From 1c204a0151b767ab2f57811e607a2f66abfc2f38 Mon Sep 17 00:00:00 2001 From: Alejandro Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:19:57 -0300 Subject: [PATCH] Export configuration for ast_bg_planet (#145) * Matching * remove unnecessary header * fix * add rule to extract textures as PNGs --- Makefile | 1 + assets/yaml/us/ast_bg_planet.yaml | 130 ++++++++++++++++++++++++++++++ include/assets.h | 21 ----- include/assets/ast_bg_planet.h | 8 -- src/main/fox_bg.c | 2 + src/main/fox_effect.c | 7 +- src/main/fox_hud.c | 1 + src/overlays/ovl_i3/fox_so.c | 2 + src/overlays/ovl_i5/fox_ti.c | 2 + yamls/us/assets.yaml | 6 +- 10 files changed, 147 insertions(+), 33 deletions(-) create mode 100644 assets/yaml/us/ast_bg_planet.yaml delete mode 100644 include/assets/ast_bg_planet.h diff --git a/Makefile b/Makefile index 01bcb84e..21a992fc 100644 --- a/Makefile +++ b/Makefile @@ -441,6 +441,7 @@ assets: @echo "Extracting assets..." @$(TORCH) code $(BASEROM_UNCOMPRESSED) @$(TORCH) header $(BASEROM_UNCOMPRESSED) + @$(TORCH) modding export $(BASEROM_UNCOMPRESSED) clean: @git clean -fdx asm/ diff --git a/assets/yaml/us/ast_bg_planet.yaml b/assets/yaml/us/ast_bg_planet.yaml new file mode 100644 index 00000000..69a619d8 --- /dev/null +++ b/assets/yaml/us/ast_bg_planet.yaml @@ -0,0 +1,130 @@ +:config: + segments: + seg2: 0x8AE0A0 + header: + code: + - '#include "assets/ast_bg_planet.h"' + header: + - '#include "gfx.h"' + - '#include "sf64object.h"' + - '#include "structs.h"' + +D_BG_PLANET_2000000: + { type: GFX, offset: 0x2000000, symbol: D_BG_PLANET_2000000 } + +D_BG_PLANET_2000088: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x2000088, symbol: D_BG_PLANET_2000088, pad: 8 } + +D_2001090: + { type: GFX, offset: 0x2001090, symbol: D_2001090 } + +D_2001118: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x02001118, symbol: D_2001118, pad: 8 } + +D_2002120: + { type: GFX, offset: 0x2002120, symbol: D_2002120 } + +D_20021A8: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x020021A8, symbol: D_20021A8, pad: 8 } + +D_20031B0: + { type: GFX, offset: 0x20031B0, symbol: D_20031B0 } + +D_2003238: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x02003238, symbol: D_2003238, pad: 8 } + +D_2004240: + { type: GFX, offset: 0x2004240, symbol: D_2004240 } + +D_20042C8: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x020042C8, symbol: D_20042C8, pad: 8 } + +D_20052D0: + { type: GFX, offset: 0x20052D0, symbol: D_20052D0 } + +D_2005358: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x02005358, symbol: D_2005358, pad: 8 } + +D_2006360: + { type: GFX, offset: 0x2006360, symbol: D_2006360 } + +D_20063E8: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x020063E8, symbol: D_20063E8, pad: 8 } + +D_20073F0: + { type: GFX, offset: 0x20073F0, symbol: D_20073F0 } + +D_2007478: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x02007478, symbol: D_2007478, pad: 8 } + +D_2008480: + { type: GFX, offset: 0x2008480, symbol: D_2008480 } + +D_2008508: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x02008508, symbol: D_2008508, pad: 8 } + +D_2009510: + { type: GFX, offset: 0x2009510, symbol: D_2009510 } + +D_2009598: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x02009598, symbol: D_2009598, pad: 8 } + +D_200A5A0: + { type: GFX, offset: 0x200A5A0, symbol: D_200A5A0 } + +D_200A628: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x0200A628, symbol: D_200A628, pad: 8 } + +D_200B630: + { type: GFX, offset: 0x200B630, symbol: D_200B630 } + +D_200B6B8: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x0200B6B8, symbol: D_200B6B8, pad: 8 } + +D_200C6C0: + { type: GFX, offset: 0x200C6C0, symbol: D_200C6C0 } + +D_200C748: + { type: TEXTURE, ctype: u32, format: RGBA32, width: 32, height: 32, offset: 0x0200C748, symbol: D_200C748, pad: 8 } + +D_200D750: + { type: GFX, offset: 0x200D750, symbol: D_200D750 } + +D_200D7E8: + { type: TEXTURE, ctype: u16, format: IA16, width: 64, height: 32, offset: 0x0200D7E8, symbol: D_200D7E8, pad: 8 } + +D_200E7F0: + { type: GFX, offset: 0x200E7F0, symbol: D_200E7F0 } + +D_200E878: + { type: TEXTURE, ctype: u16, format: IA16, width: 32, height: 32, offset: 0x0200E878, symbol: D_200E878, pad: 8 } + +D_200F080: + { type: GFX, offset: 0x200F080, symbol: D_200F080 } + +D_200F108: + { type: TEXTURE, ctype: u16, format: IA16, width: 32, height: 32, offset: 0x0200F108, symbol: D_200F108, pad: 8 } + +D_200F910: + { type: GFX, offset: 0x200F910, symbol: D_200F910 } + +D_200F998: + { type: TEXTURE, ctype: u16, format: IA16, width: 32, height: 32, offset: 0x0200F998, symbol: D_200F998, pad: 8 } + +D_20101A0: + { type: GFX, offset: 0x20101A0, symbol: D_20101A0 } + +D_2010228: + { type: TEXTURE, ctype: u16, format: IA16, width: 32, height: 32, offset: 0x02010228, symbol: D_2010228, pad: 8 } + +D_2010A30: + { type: GFX, offset: 0x2010A30, symbol: D_2010A30 } + +D_2010AB8: + { type: TEXTURE, ctype: u16, format: IA16, width: 32, height: 32, offset: 0x02010AB8, symbol: D_2010AB8, pad: 8 } + +D_20112C0: + { type: GFX, offset: 0x20112C0, symbol: D_20112C0 } + +D_2011358: + { type: TEXTURE, ctype: u16, format: IA16, width: 32, height: 32, offset: 0x02011358, symbol: D_2011358, pad: 8 } \ No newline at end of file diff --git a/include/assets.h b/include/assets.h index 6306b8d3..644c92a2 100644 --- a/include/assets.h +++ b/include/assets.h @@ -88,27 +88,6 @@ extern Gfx D_1031630[]; extern Gfx D_1031EC0[]; extern Gfx D_1032780[]; -// ast_bg_planet -extern Gfx D_2001090[]; -extern Gfx D_2002120[]; -extern Gfx D_20031B0[]; -extern Gfx D_2004240[]; -extern Gfx D_20052D0[]; -extern Gfx D_2006360[]; -extern Gfx D_20073F0[]; -extern Gfx D_2008480[]; -extern Gfx D_2009510[]; -extern Gfx D_200A5A0[]; -extern Gfx D_200B630[]; -extern Gfx D_200C6C0[]; -extern Gfx D_200D750[]; -extern Gfx D_200E7F0[]; -extern Gfx D_200F080[]; -extern Gfx D_200F910[]; -extern Gfx D_20101A0[]; -extern Gfx D_2010A30[]; -extern Gfx D_20112C0[]; - // ast_arwing, ast_landmaster, ast_blue_marine, ast_vs_player extern Gfx D_3006940[]; extern Gfx D_301AD60[]; diff --git a/include/assets/ast_bg_planet.h b/include/assets/ast_bg_planet.h deleted file mode 100644 index f18c0db9..00000000 --- a/include/assets/ast_bg_planet.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef AST_BG_PLANET_H -#define AST_BG_PLANET_H - -#include "gfx.h" -#include "sf64object.h" -#include "structs.h" - -#endif diff --git a/src/main/fox_bg.c b/src/main/fox_bg.c index f9714035..f4ad26ee 100644 --- a/src/main/fox_bg.c +++ b/src/main/fox_bg.c @@ -16,6 +16,8 @@ f32 D_8015F984; UNK_TYPE D_8015F988[0x683]; // Unused? Close to being [13][0x80] f32 D_80161394; // can be static +#include "assets/ast_bg_planet.h" + f32 D_800C9C30 = 0.0f; u16 D_800C9C34 = 1; s32 D_800C9C38 = 0; // unused? diff --git a/src/main/fox_effect.c b/src/main/fox_effect.c index 1431d4dc..7cbff95b 100644 --- a/src/main/fox_effect.c +++ b/src/main/fox_effect.c @@ -36,6 +36,7 @@ extern Gfx D_601BAD0[]; extern Gfx D_9013C20[]; #include "assets/ast_bg_space.h" +#include "assets/ast_bg_planet.h" void BonusText_Display(f32 xPos, f32 yPos, f32 zPos, s32 hits) { s32 i; @@ -2031,9 +2032,9 @@ void func_8007D2F4(Effect* effect) { } Gfx* D_800D17A4[] = { - D_200B630, D_200B630, D_200B630, D_200B630, D_200A5A0, D_2009510, D_2008480, - D_20073F0, D_2006360, D_200C6C0, D_20052D0, D_2004240, D_20031B0, D_2002120, - D_2001090, D_2000000, D_2010A30, D_20101A0, D_200F910, D_200F080, D_200E7F0, + D_200B630, D_200B630, D_200B630, D_200B630, D_200A5A0, D_2009510, D_2008480, + D_20073F0, D_2006360, D_200C6C0, D_20052D0, D_2004240, D_20031B0, D_2002120, + D_2001090, D_BG_PLANET_2000000, D_2010A30, D_20101A0, D_200F910, D_200F080, D_200E7F0, }; f32 D_800D17F8[] = { diff --git a/src/main/fox_hud.c b/src/main/fox_hud.c index 95981a8d..ae33c427 100644 --- a/src/main/fox_hud.c +++ b/src/main/fox_hud.c @@ -147,6 +147,7 @@ extern Gfx D_6003090[]; extern u8 D_C000A80[]; #include "assets/ast_bg_space.h" +#include "assets/ast_bg_planet.h" // DATA SECTION START diff --git a/src/overlays/ovl_i3/fox_so.c b/src/overlays/ovl_i3/fox_so.c index 5c315854..0ccd65e7 100644 --- a/src/overlays/ovl_i3/fox_so.c +++ b/src/overlays/ovl_i3/fox_so.c @@ -165,6 +165,8 @@ s32 D_i3_801C2740[10]; f32 D_i3_801C2768[14]; s32 D_i3_801C27A0[8]; // unused? part of previous? +#include "assets/ast_bg_planet.h" + void func_i3_8019E7F0(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scale2) { Effect_Initialize(effect); effect->obj.status = OBJ_ACTIVE; diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c index 26a5b1c2..e37632f5 100644 --- a/src/overlays/ovl_i5/fox_ti.c +++ b/src/overlays/ovl_i5/fox_ti.c @@ -67,6 +67,8 @@ UnkStruct_i5_801BD738 D_i5_801BD738[3][9]; PosRot D_i5_801BDA30[10]; f32 D_i5_801BDB20[3][151]; +#include "assets/ast_bg_planet.h" + static f32 D_i5_801B7360[25][4] = { { 165.0f, 120.0f, 0.0f, 90.0f }, { 127.5f, 7.5f, 0.0f, 90.0f }, { 7.5f, -112.5f, 0.0f, 90.0f }, { 255.0f, 285.0f, -60.0f, 60.0f }, { 255.0f, 285.0f, 60.0f, 60.0f }, { 247.5f, 120.0f, -90.0f, 75.0f }, diff --git a/yamls/us/assets.yaml b/yamls/us/assets.yaml index b3601573..cbcd7271 100644 --- a/yamls/us/assets.yaml +++ b/yamls/us/assets.yaml @@ -26,8 +26,12 @@ - name: ast_bg_planet exclusive_ram_id: segment_02 - type: bin + type: code + dir: assets start: 0x8AE0A0 + vram: 0x02000000 + subsegments: + - [0x8AE0A0, .data, ast_bg_planet/ast_bg_planet] - name: ast_arwing exclusive_ram_id: segment_03