From d586b5cb4ed1781087ed4ec59ff16fe40b380897 Mon Sep 17 00:00:00 2001 From: RevoSucks Date: Sat, 19 Aug 2023 20:04:14 -0400 Subject: [PATCH] add fragments header and use linker symbols --- include/fragments.h | 389 ++++++++++++++++++++++++++++++++++++++++++++ splat.yaml | 7 + src/E1C0.c | 9 +- 3 files changed, 400 insertions(+), 5 deletions(-) create mode 100644 include/fragments.h diff --git a/include/fragments.h b/include/fragments.h new file mode 100644 index 00000000..f8525c6c --- /dev/null +++ b/include/fragments.h @@ -0,0 +1,389 @@ +#ifndef _FRAGMENTS_H_ +#define _FRAGMENTS_H_ + +// fragment 1 +extern u8 fragment1_TEXT_START[]; +extern u8 fragment1_ROM_START[]; +extern u8 fragment1_ROM_END[]; + +// fragment 2 +extern u8 fragment2_TEXT_START[]; +extern u8 fragment2_ROM_START[]; +extern u8 fragment2_ROM_END[]; + +// fragment 3 +extern u8 fragment3_TEXT_START[]; +extern u8 fragment3_ROM_START[]; +extern u8 fragment3_ROM_END[]; + +// fragment 4 +extern u8 fragment4_TEXT_START[]; +extern u8 fragment4_ROM_START[]; +extern u8 fragment4_ROM_END[]; + +// fragment 5 +extern u8 fragment5_TEXT_START[]; +extern u8 fragment5_ROM_START[]; +extern u8 fragment5_ROM_END[]; + +// fragment 6 +extern u8 fragment6_TEXT_START[]; +extern u8 fragment6_ROM_START[]; +extern u8 fragment6_ROM_END[]; + +// fragment 7 +extern u8 fragment7_TEXT_START[]; +extern u8 fragment7_ROM_START[]; +extern u8 fragment7_ROM_END[]; + +// fragment 8 +extern u8 fragment8_TEXT_START[]; +extern u8 fragment8_ROM_START[]; +extern u8 fragment8_ROM_END[]; + +// fragment 9 +extern u8 fragment9_TEXT_START[]; +extern u8 fragment9_ROM_START[]; +extern u8 fragment9_ROM_END[]; + +// fragment 10 +extern u8 fragment10_TEXT_START[]; +extern u8 fragment10_ROM_START[]; +extern u8 fragment10_ROM_END[]; + +// fragment 11 +extern u8 fragment11_TEXT_START[]; +extern u8 fragment11_ROM_START[]; +extern u8 fragment11_ROM_END[]; + +// fragment 12 +extern u8 fragment12_TEXT_START[]; +extern u8 fragment12_ROM_START[]; +extern u8 fragment12_ROM_END[]; + +// fragment 13 +extern u8 fragment13_TEXT_START[]; +extern u8 fragment13_ROM_START[]; +extern u8 fragment13_ROM_END[]; + +// fragment 14 +extern u8 fragment14_TEXT_START[]; +extern u8 fragment14_ROM_START[]; +extern u8 fragment14_ROM_END[]; + +// fragment 15 +extern u8 fragment15_TEXT_START[]; +extern u8 fragment15_ROM_START[]; +extern u8 fragment15_ROM_END[]; + +// fragment 16 +extern u8 fragment16_TEXT_START[]; +extern u8 fragment16_ROM_START[]; +extern u8 fragment16_ROM_END[]; + +// fragment 17 +extern u8 fragment17_TEXT_START[]; +extern u8 fragment17_ROM_START[]; +extern u8 fragment17_ROM_END[]; + +// fragment 18 +extern u8 fragment18_TEXT_START[]; +extern u8 fragment18_ROM_START[]; +extern u8 fragment18_ROM_END[]; + +// fragment 19 +extern u8 fragment19_TEXT_START[]; +extern u8 fragment19_ROM_START[]; +extern u8 fragment19_ROM_END[]; + +// fragment 20 +extern u8 fragment20_TEXT_START[]; +extern u8 fragment20_ROM_START[]; +extern u8 fragment20_ROM_END[]; + +// fragment 21 +extern u8 fragment21_TEXT_START[]; +extern u8 fragment21_ROM_START[]; +extern u8 fragment21_ROM_END[]; + +// fragment 22 +extern u8 fragment22_TEXT_START[]; +extern u8 fragment22_ROM_START[]; +extern u8 fragment22_ROM_END[]; + +// fragment 23 +extern u8 fragment23_TEXT_START[]; +extern u8 fragment23_ROM_START[]; +extern u8 fragment23_ROM_END[]; + +// fragment 24 +extern u8 fragment24_TEXT_START[]; +extern u8 fragment24_ROM_START[]; +extern u8 fragment24_ROM_END[]; + +// fragment 25 +extern u8 fragment25_TEXT_START[]; +extern u8 fragment25_ROM_START[]; +extern u8 fragment25_ROM_END[]; + +// fragment 26 +extern u8 fragment26_TEXT_START[]; +extern u8 fragment26_ROM_START[]; +extern u8 fragment26_ROM_END[]; + +// fragment 27 +extern u8 fragment27_TEXT_START[]; +extern u8 fragment27_ROM_START[]; +extern u8 fragment27_ROM_END[]; + +// fragment 28 +extern u8 fragment28_TEXT_START[]; +extern u8 fragment28_ROM_START[]; +extern u8 fragment28_ROM_END[]; + +// fragment 29 +extern u8 fragment29_TEXT_START[]; +extern u8 fragment29_ROM_START[]; +extern u8 fragment29_ROM_END[]; + +// fragment 30 +extern u8 fragment30_TEXT_START[]; +extern u8 fragment30_ROM_START[]; +extern u8 fragment30_ROM_END[]; + +// fragment 31 +extern u8 fragment31_TEXT_START[]; +extern u8 fragment31_ROM_START[]; +extern u8 fragment31_ROM_END[]; + +// fragment 32 +extern u8 fragment32_TEXT_START[]; +extern u8 fragment32_ROM_START[]; +extern u8 fragment32_ROM_END[]; + +// fragment 33 +extern u8 fragment33_TEXT_START[]; +extern u8 fragment33_ROM_START[]; +extern u8 fragment33_ROM_END[]; + +// fragment 34 +extern u8 fragment34_TEXT_START[]; +extern u8 fragment34_ROM_START[]; +extern u8 fragment34_ROM_END[]; + +// fragment 35 +extern u8 fragment35_TEXT_START[]; +extern u8 fragment35_ROM_START[]; +extern u8 fragment35_ROM_END[]; + +// fragment 36 +extern u8 fragment36_TEXT_START[]; +extern u8 fragment36_ROM_START[]; +extern u8 fragment36_ROM_END[]; + +// fragment 37 +extern u8 fragment37_TEXT_START[]; +extern u8 fragment37_ROM_START[]; +extern u8 fragment37_ROM_END[]; + +// fragment 38 +extern u8 fragment38_TEXT_START[]; +extern u8 fragment38_ROM_START[]; +extern u8 fragment38_ROM_END[]; + +// fragment 39 +extern u8 fragment39_TEXT_START[]; +extern u8 fragment39_ROM_START[]; +extern u8 fragment39_ROM_END[]; + +// fragment 40 +extern u8 fragment40_TEXT_START[]; +extern u8 fragment40_ROM_START[]; +extern u8 fragment40_ROM_END[]; + +// fragment 41 +extern u8 fragment41_TEXT_START[]; +extern u8 fragment41_ROM_START[]; +extern u8 fragment41_ROM_END[]; + +// fragment 42 +extern u8 fragment42_TEXT_START[]; +extern u8 fragment42_ROM_START[]; +extern u8 fragment42_ROM_END[]; + +// fragment 43 +extern u8 fragment43_TEXT_START[]; +extern u8 fragment43_ROM_START[]; +extern u8 fragment43_ROM_END[]; + +// fragment 44 +extern u8 fragment44_TEXT_START[]; +extern u8 fragment44_ROM_START[]; +extern u8 fragment44_ROM_END[]; + +// fragment 45 +extern u8 fragment45_TEXT_START[]; +extern u8 fragment45_ROM_START[]; +extern u8 fragment45_ROM_END[]; + +// fragment 46 +extern u8 fragment46_TEXT_START[]; +extern u8 fragment46_ROM_START[]; +extern u8 fragment46_ROM_END[]; + +// fragment 47 +extern u8 fragment47_TEXT_START[]; +extern u8 fragment47_ROM_START[]; +extern u8 fragment47_ROM_END[]; + +// fragment 48 +extern u8 fragment48_TEXT_START[]; +extern u8 fragment48_ROM_START[]; +extern u8 fragment48_ROM_END[]; + +// fragment 49 +extern u8 fragment49_TEXT_START[]; +extern u8 fragment49_ROM_START[]; +extern u8 fragment49_ROM_END[]; + +// fragment 50 +extern u8 fragment50_TEXT_START[]; +extern u8 fragment50_ROM_START[]; +extern u8 fragment50_ROM_END[]; + +// fragment 51 +extern u8 fragment51_TEXT_START[]; +extern u8 fragment51_ROM_START[]; +extern u8 fragment51_ROM_END[]; + +// fragment 52 +extern u8 fragment52_TEXT_START[]; +extern u8 fragment52_ROM_START[]; +extern u8 fragment52_ROM_END[]; + +// fragment 53 +extern u8 fragment53_TEXT_START[]; +extern u8 fragment53_ROM_START[]; +extern u8 fragment53_ROM_END[]; + +// fragment 54 +extern u8 fragment54_TEXT_START[]; +extern u8 fragment54_ROM_START[]; +extern u8 fragment54_ROM_END[]; + +// fragment 55 +extern u8 fragment55_TEXT_START[]; +extern u8 fragment55_ROM_START[]; +extern u8 fragment55_ROM_END[]; + +// fragment 56 +extern u8 fragment56_TEXT_START[]; +extern u8 fragment56_ROM_START[]; +extern u8 fragment56_ROM_END[]; + +// fragment 57 +extern u8 fragment57_TEXT_START[]; +extern u8 fragment57_ROM_START[]; +extern u8 fragment57_ROM_END[]; + +// fragment 58 +extern u8 fragment58_TEXT_START[]; +extern u8 fragment58_ROM_START[]; +extern u8 fragment58_ROM_END[]; + +// fragment 59 +extern u8 fragment59_TEXT_START[]; +extern u8 fragment59_ROM_START[]; +extern u8 fragment59_ROM_END[]; + +// fragment 60 +extern u8 fragment60_TEXT_START[]; +extern u8 fragment60_ROM_START[]; +extern u8 fragment60_ROM_END[]; + +// fragment 61 +extern u8 fragment61_TEXT_START[]; +extern u8 fragment61_ROM_START[]; +extern u8 fragment61_ROM_END[]; + +// fragment 62 +extern u8 fragment62_TEXT_START[]; +extern u8 fragment62_ROM_START[]; +extern u8 fragment62_ROM_END[]; + +// fragment 63 +extern u8 fragment63_TEXT_START[]; +extern u8 fragment63_ROM_START[]; +extern u8 fragment63_ROM_END[]; + +// fragment 64 +extern u8 fragment64_TEXT_START[]; +extern u8 fragment64_ROM_START[]; +extern u8 fragment64_ROM_END[]; + +// fragment 65 +extern u8 fragment65_TEXT_START[]; +extern u8 fragment65_ROM_START[]; +extern u8 fragment65_ROM_END[]; + +// fragment 66 +extern u8 fragment66_TEXT_START[]; +extern u8 fragment66_ROM_START[]; +extern u8 fragment66_ROM_END[]; + +// fragment 67 +extern u8 fragment67_TEXT_START[]; +extern u8 fragment67_ROM_START[]; +extern u8 fragment67_ROM_END[]; + +// fragment 68 +extern u8 fragment68_TEXT_START[]; +extern u8 fragment68_ROM_START[]; +extern u8 fragment68_ROM_END[]; + +// fragment 69 +extern u8 fragment69_TEXT_START[]; +extern u8 fragment69_ROM_START[]; +extern u8 fragment69_ROM_END[]; + +// fragment 70 +extern u8 fragment70_TEXT_START[]; +extern u8 fragment70_ROM_START[]; +extern u8 fragment70_ROM_END[]; + +// fragment 71 +extern u8 fragment71_TEXT_START[]; +extern u8 fragment71_ROM_START[]; +extern u8 fragment71_ROM_END[]; + +// fragment 72 +extern u8 fragment72_TEXT_START[]; +extern u8 fragment72_ROM_START[]; +extern u8 fragment72_ROM_END[]; + +// fragment 73 +extern u8 fragment73_TEXT_START[]; +extern u8 fragment73_ROM_START[]; +extern u8 fragment73_ROM_END[]; + +// fragment 74 +extern u8 fragment74_TEXT_START[]; +extern u8 fragment74_ROM_START[]; +extern u8 fragment74_ROM_END[]; + +// fragment 75 +extern u8 fragment75_TEXT_START[]; +extern u8 fragment75_ROM_START[]; +extern u8 fragment75_ROM_END[]; + +// fragment 76 +extern u8 fragment76_TEXT_START[]; +extern u8 fragment76_ROM_START[]; +extern u8 fragment76_ROM_END[]; + +// fragment 77 +extern u8 fragment77_TEXT_START[]; +extern u8 fragment77_ROM_START[]; +extern u8 fragment77_ROM_END[]; + +#endif // _FRAGMENTS_H_ diff --git a/splat.yaml b/splat.yaml index 5c6f2d8c..257dc4d5 100644 --- a/splat.yaml +++ b/splat.yaml @@ -440,6 +440,13 @@ segments: - [0x8D1A0, data, fragments/1/fragment1_data] - [0xA8E80, rodata, fragments/1/fragment1_rodata] - [0xAAB60, bin, fragments/1/fragment1_relocs] + + - name: fragment1_misc_yay0 + type: code + bss_size: 0x0 + start: 0xADC80 + vram: 0x81800000 # unknown VRAM, need a value here to stop linker complaints + subsegments: - [0xADC80, bin, fragments/1/fragment1_yay0_0] - [0xF4920, bin, fragments/1/fragment1_yay0_1] - [0xF5450, bin, fragments/1/fragment1_yay0_2] diff --git a/src/E1C0.c b/src/E1C0.c index 78366fd2..31d741ee 100644 --- a/src/E1C0.c +++ b/src/E1C0.c @@ -1,5 +1,6 @@ #include #include "dp_intro.h" +#include "fragments.h" struct UnkInputStruct8000D738 { s32 unk0; @@ -28,8 +29,6 @@ extern char D_800AA668; extern u8 D_81200000[]; // ROM offsets -extern u8 D_7F980[]; // fragment 1 ROM start -extern u8 D_ADC80[]; // fragment 1 ROM end extern u8 D_3BA190[]; extern u8 D_3CB130[]; @@ -79,14 +78,14 @@ void func_8000D738(struct UnkInputStruct8000D738* arg0) { func_80002784(0x4742454D); D_800AA660 = (void*)func_800025C4(0x2210, 0); D_800AA664 = (void*)func_800025C4(0x21E0, 0); - func_80004454(((u32) ((u32) &D_81200000 & 0x0FF00000) >> 0x14) - 0x10, &D_7F980, &D_ADC80); + func_80004454(((u32) ((u32) &fragment1_TEXT_START & 0x0FF00000) >> 0x14) - 0x10, &fragment1_ROM_START, &fragment1_ROM_END); temp_v0 = func_800044F4(&D_3BA190, &D_3CB130, 1, 1); D_800AA660->unk21FC = func_8000484C(temp_v0, 0); D_800AA660->unk2200 = func_8000484C(temp_v0, 1); D_800AA660->unk2204 = *arg0; osCreateMesgQueue(&D_800AA660->queue, &D_800AA660->mesg, 1); - osCreateThread(&D_800AA664->thread, 0xA, func_8000D5C0, NULL, (u32)D_800AA664 + 0x21E0, 0x11); - osCreateThread(&D_800AA660->thread, 8, func_8000D678, NULL, (u32)D_800AA660 + 0x21E0, 0xF); + osCreateThread(&D_800AA664->thread, 10, func_8000D5C0, NULL, (u32)D_800AA664 + 0x21E0, 0x11); + osCreateThread(&D_800AA660->thread, 8, func_8000D678, NULL, (u32)D_800AA660 + 0x21E0, 0xF); D_800AA668 = func_8000B318(0); osStartThread(&D_800AA660->thread); }