Skip to content

Commit

Permalink
Merge pull request pret#142 from Kelebek1/fragment34
Browse files Browse the repository at this point in the history
Fragment34
  • Loading branch information
RevoSucks authored Sep 27, 2024
2 parents 3a5b0df + 944d476 commit 1f22b01
Show file tree
Hide file tree
Showing 15 changed files with 5,313 additions and 999 deletions.
19 changes: 19 additions & 0 deletions include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,23 @@ typedef struct unk_D_864027C0 {
/* 0x1C */ s16 unk_1C;
} unk_D_864027C0; // size = 0x20

typedef struct arg1_func_81407874_014_000_010 {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 unk_01;
/* 0x02 */ u8 unk_02;
/* 0x03 */ u8 unk_03;
/* 0x04 */ u8 unk_04;
/* 0x05 */ u8 unk_05;
/* 0x06 */ u8 unk_06;
/* 0x07 */ u8 unk_07;
/* 0x08 */ u8 unk_08;
/* 0x09 */ u8 unk_09;
/* 0x0A */ u8 unk_0A;
/* 0x0B */ u8 unk_0B;
/* 0x0C */ u8 unk_0C;
/* 0x0D */ u8 unk_0D;
/* 0x0E */ u8 unk_0E;
/* 0x0F */ u8 unk_0F;
} arg1_func_81407874_014_000_010; // size >= 0x10

#endif
5 changes: 5 additions & 0 deletions include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ typedef struct Vec3s {
/* 0x4 */ s16 z;
} Vec3s; // size = 0x6

typedef struct Vec2s {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
} Vec2s; // size = 0x4

typedef union Vec2s_s32 {
struct {
/* 0x0 */ s16 x;
Expand Down
1 change: 1 addition & 0 deletions linker_scripts/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,4 @@ pad_D_879060B4 = 0x879060B4; // size:0x8
D_879060E0 = 0x879060E0; // size:0xC
D_87906100 = 0x87906100; // size:0xC
D_87906110 = 0x87906110; // size:0xC
D_8140E628 = 0x8140E628; // size:0x90
40 changes: 6 additions & 34 deletions src/12D80.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,41 +1114,13 @@ Vec3f* func_80015390(unk_D_86002F58_004_000* arg0, s16 arg1, Vec3f* arg2) {
return NULL;
}

#ifdef NON_MATCHING
void func_80015400(Gfx* arg0, u8* arg1) {
/*
gDPSetCombineLERP(arg0++,
arg1[0], arg1[1], arg1[2], arg1[3], arg1[4], arg1[5], arg1[6],
arg1[7], arg1[8], arg1[9], arg1[10], arg1[11], arg1[12], arg1[13],
arg1[14], arg1[15]);
*/

gDPSetCombine(arg0++, GCCc0w0(arg1[0], arg1[2], arg1[4], arg1[6]) | GCCc1w0(arg1[8], arg1[10]),
GCCc0w1(arg1[1], arg1[3], arg1[5], arg1[7]) |
GCCc1w1(arg1[9], arg1[12], arg1[14], arg1[11], arg1[13], arg1[15]));

/*
arg0->words.w0 = ((((arg1->unk_0 & 0xF) << 0x14) |
((arg1->unk_2 & 0x1F) << 0xF) |
((arg1->unk_4 & 7) << 0xC) |
((arg1->unk_6 & 7) << 9) |
((arg1->unk_8 & 0xF) << 5) | (arg1->unk_A & 0x1F)) & 0xFFFFFF) |
0xFC000000;
arg0->words.w1 = (arg1->unk_1 << 0x1C) |
((arg1->unk_3 & 7) << 0xF) |
((arg1->unk_5 & 7) << 0xC) |
((arg1->unk_7 & 7) << 9) |
((arg1->unk_9 & 0xF) << 0x18) |
((arg1->unk_C & 7) << 0x15) |
((arg1->unk_E & 7) << 0x12) |
((arg1->unk_B & 7) << 6) |
((arg1->unk_D & 7) * 8) |
(arg1->unk_F & 7);
*/
void func_80015400(Gfx* arg0, arg1_func_81407874_014_000_010* arg1) {
gDPSetCombine(arg0++,
GCCc0w0(arg1->unk_00, arg1->unk_02, arg1->unk_04, arg1->unk_06) | GCCc1w0(arg1->unk_08, arg1->unk_0A),

GCCc0w1(arg1->unk_01, arg1->unk_03, arg1->unk_05, arg1->unk_07) |
GCCc1w1(arg1->unk_09, arg1->unk_0C, arg1->unk_0E, arg1->unk_0B, arg1->unk_0D, arg1->unk_0F));
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/12D80/func_80015400.s")
#endif

void func_8001550C(void) {
if (D_800ABB08 == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/12D80.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void func_8001533C(s32 arg0);
void func_80015348(void);
s32 func_80015360(void);
Vec3f* func_80015390(unk_D_86002F58_004_000* arg0, s16 arg1, Vec3f* arg2);
void func_80015400(Gfx* arg0, u8* arg1);
void func_80015400(Gfx* arg0, arg1_func_81407874_014_000_010* arg1);
void func_8001550C(void);
void func_8001554C(void);
void func_80015684(void);
Expand Down
24 changes: 12 additions & 12 deletions src/fragments/3/fragment3_119FB0.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ void func_87901A28(unk_D_8140E728* arg0) {
s16 sp2C;
unk_D_8140E728_01C* temp_v0 = arg0->unk_1C;
s16 temp_v1 = arg0->unk_24;
unk_D_8140E728_01C_004* unk_04 = temp_v0->unk_04;
unk_D_8140E728_01C_004_1* unk_04 = temp_v0->unk_04.a;

if ((temp_v0->unk_00 == 1) && (unk_04->unk_00 == 1)) {
func_87901958(func_81407B5C(temp_v1 & 0xFF), arg0, 0);
func_87901958(func_81407B5C(temp_v1), arg0, 0);
} else {
for (i = 0; i < sp2C; i++) {
func_87901958(func_81407B3C(), arg0, i);
Expand Down Expand Up @@ -176,9 +176,9 @@ void func_87901B08(void) {
}

void func_87901BB0(unk_D_8140E720* arg0) {
D_8140E628.x = arg0->unk_28;
D_8140E628.y = arg0->unk_28;
D_8140E628.z = arg0->unk_28;
D_8140E628.unk_00.x = arg0->unk_28;
D_8140E628.unk_00.y = arg0->unk_28;
D_8140E628.unk_00.z = arg0->unk_28;
}

void func_87901BD4(unk_D_8140E720* arg0) {
Expand Down Expand Up @@ -218,7 +218,7 @@ void func_87901C98(void) {

gSPDisplayList(gDisplayListHead++, D_8140DB30);

func_8140C204(D_87906054, &gDisplayListHead);
func_8140C204(D_87906054);

gSPDisplayList(gDisplayListHead++, D_8140DAE0);
}
Expand Down Expand Up @@ -249,7 +249,7 @@ void func_87901F04(unk_D_8140E720* arg0) {
break;

case 2:
if (arg0->unk_30 < 0.0f) {
if (arg0->unk_2C.y < 0.0f) {
func_81408150(arg0);
}
break;
Expand Down Expand Up @@ -398,14 +398,14 @@ void func_87902608(unk_D_8140E720* arg0) {
break;

case 2:
if (arg0->unk_54 < 0.0f) {
if (arg0->unk_50.y < 0.0f) {
func_81408150(arg0);
}
break;
}

if (func_8140819C(arg0) != 0) {
if (arg0->unk_30 > 0.0f) {
if (arg0->unk_2C.y > 0.0f) {
func_81408328(arg0);
} else {
func_81408348(arg0);
Expand Down Expand Up @@ -469,7 +469,7 @@ void func_879027F0(unk_D_8140E720* arg0) {

if (func_81408368(arg0) != 0) {
func_81409FD8(arg0);
if (arg0->unk_30 < 0.0f) {
if (arg0->unk_2C.y < 0.0f) {
func_81408150(arg0);
}
}
Expand Down Expand Up @@ -527,7 +527,7 @@ void func_879029F0(unk_D_8140E720* arg0) {

if (func_81408368(arg0) != 0) {
func_81409FD8(arg0);
if (arg0->unk_30 < 0.0f) {
if (arg0->unk_2C.y < 0.0f) {
func_81408150(arg0);
}
}
Expand Down Expand Up @@ -560,7 +560,7 @@ void func_87902C9C(unk_D_8140E720* arg0) {
break;

case 2:
if (arg0->unk_54 < -2.5f) {
if (arg0->unk_50.y < -2.5f) {
func_81408150(arg0);
}
break;
Expand Down
18 changes: 0 additions & 18 deletions src/fragments/3/fragment3_11BF90.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,6 @@ void func_879038AC(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s
sp34->unk_000.unk_000.unk_14 = 2;
}

typedef struct arg1_func_87903D64_014 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ unk_D_86002F34_000_014_004* unk_04;
/* 0x08 */ unk_D_86002F34_000_014_004* unk_08;
/* 0x0C */ unk_D_86002F34_000_014_004* unk_0C;
/* 0x10 */ unk_D_86002F34_000_014_010* unk_10;
/* 0x14 */ unk_D_86002F34_000_014_010* unk_14;
/* 0x18 */ unk_D_86002F34_000_014_010* unk_18;
} arg1_func_87903D64_014;

// Possibly unk_D_86002F34_alt7, unk_D_86002F34_alt8,
// unk_D_86002F34_alt9 or unk_D_86002F34_alt2
typedef struct arg1_func_87903D64 {
/* 0x00 */ char unk00[0x14];
/* 0x00 */ arg1_func_87903D64_014* unk_14;
/* 0x18 */ Gfx* unk_18;
} arg1_func_87903D64; // size >= 0x1C

#ifdef NON_MATCHING
Gfx* func_87903920(Gfx* arg0, arg1_func_87903D64_014* arg1) {
s32 sp38;
Expand Down
Loading

0 comments on commit 1f22b01

Please sign in to comment.