diff --git a/include/bomb_kart.h b/include/bomb_kart.h index 3431b31b3..cc5fd45b9 100644 --- a/include/bomb_kart.h +++ b/include/bomb_kart.h @@ -43,7 +43,7 @@ typedef struct { /* 0x30 */ Vec3f wheel4Pos; /* 0x3C */ f32 unk_3C; /* 0x40 */ u16 someRot; // seems like an angle of some variety, can't figure out its purpose - /* 0x42 */ u16 pathPointIndex; // probably the pathPoint that the bomb circles + /* 0x42 */ u16 pathPointIndex; // probably the path point that the bomb circles /* 0x44 */ u16 state; /* 0x46 */ u16 bounceTimer; // timer? state? height? /* 0x48 */ u16 circleTimer; // timer? state? Somehow controls how it circles around diff --git a/include/common_structs.h b/include/common_structs.h index 08231357f..960d45177 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -348,7 +348,7 @@ typedef struct { /* 0x0238 */ s16 unk_238; /* 0x023A */ s16 unk_23A; /* 0x023C */ f32 unk_23C; - /* 0x0240 */ s32 unk_240; + /* 0x0240 */ s32 tyreSpeed; /* 0x0244 */ u16 animFrameSelector[4]; // [0] Active texture group /* 0x024C */ u16 animGroupSelector[4]; /* 0x0254 */ u16 characterId; diff --git a/include/path.h b/include/path.h index b76473bd5..e85613c14 100644 --- a/include/path.h +++ b/include/path.h @@ -21,27 +21,27 @@ enum { /** * These are per-path arrays that contain some information relating to path * The arrays in gTrackPaths contain X/Y/Z and track segment information - * The arrays in gTrackLeftPaths and gCurrentTrackRightPath track some other X/Y/Z, but the track segment is always 0 - *(so, untracked/unused) Its unclear how these arrays relate to each other + * The arrays in gTrackLeftPaths and gTrackRightPaths track some other X/Y/Z, but the track segment is always 0 + * (so, untracked/unused) Its unclear how these arrays relate to each other **/ extern TrackPathPoint* gTrackPaths[]; extern TrackPathPoint* gTrackLeftPaths[]; extern TrackPathPoint* gTrackRightPaths[]; /** - * Don't know what exactly these are, but like gTrackPaths, gTrackLeftPaths, and gCurrentTrackRightPath + * Don't know what exactly these are, but like gTrackPaths, gTrackLeftPaths, and gTrackRightPaths * they track something about the path on a per-path basis **/ // PathPoint types? extern s16* gTrackSectionTypes[]; -// Based on analyse_angle_path this may be angles between path -// gPathExpectedRotation[i] = atan2(pathPoint_i, pathPoint_i+1)? +// Based on analyse_angle_path this may be angles between path point +// gPathExpectedRotation[i] = atan2(path_point_i, path_point_i+1)? extern s16* gPathExpectedRotation[]; // No idea. Adjacency list? extern s16* gTrackConsecutiveCurveCounts[]; /** - * Certain parts of the pathPoint logic will copy some path/player specific data to a temporary variable. + * Certain parts of the path point logic will copy some path/player specific data to a temporary variable. * For example: gCurrentTrackPath is always a value from gTrackPaths. Depending on which path * a given player is on, the specific value may change **/ @@ -51,7 +51,7 @@ extern s16 sSomeNearestPathPoint; extern s32 gPlayerPathIndex; // Shadows values from gTrackLeftPaths extern TrackPathPoint* gCurrentTrackLeftPath; -// Shadows values from gCurrentTrackRightPath +// Shadows values from gTrackRightPaths extern TrackPathPoint* gCurrentTrackRightPath; // Shadows values from gTrackSectionTypes extern s16* gCurrentTrackSectionTypesPath; @@ -65,7 +65,7 @@ extern TrackPathPoint* gCurrentTrackPath; extern s16* gCurrentTrackConsecutiveCurveCountsPath; extern u16 gNearestPathPointByPlayerId[]; // D_80164438 -// Total path passed by playerId? +// Total path point passed by playerId? extern s32 gNumPathPointsTraversed[]; extern u16 gPathIndexByPlayerId[]; // D_801645B0 extern u16 gPathCountByPathIndex[]; // D_801645C8 @@ -74,7 +74,7 @@ extern s16 gNearestPathPointByCameraId[]; // D_80164668 /** * Stuff that may not be directly related to path, but are only referenced in cpu_vehicles_camera_path. - * So they are at least pathPoint adjacent. + * So they are at least path point adjacent. **/ // Tracks something on a per-player basis, no idea what though @@ -82,9 +82,9 @@ extern f32 gTrackPositionFactor[]; // Track segment by playerId, although it curiously does NOT track values for human players // So, in 2 Player Grand Prix, the first 2 entries are always 0 extern u16 gPlayersTrackSectionId[]; -// Seems to be a per-path overcount of the pathPoint count -extern s32 D_80163368[]; -// Seemingly the Z position of the 1st pathPoint in the 0th path? +// Seems to be a per-path overcount of the path point count +extern s32 gSizePath[]; +// Seemingly the Z position of the 1st path point in the 0th path? extern f32 gPathStartZ; // These seem to track whether a player has entered or exited the "unknown" zone in yoshi's valley // See yoshi_valley_cpu_path and update_cpu_path_completion diff --git a/src/code_8003DC40.c b/src/code_8003DC40.c index 3ea44467e..5c3230574 100644 --- a/src/code_8003DC40.c +++ b/src/code_8003DC40.c @@ -71,7 +71,7 @@ void func_8003E048(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8829f) { arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - decelerate_player(player, 4.0f); + player_decelerate(player, 4.0f); player->unk_DAC = 0.5f; if ((player->effects & BOOST_EFFECT) != 0) { remove_boost_effect(player); @@ -99,7 +99,7 @@ void func_8003E37C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); if (((player->speed / 18.0f) * 216.0f) >= 8.0f) { - decelerate_player(player, 5.0f); + player_decelerate(player, 5.0f); } player->unk_DAC = 0.5f; if ((player->effects & BOOST_EFFECT) != 0) { @@ -127,7 +127,7 @@ void func_8003E6EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8829f) { arg3[0] = ((player->unk_206 / 182) * 0xB4); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - decelerate_player(player, 4.0f); + player_decelerate(player, 4.0f); func_8003DC40(player); } else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || ((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) { @@ -149,7 +149,7 @@ void func_8003E9EC(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0x78); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - decelerate_player(player, 4.0f); + player_decelerate(player, 4.0f); func_8003DC40(player); } else { if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || @@ -184,7 +184,7 @@ void func_8003EE2C(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0x78); arg3[2] = (-(player->slopeAccel / 182) * 0xB4); - decelerate_player(player, 4.0f); + player_decelerate(player, 4.0f); func_8003DC40(player); } else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || ((player->effects & UNKNOWN_EFFECT_0x10000) == UNKNOWN_EFFECT_0x10000)) { @@ -209,7 +209,7 @@ void func_8003F138(Player* player, Vec3f arg1, Vec3f arg2, Vec3f arg3, f32* arg4 if (player->collision.orientationVector[1] <= 0.8357f) { arg3[0] = ((player->unk_206 / 182) * 0xC8); arg3[2] = (-(player->slopeAccel / 182) * 0xC8); - decelerate_player(player, 4.0f); + player_decelerate(player, 4.0f); player->unk_DAC = 0.5f; arg3[0] = 0; } else if ((((player->speed / 18.0f) * 216.0f) > 20.0f) || diff --git a/src/code_80057C60.c b/src/code_80057C60.c index e295de381..259420310 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -555,7 +555,7 @@ void render_object_p1(void) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - func_8001C3C4(PLAYER_ONE); + render_bomb_karts_wrap(PLAYER_ONE); if (gGamestate == ENDING) { func_80055F48(PLAYER_ONE); func_80056160(PLAYER_ONE); @@ -576,7 +576,7 @@ void render_object_p2(void) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[1]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - func_8001C3C4(PLAYER_TWO); + render_bomb_karts_wrap(PLAYER_TWO); if (!gDemoMode) { render_lakitu(PLAYER_TWO); } @@ -589,7 +589,7 @@ void render_object_p3(void) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[2]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - func_8001C3C4(PLAYER_THREE); + render_bomb_karts_wrap(PLAYER_THREE); if (!gDemoMode) { render_lakitu(PLAYER_THREE); } @@ -603,7 +603,7 @@ void render_object_p4(void) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[3]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); - func_8001C3C4(PLAYER_FOUR); + render_bomb_karts_wrap(PLAYER_FOUR); if ((!gDemoMode) && (gPlayerCountSelection1 == 4)) { render_lakitu(PLAYER_FOUR); } diff --git a/src/cpu_vehicles_camera_path.c b/src/cpu_vehicles_camera_path.c index d05ab8162..07f8d8642 100644 --- a/src/cpu_vehicles_camera_path.c +++ b/src/cpu_vehicles_camera_path.c @@ -564,7 +564,7 @@ s16 get_angle_between_path(Vec3f arg0, Vec3f arg1) { return phi_v1; } -bool is_collide_with_vehicle(f32 vehicleX, f32 vehicleY, f32 vehicleVelocityX, f32 vehicleVelocityZ, f32 distanceX, +bool is_collide_with_vehicle(f32 vehicleX, f32 vehicleZ, f32 vehicleVelocityX, f32 vehicleVelocityZ, f32 distanceX, f32 distanceY, f32 playerX, f32 playerZ) { f32 velocity; f32 temp_f18; @@ -574,10 +574,10 @@ bool is_collide_with_vehicle(f32 vehicleX, f32 vehicleY, f32 vehicleVelocityX, f return false; } temp_f18 = - ((vehicleVelocityX / velocity) * (playerX - vehicleX)) + ((vehicleVelocityZ / velocity) * (playerZ - vehicleY)); + ((vehicleVelocityX / velocity) * (playerX - vehicleX)) + ((vehicleVelocityZ / velocity) * (playerZ - vehicleZ)); if ((-distanceX < temp_f18) && (temp_f18 < distanceX)) { temp_f18 = ((vehicleVelocityZ / velocity) * (playerX - vehicleX)) + - (-(vehicleVelocityX / velocity) * (playerZ - vehicleY)); + (-(vehicleVelocityX / velocity) * (playerZ - vehicleZ)); if ((-distanceY < temp_f18) && (temp_f18 < distanceY)) { return true; } @@ -1113,7 +1113,7 @@ s32 update_player_path_selection(s32 payerId, s32 pathIndex) { stackPadding = pathIndex; trackSectionId = get_track_section_id(player->collision.meshIndexZX); gPlayersTrackSectionId[payerId] = trackSectionId; - sSomeNearestPathPoint = find_closest_pathPoint_track_section(posX, posY, posZ, trackSectionId, &pathIndex); + sSomeNearestPathPoint = find_closest_path_point_track_section(posX, posY, posZ, trackSectionId, &pathIndex); gNearestPathPointByPlayerId[payerId] = sSomeNearestPathPoint; if (pathIndex) {}; gPathIndexByPlayerId[payerId] = pathIndex; @@ -1445,7 +1445,7 @@ void update_player(s32 playerId) { } break; case COURSE_DK_JUNGLE: - handle_paddleBoats_interactions(player); + handle_paddle_boats_interactions(player); break; case COURSE_TOADS_TURNPIKE: handle_box_trucks_interactions(playerId, player); @@ -1697,7 +1697,7 @@ void update_player(s32 playerId) { } break; } - if ((cpu_BehaviourState[playerId] == cpu_BEHAVIOUR_STATE_RUNNING) && + if ((cpu_BehaviourState[playerId] == CPU_BEHAVIOUR_STATE_RUNNING) && ((gTrackPositionFactor[playerId] > 0.9f) || (gTrackPositionFactor[playerId] < -0.9f))) { D_801630E8[playerId] = 0; player->effects &= ~0x10; @@ -1978,7 +1978,7 @@ void func_8000F124(void) { } // Delete track path -void clear_pathPoint(TrackPathPoint* arg0, size_t size) { +void clear_path_point(TrackPathPoint* arg0, size_t size) { bzero((void*) arg0, size * sizeof(TrackPathPoint)); } @@ -2017,9 +2017,9 @@ void init_course_path_point(void) { // zero allocated memory? //! @warning does not appear to zero all the above allocated variables. for (i = 0; i < 4; i++) { - clear_pathPoint(gTrackPaths[i], gSizePath[i]); - clear_pathPoint(gTrackLeftPaths[i], gSizePath[i]); - clear_pathPoint(gTrackRightPaths[i], gSizePath[i]); + clear_path_point(gTrackPaths[i], gSizePath[i]); + clear_path_point(gTrackLeftPaths[i], gSizePath[i]); + clear_path_point(gTrackRightPaths[i], gSizePath[i]); } // Skip several cpu cycles. @@ -4563,7 +4563,7 @@ void func_8001C14C(void) { } } -void func_8001C3C4(s32 cameraId) { +void render_bomb_karts_wrap(s32 cameraId) { if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { if (gBombKarts[0].pathPointIndex >= 16) { func_80057114(PLAYER_FOUR); diff --git a/src/cpu_vehicles_camera_path.h b/src/cpu_vehicles_camera_path.h index fc9171d61..ae46283e8 100644 --- a/src/cpu_vehicles_camera_path.h +++ b/src/cpu_vehicles_camera_path.h @@ -131,7 +131,7 @@ void calculate_track_offset_position(u16, f32, f32, s16); void set_track_offset_position(u16, f32, s16); s16 func_8000BD94(f32, f32, f32, s32); -s16 find_closest_pathPoint_track_section(f32, f32, f32, u16, s32*); +s16 find_closest_path_point_track_section(f32, f32, f32, u16, s32*); s16 update_path_index_with_track(f32, f32, f32, s16, s32, u16); s16 update_path_index(f32, f32, f32, s16, s32); void tweak_path_index_wario_stadium(f32, f32, f32, s16*, s32); @@ -139,7 +139,7 @@ void adjust_path_at_start_line(f32, f32, f32, s16*, s32); s16 update_path_index_track_section(f32, f32, f32, Player*, s32, s32*); s16 update_player_path(f32, f32, f32, s16, Player*, s32, s32); -s16 find_closest_vehicles_pathPoint(f32, f32, f32, s16); +s16 find_closest_vehicles_path_point(f32, f32, f32, s16); s16 func_8000D24C(f32, f32, f32, s32*); s16 func_8000D2B4(f32, f32, f32, s16, s32); s16 func_8000D33C(f32, f32, f32, s16, s32); @@ -161,7 +161,7 @@ void generate_player_smoke(void); void func_8000F0E0(void); void func_8000F124(void); -void clear_pathPoint(TrackPathPoint*, size_t); +void clear_path_point(TrackPathPoint*, size_t); void init_course_path_point(void); void init_players(void); @@ -190,7 +190,7 @@ void generate_train_path(void); void generate_ferry_path(void); void spawn_vehicle_on_road(VehicleStuff*); void spawn_course_vehicles(void); -void set_vehicle_pos_pathPoint(TrainCarStuff*, Path2D*, u16); +void set_vehicle_pos_path_point(TrainCarStuff*, Path2D*, u16); void init_vehicles_trains(void); void sync_train_components(TrainCarStuff*, s16); void update_vehicle_trains(void); @@ -200,10 +200,10 @@ void func_80013054(void); void check_ai_crossing_distance(s32); void init_vehicles_ferry(void); void update_vehicle_paddle_boats(void); -void handle_paddleBoats_interactions(Player*); +void handle_paddle_boats_interactions(Player*); void initialize_toads_turnpike_vehicle(f32, f32, s32, s32, VehicleStuff*, TrackPathPoint*); f32 func_80013C74(s16, s16); -void update_vehicle_follow_pathPoint(VehicleStuff*); +void update_vehicle_follow_path_point(VehicleStuff*); void handle_vehicle_interactions(s32, Player*, VehicleStuff*, f32, f32, s32, u32); f32 player_track_position_factor_vehicle(s16, f32, s16); @@ -284,7 +284,7 @@ void func_8001BE78(void); void func_8001C05C(void); void func_8001C14C(void); -void func_8001C3C4(s32); +void render_bomb_karts_wrap(s32); void func_8001C42C(void); /* This is where I'd put my static data, if I had any */ @@ -305,7 +305,6 @@ extern s16 D_80162FF8[]; extern s16 D_80163010[]; extern f32 cpu_TargetSpeed[]; extern s16 gPreviousAngleSteering[]; -extern f32 gTrackPositionFactor[]; extern f32 D_80163090[]; extern bool gIsPlayerInCurve[]; extern u16 gCurrentNearestPathPoint; @@ -319,9 +318,6 @@ extern f32 gPreviousPlayerAiOffsetX[]; extern f32 gPreviousPlayerAiOffsetZ[]; extern s16 sVehicleSoundRenderCounter; extern s32 D_801631CC; -extern TrackPathPoint* gCurrentTrackLeftPath; -extern TrackPathPoint* gCurrentTrackRightPath; -extern s16* gCurrentTrackSectionTypesPath; extern u16 D_801631E0[]; extern u16 D_801631F8[]; extern f32 gCurrentCpuTargetSpeed; @@ -337,19 +333,17 @@ extern u16 gCurrentCPUBehaviourId[]; extern u16 gPreviousCPUBehaviourId[]; extern u16 cpu_BehaviourState[]; -enum { cpu_BEHAVIOUR_STATE_NONE, cpu_BEHAVIOUR_STATE_START, cpu_BEHAVIOUR_STATE_RUNNING }; +enum { CPU_BEHAVIOUR_STATE_NONE, CPU_BEHAVIOUR_STATE_START, CPU_BEHAVIOUR_STATE_RUNNING }; extern s16 sPlayerAngle[]; -extern u16 gPlayersTrackSectionId[]; extern u16 D_80163330[]; extern u16 D_80163344[]; extern u16 D_80163348[]; extern u16 D_8016334C[]; extern u16 gSpeedCPUBehaviour[]; -enum { SPEED_cpu_BEHAVIOUR_NORMAL, SPEED_cpu_BEHAVIOUR_FAST, SPEED_cpu_BEHAVIOUR_SLOW, SPEED_cpu_BEHAVIOUR_MAX }; +enum { SPEED_CPU_BEHAVIOUR_NORMAL, SPEED_CPU_BEHAVIOUR_FAST, SPEED_CPU_BEHAVIOUR_SLOW, SPEED_CPU_BEHAVIOUR_MAX }; -extern s32 D_80163368[]; extern s32 gIncrementUpdatePlayer; extern s32 D_8016337C; extern s16 gCurrentPlayerLookAhead[]; @@ -362,8 +356,6 @@ extern s16 D_80163410[]; extern f32 D_80163418[]; extern f32 D_80163428[]; extern f32 D_80163438[]; -extern s32 gPlayerPathIndex; -extern f32 gPathStartZ; extern f32 gPreviousPlayerZ[]; extern s16 gBestRankedHumanPlayer; // 0 or 1, only 1 when when in extra (mirror) mode @@ -374,8 +366,6 @@ extern s32 D_80163480; extern s32 D_80163484; extern s32 D_80163488; extern s16 D_8016348C; -extern s16 cpu_enteringPathIntersection[]; -extern s16 cpu_exitingPathIntersection[]; extern s16 D_801634C0[]; extern s16 bStopAICrossing[]; extern s16 D_801634EC; @@ -398,15 +388,11 @@ extern s32 gLapCountByPlayerId[]; // D_80164390 extern s32 gGPCurrentRaceRankByPlayerId[]; // D_801643B8 extern s32 gPreviousGPCurrentRaceRankByPlayerId[]; extern s32 gGPCurrentRaceRankByPlayerIdDup[]; -extern u16 gSelectedPathCount; -extern u16 gNearestPathPointByPlayerId[]; -extern s32 gNumPathPointsTraversed[]; extern s16 gGetPlayerByCharacterId[]; extern s32 D_8016448C; extern f32 D_80164498[]; extern f32 gLapCompletionPercentByPlayerId[]; // D_801644A8 extern f32 gCourseCompletionPercentByPlayerId[]; // D_801644D0 -extern s16 bInMultiPathSection[]; extern f32 gPlayerPathY[]; extern s16 D_80164538[]; extern s32 D_801645D0[]; @@ -432,7 +418,6 @@ extern UnkStruct_46D0 D_801646D0[]; // See bss_80005FD0.s extern f32 gCourseCompletionPercentByRank[NUM_PLAYERS]; -extern s32 gPreviousGPCurrentRaceRankByPlayerId[]; extern s32 D_8016448C; extern u16 D_801637BE; extern u16 D_80163E2A; diff --git a/src/cpu_vehicles_camera_path/behaviour_utils.inc.c b/src/cpu_vehicles_camera_path/behaviour_utils.inc.c index 5af84fd1b..015d96e48 100644 --- a/src/cpu_vehicles_camera_path/behaviour_utils.inc.c +++ b/src/cpu_vehicles_camera_path/behaviour_utils.inc.c @@ -8,13 +8,13 @@ void copy_courses_cpu_behaviour(void) { void reset_cpu_behaviour_none(s32 playerIndex) { gCurrentCPUBehaviourId[playerIndex] = 0; gPreviousCPUBehaviourId[playerIndex] = 0; - cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_NONE; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_NONE; } void reset_cpu_behaviour(s32 playerIndex) { gCurrentCPUBehaviourId[playerIndex] = 0; gPreviousCPUBehaviourId[playerIndex] = 0; - cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_START; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START; } void cpu_behaviour_start(s32 playerId, Player* player) { @@ -38,7 +38,7 @@ void cpu_behaviour_start(s32 playerId, Player* player) { return; } if ((u32) playerPathPoint == (u32) pathPointStart) { - cpu_BehaviourState[playerId] = cpu_BEHAVIOUR_STATE_RUNNING; + cpu_BehaviourState[playerId] = CPU_BEHAVIOUR_STATE_RUNNING; gPreviousCPUBehaviourId[playerId] = gCurrentCPUBehaviourId[playerId]; gCurrentCPUBehaviourId[playerId]++; switch (behaviourType) { @@ -60,16 +60,16 @@ void cpu_behaviour_start(s32 playerId, Player* player) { gPlayerTrackPositionFactorInstruction[playerId].target = 0.6f; break; case BEHAVIOUR_NORMAL_SPEED: - gSpeedCPUBehaviour[playerId] = SPEED_cpu_BEHAVIOUR_NORMAL; + gSpeedCPUBehaviour[playerId] = SPEED_CPU_BEHAVIOUR_NORMAL; break; case BEHAVIOUR_FAST_SPEED: - gSpeedCPUBehaviour[playerId] = SPEED_cpu_BEHAVIOUR_FAST; + gSpeedCPUBehaviour[playerId] = SPEED_CPU_BEHAVIOUR_FAST; break; case BEHAVIOUR_SLOW_SPEED: - gSpeedCPUBehaviour[playerId] = SPEED_cpu_BEHAVIOUR_SLOW; + gSpeedCPUBehaviour[playerId] = SPEED_CPU_BEHAVIOUR_SLOW; break; case BEHAVIOUR_MAX_SPEED: - gSpeedCPUBehaviour[playerId] = SPEED_cpu_BEHAVIOUR_MAX; + gSpeedCPUBehaviour[playerId] = SPEED_CPU_BEHAVIOUR_MAX; break; case BEHAVIOUR_9: D_801633F8[playerId] = 1; @@ -97,14 +97,14 @@ void cpu_behaviour_end(s32 playerIndex, Player* player) { case BEHAVIOUR_1: player->effects &= ~0x10; D_801630E8[playerIndex] = 0; - cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_START; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START; break; case BEHAVIOUR_DRIVE_CENTER: case BEHAVIOUR_DRIVE_LEFT: case BEHAVIOUR_DRIVE_OUTER: gPlayerTrackPositionFactorInstruction[playerIndex].target = gPlayerTrackPositionFactorInstruction[playerIndex].unkC; - cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_START; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START; break; case BEHAVIOUR_HOP: case BEHAVIOUR_NORMAL_SPEED: @@ -113,7 +113,7 @@ void cpu_behaviour_end(s32 playerIndex, Player* player) { case BEHAVIOUR_9: case BEHAVIOUR_10: case BEHAVIOUR_MAX_SPEED: - cpu_BehaviourState[playerIndex] = cpu_BEHAVIOUR_STATE_START; + cpu_BehaviourState[playerIndex] = CPU_BEHAVIOUR_STATE_START; break; default: break; @@ -125,12 +125,12 @@ void cpu_behaviour(s32 playerIndex) { Player* player = gPlayerOne + playerIndex; switch (cpu_BehaviourState[playerIndex]) { - case cpu_BEHAVIOUR_STATE_NONE: + case CPU_BEHAVIOUR_STATE_NONE: break; - case cpu_BEHAVIOUR_STATE_START: + case CPU_BEHAVIOUR_STATE_START: cpu_behaviour_start(playerIndex, player); break; - case cpu_BEHAVIOUR_STATE_RUNNING: + case CPU_BEHAVIOUR_STATE_RUNNING: cpu_behaviour_end(playerIndex, player); break; } diff --git a/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c b/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c index 9dc128351..f7e92b6cd 100644 --- a/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c +++ b/src/cpu_vehicles_camera_path/cpu_speed_control.inc.c @@ -76,7 +76,7 @@ void func_80007D04(s32 playerId, Player* player) { D_801634C0[playerId] = 2; } else { player->effects &= ~UNKNOWN_EFFECT_0x200000; - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); D_801634C0[playerId] = -1; } } @@ -93,35 +93,35 @@ void func_80007FA4(s32 playerId, Player* player, f32 arg2) { if (playerId == 3) { if ((dist < 25.0f) && (D_80163410[playerId] < 5)) { D_80163410[playerId] = 4; - (arg2 < ((2.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_player(player, 1.0f); + (arg2 < ((2.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : player_decelerate(player, 1.0f); } else if ((dist < 3600.0f) && (D_80163410[playerId] < 4)) { D_80163410[playerId] = 3; - (arg2 < ((5.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_player(player, 5.0f); + (arg2 < ((5.0 * 18.0) / 216.0)) ? func_80038BE4(player, 1) : player_decelerate(player, 5.0f); } else { - (arg2 < ((20.0 * 18.0) / 216.0)) ? func_80038BE4(player, 10) : decelerate_player(player, 1.0f); + (arg2 < ((20.0 * 18.0) / 216.0)) ? func_80038BE4(player, 10) : player_decelerate(player, 1.0f); } } else { if ((dist < 25.0f) && (D_80163410[playerId] < 5)) { D_80163410[playerId] = 4; test = 2; - (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_player(player, 1.0f); + (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : player_decelerate(player, 1.0f); } else if ((dist < 4900.0f) && (D_80163410[playerId] < 4)) { D_80163410[playerId] = 3; test = 5; - (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : decelerate_player(player, 15.0f); + (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 1) : player_decelerate(player, 15.0f); } else if ((dist < 22500.0f) && (D_80163410[playerId] < 3)) { D_80163410[playerId] = 2; test = 20; - (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 5) : decelerate_player(player, 1.0f); + (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 5) : player_decelerate(player, 1.0f); } else if ((dist < 90000.0f) && (D_80163410[playerId] < 2)) { D_80163410[playerId] = 1; test = 30; - (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 6) : decelerate_player(player, 1.0f); + (arg2 < ((test * 18.0) / 216.0)) ? func_80038BE4(player, 6) : player_decelerate(player, 1.0f); } else if (D_80163410[playerId] == 0) { test = 35; - (arg2 < (((test ^ 0) * 18.0) / 216.0)) ? func_80038BE4(player, 2) : decelerate_player(player, 1.0f); + (arg2 < (((test ^ 0) * 18.0) / 216.0)) ? func_80038BE4(player, 2) : player_decelerate(player, 1.0f); } else { - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); } } } @@ -139,7 +139,7 @@ void regulate_cpu_speed(s32 playerId, f32 targetSpeed, Player* player) { if (gCurrentCourseId == COURSE_AWARD_CEREMONY) { func_80007FA4(playerId, player, speed); } else if ((bStopAICrossing[playerId] == true) && !(player->effects & (STAR_EFFECT | BOO_EFFECT))) { - decelerate_player(player, 10.0f); + player_decelerate(player, 10.0f); if (player->currentSpeed == 0.0) { player->velocity[0] = 0.0f; player->velocity[2] = 0.0f; @@ -166,7 +166,7 @@ void regulate_cpu_speed(s32 playerId, f32 targetSpeed, Player* player) { player_accelerate(player); } else { player->effects &= ~UNKNOWN_EFFECT_0x200000; - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); } } else if ((D_801631E0[playerId] == true) && (D_80163330[playerId] != 1)) { if (func_800088D8(playerId, gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerIdDup[playerId]) == @@ -175,26 +175,26 @@ void regulate_cpu_speed(s32 playerId, f32 targetSpeed, Player* player) { player_accelerate(player); } else { player->effects &= ~UNKNOWN_EFFECT_0x200000; - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); } } else { var_a1 = 1; switch (gSpeedCPUBehaviour[playerId]) { /* switch 1; irregular */ - case SPEED_cpu_BEHAVIOUR_FAST: /* switch 1 */ + case SPEED_CPU_BEHAVIOUR_FAST: /* switch 1 */ player->effects &= ~UNKNOWN_EFFECT_0x200000; player_accelerate(player); break; - case SPEED_cpu_BEHAVIOUR_MAX: /* switch 1 */ + case SPEED_CPU_BEHAVIOUR_MAX: /* switch 1 */ player->effects |= UNKNOWN_EFFECT_0x200000; player_accelerate(player); break; - case SPEED_cpu_BEHAVIOUR_SLOW: /* switch 1 */ + case SPEED_CPU_BEHAVIOUR_SLOW: /* switch 1 */ if (((speed / 18.0f) * 216.0f) > 20.0f) { targetSpeed = 1.6666666f; } var_a1 = 0; break; - case SPEED_cpu_BEHAVIOUR_NORMAL: /* switch 1 */ + case SPEED_CPU_BEHAVIOUR_NORMAL: /* switch 1 */ default: /* switch 1 */ var_a1 = 0; break; @@ -211,14 +211,14 @@ void regulate_cpu_speed(s32 playerId, f32 targetSpeed, Player* player) { player_accelerate(player); } else { player->effects &= ~UNKNOWN_EFFECT_0x200000; - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); } } else { player->effects &= ~UNKNOWN_EFFECT_0x200000; if (targetSpeed > 1.0f) { - decelerate_player(player, 2.0f); + player_decelerate(player, 2.0f); } else { - decelerate_player(player, 5.0f); + player_decelerate(player, 5.0f); } } } diff --git a/src/cpu_vehicles_camera_path/path_utils.inc.c b/src/cpu_vehicles_camera_path/path_utils.inc.c index f1fbe8b6b..62d3b294e 100644 --- a/src/cpu_vehicles_camera_path/path_utils.inc.c +++ b/src/cpu_vehicles_camera_path/path_utils.inc.c @@ -102,7 +102,7 @@ void calculate_track_offset_position(u16 pathPointIndex, f32 lerpFactor, f32 off pathPointTwoX = pathPointTwo->posX; pathPointTwoZ = pathPointTwo->posZ; - // Calculate vector between path + // Calculate vector between path point zdiff = pathPointTwoZ - pathPointOneZ; xdiff = pathPointTwoX - pathPointOneX; if (xdiff && xdiff) {} @@ -203,7 +203,7 @@ s16 func_8000BD94(f32 posX, f32 posY, f32 posZ, s32 pathIndex) { return nearestPathPointIndex; } -s16 find_closest_pathPoint_track_section(f32 posX, f32 posY, f32 posZ, u16 trackSectionId, s32* pathIndex) { +s16 find_closest_path_point_track_section(f32 posX, f32 posY, f32 posZ, u16 trackSectionId, s32* pathIndex) { TrackPathPoint* pathPathPoints; TrackPathPoint* considerPathPoint; f32 x_dist; @@ -297,7 +297,7 @@ s16 find_closest_pathPoint_track_section(f32 posX, f32 posY, f32 posZ, u16 track } /** - * Tries to find the pathPoint nearest to (posX, posY, posZ) + * Tries to find the path point nearest to (posX, posY, posZ) * Only consider path in the same segment as trackSectionId * Only considers path within 500 units of(posX, posY, posZ) * Looks 3 path behind and 6 path ahead of pathPointIndex @@ -339,7 +339,7 @@ s16 update_path_index_with_track(f32 posX, f32 posY, f32 posZ, s16 pathPointInde } /** - * Tries to find the pathPoint nearest to (posX, posY, posZ) + * Tries to find the path point nearest to (posX, posY, posZ) * Only considers path within 400 units of (posX, posY, posZ) * Looks 3 path behind and 6 path ahead of pathPointIndex **/ @@ -424,7 +424,7 @@ s16 update_path_index_track_section(f32 posX, f32 posY, f32 posZ, Player* player trackSectionId = gPlayersTrackSectionId[playerId]; } gPlayersTrackSectionId[playerId] = trackSectionId; - ret = find_closest_pathPoint_track_section(posX, posY, posZ, trackSectionId, pathIndex); + ret = find_closest_path_point_track_section(posX, posY, posZ, trackSectionId, pathIndex); gPathIndexByPlayerId[playerId] = *pathIndex; return ret; } @@ -475,8 +475,8 @@ s16 update_player_path(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, Player* newPathPoint = update_path_index(posX, posY, posZ, pathPointIndex, pathIndex); } if (newPathPoint == -1) { - newPathPoint = find_closest_pathPoint_track_section(posX, posY, posZ, - gPlayersTrackSectionId[playerId], &pathIndex); + newPathPoint = find_closest_path_point_track_section(posX, posY, posZ, + gPlayersTrackSectionId[playerId], &pathIndex); temp_v1 = &gTrackPaths[pathIndex][newPathPoint]; player->pos[0] = (f32) temp_v1->posX; player->pos[1] = (f32) temp_v1->posY; @@ -509,7 +509,7 @@ s16 update_player_path(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, Player* return newPathPoint; } -s16 find_closest_vehicles_pathPoint(f32 xPos, UNUSED f32 yPos, f32 zPos, s16 pathPointIndex) { +s16 find_closest_vehicles_path_point(f32 xPos, UNUSED f32 yPos, f32 zPos, s16 pathPointIndex) { f32 xdiff; f32 zdiff; f32 minimumDistance; @@ -547,7 +547,7 @@ s16 func_8000D24C(f32 posX, f32 posY, f32 posZ, s32* pathIndex) { Collision sp24; check_bounding_collision(&sp24, 10.0f, posX, posY, posZ); - return find_closest_pathPoint_track_section(posX, posY, posZ, get_track_section_id(sp24.meshIndexZX), pathIndex); + return find_closest_path_point_track_section(posX, posY, posZ, get_track_section_id(sp24.meshIndexZX), pathIndex); } s16 func_8000D2B4(f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex) { @@ -824,7 +824,7 @@ s16 update_vehicle_following_path(Vec3f pos, s16* pathPointIndex, f32 speed) { sp38[0] = pos[0]; sp38[1] = pos[1]; sp38[2] = pos[2]; - newPathPointIndex = find_closest_vehicles_pathPoint(origXPos, origYPos, origZPos, *pathPointIndex); + newPathPointIndex = find_closest_vehicles_path_point(origXPos, origYPos, origZPos, *pathPointIndex); *pathPointIndex = newPathPointIndex; farPathPoint1 = (newPathPointIndex + 3) % gVehicle2DPathLength; farPathPoint2 = (newPathPointIndex + 4) % gVehicle2DPathLength; diff --git a/src/cpu_vehicles_camera_path/vehicle_utils.inc.c b/src/cpu_vehicles_camera_path/vehicle_utils.inc.c index 2c3572f67..2ecad9c47 100644 --- a/src/cpu_vehicles_camera_path/vehicle_utils.inc.c +++ b/src/cpu_vehicles_camera_path/vehicle_utils.inc.c @@ -172,7 +172,7 @@ void spawn_course_vehicles(void) { #endif } -void set_vehicle_pos_pathPoint(TrainCarStuff* trainCar, Path2D* posXZ, u16 pathPoint) { +void set_vehicle_pos_path_point(TrainCarStuff* trainCar, Path2D* posXZ, u16 pathPoint) { trainCar->position[0] = (f32) posXZ->x; trainCar->position[1] = (f32) D_80162EB0; trainCar->position[2] = (f32) posXZ->z; @@ -206,18 +206,18 @@ void init_vehicles_trains(void) { pathPointOffset += 4; ptr1 = &gTrainList[i].passengerCars[j]; pos = &gVehicle2DPathPoint[pathPointOffset]; - set_vehicle_pos_pathPoint(ptr1, pos, pathPointOffset); + set_vehicle_pos_path_point(ptr1, pos, pathPointOffset); } // Smaller offset for the tender pathPointOffset += 3; ptr1 = &gTrainList[i].tender; pos = &gVehicle2DPathPoint[pathPointOffset]; - set_vehicle_pos_pathPoint(ptr1, pos, pathPointOffset); + set_vehicle_pos_path_point(ptr1, pos, pathPointOffset); pathPointOffset += 4; ptr1 = &gTrainList[i].locomotive; pos = &gVehicle2DPathPoint[pathPointOffset]; - set_vehicle_pos_pathPoint(ptr1, pos, pathPointOffset); + set_vehicle_pos_path_point(ptr1, pos, pathPointOffset); // Only use locomotive unless overwritten below. gTrainList[i].numCars = LOCOMOTIVE_ONLY; @@ -595,7 +595,7 @@ void update_vehicle_paddle_boats(void) { } } -void handle_paddleBoats_interactions(Player* player) { +void handle_paddle_boats_interactions(Player* player) { s32 someIndex; PaddleBoatStuff* tempPaddleWheelBoat; f32 x_diff; @@ -709,7 +709,7 @@ f32 func_80013C74(s16 someType, s16 pathPointIndex) { return var_f2; } -void update_vehicle_follow_pathPoint(VehicleStuff* vehicle) { +void update_vehicle_follow_path_point(VehicleStuff* vehicle) { f32 temp_f0_2; f32 temp_f0_3; f32 sp5C; @@ -993,7 +993,7 @@ void init_vehicles_box_trucks(void) { void update_vehicle_box_trucks(void) { s32 loopIndex; for (loopIndex = 0; loopIndex < NUM_RACE_BOX_TRUCKS; loopIndex++) { - update_vehicle_follow_pathPoint(&gBoxTruckList[loopIndex]); + update_vehicle_follow_path_point(&gBoxTruckList[loopIndex]); } } @@ -1021,7 +1021,7 @@ void init_vehicles_school_buses(void) { void update_vehicle_school_bus(void) { s32 loopIndex; for (loopIndex = 0; loopIndex < NUM_RACE_SCHOOL_BUSES; loopIndex++) { - update_vehicle_follow_pathPoint(&gSchoolBusList[loopIndex]); + update_vehicle_follow_path_point(&gSchoolBusList[loopIndex]); } } @@ -1049,7 +1049,7 @@ void init_vehicles_trucks(void) { void update_vehicle_tanker_trucks(void) { s32 loopIndex; for (loopIndex = 0; loopIndex < NUM_RACE_TANKER_TRUCKS; loopIndex++) { - update_vehicle_follow_pathPoint(&gTankerTruckList[loopIndex]); + update_vehicle_follow_path_point(&gTankerTruckList[loopIndex]); } } @@ -1077,7 +1077,7 @@ void init_vehicles_cars(void) { void update_vehicle_cars(void) { s32 loopIndex; for (loopIndex = 0; loopIndex < NUM_RACE_CARS; loopIndex++) { - update_vehicle_follow_pathPoint(&gCarList[loopIndex]); + update_vehicle_follow_path_point(&gCarList[loopIndex]); } } diff --git a/src/effects.c b/src/effects.c index 6b48a36cb..7ae37db98 100644 --- a/src/effects.c +++ b/src/effects.c @@ -221,7 +221,7 @@ void func_8008C528(Player* player, s8 arg1) { void func_8008C62C(Player* player, s8 arg1) { - decelerate_player(player, 5.0f); + player_decelerate(player, 5.0f); player->unk_0A8 += (s16) 0xA0; player->unk_042 += (s16) 0x71C; if (player->unk_0A8 >= 0x2000) { @@ -323,15 +323,15 @@ void func_8008C9EC(Player* player, s8 arg1) { player->unk_206 = 0; player->slopeAccel = 0; if ((player->unk_046 & 0x40) == 0x40) { - decelerate_player(player, 100.0f); + player_decelerate(player, 100.0f); } else { if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); } else { - decelerate_player(player, 4.0f); + player_decelerate(player, 4.0f); } if (!(player->type & PLAYER_HUMAN)) { - decelerate_player(player, 30.0f); + player_decelerate(player, 30.0f); } } if ((player->effects & 0x80) == 0x80) { @@ -893,7 +893,7 @@ void apply_lightning_effect(Player* player, s8 arg1) { D_80165190[3][arg1] = 1; } } - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); } else { player->unk_0B0 += 1; player->unk_08C = (f32) ((f64) player->unk_08C * 0.6); diff --git a/src/player_controller.c b/src/player_controller.c index 90259b6f4..6d379c932 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -1891,7 +1891,7 @@ void func_8002C954(Player* player, s8 playerId, Vec3f arg2) { player->unk_256 = 0; } if ((player->slopeAccel >= 0) && (((player->speed / 18.0f) * 216.0f) > 5.0f)) { - decelerate_player(player, 18.0f); + player_decelerate(player, 18.0f); } if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { xdist = D_80165070[playerId][0] - arg2[0]; @@ -1955,7 +1955,7 @@ void apply_effect(Player* player, s8 arg1, s8 arg2) { apply_boo_effect(player, arg1); } if (((player->effects & 0x20000000) == 0x20000000) && (player->unk_228 >= 0x64)) { - decelerate_player(player, 4.0f); + player_decelerate(player, 4.0f); } if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) { func_8008C9EC(player, arg1); @@ -1977,7 +1977,7 @@ void apply_effect(Player* player, s8 arg1, s8 arg2) { } if ((player->effects & 0x800000) == 0x800000) { func_8008D8B4(player, arg1); - decelerate_player(player, 10.0f); + player_decelerate(player, 10.0f); } if (D_800DC510 != 5) { if (player->soundEffects & 0x04000000) { @@ -2032,7 +2032,7 @@ void func_8002D028(Player* player, s8 arg1) { player->unk_08C = 0; player->speed = 0; player->unk_104 = 0; - player->unk_240 = 0; + player->tyreSpeed = 0; player->unk_07C = 0; player->velocity[0] = 0; player->velocity[1] = 0; @@ -2556,13 +2556,13 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player if (sp74 < 0.0f) { func_8003F734(player, sp48, sp54, &sp74, &spD0, &spCC, &spC8); func_8002C954(player, playerId, sp54); - decelerate_player(player, 6.0f); + player_decelerate(player, 6.0f); } sp74 = player->collision.surfaceDistance[1]; if (sp74 < 0.0f) { func_8003FBAC(player, sp48, sp54, &sp74, &spD0, &spCC, &spC8); func_8002C954(player, playerId, sp54); - decelerate_player(player, 6.0f); + player_decelerate(player, 6.0f); } sp74 = player->collision.surfaceDistance[0]; if (sp74 >= 0.0f) { @@ -3324,7 +3324,7 @@ void player_accelerate(Player* player) { } } -void decelerate_player(Player* player, f32 speed) { +void player_decelerate(Player* player, f32 speed) { s32 player_index; player_index = get_player_index_for_player(player); @@ -3503,7 +3503,7 @@ void func_800323E4(Player* player) { player->effects |= 1; // This check will never be true, why is it here? if ((player->effects & 0x20) == 0x20) { - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); player->unk_20C = var_f2; } else { if ((s32) player->tyres[BACK_RIGHT].surfaceType < 0xF) { @@ -3523,18 +3523,18 @@ void func_800323E4(Player* player) { } if (gIsPlayerTripleBButtonCombo[var_v1] == true) { if (player->unk_20C >= 2.0f) { - decelerate_player(player, (1.0f - var_f2) * 5.0f); + player_decelerate(player, (1.0f - var_f2) * 5.0f); } else { - decelerate_player(player, (1.0f - var_f2) * 3.0f); + player_decelerate(player, (1.0f - var_f2) * 3.0f); } } else { if (((player->speed / 18.0f) * 216.0f) <= 20.0f) { - decelerate_player(player, (1.0f - var_f2) * 4.0f); + player_decelerate(player, (1.0f - var_f2) * 4.0f); } if (player->unk_20C >= 2.0f) { - decelerate_player(player, (1.0f - var_f2) * 2.5); + player_decelerate(player, (1.0f - var_f2) * 2.5); } else { - decelerate_player(player, (1.0f - var_f2) * 1.2); + player_decelerate(player, (1.0f - var_f2) * 1.2); } } } @@ -4538,9 +4538,9 @@ void func_80037CFC(Player* player, struct Controller* controller, s8 arg2) { detect_triple_a_combo_a_pressed(player); } else { if (gModeSelection == BATTLE) { - decelerate_player(player, 2.0f); + player_decelerate(player, 2.0f); } else { - decelerate_player(player, 1.0f); + player_decelerate(player, 1.0f); } detect_triple_a_combo_a_released(player); } @@ -4572,7 +4572,7 @@ void func_80037CFC(Player* player, struct Controller* controller, s8 arg2) { if (controller->button & A_BUTTON) { player_accelerate(player); } else { - decelerate_player(player, 5.0f); + player_decelerate(player, 5.0f); } } if (((((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40)) || diff --git a/src/player_controller.h b/src/player_controller.h index 7bf233e55..52e704daf 100644 --- a/src/player_controller.h +++ b/src/player_controller.h @@ -74,7 +74,7 @@ void func_80030A34(Player*); void detect_triple_a_combo_a_released(Player*); void detect_triple_a_combo_a_pressed(Player*); void player_accelerate(Player*); -void decelerate_player(Player*, f32); +void player_decelerate(Player*, f32); void detect_triple_b_combo_b_released(Player*); void detect_triple_b_combo_b_pressed(Player*); void func_800323E4(Player*); diff --git a/src/render_player.c b/src/render_player.c index 0147e67d9..42d8e7ceb 100644 --- a/src/render_player.c +++ b/src/render_player.c @@ -1746,21 +1746,21 @@ void func_80026A48(Player* player, s8 arg1) { f32 temp_f0; if (((player->effects & 0x4000) == 0x4000) && ((player->type & PLAYER_START_SEQUENCE) == 0)) { - player->unk_240 += D_800DDE74[8]; - if (player->unk_240 >= 0x400) { - player->unk_240 = 0; + player->tyreSpeed += D_800DDE74[8]; + if (player->tyreSpeed >= 0x400) { + player->tyreSpeed = 0; } return; } temp_f0 = ((player->speed * (1.0f + player->unk_104)) / 18.0f) * 216.0f; if ((temp_f0 <= 1.0f) || (gIsPlayerTripleBButtonCombo[arg1] == true)) { - player->unk_240 = 0; + player->tyreSpeed = 0; } else { - player->unk_240 += D_800DDE74[(s32) (temp_f0 / 12.0f)]; + player->tyreSpeed += D_800DDE74[(s32) (temp_f0 / 12.0f)]; } - if (player->unk_240 >= 0x400) { - player->unk_240 = 0; + if (player->tyreSpeed >= 0x400) { + player->tyreSpeed = 0; } } @@ -1774,7 +1774,7 @@ void func_80026A48(Player* player, s8 arg1) { void update_wheel_palette(Player* player, s8 playerId, s8 screenId, s8 arg3) { s16 frameId = gLastAnimFrameSelector[screenId][playerId]; s16 groupId = gLastAnimGroupSelector[screenId][playerId]; - s16 temp_t2 = player->unk_240; + s16 temp_t2 = player->tyreSpeed; s16 temp_num = 0x40; // setting this as a variable gets rid of regalloc if (((player->effects & 0x4000) == 0x4000) && ((player->type & PLAYER_START_SEQUENCE) == 0)) { diff --git a/src/spawn_players.c b/src/spawn_players.c index 72b3a40ef..dc88b8ca4 100644 --- a/src/spawn_players.c +++ b/src/spawn_players.c @@ -200,7 +200,7 @@ void spawn_player(Player* player, s8 playerIndex, f32 startingRow, f32 startingC player->unk_236 = 0; player->unk_238 = 0; player->unk_23A = 0; - player->unk_240 = 0; + player->tyreSpeed = 0; player->unk_256 = 0; player->size = 1.0f;