Skip to content

Commit 8b69bff

Browse files
authored
Merge pull request #138 from Kelebek1/various
45720
2 parents b74a731 + efdfc44 commit 8b69bff

File tree

13 files changed

+559
-28
lines changed

13 files changed

+559
-28
lines changed

src/334D0.c

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
#include "334D0.h"
2+
#include "src/12D80.h"
3+
#include "src/30640.h"
4+
#include "src/6A40.h"
5+
#include "src/F420.h"
6+
7+
typedef struct unk_D_800AFFC8 {
8+
/* 0x000 */ s16 unk_000;
9+
/* 0x002 */ char unk002[0x7CE];
10+
} unk_D_800AFFC8; // size = 0x7D0
11+
12+
extern unk_D_800AFFC8 D_800AFFC8[2][3];
213

314
#pragma GLOBAL_ASM("asm/us/nonmatchings/334D0/func_800328D0.s")
415

@@ -10,7 +21,14 @@
1021

1122
#pragma GLOBAL_ASM("asm/us/nonmatchings/334D0/func_80032990.s")
1223

13-
#pragma GLOBAL_ASM("asm/us/nonmatchings/334D0/func_80032A34.s")
24+
void func_80032A34(s32 arg0) {
25+
s32 i;
26+
unk_D_800AFFC8* var_v1 = &D_800AFFC8[arg0];
27+
28+
for (i = 0; i < 3; i++) {
29+
var_v1[i].unk_000 = 0;
30+
}
31+
}
1432

1533
#pragma GLOBAL_ASM("asm/us/nonmatchings/334D0/func_80032A7C.s")
1634

src/373A0.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ u8* D_800FC6B0[3];
7878
u8* D_800FC6C0[3];
7979
unk_D_800FC6CC* D_800FC6CC;
8080
u8* D_800FC6D0;
81-
u32* D_800FC6D4;
81+
unk_D_800FC6D4* D_800FC6D4;
8282
u8* D_800FC6D8;
8383
u8* D_800FC6DC;
8484
u32* D_800FC6E0;

src/373A0.h

+28-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
#include "global.h"
55

6+
#ifdef M2C
7+
#define ENTRY_SIZE 1
8+
#else
9+
#define ENTRY_SIZE
10+
#endif
11+
612
typedef struct File1Header {
713
/* 0x00 */ u32 offset1;
814
/* 0x04 */ u32 wave_tables_offset;
@@ -33,6 +39,27 @@ typedef struct unk_D_800FC6CC {
3339
/* 0x04 */ u32 unk_04;
3440
} unk_D_800FC6CC; // size = 0x8
3541

42+
typedef struct unk_D_800FC6D4_entry {
43+
/* 0x00 */ u16 unk_00;
44+
/* 0x02 */ u8 unk_02;
45+
/* 0x03 */ u8 unk_03;
46+
} unk_D_800FC6D4_entry; // size = 0x4
47+
48+
typedef struct testme {
49+
u32 unk_00;
50+
u32 unk_04;
51+
} testme;
52+
53+
typedef struct unk_D_800FC6D4 {
54+
/* 0x00 */ u16 flags;
55+
/* 0x02 */ u16 num_entries;
56+
/* 0x04 */ u16 unk_04;
57+
/* 0x06 */ u16 unk_06;
58+
/* 0x08 */ testme* offset;
59+
/* 0x0C */ char unk_0C[0x4];
60+
/* 0x10 */ unk_D_800FC6D4_entry entries[ENTRY_SIZE];
61+
} unk_D_800FC6D4; // size = 0x10
62+
3663
extern u8 D_800B32A0[0x493E0];
3764
extern u32* D_800FC680;
3865
extern u8* D_800FC684;
@@ -47,7 +74,7 @@ extern u8* D_800FC6B0[3];
4774
extern u8* D_800FC6C0[3];
4875
extern unk_D_800FC6CC* D_800FC6CC;
4976
extern u8* D_800FC6D0;
50-
extern u32* D_800FC6D4;
77+
extern unk_D_800FC6D4* D_800FC6D4;
5178
extern u8* D_800FC6D8;
5279
extern u8* D_800FC6DC;
5380
extern u32* D_800FC6E0;

src/3D140.c

+14-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,20 @@ s32 func_8003D494(void) {
566566
return D_80077D90;
567567
}
568568

569-
#pragma GLOBAL_ASM("asm/us/nonmatchings/3D140/func_8003D4A0.s")
569+
s32 func_8003D4A0(s32 arg0) {
570+
if (arg0 == 0) {
571+
if (D_800FC818 != D_800FCAD8) {
572+
return 0;
573+
}
574+
D_80077DA8 = 1;
575+
} else {
576+
osAiSetFrequency(D_800FCAD4);
577+
lastInfo = NULL;
578+
dmaState.initialized = 0;
579+
D_80077DA8 = 0;
580+
}
581+
return 1;
582+
}
570583

571584
#pragma GLOBAL_ASM("asm/us/nonmatchings/3D140/func_8003D514.s")
572585

src/3D140.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ OSTask* func_8003CADC(OSTask*);
2525
void __clearAudioDMA(void);
2626
void func_8003D32C(void);
2727
s32 func_8003D494(void);
28-
void func_8003D4A0(s32);
28+
s32 func_8003D4A0(s32);
2929
void func_8003D68C(s32);
3030
void func_8003D918(u32 arg0, u32 arg1);
3131
void func_8003DB84(s32 arg0);

src/435D0.c

+67-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,52 @@
11
#include "435D0.h"
22

3-
#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_800429D0.s")
3+
extern u8 D_800FCD48[8];
4+
extern s8 D_800FCEB4;
5+
extern s32 D_800FCEC8;
6+
extern u8 D_800FCECC;
7+
extern u8 D_800FCECD;
8+
9+
void func_800429D0(void) {
10+
s32 i;
11+
12+
for (i = 0; i < 8; i++) {
13+
if (D_800FCD48[i] != 0) {
14+
func_80042B8C(i);
15+
}
16+
}
17+
}
418

519
#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_80042A2C.s")
620

7-
#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_80042AB0.s")
21+
s32 func_80042AB0(u16 arg0) {
22+
s32 a;
23+
s32 offset;
24+
25+
if (func_800449F8() != 0) {
26+
return 0;
27+
}
28+
29+
func_80044A50(D_800FC6D4);
30+
31+
if (D_800FC6D4->num_entries < arg0) {
32+
return 0;
33+
}
34+
35+
offset = D_800FC6D4->offset;
36+
func_8004473C();
37+
38+
arg0--;
39+
40+
a = D_800FC6D4->entries[arg0].unk_00;
41+
D_800FCEB4 = a;
42+
D_800FCECC = D_800FC6D4->entries[arg0].unk_02;
43+
D_800FCECD = D_800FC6D4->entries[arg0].unk_03;
44+
D_800FCEC8 = offset + (a * 0x18);
45+
46+
func_80044568(a);
47+
48+
return 1;
49+
}
850

951
#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_80042B8C.s")
1052

@@ -86,4 +128,27 @@
86128

87129
#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_800449F8.s")
88130

131+
#ifdef NON_MATCHING
132+
void func_80044A50(unk_D_800FC6D4* arg0) {
133+
u32 i;
134+
u32 end;
135+
testme* ptr;
136+
u32 a0 = arg0;
137+
138+
if (arg0->flags != 0) {
139+
return;
140+
}
141+
142+
end = arg0->unk_04 * 3;
143+
ptr = arg0->offset + a0;
144+
arg0->offset = ptr;
145+
146+
for (i = 0; i < end; i++) {
147+
ptr[i].unk_00 += a0;
148+
}
149+
150+
arg0->flags = 1;
151+
}
152+
#else
89153
#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_80044A50.s")
154+
#endif

src/435D0.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
#define _435D0_H_
33

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

67
void func_800429D0(void);
7-
void func_80042AB0(u16);
8+
s32 func_80042AB0(u16);
9+
void func_80042B8C(s32);
10+
void func_80044568(u8);
11+
void func_8004473C(void);
812
s32 func_800449F8(void);
13+
void func_80044A50(unk_D_800FC6D4*);
914

1015
#endif // _435D0_H_

0 commit comments

Comments
 (0)