mirror of
https://github.com/n64decomp/mk64
synced 2026-07-29 15:32:53 -04:00
Controller/Player struct data/bss in C (#37)
* Controller/player structs ok
This commit is contained in:
+4
-4
@@ -172,11 +172,11 @@ void func_80002A18(void) {
|
||||
temp_v0 = *D_800DC4BC;
|
||||
|
||||
for (tmp = 0; tmp < 7; tmp++, temp_v0++){
|
||||
temp_v0->unk0 = 0;
|
||||
temp_v0->unk2 = 0;
|
||||
temp_v0->rawStickX = 0;
|
||||
temp_v0->rawStickY = 0;
|
||||
temp_v0->buttonPressed = 0;
|
||||
temp_v0->unk8 = 0;
|
||||
temp_v0->unk4 = 0;
|
||||
temp_v0->buttonDepressed = 0;
|
||||
temp_v0->button = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-27
@@ -8,7 +8,8 @@ extern struct_D_800E261C D_800E2400;
|
||||
extern struct_D_800E261C D_800E24B4;
|
||||
extern struct_D_800E261C D_800E2568;
|
||||
extern s16 D_80165340;
|
||||
extern s32 gPlayer1PosZ;
|
||||
|
||||
//GLOBAL_ASM("asm/non_matchings/code_800393C0/spawn_player.s")
|
||||
|
||||
void spawn_player(Player *player, s8 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, u16 arg6, s16 arg7) {
|
||||
f32 ret;
|
||||
@@ -113,9 +114,9 @@ void spawn_player(Player *player, s8 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg
|
||||
|
||||
player->unk_042 = 0;
|
||||
player->unk_078 = 0;
|
||||
player->unk_0A8 = 0;
|
||||
player->posY = 0;
|
||||
player->unk_0AA = 0;
|
||||
player->unk_0AC = 0;
|
||||
player->posZ = 0;
|
||||
player->unk_0AE = 0;
|
||||
player->unk_0B0 = 0;
|
||||
player->unk_0B2 = 0;
|
||||
@@ -165,7 +166,7 @@ void spawn_player(Player *player, s8 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg
|
||||
player->unk_098 = 0.0f;
|
||||
player->unk_09C = 0.0f;
|
||||
player->unk_0A0 = 0.0f;
|
||||
player->unk_0A4 = 0.0f;
|
||||
player->posX = 0.0f;
|
||||
player->unk_0B8 = 0.0f;
|
||||
player->unk_0E4 = 0.0f;
|
||||
player->unk_0E8 = 0.0f;
|
||||
@@ -1056,7 +1057,7 @@ void func_8003CD98(Player *player, s32 arg1, s8 arg2, s8 arg3) {
|
||||
|
||||
D_801650D0[arg3][arg2] = player->unk_244[arg3];
|
||||
D_80165110[arg3][arg2] = player->unk_24C[arg3];
|
||||
D_80165150[arg3][arg2] = player->unk_0A8;
|
||||
D_80165150[arg3][arg2] = player->posY;
|
||||
D_801651D0[arg3][arg2] = 0;
|
||||
func_800267AC(player, arg2, arg3);
|
||||
}
|
||||
@@ -1081,18 +1082,18 @@ void func_8003D080(void) {
|
||||
switch (gModeSelection) {
|
||||
case 0:
|
||||
if (gCurrentCourseId == COURSE_TOADS_TURNPIKE) {
|
||||
func_8001C4D0(0.0f, gPlayer1PosY, D_8016524C, gPlayer1Rotation, 8, 0);
|
||||
func_8001C4D0(0.0f, D_800DC4DC->posY, D_8016524C, D_800DC4DC->unk_0BC, 8, 0);
|
||||
} else {
|
||||
func_8001C4D0((D_80165210[6] + D_80165210[7]) / 2, gPlayer1PosY, D_8016524C, gPlayer1Rotation, 8, 0);
|
||||
func_8001C4D0((D_80165210[6] + D_80165210[7]) / 2, D_800DC4DC->posY, D_8016524C, D_800DC4DC->unk_0BC, 8, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, D_8016524C, gPlayer1Rotation, 1, 0);
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_8016524C, D_800DC4DC->unk_0BC, 1, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 10, 0);
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 10, 0);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -1101,27 +1102,27 @@ void func_8003D080(void) {
|
||||
case 2:
|
||||
switch (gModeSelection) {
|
||||
case 0:
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 1, 0);
|
||||
func_8001C4D0(D_800F7768.unk_014, D_800F7768.unk_018, D_800F7768.unk_01C, D_800F7768.unk_02E, 1, 1);
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 1, 0);
|
||||
func_8001C4D0(D_800DC4E0->unk_014, D_800DC4E0->unk_018, D_800DC4E0->unk_01C, D_800DC4E0->unk_02E, 1, 1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 9, 0);
|
||||
func_8001C4D0(D_800F7768.unk_014, D_800F7768.unk_018, D_800F7768.unk_01C, D_800F7768.unk_02E, 9, 1);
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 9, 0);
|
||||
func_8001C4D0(D_800DC4E0->unk_014, D_800DC4E0->unk_018, D_800DC4E0->unk_01C, D_800DC4E0->unk_02E, 9, 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 1, 0);
|
||||
func_8001C4D0(D_800F7768.unk_014, D_800F7768.unk_018, D_800F7768.unk_01C, D_800F7768.unk_02E, 1, 1);
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 1, 0);
|
||||
func_8001C4D0(D_800DC4E0->unk_014, D_800DC4E0->unk_018, D_800DC4E0->unk_01C, D_800DC4E0->unk_02E, 1, 1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (gModeSelection == 3) {
|
||||
ptr = &D_800F8540;
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 9, 0);
|
||||
func_8001C4D0(D_800F7768.unk_014, D_800F7768.unk_018, D_800F7768.unk_01C, D_800F7768.unk_02E, 9, 1);
|
||||
ptr = &D_800DC4E4;
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 9, 0);
|
||||
func_8001C4D0(D_800DC4E0->unk_014, D_800DC4E0->unk_018, D_800DC4E0->unk_01C, D_800DC4E0->unk_02E, 9, 1);
|
||||
ptr++;
|
||||
func_8001C4D0(ptr->unk_014, ptr->unk_018, ptr->unk_01C, ptr->unk_02E, 9, 2);
|
||||
ptr++;
|
||||
@@ -1129,9 +1130,9 @@ void func_8003D080(void) {
|
||||
func_8001C4D0(ptr->unk_014, ptr->unk_018, ptr->unk_01C, ptr->unk_02E, 9, 3);
|
||||
}
|
||||
} else {
|
||||
ptr = &D_800F8540;
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 1, 0);
|
||||
func_8001C4D0(D_800F7768.unk_014, D_800F7768.unk_018, D_800F7768.unk_01C, D_800F7768.unk_02E, 1, 1);
|
||||
ptr = &D_800DC4E4;
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 1, 0);
|
||||
func_8001C4D0(D_800DC4E0->unk_014, D_800DC4E0->unk_018, D_800DC4E0->unk_01C, D_800DC4E0->unk_02E, 1, 1);
|
||||
ptr++;
|
||||
func_8001C4D0(ptr->unk_014, ptr->unk_018, ptr->unk_01C, ptr->unk_02E, 1, 2);
|
||||
ptr++;
|
||||
@@ -1144,19 +1145,19 @@ void func_8003D080(void) {
|
||||
} else {
|
||||
switch (D_800DC52C) {
|
||||
case 0:
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 3, 0);
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 3, 0);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 2:
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 3, 0);
|
||||
func_8001C4D0(D_800F7768.unk_014, D_800F7768.unk_018, D_800F7768.unk_01C, D_800F7768.unk_02E, 3, 1);
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 3, 0);
|
||||
func_8001C4D0(D_800DC4E0->unk_014, D_800DC4E0->unk_018, D_800DC4E0->unk_01C, D_800DC4E0->unk_02E, 3, 1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ptr = &D_800F8540;
|
||||
func_8001C4D0(gPlayer1PosX, gPlayer1PosY, gPlayer1PosZ, gPlayer1Rotation, 3, 0);
|
||||
func_8001C4D0(D_800F7768.unk_014, D_800F7768.unk_018, D_800F7768.unk_01C, D_800F7768.unk_02E, 3, 1);
|
||||
ptr = &D_800DC4E4;
|
||||
func_8001C4D0(D_800DC4DC->posX, D_800DC4DC->posY, D_800DC4DC->posZ, D_800DC4DC->unk_0BC, 3, 0);
|
||||
func_8001C4D0(D_800DC4E0->unk_014, D_800DC4E0->unk_018, D_800DC4E0->unk_01C, D_800DC4E0->unk_02E, 3, 1);
|
||||
ptr++;
|
||||
func_8001C4D0(ptr->unk_014, ptr->unk_018, ptr->unk_01C, ptr->unk_02E, 3, 2);
|
||||
ptr++;
|
||||
|
||||
+9
-9
@@ -263,7 +263,7 @@ void func_8008C528(Player *player, s8 arg1) {
|
||||
player->unk_0F4 = 0.0f;
|
||||
|
||||
player->unk_0EC = D_800E3790[temp_v1];
|
||||
player->unk_0A8 = 0;
|
||||
player->posY = 0;
|
||||
player->unk_0BC = player->unk_0BC | 0x400;
|
||||
player->unk_0BC = player->unk_0BC & ~0x10;
|
||||
player->unk_0C0 = 0;
|
||||
@@ -281,13 +281,13 @@ void func_8008C528(Player *player, s8 arg1) {
|
||||
void func_8008C62C(Player *player, s8 arg1) {
|
||||
|
||||
func_80031F48(player, 5.0f);
|
||||
player->unk_0A8 += (s16)0xA0;
|
||||
player->posY += (s16)0xA0;
|
||||
player->unk_042 += (s16)0x71C;
|
||||
if (player->unk_0A8 >= 0x2000) {
|
||||
player->unk_0A8 = 0;
|
||||
if (player->posY >= 0x2000) {
|
||||
player->posY = 0;
|
||||
player->unk_236 = (s16) (player->unk_236 - 1);
|
||||
if (player->unk_236 == 0) {
|
||||
player->unk_0A8 = 0x2000;
|
||||
player->posY = 0x2000;
|
||||
func_8008C6D0(player, arg1);
|
||||
if (gModeSelection == 3) {
|
||||
func_8006B8B4(player, arg1);
|
||||
@@ -301,7 +301,7 @@ void func_8008C6D0(Player *player, s8 arg1) {
|
||||
player->unk_206 = 0;
|
||||
player->unk_0C4 = 0;
|
||||
player->unk_0BC = (s32) (player->unk_0BC & ~0x400);
|
||||
player->unk_0A8 = 0;
|
||||
player->posY = 0;
|
||||
player->unk_0C0 = 0;
|
||||
player->unk_07C = 0;
|
||||
player->unk_236 = 0;
|
||||
@@ -326,8 +326,8 @@ void func_8008C73C(Player *player, s8 arg1, s8 unk3, s8 unk4) {
|
||||
} else {
|
||||
player->unk_0BC = (s32) (player->unk_0BC | 0x80);
|
||||
}
|
||||
player->unk_0B6 = (u16) (player->unk_0B6 | 0x80);
|
||||
player->unk_0B2 = 2;
|
||||
player->unk_0B4 = (u16) (player->unk_0B4 | 0x80);
|
||||
player->unk_0B0 = 2;
|
||||
player->unk_0C0 = 0;
|
||||
player->unk_07C = 0;
|
||||
player->unk_078 = 0;
|
||||
@@ -364,7 +364,7 @@ void func_8008C8C4(Player *player, s8 arg1) {
|
||||
|
||||
|
||||
player->unk_02E = player->unk_0AE;
|
||||
player->unk_0A8 = 0;
|
||||
player->posY = 0;
|
||||
player->unk_07C = 0;
|
||||
player->unk_0C0 = 0;
|
||||
player->unk_0BC &= ~0x800;
|
||||
|
||||
+8
-8
@@ -10,26 +10,26 @@ extern s32 gPrevLoadedAddress;
|
||||
// unk4 is buttonDown?
|
||||
void func_80281780(void) {
|
||||
if (gEnableDebugMode != 0) {
|
||||
if (D_800DC4BC->unk4 & 0x0F0F) {
|
||||
if (D_800DC4BC->unk4 & 8) {
|
||||
if (D_800DC4BC->button & 0x0F0F) {
|
||||
if (D_800DC4BC->button & 8) {
|
||||
D_800E86A8[0] = 1;
|
||||
}
|
||||
else if (D_800DC4BC->unk4 & 2) {
|
||||
else if (D_800DC4BC->button & 2) {
|
||||
D_800E86A8[0] = 2;
|
||||
}
|
||||
else if (D_800DC4BC->unk4 & 1) {
|
||||
else if (D_800DC4BC->button & 1) {
|
||||
D_800E86A8[0] = 3;
|
||||
}
|
||||
else if (D_800DC4BC->unk4 & 4) {
|
||||
else if (D_800DC4BC->button & 4) {
|
||||
D_800E86A8[0] = 4;
|
||||
}
|
||||
else if (D_800DC4BC->unk4 & 0x800) {
|
||||
else if (D_800DC4BC->button & 0x800) {
|
||||
D_800E86A8[0] = 5;
|
||||
}
|
||||
else if (D_800DC4BC->unk4 & 0x200) {
|
||||
else if (D_800DC4BC->button & 0x200) {
|
||||
D_800E86A8[0] = 6;
|
||||
}
|
||||
else if (D_800DC4BC->unk4 & 0x100) {
|
||||
else if (D_800DC4BC->button & 0x100) {
|
||||
D_800E86A8[0] = 7;
|
||||
} else {
|
||||
D_800E86A8[0] = 0;
|
||||
|
||||
+35
-34
@@ -5,12 +5,13 @@
|
||||
|
||||
|
||||
extern s16 D_802BA040[4];
|
||||
extern struct Controller *D_800F6914;
|
||||
extern struct Controller *gControllers;
|
||||
extern struct Controller *gPlayer2Controller;
|
||||
extern struct Controller *gPlayer3Controller;
|
||||
extern struct Controller *gPlayer4Controller;
|
||||
extern struct Controller *D_800F6950;
|
||||
extern struct Controller gControllers[];
|
||||
extern struct Controller *D_800DC4BC;
|
||||
extern struct Controller *D_800DC4C4;
|
||||
extern struct Controller *D_800DC4C8;
|
||||
extern struct Controller *D_800DC4CC;
|
||||
extern struct Controller *D_800DC4D0;
|
||||
extern struct Controller *D_800DC4D4;
|
||||
|
||||
extern unsigned char *D_8015F8C4;
|
||||
extern unsigned char *D_8015F8C8;
|
||||
@@ -21,7 +22,7 @@ extern s32 D_8016348C;
|
||||
extern s8 gCourseSelection;
|
||||
extern s32 D_800DC544;
|
||||
|
||||
extern Player D_800F6990[];
|
||||
extern Player gPlayers[];
|
||||
extern Player D_800DC4E0[];
|
||||
extern Player D_800DC4DC[];
|
||||
extern s32 lapCount[];
|
||||
@@ -171,7 +172,7 @@ void func_8028E0F0(void) {
|
||||
s16 phi_s2 = 0;
|
||||
|
||||
for(i = 0; i < 4; i++) {
|
||||
ply = (Player *)&D_800F6990[i];
|
||||
ply = (Player *)&gPlayers[i];
|
||||
if (!(ply->unk_000 & 0x8000)) {
|
||||
continue;
|
||||
}
|
||||
@@ -211,11 +212,11 @@ void func_8028E298(u16 arg2) {
|
||||
f32 phi_f8;
|
||||
u16 phi_a2;
|
||||
s32 i;
|
||||
phi_a1 = &D_800F6990;
|
||||
phi_a1 = &gPlayers;
|
||||
phi_a0 = 0;
|
||||
phi_a2 = arg2;
|
||||
for (i = 0; i < 8; i++) {
|
||||
if ((D_800F6990[i].unk_000 & 0x800) == 0) {
|
||||
if ((gPlayers[i].unk_000 & 0x800) == 0) {
|
||||
temp_a2 = *(&D_801645B0 + (phi_a0 * 2));
|
||||
temp_v1 = phi_a0 * 4;
|
||||
temp_v0 = *(&D_801645C8 + (temp_a2 * 2));
|
||||
@@ -606,7 +607,7 @@ void func_8028EDA8(void) {
|
||||
if (D_800DC510 == 2) {
|
||||
D_800DC510 = 3;
|
||||
}
|
||||
phi_v1 = &D_800F6990;
|
||||
phi_v1 = &gPlayers;
|
||||
do {
|
||||
temp_v0 = phi_v1->unk0;
|
||||
if (((temp_v0 & 0x8000) != 0) && ((temp_v0 & 0x2000) != 0)) {
|
||||
@@ -635,15 +636,15 @@ GLOBAL_ASM("asm/non_matchings/code_8028DF00/func_8028EDA8.s")
|
||||
/*
|
||||
f32 func_8028EE8C(s32 i) {
|
||||
f32 temp_f14;
|
||||
temp_f14 = D_8015F8D8 - D_800F6990[i].unk_01C;
|
||||
return gCourseTimer - ((D_802B9254 * temp_f14) / (temp_f14 + (D_800F6990[i].unk_028 - D_8015F8D8)));
|
||||
temp_f14 = D_8015F8D8 - gPlayers[i].unk_01C;
|
||||
return gCourseTimer - ((D_802B9254 * temp_f14) / (temp_f14 + (gPlayers[i].unk_028 - D_8015F8D8)));
|
||||
}
|
||||
*/
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/code_8028DF00/func_8028EE8C.s")
|
||||
|
||||
void func_8028EEF0(s32 i) {
|
||||
D_800F6990[i].unk_000 |= 0x800;
|
||||
gPlayers[i].unk_000 |= 0x800;
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -653,21 +654,21 @@ void func_8028EF28(void) {
|
||||
s32 i;
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
ply = (Player *)&D_800F6990[i];
|
||||
if ((D_800F6990[i].unk_000 & 0x8000) == 0) {
|
||||
ply = (Player *)&gPlayers[i];
|
||||
if ((gPlayers[i].unk_000 & 0x8000) == 0) {
|
||||
continue;
|
||||
}
|
||||
if (lapCount[i] < D_800F6990[i].unk_008) {
|
||||
D_800F6990[i].unk_008--;
|
||||
} else if (lapCount[i] > D_800F6990[i].unk_008) {
|
||||
D_800F6990[i].unk_008++;
|
||||
if (lapCount[i] < gPlayers[i].unk_008) {
|
||||
gPlayers[i].unk_008--;
|
||||
} else if (lapCount[i] > gPlayers[i].unk_008) {
|
||||
gPlayers[i].unk_008++;
|
||||
}
|
||||
if ((D_800F6990[i].unk_000 & 0x4000) != 0) {
|
||||
if (D_800F6990[i].unk_008 == 3) {
|
||||
if ((gPlayers[i].unk_000 & 0x4000) != 0) {
|
||||
if (gPlayers[i].unk_008 == 3) {
|
||||
func_8028EEF0(i);
|
||||
|
||||
currentPosition = D_800F6990[i].unk_004;
|
||||
D_800F6990[i].unk_000 |= 0x1000;
|
||||
currentPosition = gPlayers[i].unk_004;
|
||||
gPlayers[i].unk_000 |= 0x1000;
|
||||
if (currentPosition < 4) {
|
||||
D_80150120 = 1;
|
||||
}
|
||||
@@ -678,7 +679,7 @@ void func_8028EF28(void) {
|
||||
if (gModeSelection == 0 && gPlayerCountSelection1 == 2 && D_802BA048 == 0) {
|
||||
D_802BA048 = 1;
|
||||
}
|
||||
if ((D_800F6990[i].unk_000 & 0x100) == 0) {
|
||||
if ((gPlayers[i].unk_000 & 0x100) == 0) {
|
||||
D_800DC510 = 4;
|
||||
}
|
||||
if (gModeSelection == 1) {
|
||||
@@ -699,8 +700,8 @@ void func_8028EF28(void) {
|
||||
}
|
||||
D_800DC510 = 5;
|
||||
D_8015F8F6[1] = i;
|
||||
D_800F6990->unk_00C |= 0x200000;
|
||||
D_800F6990->unk_000 |= 0x1000;
|
||||
gPlayers->unk_00C |= 0x200000;
|
||||
gPlayers->unk_000 |= 0x1000;
|
||||
func_800CA118((u8)i);
|
||||
break;
|
||||
case 3:
|
||||
@@ -717,8 +718,8 @@ void func_8028EF28(void) {
|
||||
if (*(D_8015F8C8 + i * 3 + 2) > 99) {
|
||||
*(D_8015F8C8 + i * 3 + 2) == 99;
|
||||
}
|
||||
D_800F6990->unk_00C |= 0x200000;
|
||||
D_800F6990->unk_000 |= 0x1000;
|
||||
gPlayers->unk_00C |= 0x200000;
|
||||
gPlayers->unk_000 |= 0x1000;
|
||||
func_800CA118((u8)i);
|
||||
}
|
||||
break;
|
||||
@@ -732,8 +733,8 @@ void func_8028EF28(void) {
|
||||
if (currentPosition == 2) {
|
||||
D_800DC510 = 5;
|
||||
D_8015F8F6[3] = i;
|
||||
D_800F6990->unk_00C |= 0x200000;
|
||||
D_800F6990->unk_000 |= 0x1000;
|
||||
gPlayers->unk_00C |= 0x200000;
|
||||
gPlayers->unk_000 |= 0x1000;
|
||||
func_800CA118((u8)i);
|
||||
}
|
||||
break;
|
||||
@@ -741,8 +742,8 @@ void func_8028EF28(void) {
|
||||
|
||||
}
|
||||
|
||||
} else if (D_800F6990[i].unk_008 == 2) {
|
||||
if ((D_800F6990[i].unk_000 & 0x100) == 0) {
|
||||
} else if (gPlayers[i].unk_008 == 2) {
|
||||
if ((gPlayers[i].unk_000 & 0x100) == 0) {
|
||||
return;
|
||||
}
|
||||
if ((D_802BA032 & 0x4000) == 0) {
|
||||
@@ -750,7 +751,7 @@ void func_8028EF28(void) {
|
||||
func_800CA49C(i);
|
||||
}
|
||||
}
|
||||
} else if (D_800F6990[i].unk_008 == 3) {
|
||||
} else if (gPlayers[i].unk_008 == 3) {
|
||||
func_8028EEF0(i);
|
||||
if (gModeSelection == 1) {
|
||||
func_80005AE8(ply);
|
||||
|
||||
+89
-35
@@ -8,6 +8,7 @@
|
||||
#include "memory.h"
|
||||
#include "segments.h"
|
||||
#include "segment_symbols.h"
|
||||
#include "common_structs.h"
|
||||
|
||||
// Declarations (not in this file)
|
||||
void func_8008C214(void);
|
||||
@@ -34,14 +35,80 @@ extern OSThread gVideoThread;
|
||||
extern u16 D_8015011C;
|
||||
extern OSMesgQueue D_8015F460;
|
||||
extern OSMesg D_8015F3E0;
|
||||
extern s32 gVideoThreadStack;
|
||||
extern struct SPTask *gActiveSPTask;
|
||||
extern s16 sNumVBlanks;
|
||||
extern s32 D_80156820;
|
||||
extern f32 D_800DC594;
|
||||
extern struct SPTask *sCurrentAudioSPTask;
|
||||
extern struct SPTask *sCurrentDisplaySPTask;
|
||||
extern struct VblankHandler *gVblankHandler1;
|
||||
extern struct VblankHandler *gVblankHandler2;
|
||||
|
||||
struct VblankHandler *gVblankHandler1 = NULL;
|
||||
struct VblankHandler *gVblankHandler2 = NULL;
|
||||
|
||||
struct SPTask *gActiveSPTask = NULL;
|
||||
struct SPTask *sCurrentAudioSPTask = NULL;
|
||||
struct SPTask* sCurrentDisplaySPTask = NULL;
|
||||
struct SPTask* D_800DC4B4 = NULL;
|
||||
struct SPTask* sNextDisplaySPTask = NULL;
|
||||
|
||||
|
||||
struct Controller gControllers[8];
|
||||
struct Controller *D_800DC4BC = &gControllers[0];
|
||||
struct Controller *D_800DC4C0 = &gControllers[1];
|
||||
struct Controller *D_800DC4C4 = &gControllers[2];
|
||||
struct Controller *D_800DC4C8 = &gControllers[3];
|
||||
struct Controller *D_800DC4CC = &gControllers[4];
|
||||
struct Controller *D_800DC4D0 = &gControllers[5];
|
||||
struct Controller *D_800DC4D4 = &gControllers[6];
|
||||
struct Controller *D_800DC4D8 = &gControllers[7];
|
||||
|
||||
Player gPlayers[8];
|
||||
Player *D_800DC4DC = &gPlayers[0];
|
||||
Player *D_800DC4E0 = &gPlayers[1];
|
||||
Player *D_800DC4E4 = &gPlayers[2];
|
||||
Player *D_800DC4E8 = &gPlayers[3];
|
||||
Player *D_800DC4EC = &gPlayers[4];
|
||||
Player *D_800DC4F0 = &gPlayers[5];
|
||||
Player *D_800DC4F4 = &gPlayers[6];
|
||||
Player *D_800DC4F8 = &gPlayers[7];
|
||||
|
||||
Player *D_800DC4FC = &gPlayers[0];
|
||||
Player *D_800DC500 = &gPlayers[1];
|
||||
Player *D_800DC504 = &gPlayers[2];
|
||||
Player *D_800DC508 = &gPlayers[3];
|
||||
|
||||
s32 D_800DC50C = 0xffff;
|
||||
u16 D_800DC510 = 0;
|
||||
u16 D_800DC514 = 0;
|
||||
u16 D_800DC518 = 0;
|
||||
u16 D_800DC51C = 0;
|
||||
u16 gEnableDebugMode = 0;
|
||||
s32 D_800DC524 = 7;
|
||||
UNUSED s32 D_800DC528 = 1;
|
||||
s32 D_800DC52C = 0;
|
||||
|
||||
s32 D_800DC530[2] = {0};
|
||||
s32 gPlayerCountSelection1 = 2;
|
||||
s32 gModeSelection = 0;
|
||||
s32 D_800DC540 = 0;
|
||||
s32 D_800DC544 = 0;
|
||||
s32 D_800DC548 = 0;
|
||||
s32 gGlobalTimer = 0;
|
||||
UNUSED s32 D_800DC550 = 0;
|
||||
UNUSED s32 D_800DC554 = 0;
|
||||
UNUSED s32 D_800DC558 = 0;
|
||||
// Framebuffer rendering values (max 3)
|
||||
u16 sRenderedFramebuffer = 0;
|
||||
u16 sRenderingFramebuffer = 0;
|
||||
UNUSED u16 D_800DC564 = 0;
|
||||
s32 D_800DC568 = 0;
|
||||
s32 D_800DC56C[8] = {0};
|
||||
s16 sNumVBlanks = 0;
|
||||
UNUSED s16 D_800DC590 = 0;
|
||||
float D_800DC594 = 0.0f;
|
||||
float gCourseTimer = 0.0f;
|
||||
|
||||
extern u8 gControllerBits;
|
||||
extern OSContStatus gControllerStatuses;
|
||||
extern u16 sController1Unplugged;
|
||||
|
||||
|
||||
extern uintptr_t gPhysicalFramebuffers[3];
|
||||
extern const f64 D_800EB640;
|
||||
extern struct VblankHandler sSoundVblankHandler;
|
||||
@@ -58,9 +125,6 @@ extern u64 gspF3DLXTextStart[], gspF3DLXTextEnd[];
|
||||
extern u64 gspF3DEXDataStart[];
|
||||
extern u64 gspF3DLXDataStart[];
|
||||
|
||||
extern s32 gPlayerCountSelection1;
|
||||
extern s32 D_800DC50C;
|
||||
|
||||
extern u32 gGfxSPTaskStack;
|
||||
extern u64 gGfxSPTaskOutputBuffer[];
|
||||
extern u32 gGfxSPTaskOutputBufferSize;
|
||||
@@ -78,11 +142,9 @@ extern OSIoMesg *D_8014F0A0;
|
||||
extern u32 gHeapEndPtr;
|
||||
extern u32 *D_801978D0;
|
||||
|
||||
|
||||
extern OSMesgQueue gSIEventMesgQueue;
|
||||
extern OSMesg gSIEventMesgBuf[3];
|
||||
extern u8 gControllerBits;
|
||||
extern OSContStatus gControllerStatuses;
|
||||
extern u16 sController1Unplugged;
|
||||
|
||||
extern u32 D_801502B4;
|
||||
extern u32 D_802F9F80;
|
||||
@@ -100,16 +162,8 @@ extern f64 D_800EB610;
|
||||
|
||||
extern s16 gCurrentlyLoadedCourseId;
|
||||
|
||||
extern struct SPTask* sNextDisplaySPTask;
|
||||
|
||||
extern u16 sRenderingFramebuffer;
|
||||
|
||||
s32 D_800FD850[4];
|
||||
extern struct GfxPool gGfxPools[2];
|
||||
extern s32 gGlobalTimer;
|
||||
|
||||
// Framebuffer rendering values (max 3)
|
||||
extern u16 sRenderedFramebuffer; // = 0;
|
||||
extern u16 sRenderingFramebuffer; // = 0;
|
||||
|
||||
// Declarations (in this file)
|
||||
void thread1_idle(void *arg0);
|
||||
@@ -148,7 +202,7 @@ void thread1_idle(void *arg0) {
|
||||
D_8015011C = (s16) osResetType;
|
||||
create_debug_thread();
|
||||
start_debug_thread();
|
||||
create_thread(&gVideoThread, 3, &thread3_video, arg0, &gVideoThreadStack, 100);
|
||||
create_thread(&gVideoThread, 3, &thread3_video, arg0, &D_80156820, 100);
|
||||
osStartThread(&gVideoThread);
|
||||
osSetThreadPri(NULL, 0);
|
||||
|
||||
@@ -1215,19 +1269,19 @@ void thread5_game_logic(s32 arg0) {
|
||||
rendering_init();
|
||||
read_controllers();
|
||||
func_800C5CB8();
|
||||
while(1) {
|
||||
func_800CB2C4();
|
||||
if (D_800DC524 != D_800DC50C) {
|
||||
D_800DC50C = (s32) D_800DC524;
|
||||
func_80002684();
|
||||
}
|
||||
profiler_log_thread5_time(0);
|
||||
config_gfx_pool();
|
||||
read_controllers();
|
||||
func_80001ECC();
|
||||
func_80000CE8();
|
||||
display_and_vsync();
|
||||
loop_3:
|
||||
func_800CB2C4();
|
||||
if (D_800DC524 != D_800DC50C) {
|
||||
D_800DC50C = (s32) D_800DC524;
|
||||
func_80002684();
|
||||
}
|
||||
profiler_log_thread5_time(0);
|
||||
config_gfx_pool();
|
||||
read_controllers();
|
||||
func_80001ECC();
|
||||
func_80000CE8();
|
||||
display_and_vsync();
|
||||
goto loop_3;
|
||||
}
|
||||
|
||||
void thread4_audio(UNUSED s32 arg0) {
|
||||
|
||||
Reference in New Issue
Block a user