papermario/src/code_d0a70_len_4fe0.c

115 lines
4.0 KiB
C
Raw Normal View History

2020-08-04 08:49:11 +02:00
#include "common.h"
2020-12-15 14:27:58 +01:00
s32 D_8014EE10[] = { 0x80156920, };
s32 D_8014EE14[] = { 0x00000000, };
s32 D_8014EE18[] = { 0x90909000, 0x90909000, 0xFFFFFF00, 0xFFFFFF00, 0x00007800, 0x00000000, 0xFFFFFF00, 0xFFFFFF00,
2020-12-18 11:12:41 +01:00
0x00008800, 0x00000000,
};
2020-12-15 14:27:58 +01:00
s32 D_8014EE40[] = { 0x028001E0, 0x01FF0000, 0x028001E0, 0x01FF0000, };
s32 D_8014EE50[] = { 0x028001E0, 0x01FF0000, 0x028001E0, 0x02000000, };
s32 D_8014EE60[] = { 0x012C0000, 0x00000000, };
s32 D_8014EE68[] = { 0xD9FDF9FF, 0x00000000, 0xD9FFFFFF, 0x00200005, 0xD7000002, 0xFFFFFFFF, 0xE2001E01, 0x00000000,
2020-12-18 11:12:41 +01:00
0xE3000A11, 0x00082CF0, 0xDF000000, 0x00000000,
};
2020-12-15 14:27:58 +01:00
s32 D_8014EE98[] = { 0x00441208, 0x00111208, 0x00000000, 0x00441208, 0x00111208, 0x00000000, 0x00404B40, 0x00104B40,
2020-12-18 11:12:41 +01:00
0x01000000, 0x00404B40, 0x00104B40, 0x01000000, 0x00441208, 0x00111208, 0x00000000, 0x00404B40,
0x00104B40, 0x01000000, 0x00441208, 0x00111208, 0x00000000, 0x00404B40, 0x00104B40, 0x01000000,
0x00404B40, 0x00104B40, 0x01000000, 0x00441208, 0x00111208, 0x00000000, 0x00404B40, 0x00104B40,
0x01000000, 0x00441208, 0x00111208, 0x00000000, 0x00404B40, 0x00104B40, 0x01000000, 0x00441208,
0x00111208, 0x00000000, 0x00441208, 0x00111208, 0x00000000, 0x00404B40, 0x00104B40, 0x01000000,
0x00441208, 0x00111208, 0x00000000,
};
2020-12-15 14:27:58 +01:00
s32 D_8014EF64[] = { 0x00014358, 0x00018200, 0x0001A858, 0x0001E830, 0x00029458, 0x000314E0, 0x00033498, 0x00038988,
2020-12-18 11:12:41 +01:00
0x00039228, 0x0005B7A8, 0x0007CF10, 0x00086490, 0x00096258, 0x000A1820, 0x000ACDE8, 0x000BBF68,
0x000C0490, 0x000C49B8, 0x000C6150, 0x000CA380, 0x00000000, 0x00000000, 0x00000000,
};
2020-12-15 14:27:58 +01:00
Decomp func_8013A854 from code_d0a70_len_4fe0 and add UnkStructFromfunc8013A854 (#78) * inisital docs of asm logic and mips_to_c output * add temp unknown struct for this func * remove comments from asm, will keep them local only. * moved UnkSructFromfunc8013A854 to common_sructs.h * added it's pointer to undefined_syms * fixed struct pointer and size * this is a new struct, no others that are `0x7C` in size * pulled upstream. testing more code. * fix func_8013A854 to represent latest upstream * remove unknown struct from common structs to this func * this is a void func * unknown struct should be an array with size based on mipstoc outpute a0 < 0x5A * correct number of lines of asm output from diff, but all code does not match * fix data types in UnkStructFromfunc8013A854 * temp_v0's logical shift needs to go after UnkStructFromfunc8013A854 * remove unneeded variables * remove unneeded variables and adding inline sll multiple calc * add UnkStructFromfunc8013A854 back to common structs * add UnkStructFromfunc8013A854 back to common structs * pull latest n64 splat * analyzing func_8013AA9C to construct UnkStructFromfunc8013A854 * may need unions to represent sub structs in this unk * roll back struct changes and focus on regalloc * not an array of pointers looks like there's an array of 90 structs, each struct of size 0x7C * got OK, now need to cleanup code * Merge branch 'master' of https://github.com/ethteck/papermario into code_d0a70_len_4fe0-func_8013A854 # Conflicts: # tools/n64splat * fix comment * remove func_8013AA9C comment used during debug * add placeholders unks in UnkStructFromfunc8013A854 based on func_8013AA9C * add first 6 unks in D_80156954 * update todo, add some padding * adding padding * adjusting padding * finished first implementation of padding for UnkStructFromfunc8013A854 * run ./coverage.py --delete-matched * git checkout -f master && git pull for tools/star-rod * several changes to UnkStruct8013A854: * change name from UnkStructFromfunc8013A854 to UnkStruct8013A854 * only include known member data * add list typedef since this is any arracy of structs * fix UNKSTRUCT8013A854_SIZE const * fix スプラトゥーン n64splat * implement UnkStruct8013A854List to track which array we are pointing to in this unknown struct * resolve PR feedback. todo resolve splat, review alex optimization: * move unkstruct extern, struct, and size to code_d0a70_len_4fe0.c * format void func_8013A854 variable spacing * add unknown symbol D_80156954;0x80156954 to tools/symbol_addrs.txt * try fix スプラトn64 with git checkout master && git pull * fix lint * move var declaration to inside if and format code * remove todo comment Co-authored-by: sonicspiral <> Co-authored-by: sonicspiral <mru@plusultra.localdomain>
2020-10-19 06:15:04 +02:00
#define UNKSTRUCT8013A854_SIZE 90
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A370);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A37C);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A4D0);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A610);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A650);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A6E8);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A704);
2020-08-04 08:49:11 +02:00
Decomp func_8013A854 from code_d0a70_len_4fe0 and add UnkStructFromfunc8013A854 (#78) * inisital docs of asm logic and mips_to_c output * add temp unknown struct for this func * remove comments from asm, will keep them local only. * moved UnkSructFromfunc8013A854 to common_sructs.h * added it's pointer to undefined_syms * fixed struct pointer and size * this is a new struct, no others that are `0x7C` in size * pulled upstream. testing more code. * fix func_8013A854 to represent latest upstream * remove unknown struct from common structs to this func * this is a void func * unknown struct should be an array with size based on mipstoc outpute a0 < 0x5A * correct number of lines of asm output from diff, but all code does not match * fix data types in UnkStructFromfunc8013A854 * temp_v0's logical shift needs to go after UnkStructFromfunc8013A854 * remove unneeded variables * remove unneeded variables and adding inline sll multiple calc * add UnkStructFromfunc8013A854 back to common structs * add UnkStructFromfunc8013A854 back to common structs * pull latest n64 splat * analyzing func_8013AA9C to construct UnkStructFromfunc8013A854 * may need unions to represent sub structs in this unk * roll back struct changes and focus on regalloc * not an array of pointers looks like there's an array of 90 structs, each struct of size 0x7C * got OK, now need to cleanup code * Merge branch 'master' of https://github.com/ethteck/papermario into code_d0a70_len_4fe0-func_8013A854 # Conflicts: # tools/n64splat * fix comment * remove func_8013AA9C comment used during debug * add placeholders unks in UnkStructFromfunc8013A854 based on func_8013AA9C * add first 6 unks in D_80156954 * update todo, add some padding * adding padding * adjusting padding * finished first implementation of padding for UnkStructFromfunc8013A854 * run ./coverage.py --delete-matched * git checkout -f master && git pull for tools/star-rod * several changes to UnkStruct8013A854: * change name from UnkStructFromfunc8013A854 to UnkStruct8013A854 * only include known member data * add list typedef since this is any arracy of structs * fix UNKSTRUCT8013A854_SIZE const * fix スプラトゥーン n64splat * implement UnkStruct8013A854List to track which array we are pointing to in this unknown struct * resolve PR feedback. todo resolve splat, review alex optimization: * move unkstruct extern, struct, and size to code_d0a70_len_4fe0.c * format void func_8013A854 variable spacing * add unknown symbol D_80156954;0x80156954 to tools/symbol_addrs.txt * try fix スプラトn64 with git checkout master && git pull * fix lint * move var declaration to inside if and format code * remove todo comment Co-authored-by: sonicspiral <> Co-authored-by: sonicspiral <mru@plusultra.localdomain>
2020-10-19 06:15:04 +02:00
typedef struct {
/* 0x00 */ char unk_0[0x10];
/* 0x10 */ s16 unk_10;
/* 0x14 */ s32 unk_14;
/* 0x18 */ char unk_18[0x64];
} UnkStruct8013A854 ; // size = 0x7C
typedef UnkStruct8013A854 UnkStruct8013A854List[UNKSTRUCT8013A854_SIZE];
extern UnkStruct8013A854List* D_80156954[UNKSTRUCT8013A854_SIZE];
void func_8013A854(u32 i) {
if (i < 90) {
UnkStruct8013A854* unkStruct80156954ListPtr = *D_80156954;
unkStruct80156954ListPtr[i].unk_14 = 0;
unkStruct80156954ListPtr[i].unk_10 = -1;
}
}
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A888);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A8E0);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A920);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A93C);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A9C8);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013A9E8);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013AA9C);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013AF20);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013AF70);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013B0EC);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013B1B0);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013BC88);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013C048);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013C220);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013C3F0);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013CFA8);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013DAB4);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013E2F0);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013E904);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013EE48);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013EE68);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_d0a70_len_4fe0", func_8013F1F8);