Cleanup, and documenting (#583)

* Some amount of documenting in printf.c

* Formatter, and do some mild cleanup and documentation in menu.c

* Fix gSaveMenuObjectIndices

* Use ObjectTransform in MenuAsset as it's what's being passed to cam_push_model_mtx

* Fix warnings and format

* Cleanup some objects.c code and it's usage of casting.

* Add Object to Object_64

* Much better score for func_8000B750

* Match func_8000B750

* Update score

* Do some naming

* Sorry one more better documenting!
This commit is contained in:
Ryan Myers
2025-05-21 12:56:15 -04:00
committed by GitHub
parent 2ac56bae9c
commit 97aaf39e64
24 changed files with 391 additions and 388 deletions
+11 -11
View File
@@ -5,11 +5,11 @@ This repo contains a work-in-progress decompilation of Diddy Kong Racing for the
All versions are supported, and the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fda38e533b9fe63bb9670) of the game is the default if not specified.
<!-- README_SCORE_SUMMARY_BEGIN -->
As of May 19, 2025, this is our current score:
As of May 21, 2025, this is our current score:
&emsp;&emsp;&emsp;&emsp;Decomp progress: 88.06%
&emsp;&emsp;&emsp;&emsp;Decomp progress: 88.16%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 56.98%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 56.99%
<!-- README_SCORE_SUMMARY_END -->
---
@@ -117,15 +117,15 @@ s32 is_drumstick_unlocked(void) {
```
<!-- README_SCORE_BEGIN -->
As of May 19, 2025, this is our current score:
As of May 21, 2025, this is our current score:
```
=====================================================================
ADVENTURE ONE (ASM -> C Decompilation)
--------------- 88.06% Complete (89.02% NON_MATCHING) ---------------
# Decompiled functions: 1898
# GLOBAL_ASM remaining: 53
--------------- 88.16% Complete (89.12% NON_MATCHING) ---------------
# Decompiled functions: 1899
# GLOBAL_ASM remaining: 52
# NON_MATCHING functions: 5
# NON_EQUIVALENT WIP functions: 16
# NON_EQUIVALENT WIP functions: 15
---------------------------- Game Status ----------------------------
Balloons: 41/47, Keys: 4/4, Trophies: 4/5
T.T. Amulets: 4/4, Wizpig Amulets: 4/4
@@ -133,9 +133,9 @@ As of May 19, 2025, this is our current score:
We are racing in Spaceport Alpha. (Lap 1/3)
=====================================================================
ADVENTURE TWO (Cleanup & Documentation)
-------------------------- 56.98% Complete --------------------------
# Documented functions: 1179
# Undocumented remaining: 475
-------------------------- 56.99% Complete --------------------------
# Documented functions: 1181
# Undocumented remaining: 473
---------------------------- Game Status ----------------------------
Balloons: 27/47, Keys: 3/4, Trophies: 2/5
T.T. Amulets: 3/4, Wizpig Amulets: 2/4
+6
View File
@@ -170,6 +170,11 @@ typedef struct ObjPropertyTimeTrial {
struct ObjectHeader *header;
} ObjPropertyTimeTrial;
typedef struct ObjPropertyBoost {
struct Object *obj;
s32 unk4;
} ObjPropertyBoost;
typedef struct ObjProperties {
union {
ObjPropertyCommon common;
@@ -204,6 +209,7 @@ typedef struct ObjProperties {
ObjPropertyWeapon weapon;
ObjPropertyCamControl camControl;
ObjPropertyTimeTrial timeTrial;
ObjPropertyBoost boost;
};
} ObjProperties;
+4
View File
@@ -1660,6 +1660,7 @@ typedef struct Object_CharacterSelect {
typedef struct Object_64 {
union {
struct Object *obj;
Object_Laser laser;
Object_TrophyCabinet trophy_cabinet;
Object_Animator animator;
@@ -1761,7 +1762,10 @@ typedef struct unk800B2260_C {
/* Size: 0x018 bytes */
typedef struct ObjectTransform {
/* 0x0000 */ Vec3s rotation;
union {
/* 0x0006 */ s16 flags;
/* 0x0006 */ s16 spriteID;
};
/* 0x0008 */ f32 scale;
/* 0x000C */ f32 x_position;
/* 0x0010 */ f32 y_position;
+1 -1
View File
@@ -79,7 +79,7 @@ void audspat_calculate_echo(SoundHandle soundHandle, f32 x, f32 y, f32 z);
s32 audspat_distance_to_segment(f32 inX, f32 inY, f32 inZ, f32 coords[6], f32 *outX, f32 *outY, f32 *outZ);
void audspat_reset(void);
void audspat_update_all(Object **objList, s32 numObjects, s32 updateRate); // Non Matching
void func_80006FC8(Object **objs, s32 numRacers, Camera *segment, u8 arg3, s32 updateRate); // Non Matching
void func_80006FC8(Object **objs, s32 numRacers, Camera *camera, u8 arg3, s32 updateRate); // Non Matching
u8 audspat_reverb_get_strength_at_point(ReverbLine *, f32, f32, f32);
#endif
+2 -2
View File
@@ -661,8 +661,8 @@ void func_80006FC8(Object **objs, s32 numRacers, Camera *camera, u8 arg3, s32 up
var_f26 = 2250000.0f; //(1500.0f * 1500.0f)
var_f26 = (var_f26 - (gRacerSound->unk84 * gRacerSound->unk84)) / var_f26;
var_f26 *= var_f26;
gRacerSound->unk91[0] = audspat_calculate_spatial_pan(
tempxPos, tempzPos, camera[loopCount1].trans.rotation.y_rotation);
gRacerSound->unk91[0] =
audspat_calculate_spatial_pan(tempxPos, tempzPos, camera[loopCount1].trans.rotation.y_rotation);
} else {
var_f26 = 0.0f;
}
+3 -3
View File
@@ -59,11 +59,11 @@ Vp gViewportStack[20] = {
};
ObjectTransform D_800DD288 = {
{ { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, -281.0f,
{ { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, -281.0f,
};
ObjectTransform D_800DD2A0 = {
{ { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f,
{ { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f,
};
Matrix gOrthoMatrixF = {
@@ -950,7 +950,7 @@ void set_ortho_matrix_view(Gfx **dList, MatrixS **mtx) {
void func_8006807C(Gfx **dList, MatrixS **mtx) {
object_inverse_transform_to_matrix(gCurrentModelMatrixF, &D_800DD288);
f32_matrix_mult(&gCurrentModelMatrixF, &gPerspectiveMatrixF, &gViewMatrixF);
object_inverse_transform_to_matrix((float (*)[4]) gModelMatrixF[0], &D_800DD2A0);
object_inverse_transform_to_matrix((float(*)[4]) gModelMatrixF[0], &D_800DD2A0);
f32_matrix_mult(gModelMatrixF[0], &gViewMatrixF, &gCurrentModelMatrixF);
f32_matrix_to_s16_matrix(&gCurrentModelMatrixF, *mtx);
gSPMatrixDKR((*dList)++, OS_K0_TO_PHYSICAL((*mtx)++), G_MTX_DKR_INDEX_0);
+1 -1
View File
@@ -121,7 +121,7 @@ void copy_framebuffer_size_to_coords(s32 *x1, s32 *y1, s32 *x2, s32 *y2);
void set_ortho_matrix_height(f32 value);
void set_ortho_matrix_view(Gfx **dList, MatrixS **mtx);
void func_8006807C(Gfx **dList, MatrixS **mtx);
void viewport_rsp_set(Gfx **dList, s32 width, s32 height, s32 posX, s32 posY);
void viewport_rsp_set(Gfx **dList, s32 halfWidth, s32 halfHeight, s32 centerX, s32 centerY);
void viewport_reset(Gfx **dList);
void matrix_world_origin(Gfx **dList, MatrixS **mtx);
void sprite_anim_off(s32 setting);
+1 -1
View File
@@ -163,7 +163,7 @@ GLOBAL_ASM("asm/math_util/f32_matrix_mult.s")
#ifdef NON_MATCHING
/* Official name: mathMtxF2L */
void f32_matrix_to_s16_matrix(Matrix *input, MatrixS *output) {
guMtxF2L((float (*)[4]) input, (Mtx *) output);
guMtxF2L((float(*)[4]) input, (Mtx *) output);
}
#else
GLOBAL_ASM("asm/math_util/f32_matrix_to_s16_matrix.s")
+1 -1
View File
@@ -48,7 +48,7 @@ void object_transform_to_matrix(Matrix mtx, ObjectTransform *trans);
void f32_matrix_scale_y_axis(Matrix *input, f32 scale);
void f32_matrix_translate_y_axis(Matrix *input, f32 offset);
void object_inverse_transform_to_matrix(Matrix mtx, ObjectTransform *trans);
void f32_matrix_from_rotation_and_scale(Matrix mtx, s32 angle, f32 arg2, f32 arg3);
void f32_matrix_from_rotation_and_scale(Matrix mtx, s32 angle, f32 scale, f32 scaleY);
void s16_vec3_apply_object_rotation(ObjectTransform *trans, s16 *vec3Arg);
void f32_vec3_apply_object_rotation(ObjectTransform *trans, f32 *vec3_f32);
void f32_vec3_apply_object_rotation2(ObjectTransform *trans, f32 *arg1);
+156 -156
View File
File diff suppressed because it is too large Load Diff
+1 -8
View File
@@ -270,14 +270,7 @@ typedef enum TitleDemoIndex {
/* Size: 0x20 bytes */
// So this is looking to be a struct for menu images.
typedef struct MenuAsset {
s16 y_rotation;
s16 x_rotation;
s16 z_rotation;
s16 spriteID;
f32 scale;
f32 x;
f32 y;
f32 z;
ObjectTransform trans;
s16 spriteOffset;
s8 unk1A;
s8 unk1B;
+6 -6
View File
@@ -1788,7 +1788,7 @@ void obj_loop_animator(Object *obj, s32 updateRate) {
}
void obj_init_animation(Object *obj, LevelObjectEntry_Animation *entry, s32 arg2) {
Object_Animation *obj64;
Object *obj64;
s8 tempOrderIndex;
f32 scalef;
@@ -1839,11 +1839,11 @@ void obj_init_animation(Object *obj, LevelObjectEntry_Animation *entry, s32 arg2
(entry->objectIdToSpawn != -1)) {
func_8001F23C(obj, entry);
}
obj64 = &obj->unk64->animation;
if (obj->unk64 != 0) {
obj_init_animcamera(obj, (Object *) obj64);
if (entry->order != 0 || obj64->unk4A != entry->objectIdToSpawn) {
free_object((Object *) obj64);
obj64 = (Object *) &obj->unk64->obj;
if (obj->unk64 != NULL) {
obj_init_animcamera(obj, obj64);
if (entry->order != 0 || obj64->objectID != entry->objectIdToSpawn) {
free_object(obj64);
obj->unk64 = NULL;
}
}
+104 -110
View File
@@ -372,7 +372,7 @@ void racerfx_alloc(s32 numberOfVertices, s32 numberOfTriangles) {
gBoostEffectObjects[i]->properties.common.unk4 = 0;
miscAsset20[i].unk70 = 0;
miscAsset20[i].unk74 = 0.0f;
miscAsset20[i].unk78 = (Sprite *) tex_load_sprite(miscAsset20[i].unk6C, 0);
miscAsset20[i].unk78 = tex_load_sprite(miscAsset20[i].unk6C, 0);
miscAsset20[i].unk7C = load_texture(miscAsset20[i].unk6E);
miscAsset20[i].unk72 = get_random_number_from_range(0, 255);
miscAsset20[i].unk73 = 0;
@@ -387,7 +387,7 @@ void racerfx_alloc(s32 numberOfVertices, s32 numberOfTriangles) {
objEntry.common.x = 0;
objEntry.common.y = 0;
objEntry.common.z = 0;
gShieldEffectObject = spawn_object((LevelObjectEntryCommon *) &objEntry, OBJECT_SPAWN_NONE);
gShieldEffectObject = spawn_object(&objEntry.common, OBJECT_SPAWN_NONE);
for (i = 0; i < NUMBER_OF_CHARACTERS; i++) {
gRacerFXData[i].unk0 = 0;
gRacerFXData[i].unk1 = get_random_number_from_range(0, 255);
@@ -399,7 +399,7 @@ void racerfx_alloc(s32 numberOfVertices, s32 numberOfTriangles) {
objEntry.common.x = 0;
objEntry.common.y = 0;
objEntry.common.z = 0;
gMagnetEffectObject = spawn_object((LevelObjectEntryCommon *) &objEntry, OBJECT_SPAWN_NONE);
gMagnetEffectObject = spawn_object(&objEntry.common, OBJECT_SPAWN_NONE);
}
/**
@@ -445,99 +445,94 @@ void racerfx_free(void) {
#pragma GLOBAL_ASM("asm/nonmatchings/objects/func_8000B38C.s")
#ifdef NON_EQUIVALENT
void func_8000B38C(Vertex *, Triangle *, ObjectTransform *, f32, f32, s16, TextureHeader *arg6);
void func_8000B750(Object *obj, s32 objId, s32 arg2, s32 arg3, s32 arg4) {
Vec3f sp74;
ObjectTransform sp50;
Object_Boost **temp_v0;
Object **var_t2;
f32 temp_f0;
f32 var_f14;
f32 var_f2;
Object_Boost *temp_t4;
Object_Boost *temp_v1;
Object_Boost_Inner *var_v0;
if (objId == -1) {
objId = gBoostObjOverrideID;
void func_8000B750(Object *racerObj, s32 racerIndex, s32 vehicleIDPrev, s32 boostType, s32 arg4) {
f32 sp74[3];
f32 temp_f0;
f32 var_f2;
Object_Boost *boostAsset;
ObjectTransform objTrans;
Object_Boost *objBoostRacer;
Object_Boost *objBoostType;
Object_Boost_Inner *boostData;
if (racerIndex == -1) {
racerIndex = gBoostObjOverrideID;
gBoostObjOverrideID--;
}
if (gBoostObjOverrideID < 0) {
gBoostObjOverrideID = 0;
}
if (objId >= 0 && objId < 10) {
temp_v0 = get_misc_asset(ASSET_MISC_20);
var_t2 = &gBoostEffectObjects[objId];
temp_t4 = &temp_v0[(arg3 << 5)];
temp_v1 = &temp_v0[(objId << 5)];
if (*var_t2 != NULL) {
switch (arg2) {
if (racerIndex >= 0 && racerIndex < NUMBER_OF_CHARACTERS) {
boostAsset = (Object_Boost *) get_misc_asset(ASSET_MISC_20);
objBoostType = &boostAsset[boostType];
objBoostRacer = &boostAsset[racerIndex];
if (gBoostEffectObjects[racerIndex] != NULL) {
switch (vehicleIDPrev) {
default:
var_v0 = &temp_v1->unk48;
if (arg2 != 0xD) {
var_v0 = NULL;
}
boostData = NULL;
break;
case 0:
var_v0 = &temp_v1->unk0;
case VEHICLE_CAR:
boostData = &objBoostRacer->unk0;
break;
case 1:
var_v0 = &temp_v1->unk24;
case VEHICLE_HOVERCRAFT:
boostData = &objBoostRacer->unk24;
break;
case 2:
var_v0 = &temp_v1->unk48;
case VEHICLE_PLANE:
boostData = &objBoostRacer->unk48;
break;
case VEHICLE_ROCKET:
boostData = &objBoostRacer->unk48;
break;
}
if (var_v0 != NULL) {
D_8011B048[objId] = arg2;
D_8011B058[objId] = arg3;
if (temp_v1->unk70 == 2) {
temp_f0 = coss_f(temp_v1->unk72 << 12);
var_f2 = (var_v0->unk14 + (temp_f0 * var_v0->unk18)) * temp_v1->unk74;
var_f14 = (var_v0->unk1C + (temp_f0 * var_v0->unk20)) * temp_v1->unk74;
if ((arg3 & 3) == 1) {
if (boostData != NULL) {
D_8011B048[racerIndex] = vehicleIDPrev;
D_8011B058[racerIndex] = boostType;
if (objBoostRacer->unk70 == 2) {
temp_f0 = coss_f(objBoostRacer->unk72 << 12);
var_f2 = (boostData->unk14 + (temp_f0 * boostData->unk18)) * objBoostRacer->unk74;
temp_f0 = (boostData->unk1C + (temp_f0 * boostData->unk20)) * objBoostRacer->unk74;
if ((boostType & 3) == BOOST_MEDIUM) {
var_f2 *= 1.09f;
var_f14 *= 1.09f;
temp_f0 *= 1.09f;
}
if ((arg3 & 3) >= 2) {
if ((boostType & 3) >= BOOST_LARGE) {
var_f2 *= 1.18f;
var_f14 *= 1.18f;
temp_f0 *= 1.18f;
}
sp50.x_position = var_v0->position.x;
sp50.y_position = var_v0->position.y;
sp50.z_position = var_v0->position.z;
sp50.scale = 1.0f;
sp50.rotation.x_rotation = -0x8000;
sp50.rotation.y_rotation = 0;
sp50.rotation.z_rotation = 0;
objTrans.x_position = boostData->position.x;
objTrans.y_position = boostData->position.y;
objTrans.z_position = boostData->position.z;
objTrans.scale = 1.0f;
objTrans.rotation.y_rotation = -0x8000;
objTrans.rotation.x_rotation = 0;
objTrans.rotation.z_rotation = 0;
func_8000B38C(&gBoostVerts[gBoostVertFlip][D_8011AFFC], &gBoostTris[gBoostVertFlip][D_8011B004],
&sp50, var_f2, var_f14, (temp_v1->unk72), &temp_t4->unk7C);
(*var_t2)->properties.common.unk4 = (objId << 28) | (D_8011AFFC << 14) | D_8011B004;
&objTrans, var_f2, temp_f0, objBoostRacer->unk72 << 12, objBoostType->unk7C);
gBoostEffectObjects[racerIndex]->properties.boost.unk4 =
(racerIndex << 28) | (D_8011AFFC << 14) | D_8011B004;
D_8011AFFC += 9;
D_8011B004 += 8;
}
(*var_t2)->properties.common.unk0 = (s32) obj;
(*var_t2)->segment.trans.x_position = 0.0f;
(*var_t2)->segment.trans.y_position = 0.0f;
(*var_t2)->segment.trans.z_position = 0.0f;
sp74.x = var_v0->position.x;
sp74.y = var_v0->position.y;
sp74.z = var_v0->position.z;
f32_vec3_apply_object_rotation(&obj->segment.trans, &sp74);
gBoostEffectObjects[racerIndex]->properties.boost.obj = racerObj;
gBoostEffectObjects[racerIndex]->segment.trans.x_position = 0.0f;
gBoostEffectObjects[racerIndex]->segment.trans.y_position = 0.0f;
gBoostEffectObjects[racerIndex]->segment.trans.z_position = 0.0f;
sp74[0] = boostData->position.x;
sp74[1] = boostData->position.y;
sp74[2] = boostData->position.z;
f32_vec3_apply_object_rotation(&racerObj->segment.trans, sp74);
ignore_bounds_check();
move_object(var_t2, sp74.x + obj->segment.trans.x_position, sp74.y + obj->segment.trans.y_position,
sp74.z + obj->segment.trans.z_position);
move_object(gBoostEffectObjects[racerIndex], racerObj->segment.trans.x_position + sp74[0],
racerObj->segment.trans.y_position + sp74[1], racerObj->segment.trans.z_position + sp74[2]);
}
if (arg4 != 0) {
D_8011B068[objId] = 0;
if (arg4 != FALSE) {
D_8011B068[racerIndex] = FALSE;
}
}
}
}
#else
#pragma GLOBAL_ASM("asm/nonmatchings/objects/func_8000B750.s")
#endif
/**
* Updates the racer FX object states.
@@ -1600,7 +1595,7 @@ void transform_player_vehicle(void) {
spawnObj.common.z = gTransformPosZ;
spawnObj.unkC = gTransformAngleY;
set_taj_status(TAJ_DIALOGUE);
player = spawn_object((LevelObjectEntryCommon *) &spawnObj, 0x10 | 0x1);
player = spawn_object(&spawnObj.common, 0x10 | 0x1);
gNumRacers = 1;
(*gRacers)[PLAYER_ONE] = player;
gRacersByPort[PLAYER_ONE] = player;
@@ -2194,15 +2189,15 @@ s32 init_object_shadow(Object *obj, ShadowData *shadow) {
obj->shadow = shadow;
shadow->texture = NULL;
objHeader = ((ObjectSegment *) obj)->header;
objHeader = obj->segment.header;
if (objHeader->shadowGroup) {
shadow->texture = load_texture((s32) ((ObjectHeader *) objHeader)->unk34);
objHeader = ((ObjectSegment *) obj)->header;
shadow->texture = load_texture(objHeader->unk34);
objHeader = obj->segment.header;
}
shadow->scale = objHeader->shadowScale;
shadow->meshStart = -1;
D_8011AE50 = shadow->texture;
if (((ObjectSegment *) obj)->header->shadowGroup && shadow->texture == NULL) {
if (obj->segment.header->shadowGroup && shadow->texture == NULL) {
return 0;
}
return sizeof(ShadowData);
@@ -2385,7 +2380,7 @@ void obj_update(s32 updateRate) {
func_800245B4(-1);
gEventStartTimer = gEventCountdown;
if ((gEventCountdown > 0) && (race_starting() != 0)) {
if (gEventCountdown > 0 && race_starting() != FALSE) {
gEventCountdown -= updateRate;
D_8011ADBC = 0;
} else {
@@ -2399,9 +2394,9 @@ void obj_update(s32 updateRate) {
D_8011AD22[D_8011AD21] = 0;
for (j = 0; j < gNumRacers; j++) {
racer = &(*gRacers)[j]->unk64->racer;
racer->prev_x_position = (f32) (*gRacers)[j]->segment.trans.x_position;
racer->prev_y_position = (f32) (*gRacers)[j]->segment.trans.y_position;
racer->prev_z_position = (f32) (*gRacers)[j]->segment.trans.z_position;
racer->prev_x_position = (*gRacers)[j]->segment.trans.x_position;
racer->prev_y_position = (*gRacers)[j]->segment.trans.y_position;
racer->prev_z_position = (*gRacers)[j]->segment.trans.z_position;
}
obj_tick_anims();
process_object_interactions();
@@ -2576,7 +2571,7 @@ void func_80011264(ObjectModel *model, Object *obj) {
if (batch[i].textureIndex != TEX_INDEX_NO_TEXTURE) {
// Fakematch
if (model->textures[batch[i].textureIndex].texture) {}
if ((model->textures[batch[i].textureIndex].texture->numOfTextures) > 0x900) {
if (model->textures[batch[i].textureIndex].texture->numOfTextures > 0x900) {
batch[i].unk7 = remaining;
} else if (current >= 0) {
batch[i].unk7 = current;
@@ -2797,7 +2792,7 @@ void render_misc_model(Object *obj, Vertex *verts, u32 numVertices, Triangle *tr
if (tex != NULL) {
hasTexture = TRUE;
}
material_set(&gObjectCurrDisplayList, (TextureHeader *) tex, flags, texOffset);
material_set(&gObjectCurrDisplayList, tex, flags, texOffset);
gSPVertexDKR(gObjectCurrDisplayList++, OS_K0_TO_PHYSICAL(verts), numVertices, 0);
gSPPolygon(gObjectCurrDisplayList++, OS_K0_TO_PHYSICAL(triangles), numTriangles, hasTexture);
apply_matrix_from_stack(&gObjectCurrDisplayList);
@@ -2853,7 +2848,7 @@ void render_3d_billboard(Object *obj) {
s32 hasEnvCol;
ObjectTransformExt objTrans;
Object *bubbleTrap;
Object_68 *gfxData;
Sprite *gfxData;
intensity = 255;
hasPrimCol = FALSE;
@@ -2930,7 +2925,7 @@ void render_3d_billboard(Object *obj) {
objTrans.animFrame = obj->segment.animFrame;
objTrans.unk1A = 32;
if (bubbleTrap == NULL) {
bubbleTrap = (Object *) obj->unk64->weapon.target;
bubbleTrap = obj->unk64->weapon.target;
if (bubbleTrap == NULL) {
bubbleTrap = obj;
}
@@ -2938,8 +2933,8 @@ void render_3d_billboard(Object *obj) {
render_bubble_trap(&bubbleTrap->segment.trans, gfxData, (Object *) &objTrans,
RENDER_Z_COMPARE | RENDER_SEMI_TRANSPARENT | RENDER_Z_UPDATE);
} else {
render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix, &gObjectCurrVertexList, obj,
(Sprite *) gfxData, flags);
render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix, &gObjectCurrVertexList, obj, gfxData,
flags);
}
if (hasPrimCol) {
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, 255, 255, 255, 255);
@@ -2975,7 +2970,7 @@ void render_3d_model(Object *obj) {
Object_68 *obj68;
Object_Racer *racerObj;
ObjectModel *objModel;
Object_68 *something;
Sprite *something;
obj68 = obj->unk68[obj->segment.object.modelIndex];
if (obj68 != NULL) {
@@ -2995,7 +2990,7 @@ void render_3d_model(Object *obj) {
racerObj = NULL;
}
if (obj68->animUpdateTimer <= 0) {
obj->curVertData = (Vertex *) obj68->vertices[obj68->animationTaskNum];
obj->curVertData = obj68->vertices[obj68->animationTaskNum];
if (obj68->modelType == MODELTYPE_ANIMATED) {
obj_animate(obj);
}
@@ -3008,7 +3003,7 @@ void render_3d_model(Object *obj) {
if (cam_get_viewport_layout() != VIEWPORT_LAYOUT_1_PLAYER) {
flags = FALSE;
}
obj->curVertData = (Vertex *) obj68->vertices[obj68->animationTaskNum];
obj->curVertData = obj68->vertices[obj68->animationTaskNum];
if (obj->behaviorId == BHV_UNK_3F) { // 63 = stopwatchicon, stopwatchhand
obj_shade_fancy(objModel, obj, 0, gCurrentLightIntensity);
} else if (flags) {
@@ -3025,7 +3020,7 @@ void render_3d_model(Object *obj) {
obj68->animUpdateTimer = 1;
}
}
obj->curVertData = (Vertex *) obj68->vertices[obj68->animationTaskNum];
obj->curVertData = obj68->vertices[obj68->animationTaskNum];
if (obj->behaviorId == BHV_DOOR) {
func_80011264(objModel, obj);
}
@@ -3089,7 +3084,7 @@ void render_3d_model(Object *obj) {
obj60_unk0 = 0;
}
for (i = 0; i < obj60_unk0; i++) {
loopObj = ((Object **) obj->unk60)[i + 1];
loopObj = obj->unk60->unk4[i];
if (!(loopObj->segment.trans.flags & OBJ_FLAGS_INVISIBLE)) {
index = obj->unk60->unk2C[i];
if (index >= 0 && index < objModel->unk18) {
@@ -3129,7 +3124,7 @@ void render_3d_model(Object *obj) {
}
loopObj->properties.common.unk0 =
render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix,
&gObjectCurrVertexList, loopObj, (Sprite *) something, flags);
&gObjectCurrVertexList, loopObj, something, flags);
if (var_v0_2) {
gSPSelectMatrixDKR(gObjectCurrDisplayList++, G_MTX_DKR_INDEX_0);
func_80012CE8(&gObjectCurrDisplayList);
@@ -3158,7 +3153,7 @@ void render_3d_model(Object *obj) {
loopObj->segment.trans.z_position += (vtxZ - loopObj->segment.trans.z_position) * 0.25;
if (loopObj->segment.header->modelType == OBJECT_MODEL_TYPE_SPRITE_BILLBOARD) {
render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix, &gObjectCurrVertexList,
loopObj, (Sprite *) something, flags);
loopObj, something, flags);
}
}
}
@@ -3476,7 +3471,7 @@ void func_800135B8(Object *boostObj) {
s32 hasTexture;
s32 idx;
idx = (boostObj->properties.common.unk4 >> 28) & 0xF;
idx = (boostObj->properties.boost.unk4 >> 28) & 0xF;
boost = &boostObj->unk64->boost;
switch (D_8011B048[idx]) {
case 0:
@@ -3491,10 +3486,10 @@ void func_800135B8(Object *boostObj) {
}
asset = (Object_Boost *) get_misc_asset(ASSET_MISC_20);
asset = &asset[D_8011B058[idx]];
object_do_player_tumble((Object *) boostObj->properties.common.unk0);
cam_push_model_mtx(&gObjectCurrDisplayList, &gObjectCurrMatrix,
(ObjectTransform *) boostObj->properties.common.unk0, 1.0f, 0.0f);
object_undo_player_tumble((Object *) boostObj->properties.common.unk0);
object_do_player_tumble(boostObj->properties.boost.obj);
cam_push_model_mtx(&gObjectCurrDisplayList, &gObjectCurrMatrix, &boostObj->properties.boost.obj->segment.trans,
1.0f, 0.0f);
object_undo_player_tumble(boostObj->properties.boost.obj);
objTransform.trans.x_position = boostData->position.x;
objTransform.trans.y_position = boostData->position.y;
objTransform.trans.z_position = boostData->position.z;
@@ -3523,8 +3518,8 @@ void func_800135B8(Object *boostObj) {
hasTexture = FALSE;
}
vtx = &gBoostVerts[gBoostVertFlip][(boostObj->properties.common.unk4 >> 14) & 0x3FFF];
tri = &gBoostTris[gBoostVertFlip][boostObj->properties.common.unk4 & 0x3FFF];
vtx = &gBoostVerts[gBoostVertFlip][(boostObj->properties.boost.unk4 >> 14) & 0x3FFF];
tri = &gBoostTris[gBoostVertFlip][boostObj->properties.boost.unk4 & 0x3FFF];
gSPVertexDKR(gObjectCurrDisplayList++, OS_K0_TO_PHYSICAL(vtx), 9, 0);
gSPPolygon(gObjectCurrDisplayList++, OS_K0_TO_PHYSICAL(tri), 8, hasTexture);
}
@@ -3534,7 +3529,7 @@ void func_800135B8(Object *boostObj) {
/**
* Render the bubble trap weapon.
*/
void render_bubble_trap(ObjectTransform *trans, Object_68 *gfxData, Object *obj, s32 flags) {
void render_bubble_trap(ObjectTransform *trans, Sprite *gfxData, Object *obj, s32 flags) {
f32 x;
f32 y;
f32 z;
@@ -3559,8 +3554,7 @@ void render_bubble_trap(ObjectTransform *trans, Object_68 *gfxData, Object *obj,
obj->segment.trans.x_position += x;
obj->segment.trans.y_position += y;
obj->segment.trans.z_position += z;
render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix, &gObjectCurrVertexList, obj,
(Sprite *) gfxData, flags);
render_sprite_billboard(&gObjectCurrDisplayList, &gObjectCurrMatrix, &gObjectCurrVertexList, obj, gfxData, flags);
}
/**
@@ -3616,7 +3610,7 @@ void render_racer_shield(Gfx **dList, MatrixS **mtx, Vertex **vtxList, Object *o
shear *= scale;
gfxData = gShieldEffectObject->unk68[shieldType];
mdl = gfxData->objModel;
gShieldEffectObject->curVertData = (Vertex *) gfxData->vertices[gfxData->animationTaskNum];
gShieldEffectObject->curVertData = gfxData->vertices[gfxData->animationTaskNum];
gDPSetEnvColor(gObjectCurrDisplayList++, 255, 255, 255, 0);
if (racer->shieldTimer < 64) {
gDPSetPrimColor(gObjectCurrDisplayList++, 0, 0, 255, 255, 255, racer->shieldTimer * 4);
@@ -3680,7 +3674,7 @@ void render_racer_magnet(Gfx **dList, MatrixS **mtx, Vertex **vtxList, Object *o
gMagnetEffectObject->segment.trans.rotation.z_rotation = 0;
gfxData = *gMagnetEffectObject->unk68;
mdl = gfxData->objModel;
gMagnetEffectObject->curVertData = (Vertex *) gfxData->vertices[gfxData->animationTaskNum];
gMagnetEffectObject->curVertData = gfxData->vertices[gfxData->animationTaskNum];
opacity = ((gRacerFXData[racerIndex].unk1 * 8) & 0x7F) + 0x80;
gfx_init_basic_xlu(&gObjectCurrDisplayList, DRAW_BASIC_2CYCLE, COLOUR_RGBA32(255, 255, 255, opacity),
gMagnetColours[racer->magnetModelID]);
@@ -4241,12 +4235,12 @@ void func_80016748(Object *obj0, Object *obj1) {
if (!((objModel->unk3C + 50.0) < sqrtf((xDiff * xDiff) + (yDiff * yDiff) + (zDiff * zDiff)))) {
obj0Interact = obj0->interactObj;
obj1Interact = obj1->interactObj;
object_transform_to_matrix((float (*)[4]) obj1TransformMtx, &obj1->segment.trans);
object_transform_to_matrix((float(*)[4]) obj1TransformMtx, &obj1->segment.trans);
for (i = 0; i < objModel->unk20; i += 2) {
xDiff = obj1->curVertData[objModel->unk1C[i]].x;
yDiff = obj1->curVertData[objModel->unk1C[i]].y;
zDiff = obj1->curVertData[objModel->unk1C[i]].z;
guMtxXFMF((float (*)[4]) obj1TransformMtx, xDiff, yDiff, zDiff, &xDiff, &yDiff, &zDiff);
guMtxXFMF((float(*)[4]) obj1TransformMtx, xDiff, yDiff, zDiff, &xDiff, &yDiff, &zDiff);
temp = (((f32) objModel->unk1C[i + 1] / 64) * obj1->segment.trans.scale) * 50.0;
xDiff -= obj0->segment.trans.x_position;
yDiff -= obj0->segment.trans.y_position;
@@ -4413,7 +4407,7 @@ void func_8001709C(Object *obj) {
sp78.x_position = -obj->segment.trans.x_position;
sp78.y_position = -obj->segment.trans.y_position;
sp78.z_position = -obj->segment.trans.z_position;
object_inverse_transform_to_matrix((float (*)[4]) sp6C, (ObjectTransform *) &sp78);
object_inverse_transform_to_matrix((float(*)[4]) sp6C, &sp78);
inverseScale = 1.0 / obj->segment.trans.scale;
i = 0;
while (i < 16) {
@@ -4432,7 +4426,7 @@ void func_8001709C(Object *obj) {
sp78.x_position = obj->segment.trans.x_position;
sp78.y_position = obj->segment.trans.y_position;
sp78.z_position = obj->segment.trans.z_position;
object_transform_to_matrix(obj5C->_matrices[(obj5C->unk104 + 2) << 1], (ObjectTransform *) &sp78);
object_transform_to_matrix(obj5C->_matrices[(obj5C->unk104 + 2) << 1], &sp78);
obj5C->unk100 = NULL;
}
@@ -5505,7 +5499,7 @@ s32 ainode_find_nearest(f32 diffX, f32 diffY, f32 diffZ, s32 useElevation) {
dist = 50000.0;
result = 0xFF;
for (numSteps = 0; numSteps != AINODE_COUNT; numSteps++) {
segment = (ObjectSegment *) (*gAINodes)[numSteps];
segment = &(*gAINodes)[numSteps]->segment;
if (segment) {
levelObj = &((segment->level_entry)->aiNode);
findDist = TRUE;
@@ -6184,7 +6178,7 @@ void func_8001F23C(Object *obj, LevelObjectEntry_Animation *animEntry) {
NEW_OBJECT_ENTRY(newObjEntry, animEntry->objectIdToSpawn, 8, animEntry->common.x, animEntry->common.y,
animEntry->common.z);
obj->unk64 = (Object_64 *) spawn_object((LevelObjectEntryCommon *) &newObjEntry, 1);
obj->unk64 = (Object_64 *) spawn_object(&newObjEntry, 1);
newObj = (Object *) obj->unk64;
// (newObj->behaviorId == BHV_DINO_WHALE) is Dinosaur1, Dinosaur2, Dinosaur3, Whale, and Dinoisle
if (obj->unk64 != NULL && newObj->behaviorId == BHV_DINO_WHALE && gTimeTrialEnabled) {
@@ -6265,7 +6259,7 @@ void func_80021104(Object *obj, Object_Animation *animObj, LevelObjectEntry_Anim
Camera *camera;
ObjectTransform *animObjTrans;
animObjTrans = (ObjectTransform *) animObj->unk1C;
animObjTrans = &animObj->unk1C->segment.trans;
if (obj->behaviorId == BHV_CAMERA_ANIMATION) {
animObj->unk44 = D_8011AD3E;
D_8011AD3E++;
+2 -2
View File
@@ -463,7 +463,7 @@ void render_3d_misc(Object *obj);
Object *spectate_nearest(Object *obj, s32 *cameraId);
s32 init_object_shadow(Object *obj, ShadowData *shadow);
s32 render_mesh(ObjectModel *objModel, Object *obj, s32 startIndex, s32 flags, s32 someBool);
void render_bubble_trap(ObjectTransform *trans, Object_68 *gfxData, Object *obj, s32 flags);
void render_bubble_trap(ObjectTransform *trans, Sprite *gfxData, Object *obj, s32 flags);
void gParticlePtrList_flush(void);
s32 init_object_shading(Object *obj, ShadeProperties *shadeData);
ObjectHeader *load_object_header(s32 index);
@@ -520,7 +520,7 @@ void decrypt_magic_codes(s32 *data, s32 length);
s32 get_first_active_object(s32 *);
Object *spawn_object(LevelObjectEntryCommon *entry, s32);
s32 func_8001F460(Object*, s32, Object*);
void func_8000B750(Object *obj, s32 objId, s32 arg2, s32 arg3, s32 arg4);
void func_8000B750(Object *racerObj, s32 racerIndex, s32 vehicleIDPrev, s32 boostType, s32 arg4);
void func_80018CE0(Object* obj, f32 xPos, f32 yPos, f32 zPos, s32 updateRate);
s32 func_800185E4(s8, Object* obj, f32 xPos, f32 yPos, f32 zPos, f32* checkpointDistance, u8*);
void func_80011134(Object *, s32);
+43 -38
View File
@@ -8,7 +8,7 @@
/************ .data ************/
s32 D_800E2EF0 = FALSE;
s32 gSprintfSpacingCode = FALSE; // Used to determine if vsprintf should use fixed width mode or not
// Char width is (v - u) + 1
TexFontCoords gDebugFontCoords[3][32] = {
@@ -158,7 +158,7 @@ u16 gDebugTextX;
u16 gDebugTextY;
u16 D_80127CB0;
u16 D_80127CB2;
s32 D_80127CB4;
s32 gDebugFixedWidthMode;
s32 gDebugTextOn;
s32 gDebugBoundsX1;
s32 gDebugBoundsX2;
@@ -189,12 +189,17 @@ char *_itoa(u64 n, char *outBuffer, u32 radix, s32 useUpperCase) {
return buffer;
}
// Official Name: sprintfSetSpacingCodes
void func_800B4A08(s32 setting) {
D_800E2EF0 = setting;
/**
* Used to determine if vsprintf should use fixed width mode or not
* Official Name: sprintfSetSpacingCodes
*/
void sprintfSetSpacingCodes(s32 setting) {
gSprintfSpacingCode = setting;
}
/* Official name: sprintf */
/**
* Official name: sprintf
*/
UNUSED int sprintf(char *s, const char *format, ...) {
s32 ret;
va_list args;
@@ -227,9 +232,9 @@ s32 render_printf(const char *format, ...) {
stubbed_printf("*** diPrintf Error *** ---> Out of string space. (Print less text!)\n");
return -1;
}
func_800B4A08(TRUE);
sprintfSetSpacingCodes(TRUE);
written = vsprintf(gDebugPrintBufferEnd, format, args);
func_800B4A08(FALSE);
sprintfSetSpacingCodes(FALSE);
if (written > 0) {
gDebugPrintBufferEnd = &gDebugPrintBufferEnd[written] + 1;
}
@@ -255,7 +260,7 @@ void debug_text_print(Gfx **dList) {
buffer = (char *) gDebugPrintBufferStart;
debug_text_origin();
gDebugFontTexture = -1;
D_80127CB4 = 0;
gDebugFixedWidthMode = FALSE;
D_80127CB0 = gDebugTextX;
D_80127CB2 = gDebugTextY;
while ((s32) buffer != (s32) gDebugPrintBufferEnd) {
@@ -266,7 +271,7 @@ void debug_text_print(Gfx **dList) {
buffer = (char *) gDebugPrintBufferStart;
debug_text_origin();
gDebugFontTexture = -1;
D_80127CB4 = 0;
gDebugFixedWidthMode = FALSE;
while ((s32) buffer != (s32) gDebugPrintBufferEnd) {
gDebugTextOn = TRUE;
buffer += func_800B653C(dList, buffer);
@@ -318,9 +323,9 @@ UNUSED s32 debug_text_width(const char *format, ...) {
va_start(args, format);
stringLength = 0;
func_800B4A08(TRUE);
sprintfSetSpacingCodes(TRUE);
vsprintf(s, format, args);
func_800B4A08(FALSE);
sprintfSetSpacingCodes(FALSE);
for (ch = (u8 *) &s[0]; *ch != '\0'; ch++) {
pad = *ch;
if (*ch != (0, '\n')) {
@@ -328,18 +333,18 @@ UNUSED s32 debug_text_width(const char *format, ...) {
stringLength += 6;
if (1) {}
} else {
if (*ch < '@') {
if (*ch < 0x40) {
// Character is a symbol or number and not a letter
gDebugFontTexture = 0;
*ch -= '!';
} else if (*ch < '`') {
gDebugFontTexture = ASSET_TEX2D_SMALLFONT_0;
*ch -= 0x21;
} else if (*ch < 0x60) {
// Character is a upper case letter
gDebugFontTexture = 1;
*ch -= '@';
gDebugFontTexture = ASSET_TEX2D_SMALLFONT_1;
*ch -= 0x40;
} else if (*ch <= 0x7F) {
// Character is a lower case letter
gDebugFontTexture = 2;
*ch -= '`';
gDebugFontTexture = ASSET_TEX2D_SMALLFONT_2;
*ch -= 0x60;
}
fontCharU = gDebugFontCoords[gDebugFontTexture][*ch].u;
stringLength = ((stringLength + gDebugFontCoords[gDebugFontTexture][*ch].v) - fontCharU) + (pad = 1);
@@ -350,8 +355,8 @@ UNUSED s32 debug_text_width(const char *format, ...) {
return stringLength;
}
s32 func_800B653C(Gfx **dList, u8 *buffer) {
u8 *bufferCopy;
s32 func_800B653C(Gfx **dList, char *buffer) {
char *bufferCopy;
s32 xOffset;
u8 red;
u8 green;
@@ -365,13 +370,13 @@ s32 func_800B653C(Gfx **dList, u8 *buffer) {
while (bufferValue != NULL) {
xOffset = 0;
switch (bufferValue) {
case 0x83:
D_80127CB4 = 0;
case 0x83: // Leave fixed-width mode
gDebugFixedWidthMode = FALSE;
break;
case 0x84:
D_80127CB4 = 1;
case 0x84: // Enter fixed-width mode
gDebugFixedWidthMode = TRUE;
break;
case 0x81:
case 0x81: // Set the text color from the next 4 bytes
red = buffer[0];
green = buffer[1];
blue = buffer[2];
@@ -381,7 +386,7 @@ s32 func_800B653C(Gfx **dList, u8 *buffer) {
gDPSetEnvColor((*dList)++, red, green, blue, alpha);
}
break;
case 0x85:
case 0x85: // Set the background color from the next 4 bytes
red = buffer[0];
green = buffer[1];
blue = buffer[2];
@@ -391,7 +396,7 @@ s32 func_800B653C(Gfx **dList, u8 *buffer) {
gDPSetPrimColor((*dList)++, 0, 0, red, green, blue, alpha);
}
break;
case 0x82:
case 0x82: // Set debug text position from the next 4 bytes
if (!gDebugTextOn) {
debug_text_background(dList, D_80127CB0, D_80127CB2, gDebugTextX, gDebugTextY + 10);
}
@@ -403,10 +408,10 @@ s32 func_800B653C(Gfx **dList, u8 *buffer) {
D_80127CB2 = gDebugTextY;
buffer += 4;
break;
case 0x20:
case ' ': // Space
xOffset = 6;
break;
case 10:
case '\n': // Line Feed
if (!gDebugTextOn) {
debug_text_background(dList, D_80127CB0, D_80127CB2, gDebugTextX, gDebugTextY + 10);
}
@@ -414,7 +419,7 @@ s32 func_800B653C(Gfx **dList, u8 *buffer) {
D_80127CB0 = gDebugTextX;
D_80127CB2 = gDebugTextY;
break;
case 9:
case '\t': // HT - Horizontal Tab
if (!(gDebugTextX % 32)) {
xOffset = 32;
} else {
@@ -426,7 +431,7 @@ s32 func_800B653C(Gfx **dList, u8 *buffer) {
break;
}
if (D_80127CB4 != 0 && bufferValue >= 32 && bufferValue < 0x80) {
if (gDebugFixedWidthMode && bufferValue >= 0x20 && bufferValue < 0x80) {
xOffset = 7;
}
gDebugTextX += xOffset;
@@ -468,7 +473,7 @@ s32 debug_text_character(Gfx **dList, s32 asciiVal) {
s32 fontCharWidth;
s32 fontCharU;
if (asciiVal < '@') {
if (asciiVal < 0x40) {
// Character is a symbol or number and not a letter
if (gDebugFontTexture != 0) {
if (gDebugTextOn) {
@@ -477,8 +482,8 @@ s32 debug_text_character(Gfx **dList, s32 asciiVal) {
}
gDebugFontTexture = 0;
}
asciiVal -= '!';
} else if (asciiVal < '`') {
asciiVal -= 0x21;
} else if (asciiVal < 0x60) {
// Character is a upper case letter
if (gDebugFontTexture != 1) {
if (gDebugTextOn) {
@@ -487,7 +492,7 @@ s32 debug_text_character(Gfx **dList, s32 asciiVal) {
}
gDebugFontTexture = 1;
}
asciiVal -= '@';
asciiVal -= 0x40;
} else if (asciiVal <= 0x7F) {
// Character is a lower case letter
if (gDebugFontTexture != 2) {
@@ -497,7 +502,7 @@ s32 debug_text_character(Gfx **dList, s32 asciiVal) {
}
gDebugFontTexture = 2;
}
asciiVal -= '`';
asciiVal -= 0x60;
}
fontCharU = gDebugFontCoords[gDebugFontTexture][asciiVal].u;
fontCharWidth = (gDebugFontCoords[gDebugFontTexture][asciiVal].v - fontCharU) + 1;
+2 -4
View File
@@ -44,8 +44,7 @@ typedef struct TexFontCoords {
RENDER_PRINTF_CMD_END
char *_itoa(u64 n, char *outBuffer, u32 radix, s32 useUpperCase);
void func_800B4A08(s32 setting);
void sprintfSetSpacingCodes(s32 setting);
void debug_text_init(void);
void set_render_printf_colour(u8 red, u8 green, u8 blue, u8 alpha);
void set_render_printf_background_colour(u8 red, u8 green, u8 blue, u8 alpha);
@@ -57,8 +56,7 @@ s32 render_printf(const char *format, ...);
void debug_text_bounds(void);
void debug_text_origin(void);
void debug_text_newline(void);
s32 func_800B653C(Gfx**, u8*);
s32 func_800B653C(Gfx**, char*);
int vsprintf(char *s, const char *fmt, ...);
#endif
+10 -10
View File
@@ -161,18 +161,18 @@ void func_8007F1E8(LevelHeader_70 *arg0);
void init_pulsating_light_data(PulsatingLightData *data);
void update_pulsating_light_data(PulsatingLightData *data, s32 timeDelta);
TextureHeader *set_animated_texture_header(TextureHeader *texHead, s32 offset);
TextureHeader *load_texture(s32 arg0); // Non Matching
s32 tex_asset_size(s32 id); // Non Matching
s32 tex_cache_asset_id(s32 cacheID); // Non Matching
TextureHeader *load_texture(s32 arg0);
s32 tex_asset_size(s32 id);
s32 tex_cache_asset_id(s32 cacheID);
s32 load_sprite_info(s32 spriteIndex, s32 *numOfInstancesOut, s32 *unkOut, s32 *numFramesOut, s32 *formatOut,
s32 *sizeOut); // Non Matching
void gfx_init_basic_xlu(Gfx **dList, u32 index, u32 primitiveColor, u32 environmentColor); // Non Matching
void func_8007CA68(s32 spriteID, s32 arg1, s32 *arg2, s32 *arg3, s32 *arg4); // Non Matching
s32 *sizeOut);
void gfx_init_basic_xlu(Gfx **dList, u32 index, u32 primitiveColor, u32 environmentColor);
void func_8007CA68(s32 arg0, s32 arg1, s32 *arg2, s32 *arg3, s32 *arg4);
Sprite *tex_load_sprite(s32 spriteID, s32 arg1);
void tex_init_textures(void); // Non Matching
void tex_init_textures(void);
void material_set_blinking_lights(Gfx **dList, TextureHeader *texture_list, u32 flags,
s32 texture_index); // Non Matching
void material_init(TextureHeader *tex, Gfx *_dList); // Non Matching
void func_8007CDC0(Sprite *sprite1, Sprite *sprite2, s32 arg2); // Non Matching
s32 texture_index);
void material_init(TextureHeader *tex, Gfx *_dList);
void func_8007CDC0(Sprite *sprite1, Sprite *sprite2, s32 arg2);
#endif
+3 -5
View File
@@ -1274,7 +1274,7 @@ void func_800278E8(s32 updateRate) {
}
camera->trans.rotation.z_rotation = 0;
camera->cameraSegmentID = get_level_segment_index_from_position(camera->trans.x_position, currentRacer->oy1,
camera->trans.z_position);
camera->trans.z_position);
D_8011B104 = currentRacer->cameraIndex;
}
}
@@ -1426,10 +1426,8 @@ void func_80028050(void) {
var_a1 = texHeader->width * 16 * gCurrentLevelHeader2->unkA0;
var_a2 = texHeader->height * 16 * gCurrentLevelHeader2->unkA1;
var_v0 =
((s32) (camera->trans.x_position * (var_f14 / var_a1)) + (gCurrentLevelHeader2->unkA8 >> 4)) & uCoordMask;
var_v1 =
((s32) (camera->trans.z_position * (var_f14 / var_a2)) + (gCurrentLevelHeader2->unkAA >> 4)) & vCoordMask;
var_v0 = ((s32) (camera->trans.x_position * (var_f14 / var_a1)) + (gCurrentLevelHeader2->unkA8 >> 4)) & uCoordMask;
var_v1 = ((s32) (camera->trans.z_position * (var_f14 / var_a2)) + (gCurrentLevelHeader2->unkAA >> 4)) & vCoordMask;
var_f14 = var_a1 * xCos;
pos.z = var_a1 * xCos;
+8 -8
View File
@@ -87,14 +87,14 @@ Vertex gRainVertices[16] = {
};
RainPosData gRainSplashSegments[8] = {
{ { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, 0, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
{ { { { { 0, 0, 0 } } }, { 0 }, 1.0f, 0.0f, 0.0f, 0.0f }, 0, 0 },
};
RainGfxData gRainGfx[2] = {
+6 -5
View File
@@ -1683,7 +1683,7 @@ memset = 0x800B4F0C;
// printf.c .text
_itoa = 0x800B4F40;
func_800B4A08 = 0x800B5008;
sprintfSetSpacingCodes = 0x800B5008;
sprintf = 0x800B5014;
vsprintf = 0x800B5040;
debug_text_init = 0x800B6488;
@@ -2523,12 +2523,13 @@ sGameTitleTileTextures = 0x800E1174; // size:0x18
sGameTitleTileOffsets = 0x800E118C; // size:0x60
gTitleCinematicText = 0x800E11EC;
D_800E142C_E202C = 0x800E142C; // new?
gTitleCinematicTextJpn = 0x800E142C;
gTitleCinematicTextColourCount = 0x800E1454;
gTitleCinematicTextColours = 0x800E1458;
unused_800DFA0C = 0x800E146C;
gOptionMenuStrings = 0x800E1470; // size:0x1C
gOptionMenuTextures = 0x800E148C; // size:0x10
gOptionMenuTextures = 0x800E148C; // size:0xC
gOptionMenuImageIndices = 0x800E1498; // size:0x2
gAudioMenuStrings = 0x800E149C; // size:0x80
gMusicTestSongIndex = 0x800E151C;
gSfxVolumeSliderValue = 0x800E1520;
@@ -2863,7 +2864,7 @@ D_800E2EC4 = 0x800E49B4;
gCurrentHovercraftParticleOpacity = 0x800E49DC;
// printf.c .data
D_800E2EF0 = 0x800E49E0;
gSprintfSpacingCode = 0x800E49E0;
gDebugFontCoords = 0x800E49E4;
dDebugFontSettings = 0x800E4AA8;
@@ -4459,7 +4460,7 @@ gDebugTextX = 0x8012975C;
gDebugTextY = 0x8012975E;
D_80127CB0 = 0x80129760;
D_80127CB2 = 0x80129762;
D_80127CB4 = 0x80129764;
gDebugFixedWidthMode = 0x80129764;
gDebugTextOn = 0x80129768;
gDebugBoundsX1 = 0x8012976C;
gDebugBoundsX2 = 0x80129770;

Some files were not shown because too many files have changed in this diff Show More