Skip to content

Commit

Permalink
rename in code_8001F980.c (#456)
Browse files Browse the repository at this point in the history
* some renames

* Update code_8001F980.c
  • Loading branch information
coco875 authored Oct 14, 2023
1 parent 364f077 commit 10e0e61
Show file tree
Hide file tree
Showing 11 changed files with 366 additions and 282 deletions.
2 changes: 1 addition & 1 deletion asm/bss_8001C4D0.s
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ glabel D_80164AD0
glabel gMatrixEffectCount
.skip 20

glabel D_80164B04
glabel gPlayerPalette
.skip 4

glabel D_80164B08
Expand Down
3 changes: 3 additions & 0 deletions include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,5 +336,8 @@
#define SPAWN_THIRD_SHELL 2

#define GPACK_RGB888(r, g, b) (((r) << 16) | ((g) << 8) | (b))
#define COLOR_LIGHT GPACK_RGB888(0x1C, 0x00, 0x00)
#define COLOR_LAVA GPACK_RGB888(0x34, 0x00, 0x00)
#define COLOR_BLACK GPACK_RGB888(0, 0, 0)

#endif // DEFINES_H
1 change: 0 additions & 1 deletion include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ void func_80040030(u8* arg0, u8* arg1);
void func_8000F2DC(void);
void func_8000F628(void);
void func_8006B7E4(Player* player, s8 arg1);
void func_800267AC(Player* player, s8 arg1, s8 arg2);
void func_8005D290(void);


Expand Down
6 changes: 3 additions & 3 deletions src/camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ void func_8001E0C4(Camera *camera, Player *player, s8 arg2) {
} else {
var_a2 = (player->unk_078 / 3) + 0x87;
}
func_800224F0(&camera->unk_2C, player->unk_02C[1], var_a2);
adjust_angle(&camera->unk_2C, player->unk_02C[1], var_a2);
func_8001CA78(player, camera, sp60, &sp74, &sp70, &sp6C, camera->unk_2C, arg2);
camera->someBitFlags &= ~0x0004;
temp_t7 = func_802ADDC8(&camera->unk_54, test, sp74, sp70, sp6C);
Expand Down Expand Up @@ -739,7 +739,7 @@ void func_8001E45C(Camera *camera, Player *player, s8 arg2) {
(player->unk_110.unk3C[0] <= 0.0f) || (player->unk_110.unk3C[1] <= 0.0f) || ((player->effects & 0x20000) == 0x20000)) {
func_8001CCEC(player, camera, sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2);
} else {
func_800224F0(&camera->unk_2C, (s16) (player->unk_02C[1] + camera->unk_B0), var_a3);
adjust_angle(&camera->unk_2C, (s16) (player->unk_02C[1] + camera->unk_B0), var_a3);
func_8001CCEC(player, camera, sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2);
}
temp = 3;
Expand Down Expand Up @@ -861,7 +861,7 @@ void func_8001EA0C(Camera *camera, Player *player, s8 arg2) {
(player->unk_110.unk3C[0] <= 0.0f) || (player->unk_110.unk3C[1] <= 0.0f) || ((player->effects & 0x20000) == 0x20000)) {
func_8001D944(player, camera, sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2);
} else {
func_800224F0(&camera->unk_2C, (s16) (player->unk_02C[1] + camera->unk_B0), var_a3);
adjust_angle(&camera->unk_2C, (s16) (player->unk_02C[1] + camera->unk_B0), var_a3);
func_8001D944(player, camera, sp64, &sp84, &sp80, &sp7C, &sp58, (s32) camera->unk_2C, (s32) arg2);
}
temp = 3;
Expand Down
6 changes: 3 additions & 3 deletions src/code_80005FD0.c
Original file line number Diff line number Diff line change
Expand Up @@ -6361,14 +6361,14 @@ void func_80013D20(VehicleStuff *vehicle) {
} else {
var_a1 = func_8000D940(vehicle->position, &vehicle->waypointIndex, vehicle->someMultiplier, vehicle->someMultiplierTheSequel, 0);
}
func_800224F0(&vehicle->rotation[1], var_a1, 100);
adjust_angle(&vehicle->rotation[1], var_a1, 100);
temp_f0_3 = vehicle->position[0] - sp5C;
temp_f2_2 = vehicle->position[2] - sp54;
sp34[0] = vehicle->position[1];
sp34[1] = 0.0f;
sp34[2] = sqrtf((temp_f0_3 * temp_f0_3) + (temp_f2_2 * temp_f2_2));
thing = get_angle_between_points(sp40, sp34);
func_800224F0(&vehicle->rotation[0], -thing, 100);
adjust_angle(&vehicle->rotation[0], -thing, 100);
vehicle->velocity[0] = vehicle->position[0] - sp5C;
vehicle->velocity[1] = vehicle->position[1] - sp58;
vehicle->velocity[2] = vehicle->position[2] - sp54;
Expand Down Expand Up @@ -7010,7 +7010,7 @@ void func_80015390(Camera *camera, UNUSED Player *player, UNUSED s32 arg2) {
var_a2 = 0xA0 + (temp_s1->unk_078 / 16);
}
if (!((temp_s1->effects & 0x80) || (temp_s1->effects & 0x40))) {
func_800224F0(&camera->unk_2C, temp_s1->unk_02C[1], var_a2);
adjust_angle(&camera->unk_2C, temp_s1->unk_02C[1], var_a2);
}
func_8001D794(temp_s1, camera, sp64, &sp84, &sp80, &sp7C, camera->unk_2C);
func_802ADDC8(&camera->unk_54, 10.0f, sp84, sp80, sp7C);
Expand Down
577 changes: 329 additions & 248 deletions src/code_8001F980.c

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions src/code_8001F980.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ void func_8001F980(s32*, s32*);
void func_8001F9E4(Player*, Camera*, s8);
u16 check_player_camera_collision(Player*, Camera*, f32, f32);
u16 func_8001FD78(Player*, f32, f32, f32);
void func_80020000(Player*, Camera*, s8, s8);
void init_render_player(Player*, Camera*, s8, s8);
void func_80020524(void);
void func_8002088C(void);
void func_80020BF4(void);
void func_80020F1C(void);
void func_80021244(Player*, s8, s8);
void func_800212B4(void);
void func_800215DC(void);
void func_8002186C(void);
void func_800219BC(void);
void try_render_player(Player*, s8, s8);
void render_players_on_screen_one(void);
void render_players_on_screen_two(void);
void render_players_on_screen_three(void);
void render_players_on_screen_four(void);
void func_80021B0C(void);
void func_80021C78(void);
void func_80021D40(void);
Expand All @@ -32,7 +32,7 @@ void func_80021F50(Mat4, Vec3f);
void mtxf_scale2(Mat4, f32);
void func_80021FF8(Mtx*, Mat4);
void convert_to_fixed_point_matrix(Mtx*, Mat4);
s32 func_800224F0(s16*, s16, s16);
s32 adjust_angle(s16*, s16, s16);
void move_s32_towards(s32*, s32, f32);
void move_f32_towards(f32*, f32, f32);
void move_s16_towards(s16*, s16, f32);
Expand All @@ -49,16 +49,16 @@ void func_80022E84(Player*, s8, s8, s8);
void change_player_color_effect_rgb(Player*, s8, s32, f32);
void change_player_color_effect_cmy(Player*, s8, s32, f32);
s32 is_player_under_light_luigi_raceway(Player*, s8);
void func_800231D8(Player*, s8);
void render_light_environment_on_player(Player*, s8);
void func_800235AC(Player*, s8);
void func_80023BF0(Player*, s8, s8, s8);
void func_80023C84(Player*, s8, s8);
void func_80024374(Player*, s8, s8);
void player_render(Player*, s8, s8, s8);
void render_player_shadow(Player*, s8, s8);
void render_player_shadow_credits(Player*, s8, s8);
void kart_render(Player*, s8, s8, s8);
void ghost_render(Player*, s8, s8, s8);
void func_80025DE8(Player*, s8, s8, s8);
void player_ice_reflection_render(Player*, s8, s8, s8);
void func_800267AC(Player*, s8, s8);
void player_render(Player*, s8, s8);
void func_80026A48(Player*, s8);
void func_80026B4C(Player*, s8, s8, s8);
void func_80030A34(Player*);
Expand All @@ -67,7 +67,7 @@ void func_80027024(s32, s32, s32);

/* This is where I'd put my static data, if I had any */

extern struct_D_802F1F80 *D_80164B04;
extern struct_D_802F1F80 *gPlayerPalette;
extern u8 *D_80164B08;
extern u8 *D_80164B0C;

Expand All @@ -91,7 +91,7 @@ extern s32 D_8018D930[];
extern Gfx common_square_plain_render[];
extern Gfx D_0D008D58[];

extern s32 D_800DDB58;
extern s32 gPlayersToRenderCount;
extern void *D_800DDB5C[];
extern Vtx *D_800DDBB4[];
extern f32 gCharacterSize[];
Expand Down
2 changes: 1 addition & 1 deletion src/ending/code_80281C40.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void func_80281D00(void) {
mtxf_identity(matrix);
render_set_position(matrix, 0);
gSPDisplayList(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_80284F70));
func_800212B4();
render_players_on_screen_one();
gSPDisplayList(gDisplayListHead++, VIRTUAL_TO_PHYSICAL2(&D_80284EE0));
update_actors_loop();
func_80058090(0);
Expand Down
2 changes: 1 addition & 1 deletion src/player_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,7 @@ void func_8002D028(Player *player, s8 arg1) {

temp_f18 = sqrtf((sp4C[0] - player->pos[0]) * (sp4C[0] - player->pos[0])+ (sp4C[2] - player->pos[2]) * (sp4C[2] - player->pos[2]));
if (temp_f18 <= 8.0f) {
func_800224F0(&player->unk_02C[1], -0x8000, 0x016C);
adjust_angle(&player->unk_02C[1], -0x8000, 0x016C);
if ((player->unk_02C[1] < (-0x7F41)) || (player->unk_02C[1] > 0x7F41)) {
player->type &= ~0x0200;
}
Expand Down
18 changes: 9 additions & 9 deletions src/racing/skybox_and_splitscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ void func_802A59A4(void) {
}
render_course_actors(D_800DC5EC);
func_80058090(0);
func_800212B4();
render_players_on_screen_one();
func_8029122C(D_800DC5EC, 0);
func_80021B0C();
func_802A2F34(D_800DC5EC);
Expand Down Expand Up @@ -851,7 +851,7 @@ void func_802A5CB4(void) {
}
render_course_actors(D_800DC5EC);
func_80058090(1);
func_800212B4();
render_players_on_screen_one();
func_8029122C(D_800DC5EC, 0);
func_80021B0C();
func_802A2F34(D_800DC5EC);
Expand Down Expand Up @@ -898,7 +898,7 @@ void func_802A5FAC(void) {
}
render_course_actors(D_800DC5F0);
func_80058090(2);
func_800215DC();
render_players_on_screen_two();
func_8029122C(D_800DC5F0, 1);
func_80021C78();
func_802A2F34(D_800DC5F0);
Expand Down Expand Up @@ -947,7 +947,7 @@ void func_802A62A4(void) {
}
render_course_actors(D_800DC5EC);
func_80058090(3);
func_800212B4();
render_players_on_screen_one();
func_8029122C(D_800DC5EC, 0);
func_80021B0C();
func_802A2F34(D_800DC5EC);
Expand Down Expand Up @@ -996,7 +996,7 @@ void func_802A65B8(void) {
}
render_course_actors(D_800DC5F0);
func_80058090(4);
func_800215DC();
render_players_on_screen_two();
func_8029122C(D_800DC5F0, 1);
func_80021C78();
func_802A2F34(D_800DC5F0);
Expand Down Expand Up @@ -1043,7 +1043,7 @@ void func_802A68CC(void) {
}
render_course_actors(D_800DC5EC);
func_80058090(8);
func_800212B4();
render_players_on_screen_one();
func_8029122C(D_800DC5EC, 0);
func_80021B0C();
func_802A2F34(D_800DC5EC);
Expand Down Expand Up @@ -1090,7 +1090,7 @@ void func_802A6BB0(void) {
}
render_course_actors(D_800DC5F0);
func_80058090(9);
func_800215DC();
render_players_on_screen_two();
func_8029122C(D_800DC5F0, 1);
func_80021C78();
func_802A2F34(D_800DC5F0);
Expand Down Expand Up @@ -1137,7 +1137,7 @@ void func_802A6E94(void) {
}
render_course_actors(D_800DC5F4);
func_80058090(10);
func_8002186C();
render_players_on_screen_three();
func_8029122C(D_800DC5F4, 2);
func_80021D40();
func_802A2F34(D_800DC5F4);
Expand Down Expand Up @@ -1192,7 +1192,7 @@ void func_802A7178(void) {
}
render_course_actors(D_800DC5F8);
func_80058090(11);
func_800219BC();
render_players_on_screen_four();
func_8029122C(D_800DC5F8, 3);
func_80021DA8();
func_802A2F34(D_800DC5F8);
Expand Down
3 changes: 2 additions & 1 deletion src/spawn_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "podium_ceremony_actors.h"
#include "main.h"
#include "menus.h"
#include "code_8001F980.h"

// arg4 is height? Or something like that?
void spawn_player(Player *player, s8 playerIndex, f32 startingRow, f32 startingColumn, f32 arg4, f32 arg5, u16 characterId, s16 playerType) {
Expand Down Expand Up @@ -1040,7 +1041,7 @@ void func_8003CD98(Player *player, Camera *camera, s8 playerId, s8 arg3) {
D_80165110[arg3][playerId] = player->animGroupSelector[arg3];
D_80165150[arg3][playerId] = player->unk_0A8;
D_801651D0[arg3][playerId] = 0;
func_800267AC(player, playerId, arg3);
player_render(player, playerId, arg3);
}
}

Expand Down

0 comments on commit 10e0e61

Please sign in to comment.