Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 196 additions & 4 deletions include/uv_dobj.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/uv_graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ typedef struct ParsedUVAN_Unk0 {
struct ParsedUVAN_Unk0* unk0;
u16 unk4;
u8 pad6[0x2];
s32 unk8;
u32 unk8;
Unk8037DCA0_UnkC* unkC;
} ParsedUVAN_Unk0;

Expand Down
44 changes: 22 additions & 22 deletions src/app/cannonball.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern u8 D_80359A84;
extern s32 D_80359A88[];

// forward declarations
s32 cannonEndShot(Unk802D5C5C_Arg0*);
s32 cannonEndShot(Unk802D5B50_Arg2*);

void cannon_802D5A90(void) {
D_80359A30.unk0 = 8;
Expand Down Expand Up @@ -71,12 +71,12 @@ void cannonLoadLevel(u8 arg0, u8 pilot, Unk802D5B50_Arg2* arg2, Unk802D3658_Arg0
cannonLoadPilot(pilot, arg2);
arg2->unk0 = uvDobjAllocIdx();
arg2->unk2 = 2;
uvDobjModel(arg2->unk0, arg2->unk220);
uvDobjModel(arg2->unk0, arg2->modelId);
uvDobjPosm(arg2->unk0, 0, &arg2->unk14);
uvDobjState(arg2->unk0, arg2->unk2);
arg2->unk54 = uvDobjAllocIdx();
arg2->unk56 = 2;
uvDobjModel(arg2->unk54, 0x105);
uvDobjModel(arg2->unk54, MODEL_105);
uvDobjPosm(arg2->unk54, 0, &arg2->unk58);
uvDobjState(arg2->unk54, arg2->unk56);
arg2->unkB0 = arg3;
Expand All @@ -90,7 +90,7 @@ void cannonLoadLevel(u8 arg0, u8 pilot, Unk802D5B50_Arg2* arg2, Unk802D3658_Arg0
}

// cannon_802D5C5C is invoked when loading and exiting cannonball level
void cannon_802D5C5C(Unk802D5C5C_Arg0* arg0) {
void cannon_802D5C5C(Unk802D5B50_Arg2* arg0) {
f32 sp54;
f32 sp50;
f32 sp4C;
Expand Down Expand Up @@ -139,7 +139,7 @@ void cannon_802D5C5C(Unk802D5C5C_Arg0* arg0) {
arg0->unkB0->unk4C = 1;
arg0->unkB0->unk50 = 0.0f;
arg0->unkB0->unk228 = 0.0f;
uvModelGetProps(arg0->unk220, 1, &arg0->unkB0->unk8, 0);
uvModelGetProps(arg0->modelId, 1, &arg0->unkB0->unk8, 0);
func_802D45C4(arg0->unkB0, arg0->unkB8);
D_8034E9F0 = 4.712389f; // DEG_TO_RAD(270)
D_8034E9F4 = 0;
Expand All @@ -148,16 +148,16 @@ void cannon_802D5C5C(Unk802D5C5C_Arg0* arg0) {

// cannonEndTarget is invoked at the end of a cannonball target
void cannonEndTarget(Unk802D5B50_Arg2* arg0) {
uvDobjModel(arg0->unk0, WORLD_MODEL_ID);
uvDobjModel(arg0->unk54, WORLD_MODEL_ID);
uvDobjModel(arg0->unk0, MODEL_WORLD);
uvDobjModel(arg0->unk54, MODEL_WORLD);
arg0->unk10 = 0xFFFF;
arg0->unk0 = 0xFFFF;
arg0->unk54 = 0xFFFF;
arg0->unkB0->unk40 -= 100.0f;
}

// cannonMovementFrame called every frame while aiming cannon and while in flight
void cannonMovementFrame(Unk802D5C5C_Arg0* arg0, u8 arg1) {
void cannonMovementFrame(Unk802D5B50_Arg2* arg0, u8 arg1) {
f32 stickX;
f32 stickY;
s32 spE4;
Expand Down Expand Up @@ -360,7 +360,7 @@ void cannonMovementFrame(Unk802D5C5C_Arg0* arg0, u8 arg1) {
#endif
// cannonAimingFrame called every frame while inside cannon
// controls the rate of rotation and Z-button presses
void cannonAimingFrame(Unk802D5C5C_Arg0* arg0) {
void cannonAimingFrame(Unk802D5B50_Arg2* arg0) {
Mtx4F sp38;
f32 sp34;

Expand Down Expand Up @@ -459,7 +459,7 @@ void cannonAimingFrame(Unk802D5C5C_Arg0* arg0) {
#endif

// cannonShoot called when firing the cannon
void cannonShoot(Unk802D5C5C_Arg0* arg0) {
void cannonShoot(Unk802D5B50_Arg2* arg0) {
Mtx4F sp50;

uvMat4Copy(&sp50, &arg0->unk58);
Expand All @@ -485,7 +485,7 @@ void cannonShoot(Unk802D5C5C_Arg0* arg0) {
#pragma GLOBAL_ASM("asm/nonmatchings/app/cannonball/cannonPilotLand.s")
#else
// Matches but has bss/data issues
void cannonPilotLand(Unk802D5C5C_Arg0* arg0) {
void cannonPilotLand(Unk802D5B50_Arg2* arg0) {
static Vec4F D_80359AB0;
static Vec4F D_80359AC0;
static f32 D_8034E9FC = 0.0f;
Expand Down Expand Up @@ -570,7 +570,7 @@ void cannonLoadPilot(u8 pilot, Unk802D5B50_Arg2* arg1) {
arg1->unk278 = 0.96f;
arg1->unk280 = 0.8f;
arg1->unk27C = 5.88f;
arg1->unk220 = 0x135;
arg1->modelId = MODEL_135;
arg1->unk292 = 1;
arg1->unk285 = 0xA;
arg1->unk286 = 0xB;
Expand Down Expand Up @@ -610,7 +610,7 @@ void cannonLoadPilot(u8 pilot, Unk802D5B50_Arg2* arg1) {
arg1->unk278 = 0.8f;
arg1->unk280 = 1.0f;
arg1->unk27C = 9.8f;
arg1->unk220 = 0x136;
arg1->modelId = MODEL_136;
arg1->unk292 = 6;
arg1->unk285 = 2;
arg1->unk286 = 3;
Expand Down Expand Up @@ -650,7 +650,7 @@ void cannonLoadPilot(u8 pilot, Unk802D5B50_Arg2* arg1) {
arg1->unk278 = 0.64f;
arg1->unk280 = 1.2f;
arg1->unk27C = 13.72f;
arg1->unk220 = 0x137;
arg1->modelId = MODEL_137;
arg1->unk292 = 6;
arg1->unk285 = 1;
arg1->unk286 = 2;
Expand Down Expand Up @@ -690,7 +690,7 @@ void cannonLoadPilot(u8 pilot, Unk802D5B50_Arg2* arg1) {
arg1->unk278 = 0.96f;
arg1->unk280 = 0.8f;
arg1->unk27C = 5.88f;
arg1->unk220 = 0x138;
arg1->modelId = MODEL_138;
arg1->unk292 = 8;
arg1->unk285 = 1;
arg1->unk286 = 2;
Expand Down Expand Up @@ -730,7 +730,7 @@ void cannonLoadPilot(u8 pilot, Unk802D5B50_Arg2* arg1) {
arg1->unk278 = 0.8f;
arg1->unk280 = 1.0f;
arg1->unk27C = 9.8f;
arg1->unk220 = 0x139;
arg1->modelId = MODEL_139;
arg1->unk292 = 6;
arg1->unk285 = 2;
arg1->unk286 = 3;
Expand Down Expand Up @@ -770,7 +770,7 @@ void cannonLoadPilot(u8 pilot, Unk802D5B50_Arg2* arg1) {
arg1->unk278 = 0.64f;
arg1->unk280 = 1.2f;
arg1->unk27C = 13.72f;
arg1->unk220 = 0x13A;
arg1->modelId = MODEL_13A;
arg1->unk292 = 6;
arg1->unk285 = 2;
arg1->unk286 = 3;
Expand Down Expand Up @@ -808,7 +808,7 @@ extern s32 D_80359A98[];
extern s32 D_80359AA8;
extern s32 D_80359AAC;
extern void func_802E0CF0(void);
s32 cannonLoad802D77D8(Unk80362690* arg0, Unk802D3658_Arg0* arg1) {
s32 cannonLoad802D77D8(Unk80362690* arg0, Unk802D5B50_Arg2* arg1) {
s32 i;
Mtx4F sp3C;
Unk80362690_Unk0_UnkC* temp_s1_2;
Expand Down Expand Up @@ -842,7 +842,7 @@ s32 cannonLoad802D77D8(Unk80362690* arg0, Unk802D3658_Arg0* arg1) {
}
temp_s1_2->unk6C = (s32)arg1;
cannonLoadLevel(arg0->unk9C, temp_s1_2->pad0, arg1, (Unk802D3658_Arg0*)temp_s1_2->unk70);
cannon_802D5C5C((Unk802D5C5C_Arg0*)arg1);
cannon_802D5C5C(arg1);
arg1->unkC = 0;
arg1->unkE = 0;
D_80359A88[0] = 0;
Expand All @@ -852,7 +852,7 @@ s32 cannonLoad802D77D8(Unk80362690* arg0, Unk802D3658_Arg0* arg1) {
uvMat4Copy(&sp3C, (Mtx4F*)&arg1->unk14);
uvMat4RotateAxis(&sp3C, 1.5707961f, 'x');
func_802EDD9C(temp_s1_2, &sp3C);
func_802D4DE8((Unk802D3658_Arg0*)temp_s1_2->unk70, 0U);
func_802D4DE8(temp_s1_2->unk70, 0U);
func_8032B508(temp_s1_2->unk74);
func_80313E0C(0.0f);
func_802E66F4(1.0f);
Expand All @@ -871,7 +871,7 @@ s32 cannonLoad802D77D8(Unk80362690* arg0, Unk802D3658_Arg0* arg1) {
#pragma GLOBAL_ASM("asm/nonmatchings/app/cannonball/cannonFrame802D7B7C.s")

// cannonLandedFrame called every frame after landing from cannon shot
s32 cannonLandedFrame(Unk802D5C5C_Arg0* arg0) {
s32 cannonLandedFrame(Unk802D5B50_Arg2* arg0) {
s32* temp_v1;
Unk80362690_Unk0_UnkC* temp_s0;
u8 sp27;
Expand Down Expand Up @@ -951,7 +951,7 @@ s32 cannonLandedFrame(Unk802D5C5C_Arg0* arg0) {
// cannonEndAllTgts called once after all four cannon targets are complete
#pragma GLOBAL_ASM("asm/nonmatchings/app/cannonball/cannonEndAllTgts.s")

void cannon_802D8A40(u8 arg0, Unk802D5C5C_Arg0* arg1) {
void cannon_802D8A40(u8 arg0, Unk802D5B50_Arg2* arg1) {
Unk80362690_Unk0_UnkC* unkC;
unkC = &D_80362690->unk0[D_80362690->unk9C].unkC;
if (unkC->veh == 3) {
Expand Down
62 changes: 50 additions & 12 deletions src/app/cannonball.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,56 @@ typedef struct {
u8 unk2;
u8 pad3;
u16 unk4;
u8 pad6[0xA];
u16 pad6;
f32 unk8;
u16 unkC;
u16 unkE;
u16 unk10;
u8 pad12[2];
u16 pad12;
Mtx4F unk14;
u16 unk54;
u8 unk56;
u8 pad57;
Mtx4F unk58;
u8 pad98[0xA4-0x98];
f32 unk98;
union {
f32 zxAxis[2];
struct {
f32 zAxis; // rotation intended here
f32 xAxis;
};
};
f32 unkA4;
u8 padA8[8];
Unk802D3658_Arg0* unkB0;
u8 padB4[0x16C];
u16 unk220;
u8 unkB4;
u8 padB5[3];
f32 unkB8;
f32 unkBC;
f32 unkC0;
u8 unkC4;
u8 padC5[3];
f32 unkC8;
f32 unkCC;
f32 unkD0;
u8 unkD4;
u8 unkD5;
u8 padD6[0x11C - 0xD6];
u8 unk11C;
s8 unk11D;
f32 unk120;
u8 pad124[0x12C - 0x124];
f32 unk12C;
f32 unk130;
f32 unk134;
u8 pad138[0x1B8 - 0x138];
Vec3F unk1B8;
f32 unk1C4;
f32 unk1C8;
f32 unk1CC;
f32 unk1D0;
u8 pad1D4[0x220 - 0x1D4];
u16 modelId;
u8 pad222[2];
f32 unk224;
f32 unk228;
Expand Down Expand Up @@ -65,22 +101,24 @@ typedef struct {
u8 unk291;
u8 unk292;
u8 unk293;
u8 pad294[0x2BC - 0x294];
u8 pad294[0x2B4 - 0x294];
u8 unk2B4;
u8 pad2B5[0x2BC-0x2B5];
} Unk802D5B50_Arg2;

extern u16 D_80359AAA;
extern u16 D_80359AAE;

void cannon_802D5A90(void);
void cannonLoadLevel(u8, u8 pilot, Unk802D5B50_Arg2*, Unk802D3658_Arg0*);
void cannon_802D5C5C(Unk802D5C5C_Arg0*);
void cannon_802D5C5C(Unk802D5B50_Arg2*);
void cannonEndTarget(Unk802D5B50_Arg2*);
void cannonMovementFrame(Unk802D5C5C_Arg0*, u8);
void cannonAimingFrame(Unk802D5C5C_Arg0*);
void cannonShoot(Unk802D5C5C_Arg0*);
void cannonPilotLand(Unk802D5C5C_Arg0*);
void cannonMovementFrame(Unk802D5B50_Arg2*, u8);
void cannonAimingFrame(Unk802D5B50_Arg2*);
void cannonShoot(Unk802D5B50_Arg2*);
void cannonPilotLand(Unk802D5B50_Arg2*);
void cannonLoadPilot(u8 pilot, Unk802D5B50_Arg2*);
void cannon_802D8A40(u8 arg0, Unk802D5C5C_Arg0* arg1);
void cannon_802D8A40(u8 arg0, Unk802D5B50_Arg2* arg1);
s32 cannonLoad802D77D8(Unk80362690* arg0, Unk802D3658_Arg0* arg1);
s32 cannonFrame802D7B7C(Unk80362690* arg0);

Expand Down
67 changes: 0 additions & 67 deletions src/app/code_5A6A0.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,73 +29,6 @@ typedef struct {
s32 pad50;
} Unk803599D0;

typedef struct {
u16 unk0;
u8 unk2;
u8 pad3;
u16 unk4;
u16 pad6;
f32 unk8;
u16 unkC;
u16 unkE;
u16 unk10;
u16 pad12;
Mtx4F unk14;
u16 unk54;
u8 unk56;
u8 pad57;
Mtx4F unk58;
f32 unk98;
union {
f32 zxAxis[2];
struct {
f32 zAxis; // rotation intended here
f32 xAxis;
};
};
f32 unkA4;
u8 padA8[0xB0 - 0xA8];
Unk802D3658_Arg0* unkB0;
u8 unkB4;
u8 padB5[3];
f32 unkB8;
f32 unkBC;
f32 unkC0;
u8 unkC4;
u8 padC5[3];
f32 unkC8;
f32 unkCC;
f32 unkD0;
u8 unkD4;
u8 unkD5;
u8 padD6[0x11C - 0xD6];
u8 unk11C;
s8 unk11D;
f32 unk120;
u8 pad124[0x12C - 0x124];
f32 unk12C;
f32 unk130;
f32 unk134;
u8 pad138[0x1B8 - 0x138];
Vec3F unk1B8;
f32 unk1C4;
f32 unk1C8;
f32 unk1CC;
f32 unk1D0;
u8 pad1D4[0x220 - 0x1D4];
u16 unk220;
u8 pad222[0x4A];
f32 unk26C;
f32 unk270;
f32 unk274;
u8 pad278[0x280 - 0x278];
f32 unk280;
u8 pad284[0x293 - 0x284];
u8 unk293;
u8 pad294[0x2B4 - 0x294];
u8 unk2B4;
} Unk802D5C5C_Arg0;

void func_802D45C4(Unk802D3658_Arg0*, f32);
s32 func_802D472C(Unk802D3658_Arg0*, Mtx4F*);
s32 func_802D4A30(Unk802D3658_Arg0*, Mtx4F*);
Expand Down
7 changes: 4 additions & 3 deletions src/app/code_60020.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

#include <uv_matrix.h>
#include "code_5A6A0.h"
#include "cannonball.h"

void func_802D8AF0(Unk802D5C5C_Arg0*);
void func_802D9220(Unk802D5C5C_Arg0*);
void func_802D8AF0(Unk802D5B50_Arg2*);
void func_802D9220(Unk802D5B50_Arg2*);
void func_802D9430(void*);
void func_802D94EC(void*);
void func_802D95D8(Unk802D5C5C_Arg0*);
void func_802D95D8(Unk802D5B50_Arg2*);

#endif // CODE_60020_H
6 changes: 3 additions & 3 deletions src/app/code_A6000.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void uvPathPoseLine(Unk8037F098* arg0, Unk8037DCA0* arg1, f32 arg2) {
s32 pad1;
s32 pad2;

if (arg1->modelId == WORLD_MODEL_ID) {
if (arg1->modelId == MODEL_WORLD) {
_uvDebugPrintf("uvPathPoseLine: Path has an invalid Model ID!\n");
return;
}
Expand Down Expand Up @@ -128,7 +128,7 @@ void func_8031EF60(Unk8037DCA0* arg0, s32 arg1) {
}

void func_8031EF68(Unk8037DCA0* arg0) {
if (arg0->modelId != WORLD_MODEL_ID) {
arg0->modelId = WORLD_MODEL_ID;
if (arg0->modelId != MODEL_WORLD) {
arg0->modelId = MODEL_WORLD;
}
}
Loading
Loading