From 41698a131a1794d08e5246b8d685d761998c15ed Mon Sep 17 00:00:00 2001 From: Alejandro Asenjo Nitti <96613413+sonicdcer@users.noreply.github.com> Date: Sun, 18 Feb 2024 22:34:56 -0300 Subject: [PATCH] Extract ast_warp_zone (#136) * try * progress * hasta la vista, baby * ast_warp_zone matching * remove symbols from linker * new version of Torch * ast_warp_zone --- .gitignore | 2 ++ .vscode/settings.json | 1 + Makefile | 1 + assets/yaml/us/ast_logo.yml | 7 ++++- assets/yaml/us/ast_warp_zone.yaml | 43 +++++++++++++++++++++++++++++ config.yml | 3 +- include/assets.h | 8 +++--- include/assets/ast_logo.h | 10 ------- include/assets/ast_warp_zone.h | 8 ------ include/fox_enmy2_assets.h | 6 ---- linker_scripts/us/undefined_syms.ld | 5 ---- src/main/fox_enmy2.c | 1 + tools/Torch | 2 +- yamls/us/assets.yaml | 8 ++++-- 14 files changed, 67 insertions(+), 38 deletions(-) create mode 100644 assets/yaml/us/ast_warp_zone.yaml delete mode 100644 include/assets/ast_logo.h delete mode 100644 include/assets/ast_warp_zone.h diff --git a/.gitignore b/.gitignore index 0363660f..4cfcb3e5 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ ctx.c.m2c *.bin src/assets/* !src/assets/ast_radio.c +include/assets/* +!include/assets/ast_radio.h /build tools/mio0 tools/ido-recomp diff --git a/.vscode/settings.json b/.vscode/settings.json index 5e56c2af..a3656898 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -63,6 +63,7 @@ "fox_option_assets.h": "c", "mods.h": "c", "i5.h": "c", + "ast_warp_zone.h": "c" "sf64audio_provisional.h": "c" }, "C_Cpp_Runner.msvcBatchPath": "" diff --git a/Makefile b/Makefile index 4462a70e..13b6d1e4 100644 --- a/Makefile +++ b/Makefile @@ -435,6 +435,7 @@ extract: assets: @echo "Extracting assets..." @$(TORCH) code $(BASEROM_UNCOMPRESSED) + @$(TORCH) header $(BASEROM_UNCOMPRESSED) clean: @git clean -fdx asm/ diff --git a/assets/yaml/us/ast_logo.yml b/assets/yaml/us/ast_logo.yml index 7d618310..0792954a 100644 --- a/assets/yaml/us/ast_logo.yml +++ b/assets/yaml/us/ast_logo.yml @@ -2,7 +2,12 @@ segments: seg15: 0xD25100 header: - - '#include "assets/ast_logo.h"' + code: + - '#include "assets/ast_logo.h"' + header: + - '#include "gfx.h"' + - '#include "sf64object.h"' + - '#include "structs.h"' nintendo_logo: type: TEXTURE diff --git a/assets/yaml/us/ast_warp_zone.yaml b/assets/yaml/us/ast_warp_zone.yaml new file mode 100644 index 00000000..63b69b4b --- /dev/null +++ b/assets/yaml/us/ast_warp_zone.yaml @@ -0,0 +1,43 @@ +:config: + segments: + seg7: 0xBFA740 + header: + code: + - '#include "assets/ast_warp_zone.h"' + header: + - '#include "gfx.h"' + - '#include "sf64object.h"' + - '#include "structs.h"' + +D_7000000: + { type: GFX, offset: 0x7000000, symbol: D_7000000 } + +D_7000280: + { type: GFX, offset: 0x7000280, symbol: D_7000280 } + +D_70008F0: + { type: GFX, offset: 0x70008F0, symbol: D_70008F0 } + +D_7000260: + { type: TEXTURE, ctype: u8, format: RGBA16, width: 4, height: 4, offset: 0x7000260, symbol: D_7000260 } + +D_7000A30: + { type: TEXTURE, ctype: u8, format: CI4, width: 32, height: 32, offset: 0x7000A30, symbol: D_7000A30, tlut: 0x7000C30 } + +D_7000C30: + { type: TEXTURE, ctype: u8, format: TLUT, colors: 8, offset: 0x7000C30, symbol: D_7000C30 } + +D_7000C40: + { type: GFX, offset: 0x7000C40, symbol: D_7000C40 } + +D_7000E80: + { type: GFX, offset: 0x7000E80, symbol: D_7000E80 } + +D_70010E0: + { type: GFX, offset: 0x70010E0, symbol: D_70010E0 } + +D_7001540: + { type: GFX, offset: 0x7001540, symbol: D_7001540 } + +D_70015D0: + { type: TEXTURE, ctype: u8, format: RGBA16, width: 32, height: 32, offset: 0x70015D0, symbol: D_70015D0 } \ No newline at end of file diff --git a/config.yml b/config.yml index bc5df76d..9be921c3 100644 --- a/config.yml +++ b/config.yml @@ -8,4 +8,5 @@ f7475fb11e7e6830f82883412638e8390791ab87: sort: OFFSET output: binary: lylat.otr - code: src/assets \ No newline at end of file + code: src/assets + headers: include/assets \ No newline at end of file diff --git a/include/assets.h b/include/assets.h index 3e2ad210..8aca195a 100644 --- a/include/assets.h +++ b/include/assets.h @@ -946,10 +946,10 @@ extern Gfx D_60185E0[]; extern Gfx D_6017550[]; // ast_7_ti_2, ast_7_ti_1, ast_warp_zone, ast_versus, ast_ending -extern u8 D_7000F10[]; -extern u8 D_7001030[]; -extern u8 D_7001270[]; -extern Gfx D_7001540[]; +extern u8 D_7000F10[]; // fox_option +extern u8 D_7001030[]; // fox_option +extern u8 D_7001270[]; // fox_option +extern Gfx D_7001540[]; // fox_bg extern u8 D_7001DF0[]; extern u8 D_7002110[]; extern u8 D_7003650[]; diff --git a/include/assets/ast_logo.h b/include/assets/ast_logo.h deleted file mode 100644 index e6588db4..00000000 --- a/include/assets/ast_logo.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef AST_LOGO_H -#define AST_LOGO_H - -#include "gfx.h" -#include "sf64object.h" -#include "structs.h" - -extern u8 gNintendoLogo[]; - -#endif diff --git a/include/assets/ast_warp_zone.h b/include/assets/ast_warp_zone.h deleted file mode 100644 index e69ccb18..00000000 --- a/include/assets/ast_warp_zone.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef AST_WARP_ZONE_H -#define AST_WARP_ZONE_H - -#include "gfx.h" -#include "sf64object.h" -#include "structs.h" - -#endif diff --git a/include/fox_enmy2_assets.h b/include/fox_enmy2_assets.h index 56a17fce..37aece2b 100644 --- a/include/fox_enmy2_assets.h +++ b/include/fox_enmy2_assets.h @@ -65,12 +65,6 @@ extern Gfx D_9012180[]; extern Gfx D_900EFC0[]; extern Gfx D_601C520[]; extern Gfx D_600AF40[]; -extern Gfx D_7000000[]; -extern Gfx D_7000C40[]; -extern Gfx D_70010E0[]; -extern Gfx D_7000E80[]; -extern Gfx D_70008F0[]; -extern Gfx D_7000280[]; extern Gfx D_600AC70[]; extern Gfx D_601A2B0[]; extern Gfx D_6002500[]; diff --git a/linker_scripts/us/undefined_syms.ld b/linker_scripts/us/undefined_syms.ld index 99f66316..f9f94295 100644 --- a/linker_scripts/us/undefined_syms.ld +++ b/linker_scripts/us/undefined_syms.ld @@ -1071,11 +1071,6 @@ D_60205D0 = 0x060205D0; D_9012180 = 0x09012180; D_900EFC0 = 0x0900EFC0; D_601C520 = 0x0601C520; -D_7000C40 = 0x07000C40; -D_70010E0 = 0x070010E0; -D_7000E80 = 0x07000E80; -D_70008F0 = 0x070008F0; -D_7000280 = 0x07000280; D_600AC70 = 0x0600AC70; D_6002500 = 0x06002500; D_60043F0 = 0x060043F0; diff --git a/src/main/fox_enmy2.c b/src/main/fox_enmy2.c index 132112c3..2d61f953 100644 --- a/src/main/fox_enmy2.c +++ b/src/main/fox_enmy2.c @@ -5,6 +5,7 @@ s32 D_800CFF90 = 0; s32 D_80161690; #include "fox_enmy2_assets.h" +#include "assets/ast_warp_zone.h" void func_8006A7B0(u16* msg, s32 character) { PRINTF("Enm->obj.pos.y + tmp_xyz.y=<%10.3f>\n"); diff --git a/tools/Torch b/tools/Torch index 5b1e5d63..56ade56c 160000 --- a/tools/Torch +++ b/tools/Torch @@ -1 +1 @@ -Subproject commit 5b1e5d632b44cd13282ce98d8dd3c11a5c86d598 +Subproject commit 56ade56c1236adcefddf1e97fffee0b1555c0877 diff --git a/yamls/us/assets.yaml b/yamls/us/assets.yaml index f62c9c90..0c8d1f2d 100644 --- a/yamls/us/assets.yaml +++ b/yamls/us/assets.yaml @@ -147,8 +147,12 @@ start: 0xBC23D0 - name: ast_warp_zone #7 - type: bin + type: code + dir: assets start: 0xBFA740 + vram: 0x07000000 + subsegments: + - [0xBFA740, .data, ast_warp_zone/ast_warp_zone] - name: ast_title #6 type: bin @@ -184,7 +188,7 @@ start: 0xD25100 vram: 0x0F000000 subsegments: - - [0xD25100, .data, ast_logo/bin] + - [0xD25100, .data, ast_logo/ast_logo] - name: ast_ending #7 type: bin