Skip to content

Commit

Permalink
Merge pull request pret#129 from Kelebek1/various
Browse files Browse the repository at this point in the history
various
  • Loading branch information
RevoSucks authored Sep 10, 2024
2 parents f4ede05 + 3b4b087 commit b623828
Show file tree
Hide file tree
Showing 26 changed files with 1,588 additions and 101 deletions.
4 changes: 2 additions & 2 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ void func_80057FD0(void *, int);
s32 func_8005A990(OSPiHandle *);

// bcopy.s
void _bcopy(void *, void *, u32);
void _bcopy(void *, void *, s32);

// 5580.s
void func_80004CC0(OSThread *, s32, s32);
Expand Down Expand Up @@ -37,7 +37,7 @@ void func_8000D970(OSPfs *);
void set_watch_lohi(s32);

u32 osGetCount(void);
OSIntMask osSetIntMask(OSIntMask);;
OSIntMask osSetIntMask(OSIntMask);

unsigned long long __ull_rshift(unsigned long long a0, unsigned long long a1);
unsigned long long __ull_rem(unsigned long long a0, unsigned long long a1);
Expand Down
4 changes: 2 additions & 2 deletions include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ typedef struct unk_D_86002F34_00C {
/* 0x38 */ f32 unk_038;
/* 0x3C */ char pad3C[0x24];
/* 0x60 */ MtxF* unk_060;
/* 0x64 */ Vec3f unk_064;
/* 0x70 */ char pad70[0x38];
/* 0x64 */ MtxF unk_064;
/* 0xA4 */ char padA4[0x4];
/* 0xA8 */ Vec3f unk_0A8;
/* 0xB4 */ Vec3f unk_0B4;
} unk_D_86002F34_00C; // size >= 0xC0
Expand Down
9 changes: 9 additions & 0 deletions include/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ extern u8 fragment14_relocs_ROM_END[];
extern u8 fragment15_TEXT_START[];
extern u8 fragment15_ROM_START[];
extern u8 fragment15_ROM_END[];
extern u8 fragment15_relocs_ROM_END[];

// fragment 16
extern u8 fragment16_TEXT_START[];
Expand Down Expand Up @@ -229,42 +230,50 @@ extern u8 fragment41_ROM_END[];
extern u8 fragment42_TEXT_START[];
extern u8 fragment42_ROM_START[];
extern u8 fragment42_ROM_END[];
extern u8 fragment42_relocs_ROM_END[];

// fragment 43
extern u8 fragment43_TEXT_START[];
extern u8 fragment43_ROM_START[];
extern u8 fragment43_ROM_END[];
extern u8 fragment43_relocs_ROM_END[];
extern u8 fragment43_relocs_ROM_END[];

// fragment 44
extern u8 fragment44_TEXT_START[];
extern u8 fragment44_ROM_START[];
extern u8 fragment44_ROM_END[];
extern u8 fragment44_relocs_ROM_END[];

// fragment 45
extern u8 fragment45_TEXT_START[];
extern u8 fragment45_ROM_START[];
extern u8 fragment45_ROM_END[];
extern u8 fragment45_relocs_ROM_END[];

// fragment 46
extern u8 fragment46_TEXT_START[];
extern u8 fragment46_ROM_START[];
extern u8 fragment46_ROM_END[];
extern u8 fragment46_relocs_ROM_END[];

// fragment 47
extern u8 fragment47_TEXT_START[];
extern u8 fragment47_ROM_START[];
extern u8 fragment47_ROM_END[];
extern u8 fragment47_relocs_ROM_END[];

// fragment 48
extern u8 fragment48_TEXT_START[];
extern u8 fragment48_ROM_START[];
extern u8 fragment48_ROM_END[];
extern u8 fragment48_relocs_ROM_END[];

// fragment 49
extern u8 fragment49_TEXT_START[];
extern u8 fragment49_ROM_START[];
extern u8 fragment49_ROM_END[];
extern u8 fragment49_relocs_ROM_END[];

// fragment 50
extern u8 fragment50_TEXT_START[];
Expand Down
3 changes: 3 additions & 0 deletions include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,7 @@ extern u8 D_87B000CC;
extern u8 D_87B000D0;
extern u8 D_87B000D4;

extern s32 D_800FC820;
extern s32 D_800FF9C0;

#endif
1 change: 1 addition & 0 deletions linker_scripts/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,4 @@ D_800A60C0 = 0x800A60C0;
D_82100DC0 = 0x82100DC0;
D_86106450 = 0x86106450; // size:0x1140
D_862082A0 = 0x862082A0; // size:0x10
D_800AE4E8 = 0x800AE4E8; // size:0x30
62 changes: 59 additions & 3 deletions src/20330.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,64 @@
#include "global.h"
#include "20330.h"

#pragma GLOBAL_ASM("asm/us/nonmatchings/20330/func_8001F730.s")
static s32 pad_D_800AC880[0x2];
static s32 D_800AC888;
static unk_D_80068BA0* D_800AC88C;

#pragma GLOBAL_ASM("asm/us/nonmatchings/20330/func_8001F738.s")
void func_8001F730(void) {
}

#pragma GLOBAL_ASM("asm/us/nonmatchings/20330/func_8001F750.s")
void func_8001F738(unk_D_80068BA0* arg0) {
D_800AC888 = 0xA;
D_800AC88C = arg0;
}

s32 func_8001F750(void) {
if (D_800AC88C->unk_08 & 0x800) {
D_800AC888 = 0xA;
return 0x800;
}

if (D_800AC88C->unk_08 & 0x400) {
D_800AC888 = 0xA;
return 0x400;
}

if (D_800AC88C->unk_08 & 0x200) {
D_800AC888 = 0xA;
return 0x200;
}

if (D_800AC88C->unk_08 & 0x100) {
D_800AC888 = 0xA;
return 0x100;
}

D_800AC888--;
if (D_800AC888 <= 0) {
D_800AC888 = 0;

// clang-format off
if (D_800AC88C->unk_06 & 0x800) {
D_800AC888 = 2; return 0x800;
}
// clang-format on

if (D_800AC88C->unk_06 & 0x400) {
D_800AC888 = 2;
return 0x400;
}

if (D_800AC88C->unk_06 & 0x200) {
D_800AC888 = 2;
return 0x200;
}

if (D_800AC88C->unk_06 & 0x100) {
D_800AC888 = 2;
return 0x100;
}
}

return 0;
}
2 changes: 1 addition & 1 deletion src/20330.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

void func_8001F730(void);
void func_8001F738(unk_D_80068BA0*);
void func_8001F750(void);
s32 func_8001F750(void);


#endif // _20330_H_
26 changes: 26 additions & 0 deletions src/22630.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,33 @@

#include "global.h"

typedef struct unk_func_80026268_arg0 {
/* 0x00 */ char unk00[0x4];
/* 0x04 */ u8 unk_04;
/* 0x05 */ char unk05[0x1F];
/* 0x24 */ u8 unk_24;
/* 0x25 */ u8 unk_25;
/* 0x26 */ char unk26[0xA];
/* 0x30 */ u8 unk_30[11];
/* 0x3B */ u8 unk_3B[11];
/* 0x46 */ u8 unk_46[11];
/* 0x51 */ char unk51[0x1];
/* 0x52 */ u8 unk_52;
/* 0x52 */ u8 unk_53;
} unk_func_80026268_arg0; // size >= 0x54

typedef struct unk_D_800AE4E8_004_1_000_010 {
/* 0x00 */ char unk00[0x21];
/* 0x21 */ u8 unk_21[11];
/* 0x2C */ u8 unk_2C[11];
} unk_D_800AE4E8_004_1_000_010; // size = 0x37

void func_80021B7C(u8*, u8*);
void func_80021C40(u8*, u8*);
void func_80021CA4(char*, u8);
void func_80021D9C(unk_func_80026268_arg0*, unk_D_800AE4E8_004_1_000_010*);
void func_80021F04(unk_func_80026268_arg0*, unk_D_800AE4E8_004_1_000_010*);
void func_80022338(unk_func_80026268_arg0*);
void func_80023068(void);
s32 func_8002311C(s32);
void func_80024040(s16);
Expand Down
Loading

0 comments on commit b623828

Please sign in to comment.