Mario Kart 64
|
#include <ultra64.h>
#include <macros.h>
#include <mk64.h>
#include <common_structs.h>
#include <defines.h>
#include "code_800029B0.h"
#include "camera.h"
#include "math_util.h"
#include "math_util_2.h"
#include "main.h"
#include "decode.h"
#include "kart_dma.h"
#include "objects.h"
#include "render_player.h"
#include "code_80057C60.h"
#include "effects.h"
#include "buffers.h"
#include "waypoints.h"
#include "player_controller.h"
#include "render_objects.h"
#include <assets/common_data.h>
#include "skybox_and_splitscreen.h"
#include "spawn_players.h"
Macros | |
#define | D_802F1F80_WHEEL(a, b, c) &gPlayerPalettesList[a][b][(c * 0x100) + 0xC0] |
Functions | |
void | func_8001F980 (s32 *arg0, s32 *arg1) |
void | func_8001F9E4 (Player *player, Camera *camera, s8 screenId) |
u16 | check_player_camera_collision (Player *player, Camera *camera, f32 arg2, f32 arg3) |
u16 | func_8001FD78 (Player *player, f32 posX, UNUSED f32 arg2, f32 posZ) |
void | init_render_player (Player *player, Camera *camera, s8 playerId, s8 screenId) |
one of his function is to put the frame to load in to a list to load it to be only applied for the next frame | |
void | load_kart_texture_and_render_kart_particle_on_screen_one (void) |
void | load_kart_texture_and_render_kart_particle_on_screen_two (void) |
void | load_kart_texture_and_render_kart_particle_on_screen_three (void) |
void | load_kart_texture_and_render_kart_particle_on_screen_four (void) |
void | try_rendering_player (Player *player, s8 playerId, s8 arg2) |
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) |
void | func_80021DA8 (void) |
void | mtxf_translate_rotate (Mat4 dest, Vec3f pos, Vec3s orientation) |
UNUSED void | func_80021F50 (Mat4 arg0, Vec3f arg1) |
void | mtxf_scale2 (Mat4 arg0, f32 scale) |
UNUSED void | failed_fixed_point_matrix_conversion (Mtx *dest, Mat4 src) |
void | convert_to_fixed_point_matrix (Mtx *dest, Mat4 src) |
bool | adjust_angle (s16 *angle, s16 targetAngle, s16 step) |
void | move_s32_towards (s32 *startingValue, s32 targetValue, f32 somePercent) |
void | move_f32_towards (f32 *startingValue, f32 targetValue, f32 somePercent) |
void | move_s16_towards (s16 *startingValue, s16 targetValue, f32 somePercent) |
void | move_u16_towards (u16 *startingValue, s16 targetValue, f32 somePercent) |
void | func_80022744 (void) |
void | func_8002276C (void) |
void | func_80022A98 (Player *player, s8 arg1) |
void | func_80022B50 (Player *player, UNUSED s8 arg1) |
void | func_80022BC4 (Player *player, UNUSED s8 arg1) |
void | func_80022CA8 (Player *player, s8 playerId, UNUSED s8 screenId, s8 arg3) |
void | func_80022D60 (UNUSED Player *player, s8 playerId, UNUSED s8 screenId, s8 arg3) |
void | func_80022DB4 (Player *player, UNUSED s8 arg1) |
void | func_80022E84 (Player *player, s8 playerId, UNUSED s8 screenId, s8 arg3) |
void | change_player_color_effect_rgb (UNUSED Player *player, s8 arg1, s32 arg2, f32 alpha) |
void | change_player_color_effect_cmy (UNUSED Player *player, s8 arg1, s32 arg2, f32 arg3) |
bool | is_player_under_light_luigi_raceway (Player *player, s8 arg1) |
void | render_light_environment_on_player (Player *player, s8 arg1) |
void | func_800235AC (Player *player, s8 arg1) |
void | func_80023BF0 (Player *player, s8 playerId, s8 screenId, s8 arg3) |
void | render_player_shadow (Player *player, s8 playerId, s8 screenId) |
void | render_player_shadow_credits (Player *player, s8 playerId, s8 arg2) |
void | render_kart (Player *player, s8 playerId, s8 arg2, s8 arg3) |
void | render_ghost (Player *player, s8 playerId, s8 screenId, s8 arg3) |
void | func_80025DE8 (Player *player, s8 playerId, s8 screenId, s8 arg3) |
void | render_player_ice_reflection (Player *player, s8 playerId, s8 screenId, s8 arg3) |
void | render_player (Player *player, s8 playerId, s8 screenId) |
void | func_80026A48 (Player *player, s8 arg1) |
void | update_wheel_palette (Player *player, s8 playerId, s8 screenId, s8 arg3) |
UNUSED void | func_8002701C (void) |
UNUSED void | func_80027024 (UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2) |
#define D_802F1F80_WHEEL | ( | a, | |
b, | |||
c ) &gPlayerPalettesList[a][b][(c * 0x100) + 0xC0] |
Sets player shading/colour.
void convert_to_fixed_point_matrix | ( | Mtx * | dest, |
Mat4 | src ) |
Takes a floating-point matrix and converts it to an s15.16 internal matrix. Each Mtx entry is a size of s32 that holds two values. The first 16 entries hold only the integer values and the second 16 entries hold only the decimal (fractional) parts. In simpler words, the integer and decimal gets split up and stored in their own section. Mtx is setup this way due to hardware restrictions of the n64 or as an optimization.
Mtx | A new internal fixed-point matrix. |
Mat4 | An array of f32 Mat4 to Mtx explanation: https://blarg.ca/2020/10/11/fixed-point-math. |
This function writes a fixed-point value to each Mtx entry. This is not how the Mtx struct works. The first half of Mtx only holds s16 whole numbers and the second half holds the s16 decimal (fractional) parts. See convert_to_fixed_point_matrix() for correct calculations. Note that each Mtx entry is the size of s32. This means each Mtx entry holds two s16 values. The first sixteen entries contain only the integer parts and the second sixteen entries hold only the decimal (fractional) parts.
void func_80021B0C | ( | void | ) |
void func_80021C78 | ( | void | ) |
void func_80021D40 | ( | void | ) |
void func_80021DA8 | ( | void | ) |
void func_80022744 | ( | void | ) |
void func_8002276C | ( | void | ) |
Seems to stretch/warp a specific players texture for a short period of time. Perhaps does not do anything
UNUSED void func_8002701C | ( | void | ) |
one of his function is to put the frame to load in to a list to load it to be only applied for the next frame
Activates in the tunnel to shade the player a bit darker Sort of an atmospheric effect.
void load_kart_texture_and_render_kart_particle_on_screen_four | ( | void | ) |
void load_kart_texture_and_render_kart_particle_on_screen_one | ( | void | ) |
void load_kart_texture_and_render_kart_particle_on_screen_three | ( | void | ) |
void load_kart_texture_and_render_kart_particle_on_screen_two | ( | void | ) |
Function: move_f32_towards
Parameters: f32 *startingValue - Pointer to the float that will be modified f32 targetValue - Float value to move startingValue towards f32 somePercent - The percent of the difference between startingValue and targetValue to actually move
Moves a given startingValue the given somePercent towards the targetValue
f32 *thing = 2500; move_f32_towards(thing, 500, 0.75f); thing now has a value of 1000
If after the move startingValue is inside of the range [-0.001, 0.001], force it to exactly 0.0f
This is probably a precision thing. The scaling with somePercent likely can't hit exactly 0 with any reliability, so they force it to 0 if you're in a small range around it. Why they only do this for 0 is anyone's guess though
void render_players_on_screen_four | ( | void | ) |
void render_players_on_screen_one | ( | void | ) |
void render_players_on_screen_three | ( | void | ) |
void render_players_on_screen_two | ( | void | ) |
UNUSED void* D_800DDB5C[3] = { gFramebuffer0, gFramebuffer1, gFramebuffer2 } |
Vtx* D_800DDBB4[] = { D_800E49C0, D_800E4AC0, D_800E4BC0, D_800E4CC0, D_800E4DC0, D_800E4EC0, D_800E4FD0, D_800E50D0 } |
s32 D_800DDE74[] = { 96, 128, 192, 256, 288, 384, 512, 544, 576 } |
s32 D_80164AF4[3] |
s32 D_80164B80[296] |
s16 D_80165020[40] |
Vec3f D_80165070[8] |
s16 D_80165150[4][8] |
s16 D_80165190[4][8] |
s16 D_801651D0[4][8] |
f32 gCharacterSize[] = { MARIO_SIZE, LUIGI_SIZE, YOSHI_SIZE, TOAD_SIZE, DK_SIZE, WARIO_SIZE, PEACH_SIZE, BOWSER_SIZE } |
u8** gKartBowserWheels0[] |
u8** gKartBowserWheels1[] |
u8** gKartDKWheels0[] |
u8** gKartDKWheels1[] |
u8** gKartLuigiWheels0[] |
u8** gKartLuigiWheels1[] |
u8** gKartMarioWheels0[] |
u8** gKartMarioWheels1[] |
u8** gKartPeachWheels0[] |
u8** gKartPeachWheels1[] |
u8** gKartToadWheels0[] |
u8** gKartToadWheels1[] |
u8** gKartWarioWheels0[] |
u8** gKartWarioWheels1[] |
u16** gKartWheels0[] |
u16** gKartWheels1[] |
u8** gKartYoshiWheels0[] |
u8** gKartYoshiWheels1[] |
s16 gLastAnimFrameSelector[4][8] |
s16 gLastAnimGroupSelector[4][8] |
s16 gMatrixEffectCount |
u16 gPlayerBlueEffect[8] |
u16 gPlayerCyanEffect[8] |
u16 gPlayerGreenEffect[8] |
u16 gPlayerMagentaEffect[8] |
struct_D_802F1F80* gPlayerPalette |
u16 gPlayerRedEffect[8] |
s32 gPlayersToRenderCount = 0 |
Player* gPlayersToRenderPlayer[8] |
s16 gPlayersToRenderPlayerId[8] |
s16 gPlayersToRenderScreenId[8] |
u16 gPlayerYellowEffect[8] |
s8 gRenderingFramebufferByPlayer[] = { 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02 } |
s32 junk[] = { 0, 0, 0 } |
s32 maybeCompilerPadding = 0 |
u8* sKartLowerTexture |
u8* sKartUpperTexture |