Skip to content

Commit

Permalink
Merge pull request #158 from Kelebek1/fragment18
Browse files Browse the repository at this point in the history
fragment18
  • Loading branch information
RevoSucks authored Oct 17, 2024
2 parents 0bc12ff + 3dc0221 commit 23bb731
Show file tree
Hide file tree
Showing 16 changed files with 3,635 additions and 123 deletions.
11 changes: 4 additions & 7 deletions linker_scripts/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ D_8690B5D0 = 0x8690B5D0; // size:0x24
D_86A06228 = 0x86A06228; // size:0xC
D_86A06238 = 0x86A06238; // size:0xC
D_86A06248 = 0x86A06248; // size:0xC
D_30074E0 = 0x30074E0;
D_30092E0 = 0x30092E0;
D_300B6E0 = 0x300B6E0;
D_300B980 = 0x300B980;
D_300BAD0 = 0x300BAD0;
D_300BED0 = 0x300BED0;
D_300C2D0 = 0x300C2D0;
D_86C0E480 = 0x86C0E480; // size:0x1854
D_86C0FCD8 = 0x86C0FCD8; // size:0x1854
D_86C11530 = 0x86C11530; // size:0xAD0
D_879060BC = 0x879060BC; // size:0x2
16 changes: 16 additions & 0 deletions linker_scripts/us/undefined_syms.ld
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,19 @@ D_300B980 = 0x300B980;
D_300BAD0 = 0x300BAD0;
D_300BED0 = 0x300BED0;
D_300C2D0 = 0x300C2D0;
D_03034E40 = 0x03034E40;
D_03035A80 = 0x03035A80;
D_030366C0 = 0x030366C0;
D_03037300 = 0x03037300;
D_030397C0 = 0x030397C0;
D_0303A400 = 0x0303A400;
D_0303B040 = 0x0303B040;
D_0303D500 = 0x0303D500;
D_03040580 = 0x03040580;
D_03040980 = 0x03040980;
D_03040D80 = 0x03040D80;
D_03041FC0 = 0x03041FC0;
D_03043520 = 0x03043520;
D_03043C40 = 0x03043C40;
D_030426E0 = 0x030426E0;
D_03042E00 = 0x03042E00;
2 changes: 1 addition & 1 deletion src/50860.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "38BB0.h"
#include "3D140.h"

void func_8004FC60(s32 arg0, s32 arg1) {
void func_8004FC60(s32 arg0, u32 arg1) {
s32 i;

if (arg0 & 4) {
Expand Down
2 changes: 1 addition & 1 deletion src/50860.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "global.h"

void func_8004FC60(s32, s32);
void func_8004FC60(s32, u32);
void func_8004FCD8(s32);

#endif // _50860_H_
3,552 changes: 3,488 additions & 64 deletions src/fragments/18/fragment18.c

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions src/fragments/18/fragment18.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#ifndef _FRAGMENT18_H_
#define _FRAGMENT18_H_

#include "global.h"
#include "src/fragments/3/fragment3.h"

s32 func_86C00020(unk_func_8790002C* arg0);
void func_86C00090(s16 arg0, s32* arg1, s32* arg2);
void func_86C00110(s16 arg0, s16 arg1);
void func_86C00368(s16 arg0, s16 arg1);
void func_86C003AC(unk_func_8790002C* arg0);
void func_86C00424(unk_func_8790002C* arg0, s16 arg1);
void func_86C005D0(void);
f32 func_86C0063C(unk_func_8790002C* arg0);
s16 func_86C00668(unk_func_8790002C* arg0, s16 arg1);
void func_86C00770(unk_func_8790002C* arg0);
void func_86C00AA4(void);
s32 func_86C00B0C(unk_func_8790002C* arg0);
s16 func_86C00BB4(void);
s16 func_86C00C40(unk_func_8790002C* arg0);
s16 func_86C00D50(unk_func_8790002C* arg0);
s32 func_86C00EF8(unk_func_8790002C* arg0);
void func_86C00F70(unk_func_8790002C* arg0);
void func_86C01100(unk_func_8790002C* arg0);
s16 func_86C01408(void);
s16 func_86C014A0(void);
void func_86C01538(unk_func_8790002C* arg0);
void func_86C016C8(unk_func_8790002C* arg0);
void func_86C01748(void);
void func_86C01750(unk_func_8790002C* arg0, s32 arg1, s32 arg2, f32 arg3, f32 arg4, f32 arg5);
void func_86C018B8(unk_func_8790002C* arg0, s32 arg1);
void func_86C01AF8(void);
void func_86C01D2C(unk_func_8790002C* arg0, s32 arg1);
void func_86C01FAC(unk_func_8790002C* arg0, s32 arg1);
void func_86C021FC(unk_func_8790002C* arg0);
void func_86C022D8(unk_func_8790002C* arg0);
void func_86C02324(unk_func_8790002C* arg0, s32 arg1);
void func_86C0250C(void);
void func_86C02514(void);
void func_86C02610(unk_func_8790002C* arg0, s32 arg1);
void func_86C026F0(unk_func_8790002C* arg0, s32 arg1);
void func_86C0276C(void);
void func_86C027A4(void);
void func_86C027AC(void);
void func_86C027B4(void);
void func_86C027BC(void);
void func_86C02804(void);
s16 func_86C028C0(s16 arg0);
void func_86C02A1C(unk_func_8790002C* arg0);
void func_86C02B78(unk_func_8790002C* arg0, s32 arg1);
void func_86C02C28(void);
void func_86C03008(void);
void func_86C03080(void);
s32 func_86C030EC(void);
void func_86C03128(void);
s32 func_86C031E4(void);
s32 func_86C03258(void);
void func_86C03344(void);
void func_86C034F8(void);
void func_86C03500(void);
void func_86C035E0(void);
void func_86C03608(void);
void func_86C03AB8(void);
void func_86C03BE8(void);
void func_86C03C64(void);
void func_86C03E4C(void);
void func_86C03E8C(s32 arg0);
void func_86C03ED4(void);
void func_86C040B4(s32 arg0);
void func_86C04170(void);
void func_86C041E8(void);
void func_86C043C4(void);
void func_86C044B4(void);
s32 func_86C046B0(s32 arg0, UNUSED s32 arg1);

#endif // _FRAGMENT18_H_
1 change: 1 addition & 0 deletions src/fragments/2/fragment2.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern char** D_87806330;
extern s16 D_87806338;
extern u32* D_8780633C[];
extern u32* D_8780634C[];
extern u32 D_87806398[];

extern u16 D_8780FA28;
extern s16 D_8780FA2A;
Expand Down
4 changes: 2 additions & 2 deletions src/fragments/2/fragment2_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ static Gfx D_87806390[] = {
};

u32 D_87806398[] = {
0x0B00001E, 0x00000000, 0x014000F0, 0x00000000, 0x000016A8, 0x00000190, 0x05000000, 0x0D000000, 0x05000000,
0x0F000002, 0x05000000, 0x0A000000, 0x800AC858, 0x06000000, 0x06000000, 0x06000000, 0x04000000, 0x00000000,
0x0B00001E, 0x00000000, 0x014000F0, 0x00000000, 0x000016A8, 0x00000190, 0x05000000, 0x0D000000, 0x05000000,
0x0F000002, 0x05000000, 0x0A000000, &D_800AC858, 0x06000000, 0x06000000, 0x06000000, 0x04000000, 0x00000000,
};

static Vtx D_878063E0[] = {
Expand Down
27 changes: 14 additions & 13 deletions src/fragments/3/fragment3.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
#include "global.h"
#include "src/fragments/34/fragment34.h"
#include "src/3FB0.h"
#include "src/controller.h"

typedef struct unk_func_8790002C {
/* 0x000 */ unk_D_86002F58_004_000 unk_000;
/* 0x168 */ unk_D_86002F30* unk_168;
/* 0x16C */ f32 unk_16C;
/* 0x170 */ f32 unk_170;
/* 0x174 */ f32 unk_174;
/* 0x16C */ Vec3f unk_16C;
/* 0x178 */ char unk178[0x18];
/* 0x190 */ f32 unk_190;
/* 0x194 */ f32 unk_194;
Expand All @@ -30,7 +29,7 @@ typedef struct unk_func_8790002C {
/* 0x1CC */ f32 unk_1CC;
/* 0x1D0 */ f32 unk_1D0;
/* 0x1D4 */ f32 unk_1D4;
/* 0x1D8 */ char unk1D8[0xC];
/* 0x1D8 */ Vec3f unk_1D8;
/* 0x1E4 */ f32 unk_1E4;
/* 0x1E8 */ char unk1E8[0x4];
/* 0x1EC */ f32 unk_1EC;
Expand Down Expand Up @@ -73,14 +72,15 @@ typedef struct unk_func_8790002C {
/* 0x24C */ s16 unk_24C;
/* 0x24E */ char unk24E[0x6];
/* 0x254 */ s32 unk_254;
/* 0x258 */ char unk258[0x2];
/* 0x258 */ s16 unk_258;
/* 0x25A */ s16 unk_25A;
/* 0x25C */ char unk25C[0x4];
/* 0x25C */ s16 unk_25C;
/* 0x25E */ s16 unk_25E;
/* 0x260 */ s16 unk_260;
/* 0x262 */ s16 unk_262;
/* 0x264 */ s16 unk_264;
/* 0x264 */ s16 unk_266;
/* 0x268 */ char unk268[0x2];
/* 0x268 */ s16 unk_268;
/* 0x26A */ s16 unk_26A;
/* 0x26C */ s16 unk_26C;
/* 0x26E */ s16 unk_26E;
Expand Down Expand Up @@ -108,6 +108,7 @@ typedef struct unk_func_8790002C {
/* 0x2A8 */ s16 unk_2A8;
/* 0x2AA */ s16 unk_2AA;
/* 0x2AC */ s16 unk_2AC;
/* 0x2AE */ s16 unk_2AE;
/* 0x2B0 */ char unk2B0[0x4];
} unk_func_8790002C; // size = 0x2B4

Expand All @@ -130,9 +131,11 @@ typedef struct unk_D_87903E10 {
/* 0x04 */ unk_D_87903E00* unk_04;
} unk_D_87903E10; // size = 0x8

extern s16 D_87903DA0;
extern s16 D_87903DA4;
extern s16 D_87903DA8;
extern s16 D_87903DAC;
extern s16 D_87903DBC;
extern s16 D_87903DC0;
extern s16 D_87903DC4;
extern s16 D_87903DC8;
Expand Down Expand Up @@ -165,7 +168,6 @@ extern s16 D_87906078;
extern f32 D_8790607C;
extern f32 D_87906080;
extern Vec3f D_87906088;

extern s16 D_87906094;
extern s16 D_87906096;
extern s16 D_87906098;
Expand All @@ -180,11 +182,10 @@ extern Vec3s D_879060AC;

extern s16 D_87903DB0;
extern s16 D_87903DB8;

extern s8 D_879060C4;
extern s8 D_879060C5;
extern s8 D_879060C6;
extern s8 D_879060C7;
extern Controller* D_879060BC;
extern s16 D_879060C0;
extern s16 D_879060C2;
extern s8 D_879060C4[4];
extern s16 D_879060C8;
extern s16 D_879060CA;

Expand Down
24 changes: 12 additions & 12 deletions src/fragments/3/fragment3_1189B0.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ s16 D_87903DAC = 0;
s16 D_87903DB0 = 0;
s32 pad_D_87903DB4 = 0;
s16 D_87903DB8 = 0;
s32 pad_D_87903DBC = 0;
s16 D_87903DBC = 0;
s16 D_87903DC0 = 0;
s16 D_87903DC4 = 0;
s16 D_87903DC8 = 0;
Expand All @@ -39,7 +39,7 @@ s32 func_879000C4(unk_func_8790002C* arg0, unk_func_8790002C* arg1) {
f32 var_fv0 = arg1->unk_19C - arg0->unk_19C;
f32 var_fv1 = arg1->unk_1A0 - arg0->unk_1A0;
f32 var_fa0 = arg1->unk_1A4 - arg0->unk_1A4;
f32 var_fa1 = (arg0->unk_288 * arg0->unk_170) + (arg1->unk_288 * arg1->unk_170);
f32 var_fa1 = (arg0->unk_288 * arg0->unk_16C.y) + (arg1->unk_288 * arg1->unk_16C.y);
s32 ret = 0;

if (var_fv0 < 0.0f) {
Expand Down Expand Up @@ -79,8 +79,8 @@ s32 func_879001A4(unk_func_8790002C* arg0, unk_func_8790002C* arg1) {
var_fa0 = arg1->unk_1A4 - arg0->unk_1A4;
var_v1 = 0;

var_fa1 = (arg0->unk_288 * arg0->unk_170) + (arg1->unk_288 * arg1->unk_170);
var_fs0 = ((arg0->unk_28C * arg0->unk_170) + (arg1->unk_28C * arg1->unk_170)) * 0.5f;
var_fa1 = (arg0->unk_288 * arg0->unk_16C.y) + (arg1->unk_288 * arg1->unk_16C.y);
var_fs0 = ((arg0->unk_28C * arg0->unk_16C.y) + (arg1->unk_28C * arg1->unk_16C.y)) * 0.5f;

var_fv0 = ABS(var_fv0);
var_fv1 = ABS(var_fv1);
Expand Down Expand Up @@ -240,7 +240,7 @@ void func_8790060C(unk_func_8790002C* arg0) {
arg0->unk_296 = 0;
arg0->unk_298 = 0;

arg0->unk_16C = arg0->unk_170 = arg0->unk_174 = 1.0f;
arg0->unk_16C.x = arg0->unk_16C.y = arg0->unk_16C.z = 1.0f;

arg0->unk_198 = 0.0f;
arg0->unk_194 = 0.0f;
Expand Down Expand Up @@ -290,9 +290,9 @@ void func_87900770(unk_func_8790002C* arg0) {
}

void func_87900808(unk_func_8790002C* arg0) {
arg0->unk_000.unk_030.x = arg0->unk_16C;
arg0->unk_000.unk_030.y = arg0->unk_170;
arg0->unk_000.unk_030.z = arg0->unk_174;
arg0->unk_000.unk_030.x = arg0->unk_16C.x;
arg0->unk_000.unk_030.y = arg0->unk_16C.y;
arg0->unk_000.unk_030.z = arg0->unk_16C.z;

arg0->unk_000.unk_024.x = arg0->unk_190;
arg0->unk_000.unk_024.y = arg0->unk_194;
Expand Down Expand Up @@ -322,10 +322,10 @@ void func_87900854(void) {
func_878029C0();
func_87802528();

D_879060C4 = ptr[0];
D_879060C5 = ptr[1];
D_879060C6 = ptr[2];
D_879060C7 = ptr[3];
D_879060C4[0] = ptr[0];
D_879060C4[1] = ptr[1];
D_879060C4[2] = ptr[2];
D_879060C4[3] = ptr[3];

D_879060C8 = 0xFF;
}
Expand Down
9 changes: 2 additions & 7 deletions src/fragments/3/fragment3_1193E0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "src/1CF30.h"
#include "src/20470.h"
#include "src/F420.h"
#include "src/controller.h"

s16 D_87906040;
s16 pad_D_87906042;
Expand Down Expand Up @@ -41,14 +40,10 @@ s16 D_879060A8;
Vec3s D_879060AC;
s32 pad_D_879060B4;
s32 pad_D_879060B8;
s16 D_879060BC;
s16 D_879060BE;
Controller* D_879060BC;
s16 D_879060C0;
s16 D_879060C2;
s8 D_879060C4;
s8 D_879060C5;
s8 D_879060C6;
s8 D_879060C7;
s8 D_879060C4[4];
s16 D_879060C8;
s16 D_879060CA;
s32 pad_D_879060D0[4];
Expand Down
7 changes: 4 additions & 3 deletions src/fragments/3/fragment3_11BF90.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ void func_8790370C(void) {

void func_87903778(unk_func_8790002C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s16 arg5, s16 arg6, s16 arg7,
s16 arg8) {
arg0->unk_16C = arg1;
arg0->unk_170 = arg1;
arg0->unk_174 = arg1;
arg0->unk_16C.x = arg1;
arg0->unk_16C.y = arg1;
arg0->unk_16C.z = arg1;

arg0->unk_1A8 = arg2;
arg0->unk_1AC = arg3;
arg0->unk_1B0 = arg4;
Expand Down
6 changes: 3 additions & 3 deletions src/fragments/34/fragment34.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ s32 func_81400B00(s32 arg0);
s32 func_81400B28(s32 arg0, s32 arg1);
s32 func_81400B4C(s32 arg0, s32 arg1);
void func_81400B84(UNUSED s32 arg0);
void func_81400B8C(Vec3f arg0);
void func_81400BBC(Vec3f arg0);
void func_81400BEC(Vec3f arg0);
s16 func_81400B8C(Vec3f arg0);
s16 func_81400BBC(Vec3f arg0);
s16 func_81400BEC(Vec3f arg0);
void func_81400C1C(Vec3s* arg0, Vec3f arg1);
f32 func_81400C80(f32 arg0, f32 arg1, s16 arg2);
f32 func_81400CC0(f32 arg0, f32 arg1, s16 arg2);
Expand Down
12 changes: 6 additions & 6 deletions src/fragments/34/fragment34_261F90.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,16 +555,16 @@ s32 func_81400B4C(s32 arg0, s32 arg1) {
void func_81400B84(UNUSED s32 arg0) {
}

void func_81400B8C(Vec3f arg0) {
MathUtil_Atan2s(arg0.y, arg0.z);
s16 func_81400B8C(Vec3f arg0) {
return MathUtil_Atan2s(arg0.y, arg0.z);
}

void func_81400BBC(Vec3f arg0) {
MathUtil_Atan2s(arg0.z, arg0.x);
s16 func_81400BBC(Vec3f arg0) {
return MathUtil_Atan2s(arg0.z, arg0.x);
}

void func_81400BEC(Vec3f arg0) {
MathUtil_Atan2s(arg0.x, arg0.y);
s16 func_81400BEC(Vec3f arg0) {
return MathUtil_Atan2s(arg0.x, arg0.y);
}

void func_81400C1C(Vec3s* arg0, Vec3f arg1) {
Expand Down
3 changes: 2 additions & 1 deletion tools/animation_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ def get_type(f, offset, cmd, args, out):

out += f" ANIMATION_SCRIPT_CMD_{cmd:02X}"
out += "("
#print(hex(offset), hex(cmd))
out = get_type(f, offset, cmd, COMMANDS[cmd]["args"][1:], out)
if out[-2:] == ", ":
out = out[:-2]
out += "),\n"

if cmd == 0x01:
if cmd == 0x01 or cmd == 0x04:
break;

offset += COMMANDS[cmd]["size"]
Expand Down
Loading

0 comments on commit 23bb731

Please sign in to comment.