document player and cpu (#534)

* document player and cpu

* cpu_descisions_branch_item to cpu_decisions_branch_item
This commit is contained in:
coco875
2024-01-18 00:19:54 +01:00
committed by GitHub
parent bd15658807
commit a86b3b0a2e
22 changed files with 250 additions and 248 deletions
+15 -15
View File
@@ -15,7 +15,7 @@
#include "code_80071F00.h"
#include "code_8008C1D0.h"
void func_802B0210(Collision *arg0, Collision *arg1) {
void copy_collision(Collision *arg0, Collision *arg1) {
arg1->unk30 = arg0->unk30;
arg1->unk32 = arg0->unk32;
arg1->unk34 = arg0->unk34;
@@ -192,7 +192,7 @@ void func_802B0788(s16 rawStickY, struct BananaBunchParent *banana_bunch, Player
var_f12 = (player->unk_094 * 0.75f) + 4.5f + var_f0;
}
vec3f_set(velocity, 0.0f, var_f0, var_f12);
func_802B64C4(velocity, player->unk_02C[1] + player->unk_0C0);
func_802B64C4(velocity, player->rotation[1] + player->unk_0C0);
banana->velocity[0] = velocity[0];
banana->velocity[1] = velocity[1];
banana->velocity[2] = velocity[2];
@@ -429,7 +429,7 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
someVelocity[0] = 0;
someVelocity[1] = 0;
someVelocity[2] = 8;
func_802B64C4(someVelocity, player->unk_02C[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
shell->velocity[0] = someVelocity[0];
shell->velocity[1] = someVelocity[1];
shell->velocity[2] = someVelocity[2];
@@ -454,7 +454,7 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
someVelocity[0] = 0;
someVelocity[1] = 0;
someVelocity[2] = 8;
func_802B64C4(someVelocity, player->unk_02C[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
shell->velocity[0] = someVelocity[0];
shell->velocity[1] = someVelocity[1];
shell->velocity[2] = someVelocity[2];
@@ -479,7 +479,7 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) {
someVelocity[0] = 0;
someVelocity[1] = 0;
someVelocity[2] = 8;
func_802B64C4(someVelocity, player->unk_02C[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
shell->velocity[0] = someVelocity[0];
shell->velocity[1] = someVelocity[1];
shell->velocity[2] = someVelocity[2];
@@ -664,7 +664,7 @@ s32 use_red_shell_item(Player *player) {
func_802B4E30((struct Actor *)shell);
shell->state = HELD_SHELL;
shell->rotVelocity = 0;
shell->rotAngle = player->unk_02C[1] - 0x8000;
shell->rotAngle = player->rotation[1] - 0x8000;
shell->playerId = player - gPlayerOne;
return actorIndex;
}
@@ -738,7 +738,7 @@ void update_actor_banana(struct BananaActor *banana) {
temp_f0 = (player->unk_094 * 0.75f) + 3.5f + pad3;
}
vec3f_set(someVelocity, 0, pad3, temp_f0);
func_802B64C4(someVelocity, player->unk_02C[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
banana->velocity[0] = someVelocity[0];
banana->velocity[1] = someVelocity[1];
banana->velocity[2] = someVelocity[2];
@@ -784,7 +784,7 @@ void update_actor_banana(struct BananaActor *banana) {
someVelocity[0] = 0.0f;
someVelocity[1] = 0.0f;
someVelocity[2] = -5.0f;
func_802B64C4(someVelocity, player->unk_02C[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
unkX = player->pos[0] + someVelocity[0];
unkY = player->pos[1] + someVelocity[1];
unkZ = player->pos[2] + someVelocity[2];
@@ -1044,7 +1044,7 @@ void use_thunder_item(Player *player) {
}
// Handles item use?
void func_802B2FA0(Player *player) {
void player_use_item(Player *player) {
s32 playerId = player - gPlayerOne;
switch (player->currentItemCopy) {
@@ -1122,7 +1122,7 @@ void func_802B30EC(void) {
if (((player->type & PLAYER_HUMAN) != 0) && (player->currentItemCopy != ITEM_NONE) && ((player->type & PLAYER_START_SEQUENCE) == 0)) {
if ((controller->buttonPressed & Z_TRIG) != 0) {
controller->buttonPressed &= ~Z_TRIG;
func_802B2FA0(player);
player_use_item(player);
}
}
}
@@ -1158,7 +1158,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
switch (shell->state) {
case HELD_SHELL:
player = &gPlayers[shell->playerId];
func_802B0210(&player->unk_110, &shell->unk30);
copy_collision(&player->unk_110, &shell->unk30);
somePosVel[0] = 0.0f;
somePosVel[1] = player->boundingBoxSize;
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
@@ -1185,7 +1185,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
somePosVel[0] = 0.0f;
somePosVel[1] = 0.0f;
somePosVel[2] = -var_f2;
func_802B64C4(somePosVel, player->unk_02C[1] + player->unk_0C0);
func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
shell->velocity[0] = somePosVel[0];
shell->velocity[1] = somePosVel[1];
shell->velocity[2] = somePosVel[2];
@@ -1234,7 +1234,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
somePosVel[0] = 0.0f;
somePosVel[1] = 0.0f;
somePosVel[2] = var_f2;
func_802B64C4(somePosVel, player->unk_02C[1] + player->unk_0C0);
func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
shell->velocity[0] = somePosVel[0];
shell->velocity[1] = somePosVel[1];
shell->velocity[2] = somePosVel[2];
@@ -1537,7 +1537,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
switch (shell->state) {
case HELD_SHELL:
player = &gPlayers[shell->playerId];
func_802B0210(&player->unk_110, &shell->unk30);
copy_collision(&player->unk_110, &shell->unk30);
somePosVel[0] = 0.0f;
somePosVel[1] = player->boundingBoxSize;
somePosVel[2] = -(player->boundingBoxSize + shell->boundingBoxSize + 2.0f);
@@ -1612,7 +1612,7 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
somePosVel[0] = 0.0f;
somePosVel[1] = 0.0f;
somePosVel[2] = temp_f0;
func_802B64C4(somePosVel, (s16) (player->unk_02C[1] + player->unk_0C0));
func_802B64C4(somePosVel, (s16) (player->rotation[1] + player->unk_0C0));
shell->velocity[0] = somePosVel[0];
shell->velocity[1] = somePosVel[1];
shell->velocity[2] = somePosVel[2];
+2 -2
View File
@@ -4,7 +4,7 @@
#include "common_structs.h"
#include "actor_types.h"
void func_802B0210(Collision*, Collision*);
void copy_collision(Collision*, Collision*);
void func_802B02B4(struct ShellActor*, s32);
void func_802B039C(struct BananaActor*);
void func_802B0464(s16);
@@ -27,7 +27,7 @@ void func_802B2914(struct BananaBunchParent*, Player*, s16);
s32 use_fake_itembox_item(Player*);
s32 use_banana_item(Player*);
void use_thunder_item(Player*);
void func_802B2FA0(Player*);
void player_use_item(Player*);
void func_802B30EC(void);
void update_actor_green_shell(struct ShellActor*);
void func_802B3B44(struct ShellActor*);
+1 -1
View File
@@ -502,7 +502,7 @@ void start_race(void) {
f32 func_8028EE8C(s32 arg0) {
f32 temp_v0 = gPlayers[arg0].pos[2];
f32 temp_v1 = gPlayers[arg0].rotZ;
f32 temp_v1 = gPlayers[arg0].copy_rotation_z;
f32 temp_f14 = D_8015F8D0[2] - temp_v0;
f32 temp_f16 = temp_v1 - D_8015F8D0[2];
return gCourseTimer - ((0.01666666f * temp_f14) / (temp_f14 + temp_f16));
+1 -1
View File
@@ -1258,7 +1258,7 @@ void func_8029569C(void) {
}
}
void func_80295A38(struct UnkStruct_800DC5EC *arg0) {
void render_course(struct UnkStruct_800DC5EC *arg0) {
func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1);
if (creditsRenderMode) {
+1 -1
View File
@@ -27,7 +27,7 @@ void render_double_deck(struct UnkStruct_800DC5EC*);
void render_dks_jungle_parkway(struct UnkStruct_800DC5EC*);
void render_big_donut(struct UnkStruct_800DC5EC*);
void func_8029569C(void);
void func_80295A38(struct UnkStruct_800DC5EC*);
void render_course(struct UnkStruct_800DC5EC*);
void func_80295BF8(s32);
void func_80295C6C(void);
void func_80295D50(s16, s16);
+9 -9
View File
@@ -803,7 +803,7 @@ void func_802A59A4(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5EC);
render_course(D_800DC5EC);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(matrix);
@@ -857,7 +857,7 @@ void func_802A5CB4(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5EC);
render_course(D_800DC5EC);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
@@ -913,7 +913,7 @@ void func_802A5FAC(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5F0);
render_course(D_800DC5F0);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(matrix);
@@ -971,7 +971,7 @@ void func_802A62A4(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5EC);
render_course(D_800DC5EC);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(matrix);
@@ -1028,7 +1028,7 @@ void func_802A65B8(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5F0);
render_course(D_800DC5F0);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(matrix);
@@ -1082,7 +1082,7 @@ void func_802A68CC(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5EC);
render_course(D_800DC5EC);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(matrix);
@@ -1136,7 +1136,7 @@ void func_802A6BB0(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5F0);
render_course(D_800DC5F0);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(matrix);
@@ -1191,7 +1191,7 @@ void func_802A6E94(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5F4);
render_course(D_800DC5F4);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(matrix);
@@ -1254,7 +1254,7 @@ void func_802A7178(void) {
} else {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
}
func_80295A38(D_800DC5F8);
render_course(D_800DC5F8);
if (D_800DC5C8 == 1) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(matrix);