Skip to content

Instantly share code, notes, and snippets.

@Dragorn421
Created March 18, 2022 12:05
Show Gist options
  • Save Dragorn421/4e73105907c5df1d84ed884d42cacc4f to your computer and use it in GitHub Desktop.
Save Dragorn421/4e73105907c5df1d84ed884d42cacc4f to your computer and use it in GitHub Desktop.
python script for making sense of oot decomp's setup DLs
setupDLsSource = """
{
/* SETUPDL_0 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, COMBINED, 0,
0, 0, COMBINED),
gsDPSetOtherMode(G_AD_NOISE | G_CD_NOISE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_ZB_CLD_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_1 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_OPA_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_2 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_OPA_SURF | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_3 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_4 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineLERP(PRIMITIVE, 0, SHADE, 0, 0, 0, 0, PRIMITIVE, PRIMITIVE, 0, SHADE, 0, 0, 0, 0, PRIMITIVE),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_SURF | G_RM_AA_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_5 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_SURF | G_RM_AA_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_6 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_TEX_EDGE2),
gsSPLoadGeometryMode(G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_7 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_XLU_SURF | G_RM_AA_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_SHADE__AA_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_OPA_SURF | G_RM_AA_OPA_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA__MODULATEIA2__AA__FOG_SHADE_A__XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__AA_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_OPA_SURF | G_RM_AA_OPA_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__MODULATEIA_PRIM2__AA__FOG_SHADE_A__OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIA_PRIM2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_OPA_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEI_PRIM__AA_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_OPA_SURF | G_RM_AA_OPA_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_DECALRGBA__AA_ZB_TEX_EDGE */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_TEX_EDGE | G_RM_AA_ZB_TEX_EDGE2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_DECALRGBA__AA__FOG_SHADE_A__TEX_EDGE */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_TEX_EDGE2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__MODULATEIA_PRIM2__AA__FOG_SHADE_A__XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__AA_ZB_TEX_EDGE */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_TEX_EDGE | G_RM_AA_ZB_TEX_EDGE2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__AA__FOG_SHADE_A__TEX_EDGE */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_TEX_EDGE2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_19 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | AA_EN | Z_CMP | IM_RD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__ACT_ZB_CLD_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_ZB_CLD_SURF | G_RM_ZB_CLD_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_21 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_SURF | G_RM_AA_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA__MODULATEIA2__AA__FOG_SHADE_A__XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__AA_ZB_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_OPA_SURF | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__MODULATEIA2__AA__FOG_SHADE_A__OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIA2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__MODULATEIA_PRIM2__AA__FOG_SHADE_A__OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIA_PRIM2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEI_PRIM__AA_ZB_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_OPA_SURF | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_27 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_SURF | G_RM_AA_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA_PRIM__ACT_AA_TEX_EDGE */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA_PRIM, G_CC_MODULATEIDECALA_PRIM),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_AA_TEX_EDGE | G_RM_AA_TEX_EDGE2),
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_29 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, NOISE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_PASS | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_PRIMITIVE__AA_ZB_XLU_LINE */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_LINE | G_RM_AA_ZB_XLU_LINE2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_HILITERGBA__AA_ZB_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_HILITERGBA, G_CC_HILITERGBA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_OPA_SURF | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_TEXTURE_GEN | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_HILITERGBA__AA_ZB_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_HILITERGBA, G_CC_HILITERGBA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_OPA_SURF | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR |
G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_33 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(TEXEL0, 0, PRIMITIVE, SHADE, 1, 0, TEXEL0, SHADE, ENVIRONMENT, COMBINED, TEXEL0, COMBINED,
ENVIRONMENT, COMBINED, TEXEL0, COMBINED),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_PASS | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR |
G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_DECALRGB__ACT_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_OPA_SURF | G_RM_OPA_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_DECALRGBA__AA_ZB_XLU_DECAL */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_DECAL | G_RM_AA_ZB_XLU_DECAL2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_36 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_FILL | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_37 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineLERP(PRIMITIVE, 0, SHADE, 0, 0, 0, 0, PRIMITIVE, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_38 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_SURF | G_RM_AA_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__ACT_XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_40 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(TEXEL1, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0,
COMBINED, 0, 0, 0, COMBINED),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_OPA_SURF | G_RM_OPA_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_FRONT | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_41 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_ZB_XLU_SURF | G_RM_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA_PRIM__ACT_XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA_PRIM, G_CC_MODULATEIDECALA_PRIM),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__ZB__FOG_SHADE_A__OVL_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_PASS2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_ZB_OVL_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_45 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_46 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEI_PRIM__ZB_XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_ZB_XLU_SURF | G_RM_ZB_XLU_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_PRIMITIVE__AA_XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_XLU_SURF | G_RM_AA_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_49 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineLERP(PRIMITIVE, 0, SHADE, 0, 0, 0, 0, PRIMITIVE, PRIMITIVE, 0, SHADE, 0, 0, 0, 0, PRIMITIVE),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_XLU_SURF | G_RM_AA_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__ACT_OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_OPA_SURF | G_RM_OPA_SURF2),
gsSPLoadGeometryMode(G_CULL_BACK),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_CULL_BACK),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__ACT_XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_CULL_BACK),
gsSPEndDisplayList(),
},
{
/* SETUPDL_53 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0, PRIMITIVE,
ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_OPA_SURF | G_RM_OPA_SURF2),
gsSPLoadGeometryMode(G_CULL_BACK),
gsSPEndDisplayList(),
},
{
/* SETUPDL_54 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0, PRIMITIVE,
ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_PASS | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_CULL_BACK),
gsSPEndDisplayList(),
},
{
/* SETUPDL_55 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0, PRIMITIVE,
ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_PASS | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_CULL_BACK),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__ACT_XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_PRIMITIVE__ACT_CLD_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
gsSPLoadGeometryMode(G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_58 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineLERP(PRIMITIVE, 0, SHADE, 0, PRIMITIVE, 0, SHADE, 0, PRIMITIVE, 0, SHADE, 0, PRIMITIVE, 0, SHADE,
0),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_59 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(TEXEL0, 0, PRIMITIVE, SHADE, 1, 0, TEXEL0, SHADE, ENVIRONMENT, COMBINED, TEXEL0, COMBINED,
ENVIRONMENT, COMBINED, TEXEL0, COMBINED),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_PASS | G_RM_AA_OPA_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_CULL_BACK | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR |
G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_60 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, ENVIRONMENT,
TEXEL0, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_ZB_CLD_SURF | G_RM_ZB_CLD_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_61 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, ENVIRONMENT,
TEXEL0, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0),
gsDPSetOtherMode(G_AD_NOISE | G_CD_NOISE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_ZB_CLD_SURF | G_RM_ZB_CLD_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIDECALA__MODULATEIA_PRIM2__AA__FOG_SHADE_A__OPA_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIA_PRIM2),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_OPA_SURF2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_63 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL |
GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_DECALRGBA__ACT_XLU_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2),
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_NONE | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_PASS | G_RM_XLU_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_MODULATEIA_PRIM__ACT_CLD_SURF */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_66 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
ALPHA_CVG_SEL | G_RM_PASS | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_67 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
ALPHA_CVG_SEL | G_RM_PASS | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_68 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
ALPHA_CVG_SEL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_69 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
ALPHA_CVG_SEL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
{
/* SETUPDL_70 */
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA |
ALPHA_CVG_SEL | G_RM_PASS | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
},
"""
import re
from typing import Iterable
SINGLE_CHARS_TOKENS = set("{}(),|")
class Tokenizer:
def __init__(self) -> None:
self.tokens = []
self.current_token = ""
def feed(self, source: str) -> None:
for c in source:
if c.isspace():
self.token_end()
elif c in SINGLE_CHARS_TOKENS:
self.token_end()
self.token_extend(c)
self.token_end()
else:
self.token_extend(c)
def token_end(self):
if self.current_token:
self.tokens.append(self.current_token)
self.current_token = ""
def token_extend(self, s):
self.current_token += s
NODE_TOKENS = {
"{": "}",
"(": ")",
}
def as_separated(tokens, sep_token):
args = []
cur_args = []
for child in tokens:
if child == sep_token:
args.append(cur_args)
cur_args = []
else:
cur_args.append(child)
if cur_args:
args.append(cur_args)
return args
class Node:
def __init__(self, start_token) -> None:
self.start_token = start_token
self.children = []
self.parent = None
def as_separated(self, sep_token):
return as_separated(self.children, sep_token)
def __str__(self) -> str:
childrenStr = " ".join(
"\n" + str(child) + "\n" if isinstance(child, Node) else str(child)
for child in self.children
)
if self.start_token:
return self.start_token + childrenStr + NODE_TOKENS[self.start_token]
else:
return childrenStr
class Parser:
def __init__(self) -> None:
self.root_node = Node(None)
self.cur_node = self.root_node
def feed(self, tokens: Iterable[str]) -> None:
for token in tokens:
if token in NODE_TOKENS:
self.node_push(Node(token))
elif (
self.cur_node.start_token
and token == NODE_TOKENS[self.cur_node.start_token]
):
self.node_pop()
else:
self.cur_node.children.append(token)
def node_push(self, node: Node):
self.cur_node.children.append(node)
node.parent = self.cur_node
self.cur_node = node
def node_pop(self):
self.cur_node = self.cur_node.parent
setupDLsSource_nocomments = re.sub(r"\/\*.*?\*\/", "", setupDLsSource)
tokenizer = Tokenizer()
tokenizer.feed(setupDLsSource_nocomments)
print(tokenizer.tokens)
print(
"".join(token + "\n" if token in set("{,") else token for token in tokenizer.tokens)
)
parser = Parser()
parser.feed(tokenizer.tokens)
root_node = parser.root_node
print(root_node)
setupDLs_nodes = root_node.as_separated(",")
assert all(len(setupDL_nodes) == 1 for setupDL_nodes in setupDLs_nodes)
setupDLs_nodes: list[Node] = [setupDL_nodes[0] for setupDL_nodes in setupDLs_nodes]
print(len(setupDLs_nodes), "setup DLs")
expected_cmds_names = [
"gsDPPipeSync",
"gsSPTexture",
{"gsDPSetCombineMode", "gsDPSetCombineLERP"},
"gsDPSetOtherMode",
"gsSPLoadGeometryMode",
"gsSPEndDisplayList",
]
OTHERMODE0FLAGS = {
"AD": {"G_AD_NOTPATTERN", "G_AD_DISABLE", "G_AD_NOISE"},
"CD": {"G_CD_NOISE", "G_CD_MAGICSQ", "G_CD_DISABLE"},
"CK": {"G_CK_NONE"},
"CYC": {"G_CYC_1CYCLE", "G_CYC_2CYCLE", "G_CYC_FILL"},
"TC": {"G_TC_FILT"},
"TF": {"G_TF_BILERP", "G_TF_POINT"},
"TT": {"G_TT_NONE", "G_TT_RGBA16"},
"TL": {"G_TL_TILE"},
"TD": {"G_TD_CLAMP"},
"TP": {"G_TP_PERSP", "G_TP_NONE"},
"PM": {"G_PM_NPRIMITIVE"},
}
OTHERMODE1FLAGS_setorclear = {
"ALPHA_CVG_SEL",
"CVG_X_ALPHA",
"AA_EN",
"Z_CMP",
"IM_RD",
"FORCE_BL",
"Z_UPD",
"CLR_ON_CVG",
}
OTHERMODE1FLAGS_opts = {
"AC": {"G_AC_THRESHOLD", "G_AC_NONE"},
"ZS": {"G_ZS_PIXEL"},
"CVG_DST": {"CVG_DST_FULL", "CVG_DST_SAVE"},
"ZMODE": {"ZMODE_OPA"},
}
OTHERMODE1PRESETS = {
# opa
"G_RM_OPA_SURF",
"G_RM_OPA_SURF2",
"G_RM_AA_OPA_SURF",
"G_RM_AA_OPA_SURF2",
"G_RM_AA_ZB_OPA_SURF",
"G_RM_AA_ZB_OPA_SURF2",
# xlu
"G_RM_XLU_SURF",
"G_RM_XLU_SURF2",
"G_RM_AA_XLU_SURF",
"G_RM_AA_XLU_SURF2",
"G_RM_ZB_XLU_SURF",
"G_RM_ZB_XLU_SURF2",
"G_RM_AA_ZB_XLU_SURF",
"G_RM_AA_ZB_XLU_SURF2",
"G_RM_AA_ZB_XLU_DECAL",
"G_RM_AA_ZB_XLU_DECAL2",
"G_RM_AA_ZB_XLU_LINE",
"G_RM_AA_ZB_XLU_LINE2",
# other
"G_RM_PASS",
"G_RM_NOOP",
"G_RM_NOOP2",
"G_RM_FOG_SHADE_A",
"G_RM_ZB_OVL_SURF2",
"G_RM_CLD_SURF",
"G_RM_CLD_SURF2",
"G_RM_ZB_CLD_SURF",
"G_RM_ZB_CLD_SURF2",
"G_RM_AA_TEX_EDGE",
"G_RM_AA_TEX_EDGE2",
"G_RM_AA_ZB_TEX_EDGE",
"G_RM_AA_ZB_TEX_EDGE2",
}
OTHERMODE1PRESETS_DATA1 = {
# opa
"G_RM_OPA_SURF": {
"CVG_DST": "CLAMP",
"FORCE_BL": "set",
"ZMODE": "OPA",
"blender 1": "G_BL_CLR_IN,G_BL_0,G_BL_CLR_IN,G_BL_1",
},
"G_RM_AA_OPA_SURF": {
"AA_EN": "set",
"IM_RD": "set",
"ALPHA_CVG_SEL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "OPA",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_A_MEM",
},
"G_RM_AA_ZB_OPA_SURF": {
"AA_EN": "set",
"Z_CMP": "set",
"Z_UPD": "set",
"IM_RD": "set",
"ALPHA_CVG_SEL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "OPA",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_A_MEM",
},
# xlu
"G_RM_XLU_SURF": {
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "FULL",
"ZMODE": "OPA",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_XLU_SURF": {
"AA_EN": "set",
"IM_RD": "set",
"CLR_ON_CVG": "set",
"FORCE_BL": "set",
"CVG_DST": "WRAP",
"ZMODE": "OPA",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_ZB_XLU_SURF": {
"Z_CMP": "set",
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "FULL",
"ZMODE": "XLU",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_ZB_XLU_SURF": {
"AA_EN": "set",
"Z_CMP": "set",
"IM_RD": "set",
"CLR_ON_CVG": "set",
"FORCE_BL": "set",
"CVG_DST": "WRAP",
"ZMODE": "XLU",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_ZB_XLU_DECAL": {
"AA_EN": "set",
"Z_CMP": "set",
"IM_RD": "set",
"CLR_ON_CVG": "set",
"FORCE_BL": "set",
"CVG_DST": "WRAP",
"ZMODE": "DEC",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_ZB_XLU_LINE": {
"AA_EN": "set",
"Z_CMP": "set",
"IM_RD": "set",
"CVG_X_ALPHA": "set",
"ALPHA_CVG_SEL": "set",
"FORCE_BL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "XLU",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
# other
"G_RM_PASS": {"blender 1": "G_BL_CLR_IN,G_BL_0,G_BL_CLR_IN,G_BL_1"},
"G_RM_NOOP": {"blender 1": "0,0,0,0"},
"G_RM_FOG_SHADE_A": {"blender 1": "G_BL_CLR_FOG,G_BL_A_SHADE,G_BL_CLR_IN,G_BL_1MA"},
"G_RM_CLD_SURF": {
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "SAVE",
"ZMODE": "OPA",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_ZB_CLD_SURF": {
"Z_CMP": "set",
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "SAVE",
"ZMODE": "XLU",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_TEX_EDGE": {
"AA_EN": "set",
"IM_RD": "set",
"CVG_X_ALPHA": "set",
"ALPHA_CVG_SEL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "OPA",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_A_MEM",
},
"G_RM_AA_ZB_TEX_EDGE": {
"AA_EN": "set",
"Z_CMP": "set",
"Z_UPD": "set",
"IM_RD": "set",
"CVG_X_ALPHA": "set",
"ALPHA_CVG_SEL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "OPA",
"blender 1": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_A_MEM",
},
}
OTHERMODE1PRESETS_DATA2 = {
# opa
"G_RM_OPA_SURF2": {
"CVG_DST": "CLAMP",
"FORCE_BL": "set",
"ZMODE": "OPA",
"blender 2": "G_BL_CLR_IN,G_BL_0,G_BL_CLR_IN,G_BL_1",
},
"G_RM_AA_OPA_SURF2": {
"AA_EN": "set",
"IM_RD": "set",
"ALPHA_CVG_SEL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "OPA",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_A_MEM",
},
"G_RM_AA_ZB_OPA_SURF2": {
"AA_EN": "set",
"Z_CMP": "set",
"Z_UPD": "set",
"IM_RD": "set",
"ALPHA_CVG_SEL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "OPA",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_A_MEM",
},
# xlu
"G_RM_XLU_SURF2": {
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "FULL",
"ZMODE": "OPA",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_XLU_SURF2": {
"AA_EN": "set",
"IM_RD": "set",
"CLR_ON_CVG": "set",
"FORCE_BL": "set",
"CVG_DST": "WRAP",
"ZMODE": "OPA",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_ZB_XLU_SURF2": {
"Z_CMP": "set",
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "FULL",
"ZMODE": "XLU",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_ZB_XLU_SURF2": {
"AA_EN": "set",
"Z_CMP": "set",
"IM_RD": "set",
"CLR_ON_CVG": "set",
"FORCE_BL": "set",
"CVG_DST": "WRAP",
"ZMODE": "XLU",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_ZB_XLU_DECAL2": {
"AA_EN": "set",
"Z_CMP": "set",
"IM_RD": "set",
"CLR_ON_CVG": "set",
"FORCE_BL": "set",
"CVG_DST": "WRAP",
"ZMODE": "DEC",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_ZB_XLU_LINE2": {
"AA_EN": "set",
"Z_CMP": "set",
"IM_RD": "set",
"CVG_X_ALPHA": "set",
"ALPHA_CVG_SEL": "set",
"FORCE_BL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "XLU",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
# other
"G_RM_NOOP2": {"blender 2": "0,0,0,0"},
"G_RM_ZB_OVL_SURF2": {
"Z_CMP": "set",
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "SAVE",
"ZMODE": "DEC",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_CLD_SURF2": {
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "SAVE",
"ZMODE": "OPA",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_ZB_CLD_SURF2": {
"Z_CMP": "set",
"IM_RD": "set",
"FORCE_BL": "set",
"CVG_DST": "SAVE",
"ZMODE": "XLU",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_1MA",
},
"G_RM_AA_TEX_EDGE2": {
"AA_EN": "set",
"IM_RD": "set",
"CVG_X_ALPHA": "set",
"ALPHA_CVG_SEL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "OPA",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_A_MEM",
},
"G_RM_AA_ZB_TEX_EDGE2": {
"AA_EN": "set",
"Z_CMP": "set",
"Z_UPD": "set",
"IM_RD": "set",
"CVG_X_ALPHA": "set",
"ALPHA_CVG_SEL": "set",
"CVG_DST": "CLAMP",
"ZMODE": "OPA",
"blender 2": "G_BL_CLR_IN,G_BL_A_IN,G_BL_CLR_MEM,G_BL_A_MEM",
},
}
expected_info_dict_keys = {
"gsSPTexture on",
"combiner 1 name",
"combiner 2 name",
"combiner C1 custom",
"combiner C2 custom",
"combiner A1 custom",
"combiner A2 custom",
"blender 1",
"blender 2",
"othermode1 preset 1",
"othermode1 preset 2",
}
expected_info_dict_keys |= OTHERMODE0FLAGS.keys()
expected_info_dict_keys |= OTHERMODE1FLAGS_setorclear
expected_info_dict_keys |= OTHERMODE1FLAGS_opts.keys()
setupDL_info_dicts = {}
for setupDL_index, setupDL_node in enumerate(setupDLs_nodes):
info_dict = dict()
print("\n" * 4)
print(setupDL_index, setupDL_node)
assert setupDL_node.start_token == "{"
setupDL_cmds = setupDL_node.as_separated(",")
for setupDL_cmd_i, setupDL_cmd in enumerate(setupDL_cmds):
assert len(setupDL_cmd) == 2
setupDL_cmd_name, setupDL_cmd_args_node = setupDL_cmd
assert (
setupDL_cmd_name == expected_cmds_names[setupDL_cmd_i]
if isinstance(expected_cmds_names[setupDL_cmd_i], str)
else setupDL_cmd_name in expected_cmds_names[setupDL_cmd_i]
)
print(setupDL_cmd_i, setupDL_cmd_name, setupDL_cmd_args_node)
setupDL_cmd_args = setupDL_cmd_args_node.as_separated(",")
print(setupDL_cmd_args)
if all(len(setupDL_cmd_arg) == 1 for setupDL_cmd_arg in setupDL_cmd_args):
setupDL_cmd_args_single = [
setupDL_cmd_arg[0] for setupDL_cmd_arg in setupDL_cmd_args
]
print(setupDL_cmd_args_single)
else:
setupDL_cmd_args_single = None
if (
setupDL_cmd_name == "gsDPPipeSync"
or setupDL_cmd_name == "gsSPEndDisplayList"
):
assert len(setupDL_cmd_args) == 0
elif setupDL_cmd_name == "gsSPTexture":
assert setupDL_cmd_args_single is not None
assert len(setupDL_cmd_args_single) == 5
assert setupDL_cmd_args_single[:4] == [
"0xFFFF",
"0xFFFF",
"0",
"G_TX_RENDERTILE",
]
assert setupDL_cmd_args_single[4] in {"G_ON", "G_OFF"}
info_dict["gsSPTexture on"] = setupDL_cmd_args_single[4]
elif setupDL_cmd_name == "gsDPSetCombineMode":
assert setupDL_cmd_args_single is not None
assert len(setupDL_cmd_args_single) == 2
info_dict["combiner 1 name"] = setupDL_cmd_args_single[0]
info_dict["combiner 2 name"] = setupDL_cmd_args_single[1]
info_dict["combiner C1 custom"] = ""
info_dict["combiner C2 custom"] = ""
info_dict["combiner A1 custom"] = ""
info_dict["combiner A2 custom"] = ""
elif setupDL_cmd_name == "gsDPSetCombineLERP":
assert setupDL_cmd_args_single is not None
assert len(setupDL_cmd_args_single) == 16
info_dict["combiner 1 name"] = "custom"
info_dict["combiner 2 name"] = "custom"
info_dict["combiner C1 custom"] = ",".join(setupDL_cmd_args_single[0:4])
info_dict["combiner C2 custom"] = ",".join(setupDL_cmd_args_single[4:8])
info_dict["combiner A1 custom"] = ",".join(setupDL_cmd_args_single[8:12])
info_dict["combiner A2 custom"] = ",".join(setupDL_cmd_args_single[12:16])
elif setupDL_cmd_name == "gsDPSetOtherMode":
assert len(setupDL_cmd_args) == 2
# mode 0
flags0 = as_separated(setupDL_cmd_args[0], "|")
assert all(len(flag0) == 1 for flag0 in flags0)
flags0 = [flag0[0] for flag0 in flags0]
for flag0 in flags0:
flag0_group = None
for othermode0flag_group, othermode0flags in OTHERMODE0FLAGS.items():
if flag0 in othermode0flags:
flag0_group = othermode0flag_group
break
assert flag0_group is not None
assert flag0_group not in info_dict
group_prefix = "G_" + flag0_group + "_"
assert flag0.startswith(group_prefix)
info_dict[flag0_group] = flag0[len(group_prefix) :]
# mode 1
for flag1 in OTHERMODE1FLAGS_setorclear:
info_dict[flag1] = "clear"
info_dict["CVG_DST"] = "?"
info_dict["ZMODE"] = "?"
info_dict["othermode1 preset 1"] = "?"
info_dict["othermode1 preset 2"] = "?"
custom_blender = [None, None]
for arg1 in as_separated(setupDL_cmd_args[1], "|"):
if len(arg1) == 1:
flag1 = arg1[0]
if flag1 in OTHERMODE1FLAGS_setorclear:
info_dict[flag1] = "set"
elif flag1.startswith("G_RM_"):
assert flag1 in OTHERMODE1PRESETS
if flag1.endswith("2"):
assert info_dict["othermode1 preset 2"] == "?"
info_dict["othermode1 preset 2"] = flag1
else:
assert info_dict["othermode1 preset 1"] == "?"
info_dict["othermode1 preset 1"] = flag1
else:
flag1_group = None
for (
othermode1flag_group,
othermode1flags,
) in OTHERMODE1FLAGS_opts.items():
if flag1 in othermode1flags:
flag1_group = othermode1flag_group
break
assert flag1_group is not None
if flag1_group == "CVG_DST":
assert info_dict["CVG_DST"] == "?"
group_prefix = "CVG_DST_"
elif flag1_group == "ZMODE":
assert info_dict["ZMODE"] == "?"
group_prefix = "ZMODE_"
else:
assert flag1_group not in info_dict
group_prefix = "G_" + flag1_group + "_"
assert flag1.startswith(group_prefix)
info_dict[flag1_group] = flag1[len(group_prefix) :]
else:
assert len(arg1) == 2
assert arg1[0] in {"GBL_c1", "GBL_c2"}
assert isinstance(arg1[1], Node)
macro_name = arg1[0]
macro_args = arg1[1].as_separated(",")
assert len(macro_args) == 4
assert all(len(macro_arg) for macro_arg in macro_args) == 1
macro_args = [macro_arg[0] for macro_arg in macro_args]
assert len(macro_args) == 4
blender_cycle = 0 if macro_name == "GBL_c1" else 1
custom_blender[blender_cycle] = macro_args
if custom_blender[0] is None:
info_dict["blender 1"] = "?"
else:
info_dict["blender 1"] = ",".join(custom_blender[0])
if custom_blender[1] is None:
info_dict["blender 2"] = "?"
else:
info_dict["blender 2"] = ",".join(custom_blender[1])
if info_dict["othermode1 preset 1"] != "?":
assert info_dict["othermode1 preset 1"] in OTHERMODE1PRESETS_DATA1
preset_data = OTHERMODE1PRESETS_DATA1[info_dict["othermode1 preset 1"]]
for key, val in preset_data.items():
if key in OTHERMODE1FLAGS_setorclear:
assert val == "set"
assert info_dict[key] in {"clear", val}
info_dict[key] = val
else:
assert info_dict[key] in {"?", val}
info_dict[key] = val
if info_dict["othermode1 preset 2"] != "?":
assert info_dict["othermode1 preset 2"] in OTHERMODE1PRESETS_DATA2
preset_data = OTHERMODE1PRESETS_DATA2[info_dict["othermode1 preset 2"]]
for key, val in preset_data.items():
if key in OTHERMODE1FLAGS_setorclear:
assert val == "set"
assert info_dict[key] in {"clear", val}
info_dict[key] = val
else:
assert info_dict[key] in {"?", val}
info_dict[key] = val
elif setupDL_cmd_name == "gsSPLoadGeometryMode":
...
if info_dict.keys() != expected_info_dict_keys:
print("unexpected keys:", info_dict.keys() - expected_info_dict_keys)
print("missing keys:", expected_info_dict_keys - info_dict.keys())
assert False
setupDL_info_dicts[setupDL_index] = info_dict
# setupDL_info_dicts = [setupDL_info_dicts[i] for i in range(len(setupDL_info_dicts))]
print(setupDL_info_dicts)
tsv = []
cols_key = [
"gsSPTexture on",
"combiner 1 name",
"combiner 2 name",
"combiner C1 custom",
"combiner C2 custom",
"combiner A1 custom",
"combiner A2 custom",
"AD",
"CD",
"CYC",
"TT",
"CK",
"TC",
"TF",
"TL",
"TD",
"TP",
"PM",
"othermode1 preset 1",
"othermode1 preset 2",
"AA_EN",
"IM_RD",
"FORCE_BL",
"Z_CMP",
"Z_UPD",
"ALPHA_CVG_SEL",
"CVG_X_ALPHA",
"CLR_ON_CVG",
"AC",
"ZS",
"CVG_DST",
"ZMODE",
"blender 1",
"blender 2",
]
if not (set(cols_key) == expected_info_dict_keys):
print("unexpected keys:", set(cols_key) - expected_info_dict_keys)
print("missing keys:", expected_info_dict_keys - set(cols_key))
assert set(cols_key) == expected_info_dict_keys
tsv.append("i\t" + "\t".join(cols_key))
for setupDL_i, info_dict in setupDL_info_dicts.items():
tsv.append(str(setupDL_i) + "\t" + "\t".join(info_dict[key] for key in cols_key))
with open("setupDLs_info.tsv", "w") as f:
f.writelines(l + "\n" for l in tsv)
def stripCC(cc: str):
assert cc.startswith("G_CC_")
cc = cc[len("G_CC_") :]
return cc
def stripRM(rm: str):
assert rm.startswith("G_RM_")
rm = rm[len("G_RM_") :]
if rm.endswith("2"):
rm = rm[:-1]
return rm
def mergeRM(rm1: str, rm2: str):
rm1 = stripRM(rm1)
rm2 = stripRM(rm2)
aa = rm1.startswith("AA_") or rm2.startswith("AA_")
if rm1.startswith("AA_"):
rm1 = rm1[len("AA_") :]
if rm2.startswith("AA_"):
rm2 = rm2[len("AA_") :]
zb = rm1.startswith("ZB_") or rm2.startswith("ZB_")
if rm1.startswith("ZB_"):
rm1 = rm1[len("ZB_") :]
if rm2.startswith("ZB_"):
rm2 = rm2[len("ZB_") :]
if rm1 == rm2:
rm = rm1
else:
rm = rm1 + "__" + rm2
pre = ""
if aa:
pre += "AA_"
if zb:
pre += "ZB_"
return pre + "_" + rm
def makename(info_dict: dict, lod):
rm_pre = ""
if lod >= 1:
if info_dict["CD"] == "DISABLE":
rm_pre += "CD_DISABLE__"
if info_dict["AC"] == "THRESHOLD":
rm_pre += "ACT_"
if info_dict["CYC"] == "1CYCLE":
if info_dict["combiner 1 name"] == "custom":
name = "skip (1CYC) (c1 custom)"
elif info_dict["combiner 2 name"] == "custom":
name = "skip (1CYC) (c2 custom)"
elif info_dict["othermode1 preset 1"] == "?":
name = "skip (1CYC) (othermode1 preset 1 ?)"
elif info_dict["othermode1 preset 2"] == "?":
name = "skip (1CYC) (othermode1 preset 2 ?)"
else:
assert info_dict["combiner 1 name"] == info_dict["combiner 2 name"]
assert stripRM(info_dict["othermode1 preset 1"]) == stripRM(
info_dict["othermode1 preset 2"]
)
name = (
"SETUPDL_"
+ stripCC(info_dict["combiner 1 name"])
+ "__"
+ rm_pre
+ stripRM(info_dict["othermode1 preset 1"])
)
elif info_dict["CYC"] == "2CYCLE":
if info_dict["combiner 1 name"] == "custom":
name = "skip (2CYC) (c1 custom)"
elif info_dict["combiner 2 name"] == "custom":
name = "skip (2CYC) (c2 custom)"
elif info_dict["othermode1 preset 1"] == "?":
name = "skip (2CYC) (othermode1 preset 1 ?)"
elif info_dict["othermode1 preset 2"] == "?":
name = "skip (2CYC) (othermode1 preset 2 ?)"
else:
name = "SETUPDL_"
if info_dict["combiner 2 name"] != "G_CC_PASS2":
name += (
stripCC(info_dict["combiner 1 name"])
+ "__"
+ stripCC(info_dict["combiner 2 name"])
+ "__"
)
else:
name += stripCC(info_dict["combiner 1 name"]) + "__"
name += rm_pre
if info_dict["othermode1 preset 1"] != "G_RM_PASS":
name += mergeRM(
info_dict["othermode1 preset 1"], info_dict["othermode1 preset 2"]
)
else:
name += stripRM(info_dict["othermode1 preset 2"])
else:
name = "skip (CYC)"
return name
for i in range(10):
print()
indices_by_name = dict()
names_by_index = dict()
exact_duplicates = dict()
skipped_indices = dict()
go = True
lod = 0
while go:
go_again = False
for setupDL_i, info_dict in setupDL_info_dicts.items():
name = makename(info_dict, lod)
if "skip" not in name:
if name in indices_by_name:
is_exact_duplicate = False
for i in indices_by_name[name]:
if setupDL_info_dicts[i] == setupDL_info_dicts[setupDL_i]:
if i not in exact_duplicates:
exact_duplicates[i] = set()
exact_duplicates[i].add(setupDL_i)
if setupDL_i not in exact_duplicates:
exact_duplicates[setupDL_i] = set()
exact_duplicates[setupDL_i].add(i)
is_exact_duplicate = True
if not is_exact_duplicate:
print("go again: ", setupDL_i, indices_by_name[name])
go_again = True
else:
indices_by_name[name] = set()
indices_by_name[name].add(setupDL_i)
if setupDL_i not in names_by_index:
names_by_index[setupDL_i] = name
else:
skipped_indices[setupDL_i] = name
if not go_again:
go = False
lod += 1
for inds in indices_by_name.values():
if len(inds) >= 2:
for ind in inds:
if ind in names_by_index:
del names_by_index[ind]
if lod > 10:
print("Cant make different names")
for name, inds in indices_by_name.items():
if len(inds) >= 2:
print(name, inds)
exit()
missing_indices = set(setupDL_info_dicts.keys())
print("exact_duplicates =")
for i, dups in exact_duplicates.items():
if dups != {i}:
print(i, dups)
missing_indices.discard(i)
print()
print("names_by_index =")
for i, name in names_by_index.items():
print(i, name)
missing_indices.discard(i)
print()
print("skipped_indices =")
for i, name in skipped_indices.items():
print(i, name)
missing_indices.discard(i)
print()
print("missing_indices =")
print(missing_indices)
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment