Skip to content

Commit 0f28ab4

Browse files
authored
Merge pull request #164 from Kelebek1/fragment23
fragment23
2 parents c0ff344 + 65205b7 commit 0f28ab4

35 files changed

+11319
-364
lines changed

include/color.h

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ typedef union{
7979
} Color_RGBA14;
8080

8181
#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0))
82+
#define RGBA5551(r, g, b, a) ((((r) << 8) & 0xF800) | (((g) << 3) & 0x7C0) | (((b) >> 2) & 0x3E) | ((a) & 0x1))
8283

8384
#define RGBA16_GET_R(pixel) ((((pixel) & 0xF800) >> 11) & 0xFF)
8485
#define RGBA16_GET_G(pixel) ((((pixel) & 0x7C0) >> 6) & 0xFF)

include/global.h

+15-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
typedef unsigned int uintptr_t;
88

99
#include "macros.h"
10-
1110
#include "attributes.h"
1211
#include "functions.h"
13-
#include "variables.h"
1412
#include "sections.h"
1513
#include "gfx.h"
1614
#include "color.h"
1715
#include "sound.h"
16+
#include "string.h"
1817
#include "math.h"
1918

2019
typedef struct unk_D_86002F58_004_000_00C_028 {
@@ -502,4 +501,18 @@ typedef struct arg1_func_81407874_014_000_010 {
502501
/* 0x0F */ u8 unk_0F;
503502
} arg1_func_81407874_014_000_010; // size >= 0x10
504503

504+
typedef struct func_88002628_sp38 {
505+
/* 0x000 */ OSThread thread;
506+
/* 0x1B0 */ char unk1B0[0x10];
507+
} func_88002628_sp38; // size = 0x1C0
508+
509+
typedef struct unk_func_88500020 {
510+
/* 0x00 */ s32 unk_00;
511+
/* 0x04 */ s32 unk_04;
512+
/* 0x08 */ s32 unk_08;
513+
/* 0x0C */ u8* unk_0C;
514+
} unk_func_88500020; // size = 0x10
515+
516+
#include "variables.h"
517+
505518
#endif

include/variables.h

+16
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ extern u8 D_04008000[];
101101
extern u8 D_04009000[];
102102
extern u8 D_0400A000[];
103103
extern u8 D_0400B000[];
104+
extern u8 D_4006A60[];
105+
extern u8 D_40022E0[];
106+
extern u8 D_4002368[];
107+
extern u8 D_40025F0[];
108+
extern u8 D_4002878[];
109+
extern u8 D_4002B00[];
110+
extern u8 D_4002D88[];
111+
extern u8 D_4003010[];
112+
extern u8 D_4003298[];
113+
extern u8 D_4003520[];
114+
extern u8 D_4001638[];
115+
extern u8 D_4001680[];
116+
extern u8 D_40016C8[];
117+
extern u8 D_4001710[];
104118

105119
extern u8 D_800818E0[0x20];
106120

@@ -212,4 +226,6 @@ typedef struct unk_D_70B10 {
212226
/* 0x00 */ char unk00[0x20];
213227
} unk_D_70B10; // size = 0x20
214228

229+
extern unk_func_88500020 D_800758E0;
230+
215231
#endif

linker_scripts/us/symbol_addrs.txt

+19
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,22 @@ D_86C11530 = 0x86C11530; // size:0xAD0
359359
D_879060BC = 0x879060BC; // size:0x2
360360
D_86E04D60 = 0x86E04D60; // size:0xAD0
361361
D_86E05830 = 0x86E05830; // size:0x3610
362+
D_4006A60 = 0x4006A60;
363+
D_40022E0 = 0x40022E0;
364+
D_4002368 = 0x4002368;
365+
D_40025F0 = 0x40025F0;
366+
D_4002878 = 0x4002878;
367+
D_4002B00 = 0x4002B00;
368+
D_4002D88 = 0x4002D88;
369+
D_4003010 = 0x4003010;
370+
D_4003298 = 0x4003298;
371+
D_4003520 = 0x4003520;
372+
D_88217C20 = 0x88217C20; // size:0x4
373+
D_88217C24 = 0x88217C24; // size:0x4
374+
D_88217C28 = 0x88217C28; // size:0x4
375+
D_88217C2C = 0x88217C2C; // size:0x4
376+
D_88217C48 = 0x88217C48; // size:0x4
377+
D_88217C4C = 0x88217C4C; // size:0x4
378+
D_88217C50 = 0x88217C50; // size:0x4
379+
D_88217C54 = 0x88217C54; // size:0x4
380+
D_88217C58 = 0x88217C58; // size:0x4

src/19840.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ typedef struct unk_func_80019600 {
1717
/* 0x04 */ OSMesgQueue* queue;
1818
/* 0x08 */ void* unk_08;
1919
/* 0x0C */ void* unk_0C;
20-
/* 0x10 */ struct MainPoolState* pool;
20+
/* 0x10 */ MainPoolState* pool;
2121
/* 0x14 */ s32 size;
2222
/* 0x18 */ arg1_func_80010CA8 unk_18;
2323
} unk_func_80019600; // size >= 0x1C

src/1AB70.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "global.h"
1+
#include "1AB70.h"
22

33
#pragma GLOBAL_ASM("asm/us/nonmatchings/1AB70/func_80019F70.s")
44

src/1AB70.h

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef _1AB70_H_
2+
#define _1AB70_H_
3+
4+
#include "global.h"
5+
6+
typedef struct unk_func_88201DA0_034_008 {
7+
/* 0x00 */ char unk00[0x4];
8+
} unk_func_88201DA0_034_008; // size >= 1
9+
10+
void func_8001B058(void);
11+
void func_8001B0DC(unk_func_88201DA0_034_008*, s32, s32);
12+
13+
14+
#endif // _1AB70_H_

src/22630.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ char* func_80021B7C(char* arg0, char* arg1) {
122122

123123
#pragma GLOBAL_ASM("asm/us/nonmatchings/22630/func_80021C20.s")
124124

125-
void func_80021C40(char* arg0, char* arg1) {
125+
char* func_80021C40(char* arg0, char* arg1) {
126126
char sp1C[11];
127127

128128
_bcopy(arg1, sp1C, 0xA);
129129

130130
sp1C[10] = 'P';
131131

132-
func_80021A90(arg0, sp1C);
132+
return func_80021A90(arg0, sp1C);
133133
}
134134

135135
extern char D_8006FEE8[][0x1C];

src/22630.h

+60-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "global.h"
55
#include "memory.h"
66
#include "29BA0.h"
7+
#include "2D340.h"
78

89
typedef enum {
910
POKEMON_ROM_NONE = 0,
@@ -51,6 +52,48 @@ typedef struct unk_D_800AE4E8_004_1_000_010 {
5152
/* 0x2C */ u8 unk_2C[11];
5253
} unk_D_800AE4E8_004_1_000_010; // size = 0x37
5354

55+
typedef struct unk_func_80022C28_ret {
56+
/* 0x00 */ s8 unk_00;
57+
/* 0x01 */ s8 unk_01;
58+
/* 0x02 */ s8 unk_02;
59+
/* 0x03 */ s8 unk_03;
60+
/* 0x04 */ s8 unk_04;
61+
/* 0x05 */ char unk05[0x3];
62+
/* 0x08 */ s16 unk_08;
63+
/* 0x0A */ s16 unk_0A;
64+
} unk_func_80022C28_ret; // size = 0xC
65+
66+
typedef struct unk_func_8820BE14_sp {
67+
/* 0x00 */ u8 unk_00;
68+
/* 0x01 */ char unk01[0x3];
69+
/* 0x04 */ u8 unk_04;
70+
/* 0x05 */ char unk05[0x1];
71+
/* 0x06 */ u8 unk_06;
72+
/* 0x07 */ u8 unk_07;
73+
/* 0x08 */ u8 unk_08;
74+
/* 0x09 */ u8 unk_09;
75+
/* 0x0A */ u8 unk_0A;
76+
/* 0x0B */ u8 unk_0B;
77+
/* 0x0C */ u8 unk_0C;
78+
/* 0x0E */ s16 unk_0E;
79+
/* 0x0E */ s32 unk_10;
80+
/* 0x0E */ s16 unk_14;
81+
/* 0x0E */ s16 unk_16;
82+
/* 0x0E */ s16 unk_18;
83+
/* 0x0E */ s16 unk_1A;
84+
/* 0x0E */ s16 unk_1C;
85+
/* 0x0E */ s16 unk_1E;
86+
/* 0x20 */ char unk20[0x4];
87+
/* 0x24 */ u8 unk_24;
88+
/* 0x25 */ u8 unk_25;
89+
/* 0x26 */ char unk26[0xA];
90+
/* 0x30 */ char unk_30[11];
91+
/* 0x3B */ char unk_3B[11];
92+
/* 0x46 */ char unk46[0xC];
93+
/* 0x52 */ u8 unk_52;
94+
/* 0x53 */ u8 unk_53;
95+
} unk_func_8820BE14_sp; // size = 0x54
96+
5497
u16 func_80021A30(u8* arg0);
5598
u32 func_80021A48(u8* arg0);
5699
void func_80021A68(u8* arg0, s32 arg1);
@@ -59,7 +102,7 @@ char* func_80021A90(char* arg0, char* arg1);
59102
void func_80021B5C(char*, char*);
60103
char* func_80021B7C(char* arg0, char* arg1);
61104
void func_80021C20(char*, char*);
62-
void func_80021C40(char* arg0, char* arg1);
105+
char* func_80021C40(char* arg0, char* arg1);
63106
char* func_80021C80(char* arg0, char* arg1);
64107
char* func_80021CA4(char* arg0, s32 arg1);
65108
char* func_80021CE0(s32 arg0, s8* arg1);
@@ -71,11 +114,16 @@ u32 func_80022170(s32 arg0, s32 arg1, u16 arg2, u16 arg3, s32 arg4);
71114
void func_80022338(unk_func_80026268_arg0* arg0);
72115
u32 func_800224B8(s32 arg0, u16 arg1);
73116
u16 func_800226C0(s32 arg0, u32 arg1);
117+
void func_80022734(unk_func_8820BE14_sp*);
118+
void func_800228B0(unk_func_8820BE14_sp*);
74119
u8 func_80022A38(s32 arg0);
75120
u8 func_80022A60(s32 arg0);
76-
s32 func_80022C28(s32, s32, s32, s32);
77-
void func_80022D8C(void*);
78-
s32 func_80022E18(unk_func_80026268_arg0*, s32, void*);
121+
unk_func_80022C28_ret* func_80022C28(s32, s32, s32, s32);
122+
unk_func_80022C28_ret* func_80022CC0(s32, s32, s32, s32, char*, s32);
123+
void func_80022D24(unk_func_80022C28_ret*);
124+
void func_80022D8C(unk_func_80022C28_ret*);
125+
s32 func_80022E18(unk_func_80026268_arg0*, s32, unk_func_80022C28_ret*);
126+
s32 func_80022F24(unk_func_88205880_00D0*, s32, unk_func_80022C28_ret*);
79127
void func_80023068(void);
80128
char* func_8002311C(s32 arg0);
81129
s32 func_80023130(u8* arg0);
@@ -90,12 +138,19 @@ void func_80023D60(s32);
90138
void func_80023F78(s32 arg0);
91139
void func_80024040(s32 arg0);
92140
s32 func_800240A0(void);
141+
void func_80024208(s32);
93142
s32 func_80024A48(s32, s32, s32);
94143
s32 func_80024EF4(void);
95144
s32 func_80024F00(s32);
145+
u8 func_80024F68(s32);
96146
s32 func_80024FB0(s32 arg0);
97-
void func_800251B0(s32, s8*);
147+
s32 func_80025084(s32);
148+
s32 func_8002513C(s32);
149+
char* func_800251B0(s32, s8*);
98150
s32 func_80025370(s32);
99151
s32 func_8002539C(s32);
152+
void func_80025540(s32);
153+
void func_800256F4(s32, s32, s32);
154+
void func_80026E4C(s32);
100155

101156
#endif // _6BC0_H_

src/26820.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -721,11 +721,13 @@ s32 func_8002797C(s32 arg0, s32 arg1, s32 arg2, void* arg3) {
721721
break;
722722

723723
case 22:
724-
_bcopy(&D_800AE4E8[2].unk_04.unk2->unk_1EC8.unk_0002[arg2], arg3, 0x8C);
724+
_bcopy(&D_800AE4E8[2].unk_04.unk2->unk_1EC8.unk_0002[arg2], arg3,
725+
sizeof(unk_D_800AE4E8_004_2_1EC8_0002));
725726
break;
726727

727728
case 23:
728-
_bcopy(&D_800AE4E8[2].unk_04.unk2->unk_3280.unk_0002[arg2], arg3, 0x8C);
729+
_bcopy(&D_800AE4E8[2].unk_04.unk2->unk_3280.unk_0002[arg2], arg3,
730+
sizeof(unk_D_800AE4E8_004_2_1EC8_0002));
729731
break;
730732
}
731733
sp2C = 1;

src/26820.h

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ void func_80026C0C(s32 arg0, s32 arg1);
5252
void func_8002707C(s32 arg0, s32 arg1);
5353
s32 func_800270AC(s32 arg0);
5454
s32 func_80027108(s32 arg0);
55+
s32 func_80027164(s32, s32);
56+
s32 func_80027184(s32, s32);
57+
void func_800272BC(s32, s32, char*);
5558
s16 func_800275E0(s32 arg0, s32 arg1);
5659
s32 func_8002797C(s32 arg0, s32 arg1, s32 arg2, void* arg3);
5760
s32 func_80027C24(s32 arg0, s32 arg1, s32 arg2, void* arg3);

src/2C1C0.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void func_8002BA34(s16 arg0, s16 arg1, s16 arg2, s16 arg3) {
224224
void func_8002BB7C(s32 arg0, s32 arg1, s32 arg2) {
225225
s32 i;
226226
unk_func_80026268_arg0 sp48;
227-
void* temp_v0;
227+
unk_func_80022C28_ret* temp_v0;
228228
unk_D_800AE540_0004* temp_s4;
229229
char sp34[11];
230230

src/2D340.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "global.h"
1+
#include "2D340.h"
22

33
#pragma GLOBAL_ASM("asm/us/nonmatchings/2D340/func_8002C740.s")
44

src/2D340.h

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#ifndef _3D340_H_
2+
#define _3D340_H_
3+
4+
#include "global.h"
5+
#include "src/1C720.h"
6+
#include "src/1AB70.h"
7+
8+
typedef struct unk_func_88205880_00D0 {
9+
/* 0x000 */ unk_func_80026268_arg0 unk_000[20];
10+
/* 0x690 */ s32 unk_690;
11+
/* 0x694 */ s32 unk_694;
12+
/* 0x698 */ s32 unk_698;
13+
/* 0x69C */ u32 unk_69C;
14+
} unk_func_88205880_00D0; // size = 0x6A0
15+
16+
typedef struct unk_func_88200FA0_030_038 {
17+
/* 0x00 */ unk_func_88205880_00D0** unk_00;
18+
/* 0x04 */ s32 unk_04;
19+
/* 0x08 */ s32 unk_08;
20+
} unk_func_88200FA0_030_038; // size = 0xC
21+
22+
typedef struct unk_func_88201DA0_034 {
23+
/* 0x0000 */ s32 unk_000;
24+
/* 0x0004 */ char unk004[0x4];
25+
/* 0x0008 */ unk_func_88201DA0_034_008 unk_008;
26+
/* 0x000C */ char unk00C[0xC7C];
27+
} unk_func_88201DA0_034; // size = 0xC88
28+
29+
typedef struct unk_func_88201DA0_038 {
30+
/* 0x00 */ unk_func_88201DA0_034* unk_00;
31+
/* 0x04 */ s32 unk_04;
32+
/* 0x08 */ s32 unk_08;
33+
/* 0x0C */ s32 unk_0C;
34+
} unk_func_88201DA0_038; // size = 0x10
35+
36+
typedef struct unk_func_88205880_A030 {
37+
/* 0x00 */ unk_func_88205880_00D0** unk_00;
38+
/* 0x04 */ s32 unk_04;
39+
/* 0x08 */ s32 unk_08;
40+
} unk_func_88205880_A030; // size = 0xC
41+
42+
typedef struct unk_func_8820BE14_06C_000 {
43+
/* 0x00 */ s32 unk_00;
44+
/* 0x04 */ unk_func_88200FA0_030_038 unk_04;
45+
} unk_func_8820BE14_06C_000; // size = 0x10
46+
47+
typedef struct unk_func_8820BE14_06C {
48+
/* 0x00 */ unk_func_8820BE14_06C_000* unk_00;
49+
/* 0x04 */ s32 unk_04;
50+
/* 0x08 */ s32 unk_08;
51+
/* 0x0C */ s32 unk_0C;
52+
} unk_func_8820BE14_06C; // size = 0x10
53+
54+
void func_8002C740(s8*, unk_func_88201DA0_034*, s32, s32, s32);
55+
void func_8002C758(unk_func_8820BE14_06C*, s32, s32, MemoryPool*);
56+
void func_8002C88C(unk_func_8820BE14_06C*, u8*, s32);
57+
void func_8002C990(unk_func_8820BE14_06C*, s32);
58+
void func_8002CBC0(unk_func_88200FA0_030_038*, s32, MemoryPool*);
59+
void func_8002CBB0(unk_func_88205880_A030*, void*, s32, s32);
60+
void func_8002CC2C(unk_func_88200FA0_030_038*, char*, s32);
61+
void func_8002D3F0(f32*);
62+
Color_RGBA8 func_8002D444(Color_RGBA8, f32);
63+
64+
#endif // _3D340_H_

src/2E460.h

+22-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,31 @@
22
#define _2E460_H_
33

44
#include "global.h"
5-
#include "src/fragments/26/fragment26.h"
65

6+
typedef struct ret_func_8002ED08 {
7+
/* 0x00 */ u8 unk_00[12];
8+
} ret_func_8002ED08; // size = 0xC
9+
10+
typedef struct unk_func_8820E99C_030_030 {
11+
/* 0x00 */ s32 unk_00;
12+
/* 0x04 */ s32 unk_04;
13+
/* 0x08 */ s32 unk_08;
14+
/* 0x0C */ s32 unk_0C;
15+
/* 0x10 */ s32 unk_10;
16+
} unk_func_8820E99C_030_030; // size = 0x14
17+
18+
void func_8002D8C8(unk_func_88500020*, s32, s32);
19+
s32 func_8002EC08(s32);
20+
s32 func_8002ECDC(s32);
21+
s32 func_8002E0F4(unk_func_8820E99C_030_030*);
22+
void func_8002E8E4(s32, s32, s32, s32);
23+
s32 func_8002EE1C(s32, s32, s32);
724
void func_8002EE78(void);
8-
void func_8002EEA8(unk_func_88001300_034*);
25+
void func_8002EEA8(OSMesg);
26+
ret_func_8002ED08* func_8002ED08(u8);
927
void func_8002EF18(s32*);
1028
void func_8002EF44(void);
29+
s32 func_8002F1C0(u8);
30+
s32 func_8002F264(s32);
1131

1232
#endif // _2E460_H_

0 commit comments

Comments
 (0)