Skip to content

Commit

Permalink
Merge pull request pret#138 from Kelebek1/various
Browse files Browse the repository at this point in the history
45720
  • Loading branch information
RevoSucks authored Sep 24, 2024
2 parents c4e46f4 + b485468 commit 9fe5730
Show file tree
Hide file tree
Showing 13 changed files with 559 additions and 28 deletions.
20 changes: 19 additions & 1 deletion src/334D0.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#include "334D0.h"
#include "src/12D80.h"
#include "src/30640.h"
#include "src/6A40.h"
#include "src/F420.h"

typedef struct unk_D_800AFFC8 {
/* 0x000 */ s16 unk_000;
/* 0x002 */ char unk002[0x7CE];
} unk_D_800AFFC8; // size = 0x7D0

extern unk_D_800AFFC8 D_800AFFC8[2][3];

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

Expand All @@ -10,7 +21,14 @@

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

#pragma GLOBAL_ASM("asm/us/nonmatchings/334D0/func_80032A34.s")
void func_80032A34(s32 arg0) {
s32 i;
unk_D_800AFFC8* var_v1 = &D_800AFFC8[arg0];

for (i = 0; i < 3; i++) {
var_v1[i].unk_000 = 0;
}
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/373A0.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ u8* D_800FC6B0[3];
u8* D_800FC6C0[3];
unk_D_800FC6CC* D_800FC6CC;
u8* D_800FC6D0;
u32* D_800FC6D4;
unk_D_800FC6D4* D_800FC6D4;
u8* D_800FC6D8;
u8* D_800FC6DC;
u32* D_800FC6E0;
Expand Down
29 changes: 28 additions & 1 deletion src/373A0.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

#include "global.h"

#ifdef M2C
#define ENTRY_SIZE 1
#else
#define ENTRY_SIZE
#endif

typedef struct File1Header {
/* 0x00 */ u32 offset1;
/* 0x04 */ u32 wave_tables_offset;
Expand Down Expand Up @@ -33,6 +39,27 @@ typedef struct unk_D_800FC6CC {
/* 0x04 */ u32 unk_04;
} unk_D_800FC6CC; // size = 0x8

typedef struct unk_D_800FC6D4_entry {
/* 0x00 */ u16 unk_00;
/* 0x02 */ u8 unk_02;
/* 0x03 */ u8 unk_03;
} unk_D_800FC6D4_entry; // size = 0x4

typedef struct testme {
u32 unk_00;
u32 unk_04;
} testme;

typedef struct unk_D_800FC6D4 {
/* 0x00 */ u16 flags;
/* 0x02 */ u16 num_entries;
/* 0x04 */ u16 unk_04;
/* 0x06 */ u16 unk_06;
/* 0x08 */ testme* offset;
/* 0x0C */ char unk_0C[0x4];
/* 0x10 */ unk_D_800FC6D4_entry entries[ENTRY_SIZE];
} unk_D_800FC6D4; // size = 0x10

extern u8 D_800B32A0[0x493E0];
extern u32* D_800FC680;
extern u8* D_800FC684;
Expand All @@ -47,7 +74,7 @@ extern u8* D_800FC6B0[3];
extern u8* D_800FC6C0[3];
extern unk_D_800FC6CC* D_800FC6CC;
extern u8* D_800FC6D0;
extern u32* D_800FC6D4;
extern unk_D_800FC6D4* D_800FC6D4;
extern u8* D_800FC6D8;
extern u8* D_800FC6DC;
extern u32* D_800FC6E0;
Expand Down
15 changes: 14 additions & 1 deletion src/3D140.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,20 @@ s32 func_8003D494(void) {
return D_80077D90;
}

#pragma GLOBAL_ASM("asm/us/nonmatchings/3D140/func_8003D4A0.s")
s32 func_8003D4A0(s32 arg0) {
if (arg0 == 0) {
if (D_800FC818 != D_800FCAD8) {
return 0;
}
D_80077DA8 = 1;
} else {
osAiSetFrequency(D_800FCAD4);
lastInfo = NULL;
dmaState.initialized = 0;
D_80077DA8 = 0;
}
return 1;
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/3D140.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ OSTask* func_8003CADC(OSTask*);
void __clearAudioDMA(void);
void func_8003D32C(void);
s32 func_8003D494(void);
void func_8003D4A0(s32);
s32 func_8003D4A0(s32);
void func_8003D68C(s32);
void func_8003D918(u32 arg0, u32 arg1);
void func_8003DB84(s32 arg0);
Expand Down
69 changes: 67 additions & 2 deletions src/435D0.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,52 @@
#include "435D0.h"

#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_800429D0.s")
extern u8 D_800FCD48[8];
extern s8 D_800FCEB4;
extern s32 D_800FCEC8;
extern u8 D_800FCECC;
extern u8 D_800FCECD;

void func_800429D0(void) {
s32 i;

for (i = 0; i < 8; i++) {
if (D_800FCD48[i] != 0) {
func_80042B8C(i);
}
}
}

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

#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_80042AB0.s")
s32 func_80042AB0(u16 arg0) {
s32 a;
s32 offset;

if (func_800449F8() != 0) {
return 0;
}

func_80044A50(D_800FC6D4);

if (D_800FC6D4->num_entries < arg0) {
return 0;
}

offset = D_800FC6D4->offset;
func_8004473C();

arg0--;

a = D_800FC6D4->entries[arg0].unk_00;
D_800FCEB4 = a;
D_800FCECC = D_800FC6D4->entries[arg0].unk_02;
D_800FCECD = D_800FC6D4->entries[arg0].unk_03;
D_800FCEC8 = offset + (a * 0x18);

func_80044568(a);

return 1;
}

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

Expand Down Expand Up @@ -86,4 +128,27 @@

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

#ifdef NON_MATCHING
void func_80044A50(unk_D_800FC6D4* arg0) {
u32 i;
u32 end;
testme* ptr;
u32 a0 = arg0;

if (arg0->flags != 0) {
return;
}

end = arg0->unk_04 * 3;
ptr = arg0->offset + a0;
arg0->offset = ptr;

for (i = 0; i < end; i++) {
ptr[i].unk_00 += a0;
}

arg0->flags = 1;
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/435D0/func_80044A50.s")
#endif
7 changes: 6 additions & 1 deletion src/435D0.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
#define _435D0_H_

#include "global.h"
#include "src/373A0.h"

void func_800429D0(void);
void func_80042AB0(u16);
s32 func_80042AB0(u16);
void func_80042B8C(s32);
void func_80044568(u8);
void func_8004473C(void);
s32 func_800449F8(void);
void func_80044A50(unk_D_800FC6D4*);

#endif // _435D0_H_
Loading

0 comments on commit 9fe5730

Please sign in to comment.