Sage branded brain blast leads to some new documented bits (#660)

* oops

* yum

* naming

* find homes for these

* Missed a few bits
This commit is contained in:
Fazana
2025-07-03 13:34:36 +01:00
committed by GitHub
parent 7e24105488
commit 116ee8e77e
21 changed files with 477 additions and 454 deletions
+24 -24
View File
@@ -9,7 +9,7 @@ As of July 3, 2025, this is our current score:
    Decomp progress: 96.43%
    Documentation progress: 62.00%
    Documentation progress: 62.43%
<!-- README_SCORE_SUMMARY_END -->
---
@@ -119,28 +119,28 @@ s32 is_drumstick_unlocked(void) {
<!-- README_SCORE_BEGIN -->
As of July 3, 2025, this is our current score:
```
===============================================================
ADVENTURE ONE (ASM -> C Decompilation)
------------ 96.43% Complete (97.13% NON_MATCHING) ------------
# Decompiled functions: 1939
# GLOBAL_ASM remaining: 13
# NON_MATCHING functions: 4
# NON_EQUIVALENT WIP functions: 9
------------------------- Game Status -------------------------
Balloons: 46/47, Keys: 4/4, Trophies: 4/5
T.T. Amulets: 4/4, Wizpig Amulets: 4/4
---------------------------------------------------------------
We are collecting silver coins in Star City. (5/8 silver coins)
===============================================================
ADVENTURE TWO (Cleanup & Documentation)
----------------------- 62.00% Complete -----------------------
# Documented functions: 1221
# Undocumented remaining: 431
------------------------- Game Status -------------------------
Balloons: 30/47, Keys: 3/4, Trophies: 2/5
T.T. Amulets: 3/4, Wizpig Amulets: 2/4
---------------------------------------------------------------
We are racing in the rematch against Bubbler. (Lap 3/3)
===============================================================
======================================================================
ADVENTURE ONE (ASM -> C Decompilation)
--------------- 96.43% Complete (97.13% NON_MATCHING) ----------------
# Decompiled functions: 1939
# GLOBAL_ASM remaining: 13
# NON_MATCHING functions: 4
# NON_EQUIVALENT WIP functions: 9
---------------------------- Game Status -----------------------------
Balloons: 46/47, Keys: 4/4, Trophies: 4/5
T.T. Amulets: 4/4, Wizpig Amulets: 4/4
----------------------------------------------------------------------
We are collecting silver coins in Star City. (5/8 silver coins)
======================================================================
ADVENTURE TWO (Cleanup & Documentation)
-------------------------- 62.43% Complete ---------------------------
# Documented functions: 1228
# Undocumented remaining: 424
---------------------------- Game Status -----------------------------
Balloons: 30/47, Keys: 3/4, Trophies: 2/5
T.T. Amulets: 3/4, Wizpig Amulets: 3/4
----------------------------------------------------------------------
We are participating in the Trophy Race of Sherbet Island. (Round One)
======================================================================
```
<!-- README_SCORE_END -->
+1 -1
View File
@@ -590,7 +590,7 @@ typedef struct LevelObjectEntry_Boost {
// The object map file expects 8 bytes, but the in-game function expects something different?
typedef struct LevelObjectEntry_Boost2 {
/* 0x00 */ LevelObjectEntryCommon common;
/* 0x08 */ s8 unk8[1];
/* 0x08 */ s8 racerIndex;
} LevelObjectEntry_Boost2;
typedef struct LevelObjectEntry_WardenSmoke {
+10 -15
View File
@@ -645,8 +645,8 @@ typedef struct ObjectModel {
/* 0x00 */ TextureInfo *textures;
/* 0x04 */ Vertex *vertices;
/* 0x08 */ Triangle *triangles;
/* 0x0C */ CollisionFacetPlanes *unkC;
/* 0x10 */ f32 *unk10;
/* 0x0C */ CollisionFacetPlanes *collisionFacets;
/* 0x10 */ f32 *collisionPlanes;
/* 0x14 */ s16 *unk14;
/* 0x18 */ s16 unk18;
/* 0x1A */ s16 unk1A;
@@ -656,11 +656,9 @@ typedef struct ObjectModel {
/* 0x24 */ s16 numberOfVertices;
/* 0x26 */ s16 numberOfTriangles;
/* 0x28 */ s16 numberOfBatches;
/* 0x2A */ u8 pad2A[4];
/* 0x2E */ u8 unk2E;
/* 0x2F */ char pad2F[1];
/* 0x2A */ u8 pad2A[6];
/* 0x30 */ s16 references;
/* 0x32 */ s16 unk32;
/* 0x32 */ s16 collisionFacetCount;
/* 0x34 */ u8 pad34[4];
/* 0x38 */ TriangleBatchInfo *batches;
/* 0x3C */ f32 unk3C;
@@ -919,18 +917,15 @@ typedef struct ShadeProperties {
} ShadeProperties;
typedef f32 FakeHalfMatrix[2][4];
typedef struct Object_5C {
typedef struct ObjectCollision {
union {
/* 0x0000 */ MtxF matrices[4];
/* 0x0000 */ FakeHalfMatrix _matrices[8]; // This is a hack. The MtxF[4] is the real one.
};
/* 0x0100 */ void *unk100;
/* 0x0104 */ u8 unk104;
/* 0x0105 */ u8 unk105;
/* 0x0106 */ u8 unk106;
/* 0x0107 */ u8 unk107;
/* 0x0108 */ s32 unk108;
} Object_5C;
/* 0x0100 */ struct Object *collidedObj;
/* 0x0104 */ u8 mtxFlip;
u8 pad[7];
} ObjectCollision;
typedef struct AttachPoint {
s32 count; // Number of active attach points.
@@ -1561,7 +1556,7 @@ typedef struct Object {
/* 0x0050 */ ShadowData *shadow;
/* 0x0054 */ ShadeProperties *shading;
/* 0x0058 */ WaterEffect *waterEffect;
/* 0x005C */ Object_5C *unk5C;
/* 0x005C */ ObjectCollision *collisionData;
/* 0x0060 */ AttachPoint *attachPoints;
/* 0x0064 */ union {
struct Object *animTarget; // BHV_ANIMATION
+1 -1
View File
@@ -737,7 +737,7 @@ void audspat_calculate_echo(SoundHandle soundHandle, f32 x, f32 y, f32 z) {
if (distToSegment < minDist) {
// Check if the point is below the ceiling (indicating it is inside a tunnel).
// This check should ideally be performed only once per call.
numOfYVals = func_8002BAB0(levelSegmentIndex, x, z, yVals);
numOfYVals = collision_get_y(levelSegmentIndex, x, z, yVals);
for (k = 0; k < numOfYVals; k++) {
if (y < yVals[k]) {
minDist = distToSegment;
+1
View File
@@ -145,6 +145,7 @@ void amCreateAudioMgr(ALSynConfig *c, OSPri pri, OSSched *audSched) {
c->params = asset8;
c[1].maxVVoices = 0;
alInit(&__am.g, c);
//!@bug: Forgot to free assetAudioTable
mempool_free(asset8);
} else {
alInit(&__am.g, c);
+2 -2
View File
@@ -28,7 +28,7 @@ typedef enum MempoolFlags {
#define FREE_QUEUE_SIZE 256
#define MEMSLOT_NONE -1
// Animation related?
// Model data. Mesh, collision, animation.
#define COLOUR_TAG_RED 0xFF0000FF
// Model headers
#define COLOUR_TAG_GREEN 0x00FF00FF
@@ -47,7 +47,7 @@ typedef enum MempoolFlags {
#define COLOUR_TAG_GREY 0x7F7F7FFF
// Particles
#define COLOUR_TAG_SEMITRANS_GREY 0x80808080
// Model data
// Model normals
#define COLOUR_TAG_ORANGE 0xFF7F7FFF
// Controller Pak
#define COLOUR_TAG_BLACK 0x000000FF
+13 -13
View File
@@ -629,7 +629,7 @@ void obj_loop_trophycab(Object *obj, s32 updateRate) {
worldBalloons = ((1 << (settings->worldId + 6)) & bossFlags) != 0;
}
if (obj->properties.trophyCabinet.action == NULL && textbox_visible() == FALSE) {
if (obj->unk5C->unk100 != NULL) {
if (obj->collisionData->collidedObj != NULL) {
if (jingle_state->cooldown == 0) {
if (worldBalloons) {
obj->properties.trophyCabinet.action = 1;
@@ -657,7 +657,7 @@ void obj_loop_trophycab(Object *obj, s32 updateRate) {
music_jingle_voicelimit_set(6);
}
}
if (obj->unk5C->unk100 != NULL || textbox_visible()) {
if (obj->collisionData->collidedObj != NULL || textbox_visible()) {
jingle_state->cooldown = 180;
}
if (jingle_state->cooldown > 0) {
@@ -681,7 +681,7 @@ void obj_loop_trophycab(Object *obj, s32 updateRate) {
}
disable_racer_input();
}
obj->unk5C->unk100 = NULL;
obj->collisionData->collidedObj = NULL;
if (worldBalloons) {
obj->shading->ambient = 0.552f;
}
@@ -870,7 +870,7 @@ void obj_loop_rocketsignpost(Object *obj, UNUSED s32 updateRate) {
if (interactObj->distance < 200) {
if (playerObj == interactObj->obj) {
// Detect if the player honks or slams into the signpost.
if ((input_pressed(PLAYER_ONE) & Z_TRIG) || playerObj == obj->unk5C->unk100) {
if ((input_pressed(PLAYER_ONE) & Z_TRIG) || playerObj == obj->collisionData->collidedObj) {
begin_lighthouse_rocket_cutscene();
}
}
@@ -3542,7 +3542,7 @@ void obj_loop_door(Object *doorObj, s32 updateRate) {
racerObj = racerObjInter->obj;
if (racerObj != NULL && racerObj->header->behaviorId == BHV_RACER) {
racer = racerObj->racer;
if (racer->playerIndex != PLAYER_COMPUTER && racerObj == doorObj->unk5C->unk100) {
if (racer->playerIndex != PLAYER_COMPUTER && racerObj == doorObj->collisionData->collidedObj) {
if (door->textID != -1 && textbox_visible() == FALSE && door->jingleCooldown == 0) {
music_fade(-8);
door->jingleTimer = 140; // PAL users once again forsaken.
@@ -3708,7 +3708,7 @@ void obj_loop_door(Object *doorObj, s32 updateRate) {
doorObj->interactObj->obj = NULL;
racerObjInter = doorObj->interactObj;
racerObjInter->flags &= ~INTERACT_FLAGS_PUSHING;
doorObj->unk5C->unk100 = NULL;
doorObj->collisionData->collidedObj = NULL;
}
/**
@@ -3768,7 +3768,7 @@ void obj_loop_ttdoor(Object *obj, s32 updateRate) {
racerObj = obj->interactObj->obj;
if (racerObj != NULL && racerObj->header->behaviorId == BHV_RACER) {
racer = racerObj->racer;
if (racer->playerIndex != PLAYER_COMPUTER && racerObj == obj->unk5C->unk100) {
if (racer->playerIndex != PLAYER_COMPUTER && racerObj == obj->collisionData->collidedObj) {
if (ttDoor->textID != -1 && textbox_visible() == 0 && ttDoor->jingleCooldown == 0) {
music_fade(-8);
ttDoor->jingleTimer = 140;
@@ -3826,7 +3826,7 @@ void obj_loop_ttdoor(Object *obj, s32 updateRate) {
obj->interactObj->distance = 0xFF;
obj->interactObj->obj = NULL;
obj->interactObj->flags &= 0xFFF7;
obj->unk5C->unk100 = NULL;
obj->collisionData->collidedObj = NULL;
}
void obj_init_trigger(Object *obj, LevelObjectEntry_Trigger *entry) {
@@ -5605,9 +5605,9 @@ void obj_loop_log(Object *obj, s32 updateRate) {
} else {
obj->trans.y_position = ((LevelObjectEntryCommon *) obj->level_entry)->y;
}
if (obj->unk5C->unk100 != NULL) {
if (obj->collisionData->collidedObj != NULL) {
obj->properties.log.velocityY++;
racerObj = obj->unk5C->unk100;
racerObj = obj->collisionData->collidedObj;
if (racerObj->behaviorId == BHV_RACER) {
racer = racerObj->racer;
if (racer->velocity < -4.0 && racer->raceFinished == FALSE) {
@@ -5650,7 +5650,7 @@ void obj_loop_log(Object *obj, s32 updateRate) {
}
}
obj->trans.rotation.y_rotation += obj->properties.log.angleVel * updateRate;
obj->unk5C->unk100 = NULL;
obj->collisionData->collidedObj = NULL;
}
/* Official name: weatherInit */
@@ -6268,7 +6268,7 @@ void obj_loop_bubbler(Object *obj, s32 updateRate) {
void obj_init_boost(Object *obj, LevelObjectEntry_Boost2 *entry) {
Object_Boost *asset20 = (Object_Boost *) get_misc_asset(ASSET_MISC_20);
obj->boost = &asset20[entry->unk8[0]];
obj->boost = &asset20[entry->racerIndex];
obj->level_entry = NULL;
}
@@ -6460,7 +6460,7 @@ void obj_loop_frog(Object *obj, s32 updateRate) {
obj->z_velocity = frog->hopTargetZ * cosine;
ignore_bounds_check();
move_object(obj, obj->x_velocity, 0.0f, obj->z_velocity);
if (func_8002BAB0(obj->segmentID, obj->trans.x_position, obj->trans.z_position, colY) != 0) {
if (collision_get_y(obj->segmentID, obj->trans.x_position, obj->trans.z_position, colY) != 0) {
obj->trans.y_position = 0.0f;
ignore_bounds_check();
move_object(obj, 0.0f, (f32) colY[0], 0.0f);
+83 -83
View File
@@ -18,17 +18,6 @@ s32 gRenderSceneFuncLength = 1980;
/*******************************/
/************ .rodata ************/
UNUSED const char D_800E6B20[] = "Error: Model no. out of range on load. !!\n";
UNUSED const char D_800E6B4C[] = "TEXTURE ERROR!!\n%d,%d\n";
UNUSED const char D_800E6B64[] = "Error: Model table overflow!!\n";
UNUSED const char D_800E6B84[] = "WARNING :: createModelInstance called with NULL pointer\n";
UNUSED const char D_800E6BC0[] = "ModFreeModel : NULL mod_inst!!\n";
UNUSED const char D_800E6BE0[] = "MOD Error: Tryed to deallocate non-existent model!!\n";
/*********************************/
/************ .bss ************/
s32 *gObjectModelTable;
@@ -99,7 +88,7 @@ ModelInstance *object_model_init(s32 modelID, s32 flags) {
s32 modelSize;
if (modelID >= gNumModelIDs) {
stubbed_printf(D_800E6B20);
stubbed_printf("Error: Model no. out of range on load. !!\n");
modelID = 0;
}
@@ -159,9 +148,9 @@ ModelInstance *object_model_init(s32 modelID, s32 flags) {
objMdl->unk1C = (s16 *) ((s32) objMdl->unk1C + (u8 *) objMdl);
objMdl->unk4C = (s32 *) ((s32) objMdl->unk4C + (u8 *) objMdl);
objMdl->references = 1;
objMdl->unkC = 0;
objMdl->unk10 = 0;
objMdl->unk32 = 0;
objMdl->collisionFacets = NULL;
objMdl->collisionPlanes = NULL;
objMdl->collisionFacetCount = 0;
objMdl->texOffsetUpdateRate = 0;
objMdl->normals = NULL;
objMdl->numberOfAnimations = 0;
@@ -177,11 +166,11 @@ ModelInstance *object_model_init(s32 modelID, s32 flags) {
for (i = 0; i < objMdl->numberOfBatches; i++) {
if (objMdl->batches[i].textureIndex != 0xFF &&
objMdl->batches[i].textureIndex >= objMdl->numberOfTextures) {
stubbed_printf(D_800E6B4C);
stubbed_printf("TEXTURE ERROR!!\n%d,%d\n", objMdl->batches[i].textureIndex, objMdl->numberOfTextures);
goto block_30;
}
}
if (model_calc_normals(objMdl) == 0 && model_anim_init(objMdl, modelID) == 0) {
if (model_init_normals(objMdl) == 0 && model_anim_init(objMdl, modelID) == 0) {
instance = model_instance_init(objMdl, flags);
if (instance != NULL) {
gModelCache[ASSETCACHE_ID(cacheIndex)] = modelID;
@@ -190,7 +179,7 @@ ModelInstance *object_model_init(s32 modelID, s32 flags) {
instance->animUpdateTimer = 0;
return instance;
} else {
stubbed_printf(D_800E6B64);
stubbed_printf("Error: Model table overflow!!\n");
}
}
}
@@ -213,6 +202,7 @@ block_30:
* Objects that do nothing special get a standard instance assigned,
* otherwise, ones that utilise shading or animation will have their own copies of the vertex data.
* Returns null if it failed.
* Official name: createModelInstance
*/
ModelInstance *model_instance_init(ObjectModel *model, s32 flags) {
s32 temp;
@@ -221,6 +211,10 @@ ModelInstance *model_instance_init(ObjectModel *model, s32 flags) {
Vertex *vertex;
Vertex *mdlVertex;
if (model == NULL) {
stubbed_printf("WARNING :: createModelInstance called with NULL pointer\n");
}
if (model->numberOfAnimations != 0 && (flags & OBJECT_BEHAVIOUR_ANIMATION)) {
temp = ((model->numberOfVertices * 2) * sizeof(Vertex)) + sizeof(ModelInstance);
result = (ModelInstance *) mempool_alloc((model->unk4A * 6) + temp, COLOUR_TAG_BLUE);
@@ -299,6 +293,7 @@ ModelInstance *model_instance_init(ObjectModel *model, s32 flags) {
/**
* Attempts to free the object model from RAM.
* Official name: ModFreeModel
*/
void free_3d_model(ModelInstance *modInst) {
UNUSED s32 pad;
@@ -307,7 +302,7 @@ void free_3d_model(ModelInstance *modInst) {
s32 i;
if (modInst == NULL) {
stubbed_printf(D_800E6BC0);
stubbed_printf("ModFreeModel : NULL mod_inst!!\n");
return;
}
@@ -339,8 +334,13 @@ void free_3d_model(ModelInstance *modInst) {
* Frees all associated meshes, textures and animations from the model.
*/
void free_model_data(ObjectModel *mdl) {
// free the textures
s16 numTextures = mdl->numberOfTextures;
s16 numTextures;
if (mdl == NULL) {
stubbed_printf("MOD Error: Tryed to deallocate non-existent model!!\n");
}
numTextures = mdl->numberOfTextures;
if (numTextures > 0) {
s32 texturesFreed = 0;
s32 textureIndex = 0;
@@ -354,13 +354,13 @@ void free_model_data(ObjectModel *mdl) {
textureIndex++;
} while (texturesFreed < numTextures);
}
// ???
if (mdl->unkC != NULL) {
mempool_free(mdl->unkC);
if (mdl->collisionFacets != NULL) {
mempool_free(mdl->collisionFacets);
}
// ???
if (mdl->unk10 != NULL) {
mempool_free(mdl->unk10);
if (mdl->collisionPlanes != NULL) {
mempool_free(mdl->collisionPlanes);
}
if (mdl->normals != NULL) {
@@ -383,7 +383,7 @@ void free_model_data(ObjectModel *mdl) {
mempool_free(mdl);
}
void func_8006017C(ObjectModel *arg0) {
void model_init_collision(ObjectModel *model) {
s32 facesOffset;
s32 verticesOffset;
s32 nextFacesOffset;
@@ -404,54 +404,54 @@ void func_8006017C(ObjectModel *arg0) {
s32 index;
s32 temp1, temp2;
if (arg0->unkC != NULL) {
if (model->collisionFacets != NULL) {
return;
}
s4 = 0;
for (i = 0; i < arg0->numberOfBatches; i++) {
facesOffset = arg0->batches[i].facesOffset;
nextFacesOffset = arg0->batches[i + 1].facesOffset;
if (arg0->batches[i].flags & RENDER_NO_COLLISION) {
for (i = 0; i < model->numberOfBatches; i++) {
facesOffset = model->batches[i].facesOffset;
nextFacesOffset = model->batches[i + 1].facesOffset;
if (model->batches[i].flags & RENDER_NO_COLLISION) {
continue;
}
s4 += nextFacesOffset - facesOffset;
}
arg0->unkC = (CollisionFacetPlanes *) mempool_alloc(s4 * sizeof(CollisionFacetPlanes), COLOUR_TAG_RED);
model->collisionFacets = (CollisionFacetPlanes *) mempool_alloc(s4 * sizeof(CollisionFacetPlanes), COLOUR_TAG_RED);
if (arg0->unkC == NULL) {
if (model->collisionFacets == NULL) {
return;
}
arg0->unk10 = (f32 *) mempool_alloc(s4 * 64, COLOUR_TAG_RED);
if (arg0->unk10 == NULL) {
mempool_free(arg0->unkC);
arg0->unkC = NULL;
model->collisionPlanes = (f32 *) mempool_alloc(s4 * (sizeof(f32) * 16), COLOUR_TAG_RED);
if (model->collisionPlanes == NULL) {
mempool_free(model->collisionFacets);
model->collisionFacets = NULL;
return;
}
s4 = 0;
for (i = 0; i < arg0->numberOfBatches; i++) {
facesOffset = arg0->batches[i].facesOffset;
verticesOffset = arg0->batches[i].verticesOffset;
nextFacesOffset = arg0->batches[i + 1].facesOffset;
if (arg0->batches[i].flags & RENDER_NO_COLLISION) {
for (i = 0; i < model->numberOfBatches; i++) {
facesOffset = model->batches[i].facesOffset;
verticesOffset = model->batches[i].verticesOffset;
nextFacesOffset = model->batches[i + 1].facesOffset;
if (model->batches[i].flags & RENDER_NO_COLLISION) {
nextFacesOffset = facesOffset - 1;
}
for (j = facesOffset; j < nextFacesOffset; j++) {
v = &arg0->vertices[arg0->triangles[j].vi0 + verticesOffset];
v = &model->vertices[model->triangles[j].vi0 + verticesOffset];
x1 = v->x;
y1 = v->y;
z1 = v->z;
v = &arg0->vertices[arg0->triangles[j].vi1 + verticesOffset];
v = &model->vertices[model->triangles[j].vi1 + verticesOffset];
x2 = v->x;
y2 = v->y;
z2 = v->z;
v = &arg0->vertices[arg0->triangles[j].vi2 + verticesOffset];
v = &model->vertices[model->triangles[j].vi2 + verticesOffset];
x3 = v->x;
y3 = v->y;
z3 = v->z;
@@ -468,38 +468,38 @@ void func_8006017C(ObjectModel *arg0) {
}
temp1 = s4 << 2;
*(arg0->unk10 + temp1 + 0) = nx;
*(arg0->unk10 + temp1 + 1) = ny;
*(arg0->unk10 + temp1 + 2) = nz;
*(arg0->unk10 + temp1 + 3) = -(x1 * nx + y1 * ny + z1 * nz);
*(model->collisionPlanes + temp1 + 0) = nx;
*(model->collisionPlanes + temp1 + 1) = ny;
*(model->collisionPlanes + temp1 + 2) = nz;
*(model->collisionPlanes + temp1 + 3) = -(x1 * nx + y1 * ny + z1 * nz);
arg0->unkC[s4].basePlaneIndex = s4;
arg0->unkC[s4].edgeBisectorPlane[0] = s4;
arg0->unkC[s4].edgeBisectorPlane[1] = s4;
arg0->unkC[s4].edgeBisectorPlane[2] = s4;
model->collisionFacets[s4].basePlaneIndex = s4;
model->collisionFacets[s4].edgeBisectorPlane[0] = s4;
model->collisionFacets[s4].edgeBisectorPlane[1] = s4;
model->collisionFacets[s4].edgeBisectorPlane[2] = s4;
s4++;
}
}
arg0->unk32 = s4;
model->collisionFacetCount = s4;
func_80060910(arg0);
func_80060910(model);
s3 = 0;
for (i = 0; i < arg0->numberOfBatches; i++) {
facesOffset = arg0->batches[i].facesOffset;
verticesOffset = arg0->batches[i].verticesOffset;
nextFacesOffset = arg0->batches[i + 1].facesOffset;
if (arg0->batches[i].flags & RENDER_NO_COLLISION) {
for (i = 0; i < model->numberOfBatches; i++) {
facesOffset = model->batches[i].facesOffset;
verticesOffset = model->batches[i].verticesOffset;
nextFacesOffset = model->batches[i + 1].facesOffset;
if (model->batches[i].flags & RENDER_NO_COLLISION) {
nextFacesOffset = facesOffset - 1;
}
for (j = facesOffset; j < nextFacesOffset; j++, s3++) {
index = arg0->unkC[s3].basePlaneIndex << 2;
nx = *(arg0->unk10 + index + 0);
ny = *(arg0->unk10 + index + 1);
nz = *(arg0->unk10 + index + 2);
index = model->collisionFacets[s3].basePlaneIndex << 2;
nx = *(model->collisionPlanes + index + 0);
ny = *(model->collisionPlanes + index + 1);
nz = *(model->collisionPlanes + index + 2);
for (k = 0; k < 3; k++) {
l = k + 1;
@@ -507,20 +507,20 @@ void func_8006017C(ObjectModel *arg0) {
l = 0;
}
v1 = arg0->triangles[j].verticesArray[1 + k] + verticesOffset;
v2 = arg0->triangles[j].verticesArray[1 + l] + verticesOffset;
v1 = model->triangles[j].verticesArray[1 + k] + verticesOffset;
v2 = model->triangles[j].verticesArray[1 + l] + verticesOffset;
index = arg0->unkC[s3].edgeBisectorPlane[k] << 2;
x5 = nx + *(arg0->unk10 + index + 0);
y5 = ny + *(arg0->unk10 + index + 1);
z5 = nz + *(arg0->unk10 + index + 2);
index = model->collisionFacets[s3].edgeBisectorPlane[k] << 2;
x5 = nx + *(model->collisionPlanes + index + 0);
y5 = ny + *(model->collisionPlanes + index + 1);
z5 = nz + *(model->collisionPlanes + index + 2);
v = &arg0->vertices[v1];
v = &model->vertices[v1];
x1 = v->x;
y1 = v->y;
z1 = v->z;
v = &arg0->vertices[v2];
v = &model->vertices[v2];
x2 = v->x;
y2 = v->y;
z2 = v->z;
@@ -540,13 +540,13 @@ void func_8006017C(ObjectModel *arg0) {
z5 /= mag;
}
arg0->unkC[s3].edgeBisectorPlane[k] = s4;
model->collisionFacets[s3].edgeBisectorPlane[k] = s4;
temp2 = s4 << 2;
*(arg0->unk10 + temp2 + 0) = x5;
*(arg0->unk10 + temp2 + 1) = y5;
*(arg0->unk10 + temp2 + 2) = z5;
*(arg0->unk10 + temp2 + 3) = -(x1 * x5 + y1 * y5 + z1 * z5);
*(model->collisionPlanes + temp2 + 0) = x5;
*(model->collisionPlanes + temp2 + 1) = y5;
*(model->collisionPlanes + temp2 + 2) = z5;
*(model->collisionPlanes + temp2 + 3) = -(x1 * x5 + y1 * y5 + z1 * z5);
s4++;
}
@@ -579,7 +579,7 @@ void func_80060910(ObjectModel *mdl) {
}
for (triIndex = startTri; triIndex < endTri; triIndex++, count++) {
mdl->unkC[count].basePlaneIndex = count;
mdl->collisionFacets[count].basePlaneIndex = count;
for (vertIndex = 0; vertIndex < 3; vertIndex++) {
nextVertIndex = vertIndex + 1;
@@ -592,9 +592,9 @@ void func_80060910(ObjectModel *mdl) {
result = func_80060AC8(mdl, triIndex, vertIndex0, vertIndex1, &sp5C, &sp60);
if (result != -1) {
mdl->unkC[count].edgeBisectorPlane[vertIndex] = result;
mdl->collisionFacets[count].edgeBisectorPlane[vertIndex] = result;
} else {
mdl->unkC[count].edgeBisectorPlane[vertIndex] = count;
mdl->collisionFacets[count].edgeBisectorPlane[vertIndex] = count;
}
}
}
@@ -678,7 +678,7 @@ s32 func_80060C58(Vertex *vertices, s32 i1, s32 i2, s32 i3, s32 i4) {
}
// Returns 0 if successful, or 1 if an error occured.
s32 model_calc_normals(ObjectModel *model) {
s32 model_init_normals(ObjectModel *model) {
Vertex *vertices;
Triangle *triangles;
Vec3f *floatNorms;
+1 -1
View File
@@ -33,6 +33,6 @@ s32 func_80060C58(Vertex *vertices, s32 i1, s32 i2, s32 i3, s32 i4);
void free_model_data(ObjectModel *mdl); // Non Matching
void func_80060910(ObjectModel *);
s32 func_80060AC8(ObjectModel *mdl, s32 arg1, s32 arg2, s32 arg3, s32 *outBatchIndex, s32 *outVertexIndex);
s32 model_calc_normals(ObjectModel *);
s32 model_init_normals(ObjectModel *);
#endif
+114 -99
View File
@@ -36,6 +36,7 @@
#define OBJECT_POOL_SIZE 0x15800
#define OBJECT_BLUEPRINT_SIZE 0x800
#define OBJECT_SLOT_COUNT 512
#define OBJECT_COLLISION_COUNT 20
#define AINODE_COUNT 128
#define CAMCONTROL_COUNT 20
#define BOOST_VERT_COUNT 9
@@ -269,8 +270,8 @@ s32 gObjectCount;
s32 gObjectListStart;
s32 gParticleCount;
Object *gObjectMemoryPool;
Object **D_8011AE6C;
s32 D_8011AE70;
Object **gCollisionObjects;
s32 gCollisionObjectCount;
Object **D_8011AE74; // Pointer to an array of Animation objects
s16 D_8011AE78; // Number of Animation objects in D_8011AE74
s16 gCutsceneID;
@@ -340,12 +341,6 @@ extern s16 gGhostMapID;
/******************************/
typedef struct LevelObjectEntry_unk8000B020 {
LevelObjectEntryCommon common;
s8 unk8;
s8 unk9;
} LevelObjectEntry_unk8000B020;
/**
* Spawns control objects for racer boost visuals, as well as shield and magnet visuals.
* Boost geometry is made in real time, and allocated here.
@@ -353,7 +348,7 @@ typedef struct LevelObjectEntry_unk8000B020 {
*/
void racerfx_alloc(s32 numberOfVertices, s32 numberOfTriangles) {
Object_Boost *boostObj;
LevelObjectEntry_unk8000B020 objEntry;
LevelObjectEntry_Boost2 objEntry;
s32 i;
gBoostTris[0] = (Triangle *) mempool_alloc_safe(
@@ -370,11 +365,11 @@ void racerfx_alloc(s32 numberOfVertices, s32 numberOfTriangles) {
// Makes 10 boost objects, but only 8 racers can actually exist at once.
for (i = 0; i < NUMBER_OF_CHARACTERS; i++) {
objEntry.common.objectID = ASSET_OBJECT_ID_BOOST;
objEntry.common.size = sizeof(LevelObjectEntry_unk8000B020);
objEntry.common.size = sizeof(LevelObjectEntry_Boost2);
objEntry.common.x = 0;
objEntry.common.y = 0;
objEntry.common.z = 0;
objEntry.unk8 = i;
objEntry.racerIndex = i;
gBoostEffectObjects[i] = spawn_object(&objEntry.common, OBJECT_SPAWN_UNK01);
if (gBoostEffectObjects[i] != NULL) {
gBoostEffectObjects[i]->properties.common.unk0 = 0;
@@ -392,7 +387,7 @@ void racerfx_alloc(s32 numberOfVertices, s32 numberOfTriangles) {
}
gBoostObjOverrideID = 9;
objEntry.common.objectID = ASSET_OBJECT_ID_SHIELD;
objEntry.common.size = sizeof(LevelObjectEntry_unk8000B020);
objEntry.common.size = sizeof(LevelObjectEntry_Boost2);
objEntry.common.x = 0;
objEntry.common.y = 0;
objEntry.common.z = 0;
@@ -404,7 +399,7 @@ void racerfx_alloc(s32 numberOfVertices, s32 numberOfTriangles) {
gRacerFXData[i].unk3 = 0;
}
objEntry.common.objectID = ASSET_OBJECT_ID_AINODE;
objEntry.common.size = sizeof(LevelObjectEntry_unk8000B020) + 0x80; // Not sure where this 0x80 comes from.
objEntry.common.size = sizeof(LevelObjectEntry_Boost2) + 0x80; // Not sure where this 0x80 comes from.
objEntry.common.x = 0;
objEntry.common.y = 0;
objEntry.common.z = 0;
@@ -727,7 +722,7 @@ void allocate_object_pools(void) {
set_world_shading(0.67f, 0.33f, 0, -0x2000, 0);
gObjectMemoryPool = (Object *) mempool_new_sub(OBJECT_POOL_SIZE, OBJECT_SLOT_COUNT);
gParticlePtrList = mempool_alloc_safe(sizeof(uintptr_t) * 200, COLOUR_TAG_BLUE);
D_8011AE6C = mempool_alloc_safe(sizeof(uintptr_t) * 20, COLOUR_TAG_BLUE);
gCollisionObjects = mempool_alloc_safe(sizeof(uintptr_t) * OBJECT_COLLISION_COUNT, COLOUR_TAG_BLUE);
D_8011AE74 = mempool_alloc_safe(sizeof(uintptr_t) * 128, COLOUR_TAG_BLUE);
gTrackCheckpoints = mempool_alloc_safe(sizeof(CheckpointNode) * MAX_CHECKPOINTS, COLOUR_TAG_BLUE);
gCameraObjList = mempool_alloc_safe(sizeof(uintptr_t *) * CAMCONTROL_COUNT, COLOUR_TAG_BLUE);
@@ -822,7 +817,7 @@ void clear_object_pointers(void) {
D_8011AD5C = 0;
D_8011AD60 = 0;
gFreeListCount = 0;
D_8011AE70 = 0;
gCollisionObjectCount = 0;
gNumberOfCheckpoints = 0;
D_8011AED4 = 0;
gNumRacers = 0;
@@ -1008,7 +1003,7 @@ void func_8000C8F8(s32 arg0, s32 arg1) {
D_8011AE98[arg1] = &D_8011AE98[arg1][temp_t3 = D_8011AE98[arg1][1] & 0x3F];
}
D_8011AE98[arg1] = (u8 *) (D_8011AEB0[arg1] + 4);
D_8011AE70 = 0;
gCollisionObjectCount = 0;
gNumFinishedRacers = 1;
if (gPathUpdateOff == FALSE) {
gParticlePtrList_flush();
@@ -1670,7 +1665,7 @@ void transform_player_vehicle(void) {
spawnObj.common.z = gTransformPosZ;
spawnObj.unkC = gTransformAngleY;
set_taj_status(TAJ_DIALOGUE);
player = spawn_object(&spawnObj.common, OBJECT_SPAWN_UNK10 | OBJECT_SPAWN_UNK01);
player = spawn_object(&spawnObj.common, OBJECT_SPAWN_NO_LODS | OBJECT_SPAWN_UNK01);
gNumRacers = 1;
(*gRacers)[PLAYER_ONE] = player;
gRacersByPort[PLAYER_ONE] = player;
@@ -1973,7 +1968,7 @@ Object *spawn_object(LevelObjectEntryCommon *entry, s32 spawnFlags) {
objType = curObj->header->modelType;
curObj->modelInstances = (ModelInstance **) &curObj[1];
if (spawnFlags & OBJECT_SPAWN_UNK10) {
if (spawnFlags & OBJECT_SPAWN_NO_LODS) {
assetCount = 1;
}
i = 0; // a2
@@ -2111,8 +2106,8 @@ Object *spawn_object(LevelObjectEntryCommon *entry, s32 spawnFlags) {
if (behaviourFlags & OBJECT_BEHAVIOUR_INTERACTIVE) {
address += init_object_interaction_data(curObj, (ObjectInteraction *) address);
}
if (behaviourFlags & OBJECT_BEHAVIOUR_UNK20) {
address += func_8000FD34(curObj, (Object_5C *) address);
if (behaviourFlags & OBJECT_BEHAVIOUR_COLLIDABLE) {
address += obj_init_collision(curObj, (ObjectCollision *) address);
}
if (curObj->header->attachPointCount > 0 && curObj->header->attachPointCount < 10) {
curObj->attachPoints = (AttachPoint *) address;
@@ -2173,8 +2168,9 @@ Object *spawn_object(LevelObjectEntryCommon *entry, s32 spawnFlags) {
curObj->interactObj = (ObjectInteraction *) (((uintptr_t) curObj + (uintptr_t) curObj->interactObj) -
(uintptr_t) gSpawnObjectHeap);
}
if (curObj->unk5C != NULL) {
curObj->unk5C = (Object_5C *) (((uintptr_t) curObj + (uintptr_t) curObj->unk5C) - (uintptr_t) gSpawnObjectHeap);
if (curObj->collisionData != NULL) {
curObj->collisionData = (ObjectCollision *) (((uintptr_t) curObj + (uintptr_t) curObj->collisionData) -
(uintptr_t) gSpawnObjectHeap);
}
if (curObj->attachPoints != NULL) {
curObj->attachPoints =
@@ -2402,11 +2398,13 @@ s32 init_object_interaction_data(Object *obj, ObjectInteraction *interactObj) {
return sizeof(ObjectInteraction);
}
// Inits some matrix stuff for objects. It seems to be precomputing something, but not sure what.
s32 func_8000FD34(Object *obj, Object_5C *matrices) {
obj->unk5C = matrices;
/**
* Sets up collision surface data for the object model.
*/
s32 obj_init_collision(Object *obj, ObjectCollision *colData) {
obj->collisionData = colData;
func_80016BC4(obj);
return sizeof(Object_5C);
return sizeof(ObjectCollision);
}
/**
@@ -2816,13 +2814,15 @@ void obj_update(s32 updateRate) {
obj_tick_anims();
process_object_interactions();
func_8001E89C();
for (i = 0; i < D_8011AE70; i++) {
run_object_loop_func(D_8011AE6C[i], updateRate);
// Update collidable objects first.
for (i = 0; i < gCollisionObjectCount; i++) {
run_object_loop_func(gCollisionObjects[i], updateRate);
}
func_8001E6EC(1);
for (i = 0; i < D_8011AE70; i++) {
func_8001709C(D_8011AE6C[i]);
func_8001E6EC(TRUE);
for (i = 0; i < gCollisionObjectCount; i++) {
obj_collision_transform(gCollisionObjects[i]);
}
// Update nonspecific objects
j = gObjectCount;
for (i = gObjectListStart; i < j; i++) {
obj = gObjPtrList[i];
@@ -2850,6 +2850,7 @@ void obj_update(s32 updateRate) {
}
}
}
// Update racers
for (i = 0; i < gNumRacers; i++) {
update_player_racer((*gRacers)[i], updateRate);
}
@@ -2870,16 +2871,17 @@ void obj_update(s32 updateRate) {
run_object_loop_func(obj, updateRate);
}
}
// Update particles
if (gParticleCount > 0) {
for (i = gObjectListStart; i < j; i++) {
obj = gObjPtrList[i];
if (obj->trans.flags & OBJ_FLAGS_PARTICLE) {
// Why is this object being treated as a Particle?
particle_update((Particle *) obj, updateRate);
}
}
}
// Update lights
lightUpdateLights(updateRate);
if (get_light_count() > 0) {
for (i = gObjectListStart; i < gObjectCount; i++) {
@@ -2889,8 +2891,8 @@ void obj_update(s32 updateRate) {
}
}
}
func_8001E6EC(0);
if (gTajRaceInit != 0) {
func_8001E6EC(FALSE);
if (gTajRaceInit) {
mode_init_taj_race();
}
if (gPathUpdateOff == FALSE) {
@@ -3171,7 +3173,7 @@ s32 move_object(Object *obj, f32 xPos, f32 yPos, f32 zPos) {
obj->trans.x_position = newXPos;
obj->trans.y_position = newYPos;
obj->trans.z_position = newZPos;
box = get_segment_bounding_box(obj->segmentID);
box = block_boundbox(obj->segmentID);
// For some reason the XYZ positions are converted into integers for the next section
intXPos = newXPos, intYPos = newYPos, intZPos = newZPos;
@@ -4557,14 +4559,14 @@ void process_object_interactions(void) {
}
}
D_8011AE70 = 0;
gCollisionObjectCount = 0;
for (i = 0; i < objsWithInteractives; i++) {
obj = objList[i];
objInteract = obj->interactObj;
if (objInteract->unk11 == 2 && D_8011AE70 < 20) {
D_8011AE6C[D_8011AE70] = obj;
D_8011AE70++;
if (objInteract->unk11 == 2 && gCollisionObjectCount < 20) {
gCollisionObjects[gCollisionObjectCount] = obj;
gCollisionObjectCount++;
}
if (objInteract->flags & INTERACT_FLAGS_UNK_0004) {
for (j = 0; j < objsWithInteractives; j++) {
@@ -5007,12 +5009,12 @@ void func_80016748(Object *obj0, Object *obj1) {
void func_80016BC4(Object *obj) {
s32 i;
obj->unk5C->unk104 = 0;
func_8001709C(obj);
func_8001709C(obj);
obj->collisionData->mtxFlip = 0;
obj_collision_transform(obj);
obj_collision_transform(obj); // Not sure why they do this a second time.
for (i = 0; i < obj->header->numberOfModelIds; i++) {
if (obj->modelInstances[i] != NULL) {
func_8006017C(obj->modelInstances[i]->objModel);
model_init_collision(obj->modelInstances[i]->objModel);
}
}
}
@@ -5106,45 +5108,58 @@ s32 obj_dist_racer(f32 x, f32 y, f32 z, f32 radius, s32 is2dCheck, Object **sort
return result;
}
void func_8001709C(Object *obj) {
ObjectTransform sp78;
/**
* Updates the object's collision transformation matrices.
*/
void obj_collision_transform(Object *obj) {
ObjectTransform trans;
s32 i;
f32 inverseScale;
MtxF *sp6C;
MtxF sp2C;
Object_5C *obj5C;
MtxF *curMtx;
MtxF inverseMtx;
ObjectCollision *colData;
obj5C = obj->unk5C;
obj5C->unk104 = (obj5C->unk104 + 1) & 1;
sp6C = (MtxF *) &obj5C->_matrices[obj5C->unk104 << 1];
sp78.rotation.y_rotation = -obj->trans.rotation.y_rotation;
sp78.rotation.x_rotation = -obj->trans.rotation.x_rotation;
sp78.rotation.z_rotation = -obj->trans.rotation.z_rotation;
sp78.scale = 1.0f;
sp78.x_position = -obj->trans.x_position;
sp78.y_position = -obj->trans.y_position;
sp78.z_position = -obj->trans.z_position;
mtxf_from_inverse_transform(sp6C, &sp78);
colData = obj->collisionData;
colData->mtxFlip = (colData->mtxFlip + 1) & 1;
#ifdef AVOID_UB
curMtx = &colData->matrices[colData->mtxFlip];
#else
curMtx = (MtxF *) &colData->_matrices[colData->mtxFlip << 1];
#endif
trans.rotation.y_rotation = -obj->trans.rotation.y_rotation;
trans.rotation.x_rotation = -obj->trans.rotation.x_rotation;
trans.rotation.z_rotation = -obj->trans.rotation.z_rotation;
trans.scale = 1.0f;
trans.x_position = -obj->trans.x_position;
trans.y_position = -obj->trans.y_position;
trans.z_position = -obj->trans.z_position;
mtxf_from_inverse_transform(curMtx, &trans);
inverseScale = 1.0 / obj->trans.scale;
i = 0;
// Zero out the matrix.
while (i < 16) {
((f32 *) sp2C)[i] = 0.0f;
((f32 *) inverseMtx)[i] = 0.0f;
i++;
}
sp2C[0][0] = inverseScale;
sp2C[1][1] = inverseScale;
sp2C[2][2] = inverseScale;
sp2C[3][3] = 1.0f;
mtxf_mul(sp6C, &sp2C, sp6C);
sp78.rotation.y_rotation = obj->trans.rotation.y_rotation;
sp78.rotation.x_rotation = obj->trans.rotation.x_rotation;
sp78.rotation.z_rotation = obj->trans.rotation.z_rotation;
sp78.scale = 1.0 / inverseScale;
sp78.x_position = obj->trans.x_position;
sp78.y_position = obj->trans.y_position;
sp78.z_position = obj->trans.z_position;
mtxf_from_transform((MtxF *) obj5C->_matrices[(obj5C->unk104 + 2) << 1], &sp78);
obj5C->unk100 = NULL;
inverseMtx[0][0] = inverseScale;
inverseMtx[1][1] = inverseScale;
inverseMtx[2][2] = inverseScale;
inverseMtx[3][3] = 1.0f;
mtxf_mul(curMtx, &inverseMtx, curMtx);
trans.rotation.y_rotation = obj->trans.rotation.y_rotation;
trans.rotation.x_rotation = obj->trans.rotation.x_rotation;
trans.rotation.z_rotation = obj->trans.rotation.z_rotation;
trans.scale = 1.0 / inverseScale;
trans.x_position = obj->trans.x_position;
trans.y_position = obj->trans.y_position;
trans.z_position = obj->trans.z_position;
#ifdef AVOID_UB
mtxf_from_transform(colData->matrices[(colData->mtxFlip + 2)], &trans);
#else
mtxf_from_transform((MtxF *) colData->_matrices[(colData->mtxFlip + 2) << 1], &trans);
#endif
colData->collidedObj = NULL;
}
// https://decomp.me/scratch/Lxwa8
@@ -5171,8 +5186,8 @@ s32 func_80017248(Object *obj, s32 arg1, s32 *arg2, Vec3f *arg3, f32 *arg4, f32
Object *temp_a1;
Object *temp_v0;
ObjectInteraction *temp_v1;
Object_5C *temp_v0_2;
Object_5C *temp_v0_5;
ObjectCollision *temp_v0_2;
ObjectCollision *temp_v0_5;
Vec3f *var_s0_2;
f32 temp_f0;
f32 temp_f0_2;
@@ -5220,10 +5235,10 @@ s32 func_80017248(Object *obj, s32 arg1, s32 *arg2, Vec3f *arg3, f32 *arg4, f32
sp160 = 0;
sp170 = 0;
if (D_8011AE70 > 0) {
if (gCollisionObjectCount > 0) {
var_s2 = 0;
do {
temp_v0 = *(D_8011AE6C + var_s2);
temp_v0 = *(gCollisionObjects + var_s2);
objModel = temp_v0->modelInstances[temp_v0->modelIndex]->objModel;
temp_f14 = temp_v0->trans.x_position - obj->trans.x_position;
temp_f0 = temp_v0->trans.y_position - obj->trans.y_position;
@@ -5276,7 +5291,7 @@ s32 func_80017248(Object *obj, s32 arg1, s32 *arg2, Vec3f *arg3, f32 *arg4, f32
}
temp_t2 = sp170 + 1;
sp170 = temp_t2;
} while (temp_t2 < D_8011AE70);
} while (temp_t2 < gCollisionObjectCount);
sp170 = 0;
}
var_a3 = 0;
@@ -5284,13 +5299,13 @@ s32 func_80017248(Object *obj, s32 arg1, s32 *arg2, Vec3f *arg3, f32 *arg4, f32
sp88 = &spB4[0];
sp168 = 0;
do {
temp_a1 = D_8011AE6C[*sp88];
temp_a1 = gCollisionObjects[*sp88];
var_s1 = 0;
objModel = temp_a1->modelInstances[temp_a1->modelIndex]->objModel;
temp_v0_2 = temp_a1->unk5C;
temp_v0_2 = temp_a1->collisionData;
var_fp_2 = 0;
sp16C = 1;
spDC = &temp_a1->unk5C->matrices[(((temp_a1->unk5C->unk104 + 1) & 1) << 6)];
spDC = &temp_a1->collisionData->matrices[(((temp_a1->collisionData->mtxFlip + 1) & 1) << 6)];
otherObj = temp_a1;
temp_v0_3 = func_8001790C((u32 *) obj, (u32 *) temp_a1);
var_t0 = 1;
@@ -5366,14 +5381,14 @@ s32 func_80017248(Object *obj, s32 arg1, s32 *arg2, Vec3f *arg3, f32 *arg4, f32
(f32) (1.0 / (f64) otherObj->trans.scale));
var_t0_2 = sp16C;
if (temp_v0_4 != 0) {
otherObj->unk5C->unk100 = obj;
otherObj->collisionData->collidedObj = obj;
}
var_fp_3 = 0;
if (*D_8011AD24 == 0) {
sp14C = func_80017978((s32) obj, (s32) otherObj);
}
temp_v0_5 = otherObj->unk5C;
spDC = &temp_a1->unk5C->matrices[(temp_a1->unk5C->unk104 + 2) << 6];
temp_v0_5 = otherObj->collisionData;
spDC = &temp_a1->collisionData->matrices[(temp_a1->collisionData->mtxFlip + 2) << 6];
if (arg1 > 0) {
do {
if (sp14C != NULL) {
@@ -5505,7 +5520,7 @@ s32 func_80017A18(ObjectModel *arg0, s32 arg1, s32 *arg2, f32 *arg3, f32 *arg4,
s32 pad1;
spF8 = 0;
temp_t0 = arg0->unk10;
temp_t0 = arg0->collisionPlanes;
var_s6 = 1;
for (i = 0; i < arg1; i++) {
spBC = arg6[i];
@@ -5518,8 +5533,8 @@ s32 func_80017A18(ObjectModel *arg0, s32 arg1, s32 *arg2, f32 *arg3, f32 *arg4,
var_t4 = 0;
do {
redoLoop = FALSE;
for (j = 0; j < arg0->unk32; j++) {
temp_v0 = &temp_t0[arg0->unkC[j].basePlaneIndex];
for (j = 0; j < arg0->collisionFacetCount; j++) {
temp_v0 = &temp_t0[arg0->collisionFacets[j].basePlaneIndex];
temp_f26 = temp_v0[1];
sp74 = temp_v0[0];
temp_f12 = temp_v0[2];
@@ -5544,7 +5559,7 @@ s32 func_80017A18(ObjectModel *arg0, s32 arg1, s32 *arg2, f32 *arg3, f32 *arg4,
}
for (k = 0; (k < 3) && (var_a2 == 1); k++) {
temp_v0 = &temp_t0[arg0->unkC->edgeBisectorPlane[k]];
temp_v0 = &temp_t0[arg0->collisionFacets->edgeBisectorPlane[k]];
if (((temp_v0[0] * (((spBC - sp60) * var_f2) + spA4)) +
(temp_v0[1] * (((var_f30 - sp64) * var_f2) + spA0)) +
(temp_v0[2] * (((spB4 - sp68) * var_f2) + sp9C)) + temp_v0[3]) > 4.0f) {
@@ -5572,7 +5587,7 @@ s32 func_80017A18(ObjectModel *arg0, s32 arg1, s32 *arg2, f32 *arg3, f32 *arg4,
arg6[i] = spBC;
arg7[i] = var_f30;
arg8[i] = spB4;
j = arg0->unk32;
j = arg0->collisionFacetCount;
}
}
}
@@ -8465,7 +8480,7 @@ void func_8001E6EC(s8 arg0) {
(j < D_8011AE78) && (overridePosEntry->behaviorId != D_8011AE74[j]->properties.animation.behaviourID);
j++) {}
if (j != D_8011AE78 && D_8011AE74[j]->animTarget != NULL) {
someBool = (D_8011AE74[j]->animTarget->unk5C != NULL) ? FALSE : TRUE;
someBool = (D_8011AE74[j]->animTarget->collisionData != NULL) ? FALSE : TRUE;
if (arg0 != someBool) {
animTarget = D_8011AE74[j]->animTarget;
overridePos->x = animTarget->trans.x_position;
@@ -9880,7 +9895,7 @@ void mode_init_taj_race(void) {
lvlSeg =
get_level_segment_index_from_position(newRacerEntry.common.x, checkpointNode->y, newRacerEntry.common.z);
newRacerEntry.common.y =
func_8002BAB0(lvlSeg, newRacerEntry.common.x, newRacerEntry.common.z, yOut) ? yOut[0] : checkpointNode->y;
collision_get_y(lvlSeg, newRacerEntry.common.x, newRacerEntry.common.z, yOut) ? yOut[0] : checkpointNode->y;
newRacerEntry.common.size = 16;
newRacerEntry.angleY = racer->steerVisualRotation;
newRacerEntry.angleX = 0;
@@ -10049,7 +10064,7 @@ CheckpointNode *func_800230D0(Object *obj, Object_Racer *racer) {
obj->segmentID =
get_level_segment_index_from_position(obj->trans.x_position, obj->trans.y_position, obj->trans.z_position);
}
yOutCount = func_8002BAB0(obj->segmentID, obj->trans.x_position, obj->trans.z_position, yOut);
yOutCount = collision_get_y(obj->segmentID, obj->trans.x_position, obj->trans.z_position, yOut);
if (yOutCount != 0) {
obj->trans.y_position = yOut[yOutCount - 1];
}
@@ -10593,7 +10608,7 @@ s32 obj_init_property_flags(s32 behaviorId) {
break;
case BHV_DOOR:
case BHV_TT_DOOR:
flags = OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_UNK20;
flags = OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_COLLIDABLE;
break;
case BHV_WEAPON_BALLOON:
case BHV_GOLDEN_BALLOON:
@@ -10604,14 +10619,14 @@ s32 obj_init_property_flags(s32 behaviorId) {
case BHV_SNOWBALL:
case BHV_SNOWBALL_2:
flags = OBJECT_BEHAVIOUR_SHADED | OBJECT_BEHAVIOUR_SHADOW | OBJECT_BEHAVIOUR_ANIMATION |
OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_UNK20;
OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_COLLIDABLE;
break;
case BHV_SNOWBALL_3:
case BHV_SNOWBALL_4:
case BHV_HIT_TESTER_3:
case BHV_HIT_TESTER_4:
flags = OBJECT_BEHAVIOUR_SHADOW | OBJECT_BEHAVIOUR_ANIMATION | OBJECT_BEHAVIOUR_INTERACTIVE |
OBJECT_BEHAVIOUR_UNK20;
OBJECT_BEHAVIOUR_COLLIDABLE;
break;
case BHV_UNK_18:
flags = OBJECT_BEHAVIOUR_WATER_EFFECT;
@@ -10627,11 +10642,11 @@ s32 obj_init_property_flags(s32 behaviorId) {
flags = OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_SHADOW;
break;
case BHV_LOG:
flags = OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_UNK20;
flags = OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_COLLIDABLE;
break;
case BHV_BRIDGE_WHALE_RAMP:
flags = OBJECT_BEHAVIOUR_SHADED | OBJECT_BEHAVIOUR_ANIMATION | OBJECT_BEHAVIOUR_INTERACTIVE |
OBJECT_BEHAVIOUR_UNK20;
OBJECT_BEHAVIOUR_COLLIDABLE;
break;
case BHV_RAMP_SWITCH:
flags = OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_SHADOW;
@@ -10663,7 +10678,7 @@ s32 obj_init_property_flags(s32 behaviorId) {
case BHV_DYNAMIC_LIGHT_OBJECT_2:
case BHV_ROCKET_SIGNPOST:
case BHV_ROCKET_SIGNPOST_2:
flags = OBJECT_BEHAVIOUR_SHADED | OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_UNK20;
flags = OBJECT_BEHAVIOUR_SHADED | OBJECT_BEHAVIOUR_INTERACTIVE | OBJECT_BEHAVIOUR_COLLIDABLE;
break;
case BHV_UNK_5B:
flags = OBJECT_BEHAVIOUR_SHADED;
+5 -5
View File
@@ -178,7 +178,7 @@ enum ObjectSpawnFlags {
OBJECT_SPAWN_UNK02 = (1 << 1),
OBJECT_SPAWN_UNK04 = (1 << 2),
OBJECT_SPAWN_UNK08 = (1 << 3),
OBJECT_SPAWN_UNK10 = (1 << 4)
OBJECT_SPAWN_NO_LODS = (1 << 4) // Forces the object to have 1 model associate. Used to prevent LoD models of player model racers spawning.
};
enum ObjectHeaderFlags {
@@ -199,7 +199,7 @@ enum ObjectBehaviourFlags {
OBJECT_BEHAVIOUR_WATER_EFFECT = (1 << 2),
OBJECT_BEHAVIOUR_ANIMATION = (1 << 3),
OBJECT_BEHAVIOUR_INTERACTIVE = (1 << 4),
OBJECT_BEHAVIOUR_UNK20 = (1 << 5)
OBJECT_BEHAVIOUR_COLLIDABLE = (1 << 5)
};
enum ContPakErrors {
@@ -413,10 +413,10 @@ void func_80016BC4(Object *obj);
s32 ainode_register(Object *obj);
void obj_taj_create_balloon(s32 blockID, f32 x, f32 y, f32 z);
Object *func_8001B7A8(Object_Racer *racer, s32 position, f32 *distance);
s32 func_8000FD34(Object *obj, Object_5C *matrices);
s32 obj_init_collision(Object *obj, ObjectCollision *colData);
void func_8000E4E8(s32 index);
void objFreeAssets(Object *obj, s32 count, s32 objType);
void func_8001709C(Object *obj);
void obj_collision_transform(Object *obj);
s32 play_footstep_sounds(Object *obj, s32 arg1, s32 frame, s32 oddSoundId, s32 evenSoundId);
void render_3d_misc(Object *obj);
Object *spectate_nearest(Object *obj, s32 *cameraId);
@@ -491,7 +491,7 @@ void func_80018CE0(Object *racerObj, f32 xPos, f32 yPos, f32 zPos, s32 updateRat
s32 func_800185E4(s32 checkpointIndex, Object *obj, f32 objX, f32 objY, f32 objZ, f32 *arg5, u8 *arg6);
void obj_tex_animate(Object *, s32);
Object *find_furthest_telepoint(f32 x, f32 z);
void func_8006017C(ObjectModel *);
void model_init_collision(ObjectModel *);
void set_temp_model_transforms(Object *);
void func_800101AC(Object *, s32);
void func_800135B8(Object *);
+1 -1
View File
@@ -1922,7 +1922,7 @@ void particle_update(Particle *particle, s32 updateRate) {
}
}
boundingBox = get_segment_bounding_box(particle->segmentID);
boundingBox = block_boundbox(particle->segmentID);
if (boundingBox != NULL) {
if (particle->trans.x_position < boundingBox->x1 || boundingBox->x2 < particle->trans.x_position ||
particle->trans.y_position < boundingBox->y1 || boundingBox->y2 < particle->trans.y_position ||
+11 -14
View File
@@ -337,20 +337,6 @@ Gfx dBasicRenderModes[][2] = {
/*******************************/
/************ .rodata ************/
const char D_800E7B30[] = "Error: Texture no %x out of range on load. !!\n";
const char D_800E7B60[] = "TEX Error: Palette memory overflow!!\n";
const char D_800E7B88[] = "TEX Error: TexTab overflow!!\n";
const char D_800E7BA8[] = "texFreeTexture: NULL tex!!\n";
const char D_800E7BC4[] = "TEX Error: Tryed to deallocate non-existent texture!!\n";
const char D_800E7BFC[] = "SRPBUF overflow!!\n";
const char D_800E7C10[] = "Error: Sprite table overflow!!\n";
const char D_800E7C30[] = "texFreeSprite: NULL sprite!!\n";
const char D_800E7C50[] = "TEXSPR Error: Tryed to deallocate non-existent sprite!!\n";
/*********************************/
/************ .bss ************/
s32 *gTextureAssetTable[2];
@@ -493,6 +479,7 @@ TextureHeader *load_texture(s32 id) {
// If the index is out of bounds, fall back to texture 0. Returning NULL would be better.
if (assetIndex >= gTextureTableSize[tableType] || assetIndex < 0) {
stubbed_printf("Error: Texture no %x out of range on load. !!\n", assetIndex);
id = 0;
}
@@ -584,9 +571,11 @@ TextureHeader *load_texture(s32 id) {
texTemp = (TextureHeader *) ((s32) texTemp + texTemp->textureSize);
}
if (gCiPalettesSize >= MAX_TEX_PALETTE_SIZE) {
stubbed_printf("TEX Error: Palette memory overflow!!\n");
return NULL;
}
if (gNumberOfLoadedTextures > MAX_NUM_TEXTURES) {
stubbed_printf("TEX Error: TexTab overflow!!\n");
return NULL;
}
return tex;
@@ -611,7 +600,10 @@ void tex_free(TextureHeader *tex) {
return;
}
}
stubbed_printf("texFreeTexture: NULL tex!!\n");
}
} else {
stubbed_printf("TEX Error: Tryed to deallocate non-existent texture!!\n");
}
}
@@ -979,6 +971,7 @@ Sprite *tex_load_sprite(s32 spriteID, s32 arg1) {
if (cacheNum == -1) {
cacheFull = TRUE;
stubbed_printf("SRPBUF overflow!!\n");
cacheNum = gSpriteCacheCount;
gSpriteCacheCount++;
}
@@ -1047,6 +1040,7 @@ Sprite *tex_load_sprite(s32 spriteID, s32 arg1) {
}
if (gSpriteCacheCount >= MAX_NUM_SPRITES) {
stubbed_printf("Error: Sprite table overflow!!\n");
return NULL;
}
@@ -1293,7 +1287,10 @@ void sprite_free(Sprite *sprite) {
break;
}
}
stubbed_printf("texFreeSprite: NULL sprite!!\n");
}
} else {
stubbed_printf("TEXSPR Error: Tryed to deallocate non-existent sprite!!\n");
}
}
+98 -83
View File
@@ -93,9 +93,9 @@ s32 gHitWall;
s32 gCollisionMode;
s32 D_8011B0F8; // gIsInCutscene?
s32 gAntiAliasing;
s32 D_8011B100;
s32 D_8011B104;
s32 D_8011B108;
s32 gTTCamPlayerID;
s32 gTTCamID;
s32 gTTCamSmoothTimer;
s32 D_8011B10C;
s32 D_8011B110;
u32 D_8011B114;
@@ -197,9 +197,9 @@ void init_track(u32 geometry, u32 skybox, s32 numberOfPlayers, Vehicle vehicle,
gCurrentLevelHeader2 = get_current_level_header();
D_8011B0F8 = FALSE;
D_8011B100 = 0;
D_8011B104 = 0;
D_8011B108 = 0;
gTTCamPlayerID = 0;
gTTCamID = 0;
gTTCamSmoothTimer = 0;
D_8011B10C = 0;
if (gCurrentLevelHeader2->race_type == RACETYPE_CUTSCENE_1 ||
@@ -232,7 +232,7 @@ void init_track(u32 geometry, u32 skybox, s32 numberOfPlayers, Vehicle vehicle,
}
cam_set_layout(numberOfPlayers);
spawn_skydome(skybox);
skydome_spawn(skybox);
D_8011B110 = 0;
D_8011B114 = 0x10000;
path_enable();
@@ -350,7 +350,7 @@ void render_scene(Gfx **dList, Mtx **mtx, Vertex **vtx, Triangle **tris, s32 upd
update_fog(numViewports, tempUpdateRate);
scroll_particle_textures(tempUpdateRate);
if (gCurrentLevelModel->numberOfAnimatedTextures > 0) {
animate_level_textures(tempUpdateRate);
track_tex_anim(tempUpdateRate);
}
for (j = gSceneCurrentPlayerID = 0; j < numViewports; gSceneCurrentPlayerID++, j = gSceneCurrentPlayerID) {
if (gCurrentLevelHeader2 && !gCurrentLevelHeader2 && !gCurrentLevelHeader2) {} // Fakematch
@@ -371,13 +371,13 @@ void render_scene(Gfx **dList, Mtx **mtx, Vertex **vtx, Triangle **tris, s32 upd
if (numViewports < 2) {
mtx_world_origin(&gTrackDL, &gTrackMtxPtr);
if (gCurrentLevelHeader2->skyDome == -1) {
func_80028050();
trackbg_render_flashy();
} else {
render_skydome();
skydome_render();
}
} else {
mtx_perspective(&gTrackDL, &gTrackMtxPtr);
draw_gradient_background();
trackbg_render_gradient();
func_80067D3C(&gTrackDL, &gTrackMtxPtr);
mtx_world_origin(&gTrackDL, &gTrackMtxPtr);
}
@@ -405,11 +405,11 @@ void render_scene(Gfx **dList, Mtx **mtx, Vertex **vtx, Triangle **tris, s32 upd
gDPPipeSync(gTrackDL++);
set_active_camera(PLAYER_FOUR);
disable_cutscene_camera();
func_800278E8(updateRate);
ttcam_update(updateRate);
viewport_main(&gTrackDL, &gTrackMtxPtr);
func_8002A31C();
mtx_perspective(&gTrackDL, &gTrackMtxPtr);
draw_gradient_background();
trackbg_render_gradient();
func_80067D3C(&gTrackDL, &gTrackMtxPtr);
mtx_world_origin(&gTrackDL, &gTrackMtxPtr);
gDPPipeSync(gTrackDL++);
@@ -432,7 +432,7 @@ void render_scene(Gfx **dList, Mtx **mtx, Vertex **vtx, Triangle **tris, s32 upd
#endif
} else {
set_active_camera(PLAYER_FOUR);
func_800278E8(updateRate);
ttcam_update(updateRate);
}
}
viewport_reset(&gTrackDL);
@@ -1195,7 +1195,12 @@ s32 func_80027568(void) {
#pragma GLOBAL_ASM("asm/nonmatchings/tracks/func_80027568.s")
#endif
void func_800278E8(s32 updateRate) {
/**
* Sets up the camera placement for the 4th viewport when using T.T Cam in 3 player.
* It utilises spectate points then points at the race leader.
* Uses lookat smoothing when changing which player, otherwise, snaps if the camera itself changes.
*/
void ttcam_update(s32 updateRate) {
s16 angleDiff;
f32 xDelta;
f32 yDelta;
@@ -1245,11 +1250,11 @@ void func_800278E8(s32 updateRate) {
thisObject = objectFirstPlace;
}
camObj = spectate_object(currentRacer->cameraIndex);
if (D_8011B104 != currentRacer->cameraIndex) {
D_8011B108 = 0;
} else if (D_8011B100 != currentRacer->playerIndex) {
D_8011B108 = 180;
D_8011B100 = currentRacer->playerIndex;
if (gTTCamID != currentRacer->cameraIndex) {
gTTCamSmoothTimer = 0;
} else if (gTTCamPlayerID != currentRacer->playerIndex) {
gTTCamSmoothTimer = 180;
gTTCamPlayerID = currentRacer->playerIndex;
}
if (camObj != NULL) {
camera = cam_get_active_camera_no_cutscenes();
@@ -1260,22 +1265,22 @@ void func_800278E8(s32 updateRate) {
yDelta = camera->trans.y_position - thisObject->trans.y_position;
zDelta = camera->trans.z_position - thisObject->trans.z_position;
xzSqr = sqrtf((xDelta * xDelta) + (zDelta * zDelta));
if (D_8011B108 != 0) {
if (gTTCamSmoothTimer != 0) {
angleDiff = ((s32) (-atan2s(xDelta, zDelta) - camera->trans.rotation.y_rotation) + 0x8000);
//!@bug Never true, since angleDiff is signed. Should be >=.
if (angleDiff > 0x8000) {
angleDiff = -(0xFFFF - angleDiff);
}
camera->trans.rotation.y_rotation += ((s32) (angleDiff / (16.0f * (D_8011B108 / 180.0f)))) & 0xFFFF;
camera->trans.rotation.y_rotation += ((s32) (angleDiff / (16.0f * (gTTCamSmoothTimer / 180.0f)))) & 0xFFFF;
angleDiff = atan2s(yDelta, xzSqr) - camera->trans.rotation.x_rotation;
//!@bug Never true, since angleDiff is signed. Should be >=.
if (angleDiff > 0x8000) {
angleDiff = -(0xFFFF - angleDiff);
}
camera->trans.rotation.x_rotation += ((s32) (angleDiff / (16.0f * (D_8011B108 / 180.0f)))) & 0xFFFF;
D_8011B108 -= updateRate;
if (D_8011B108 < 0) {
D_8011B108 = 0;
camera->trans.rotation.x_rotation += ((s32) (angleDiff / (16.0f * (gTTCamSmoothTimer / 180.0f)))) & 0xFFFF;
gTTCamSmoothTimer -= updateRate;
if (gTTCamSmoothTimer < 0) {
gTTCamSmoothTimer = 0;
}
} else {
camera->trans.rotation.y_rotation = 0x8000 - atan2s(xDelta, zDelta);
@@ -1284,14 +1289,14 @@ 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);
D_8011B104 = currentRacer->cameraIndex;
gTTCamID = currentRacer->cameraIndex;
}
}
/**
* Handle the flipbook effect for level geometry textures.
*/
void animate_level_textures(s32 updateRate) {
void track_tex_anim(s32 updateRate) {
s32 segmentNumber, batchNumber;
LevelModelSegment *segment;
TextureHeader *texture;
@@ -1327,7 +1332,7 @@ void animate_level_textures(s32 updateRate) {
* Skipped if the object ID doesn't exist.
* Also compares a checksum which can potentially trigger anti-tamper measures.
*/
void spawn_skydome(s32 objectID) {
void skydome_spawn(s32 objectID) {
LevelObjectEntryCommon spawnObject;
#ifdef ANTI_TAMPER
@@ -1361,8 +1366,7 @@ void set_skydome_visbility(s32 renderSky) {
// https://decomp.me/scratch/E1DFy
#ifdef NON_MATCHING
// This function creates the flashy sky effect in the wizpig 2 race.
// init_skydome
void func_80028050(void) {
void trackbg_render_flashy(void) {
Triangle *tris;
Vertex *verts;
s32 vCoordMask; // sp14C
@@ -1535,7 +1539,7 @@ void func_80028050(void) {
gTrackTriPtr = tris;
}
#else
#pragma GLOBAL_ASM("asm/nonmatchings/tracks/func_80028050.s")
#pragma GLOBAL_ASM("asm/nonmatchings/tracks/trackbg_render_flashy.s")
#endif
/**
@@ -1543,7 +1547,7 @@ void func_80028050(void) {
* Using different colours set in the level header, the vertices are coloured and
* it gives the background a gradient effect.
*/
void draw_gradient_background(void) {
void trackbg_render_gradient(void) {
s16 z;
UNUSED s16 pad;
s16 y0;
@@ -1650,7 +1654,7 @@ void draw_gradient_background(void) {
/**
* Sets the position to the current camera's position then renders the skydome if set to be visible.
*/
void render_skydome(void) {
void skydome_render(void) {
Camera *cam;
if (gSkydomeSegment == NULL) {
return;
@@ -2051,7 +2055,7 @@ void add_segment_to_order(s32 segmentIndex, s32 *segmentsOrderIndex, u8 *segment
} else {
temp = 1;
}
if (temp & 1 && should_segment_be_visible(&gCurrentLevelModel->segmentsBoundingBoxes[segmentIndex])) {
if (temp & 1 && block_visible(&gCurrentLevelModel->segmentsBoundingBoxes[segmentIndex])) {
segmentsOrder[(*segmentsOrderIndex)++] = segmentIndex;
}
}
@@ -2175,9 +2179,9 @@ s32 get_inside_segment_count_xyz(s32 *arg0, s16 xPos1, s16 yPos1, s16 zPos1, s16
}
/**
* Returns this segment data.
* Returns this block data.
*/
LevelModelSegment *get_segment(s32 segmentID) {
LevelModelSegment *block_get(s32 segmentID) {
if (segmentID < 0 || gCurrentLevelModel->numberOfSegments < segmentID) {
return NULL;
}
@@ -2186,10 +2190,10 @@ LevelModelSegment *get_segment(s32 segmentID) {
}
/**
* Returns the bounding box data of this segment.
* Returns the bounding box data of this block.
* Official name: trackBlockDim
*/
LevelModelSegmentBoundingBox *get_segment_bounding_box(s32 segmentID) {
LevelModelSegmentBoundingBox *block_boundbox(s32 segmentID) {
if (segmentID < 0 || gCurrentLevelModel->numberOfSegments < segmentID) {
return NULL;
}
@@ -2261,7 +2265,7 @@ void func_8002A31C(void) {
* to a total figure to determine whether or not a segment should be visible.
* There's a large unused portion at the bottom writing to two vars, that are never later read.
*/
s32 should_segment_be_visible(LevelModelSegmentBoundingBox *bb) {
s32 block_visible(LevelModelSegmentBoundingBox *bb) {
UNUSED u8 unknown[0x28];
s64 sp48;
s32 i, j;
@@ -2419,6 +2423,9 @@ UNUSED void func_8002AC00(s32 arg0, s32 arg1, s32 arg2) {
}
}
/**
* Writes back the track collision data pointers.
*/
UNUSED void get_collision_candidate_data(s32 *numCollsionCandidates, s32 **collisionCandidates,
s8 **collisionSurfaces) {
*numCollsionCandidates = gNumCollisionCandidates;
@@ -2426,10 +2433,17 @@ UNUSED void get_collision_candidate_data(s32 *numCollsionCandidates, s32 **colli
*collisionSurfaces = gCollisionSurfaces;
}
/**
* Change the collision response method.
* For instance, can choose to ignore wall response.
*/
void set_collision_mode(s32 mode) {
gCollisionMode = mode;
}
/**
* Returns the surface normals of the current collision point.
*/
s32 get_collision_normal(f32 *outX, f32 *outY, f32 *outZ) {
*outX = gCollisionNormalX;
*outY = gCollisionNormalY;
@@ -2692,10 +2706,11 @@ s32 func_8002B9BC(Object *obj, f32 *arg1, Vec3f *arg2, s32 arg3) {
}
}
// Collision: Returns the Y Values in yOut, and the number of values in the array as the return.
// Get's the Y Offset acrross a surface.
// Basically it goes down, finds a triangle, then locates where the intersection is and returns the Y level of that.
s32 func_8002BAB0(s32 levelSegmentIndex, f32 xIn, f32 zIn, f32 *yOut) {
/**
* Searches for intersecting surfaces, then returns the Y values of all the intersecting points, in order.
* There is no limit for surfaces returned, so not feeding a large enough yOut array could cause problems.
*/
s32 collision_get_y(s32 levelSegmentIndex, f32 xIn, f32 zIn, f32 *yOut) {
LevelModelSegment *currentSegment;
LevelModelSegmentBoundingBox *currentBoundingBox;
Triangle *tri;
@@ -2882,7 +2897,7 @@ void generate_track(s32 modelId) {
gCurrentLevelModel->segments[k].unk10 = (s16 *) j;
j = (s32) align16(((u8 *) (gCurrentLevelModel->segments[k].numberOfTriangles * 2)) + j);
gCurrentLevelModel->segments[k].collisionPlanes = (f32 *) j;
j = (s32) & ((u8 *) j)[func_8002CC30(&gCurrentLevelModel->segments[k])];
j = (s32) & ((u8 *) j)[track_init_collision(&gCurrentLevelModel->segments[k])];
func_8002C954(&gCurrentLevelModel->segments[k], &gCurrentLevelModel->segmentsBoundingBoxes[k], k);
gCurrentLevelModel->segments[k].unk30 = 0;
gCurrentLevelModel->segments[k].unk34 = (s16 *) j;
@@ -3058,7 +3073,7 @@ void func_8002C954(LevelModelSegment *segment, LevelModelSegmentBoundingBox *bbo
}
}
s32 func_8002CC30(LevelModelSegment *arg0) {
s32 track_init_collision(LevelModelSegment *block) {
s32 facesOffset;
s32 verticesOffset;
s32 nextFacesOffset;
@@ -3081,27 +3096,27 @@ s32 func_8002CC30(LevelModelSegment *arg0) {
counter = 0;
for (batchIndex = 0; batchIndex < arg0->numberOfBatches; batchIndex++) {
facesOffset = arg0->batches[batchIndex].facesOffset;
verticesOffset = arg0->batches[batchIndex].verticesOffset;
nextFacesOffset = arg0->batches[batchIndex + 1].facesOffset;
for (batchIndex = 0; batchIndex < block->numberOfBatches; batchIndex++) {
facesOffset = block->batches[batchIndex].facesOffset;
verticesOffset = block->batches[batchIndex].verticesOffset;
nextFacesOffset = block->batches[batchIndex + 1].facesOffset;
for (triIndex = facesOffset; triIndex < nextFacesOffset; triIndex++) {
if (arg0->triangles[triIndex].flags & TRI_FLAG_80) {
if (block->triangles[triIndex].flags & TRI_FLAG_80) {
continue;
}
v = &arg0->vertices[arg0->triangles[triIndex].vi0 + verticesOffset];
v = &block->vertices[block->triangles[triIndex].vi0 + verticesOffset];
x1 = v->x;
y1 = v->y;
z1 = v->z;
v = &arg0->vertices[arg0->triangles[triIndex].vi1 + verticesOffset];
v = &block->vertices[block->triangles[triIndex].vi1 + verticesOffset];
x2 = v->x;
y2 = v->y;
z2 = v->z;
v = &arg0->vertices[arg0->triangles[triIndex].vi2 + verticesOffset];
v = &block->vertices[block->triangles[triIndex].vi2 + verticesOffset];
x3 = v->x;
y3 = v->y;
z3 = v->z;
@@ -3120,10 +3135,10 @@ s32 func_8002CC30(LevelModelSegment *arg0) {
// looks like a macro
{
s32 temp = counter++;
arg0->collisionPlanes[4 * temp + 0] = nx;
arg0->collisionPlanes[4 * temp + 1] = ny;
arg0->collisionPlanes[4 * temp + 2] = nz;
arg0->collisionPlanes[4 * temp + 3] = -(x1 * nx + y1 * ny + z1 * nz);
block->collisionPlanes[4 * temp + 0] = nx;
block->collisionPlanes[4 * temp + 1] = ny;
block->collisionPlanes[4 * temp + 2] = nz;
block->collisionPlanes[4 * temp + 3] = -(x1 * nx + y1 * ny + z1 * nz);
}
}
}
@@ -3134,24 +3149,24 @@ s32 func_8002CC30(LevelModelSegment *arg0) {
return counter * 0x10;
}
for (batchIndex = 0; batchIndex < arg0->numberOfBatches; batchIndex++) {
facesOffset = arg0->batches[batchIndex].facesOffset;
verticesOffset = arg0->batches[batchIndex].verticesOffset;
nextFacesOffset = arg0->batches[batchIndex + 1].facesOffset;
for (batchIndex = 0; batchIndex < block->numberOfBatches; batchIndex++) {
facesOffset = block->batches[batchIndex].facesOffset;
verticesOffset = block->batches[batchIndex].verticesOffset;
nextFacesOffset = block->batches[batchIndex + 1].facesOffset;
if (arg0->batches[batchIndex].flags & RENDER_NO_COLLISION) {
if (block->batches[batchIndex].flags & RENDER_NO_COLLISION) {
facesOffset = nextFacesOffset;
}
for (triIndex = facesOffset; triIndex < nextFacesOffset; triIndex++) {
if (arg0->triangles[triIndex].flags & TRI_FLAG_80) {
if (block->triangles[triIndex].flags & TRI_FLAG_80) {
continue;
}
colPlaneIndex = arg0->collisionFacets[triIndex].basePlaneIndex;
nx = arg0->collisionPlanes[4 * colPlaneIndex + 0];
ny = arg0->collisionPlanes[4 * colPlaneIndex + 1];
nz = arg0->collisionPlanes[4 * colPlaneIndex + 2];
colPlaneIndex = block->collisionFacets[triIndex].basePlaneIndex;
nx = block->collisionPlanes[4 * colPlaneIndex + 0];
ny = block->collisionPlanes[4 * colPlaneIndex + 1];
nz = block->collisionPlanes[4 * colPlaneIndex + 2];
for (i = 0; i < 3; i++) {
next = i + 1;
@@ -3159,24 +3174,24 @@ s32 func_8002CC30(LevelModelSegment *arg0) {
next = 0;
}
vertIndex = arg0->triangles[triIndex].verticesArray[1 + i] + verticesOffset;
nextVertIndex = arg0->triangles[triIndex].verticesArray[1 + next] + verticesOffset;
vertIndex = block->triangles[triIndex].verticesArray[1 + i] + verticesOffset;
nextVertIndex = block->triangles[triIndex].verticesArray[1 + next] + verticesOffset;
next = arg0->collisionFacets[triIndex].edgeBisectorPlane[i];
next = block->collisionFacets[triIndex].edgeBisectorPlane[i];
if (next < numColPlanes) {
{
s32 temp = next;
x5 = nx + arg0->collisionPlanes[4 * temp + 0];
y5 = ny + arg0->collisionPlanes[4 * temp + 1];
z5 = nz + arg0->collisionPlanes[4 * temp + 2];
x5 = nx + block->collisionPlanes[4 * temp + 0];
y5 = ny + block->collisionPlanes[4 * temp + 1];
z5 = nz + block->collisionPlanes[4 * temp + 2];
}
v = &arg0->vertices[vertIndex];
v = &block->vertices[vertIndex];
x1 = v->x;
y1 = v->y;
z1 = v->z;
v = &arg0->vertices[nextVertIndex];
v = &block->vertices[nextVertIndex];
x2 = v->x;
y2 = v->y;
z2 = v->z;
@@ -3198,20 +3213,20 @@ s32 func_8002CC30(LevelModelSegment *arg0) {
if (next != colPlaneIndex) {
for (j = 0; j < 3; j++) {
if (colPlaneIndex == arg0->collisionFacets[next].edgeBisectorPlane[j]) {
arg0->collisionFacets[next].edgeBisectorPlane[j] = counter | 0x8000;
if (colPlaneIndex == block->collisionFacets[next].edgeBisectorPlane[j]) {
block->collisionFacets[next].edgeBisectorPlane[j] = counter | 0x8000;
}
}
}
arg0->collisionFacets[triIndex].edgeBisectorPlane[i] = counter;
block->collisionFacets[triIndex].edgeBisectorPlane[i] = counter;
{
s32 temp = counter++;
arg0->collisionPlanes[4 * temp + 0] = x5;
arg0->collisionPlanes[4 * temp + 1] = y5;
arg0->collisionPlanes[4 * temp + 2] = z5;
arg0->collisionPlanes[4 * temp + 3] = -(x1 * x5 + y1 * y5 + z1 * z5);
block->collisionPlanes[4 * temp + 0] = x5;
block->collisionPlanes[4 * temp + 1] = y5;
block->collisionPlanes[4 * temp + 2] = z5;
block->collisionPlanes[4 * temp + 3] = -(x1 * x5 + y1 * y5 + z1 * z5);
}
}
}
+11 -11
View File
@@ -116,15 +116,15 @@ typedef struct WaterProperties {
s32 set_scene_viewport_num(s32 numPorts);
void void_free(void);
void spawn_skydome(s32 objectID);
void skydome_spawn(s32 objectID);
void set_skydome_visbility(s32 renderSky);
void render_skydome(void);
void skydome_render(void);
void set_anti_aliasing(s32 setting);
void add_segment_to_order(s32 segmentIndex, s32 *segmentsOrderIndex, u8 *segmentsOrder);
s32 get_inside_segment_count_xz(s32 x, s32 z, s32 *arg2);
s32 get_inside_segment_count_xyz(s32 *arg0, s16 xPos1, s16 yPos1, s16 zPos1, s16 xPos2, s16 yPos2, s16 zPos2);
LevelModelSegment *get_segment(s32 segmentID);
LevelModelSegmentBoundingBox *get_segment_bounding_box(s32 segmentID);
LevelModelSegment *block_get(s32 segmentID);
LevelModelSegmentBoundingBox *block_boundbox(s32 segmentID);
void set_collision_mode(s32 mode);
s32 get_collision_normal(f32 *outX, f32 *outY, f32 *outZ);
s32 func_8002B9BC(Object *obj, f32 *arg1, Vec3f *arg2, s32 arg3);
@@ -135,7 +135,7 @@ void reset_fog(s32 playerID);
void update_fog(s32 viewportCount, s32 updateRate);
void apply_fog(s32 playerID);
void compute_scene_camera_transform_matrix(void);
void animate_level_textures(s32 updateRate);
void track_tex_anim(s32 updateRate);
s32 check_if_inside_segment(Object *obj, s32 segmentIndex);
s32 get_level_segment_index_from_position(f32 xPos, f32 yPos, f32 zPos);
void traverse_segments_bsp_tree(s32 nodeIndex, s32 segmentIndex, s32 segmentIndex2, u8 *segmentsOrder,
@@ -143,10 +143,10 @@ void traverse_segments_bsp_tree(s32 nodeIndex, s32 segmentIndex, s32 segmentInde
void render_level_geometry_and_objects(void);
void watereffect_render(Object *obj, WaterEffect *effect);
void shadow_render(Object *obj, ShadowData *shadow);
s32 should_segment_be_visible(LevelModelSegmentBoundingBox *bb);
s32 block_visible(LevelModelSegmentBoundingBox *bb);
s32 check_if_in_draw_range(Object *obj);
void func_8002C954(LevelModelSegment *segment, LevelModelSegmentBoundingBox *bbox, s32 arg2);
void draw_gradient_background(void);
void trackbg_render_gradient(void);
void shadow_update(s32 group, s32 waterGroup, s32 updateRate);
void obj_loop_fogchanger(Object *obj);
void initialise_player_viewport_vars(s32 updateRate);
@@ -164,11 +164,11 @@ void func_80026430(LevelModelSegment *segment, f32 arg1, f32 arg2, f32 arg3);
void free_track(void);
void void_check(u8 *segmentIds, s32 numberOfSegments, s32 viewportIndex);
s32 func_80027568(void);
s32 func_8002CC30(LevelModelSegment *);
s32 track_init_collision(LevelModelSegment *);
s32 func_8002B0F4(s32, f32 xIn, f32 zIn,
WaterProperties ***); // Definitely not triple pointer, but easiest way to fix warns.
void func_800278E8(s32);
void func_80028050(void);
void ttcam_update(s32);
void trackbg_render_flashy(void);
void initialise_player_viewport_vars(s32);
void func_8002A31C(void);
void update_colour_cycle(LevelHeader_70 *arg0, s32 updateRate);
@@ -181,7 +181,7 @@ void func_8002EEEC(s32 arg0);
void func_8002F2AC(void);
void func_8002F440(void);
f32 func_8002FA64(void);
s32 func_8002BAB0(s32 levelSegmentIndex, f32 xIn, f32 zIn, f32 *yOut);
s32 collision_get_y(s32 levelSegmentIndex, f32 xIn, f32 zIn, f32 *yOut);
void init_track(u32 geometry, u32 skybox, s32 numberOfPlayers, Vehicle vehicle, u32 entranceId, u32 collectables,
u32 arg6);
void waves_init(LevelModel *, LevelHeader *, s32);
+1 -1
View File
@@ -1638,7 +1638,7 @@ void func_800BCC70(LevelModel *model) {
x = gWaveModel[i].originX;
for (k = 0; k <= subdivisions; k++) {
// var_v0 stores the length of spAC
collisionCount = func_8002BAB0(i, spA8[k] + x, spA8[sp184] + z, colY);
collisionCount = collision_get_y(i, spA8[k] + x, spA8[sp184] + z, colY);
if (collisionCount == 0) {
var_a2 = 255;
} else {
+20 -20
View File
@@ -226,7 +226,7 @@ obj_init_emitter = 0x8000FAC4;
init_object_shadow = 0x8000FBCC;
init_object_water_effect = 0x8000FC6C;
init_object_interaction_data = 0x8000FD20;
func_8000FD34 = 0x8000FD34;
obj_init_collision = 0x8000FD34;
obj_spawn_attachment = 0x8000FD54;
free_object = 0x8000FFB8;
obj_table_ids = 0x80010018;
@@ -277,7 +277,7 @@ func_80016748 = 0x80016748;
func_80016BC4 = 0x80016BC4;
obj_butterfly_node = 0x80016C68;
obj_dist_racer = 0x80016DE8;
func_8001709C = 0x8001709C;
obj_collision_transform = 0x8001709C;
func_80017248 = 0x80017248;
func_8001790C = 0x8001790C;
func_80017978 = 0x80017978;
@@ -413,13 +413,13 @@ func_80026C14 = 0x80026C14;
func_80026E54 = 0x80026E54;
void_generate_primitive = 0x80027184;
func_80027568 = 0x80027568;
func_800278E8 = 0x800278E8;
animate_level_textures = 0x80027E24;
spawn_skydome = 0x80027FC4;
ttcam_update = 0x800278E8;
track_tex_anim = 0x80027E24;
skydome_spawn = 0x80027FC4;
set_skydome_visbility = 0x80028044;
func_80028050 = 0x80028050;
draw_gradient_background = 0x800289B8;
render_skydome = 0x80028C10;
trackbg_render_flashy = 0x80028050;
trackbg_render_gradient = 0x800289B8;
skydome_render = 0x80028C10;
initialise_player_viewport_vars = 0x80028CD0;
set_anti_aliasing = 0x80028FA0;
render_level_geometry_and_objects = 0x80028FAC;
@@ -430,10 +430,10 @@ check_if_inside_segment = 0x80029DE0;
get_level_segment_index_from_position = 0x80029F18;
get_inside_segment_count_xz = 0x8002A05C;
get_inside_segment_count_xyz = 0x8002A134;
get_segment = 0x8002A29C;
get_segment_bounding_box = 0x8002A2DC;
block_get = 0x8002A29C;
block_boundbox = 0x8002A2DC;
func_8002A31C = 0x8002A31C;
should_segment_be_visible = 0x8002A5F8;
block_visible = 0x8002A5F8;
check_if_in_draw_range = 0x8002A900;
func_8002AC00 = 0x8002AC00;
get_collision_candidate_data = 0x8002ACA0;
@@ -442,13 +442,13 @@ get_collision_normal = 0x8002ACD4;
get_wave_properties = 0x8002AD08;
func_8002B0F4 = 0x8002B0F4;
func_8002B9BC = 0x8002B9BC;
func_8002BAB0 = 0x8002BAB0;
collision_get_y = 0x8002BAB0;
generate_track = 0x8002C0C4;
func_8002C71C = 0x8002C71C;
get_current_level_model = 0x8002C7C4;
free_track = 0x8002C7D4;
func_8002C954 = 0x8002C954;
func_8002CC30 = 0x8002CC30;
track_init_collision = 0x8002CC30;
trackMakeAbsolute = 0x8002D30C;
shadow_render = 0x8002D384;
watereffect_render = 0x8002D670;
@@ -787,11 +787,11 @@ object_model_init = 0x8005F9CC;
model_instance_init = 0x8005FDA0;
free_3d_model = 0x80060010;
free_model_data = 0x80060128;
func_8006017C = 0x8006024C;
model_init_collision = 0x8006024C;
func_80060910 = 0x800609E0;
func_80060AC8 = 0x80060B98;
func_80060C58 = 0x80060D28;
model_calc_normals = 0x80060F78;
model_init_normals = 0x80060F78;
model_anim_offset = 0x80061AC4;
model_anim_init = 0x80061AD0;
func_80061C0C = 0x80061CDC;
@@ -3643,8 +3643,8 @@ gObjectCount = 0x8011C8CC;
gObjectListStart = 0x8011C8D0;
gParticleCount = 0x8011C8D4;
gObjectMemoryPool = 0x8011C8D8;
D_8011AE6C = 0x8011C8DC;
D_8011AE70 = 0x8011C8E0;
gCollisionObjects = 0x8011C8DC;
gCollisionObjectCount = 0x8011C8E0;
D_8011AE74 = 0x8011C8E4;
D_8011AE78 = 0x8011C8E8;
gCutsceneID = 0x8011C8EA;
@@ -3740,9 +3740,9 @@ gHitWall = 0x8011CB60;
gCollisionMode = 0x8011CB64;
D_8011B0F8 = 0x8011CB68;
gAntiAliasing = 0x8011CB6C;
D_8011B100 = 0x8011CB70;
D_8011B104 = 0x8011CB74;
D_8011B108 = 0x8011CB78;
gTTCamPlayerID = 0x8011CB70;
gTTCamID = 0x8011CB74;
gTTCamSmoothTimer = 0x8011CB78;
D_8011B10C = 0x8011CB7C;
D_8011B110 = 0x8011CB80;
D_8011B114 = 0x8011CB84;
+20 -20
View File
@@ -226,7 +226,7 @@ obj_init_emitter = 0x8000FAC4;
init_object_shadow = 0x8000FBCC;
init_object_water_effect = 0x8000FC6C;
init_object_interaction_data = 0x8000FD20;
func_8000FD34 = 0x8000FD34;
obj_init_collision = 0x8000FD34;
obj_spawn_attachment = 0x8000FD54;
free_object = 0x8000FFB8;
obj_table_ids = 0x80010018;
@@ -277,7 +277,7 @@ func_80016748 = 0x80016748;
func_80016BC4 = 0x80016BC4;
obj_butterfly_node = 0x80016C68;
obj_dist_racer = 0x80016DE8;
func_8001709C = 0x8001709C;
obj_collision_transform = 0x8001709C;
func_80017248 = 0x80017248;
func_8001790C = 0x8001790C;
func_80017978 = 0x80017978;
@@ -413,13 +413,13 @@ func_80026C14 = 0x80026C14;
func_80026E54 = 0x80026E54;
void_generate_primitive = 0x80027184;
func_80027568 = 0x80027568;
func_800278E8 = 0x800278E8;
animate_level_textures = 0x80027E24;
spawn_skydome = 0x80027FC4;
ttcam_update = 0x800278E8;
track_tex_anim = 0x80027E24;
skydome_spawn = 0x80027FC4;
set_skydome_visbility = 0x80028044;
func_80028050 = 0x80028050;
draw_gradient_background = 0x800289B8;
render_skydome = 0x80028C10;
trackbg_render_flashy = 0x80028050;
trackbg_render_gradient = 0x800289B8;
skydome_render = 0x80028C10;
initialise_player_viewport_vars = 0x80028CD0;
set_anti_aliasing = 0x80028FA0;
render_level_geometry_and_objects = 0x80028FAC;
@@ -430,10 +430,10 @@ check_if_inside_segment = 0x80029DE0;
get_level_segment_index_from_position = 0x80029F18;
get_inside_segment_count_xz = 0x8002A05C;
get_inside_segment_count_xyz = 0x8002A134;
get_segment = 0x8002A29C;
get_segment_bounding_box = 0x8002A2DC;
block_get = 0x8002A29C;
block_boundbox = 0x8002A2DC;
func_8002A31C = 0x8002A31C;
should_segment_be_visible = 0x8002A5F8;
block_visible = 0x8002A5F8;
check_if_in_draw_range = 0x8002A900;
func_8002AC00 = 0x8002AC00;
get_collision_candidate_data = 0x8002ACA0;
@@ -442,13 +442,13 @@ get_collision_normal = 0x8002ACD4;
get_wave_properties = 0x8002AD08;
func_8002B0F4 = 0x8002B0F4;
func_8002B9BC = 0x8002B9BC;
func_8002BAB0 = 0x8002BAB0;
collision_get_y = 0x8002BAB0;
generate_track = 0x8002C0C4;
func_8002C71C = 0x8002C71C;
get_current_level_model = 0x8002C7C4;
free_track = 0x8002C7D4;
func_8002C954 = 0x8002C954;
func_8002CC30 = 0x8002CC30;
track_init_collision = 0x8002CC30;
trackMakeAbsolute = 0x8002D30C;
shadow_render = 0x8002D384;
watereffect_render = 0x8002D670;
@@ -785,11 +785,11 @@ object_model_init = 0x8005F99C;
model_instance_init = 0x8005FCD0;
free_3d_model = 0x8005FF40;
free_model_data = 0x80060058;
func_8006017C = 0x8006017C;
model_init_collision = 0x8006017C;
func_80060910 = 0x80060910;
func_80060AC8 = 0x80060AC8;
func_80060C58 = 0x80060C58;
model_calc_normals = 0x80060EA8;
model_init_normals = 0x80060EA8;
model_anim_offset = 0x800619F4;
model_anim_init = 0x80061A00;
func_80061C0C = 0x80061C0C;
@@ -3381,8 +3381,8 @@ gObjectCount = 0x8011AEEC;
gObjectListStart = 0x8011AEF0;
gParticleCount = 0x8011AEF4;
gObjectMemoryPool = 0x8011AEF8;
D_8011AE6C = 0x8011AEFC;
D_8011AE70 = 0x8011AF00;
gCollisionObjects = 0x8011AEFC;
gCollisionObjectCount = 0x8011AF00;
D_8011AE74 = 0x8011AF04;
D_8011AE78 = 0x8011AF08;
gCutsceneID = 0x8011AF0A;
@@ -3476,9 +3476,9 @@ gHitWall = 0x8011B180;
gCollisionMode = 0x8011B184;
D_8011B0F8 = 0x8011B188;
gAntiAliasing = 0x8011B18C;
D_8011B100 = 0x8011B190;
D_8011B104 = 0x8011B194;
D_8011B108 = 0x8011B198;
gTTCamPlayerID = 0x8011B190;
gTTCamID = 0x8011B194;
gTTCamSmoothTimer = 0x8011B198;
D_8011B10C = 0x8011B19C;
D_8011B110 = 0x8011B1A0;
D_8011B114 = 0x8011B1A4;
+20 -20
View File
@@ -226,7 +226,7 @@ obj_init_emitter = 0x8000FAC4;
init_object_shadow = 0x8000FBCC;
init_object_water_effect = 0x8000FC6C;
init_object_interaction_data = 0x8000FD20;
func_8000FD34 = 0x8000FD34;
obj_init_collision = 0x8000FD34;
obj_spawn_attachment = 0x8000FD54;
free_object = 0x8000FFB8;
obj_table_ids = 0x80010018;
@@ -277,7 +277,7 @@ func_80016748 = 0x8001677C;
func_80016BC4 = 0x80016BF8;
obj_butterfly_node = 0x80016C9C;
obj_dist_racer = 0x80016E1C;
func_8001709C = 0x800170D0;
obj_collision_transform = 0x800170D0;
func_80017248 = 0x8001727C;
func_8001790C = 0x80017940;
func_80017978 = 0x800179AC;
@@ -409,13 +409,13 @@ func_80026C14 = 0x80026C54;
func_80026E54 = 0x80026E94;
void_generate_primitive = 0x800271C4;
func_80027568 = 0x800275A8;
func_800278E8 = 0x80027928;
animate_level_textures = 0x80027E64;
spawn_skydome = 0x80028004;
ttcam_update = 0x80027928;
track_tex_anim = 0x80027E64;
skydome_spawn = 0x80028004;
set_skydome_visbility = 0x80028084;
func_80028050 = 0x80028090;
draw_gradient_background = 0x800289F8;
render_skydome = 0x80028C50;
trackbg_render_flashy = 0x80028090;
trackbg_render_gradient = 0x800289F8;
skydome_render = 0x80028C50;
initialise_player_viewport_vars = 0x80028D10;
set_anti_aliasing = 0x80028FE0;
render_level_geometry_and_objects = 0x80028FEC;
@@ -426,10 +426,10 @@ check_if_inside_segment = 0x80029E20;
get_level_segment_index_from_position = 0x80029F58;
get_inside_segment_count_xz = 0x8002A09C;
get_inside_segment_count_xyz = 0x8002A174;
get_segment = 0x8002A2DC;
get_segment_bounding_box = 0x8002A31C;
block_get = 0x8002A2DC;
block_boundbox = 0x8002A31C;
func_8002A31C = 0x8002A35C;
should_segment_be_visible = 0x8002A638;
block_visible = 0x8002A638;
check_if_in_draw_range = 0x8002A940;
func_8002AC00 = 0x8002AC40;
get_collision_candidate_data = 0x8002ACE0;
@@ -438,13 +438,13 @@ get_collision_normal = 0x8002AD14;
get_wave_properties = 0x8002AD48;
func_8002B0F4 = 0x8002B134;
func_8002B9BC = 0x8002B9FC;
func_8002BAB0 = 0x8002BAF0;
collision_get_y = 0x8002BAF0;
generate_track = 0x8002C104;
func_8002C71C = 0x8002C75C;
get_current_level_model = 0x8002C804;
free_track = 0x8002C814;
func_8002C954 = 0x8002C994;
func_8002CC30 = 0x8002CC70;
track_init_collision = 0x8002CC70;
trackMakeAbsolute = 0x8002D34C;
shadow_render = 0x8002D3C4;
watereffect_render = 0x8002D6B0;
@@ -759,11 +759,11 @@ object_model_init = 0x8005FB3C; // has a diff from v1
model_instance_init = 0x8005FF10;
free_3d_model = 0x80060180;
free_model_data = 0x80060298;
func_8006017C = 0x800603BC;
model_init_collision = 0x800603BC;
func_80060910 = 0x80060B50;
func_80060AC8 = 0x80060D08;
func_80060C58 = 0x80060E98;
model_calc_normals = 0x800610E8;
model_init_normals = 0x800610E8;
model_anim_offset = 0x80061C34;
model_anim_init = 0x80061C40;
func_80061C0C = 0x80061E4C;
@@ -3311,8 +3311,8 @@ gObjectCount = 0x8011B46C;
gObjectListStart = 0x8011B470;
gParticleCount = 0x8011B474;
gObjectMemoryPool = 0x8011B478;
D_8011AE6C = 0x8011B47C;
D_8011AE70 = 0x8011B480;
gCollisionObjects = 0x8011B47C;
gCollisionObjectCount = 0x8011B480;
D_8011AE74 = 0x8011B484;
D_8011AE78 = 0x8011B488;
gCutsceneID = 0x8011B48A;
@@ -3406,9 +3406,9 @@ gHitWall = 0x8011B700;
gCollisionMode = 0x8011B704;
D_8011B0F8 = 0x8011B708;
gAntiAliasing = 0x8011B70C;
D_8011B100 = 0x8011B710;
D_8011B104 = 0x8011B714;
D_8011B108 = 0x8011B718;
gTTCamPlayerID = 0x8011B710;
gTTCamID = 0x8011B714;
gTTCamSmoothTimer = 0x8011B718;
D_8011B10C = 0x8011B71C;
D_8011B110 = 0x8011B720;
D_8011B114 = 0x8011B724;
+20 -20
View File
@@ -226,7 +226,7 @@ obj_init_emitter = 0x8000FAC4;
init_object_shadow = 0x8000FBCC;
init_object_water_effect = 0x8000FC6C;
init_object_interaction_data = 0x8000FD20;
func_8000FD34 = 0x8000FD34;
obj_init_collision = 0x8000FD34;
obj_spawn_attachment = 0x8000FD54;
free_object = 0x8000FFB8;
obj_table_ids = 0x80010018;
@@ -277,7 +277,7 @@ func_80016748 = 0x80016748;
func_80016BC4 = 0x80016BC4;
obj_butterfly_node = 0x80016C68;
obj_dist_racer = 0x80016DE8;
func_8001709C = 0x8001709C;
obj_collision_transform = 0x8001709C;
func_80017248 = 0x80017248;
func_8001790C = 0x8001790C;
func_80017978 = 0x80017978;
@@ -413,13 +413,13 @@ func_80026C14 = 0x80026C14;
func_80026E54 = 0x80026E54;
void_generate_primitive = 0x80027184;
func_80027568 = 0x80027568;
func_800278E8 = 0x800278E8;
animate_level_textures = 0x80027E24;
spawn_skydome = 0x80027FC4;
ttcam_update = 0x800278E8;
track_tex_anim = 0x80027E24;
skydome_spawn = 0x80027FC4;
set_skydome_visbility = 0x80028044;
func_80028050 = 0x80028050;
draw_gradient_background = 0x800289B8;
render_skydome = 0x80028C10;
trackbg_render_flashy = 0x80028050;
trackbg_render_gradient = 0x800289B8;
skydome_render = 0x80028C10;
initialise_player_viewport_vars = 0x80028CD0;
set_anti_aliasing = 0x80028FA0;
render_level_geometry_and_objects = 0x80028FAC;
@@ -430,10 +430,10 @@ check_if_inside_segment = 0x80029DE0;
get_level_segment_index_from_position = 0x80029F18;
get_inside_segment_count_xz = 0x8002A05C;
get_inside_segment_count_xyz = 0x8002A134;
get_segment = 0x8002A29C;
get_segment_bounding_box = 0x8002A2DC;
block_get = 0x8002A29C;
block_boundbox = 0x8002A2DC;
func_8002A31C = 0x8002A31C;
should_segment_be_visible = 0x8002A5F8;
block_visible = 0x8002A5F8;
check_if_in_draw_range = 0x8002A900;
func_8002AC00 = 0x8002AC00;
get_collision_candidate_data = 0x8002ACA0;
@@ -442,13 +442,13 @@ get_collision_normal = 0x8002ACD4;
get_wave_properties = 0x8002AD08;
func_8002B0F4 = 0x8002B0F4;
func_8002B9BC = 0x8002B9BC;
func_8002BAB0 = 0x8002BAB0;
collision_get_y = 0x8002BAB0;
generate_track = 0x8002C0C4;
func_8002C71C = 0x8002C71C;
get_current_level_model = 0x8002C7C4;
free_track = 0x8002C7D4;
func_8002C954 = 0x8002C954;
func_8002CC30 = 0x8002CC30;
track_init_collision = 0x8002CC30;
trackMakeAbsolute = 0x8002D30C;
shadow_render = 0x8002D384;
watereffect_render = 0x8002D670;
@@ -785,11 +785,11 @@ object_model_init = 0x8005F99C;
model_instance_init = 0x8005FCD0;
free_3d_model = 0x8005FF40;
free_model_data = 0x80060058;
func_8006017C = 0x8006017C;
model_init_collision = 0x8006017C;
func_80060910 = 0x80060910;
func_80060AC8 = 0x80060AC8;
func_80060C58 = 0x80060C58;
model_calc_normals = 0x80060EA8;
model_init_normals = 0x80060EA8;
model_anim_offset = 0x800619F4;
model_anim_init = 0x80061A00;
func_80061C0C = 0x80061C0C;
@@ -3758,8 +3758,8 @@ gObjectCount = 0x8011AE5C;
gObjectListStart = 0x8011AE60;
gParticleCount = 0x8011AE64;
gObjectMemoryPool = 0x8011AE68;
D_8011AE6C = 0x8011AE6C;
D_8011AE70 = 0x8011AE70;
gCollisionObjects = 0x8011AE6C;
gCollisionObjectCount = 0x8011AE70;
D_8011AE74 = 0x8011AE74;
D_8011AE78 = 0x8011AE78;
gCutsceneID = 0x8011AE7A;
@@ -3855,9 +3855,9 @@ gHitWall = 0x8011B0F0;
gCollisionMode = 0x8011B0F4;
D_8011B0F8 = 0x8011B0F8;
gAntiAliasing = 0x8011B0FC;
D_8011B100 = 0x8011B100;
D_8011B104 = 0x8011B104;
D_8011B108 = 0x8011B108;
gTTCamPlayerID = 0x8011B100;
gTTCamID = 0x8011B104;
gTTCamSmoothTimer = 0x8011B108;
D_8011B10C = 0x8011B10C;
D_8011B110 = 0x8011B110;
D_8011B114 = 0x8011B114;

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