Skip to content

Commit

Permalink
Use dtk asset extractor for in-function statics as well
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Nov 7, 2024
1 parent ba5b373 commit 050cc12
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 360 deletions.
74 changes: 50 additions & 24 deletions config/GZLE01/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1039,8 +1039,8 @@ modules:
binary: assets/l_Hsand1DL.bin
header: assets/l_Hsand1DL.h
- symbol: l_matDL
binary: assets/l_matDL.bin
header: assets/l_matDL.h
binary: assets/l_matDL__d_a_bwdg.bin
header: assets/l_matDL__d_a_bwdg.h
header_type: none
custom_type: matDL

Expand Down Expand Up @@ -2155,9 +2155,10 @@ extract:
- symbol: l_bonbori2DL
binary: assets/l_bonbori2DL.bin
header: assets/l_bonbori2DL.h
# - symbol: l_matDL$5108
# binary: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.bin
# header: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.h
- symbol: l_matDL$5108
binary: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.bin
header: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.h
rename: l_matDL
- symbol: l_shadowVolDL
binary: assets/l_shadowVolDL.bin
header: assets/l_shadowVolDL.h
Expand Down Expand Up @@ -2188,28 +2189,36 @@ extract:
- symbol: l_shadowSealDL
binary: assets/l_shadowSealDL.bin
header: assets/l_shadowSealDL.h
# - symbol: l_matDL$5761
# binary: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.bin
# header: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.h
- symbol: l_matDL$5761
binary: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.bin
header: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.h
rename: l_matDL
- symbol: l_mirrorProjMat
binary: assets/l_mirrorProjMat.bin
header: assets/l_mirrorProjMat.h
# - symbol: l_backMat$6018
# binary: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.bin
# header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h

# - symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Txa_swood_bTEX.bin
# header: assets/l_Txa_swood_bTEX.h
# - symbol: l_Oba_swood_bDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Oba_swood_bDL.bin
# header: assets/l_Oba_swood_bDL.h
# - symbol: l_Oba_swood_b_cutDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Oba_swood_b_cutDL.bin
# header: assets/l_Oba_swood_b_cutDL.h
# - symbol: l_matDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_matDL.bin
# header: assets/l_matDL.h
- symbol: l_backMat$6018
binary: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.bin
header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h
rename: l_backMat

- symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Txa_swood_bTEX.bin
header: assets/l_Txa_swood_bTEX.h
rename: l_Txa_swood_bTEX
- symbol: l_Oba_swood_bDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Oba_swood_bDL.bin
header: assets/l_Oba_swood_bDL.h
rename: l_Oba_swood_bDL
- symbol: l_Oba_swood_b_cutDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Oba_swood_b_cutDL.bin
header: assets/l_Oba_swood_b_cutDL.h
rename: l_Oba_swood_b_cutDL
- symbol: l_matDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_matDL__d_wood.bin
header: assets/l_matDL__d_wood.h
rename: l_matDL
header_type: none
custom_type: matDL

- symbol: l_Txa_swood_aTEX
binary: assets/l_Txa_swood_aTEX.bin
Expand Down Expand Up @@ -2324,3 +2333,20 @@ extract:
- symbol: l_sightDL!.data:0x8038fc80
binary: assets/l_sightDL__d_a_player_main.bin
header: assets/l_sightDL__d_a_player_main.h

- symbol: l_invisibleMat$7212
binary: assets/l_invisibleMat__draw__19mDoExt_invJntPacketFv.bin
header: assets/l_invisibleMat__draw__19mDoExt_invJntPacketFv.h
rename: l_invisibleMat
- symbol: l_matDL!.data:0x80371860
binary: assets/l_matDL__m_Do_ext.bin
header: assets/l_matDL__m_Do_ext.h
- symbol: l_toonMatDL
binary: assets/l_toonMatDL.bin
header: assets/l_toonMatDL.h
- symbol: l_mat1DL
binary: assets/l_mat1DL.bin
header: assets/l_mat1DL.h
- symbol: l_toonMat1DL
binary: assets/l_toonMat1DL.bin
header: assets/l_toonMat1DL.h
74 changes: 50 additions & 24 deletions config/GZLJ01/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ modules:
binary: assets/l_Hsand1DL.bin
header: assets/l_Hsand1DL.h
- symbol: l_matDL
binary: assets/l_matDL.bin
header: assets/l_matDL.h
binary: assets/l_matDL__d_a_bwdg.bin
header: assets/l_matDL__d_a_bwdg.h
header_type: none
custom_type: matDL

Expand Down Expand Up @@ -1739,9 +1739,10 @@ extract:
- symbol: l_bonbori2DL
binary: assets/l_bonbori2DL.bin
header: assets/l_bonbori2DL.h
# - symbol: l_matDL$5108
# binary: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.bin
# header: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.h
- symbol: l_matDL$5108
binary: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.bin
header: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.h
rename: l_matDL
- symbol: l_shadowVolDL
binary: assets/l_shadowVolDL.bin
header: assets/l_shadowVolDL.h
Expand Down Expand Up @@ -1772,28 +1773,36 @@ extract:
- symbol: l_shadowSealDL
binary: assets/l_shadowSealDL.bin
header: assets/l_shadowSealDL.h
# - symbol: l_matDL$5761
# binary: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.bin
# header: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.h
- symbol: l_matDL$5761
binary: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.bin
header: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.h
rename: l_matDL
- symbol: l_mirrorProjMat
binary: assets/l_mirrorProjMat.bin
header: assets/l_mirrorProjMat.h
# - symbol: l_backMat$6016
# binary: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.bin
# header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h

# - symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Txa_swood_bTEX.bin
# header: assets/l_Txa_swood_bTEX.h
# - symbol: l_Oba_swood_bDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Oba_swood_bDL.bin
# header: assets/l_Oba_swood_bDL.h
# - symbol: l_Oba_swood_b_cutDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Oba_swood_b_cutDL.bin
# header: assets/l_Oba_swood_b_cutDL.h
# - symbol: l_matDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_matDL.bin
# header: assets/l_matDL.h
- symbol: l_backMat$6016
binary: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.bin
header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h
rename: l_backMat

- symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Txa_swood_bTEX.bin
header: assets/l_Txa_swood_bTEX.h
rename: l_Txa_swood_bTEX
- symbol: l_Oba_swood_bDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Oba_swood_bDL.bin
header: assets/l_Oba_swood_bDL.h
rename: l_Oba_swood_bDL
- symbol: l_Oba_swood_b_cutDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Oba_swood_b_cutDL.bin
header: assets/l_Oba_swood_b_cutDL.h
rename: l_Oba_swood_b_cutDL
- symbol: l_matDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_matDL__d_wood.bin
header: assets/l_matDL__d_wood.h
rename: l_matDL
header_type: none
custom_type: matDL

- symbol: l_Txa_swood_aTEX
binary: assets/l_Txa_swood_aTEX.bin
Expand Down Expand Up @@ -1908,3 +1917,20 @@ extract:
- symbol: l_sightDL!.data:0x80383320
binary: assets/l_sightDL__d_a_player_main.bin
header: assets/l_sightDL__d_a_player_main.h

- symbol: l_invisibleMat$7242
binary: assets/l_invisibleMat__draw__19mDoExt_invJntPacketFv.bin
header: assets/l_invisibleMat__draw__19mDoExt_invJntPacketFv.h
rename: l_invisibleMat
- symbol: l_matDL!.data:0x80364d00
binary: assets/l_matDL__m_Do_ext.bin
header: assets/l_matDL__m_Do_ext.h
- symbol: l_toonMatDL
binary: assets/l_toonMatDL.bin
header: assets/l_toonMatDL.h
- symbol: l_mat1DL
binary: assets/l_mat1DL.bin
header: assets/l_mat1DL.h
- symbol: l_toonMat1DL
binary: assets/l_toonMat1DL.bin
header: assets/l_toonMat1DL.h
74 changes: 50 additions & 24 deletions config/GZLP01/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ modules:
binary: assets/l_Hsand1DL.bin
header: assets/l_Hsand1DL.h
- symbol: l_matDL
binary: assets/l_matDL.bin
header: assets/l_matDL.h
binary: assets/l_matDL__d_a_bwdg.bin
header: assets/l_matDL__d_a_bwdg.h
header_type: none
custom_type: matDL

Expand Down Expand Up @@ -1751,9 +1751,10 @@ extract:
- symbol: l_bonbori2DL
binary: assets/l_bonbori2DL.bin
header: assets/l_bonbori2DL.h
# - symbol: l_matDL$5108
# binary: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.bin
# header: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.h
- symbol: l_matDL$5108
binary: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.bin
header: assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.h
rename: l_matDL
- symbol: l_shadowVolDL
binary: assets/l_shadowVolDL.bin
header: assets/l_shadowVolDL.h
Expand Down Expand Up @@ -1784,28 +1785,36 @@ extract:
- symbol: l_shadowSealDL
binary: assets/l_shadowSealDL.bin
header: assets/l_shadowSealDL.h
# - symbol: l_matDL$5761
# binary: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.bin
# header: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.h
- symbol: l_matDL$5761
binary: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.bin
header: assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.h
rename: l_matDL
- symbol: l_mirrorProjMat
binary: assets/l_mirrorProjMat.bin
header: assets/l_mirrorProjMat.h
# - symbol: l_backMat$6018
# binary: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.bin
# header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h

# - symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Txa_swood_bTEX.bin
# header: assets/l_Txa_swood_bTEX.h
# - symbol: l_Oba_swood_bDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Oba_swood_bDL.bin
# header: assets/l_Oba_swood_bDL.h
# - symbol: l_Oba_swood_b_cutDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_Oba_swood_b_cutDL.bin
# header: assets/l_Oba_swood_b_cutDL.h
# - symbol: l_matDL__Q25dWood20@unnamed@d_wood_cpp@
# binary: assets/l_matDL.bin
# header: assets/l_matDL.h
- symbol: l_backMat$6018
binary: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.bin
header: assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h
rename: l_backMat

- symbol: l_Txa_swood_bTEX__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Txa_swood_bTEX.bin
header: assets/l_Txa_swood_bTEX.h
rename: l_Txa_swood_bTEX
- symbol: l_Oba_swood_bDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Oba_swood_bDL.bin
header: assets/l_Oba_swood_bDL.h
rename: l_Oba_swood_bDL
- symbol: l_Oba_swood_b_cutDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_Oba_swood_b_cutDL.bin
header: assets/l_Oba_swood_b_cutDL.h
rename: l_Oba_swood_b_cutDL
- symbol: l_matDL__Q25dWood20@unnamed@d_wood_cpp@
binary: assets/l_matDL__d_wood.bin
header: assets/l_matDL__d_wood.h
rename: l_matDL
header_type: none
custom_type: matDL

- symbol: l_Txa_swood_aTEX
binary: assets/l_Txa_swood_aTEX.bin
Expand Down Expand Up @@ -1920,3 +1929,20 @@ extract:
- symbol: l_sightDL!.data:0x80396960
binary: assets/l_sightDL__d_a_player_main.bin
header: assets/l_sightDL__d_a_player_main.h

- symbol: l_invisibleMat$7212
binary: assets/l_invisibleMat__draw__19mDoExt_invJntPacketFv.bin
header: assets/l_invisibleMat__draw__19mDoExt_invJntPacketFv.h
rename: l_invisibleMat
- symbol: l_matDL!.data:0x80378540
binary: assets/l_matDL__m_Do_ext.bin
header: assets/l_matDL__m_Do_ext.h
- symbol: l_toonMatDL
binary: assets/l_toonMatDL.bin
header: assets/l_toonMatDL.h
- symbol: l_mat1DL
binary: assets/l_mat1DL.bin
header: assets/l_mat1DL.h
- symbol: l_toonMat1DL
binary: assets/l_toonMat1DL.bin
header: assets/l_toonMat1DL.h
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ def emit_build_rule(asset):
"inputs": out_dir / "bin" / asset["binary"],
"outputs": out_dir / "include" / asset["header"],
"variables": {
"symbol": asset["symbol"],
"symbol": asset.get("rename") or asset["symbol"],
"scope": custom_data.get("scope", "local")
},
"implicit": Path("tools/converters/matDL_dis.py"),
Expand Down
4 changes: 2 additions & 2 deletions src/d/actor/d_a_bwdg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const u16 l_B_sand2TEX__width = 512;
const u16 l_B_sand2TEX__height = 256;
#include "assets/l_texCoord.h"
#include "assets/l_Hsand1DL.h"
#include "assets/l_matDL.h"
l_matDL(l_B_sand2TEX);
#include "assets/l_matDL__d_a_bwdg.h"
l_matDL__d_a_bwdg(l_B_sand2TEX);

// Fakematch: These are supposed to be in-function statics inside daBwdg_packet_c::draw().
// But for some reason, defining them inside the function causes the function to load them as well
Expand Down
36 changes: 3 additions & 33 deletions src/d/d_drawlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,16 +1137,7 @@ BOOL dDlst_alphaModel_c::draw(Mtx mtx) {
if (mNum == 0)
return FALSE;

// #include "assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.h"
static char l_matDL[] ALIGN_DECL(32) = {
0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0A, 0x00,
0x00, 0x00, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFC, 0x61, 0xC1,
0x08, 0xFF, 0xD0, 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x61, 0xEE,
0x00, 0x00, 0x00, 0x61, 0xEF, 0x00, 0x00, 0x00, 0x61, 0xF0, 0x00, 0x00, 0x00, 0x61, 0xF1,
0x00, 0x00, 0x00, 0x61, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#include "assets/l_matDL__draw__18dDlst_alphaModel_cFPA4_f.h"

static GXVtxDescList l_vtxDescList[] = {
{GX_VA_POS, GX_INDEX8},
Expand Down Expand Up @@ -1716,18 +1707,7 @@ void dDlst_shadowControl_c::reset() {

/* 80084DEC-80084EF0 .text imageDraw__21dDlst_shadowControl_cFPA4_f */
void dDlst_shadowControl_c::imageDraw(Mtx mtx) {
// #include "assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.h"
static char l_matDL[] ALIGN_DECL(32) = {
0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00,
0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0C, 0x80, 0x80, 0x80, 0x80, 0x61, 0x28, 0x38,
0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFA, 0x61, 0xC1, 0x08, 0xFF, 0xF0, 0x61, 0x43, 0x00,
0x00, 0x41, 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x40, 0x10,
0x61, 0xEE, 0x00, 0x00, 0x00, 0x61, 0xEF, 0x00, 0x00, 0x00, 0x61, 0xF0, 0x00, 0x00, 0x00,
0x61, 0xF1, 0x00, 0x00, 0x00, 0x61, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#include "assets/l_matDL__imageDraw__21dDlst_shadowControl_cFPA4_f.h"

GXSetViewport(0.0f, 0.0f, 256.0f, 256.0f, 0.0f, 1.0f);
GXSetScissor(0, 0, 0x100, 0x100);
Expand Down Expand Up @@ -2013,17 +1993,7 @@ void dDlst_alphaVolPacket::draw() {

/* 80085AF4-80085BBC .text draw__23dDlst_alphaInvVolPacketFv */
void dDlst_alphaInvVolPacket::draw() {
// #include "assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h"
static char l_backMat[] ALIGN_DECL(32) = {
0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00,
0x00, 0x04, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xFF, 0x61, 0xC1,
0x08, 0xFF, 0x90, 0x61, 0x43, 0x00, 0x00, 0x41, 0x61, 0x40, 0x00, 0x00, 0x07, 0x61, 0x41,
0x00, 0x01, 0x14, 0x61, 0xF3, 0x7F, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00,
0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x80,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
};
#include "assets/l_backMat__draw__23dDlst_alphaInvVolPacketFv.h"

GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GXClearVtxDesc();
Expand Down
Loading

0 comments on commit 050cc12

Please sign in to comment.