Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fragment3 #139

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
fragment3
Maide committed Sep 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e85f570be57d5598d3af9fa74abb64cc15b3b6dd
15 changes: 14 additions & 1 deletion include/global.h
Original file line number Diff line number Diff line change
@@ -145,6 +145,19 @@ typedef struct unk_D_86002F58_004_000 {
/* 0x0F8 */ char pad0F8[0x70];
} unk_D_86002F58_004_000; // size = 0x168

typedef struct unk_D_86002F34_000_014_004 {
/* 0x00 */ u8 unk_00[5];
} unk_D_86002F34_000_014_004; // size = 0x5

typedef struct unk_D_86002F34_000_014_010 {
/* 0x00 */ u8 unk_00[4];
} unk_D_86002F34_000_014_010; // size = 0x4

typedef struct unk_D_86002F34_000_014 {
/* 0x00 */ u8* unk_00;
/* 0x04 */ u8* unk_04;
} unk_D_86002F34_000_014; // size >= 0x8

typedef struct unk_D_86002F34_000 {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 unk_01;
@@ -155,7 +168,7 @@ typedef struct unk_D_86002F34_000 {
/* 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];
/* 0x14 */ unk_D_86002F34_000_014* unk_14;
} unk_D_86002F34_000; // size >= 0x18

typedef struct unk_D_86002F34_00C_018 {
13 changes: 0 additions & 13 deletions include/variables.h
Original file line number Diff line number Diff line change
@@ -81,19 +81,6 @@ extern u32 D_B0000D10;

extern u8 D_800818E0[0x20];

typedef struct unk_D_80068BA0 {
/* 0x00 */ char pad00[0x2];
/* 0x02 */ s16 unk_02;
/* 0x04 */ s16 unk_04;
/* 0x06 */ u16 unk_06;
/* 0x08 */ u16 unk_08;
/* 0x0A */ char pad0A[0x2];
} unk_D_80068BA0; // size >= 0xC

extern unk_D_80068BA0* D_80068BA0;
extern unk_D_80068BA0* D_80068BA4;
extern unk_D_80068BA0* D_80068BA8;
extern unk_D_80068BA0* D_80068BAC;
extern Gfx D_8006F518[];
extern Gfx D_8006F630[];
extern u8 D_82000000;
13 changes: 12 additions & 1 deletion linker_scripts/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
@@ -77,7 +77,6 @@ D_87906048 = 0x87906048;
D_87906060 = 0x87906060;
D_87906064 = 0x87906064;
D_87906068 = 0x87906068;
D_8790606C = 0x8790606C;
D_87906070 = 0x87906070;
D_87906094 = 0x87906094;
D_87906098 = 0x87906098;
@@ -296,3 +295,15 @@ D_8006F050 = 0x8006F050; // size:0xC
D_8006F05C = 0x8006F05C; // size:0x6
D_8006F064 = 0x8006F064; // size:0xC
D_800ABE10 = 0x800ABE10; // size:0xA18
gPlayer1Controller = 0x80068BA0;
gPlayer2Controller = 0x80068BA4;
gPlayer3Controller = 0x80068BA8;
gPlayer4Controller = 0x80068BAC;
D_8790606C = 0x8790606C; // size:0x6
D_87906088 = 0x87906088; // size:0xC
D_8790609C = 0x8790609C; // size:0x6
D_879060AC = 0x879060AC; // size:0x6
pad_D_879060B4 = 0x879060B4; // size:0x8
D_879060E0 = 0x879060E0; // size:0xC
D_87906100 = 0x87906100; // size:0xC
D_87906110 = 0x87906110; // size:0xC
9 changes: 1 addition & 8 deletions src/11BA0.h
Original file line number Diff line number Diff line change
@@ -9,17 +9,10 @@ typedef struct unk_func_80011B94 {
/* 0x18 */ Gfx* unk_18;
} unk_func_80011B94; // size = 0x1C

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

unk_D_86002F58_004_000_000* func_8001103C(MainPoolState*, void*);
unk_D_86002F58_004_000* func_80011938(MainPoolState* arg0, unk_D_86002F58_004_000* arg1, s16 arg2, Vec3f* arg3, Vec3s* arg4, Vec3f* arg5);
unk_func_80011B94* func_80011B94(MainPoolState*, unk_func_80011B94*, s32, Gfx*);
unk_D_86404778_190* func_80011B10(MainPoolState*, s32, s32, s32, Vec3f*, f32);
unk_D_86002F34_alt9* func_80011B10(MainPoolState*, s32, s32, s32, Vec3f*, f32);
void func_80012094(unk_D_86002F58_004_000_000*, unk_D_86002F58_004_000_000*);


36 changes: 18 additions & 18 deletions src/12D80.c
Original file line number Diff line number Diff line change
@@ -29,17 +29,17 @@ unk_D_86002F34_00C* D_8006F094 = NULL;
unk_D_86002F34_alt1* D_8006F098 = NULL;
unk_D_86002F58_004_000* D_8006F09C = NULL;
unk_D_86002F34_alt11* D_8006F0A0 = NULL;
func_D_8006F0A4 D_8006F0A4[] = {
static func_D_8006F0A4 D_8006F0A4[] = {
func_80013330, func_800133D8, func_80013464, func_80013764, func_8001378C, func_8001395C, func_800139E8,
func_80013AF8, func_80013B8C, func_80013C14, func_80013C1C, func_80013D34, func_80013F7C, func_80013F84,
func_80014124, func_80014D70, func_80014214, func_800142BC, func_80014334, func_80014384, func_800143C0,
func_80014624, func_80014690, func_800148D8, func_80014980, func_80014A60, func_80014AEC, func_80014D24,
func_80014D50, NULL, NULL,
};

s32 D_8006F120 = 0;
static s32 D_8006F120 = 0;

u32 D_8006F124[4][9] = {
static u32 D_8006F124[4][9] = {
{
0x3024000,
0x3024000,
@@ -86,7 +86,7 @@ u32 D_8006F124[4][9] = {
},
};

u8 D_8006F1B4[15][16] = {
static u8 D_8006F1B4[15][16] = {
{ 0x1F, 0x1F, 0x1F, 3, 7, 7, 7, 3, 0, 0x1F, 4, 0x1F, 0, 7, 6, 7 },
{ 1, 0x1F, 3, 0x1F, 7, 7, 7, 1, 0, 0x1F, 4, 0x1F, 0, 7, 6, 7 },
{ 1, 3, 8, 3, 7, 7, 3, 7, 0, 0x1F, 4, 0x1F, 0, 7, 6, 7 },
@@ -104,20 +104,20 @@ u8 D_8006F1B4[15][16] = {
{ 1, 0x1F, 4, 0x1F, 1, 7, 4, 7, 0x1F, 0x1F, 0x1F, 0, 0, 7, 6, 7 },
};

s16 D_8006F2A4[] = { 16, 8, 4, 2, 0, 0 };

s32 D_800AA6C0;
MtxF* D_800AA6C8[8];
u8 pad_D_800AA6E8[0x1E0];
unk_D_800AA8C8 D_800AA8C8;
unk_D_800AB970 D_800AB970;
s32 D_800ABB00;
s32 D_800ABB04;
s32 D_800ABB08;
unk_D_800ABB10 D_800ABB10;
unk_D_800ABB28 D_800ABB28[10];
unk_D_800ABB28* D_800ABCB8;
s32 D_800ABCBC;
static s16 D_8006F2A4[] = { 16, 8, 4, 2, 0, 0 };

static s32 D_800AA6C0;
static MtxF* D_800AA6C8[8];
static u8 pad_D_800AA6E8[0x1E0];
static unk_D_800AA8C8 D_800AA8C8;
static unk_D_800AB970 D_800AB970;
static s32 D_800ABB00;
static s32 D_800ABB04;
static s32 D_800ABB08;
static unk_D_800ABB10 D_800ABB10;
static unk_D_800ABB28 D_800ABB28[10];
static unk_D_800ABB28* D_800ABCB8;
static s32 D_800ABCBC;

void func_80012180(void) {
D_800AA8C8.unk_10A0 = 0;
10 changes: 10 additions & 0 deletions src/12D80.h
Original file line number Diff line number Diff line change
@@ -44,6 +44,16 @@ typedef struct unk_D_800ABB10 {
/* 0x14 */ Gfx* unk_14;
} unk_D_800ABB10; // size = 0x18?

extern s32 D_8006F080;
extern u16 D_8006F084;
extern unk_D_86002F34_00C* D_8006F088;
extern unk_D_86002F34_alt1* D_8006F08C;
extern unk_D_86002F34_alt1* D_8006F090;
extern unk_D_86002F34_00C* D_8006F094;
extern unk_D_86002F34_alt1* D_8006F098;
extern unk_D_86002F58_004_000* D_8006F09C;
extern unk_D_86002F34_alt11* D_8006F0A0;

void func_80012180(void);
void func_800121C8(void);
void func_80012230(MtxF* arg0);
20 changes: 10 additions & 10 deletions src/20330.c
Original file line number Diff line number Diff line change
@@ -3,33 +3,33 @@

static s32 pad_D_800AC880[0x2];
static s32 D_800AC888;
static unk_D_80068BA0* D_800AC88C;
static Controller* D_800AC88C;

void func_8001F730(void) {
}

void func_8001F738(unk_D_80068BA0* arg0) {
void func_8001F738(Controller* arg0) {
D_800AC888 = 0xA;
D_800AC88C = arg0;
}

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

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

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

if (D_800AC88C->unk_08 & 0x100) {
if (D_800AC88C->buttonPressed & 0x100) {
D_800AC888 = 0xA;
return 0x100;
}
@@ -39,22 +39,22 @@ s32 func_8001F750(void) {
D_800AC888 = 0;

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

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

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

if (D_800AC88C->unk_06 & 0x100) {
if (D_800AC88C->buttonDown & 0x100) {
D_800AC888 = 2;
return 0x100;
}
3 changes: 2 additions & 1 deletion src/20330.h
Original file line number Diff line number Diff line change
@@ -2,9 +2,10 @@
#define _20330_H_

#include "global.h"
#include "src/controller.h"

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


3 changes: 2 additions & 1 deletion src/29BA0.h
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@

#include "global.h"
#include "3FB0.h"
#include "src/controller.h"

typedef struct unk_D_800AE520 {
/* 0x00 */ s16 unk_00;
@@ -64,7 +65,7 @@ typedef struct unk_D_800AE540_0004 {
/* 0x000 */ u8 unk_000;
/* 0x001 */ u8 unk_001;
/* 0x002 */ u8 unk_002;
/* 0x004 */ struct Controller* controller;
/* 0x004 */ Controller* controller;
/* 0x008 */ char unk_008[0x4];
/* 0x00C */ char unk00C[0xC];
/* 0x018 */ s32 unk_018;
2 changes: 1 addition & 1 deletion src/2FEA0.c
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ void func_8002F2A0(void) {
FRAGMENT_LOAD(fragment3);
var_s0 = FRAGMENT_LOAD_AND_CALL(fragment19, 0, 0);
break;
case 15: //
case 15: //
FRAGMENT_LOAD(fragment3);
var_s0 = FRAGMENT_LOAD_AND_CALL(fragment20, 0, 0);
break;
15 changes: 10 additions & 5 deletions src/controller.c
Original file line number Diff line number Diff line change
@@ -3,7 +3,12 @@
#include "gb_tower.h"
#include "math_util.h"

struct Controller gControllers[4];
Controller* gPlayer1Controller = &gControllers[0];
Controller* gPlayer2Controller = &gControllers[1];
Controller* gPlayer3Controller = &gControllers[2];
Controller* gPlayer4Controller = &gControllers[3];

Controller gControllers[4];
OSMesgQueue gSIEventMesgQueue;
u8 gControllerBits;
u8 gEepromProbe;
@@ -22,7 +27,7 @@ void Cont_InitControllers(void) {

// clear each gControllers member.
for (i = 0; i < MAXCONTROLLERS; i++) {
bzero((void*)&gControllers[i], sizeof(struct Controller));
bzero((void*)&gControllers[i], sizeof(Controller));
}

// Initialize each connected controller.
@@ -41,7 +46,7 @@ void Cont_InitControllers(void) {
* Take the updated controller struct and calculate
* the new x, y, and distance floats.
*/
void Cont_AdjustAnalogStick(struct Controller* controller) {
void Cont_AdjustAnalogStick(Controller* controller) {
// reset the controller's x and y floats.
controller->stickX = 0.0f;
controller->stickY = 0.0f;
@@ -75,7 +80,7 @@ void Cont_AdjustAnalogStick(struct Controller* controller) {
}

if (controller->stickMag > 0.0f) {
controller->unkE = MathUtil_Atan2s(-controller->stickY, controller->stickX);
controller->angle = MathUtil_Atan2s(-controller->stickY, controller->stickX);
}
}

@@ -93,7 +98,7 @@ void Cont_StartReadInputs(void) {
*/
void Cont_ReadInputs(void) {
s32 i;
struct Controller* controller = &gControllers[0];
Controller* controller = &gControllers[0];

osRecvMesg(&gSIEventMesgQueue, NULL, OS_MESG_BLOCK);
osContGetReadData(&gControllerPads[0]);
23 changes: 14 additions & 9 deletions src/controller.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#ifndef _CONTROLLER_H_
#define _CONTROLLER_H_

struct Controller {
typedef struct Controller {
/* 0x00 */ s16 contId;
/* 0x02 */ s16 rawStickX;
/* 0x04 */ s16 rawStickY;
/* 0x06 */ u16 buttonDown;
/* 0x08 */ u16 buttonPressed;
/* 0x0A */ u16 unkA;
char fillerC[2];
/* 0x0E */ u16 unkE;
/* 0x10 */ float stickMag;
/* 0x14 */ float stickX;
/* 0x18 */ float stickY;
/* 0x0C */ char fillerC[2];
/* 0x0E */ s16 angle;
/* 0x10 */ f32 stickMag;
/* 0x14 */ f32 stickX;
/* 0x18 */ f32 stickY;
/* 0x1C */ OSContStatus *statusData;
/* 0x20 */ OSContPad *controllerData;
};
} Controller;

extern struct Controller gControllers[4];
extern Controller gControllers[4];
extern OSMesgQueue gSIEventMesgQueue;
extern u8 gControllerBits;
extern u8 gEepromProbe;
@@ -27,8 +27,13 @@ extern OSMesg gSIEventMesgBuf[1];
extern OSMesg gEepromMesgBuf[1];
extern OSMesgQueue gEepromMesgQueue;

extern Controller* gPlayer1Controller;
extern Controller* gPlayer2Controller;
extern Controller* gPlayer3Controller;
extern Controller* gPlayer4Controller;

void Cont_InitControllers(void);
void Cont_AdjustAnalogStick(struct Controller *controller);
void Cont_AdjustAnalogStick(Controller *controller);
void Cont_StartReadInputs(void);
void Cont_ReadInputs(void);
u8 Cont_GetControllerBits(void);
4 changes: 2 additions & 2 deletions src/crash_screen.c
Original file line number Diff line number Diff line change
@@ -74,8 +74,8 @@ void crash_screen_wait_for_button_combo(void) {
do {
Cont_StartReadInputs();
Cont_ReadInputs();
if (D_80068BA0->unk_08 != 0) {
if (D_80068BA0->unk_08 == gCrashScreenUnlockInputs[i++]) {
if (gPlayer1Controller->buttonPressed != 0) {
if (gPlayer1Controller->buttonPressed == gCrashScreenUnlockInputs[i++]) {
// have we reached the end of the array? exit the sleep loop.
if (i == 10) {
breakloop = TRUE;
4 changes: 2 additions & 2 deletions src/fragments/10/fragment10.c
Original file line number Diff line number Diff line change
@@ -690,9 +690,9 @@ void func_86401B3C(void) {

while (var_s2 != 0) {
if (var_s1 >= 0x11) {
if (D_80068BA0->unk_08 & 0x1000) {
if (gPlayer1Controller->buttonPressed & 0x1000) {
var_s2 = 0;
} else if ((D_8780FA2A == 0) && (D_80068BA0->unk_08 & 0x4000)) {
} else if ((D_8780FA2A == 0) && (gPlayer1Controller->buttonPressed & 0x4000)) {
func_80048B90(3);
func_87802EB8(2);
D_87B000D0 = 1;
2 changes: 1 addition & 1 deletion src/fragments/10/fragment10.h
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ typedef struct unk_D_86404778 {
/* 0x020 */ s32 unk_020;
/* 0x024 */ u8 unk_024;
/* 0x028 */ unk_D_86002F58_004_000 unk_028;
/* 0x190 */ unk_D_86404778_190* unk_190;
/* 0x190 */ unk_D_86002F34_alt9* unk_190;
/* 0x194 */ u16 unk_194[14][8];
/* 0x274 */ u8 unk_274;
} unk_D_86404778; // size = 0x278
4 changes: 2 additions & 2 deletions src/fragments/11/fragment11.c
Original file line number Diff line number Diff line change
@@ -608,9 +608,9 @@ void func_86501668(void) {

while (var_s2 != 0) {
if (var_s1 >= 0x11) {
if (D_80068BA0->unk_08 & 0x1000) {
if (gPlayer1Controller->buttonPressed & 0x1000) {
var_s2 = 0;
} else if ((D_8780FA2A == 0) && (D_80068BA0->unk_08 & 0x4000)) {
} else if ((D_8780FA2A == 0) && (gPlayer1Controller->buttonPressed & 0x4000)) {
func_80048B90(3);
func_87802EB8(2);
D_87B000D0 = 1;
2 changes: 1 addition & 1 deletion src/fragments/11/fragment11.h
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ typedef struct unk_D_8650A528 {
/* 0x010 */ s16 unk_010;
/* 0x010 */ s16 unk_012;
/* 0x014 */ unk_D_86002F58_004_000 unk_014;
/* 0x17C */ unk_D_86404778_190* unk_17C;
/* 0x17C */ unk_D_86002F34_alt9* unk_17C;
} unk_D_8650A528; // size = 0x180

typedef struct unk_D_8650AB30_000 {
30 changes: 15 additions & 15 deletions src/fragments/2/fragment2_2.c
Original file line number Diff line number Diff line change
@@ -1237,7 +1237,7 @@ u16 D_8780FC96;
u16 D_8780FC98;
static u8 D_8780FC9A;
static u8 D_8780FC9B;
static unk_D_80068BA0* D_8780FC9C;
static Controller* D_8780FC9C;
static u8 D_8780FCA0;
static u8 D_8780FCA1;
static u8 D_8780FCA2;
@@ -1279,7 +1279,7 @@ void func_878029C0(void) {
D_8780FC44 = 0;
D_8780FC4C = 0;
D_8780FC5C = 0;
D_8780FC9C = D_80068BA0;
D_8780FC9C = gPlayer1Controller;
D_8780FC60 = D_8780FC64 = D_8780FC68 = D_8780FC6C = D_8780FC70 = D_8780FC74 = 0;
D_8780FC92 = 0;
D_8780FC94 = 0;
@@ -1903,9 +1903,9 @@ s32 func_87804FD4(void) {

sp67 = 0;
sp66 = 0;
if (D_8780FC9C->unk_04 >= 0x32) {
if (D_8780FC9C->rawStickY >= 0x32) {
sp67 = 1;
} else if (D_8780FC9C->unk_04 < -0x31) {
} else if (D_8780FC9C->rawStickY < -0x31) {
sp66 = 1;
}

@@ -1936,19 +1936,19 @@ s32 func_87804FD4(void) {
}
} else if (D_8780FC92 == 0) {
if (D_8780FC94 != 0) {
if ((D_8780FC9C->unk_08 & 0x800) || ((sp67 == 1) && (D_8780FC9A == 0))) {
if ((D_8780FC9C->buttonPressed & 0x800) || ((sp67 == 1) && (D_8780FC9A == 0))) {
func_8004AF44(2);
D_8780FC5C--;
if (D_8780FC5C < 0) {
D_8780FC5C = D_8780FC5D - 1;
}
} else if ((D_8780FC9C->unk_08 & 0x400) || ((sp66 == 1) && (D_8780FC9B == 0))) {
} else if ((D_8780FC9C->buttonPressed & 0x400) || ((sp66 == 1) && (D_8780FC9B == 0))) {
func_8004AF44(2);
D_8780FC5C++;
if (D_8780FC5C >= D_8780FC5D) {
D_8780FC5C = 0;
}
} else if (D_8780FC9C->unk_08 & 0x8000) {
} else if (D_8780FC9C->buttonPressed & 0x8000) {
if (D_8780FC5C == 0) {
func_8004AF44(0);
D_8780FC94 = 0;
@@ -1957,12 +1957,12 @@ s32 func_87804FD4(void) {
D_8780FC92 = 1;
D_8780FE01 = 1;
}
} else if (D_8780FC9C->unk_08 & 0x1000) {
} else if (D_8780FC9C->buttonPressed & 0x1000) {
func_8004AF44(0);
D_8780FC94 = 0;
D_8780FC5C = 0;
}
} else if ((func_87802974() == -2) && (D_8780FC9C->unk_08 & 0x1000)) {
} else if ((func_87802974() == -2) && (D_8780FC9C->buttonPressed & 0x1000)) {
func_8004AF44(1);
D_8780FC94 = 1;
D_8780FC5D = 2;
@@ -1975,7 +1975,7 @@ s32 func_87804FD4(void) {
D_8780FE44 -= D_8780FCA0;
}

if ((D_8780FE44 <= 0) && (D_8780FC9C->unk_08 & 0x8000)) {
if ((D_8780FE44 <= 0) && (D_8780FC9C->buttonPressed & 0x8000)) {
D_8780FC98 = 1;
if (D_8780FA2A == 0) {
func_80048B90(4);
@@ -2025,7 +2025,7 @@ s32 func_87804FD4(void) {

if (i == 4) {
if (D_8780FC6C == 0) {
if (D_8780FC9C->unk_08 & 0x8000) {
if (D_8780FC9C->buttonPressed & 0x8000) {
func_80048B90(4);
if (func_87802FA0() != 0) {
func_8004B1CC(0x13);
@@ -2039,7 +2039,7 @@ s32 func_87804FD4(void) {
} else {
D_8780FE44 -= D_8780FCA0;
if (D_8780FE44 <= 0) {
if (D_8780FC9C->unk_08 & 0x8000) {
if (D_8780FC9C->buttonPressed & 0x8000) {
func_80048B90(4);
D_8780FC40 = 3;
D_8780FC70 = 1;
@@ -2059,19 +2059,19 @@ s32 func_87804FD4(void) {
break;

case 3:
if ((D_8780FC9C->unk_08 & 0x800) || ((sp67 == 1) && (D_8780FC9A == 0))) {
if ((D_8780FC9C->buttonPressed & 0x800) || ((sp67 == 1) && (D_8780FC9A == 0))) {
func_80048B90(1);
D_8780FC5C--;
if (D_8780FC5C < 0) {
D_8780FC5C = D_8780FC5D - 1;
}
} else if ((D_8780FC9C->unk_08 & 0x400) || ((sp66 == 1) && (D_8780FC9B == 0))) {
} else if ((D_8780FC9C->buttonPressed & 0x400) || ((sp66 == 1) && (D_8780FC9B == 0))) {
func_80048B90(1);
D_8780FC5C++;
if (D_8780FC5C >= D_8780FC5D) {
D_8780FC5C = 0;
}
} else if (D_8780FC9C->unk_08 & 0x8000) {
} else if (D_8780FC9C->buttonPressed & 0x8000) {
func_80048B90(2);
if (D_8780FA2A == 0) {
D_8780FC40 = 6;
166 changes: 163 additions & 3 deletions src/fragments/3/fragment3.h
Original file line number Diff line number Diff line change
@@ -2,10 +2,12 @@
#define _FRAGMENT3_H_

#include "global.h"
#include "src/fragments/34/fragment34.h"
#include "src/3FB0.h"

typedef struct unk_func_8790002C {
/* 0x000 */ unk_D_86002F58_004_000 unk_000;
/* 0x168 */ char unk168[0x4];
/* 0x168 */ unk_D_86002F30* unk_168;
/* 0x16C */ f32 unk_16C;
/* 0x170 */ f32 unk_170;
/* 0x174 */ f32 unk_174;
@@ -60,7 +62,8 @@ typedef struct unk_func_8790002C {
/* 0x234 */ s16 unk_234;
/* 0x236 */ s16 unk_236;
/* 0x238 */ s16 unk_238;
/* 0x23A */ char unk23A[0x4];
/* 0x23A */ char unk23A[0x2];
/* 0x23A */ s16 unk_23C;
/* 0x23E */ s16 unk_23E;
/* 0x240 */ s16 unk_240;
/* 0x242 */ s16 unk_242;
@@ -104,6 +107,163 @@ typedef struct unk_func_8790002C {
/* 0x2A6 */ char unk2A6[0x2];
/* 0x2A8 */ s16 unk_2A8;
/* 0x2AA */ s16 unk_2AA;
} unk_func_8790002C; // size >= 0x2AC
/* 0x2AC */ s16 unk_2AC;
/* 0x2B0 */ char unk2B0[0x4];
} unk_func_8790002C; // size = 0x2B4

// Possibly unk_D_86002F34_alt7, unk_D_86002F34_alt8,
// unk_D_86002F34_alt9 or unk_D_86002F34_alt2
typedef struct arg1_func_87902F80 {
/* 0x00 */ unk_D_86002F34_000 unk_00;
/* 0x18 */ Gfx* unk_18;
} arg1_func_87902F80; // size >= 0x1C

typedef struct unk_D_87903E00 {
/* 0x00 */ u32 unk_00;
/* 0x04 */ void* unk_04;
/* 0x08 */ void* unk_08;
/* 0x0C */ u32* unk_0C;
} unk_D_87903E00; // size = 0x10

typedef struct unk_D_87903E10 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ unk_D_87903E00* unk_04;
} unk_D_87903E10; // size = 0x8

extern s16 D_87903DA4;
extern s16 D_87903DA8;
extern s16 D_87903DAC;
extern s16 D_87903DC0;
extern s16 D_87903DC4;
extern s16 D_87903DC8;
extern s16 D_87903DCC;
extern s16 D_87903DD0;
extern s16 D_87903DD4;

extern unk_D_87903E10 D_87903E10;
extern unk_D_87903E10 D_87903E28;
extern unk_D_87903E10 D_87903E40;
extern unk_D_87903E10 D_87903E58;

extern s16 D_87906040;
extern s16 D_87906044;
extern s16 D_87906046;
extern s16 D_87906048;
extern s16 D_8790604A;

extern unk_D_86002F34_00C* D_87906054;
extern s16 D_87906060;
extern s16 D_87906062;
extern s16 D_87906064;
extern s16 D_87906066;
extern s16 D_87906068;
extern s16 D_8790606A;
extern Vec3s D_8790606C;
extern s16 D_87906072;
extern s16 D_87906076;
extern s16 D_87906078;
extern f32 D_8790607C;
extern f32 D_87906080;
extern Vec3f D_87906088;

extern s16 D_87906094;
extern s16 D_87906096;
extern s16 D_87906098;
extern s16 D_8790609A;
extern Vec3s D_8790609C;

extern s16 D_879060A2;
extern s16 D_879060A4;
extern s16 D_879060A6;
extern s16 D_879060A8;
extern Vec3s D_879060AC;

extern s16 D_87903DB0;
extern s16 D_87903DB8;

extern s8 D_879060C4;
extern s8 D_879060C5;
extern s8 D_879060C6;
extern s8 D_879060C7;
extern s16 D_879060C8;
extern s16 D_879060CA;

extern Vec3f D_879060E0;
extern Vec3f D_87906100;
extern Vec3f D_87906110;

ret_func_80004454 func_87900020(void);
void func_8790002C(unk_func_8790002C* arg0, unk_func_8790002C* arg1);
void func_87900070(unk_func_8790002C* arg0, unk_func_8790002C* arg1);
s32 func_879000C4(unk_func_8790002C* arg0, unk_func_8790002C* arg1);
s32 func_879001A4(unk_func_8790002C* arg0, unk_func_8790002C* arg1);
void func_879002B8(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3);
void func_879002FC(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4);
void func_87900344(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3);
s32 func_87900384(unk_func_8790002C* arg0);
void func_879003A0(unk_func_8790002C* arg0);
void func_879004F8(unk_D_86002F58_004_000* arg0);
void func_87900528(void);
void func_87900558(void);
void func_87900564(unk_func_8790002C* arg0);
void func_87900594(unk_func_8790002C* arg0);
void func_879005AC(unk_func_8790002C* arg0);
void func_879005C4(unk_func_8790002C* arg0);
void func_8790060C(unk_func_8790002C* arg0);
void func_87900770(unk_func_8790002C* arg0);
void func_87900808(unk_func_8790002C* arg0);
void func_87900854(void);
void func_87900920(void);
void func_879009B4(void);

void func_87900A50(void);
void func_87900B64(void);
s32 func_87900C5C(void);
void func_87900F44(void);
void func_879010A4(void);
void func_87901200(void);

void func_87901620(void);
s32 func_8790168C(void);
void func_87901720(unk_D_8140E728* arg0);
void func_87901804(s32 arg0, f32 arg1, Vec3f arg2, func_unk_D_8140E720_008 arg3, unk_D_8140E728_01C* arg4, s16 arg5, u8 arg6, u8 arg7);
void func_879018B0(s32 arg0, s32 arg1, s8 arg2, f32 arg3, Vec3f arg4, func_unk_D_8140E720_008 arg7, unk_D_8140E728_01C* arg8, s16 arg9, u8 argA, u8 argB);
void func_87901958(unk_D_8140E720* arg0, unk_D_8140E728* arg1, s16 arg2);
void func_87901A28(unk_D_8140E728* arg0);
void func_87901ADC(unk_D_8140E728* arg0);
void func_87901B08(void);
void func_87901BB0(unk_D_8140E720* arg0);
void func_87901BD4(unk_D_8140E720* arg0);
void func_87901C20(void);
void func_87901C98(void);
void func_87901DA0(unk_D_8140E720* arg0);
void func_87901F04(unk_D_8140E720* arg0);
void func_87901FA0(unk_D_8140E720* arg0);
void func_87902068(unk_D_8140E720* arg0);
void func_8790215C(unk_D_8140E720* arg0);
void func_87902224(unk_D_8140E720* arg0);
void func_87902318(unk_D_8140E720* arg0);
void func_879023EC(unk_D_8140E720* arg0);
void func_879024DC(unk_D_8140E720* arg0);
void func_87902608(unk_D_8140E720* arg0);
void func_879026D8(unk_D_8140E720* arg0);
void func_879027F0(unk_D_8140E720* arg0);
void func_879028E0(unk_D_8140E720* arg0);
void func_879029F0(unk_D_8140E720* arg0);
void func_87902AE0(unk_D_8140E720* arg0);
void func_87902C9C(unk_D_8140E720* arg0);
void func_87902D3C(Gfx* arg0, unk_D_86002F34_000_014* arg1, UNUSED u16 arg2);
void func_87902F80(s32 arg0, arg1_func_87902F80* arg1);
void func_87902FC8(Gfx* arg0, unk_D_86002F34_000_014* arg1, UNUSED u16 arg2);
void func_8790320C(s32 arg0, arg1_func_87902F80* arg1);

void func_87903260(void);
void func_87903294(void);
void func_879032BC(s16 arg0);
void func_87903358(s16 arg0, s16 arg1);
void func_879033FC(unk_func_8790002C* arg0);
void func_8790354C(void);



#endif // _FRAGMENT3_H_
45 changes: 14 additions & 31 deletions src/fragments/3/fragment3_1189B0.c
Original file line number Diff line number Diff line change
@@ -8,37 +8,20 @@
#include "src/controller.h"
#include "src/fragments/2/fragment2.h"

extern s16 D_87903DA4;
extern s16 D_87903DA8;
extern s16 D_87903DAC;
extern s16 D_87903DC0;
extern s16 D_87903DC4;
extern s16 D_87903DC8;
extern s16 D_87903DCC;
extern s16 D_87903DD0;

extern s16 D_87906040;
extern s16 D_87906044;
extern s16 D_87906048;
extern s16 D_8790604A;

extern s16 D_87906060;
extern s16 D_87906062;
extern s16 D_87906064;
extern s16 D_87906066;
extern Vec3s D_8790606C;
extern s16 D_87906072;
extern s16 D_87906076;
extern s16 D_87906078;
extern f32 D_8790607C;
extern f32 D_87906080;
extern Vec3f D_87906088;
extern s8 D_879060C4;
extern s8 D_879060C5;
extern s8 D_879060C6;
extern s8 D_879060C7;
extern s16 D_879060C8;

s16 D_87903DA0 = 0;
s16 D_87903DA4 = 0;
s16 D_87903DA8 = 0;
s16 D_87903DAC = 0;
s16 D_87903DB0 = 0;
s32 pad_D_87903DB4 = 0;
s16 D_87903DB8 = 0;
s32 pad_D_87903DBC = 0;
s16 D_87903DC0 = 0;
s16 D_87903DC4 = 0;
s16 D_87903DC8 = 0;
s16 D_87903DCC = 0;
s16 D_87903DD0 = 0;
s16 D_87903DD4 = 0;

ret_func_80004454 func_87900020(void) {
return func_87900020;
297 changes: 290 additions & 7 deletions src/fragments/3/fragment3_1193E0.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,296 @@
#include "global.h"
#include "fragment3.h"
#include "src/1CF30.h"
#include "src/20470.h"
#include "src/F420.h"
#include "src/controller.h"

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_1193E0/func_87900A50.s")
s16 D_87906040;
s16 pad_D_87906042;
s16 D_87906044;
s16 D_87906046;
s16 D_87906048;
s16 D_8790604A;
s32 pad_D_8790604C;
s32 D_87906050;
unk_D_86002F34_00C* D_87906054;
s32 pad_D_87906058[2];
s16 D_87906060;
s16 D_87906062;
s16 D_87906064;
s16 D_87906066;
s16 D_87906068;
s16 D_8790606A;
Vec3s D_8790606C;
s16 D_87906072;
s16 pad_D_87906074;
s16 D_87906076;
s16 D_87906078;
f32 D_8790607C;
f32 D_87906080;
s32 pad_D_87906084;
Vec3f D_87906088;
s16 D_87906094;
s16 D_87906096;
s16 D_87906098;
s16 D_8790609A;
Vec3s D_8790609C;
s16 D_879060A2;
s16 D_879060A4;
s16 D_879060A6;
s16 D_879060A8;
Vec3s D_879060AC;
s32 pad_D_879060B4;
s32 pad_D_879060B8;
s16 D_879060BC;
s16 D_879060BE;
s16 D_879060C0;
s16 D_879060C2;
s8 D_879060C4;
s8 D_879060C5;
s8 D_879060C6;
s8 D_879060C7;
s16 D_879060C8;
s16 D_879060CA;
s32 pad_D_879060D0[4];
Vec3f D_879060E0;
Vec3f pad_D_879060F0;
Vec3f D_87906100;
Vec3f D_87906110;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_1193E0/func_87900B64.s")
void func_87900A50(void) {
D_87906060 = D_879060A2 + D_87906094;
D_87906062 = D_879060A4 + D_87906096;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_1193E0/func_87900C5C.s")
D_8790606C.x = D_879060AC.x + D_8790609C.x;
D_8790606C.y = D_879060AC.y + D_8790609C.y;
D_8790606C.z = D_879060AC.z + D_8790609C.z;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_1193E0/func_87900F44.s")
D_87906064 = D_879060A6 + D_87906098;
D_87906066 = D_879060A8 + D_8790609A;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_1193E0/func_879010A4.s")
if (D_87906064 < 0x32) {
D_87906064 = 0x32;
D_87906098 = D_87906064 - D_879060A6;
}

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_1193E0/func_87901200.s")
if (D_87906066 < 0xA) {
D_87906066 = 0xA;
D_8790609A = D_87906066 - D_879060A8;
}
}

void func_87900B64(void) {
D_87906054->unk_24.fovy = D_87906066;
D_87906054->unk_24.near = D_87906068;
D_87906054->unk_24.far = D_8790606A;

D_87906054->unk_60.at.x = D_8790606C.x;
D_87906054->unk_60.at.y = D_8790606C.y;
D_87906054->unk_60.at.z = D_8790606C.z;

func_80010354(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, D_87906064, D_87906060, D_87906062);
}

s32 func_87900C5C(void) {
s16 sp6;

if (D_87903DB0 == 0) {
return;
}

if (gPlayer1Controller->buttonPressed & 0x20) {
D_87903DB8++;
if (D_87903DB8 == 1) {
D_87903DB8 = 0;
}
}

if (gPlayer1Controller->buttonPressed & 0x10) {
D_87903DB8--;
if (D_87903DB8 < 0) {
D_87903DB8 = 0;
}
}

if (gPlayer1Controller->buttonPressed & 0x1000) {
D_8790609C.x = 0;
D_8790609C.y = 0;
D_8790609C.z = 0;

D_87906094 = 0;
D_87906096 = 0;
D_87906098 = 0;
D_8790609A = 0;
}

if (D_87903DB8 == 0) {
if (gPlayer1Controller->buttonDown & 0xCF00) {
if (gPlayer1Controller->buttonDown & 0x800) {
sp6 = D_87906062 + 0x8000;
}

if (gPlayer1Controller->buttonDown & 0x400) {
sp6 = D_87906062;
}

if (gPlayer1Controller->buttonDown & 0x200) {
sp6 = D_87906062 + 0xC000;
}

if (gPlayer1Controller->buttonDown & 0x100) {
sp6 = D_87906062 + 0x4000;
}

if (gPlayer1Controller->buttonDown & 0x8000) {
sp6 = D_87906062 + 0x8000;
}

if (gPlayer1Controller->buttonDown & 0x4000) {
sp6 = D_87906062;
}

D_8790609C.x += SINS(sp6) * 16.0f;
D_8790609C.z += COSS(sp6) * 16.0f;
}

D_87906096 += gPlayer1Controller->stickX * 4.0f;
D_87906094 += gPlayer1Controller->stickY * 4.0f;

if (gPlayer1Controller->buttonDown & 8) {
D_8790609C.y += 4;
}

if (gPlayer1Controller->buttonDown & 4) {
D_8790609C.y -= 4;
}

if (gPlayer1Controller->buttonDown & 1) {
D_87906098 += 0xA;
}

if (gPlayer1Controller->buttonDown & 2) {
D_87906098 -= 0xA;
}
}
}

void func_87900F44(void) {
u8 sp24[3] = { 0, 0, 30 }; // D_87903DE0
u8 sp20[3] = { 0, 0, 250 }; // D_87903DE4

func_80020460(0x14, 0x14, 0x122, 0x3C, 0x141);
func_8001F3F4();
func_8001EBE0(2, -2);
func_8001F324(0xFF, 0xFF, 0xFF, 0xFF);

if (D_87903DB8 == 0) {
func_8001F1E8(0x19, 0x1C, "TRANSRATE");
}

func_8001F1E8(0x19, 0x28, "CAMERA X:%d", D_8790606C.x);
func_8001F1E8(0x19, 0x34, "CAMERA Y:%d", D_8790606C.y);
func_8001F1E8(0x19, 0x40, "CAMERA Z:%d", D_8790606C.z);
func_8001F1E8(0xA7, 0x28, "CAMERA D:%d", D_87906064);
func_8001F1E8(0xA7, 0x34, "CAMERA F:%d", D_87906066);
func_8001F1E8(0xA7, 0x40, "X:%04hX Y:%04hX", D_87906060, D_87906062);
func_8001F444();
}

void func_879010A4(void) {
u8 sp2C[3] = { 0, 0, 30 }; // D_87903DE8
u8 sp28[3] = { 0, 0, 250 }; // D_87903DEC

func_80020460(0x78, 0x80, 0xB4, 0x64, 0x141);
func_8001F3F4();
func_8001EBE0(2, -2);
func_8001F324(0xFF, 0xFF, 0xFF, 0xFF);
func_8001F1E8(0x82, 0x8C, "FORCE :%2.2f", gPlayer1Controller->stickMag);
func_8001F1E8(0x82, 0x98, "LEVEL X :%2.2f", gPlayer1Controller->stickX);
func_8001F1E8(0x82, 0xA4, "LEVEL Y :%2.2f", gPlayer1Controller->stickY);
func_8001F1E8(0x82, 0xB0, "STICK X :%d", gPlayer1Controller->rawStickX);
func_8001F1E8(0x82, 0xBC, "STICK Y :%d", gPlayer1Controller->rawStickY);
func_8001F1E8(0x82, 0xC8, "ANGLE :%04hx", gPlayer1Controller->angle);
func_8001F444();
}

void func_87901200(void) {
UNUSED s32 pad;
u8 sp30[3] = { 0, 0, 30 }; // D_87903DF0
u8 sp2C[3] = { 0, 0, 250 }; // D_87903DF4

if (gPlayer1Controller->buttonPressed & 8) {
D_879060CA--;
if (D_879060CA < 0) {
D_879060CA = 4;
}
}

if (gPlayer1Controller->buttonPressed & 4) {
D_879060CA++;
if (D_879060CA >= 5) {
D_879060CA = 0;
}
}

switch (D_879060CA) {
case 0:
if (gPlayer1Controller->buttonPressed & 2) {
D_87906100.x -= 0.1f;
}
if (gPlayer1Controller->buttonPressed & 1) {
D_87906100.x += 0.1f;
}
break;

case 1:
if (gPlayer1Controller->buttonPressed & 2) {
D_87906100.y -= 0.1;
}
if (gPlayer1Controller->buttonPressed & 1) {
D_87906100.y += 0.1;
}
break;

case 2:
if (gPlayer1Controller->buttonPressed & 2) {
D_879060E0.x -= 1.0;
}
if (gPlayer1Controller->buttonPressed & 1) {
D_879060E0.x += 1.0;
}
break;

case 3:
if (gPlayer1Controller->buttonPressed & 2) {
D_879060E0.y -= 1.0;
}
if (gPlayer1Controller->buttonPressed & 1) {
D_879060E0.y += 1.0;
}
break;

case 4:
if (gPlayer1Controller->buttonPressed & 2) {
D_87906110.y -= 0.02;
}
if (gPlayer1Controller->buttonPressed & 1) {
D_87906110.y += 0.02;
}
break;
}

func_80020460(0x78, 0x80, 0xB4, 0x64, 0x141);
func_8001F3F4();
func_8001EBE0(2, -2);
func_8001F324(0xFF, 0xFF, 0xFF, 0xFF);
func_8001F1E8(0x7C, 0x8C + (D_879060CA * 0xC), "@");

func_8001F1E8(0x82, 0x8C, "VX:%2.2f", D_87906100.x);
func_8001F1E8(0x82, 0x98, "VY:%2.2f", D_87906100.y);
func_8001F1E8(0x82, 0xA4, "BX:%2.2f", D_879060E0.x);
func_8001F1E8(0x82, 0xB0, "BY:%2.2f", D_879060E0.y);
func_8001F1E8(0x82, 0xBC, "GV:%2.2f", D_87906110.y);
func_8001F1E8(0x82, 0xC8, "PW:%2.2f", D_87906110.x);

func_8001F444();
}
696 changes: 628 additions & 68 deletions src/fragments/3/fragment3_119FB0.c

Large diffs are not rendered by default.

405 changes: 398 additions & 7 deletions src/fragments/3/fragment3_11BBF0.c

Large diffs are not rendered by default.

253 changes: 244 additions & 9 deletions src/fragments/3/fragment3_11BF90.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,254 @@
#include "global.h"
#include "fragment3.h"
#include "src/19840.h"
#include "src/1C720.h"
#include "src/memory.h"

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_87903600.s")
static unk_func_8790002C* D_87906120;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_879036B4.s")
void func_87903600(void) {
s32 i;
unk_func_8790002C* ptr;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_8790370C.s")
D_87906120 = main_pool_alloc(sizeof(unk_func_8790002C) * 3, 0);
ptr = D_87906120;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_87903778.s")
for (i = 0; i < 3; i++, ptr++) {
func_8001BB58(&ptr->unk_000);
ptr->unk_168 = func_80019D18(0xAB);
func_8001BC34(&ptr->unk_000, 0, ptr->unk_23C, ptr->unk_168->unk_08->unk_00[0]);
func_8001BD04(&ptr->unk_000, 0);
ptr->unk_000.unk_000.unk_01 &= ~1;
func_8790060C(ptr);
}
}

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_879037D0.s")
void func_879036B4(unk_func_8790002C* arg0) {
if (arg0->unk_23E == 1) {
arg0->unk_000.unk_000.unk_01 |= 1;
func_879002B8(arg0, 0, -1, 0);
arg0->unk_23E++;
}
}

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_87903838.s")
void func_8790370C(void) {
s32 i;
unk_func_8790002C* ptr = D_87906120;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_879038AC.s")
func_8140C5D0();

for (i = 0; i < 3; i++, ptr++) {
func_879036B4(ptr);
func_879003A0(ptr);
func_87900770(ptr);
func_87900808(ptr);
}
}

void func_87903778(unk_func_8790002C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s16 arg5, s16 arg6, s16 arg7,
s16 arg8) {
arg0->unk_16C = arg1;
arg0->unk_170 = arg1;
arg0->unk_174 = arg1;
arg0->unk_1A8 = arg2;
arg0->unk_1AC = arg3;
arg0->unk_1B0 = arg4;
arg0->unk_21A = arg5;
arg0->unk_21C = arg6;
arg0->unk_21E = arg7;
arg0->unk_266 = arg8;
arg0->unk_23E = 1;
}

void func_879037D0(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6) {
unk_func_8790002C* sp34 = D_87906120;

func_87903778(sp34, arg0, arg1, arg2, arg3, arg4, arg5, arg6, 0);
sp34->unk_000.unk_000.unk_14 = 0;
}

void func_87903838(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6) {
unk_func_8790002C* sp34 = &D_87906120[1];

func_87903778(sp34, arg0, arg1, arg2, arg3, arg4, arg5, arg6, 1);
sp34->unk_000.unk_000.unk_14 = 1;
}

void func_879038AC(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6) {
unk_func_8790002C* sp34 = &D_87906120[2];

func_87903778(sp34, arg0, arg1, arg2, arg3, arg4, arg5, arg6, 2);
sp34->unk_000.unk_000.unk_14 = 2;
}

typedef struct arg1_func_87903D64_014 {
/* 0x00 */ s32 unk_00;
/* 0x04 */ unk_D_86002F34_000_014_004* unk_04;
/* 0x08 */ unk_D_86002F34_000_014_004* unk_08;
/* 0x0C */ unk_D_86002F34_000_014_004* unk_0C;
/* 0x10 */ unk_D_86002F34_000_014_010* unk_10;
/* 0x14 */ unk_D_86002F34_000_014_010* unk_14;
/* 0x18 */ unk_D_86002F34_000_014_010* unk_18;
} arg1_func_87903D64_014;

// Possibly unk_D_86002F34_alt7, unk_D_86002F34_alt8,
// unk_D_86002F34_alt9 or unk_D_86002F34_alt2
typedef struct arg1_func_87903D64 {
/* 0x00 */ char unk00[0x14];
/* 0x00 */ arg1_func_87903D64_014* unk_14;
/* 0x18 */ Gfx* unk_18;
} arg1_func_87903D64; // size >= 0x1C

#ifdef NON_MATCHING
Gfx* func_87903920(Gfx* arg0, arg1_func_87903D64_014* arg1) {
s32 sp38;
s32 sp34;
s32 sp30;

unk_D_86002F34_000_014_004* sp2C;
unk_D_86002F34_000_014_004* sp28;
unk_D_86002F34_000_014_010* sp24;
unk_D_86002F34_000_014_010* sp20;

s32 temp_a2;
s32 temp_t1;
s32 temp_t1_2;
s32 temp_t2;
s32 temp_t2_2;
s32 temp_t2_3;
s32 temp_t4;
s32 var_a0;
s32 var_v1;
u32 temp_a3;
u32 var_v0;
u8* temp_t1_3;
u8* temp_v1;
unk_D_86002F34_000_014_004* var_a1;
unk_D_86002F34_000_014_004* var_a2;
unk_D_86002F34_000_014_010* var_a3;
unk_D_86002F34_000_014_010* var_t0;
u32 tmp1;
u32 tmp2;
u32 tmp3;
u32 tmp4;
u32 tmp5;
u32 tmp6;
u32 tmp7;
u32 tmp8;
u32 tmp9;

temp_a2 = D_8006F09C->unk_000.unk_14;
temp_a3 = (D_8006F09C->unk_040.unk_08 >> 0x10) + 1;

switch (arg1->unk_00) {
default:
var_a0 = sp34;
var_v1 = sp38;
var_v0 = sp30;
break;

case 1:
if (temp_a3 < 0xF) {
var_v1 = 0;
var_v0 = (temp_a3 << 8) / 15;
var_a0 = 1;
} else if (temp_a3 < 0x1D) {
var_v1 = 1;
var_v0 = ((temp_a3 << 8) - 0xF00) / 14;
var_a0 = 2;
} else {
var_v1 = 2;
var_a0 = 2;
var_v0 = 0;
}
break;

case 2:
if (temp_a3 < 5) {
var_v1 = 0;
var_v0 = (temp_a3 << 8) / 5;
var_a0 = 1;
} else if (temp_a3 < 0xF) {
var_v1 = 1;
var_v0 = ((temp_a3 << 8) - 0x500) / 10;
var_a0 = 2;
} else if (temp_a3 < 0x1D) {
var_v1 = 2;
var_v0 = ((temp_a3 << 8) - 0xF00) / 14;
var_a0 = 3;
} else {
var_v1 = 3;
var_a0 = 3;
var_v0 = 0;
}
break;
}

switch (temp_a2) {
default:
var_t0 = sp20;
var_a3 = sp24;
var_a2 = sp28;
var_a1 = sp2C;
break;

case 0:
var_a3 = &arg1->unk_10[var_v1];
var_t0 = &arg1->unk_10[var_a0];
var_a1 = &arg1->unk_04[var_v1];
var_a2 = &arg1->unk_04[var_a0];
break;

case 1:
var_a3 = &arg1->unk_14[var_v1];
var_t0 = &arg1->unk_14[var_a0];
var_a1 = &arg1->unk_08[var_v1];
var_a2 = &arg1->unk_08[var_a0];
break;

case 2:
var_a3 = &arg1->unk_18[var_v1];
var_t0 = &arg1->unk_18[var_a0];
var_a1 = &arg1->unk_0C[var_v1];
var_a2 = &arg1->unk_0C[var_a0];
break;
}

gDPPipeSync(arg0++);

tmp5 = ((var_a1->unk_00[4] * (0x100 - var_v0)) + (var_a2->unk_00[4] * var_v0)) >> 8;

tmp1 = ((var_a1->unk_00[0] * (0x100 - var_v0)) + (var_a2->unk_00[0] * var_v0));
tmp1 >>= 8;
tmp2 = ((var_a1->unk_00[1] * (0x100 - var_v0)) + (var_a2->unk_00[1] * var_v0));
tmp2 >>= 8;
tmp3 = ((var_a1->unk_00[2] * (0x100 - var_v0)) + (var_a2->unk_00[2] * var_v0));
tmp3 >>= 8;
tmp4 = ((var_a1->unk_00[3] * (0x100 - var_v0)) + (var_a2->unk_00[3] * var_v0));
tmp4 >>= 8;

tmp6 = ((var_a3->unk_00[0] * (0x100 - var_v0)) + (var_t0->unk_00[0] * var_v0));
tmp6 >>= 8;
tmp7 = ((var_a3->unk_00[1] * (0x100 - var_v0)) + (var_t0->unk_00[1] * var_v0));
tmp7 >>= 8;
tmp8 = ((var_a3->unk_00[2] * (0x100 - var_v0)) + (var_t0->unk_00[2] * var_v0));
tmp8 >>= 8;
tmp9 = ((var_a3->unk_00[3] * (0x100 - var_v0)) + (var_t0->unk_00[3] * var_v0));
tmp9 >>= 8;

gDPSetPrimColor(arg0++, 0, tmp5, tmp1, tmp2, tmp3, tmp4);

gDPSetEnvColor(arg0++, tmp1, tmp2, tmp3, tmp4);

return arg0;
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_87903920.s")
#endif

void func_87903D64(s32 arg0, arg1_func_87903D64* arg1) {
if (arg0 == 5) {
arg1_func_87903D64_014* tmp = arg1->unk_14;

#pragma GLOBAL_ASM("asm/us/nonmatchings/fragments/3/fragment3_11BF90/func_87903D64.s")
gDisplayListHead = func_87903920(gDisplayListHead, tmp);
}
}
131 changes: 131 additions & 0 deletions src/fragments/34/fragment34.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#ifndef _FRAGMENT34_H_
#define _FRAGMENT34_H_

#include "global.h"

typedef void (*func_unk_D_8140E720_008)(struct unk_D_8140E720*);

typedef struct unk_D_8140E728_01C_004 {
/* 0x00 */ u8 unk_00;
} unk_D_8140E728_01C_004;

typedef struct unk_D_8140E728_01C {
/* 0x00 */ s32 unk_00;
/* 0x04 */ unk_D_8140E728_01C_004* unk_04;
} unk_D_8140E728_01C; // size >= 0x8

typedef struct unk_D_8140E728 {
/* 0x00 */ f32 unk_00;
/* 0x04 */ Vec3f unk_04;
/* 0x10 */ Vec3s unk_10;
/* 0x18 */ func_unk_D_8140E720_008 unk_18;
/* 0x1C */ unk_D_8140E728_01C* unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ u16 unk_24;
/* 0x26 */ s16 unk_26;
/* 0x28 */ s16 unk_28;
/* 0x2A */ s8 unk_2A;
/* 0x2B */ s8 unk_2B;
/* 0x2C */ u8 unk_2C;
/* 0x2D */ u8 unk_2D;
/* 0x2E */ u8 unk_2E;
/* 0x2F */ u8 unk_2F;
} unk_D_8140E728; // size = 0x30

typedef struct unk_D_8140E720 {
/* 0x00 */ struct unk_D_8140E720* next;
/* 0x04 */ char unk04[0x4];
/* 0x08 */ func_unk_D_8140E720_008 unk_08;
/* 0x0C */ unk_D_8140E728_01C* unk_0C;
/* 0x10 */ char unk10[0x8];
/* 0x18 */ s32 unk_18;
/* 0x1C */ char unk1C[0xC];
/* 0x28 */ f32 unk_28;
/* 0x2C */ char unk2C[0x4];
/* 0x30 */ f32 unk_30;
/* 0x34 */ char unk34[0x20];
/* 0x54 */ f32 unk_54;
/* 0x58 */ char unk58[0x10];
/* 0x68 */ Vec3f unk_68;
/* 0x74 */ char unk74[0x20];
/* 0x94 */ Vec3s unk_94;
/* 0x9A */ char unk9A[0x10];
/* 0xAA */ s16 unk_AA;
/* 0xAC */ s16 unk_AC;
/* 0xAE */ char unkAE[0x4];
/* 0xB2 */ s16 unk_B2;
/* 0xB4 */ char unkB4[0x19];
/* 0xCD */ u8 unk_CD;
/* 0xCE */ u8 unk_CE;
/* 0xCF */ u8 unk_CF;
/* 0xD0 */ s8 unk_D0;
} unk_D_8140E720; // size = 0xD4

extern Gfx D_8140DAE0[];
extern Gfx D_8140DB30[];

extern void* D_8140E620;
extern s32 D_8140E624;
extern Vec3f D_8140E628;

extern unk_D_8140E720* D_8140E720;
extern unk_D_8140E728* D_8140E728;
extern s32 D_8140E72C;
extern s32 D_8140E734;

void func_81400930(Vec3f*, Vec3f*);
void func_8140094C(Vec3s*, Vec3s*);
u32 func_81400A78(s32);
s32 func_81400B00(s32);
void func_81406204(Gfx*, s32, s32, s32, s32);
void func_81406288(Gfx*, s32, s32, s32, s32);
void func_81407B04(unk_D_8140E720*);
unk_D_8140E720* func_81407B3C(void);
unk_D_8140E720* func_81407B5C(s32);
void func_81408150(unk_D_8140E720*);
void func_81408158(unk_D_8140E720*);
s32 func_81408180(unk_D_8140E720*);
s32 func_8140819C(unk_D_8140E720*);
void func_814081BC(unk_D_8140E720*);
void func_81408328(unk_D_8140E720*);
void func_81408348(unk_D_8140E720*);
s32 func_81408368(unk_D_8140E720*);
void func_814084D8(unk_D_8140E720*, s32, s32, s32, s32, s32);
void func_81408AF0(unk_D_8140E720*);
void func_81408E18(unk_D_8140E720*, f32, f32, f32);
void func_8140935C(unk_D_8140E720*, s32, s32);
void func_81409404(unk_D_8140E720*, s32, s32);
void func_81409514(unk_D_8140E720*, s32, s32);
void func_8140959C(unk_D_8140E720*, s32, s32, s32);
void func_81409BDC(unk_D_8140E720*);
void func_81409C6C(unk_D_8140E720*);
void func_81409CBC(unk_D_8140E720*);
void func_81409FD8(unk_D_8140E720*);
void func_8140A24C(unk_D_8140E720*, Vec3s);
void func_8140A4F0(unk_D_8140E720*, Vec3s);
void func_8140A594(unk_D_8140E720*, s16);
void func_8140AD8C(unk_D_8140E720*, f32);
void func_8140ADA4(unk_D_8140E720*, f32);
void func_8140ADBC(unk_D_8140E720*, f32, f32);
void func_8140AF24(unk_D_8140E720*, f32);
void func_8140B0A4(unk_D_8140E720*, f32, f32);
void func_8140B180(unk_D_8140E720*, f32, f32);
void func_8140B2B4(unk_D_8140E720*);
void func_8140B938(unk_D_8140E720*, f32);
void func_8140B95C(unk_D_8140E720*, f32);
void func_8140B974(unk_D_8140E720*, f32);
void func_8140B98C(unk_D_8140E720*, f32, f32);
s32 func_8140BA48(unk_D_8140E720*);
void func_8140BAC8(unk_D_8140E720*, s32, s32, s32);
void func_8140BB74(unk_D_8140E720*, s32, s32, s32);
s32 func_8140BDAC(unk_D_8140E720*);
s32 func_8140BDD0(unk_D_8140E720*);
void func_8140BC20(unk_D_8140E720*, s32);
void func_8140BCA8(unk_D_8140E720*, s32);
s16 func_8140C038(unk_D_8140E720*);
void func_8140C040(unk_D_8140E720*);
void func_8140C204(unk_D_86002F34_00C*, Gfx**);
void func_8140C5D0(void);
void func_8140D5A0(unk_D_8140E720*, s32);

#endif // _FRAGMENT34_H_
7 changes: 4 additions & 3 deletions src/fragments/36/fragment36.c
Original file line number Diff line number Diff line change
@@ -286,7 +286,7 @@ s32 func_821009B4(void) {
s32 var_s0 = 0;
s32 var_s2 = 30;

func_8001F738(D_80068BA0);
func_8001F738(gPlayer1Controller);

while (var_s0 == 0) {
if (D_82100EC8 == 0) {
@@ -298,7 +298,7 @@ s32 func_821009B4(void) {

func_800290B4();

if ((D_80068BA0->unk_08 & 0x9000) && (D_82100EC8 != 0)) {
if ((gPlayer1Controller->buttonPressed & 0x9000) && (D_82100EC8 != 0)) {
func_80048B90(0xF);
var_s0 = func_82100054();
} else if (func_82100958() != 0) {
@@ -343,7 +343,8 @@ void func_82100B1C(s32 arg0) {

void func_82100B98(void) {
ASSET_LOAD(D_1000000, common_menu1_ui, 0);
ASSET_LOAD(D_2000000, title_ui, 0); // bin contains a JP logo and press start, but this bin is loaded for the "Press Start" gfx
ASSET_LOAD(D_2000000, title_ui,
0); // bin contains a JP logo and press start, but this bin is loaded for the "Press Start" gfx

D_82100EB8 = main_pool_alloc(0x4510, 0);
D_82100EBC = main_pool_alloc(0x100000, 0);
12 changes: 6 additions & 6 deletions src/fragments/37/fragment37.c
Original file line number Diff line number Diff line change
@@ -530,24 +530,24 @@ s32 func_822023A4(void) {
D_82203150.unk_06 = 0;
D_82203150.unk_04 = 0x12C;

if (D_80068BA0->unk_08 & 0x8000) {
if (gPlayer1Controller->buttonPressed & 0x8000) {
if (D_822031D8 == 3) {
func_8004E810(0x96, 8);
}
func_80048B90(0x33);
func_80048B90(0x16);
var_t1 = 3;
} else if (D_80068BA0->unk_08 & 0x4000) {
} else if (gPlayer1Controller->buttonPressed & 0x4000) {
func_8000D23C(0x28);
func_80048B90(3);
var_t1 = 4;
} else if (D_80068BA0->unk_08 & 0x800) {
} else if (gPlayer1Controller->buttonPressed & 0x800) {
var_s0 = D_82202FE4[D_822031D8].unk_06;
} else if (D_80068BA0->unk_08 & 0x400) {
} else if (gPlayer1Controller->buttonPressed & 0x400) {
var_s0 = D_82202FE4[D_822031D8].unk_07;
} else if (D_80068BA0->unk_08 & 0x200) {
} else if (gPlayer1Controller->buttonPressed & 0x200) {
var_s0 = D_82202FE4[D_822031D8].unk_08;
} else if (D_80068BA0->unk_08 & 0x100) {
} else if (gPlayer1Controller->buttonPressed & 0x100) {
var_s0 = D_82202FE4[D_822031D8].unk_09;
}

20 changes: 10 additions & 10 deletions src/fragments/6/fragment6.c
Original file line number Diff line number Diff line change
@@ -177,15 +177,15 @@ void func_86000020(void) {
s32 i;
s32 j;

D_86002F58[0].unk_17A = D_80068BA0->unk_08;
D_86002F58[1].unk_17A = D_80068BA4->unk_08;
D_86002F58[2].unk_17A = D_80068BA8->unk_08;
D_86002F58[3].unk_17A = D_80068BAC->unk_08;
D_86002F58[0].unk_17A = gPlayer1Controller->buttonPressed;
D_86002F58[1].unk_17A = gPlayer2Controller->buttonPressed;
D_86002F58[2].unk_17A = gPlayer3Controller->buttonPressed;
D_86002F58[3].unk_17A = gPlayer4Controller->buttonPressed;

D_86002F58[0].unk_174 = D_80068BA0->unk_06;
D_86002F58[1].unk_174 = D_80068BA4->unk_06;
D_86002F58[2].unk_174 = D_80068BA8->unk_06;
D_86002F58[3].unk_174 = D_80068BAC->unk_06;
D_86002F58[0].unk_174 = gPlayer1Controller->buttonDown;
D_86002F58[1].unk_174 = gPlayer2Controller->buttonDown;
D_86002F58[2].unk_174 = gPlayer3Controller->buttonDown;
D_86002F58[3].unk_174 = gPlayer4Controller->buttonDown;

for (i = 0; i < 4; i++) {
D_86003B5C = &D_86002F58[i];
@@ -596,11 +596,11 @@ s32 func_86000FD4(void) {
var_s0_2 = true;
while (var_s0_2 == true) {
if (func_86000410() == 0) {
if (D_80068BA0->unk_08 & 0x1000) {
if (gPlayer1Controller->buttonPressed & 0x1000) {
var_s0_2 = false;
}

if ((D_8780FA2A == 0) && (D_80068BA0->unk_08 & 0x4000)) {
if ((D_8780FA2A == 0) && (gPlayer1Controller->buttonPressed & 0x4000)) {
func_80048B90(3);
func_87802EB8(2);
return -1;
20 changes: 10 additions & 10 deletions src/fragments/7/fragment7.c
Original file line number Diff line number Diff line change
@@ -497,15 +497,15 @@ void func_86100798(s16 arg0, s16 arg1, f32 arg2) {
}

void func_86100A80(void) {
D_861054C0[0].unk_172 = D_80068BA0->unk_08;
D_861054C0[1].unk_172 = D_80068BA4->unk_08;
D_861054C0[2].unk_172 = D_80068BA8->unk_08;
D_861054C0[3].unk_172 = D_80068BAC->unk_08;

D_861054C0[0].unk_170 = D_80068BA0->unk_06;
D_861054C0[1].unk_170 = D_80068BA4->unk_06;
D_861054C0[2].unk_170 = D_80068BA8->unk_06;
D_861054C0[3].unk_170 = D_80068BAC->unk_06;
D_861054C0[0].unk_172 = gPlayer1Controller->buttonPressed;
D_861054C0[1].unk_172 = gPlayer2Controller->buttonPressed;
D_861054C0[2].unk_172 = gPlayer3Controller->buttonPressed;
D_861054C0[3].unk_172 = gPlayer4Controller->buttonPressed;

D_861054C0[0].unk_170 = gPlayer1Controller->buttonDown;
D_861054C0[1].unk_170 = gPlayer2Controller->buttonDown;
D_861054C0[2].unk_170 = gPlayer3Controller->buttonDown;
D_861054C0[3].unk_170 = gPlayer4Controller->buttonDown;
}

void func_86100AEC(void) {
@@ -822,7 +822,7 @@ s32 func_8610197C(void) {
while (var_s0 == 1) {
func_878001E8(0x3E8);

temp_v1 = D_80068BA0->unk_08;
temp_v1 = gPlayer1Controller->buttonPressed;
if (temp_v1 & 0x1000) {
var_s0 = 0;
}
17 changes: 9 additions & 8 deletions src/fragments/8/fragment8.c
Original file line number Diff line number Diff line change
@@ -217,10 +217,10 @@ void func_862002F4(void) {
f32 temp_fv0;
f32 temp_fv1;

sp60[0] = D_80068BA0->unk_08;
sp60[1] = D_80068BA4->unk_08;
sp60[2] = D_80068BA8->unk_08;
sp60[3] = D_80068BAC->unk_08;
sp60[0] = gPlayer1Controller->buttonPressed;
sp60[1] = gPlayer2Controller->buttonPressed;
sp60[2] = gPlayer3Controller->buttonPressed;
sp60[3] = gPlayer4Controller->buttonPressed;

if (D_86203E48 == 2) {
for (i = 0; i < 4; i++) {
@@ -537,11 +537,11 @@ s32 func_862011E8(void) {
func_862004D8();
func_86200620();
if (D_8620471A == 1) {
if (D_80068BA0->unk_08 & 0x1000) {
if (gPlayer1Controller->buttonPressed & 0x1000) {
var_s1_3 = 0;
}

if ((D_8780FA2A == 0) && (D_80068BA0->unk_08 & 0x4000)) {
if ((D_8780FA2A == 0) && (gPlayer1Controller->buttonPressed & 0x4000)) {
func_80048B90(3);
func_87802EB8(2);
return -1;
@@ -581,7 +581,8 @@ void func_862013C0(void) {
func_862004D8();

if ((D_86204718 == 1) && (func_80007604() == 0) &&
((D_80068BA0->unk_08 | D_80068BA4->unk_08 | D_80068BA8->unk_08 | (D_80068BAC->unk_08 != 0)) != 0)) {
((gPlayer1Controller->buttonPressed | gPlayer2Controller->buttonPressed |
gPlayer3Controller->buttonPressed | (gPlayer4Controller->buttonPressed != 0)) != 0)) {
func_80006CB4(0x1E);
func_8004B094(0x1E);
D_86204700 = 0;
@@ -1026,7 +1027,7 @@ void func_862023F8(void) {
}

if (D_86204718 == 1) {
if ((D_80068BA0->unk_08 != 0) && (sp8C == 0)) {
if ((gPlayer1Controller->buttonPressed != 0) && (sp8C == 0)) {
D_86204704 = 0x1C2;
sp8C = 1;
}
26 changes: 13 additions & 13 deletions src/fragments/9/fragment9.c
Original file line number Diff line number Diff line change
@@ -82,21 +82,21 @@ void func_86300020(void) {
D_86301730[i].unk_17B = D_86301730[i].unk_179;
}

D_86301730[0].unk_17C = D_80068BA0->unk_08;
D_86301730[0].unk_178 = D_80068BA0->unk_02;
D_86301730[0].unk_179 = D_80068BA0->unk_04;
D_86301730[0].unk_17C = gPlayer1Controller->buttonPressed;
D_86301730[0].unk_178 = gPlayer1Controller->rawStickX;
D_86301730[0].unk_179 = gPlayer1Controller->rawStickY;

D_86301730[1].unk_17C = D_80068BA4->unk_08;
D_86301730[1].unk_178 = D_80068BA4->unk_02;
D_86301730[1].unk_179 = D_80068BA4->unk_04;
D_86301730[1].unk_17C = gPlayer2Controller->buttonPressed;
D_86301730[1].unk_178 = gPlayer2Controller->rawStickX;
D_86301730[1].unk_179 = gPlayer2Controller->rawStickY;

D_86301730[2].unk_17C = D_80068BA8->unk_08;
D_86301730[2].unk_178 = D_80068BA8->unk_02;
D_86301730[2].unk_179 = D_80068BA8->unk_04;
D_86301730[2].unk_17C = gPlayer3Controller->buttonPressed;
D_86301730[2].unk_178 = gPlayer3Controller->rawStickX;
D_86301730[2].unk_179 = gPlayer3Controller->rawStickY;

D_86301730[3].unk_17C = D_80068BAC->unk_08;
D_86301730[3].unk_178 = D_80068BAC->unk_02;
D_86301730[3].unk_179 = D_80068BAC->unk_04;
D_86301730[3].unk_17C = gPlayer4Controller->buttonPressed;
D_86301730[3].unk_178 = gPlayer4Controller->rawStickX;
D_86301730[3].unk_179 = gPlayer4Controller->rawStickY;
}

void func_8630011C(void) {
@@ -461,7 +461,7 @@ void func_86300F68(void) {
func_8630011C();
func_86300230();

if (D_80068BA0->unk_08 & 0x1000) {
if (gPlayer1Controller->buttonPressed & 0x1000) {
var_s6 = 0;
}

2 changes: 1 addition & 1 deletion src/stage_loader.c
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ static unk_D_80068CA0* D_80068CA4 = NULL;

static s32 D_80068CA8 = 0;

static s32 D_80068BAC_Pad[1] = { 0 };
static s32 D_80068CAC_Pad[1] = { 0 };

static u32 D_80068CB0[] = {
0x00000000, 0xF1000F1F, 0x10000000, 0x00F10000, 0x00000FF1, 0x0000F100, 0x000F100F, 0x10000000, 0x00000000,
18 changes: 11 additions & 7 deletions yamls/us/rom.yaml
Original file line number Diff line number Diff line change
@@ -332,7 +332,7 @@
# .data
- [0x69770, data, rom_data_69770] # dp_intro
- [0x69790, .data, util]
- [0x697A0, data, rom_data_697A0]
- [0x697A0, .data, controller]
- [0x697B0, .data, 6BC0]
- [0x697C0, .data, stage_loader]
- [0x6A1B0, .data, crash_screen]
@@ -635,12 +635,16 @@
- [0x119FB0, c, fragments/3/fragment3_119FB0]
- [0x11BBF0, c, fragments/3/fragment3_11BBF0]
- [0x11BF90, c, fragments/3/fragment3_11BF90]
- [0x11C730, data, fragments/3/fragment3_data]
- [0x11E810, rodata, fragments/3/fragment3_rodata_11E810]
- [0x11E950, rodata, fragments/3/fragment3_rodata_11E950]
- [0x11E9A0, rodata, fragments/3/fragment3_rodata_11E9A0]

- {vram: 0x87906040, type: bss, name: fragments/3/fragment3_bss}
- [0x11C730, .data, fragments/3/fragment3_1189B0]
- [0x11C770, .data, fragments/3/fragment3_1193E0]
- [0x11C790, .data, fragments/3/fragment3_11BBF0]
- [0x11E810, .rodata, fragments/3/fragment3_1193E0]
- [0x11E950, .rodata, fragments/3/fragment3_119FB0]
- [0x11E9A0, .rodata, fragments/3/fragment3_11BBF0]

- {vram: 0x87906040, type: .bss, name: fragments/3/fragment3_1189B0}
- {vram: 0x879060E0, type: .bss, name: fragments/3/fragment3_1193E0}
- {vram: 0x87906120, type: .bss, name: fragments/3/fragment3_11BF90}

- name: fragment3_relocs
type: code