Skip to content

Commit

Permalink
Merge pull request pret#134 from Kelebek1/various
Browse files Browse the repository at this point in the history
32D10, 12D80, F420
  • Loading branch information
RevoSucks authored Sep 21, 2024
2 parents 001630f + 172cd99 commit 51a9bcd
Show file tree
Hide file tree
Showing 38 changed files with 3,133 additions and 361 deletions.
7 changes: 7 additions & 0 deletions include/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ typedef union Color_RGBA8_u32 {
u32 rgba;
} Color_RGBA8_u32;

typedef union Color_RGBA8_s32 {
struct {
s8 r, g, b, a;
};
s32 rgba;
} Color_RGBA8_s32;

typedef struct {
f32 r, g, b, a;
} Color_RGBAf;
Expand Down
210 changes: 185 additions & 25 deletions include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ typedef struct unk_D_86002F58_004_000_054 {
/* 0x04 */ unk_D_86002F58_004_000_054_004* unk_04;
/* 0x08 */ s16 unk_08;
/* 0x0A */ s16 unk_0A;
} unk_D_86002F58_004_000_054; // size >= 0xC
} unk_D_86002F58_004_000_054; // size = 0xC

typedef struct unk_D_86002F58_004_000_0A8 {
/* 0x00 */ u16 unk_00;
/* 0x04 */ Vec3f unk_04;
} unk_D_86002F58_004_000_0A8; // size = 0x10

typedef struct unk_D_86002F58_004_000 {
/* 0x000 */ unk_D_86002F58_004_000_000 unk_000;
Expand All @@ -95,45 +100,200 @@ typedef struct unk_D_86002F58_004_000 {
/* 0x01E */ Vec3s unk_01E;
/* 0x024 */ Vec3f unk_024;
/* 0x030 */ Vec3f unk_030;
/* 0x03C */ s32 unk_03C;
/* 0x03C */ Color_RGBA8_u32 unk_03C;
/* 0x040 */ unk_D_86002F58_004_000_040 unk_040;
/* 0x050 */ char pad050[2];
/* 0x052 */ s16 unk_052;
/* 0x054 */ unk_D_86002F58_004_000_054 unk_054;
/* 0x060 */ s32 unk_060;
/* 0x064 */ char pad064[0x3C];
/* 0x0A0 */ s32 unk_0A0;
/* 0x060 */ MtxF unk_060;
/* 0x0A0 */ Color_RGBA8_u32 unk_0A0;
/* 0x0A4 */ char pad0A4[2];
/* 0x0A6 */ s8 unk_0A6;
/* 0x0A7 */ char pad0A7[5];
/* 0x0AC */ Vec3f unk_0AC;
/* 0x0A6 */ u8 unk_0A6;
/* 0x0A7 */ u8 unk_0A7;
/* 0x0A8 */ unk_D_86002F58_004_000_0A8 unk_0A8[1];
/* 0x0B8 */ char pad0B8[0x24];
/* 0x0DC */ Vec3f unk_0DC;
/* 0x0E0 */ char pad0E0[0x4];
/* 0x0EC */ Vec3f unk_0EC;
/* 0x0F8 */ char pad0F8[0x70];
} unk_D_86002F58_004_000; // size = 0x168

typedef struct unk_D_86002F34_000 {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 unk_01;
/* 0x02 */ u8 unk_02;
/* 0x03 */ u8 unk_03;
/* 0x04 */ char pad04[0x4];
/* 0x08 */ struct unk_D_86002F34_000* unk_08;
/* 0x0C */ struct unk_D_86002F34_000* unk_0C;
/* 0x10 */ s32 (*unk_10)(s32, struct unk_D_86002F34_000*);
/* 0x14 */ char unk14[0x4];
} unk_D_86002F34_000; // size >= 0x18

typedef struct unk_D_86002F34_00C_018 {
/* 0x00 */ Vp* vp;
/* 0x04 */ s16 x;
/* 0x06 */ s16 y;
/* 0x08 */ s16 width;
/* 0x0A */ s16 height;
} unk_D_86002F34_00C_018; // size = 0xC

typedef struct unk_D_86002F34_00C_024 {
/* 0x00 */ Mtx* mtx;
/* 0x04 */ u16 perspNorm;
/* 0x08 */ f32 fovy;
/* 0x0C */ f32 aspect;
/* 0x10 */ f32 near;
/* 0x14 */ f32 far;
/* 0x18 */ f32 scale;
} unk_D_86002F34_00C_024; // size = 0x1C

typedef struct unk_D_86002F34_00C_040 {
/* 0x00 */ Mtx* mtx;
/* 0x04 */ f32 l;
/* 0x08 */ f32 r;
/* 0x0C */ f32 b;
/* 0x10 */ f32 t;
/* 0x14 */ f32 n;
/* 0x18 */ f32 f;
/* 0x1C */ f32 scale;
} unk_D_86002F34_00C_040; // size = 0x20

typedef struct unk_D_86002F34_00C_060 {
/* 0x00 */ MtxF* p_mtxf;
/* 0x04 */ MtxF mtxf;
/* 0x44 */ LookAt* lookat;
/* 0x48 */ Vec3f eye;
/* 0x54 */ Vec3f at;
/* 0x60 */ Vec3f up;
} unk_D_86002F34_00C_060; // size >= 0x6C

typedef struct unk_D_86002F34_00C_0CC {
/* 0x00 */ u16 unk_00;
/* 0x02 */ u16 unk_02;
/* 0x04 */ Color_RGBA8_u32 color;
/* 0x08 */ u16 unk_08;
/* 0x0A */ u16 unk_0A;
/* 0x0C */ s16 unk_0C;
/* 0x0E */ s16 unk_0E;
/* 0x10 */ s16 unk_10;
/* 0x12 */ s16 unk_12;
/* 0x14 */ s16 unk_14;
/* 0x16 */ s16 unk_16;
/* 0x18 */ s16 unk_18;
/* 0x1A */ s16 unk_1A;
/* 0x1C */ u8* texture;
} unk_D_86002F34_00C_0CC; // size >= 0x20

typedef struct unk_D_86002F34_00C {
/* 0x00 */ char pad0[0x24];
/* 0x24 */ MtxF* unk_024;
/* 0x28 */ u16 unk_028;
/* 0x2C */ f32 unk_02C;
/* 0x30 */ char pad30[4];
/* 0x34 */ f32 unk_034;
/* 0x38 */ f32 unk_038;
/* 0x3C */ char pad3C[0x24];
/* 0x60 */ MtxF* unk_060;
/* 0x64 */ MtxF unk_064;
/* 0xA4 */ char padA4[0x4];
/* 0xA8 */ Vec3f unk_0A8;
/* 0xB4 */ Vec3f unk_0B4;
} unk_D_86002F34_00C; // size >= 0xC0
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ unk_D_86002F34_00C_018 unk_18;
/* 0x24 */ unk_D_86002F34_00C_024 unk_24;
/* 0x40 */ unk_D_86002F34_00C_040 unk_40;
/* 0x60 */ unk_D_86002F34_00C_060 unk_60;
/* 0xCC */ unk_D_86002F34_00C_0CC unk_CC;
} unk_D_86002F34_00C; // size >= 0xEC

typedef struct unk_D_86002F34_alt1 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ s16 unk_18;
/* 0x1A */ u16 unk_1A;
/* 0x1C */ s8 unk_1C;
/* 0x1D */ s8 unk_1D;
/* 0x20 */ s32 unk_20;
/* 0x24 */ Lights7* lights;
} unk_D_86002F34_alt1; // size >= 0x28

typedef struct unk_D_86002F34_alt2 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ u32 unk_18;
} unk_D_86002F34_alt2; // size >= 0x1C

typedef struct unk_D_86002F34_alt3 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ s16 unk_18;
/* 0x1A */ s16 unk_1A;
/* 0x1C */ s32 unk_1C;
} unk_D_86002F34_alt3; // size >= 0x20

typedef struct unk_D_86002F34_alt4 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ Color_RGBA8_u32 unk_18;
/* 0x1C */ u16 unk_1C;
/* 0x1E */ u16 unk_1E;
} unk_D_86002F34_alt4; // size >= 0x20

typedef struct unk_D_86002F34_alt5 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ Vec3f unk_18;
/* 0x24 */ Vec3s unk_24;
} unk_D_86002F34_alt5; // size >= 0x2C

typedef struct unk_D_86002F34_alt6 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ Vec3s unk_18;
/* 0x1E */ Vec3s unk_1E;
/* 0x24 */ Vec3f unk_24;
/* 0x30 */ u8 unk_30;
/* 0x31 */ u8 unk_31;
/* 0x32 */ s16 unk_32;
} unk_D_86002F34_alt6; // size >= 0x58

typedef struct unk_D_86002F34_alt7 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ Gfx* unk_18;
/* 0x1C */ s16 unk_1C;
} unk_D_86002F34_alt7; // size >= 0x20

typedef struct unk_D_86002F34_alt8 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ Gfx* unk_18;
/* 0x1C */ MtxF unk_1C;
} unk_D_86002F34_alt8; // size >= 0x5C

typedef struct unk_D_86002F34_alt9 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ Gfx* unk_18;
/* 0x1C */ Vec3f unk_1C;
/* 0x28 */ f32 unk_28;
} unk_D_86002F34_alt9; // size >= 0x2C

typedef struct unk_D_86002F34_alt10 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ s32 unk_18;
/* 0x1C */ s16 unk_1C;
/* 0x1E */ s16 unk_1E;
/* 0x20 */ s16 unk_20;
/* 0x22 */ u8 unk_22;
/* 0x24 */ Color_RGBA8_u32 unk_24;
} unk_D_86002F34_alt10; // size >= 0x28

typedef struct unk_D_86002F34_alt11_018 {
/* 0x00 */ u8 fmt;
/* 0x01 */ u8 unk_01;
/* 0x02 */ s16 unk_02;
/* 0x04 */ char unk04[0x4];
/* 0x08 */ u8* texture;
} unk_D_86002F34_alt11_018; // size >= 0xC

typedef struct unk_D_86002F34_alt11 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ unk_D_86002F34_alt11_018* unk_18;
/* 0x1C */ unk_D_86002F34_alt11_018* unk_1C;
} unk_D_86002F34_alt11; // size >= 0x20

typedef struct unk_D_86002F34_alt12 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ s16 unk_18;
/* 0x1A */ s16 unk_1A;
/* 0x1C */ s16 unk_1C;
/* 0x1E */ s16 unk_1E;
} unk_D_86002F34_alt12; // size >= 0x20

typedef struct unk_D_86002F34 {
/* 0x00 */ char pad00[0xC];
/* 0x0C */ unk_D_86002F34_00C* unk_0C;
} unk_D_86002F34; // size >= 0x10
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ unk_D_86002F34_000* unk_18;
} unk_D_86002F34; // size >= 0x1C

// Are unk_D_86002F30 and unk_D_800AC840 the same?
typedef struct unk_D_86002F30 {
Expand Down
24 changes: 24 additions & 0 deletions include/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ extern float __ll_to_f(long long s);
extern double __ull_to_d(unsigned long long u);
extern float __ull_to_f(unsigned long long u);

#define SINS(x) gSineTable[(u16) (x) >> 4]
#define COSS(x) gCosineTable[(u16) (x) >> 4]

typedef float MtxF_t[4][4];
typedef union {
MtxF_t mf;
Expand All @@ -41,4 +44,25 @@ typedef struct Vec3s {
/* 0x4 */ s16 z;
} Vec3s; // size = 0x6

typedef union Vec2s_s32 {
struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
};
s32 xy;
} Vec2s_s32; // size = 0x6

typedef union AllTypeS32 {
struct {
s16 rg;
s16 ba;
};
struct {
s8 r;
s8 g;
s8 b;
s8 a;
};
} AllTypeS32;

#endif
15 changes: 10 additions & 5 deletions include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ extern u8 gPool[];
extern Gfx* gDisplayListHead;
extern u64 _binary_assets_us_F3DEX2_bin_start[];

extern f32 gSineTable[];
extern f32 gCosineTable[0x1000];
extern s16 gArctanTable[0x401];

extern u8 D_1000000[];
extern u8 D_1001800[];
extern Gfx D_1002480[];
extern Gfx D_1002508[];
extern Gfx D_1002590[];
extern u8 D_2000000[];
extern u8 D_3000000[];
extern u8 D_4000000[];
Expand All @@ -71,6 +79,8 @@ extern u8 D_2028A60[];
extern u8 D_2028AA0[];
extern u32 D_B0000D10;

extern u8 D_800818E0[0x20];

typedef struct unk_D_80068BA0 {
/* 0x00 */ char pad00[0x2];
/* 0x02 */ s16 unk_02;
Expand All @@ -86,7 +96,6 @@ extern unk_D_80068BA0* D_80068BA8;
extern unk_D_80068BA0* D_80068BAC;
extern Gfx D_8006F518[];
extern Gfx D_8006F630[];

extern u8 D_82000000;
extern u8 D_81400000;
extern u8 D_86B00000;
Expand All @@ -111,10 +120,6 @@ extern struct unk_D_86002F58_004_000_000 D_800AC840;
extern struct unk_D_86002F58_004_000_000 D_800AC858;
extern struct unk_D_86002F58_004_000* D_8006F09C;

extern struct Vec3f D_8006F050;
extern struct Vec3s D_8006F05C;
extern struct Vec3f D_8006F064;

typedef struct unk_D_8006FF00 {
/* 0x00 */ char unk_00[0x4];
/* 0x04 */ char* name;
Expand Down
4 changes: 2 additions & 2 deletions lib/ultralib/include/PR/gbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -3050,10 +3050,10 @@ _DW({ \
}

#define gsDPSetCombine(muxs0, muxs1) \
{{ \
{ \
_SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24), \
(unsigned int)(muxs1) \
}}
}

#define GCCc0w0(saRGB0, mRGB0, saA0, mA0) \
(_SHIFTL((saRGB0), 20, 4) | _SHIFTL((mRGB0), 15, 5) | \
Expand Down
4 changes: 4 additions & 0 deletions linker_scripts/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,7 @@ rspbootTextStart = 0x80065FC0;
aspMainTextStart = 0x80067420;
aspMainDataStart = 0x8007EA70;
audDMAMessageQ = 0x800FCAE0;
D_8006F010 = 0x8006F010; // size:0x40
D_8006F050 = 0x8006F050; // size:0xC
D_8006F05C = 0x8006F05C; // size:0x6
D_8006F064 = 0x8006F064; // size:0xC
4 changes: 2 additions & 2 deletions src/11BA0.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ unk_D_86002F58_004_000* func_80011938(MainPoolState* arg0, unk_D_86002F58_004_00
arg1->unk_01D = 0xFF;
arg1->unk_01C = 0;
arg1->unk_0A6 = 0;
arg1->unk_0A0 = -0x100;
arg1->unk_03C = -0x100;
arg1->unk_0A0.rgba = 0xFFFFFF00;
arg1->unk_03C.rgba = 0xFFFFFF00;
arg1->unk_040.unk_00 = 0;
arg1->unk_040.unk_04 = NULL;
arg1->unk_040.unk_08 = 0;
Expand Down
Loading

0 comments on commit 51a9bcd

Please sign in to comment.