Skip to content

Commit 157d058

Browse files
authored
Merge pull request pret#111 from Kelebek1/various
4BA90 and fixes
2 parents 0e69e2e + e5f85e4 commit 157d058

24 files changed

+543
-377
lines changed

include/global.h

+44-37
Original file line numberDiff line numberDiff line change
@@ -15,63 +15,63 @@ typedef unsigned int uintptr_t;
1515
#include "color.h"
1616
#include "math.h"
1717

18-
typedef struct unk_D_86002F58_004_00C_028 {
18+
typedef struct unk_D_86002F58_004_000_00C_028 {
1919
/* 0x00 */ char pad0[4];
2020
/* 0x04 */ u8 unk_04;
2121
/* 0x05 */ u8 unk_05;
2222
/* 0x06 */ char pad6[6];
2323
/* 0x0C */ s32* unk_0C;
2424
/* 0x10 */ s32* unk_10;
25-
} unk_D_86002F58_004_00C_028; // size >= 0x14
25+
} unk_D_86002F58_004_000_00C_028; // size >= 0x14
2626

27-
typedef unk_D_86002F58_004_00C_028* (*unk_D_86002F58_004_00C_028_func)(s32, s32);
27+
typedef unk_D_86002F58_004_000_00C_028* (*unk_D_86002F58_004_000_00C_028_func)(s32, s32);
2828

29-
typedef struct unk_D_86002F58_004_00C {
29+
typedef struct unk_D_86002F58_004_000_00C {
3030
/* 0x00 */ char unk_00[0x28];
31-
/* 0x28 */ unk_D_86002F58_004_00C_028_func unk_28;
32-
} unk_D_86002F58_004_00C; // size >= 0x2C
31+
/* 0x28 */ unk_D_86002F58_004_000_00C_028_func unk_28;
32+
} unk_D_86002F58_004_000_00C; // size >= 0x2C
3333

34-
typedef struct unk_D_86002F58_004_010 {
35-
/* 0x00 */ u8 unk_00;
36-
/* 0x01 */ char unk_01[0x23];
37-
/* 0x24 */ s32 unk_24;
38-
/* 0x28 */ s32 unk_28;
39-
} unk_D_86002F58_004_010; // size >= 0x2C
40-
41-
typedef struct unk_func_8001BCF0 {
34+
typedef struct unk_D_86002F58_004_000_010 {
4235
/* 0x00 */ u8 unk_00;
43-
/* 0x01 */ u8 unk_01;
44-
/* 0x04 */ unk_D_86002F58_004_00C* unk_04;
45-
/* 0x08 */ unk_D_86002F58_004_010* unk_08;
46-
} unk_func_8001BCF0; // size >= 0x0C
47-
48-
typedef struct unk_D_86002F58_004 {
36+
/* 0x01 */ char unk_01[0x23];
37+
/* 0x24 */ s32 unk_24;
38+
/* 0x28 */ s32 unk_28;
39+
} unk_D_86002F58_004_000_010; // size >= 0x2C
40+
41+
typedef struct unk_D_86002F58_004_000_004 {
42+
/* 0x00 */ struct unk_D_86002F58_004_000_004* unk_00;
43+
/* 0x04 */ unk_D_86002F58_004_000_00C* unk_04;
44+
/* 0x08 */ unk_D_86002F58_004_000_010* unk_08;
45+
} unk_D_86002F58_004_000_004; // size >= 0x0C
46+
47+
typedef struct unk_D_86002F58_004_000 {
4948
/* 0x000 */ u8 unk_000;
5049
/* 0x001 */ u8 unk_001;
5150
/* 0x002 */ u8 unk_002;
52-
/* 0x004 */ unk_func_8001BCF0 unk_004;
53-
/* 0x010 */ char unk010[0x8];
51+
/* 0x003 */ u8 unk_003;
52+
/* 0x004 */ struct unk_D_86002F58_004_000* unk_004;
53+
/* 0x008 */ struct unk_D_86002F58_004_000* unk_008;
54+
/* 0x00C */ unk_D_86002F58_004_000_00C* unk_00C;
55+
/* 0x010 */ s32 unk_010;
56+
/* 0x014 */ s32 unk_014;
5457
/* 0x018 */ s16 unk_018;
5558
/* 0x01A */ s16 unk_01A;
5659
/* 0x01C */ u8 unk_01C;
5760
/* 0x01D */ u8 unk_01D;
58-
/* 0x01E */ char unk01E[0x2];
59-
/* 0x020 */ s16 unk_020;
60-
/* 0x024 */ f32 unk_024;
61-
/* 0x028 */ f32 unk_028;
62-
/* 0x02C */ f32 unk_02C;
63-
/* 0x030 */ f32 unk_030;
64-
/* 0x034 */ f32 unk_034;
65-
/* 0x038 */ f32 unk_038;
61+
/* 0x01E */ Vec3s unk_01E;
62+
/* 0x024 */ Vec3f unk_024;
63+
/* 0x030 */ Vec3f unk_030;
6664
/* 0x03C */ s32 unk_03C;
6765
/* 0x040 */ s16 unk_040;
6866
/* 0x044 */ s32 unk_044;
6967
/* 0x048 */ s32 unk_048;
7068
/* 0x04C */ u32 unk_04C;
71-
/* 0x050 */ char pad50[4];
69+
/* 0x050 */ char pad50[2];
70+
/* 0x052 */ s16 unk_052;
7271
/* 0x054 */ s16 unk_054;
7372
/* 0x058 */ s32 unk_058;
74-
/* 0x05C */ char pad5C[4];
73+
/* 0x05C */ s16 unk_05C;
74+
/* 0x05E */ s16 unk_05E;
7575
/* 0x060 */ s32 unk_060;
7676
/* 0x064 */ char pad64[0x3C];
7777
/* 0x0A0 */ s32 unk_0A0;
@@ -81,9 +81,9 @@ typedef struct unk_D_86002F58_004 {
8181
/* 0x0AC */ f32 unk_0AC;
8282
/* 0x0B0 */ f32 unk_0B0;
8383
/* 0x0B4 */ char padB4[0xB4];
84-
} unk_D_86002F58_004; // size = 0x168
84+
} unk_D_86002F58_004_000; // size = 0x168
8585

86-
// possibly unk_D_86002F58_004
86+
// possibly unk_D_86002F58_004_000
8787
typedef struct unk_D_86002F34_00C {
8888
/* 0x00 */ char pad0[0x24];
8989
/* 0x24 */ MtxF* unk_024;
@@ -109,10 +109,17 @@ typedef struct unk_D_86002F34 {
109109
/* 0x0C */ unk_D_86002F34_00C* unk_0C;
110110
} unk_D_86002F34; // size >= 0x10
111111

112+
// Are unk_D_86002F30 and unk_D_800AC840 the same?
112113
typedef struct unk_D_86002F30 {
113-
/* 0x00 */ char unk_00[0x8];
114-
/* 0x08 */ unk_func_8001BCF0** unk_08;
115-
} unk_D_86002F30; // size >= 0xC
114+
/* 0x00 */ char unk00[0x8];
115+
/* 0x08 */ unk_D_86002F58_004_000_004* unk_08[4];
116+
} unk_D_86002F30; // size = 0x18 ??
117+
118+
typedef struct unk_D_800AC840 {
119+
/* 0x00 */ char pad0[0xC];
120+
/* 0x0C */ unk_D_86002F58_004_000* unk_0C;
121+
/* 0x10 */ char pad10[8];
122+
} unk_D_800AC840; // size = 0x18
116123

117124
struct UnkInputStruct8000D738 {
118125
s32 unk0;

include/variables.h

+14-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ typedef struct unk_D_800A7440 {
9595
} unk_D_800A7440; // size >= 0x8
9696
extern unk_D_800A7440 D_800A7440;
9797

98-
extern struct unk_D_86002F58_004 D_800AC840;
99-
extern struct unk_D_86002F58_004 D_800AC858;
100-
extern struct unk_D_86002F58_004* D_8006F09C;
98+
99+
100+
extern struct unk_D_800AC840 D_800AC840;
101+
extern struct unk_D_800AC840 D_800AC858;
102+
extern struct unk_D_86002F58_004_000* D_8006F09C;
101103

102104
extern s32 D_8006F050[];
103105
extern s16 D_8006F05C[];
@@ -136,4 +138,13 @@ extern unk_D_800AC870* D_800AC870;
136138

137139
extern Gfx D_8006F498[];
138140

141+
extern f32 D_80077DD4;
142+
extern f32 D_80077DD8;
143+
extern f32 D_80077DDC;
144+
extern f32 D_80077DE0;
145+
extern s8 D_80077DE4;
146+
extern s32 D_80078E60;
147+
extern s32 D_80078E64;
148+
extern s32 D_80078E68;
149+
139150
#endif

src/11BA0.c

+75-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
#include "global.h"
22
#include "11BA0.h"
33

4-
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80010FA0.s")
4+
void func_80010FA0(unk_D_86002F58_004_000* arg0, u8 arg1) {
5+
if (arg0 != NULL) {
6+
arg0->unk_000 = arg1;
7+
arg0->unk_001 = 0x11;
8+
arg0->unk_002 = 0;
9+
arg0->unk_003 = 0;
10+
arg0->unk_004 = arg0;
11+
arg0->unk_008 = arg0;
12+
arg0->unk_00C = NULL;
13+
arg0->unk_010 = 0;
14+
arg0->unk_014 = 0;
15+
}
16+
}
517

618
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80010FDC.s")
719

8-
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_8001103C.s")
20+
unk_D_86002F58_004_000* func_8001103C(MainPoolState* arg0, void* arg1) {
21+
if (arg0 != 0) {
22+
arg1 = func_80002DCC(arg0, 0x18, 4);
23+
}
24+
25+
if (arg1 != NULL) {
26+
func_80010FA0(arg1, 0);
27+
}
28+
29+
return arg1;
30+
}
931

1032
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011088.s")
1133

@@ -45,7 +67,38 @@
4567

4668
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800118D0.s")
4769

48-
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011938.s")
70+
unk_D_86002F58_004_000* func_80011938(s32 arg0, unk_D_86002F58_004_000* arg1, s16 arg2, Vec3f* arg3, Vec3s* arg4,
71+
Vec3f* arg5) {
72+
if (arg0 != 0) {
73+
arg1 = func_80002DCC(arg0, 0x168, 4);
74+
}
75+
76+
if (arg1 != NULL) {
77+
arg1->unk_018 = 0;
78+
arg1->unk_01A = arg2;
79+
arg1->unk_024 = *arg3;
80+
arg1->unk_030 = *arg5;
81+
arg1->unk_01E = *arg4;
82+
arg1->unk_01D = 0xFF;
83+
arg1->unk_01C = 0;
84+
arg1->unk_0A6 = 0;
85+
arg1->unk_0A0 = -0x100;
86+
arg1->unk_03C = -0x100;
87+
arg1->unk_040 = 0;
88+
arg1->unk_044 = 0;
89+
arg1->unk_048 = 0;
90+
arg1->unk_04C = 0x10000;
91+
arg1->unk_052 = 0;
92+
arg1->unk_054 = 0;
93+
arg1->unk_058 = 0;
94+
arg1->unk_05C = 0;
95+
arg1->unk_05E = 0;
96+
func_80010FA0(arg1, 0x16);
97+
arg1->unk_002 |= 0x60;
98+
}
99+
100+
return arg1;
101+
}
49102

50103
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80011A3C.s")
51104

@@ -71,7 +124,25 @@
71124

72125
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80012044.s")
73126

74-
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_80012094.s")
127+
void func_80012094(unk_D_800AC840* arg0, unk_D_86002F58_004_000* arg1) {
128+
unk_D_86002F58_004_000* temp_v0;
129+
unk_D_86002F58_004_000_004* temp_v1;
130+
131+
if ((arg0 != NULL) && (arg1 != NULL)) {
132+
temp_v0 = arg0->unk_0C;
133+
if (temp_v0 == NULL) {
134+
arg0->unk_0C = arg1;
135+
arg1->unk_004 = arg1;
136+
arg1->unk_008 = arg1;
137+
} else {
138+
temp_v1 = temp_v0->unk_004;
139+
arg1->unk_008 = temp_v0;
140+
arg1->unk_004 = temp_v1;
141+
temp_v0->unk_004 = arg1;
142+
temp_v1->unk_08 = arg1;
143+
}
144+
}
145+
}
75146

76147
#pragma GLOBAL_ASM("asm/us/nonmatchings/11BA0/func_800120DC.s")
77148

src/11BA0.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
#define _11BA0_H_
33

44
#include "global.h"
5+
#include "src/memory.h"
56

6-
void func_8001103C(s32, unk_D_86002F58_004*);
7-
void func_80011938(s32, unk_D_86002F58_004*, s32, s32*, s16*, f32*);
8-
void func_80012094(unk_D_86002F58_004*, unk_D_86002F58_004*);
7+
unk_D_86002F58_004_000* func_8001103C(MainPoolState*, void*);
8+
unk_D_86002F58_004_000* func_80011938(s32 arg0, unk_D_86002F58_004_000* arg1, s16 arg2, Vec3f* arg3, Vec3s* arg4, Vec3f* arg5);
9+
void func_80012094(unk_D_800AC840*, unk_D_86002F58_004_000*);
910

1011

1112
#endif // _11BA0_H_

src/12D80.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
void func_80015094(unk_D_86002F34*);
77
void func_80015348(void);
8-
s32 func_80015390(unk_D_86002F58_004*, s16, Vec3f*);
8+
s32 func_80015390(unk_D_86002F58_004_000*, s16, Vec3f*);
99

1010

1111
#endif // _12D80_H_

src/17300.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include "global.h"
55

6-
void func_800173CC(unk_D_86002F58_004*);
7-
void func_800173DC(unk_D_86002F58_004*, s16, s32, s32);
8-
s32 func_80017514(unk_D_86002F58_004*);
6+
void func_800173CC(unk_D_86002F58_004_000*);
7+
void func_800173DC(unk_D_86002F58_004_000*, s16, s32, s32);
8+
s32 func_80017514(unk_D_86002F58_004_000*);
99

1010
#endif // _17300_H_

src/18140.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "global.h"
55

6-
void func_80017788(unk_D_86002F58_004*);
7-
void func_80017798(unk_D_86002F58_004*, s16, s32, s32);
6+
void func_80017788(unk_D_86002F58_004_000*);
7+
void func_80017798(unk_D_86002F58_004_000*, s16, s32, s32);
88

99
#endif // _18140_H_

src/19840.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
#include "global.h"
55
#include "src/memory.h"
66

7-
// seems like unk_D_86002F58_004, but unk_20 and unk_24 need to be s32
7+
// seems like unk_D_86002F58_004_000, but unk_20 and unk_24 need to be s32
88
typedef struct unk_func_8001C248 {
99
/* 0x000 */ u8 unk_000;
1010
/* 0x001 */ u8 unk_001;
1111
/* 0x002 */ u8 unk_002;
1212
/* 0x003 */ char pad3[9];
13-
/* 0x00C */ unk_D_86002F58_004_00C* unk_00C;
14-
/* 0x010 */ unk_D_86002F58_004_010* unk_010;
13+
/* 0x00C */ unk_D_86002F58_004_000_00C* unk_00C;
14+
/* 0x010 */ unk_D_86002F58_004_000_010* unk_010;
1515
/* 0x024 */ s32 unk_014;
1616
/* 0x018 */ s16 unk_018;
1717
/* 0x01A */ s16 unk_01A;
@@ -23,13 +23,13 @@ typedef struct unk_func_8001C248 {
2323
} unk_func_8001C248;
2424

2525
void func_8001987C(void);
26-
void func_80019A7C(unk_D_86002F58_004_010*, s32, s32, unk_func_8001C248*);
27-
s32 func_80019C08(unk_D_86002F58_004_010*, unk_func_8001C248*);
28-
s32 func_80019C58(unk_D_86002F58_004_010*, unk_func_8001C248*);
29-
s32 func_80019CA8(unk_D_86002F58_004_010*);
30-
void func_80019CE0(unk_D_86002F58_004_010*);
26+
void func_80019A7C(unk_D_86002F58_004_000_010*, s32, s32, unk_func_8001C248*);
27+
s32 func_80019C08(unk_D_86002F58_004_000_010*, unk_func_8001C248*);
28+
s32 func_80019C58(unk_D_86002F58_004_000_010*, unk_func_8001C248*);
29+
s32 func_80019CA8(unk_D_86002F58_004_000_010*);
30+
void func_80019CE0(unk_D_86002F58_004_000_010*);
3131
unk_D_86002F30* func_80019D18(s32);
32-
void func_800198E4(unk_D_86002F58_004_010*, u16, s32);
32+
void func_800198E4(unk_D_86002F58_004_000_010*, u16, s32);
3333

3434

3535
#endif // _19840_H_

0 commit comments

Comments
 (0)