Disassembled courses, added DLpacker, and disassembled packed DLs (#290)

* Disassembled all courses; packed DLs and course data.

* Added displaylist packer

* Minor documentation and naming
This commit is contained in:
MegaMech
2023-03-07 19:48:17 -07:00
committed by GitHub
parent 3a99685c2f
commit db4e0a3727
62 changed files with 180660 additions and 477 deletions
+78 -72
View File
@@ -99,7 +99,8 @@ void func_80296A50(struct ShellActor *shell) {
}
}
void func_80296D10(struct Actor *actor, Vec3f startingPos, Vec3s startingRot, Vec3f startingVelocity, s16 actorType) {
// Sets introductory values for a new actor (ex. Banana).
void actor_init(struct Actor *actor, Vec3f startingPos, Vec3s startingRot, Vec3f startingVelocity, s16 actorType) {
vec3f_copy(actor->pos, startingPos);
vec3s_copy(actor->rot, startingRot);
vec3f_copy(actor->velocity, startingVelocity);
@@ -1393,6 +1394,7 @@ UNUSED void func_8029AE14() {
}
// This likely attaches the paddle wheel to the boat
void func_8029AE1C(Camera *arg0, struct PaddleWheelBoat *boat, Mat4 arg2, u16 arg3) {
s32 pad[3];
Vec3f sp120;
@@ -1566,6 +1568,7 @@ void func_8029B6EC(Camera *camera, struct Actor* arg1) {
}
}
// Spins train wheels?
void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
s32 pad[3];
Vec3f sp160;
@@ -1880,26 +1883,28 @@ void func_8029CA90(Camera *camera, struct FallingRock *rock) {
if (temp_f0 < 0.0f) { return; }
if ((temp_f0 < 250000.0f) && (rock->unk30.unk34 == 1)) {
sp8C[0] = rock->pos[0];
sp8C[2] = rock->pos[2];
temp_f0 = func_802ABE30(sp8C[0], rock->pos[1], sp8C[2], rock->unk30.unk3A);
sp98[0] = 0;
sp98[1] = 0;
sp98[2] = 0;
sp8C[1] = temp_f0 + 2.0f;
func_802B5F74(sp4C, sp8C, sp98);
if (func_802B4FF8(sp4C, 0) != 0) {
if (temp_f0 < 250000.0f) {
if (rock->unk30.unk34 == 1) {
sp8C[0] = rock->pos[0];
sp8C[2] = rock->pos[2];
temp_f0 = func_802ABE30(sp8C[0], rock->pos[1], sp8C[2], rock->unk30.unk3A);
sp98[0] = 0;
sp98[1] = 0;
sp98[2] = 0;
sp8C[1] = temp_f0 + 2.0f;
func_802B5F74(sp4C, sp8C, sp98);
if (func_802B4FF8(sp4C, 0) == 0) {
return;
}
gSPDisplayList(gDisplayListHead++, D_06006F88);
goto block_6;
}
} else {
block_6:
func_802B5F74(sp4C, rock->pos, rock->rot);
if (func_802B4FF8(sp4C, 0) != 0) {
gSPDisplayList(gDisplayListHead++, D_06006FE0);
}
}
func_802B5F74(sp4C, rock->pos, rock->rot);
if (func_802B4FF8(sp4C, 0) == 0) {
return;
}
gSPDisplayList(gDisplayListHead++, D_06006FE0);
}
void place_piranha_plants(struct ActorSpawnData *spawnData) {
@@ -1920,7 +1925,7 @@ void place_piranha_plants(struct ActorSpawnData *spawnData) {
startingPos[0] = temp_s0->pos[0] * gCourseDirection;
startingPos[1] = temp_s0->pos[1];
startingPos[2] = temp_s0->pos[2];
temp = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_PIRANHA_PLANT);
temp = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_PIRANHA_PLANT);
temp_v1 = (struct PiranhaPlant *) &gActorList[temp];
temp_v1->visibilityStates[0] = 0;
temp_v1->visibilityStates[1] = 0;
@@ -1951,7 +1956,7 @@ void place_palm_trees(struct ActorSpawnData *spawnData) {
startingPos[0] = temp_s0->pos[0] * gCourseDirection;
startingPos[1] = temp_s0->pos[1];
startingPos[2] = temp_s0->pos[2];
temp = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_PALM_TREE);
temp = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_PALM_TREE);
temp_v1 = (struct PalmTree *) &gActorList[temp];
temp_v1->visibilityStates[0] = temp_s0->someId;
@@ -1991,7 +1996,7 @@ void place_falling_rocks(struct ActorSpawnData *spawnData) {
startingPos[2] = temp_s0->pos[2];
vec3f_set(startingVelocity, 0, 0, 0);
vec3s_set(startingRot, 0, 0, 0);
temp = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_FALLING_ROCK);
temp = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_FALLING_ROCK);
temp_v1 = (struct FallingRock *) &gActorList[temp];
temp_v1->unk_06 = temp_s0->someId;
@@ -2144,7 +2149,7 @@ void place_segment_06(struct ActorSpawnData *arg0) {
break;
}
temp_s0 = &gActorList[func_8029EC88(position, rotation, velocity, actorType)];
temp_s0 = &gActorList[addActorToEmptySlot(position, rotation, velocity, actorType)];
if (gGamestate == CREDITS_SEQUENCE) {
func_802976D8(temp_s0->rot);
} else {
@@ -2167,24 +2172,25 @@ void place_all_item_boxes(struct ActorSpawnData *spawnData) {
Vec3f startingVelocity;
Vec3s startingRot;
if ((gModeSelection != TIME_TRIALS) && (gPlaceItemBoxes != 0)) {
vec3f_set(startingVelocity, 0, 0, 0);
while(temp_s0->pos[0] != -0x8000) {
startingPos[0] = temp_s0->pos[0] * gCourseDirection;
startingPos[1] = temp_s0->pos[1];
startingPos[2] = temp_s0->pos[2];
startingRot[0] = random_u16();
startingRot[1] = random_u16();
startingRot[2] = random_u16();
temp_s1 = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_ITEM_BOX);
temp_f0 = func_802AE1C0(startingPos[0], startingPos[1] + 10.0f, startingPos[2]);
temp_v0 = (struct ItemBox *) &gActorList[temp_s1];
temp_v0->resetDistance = temp_f0;
temp_v0->origY = startingPos[1];
temp_v0->pos[1] = temp_f0 - 20.0f;
temp_s0++;
}
if ((gModeSelection == TIME_TRIALS) || (gPlaceItemBoxes == 0)) { return; }
vec3f_set(startingVelocity, 0, 0, 0);
while(temp_s0->pos[0] != -0x8000) {
startingPos[0] = temp_s0->pos[0] * gCourseDirection;
startingPos[1] = temp_s0->pos[1];
startingPos[2] = temp_s0->pos[2];
startingRot[0] = random_u16();
startingRot[1] = random_u16();
startingRot[2] = random_u16();
temp_s1 = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_ITEM_BOX);
temp_f0 = func_802AE1C0(startingPos[0], startingPos[1] + 10.0f, startingPos[2]);
temp_v0 = (struct ItemBox *) &gActorList[temp_s1];
temp_v0->resetDistance = temp_f0;
temp_v0->origY = startingPos[1];
temp_v0->pos[1] = temp_f0 - 20.0f;
temp_s0++;
}
}
void init_kiwano_fruit(void) {
@@ -2203,7 +2209,7 @@ void init_kiwano_fruit(void) {
if ((phi_s1->unk_000 & 0x4000) == 0) { continue; }
if ((phi_s1->unk_000 & 0x100) != 0) { continue; }
phi_s0 = func_8029EC88(sp64, sp50, sp58, ACTOR_KIWANO_FRUIT);
phi_s0 = addActorToEmptySlot(sp64, sp50, sp58, ACTOR_KIWANO_FRUIT);
actor = &gActorList[phi_s0];
actor->unk_04 = i;
}
@@ -2227,7 +2233,7 @@ void destroy_all_actors(void) {
}
}
void func_8029DB44(void) {
void place_course_actors(void) {
s32 stackPadding0;
Vec3f position;
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
@@ -2243,10 +2249,10 @@ void func_8029DB44(void) {
place_all_item_boxes(D_06009498);
vec3f_set(position, 150.0f, 40.0f, -1300.0f);
position[0] *= gCourseDirection;
func_8029EC88(position, rotation, velocity, ACTOR_MARIO_RACEWAY_SIGN);
addActorToEmptySlot(position, rotation, velocity, ACTOR_MARIO_RACEWAY_SIGN);
vec3f_set(position, 2520.0f, 0.0f, 1240.0f);
position[0] *= gCourseDirection;
actor = &gActorList[func_8029EC88(position, rotation, velocity, ACTOR_MARIO_RACEWAY_SIGN)];
actor = &gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_MARIO_RACEWAY_SIGN)];
actor->flags |= 0x4000;
break;
case COURSE_CHOCO_MOUNTAIN:
@@ -2265,7 +2271,7 @@ void func_8029DB44(void) {
place_all_item_boxes(D_06018110);
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
position[0] *= gCourseDirection;
func_8029EC88(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG);
addActorToEmptySlot(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG);
break;
case COURSE_FRAPPE_SNOWLAND:
place_segment_06(D_06007718);
@@ -2299,20 +2305,20 @@ void func_8029DB44(void) {
place_all_item_boxes(D_06022E88);
vec3f_set(position, -1680.0f, 2.0f, 35.0f);
position[0] *= gCourseDirection;
rrxing = (struct RailroadCrossing *)&gActorList[func_8029EC88(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing = (struct RailroadCrossing *)&gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing->crossingId = 1;
vec3f_set(position, -1600.0f, 2.0f, 35.0f);
position[0] *= gCourseDirection;
rrxing = (struct RailroadCrossing *)&gActorList[func_8029EC88(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing = (struct RailroadCrossing *)&gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing->crossingId = 1;
vec3s_set(rotation, 0, -0x2000, 0);
vec3f_set(position, -2459.0f, 2.0f, 2263.0f);
position[0] *= gCourseDirection;
rrxing = (struct RailroadCrossing *)&gActorList[func_8029EC88(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing = (struct RailroadCrossing *)&gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing->crossingId = 0;
vec3f_set(position, -2467.0f, 2.0f, 2375.0f);
position[0] *= gCourseDirection;
rrxing = (struct RailroadCrossing *)&gActorList[func_8029EC88(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing = (struct RailroadCrossing *)&gActorList[addActorToEmptySlot(position, rotation, velocity, ACTOR_RAILROAD_CROSSING)];
rrxing->crossingId = 0;
break;
case COURSE_SHERBET_LAND:
@@ -2325,13 +2331,13 @@ void func_8029DB44(void) {
place_all_item_boxes(D_0600CB40);
vec3f_set(position, -131.0f, 83.0f, 286.0f);
position[0] *= gCourseDirection;
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
vec3f_set(position, -2353.0f, 72.0f, -1608.0f);
position[0] *= gCourseDirection;
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
vec3f_set(position, -2622.0f, 79.0f, 739.0f);
position[0] *= gCourseDirection;
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
break;
case COURSE_BLOCK_FORT:
place_all_item_boxes(D_06000038);
@@ -2451,7 +2457,7 @@ void func_8029E158(void) {
}
func_80297818();
destroy_all_actors();
func_8029DB44();
place_course_actors();
func_800122D8();
}
@@ -2509,7 +2515,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
func_8000EE58(actorIndex);
case 7:
func_8029E7DC(compare);
func_80296D10(compare, pos, rot, velocity, actorType);
actor_init(compare, pos, rot, velocity, actorType);
return actorIndex;
default:
break;
@@ -2521,7 +2527,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
func_8000EE58(actorIndex);
case 7:
func_8029E7DC(compare);
func_80296D10(compare, pos, rot, velocity, actorType);
actor_init(compare, pos, rot, velocity, actorType);
return actorIndex;
}
break;
@@ -2531,7 +2537,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case 4:
case 5:
func_8029E7DC(compare);
func_80296D10(compare, pos, rot, velocity, actorType);
actor_init(compare, pos, rot, velocity, actorType);
return actorIndex;
}
break;
@@ -2540,7 +2546,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case 1:
case 2:
func_8029E7DC(compare);
func_80296D10(compare, pos, rot, velocity, actorType);
actor_init(compare, pos, rot, velocity, actorType);
return actorIndex;
}
break;
@@ -2564,7 +2570,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
func_8000EE58(actorIndex);
case 7:
func_8029E7DC(compare);
func_80296D10(compare, pos, rot, velocity, actorType);
actor_init(compare, pos, rot, velocity, actorType);
return actorIndex;
default:
break;
@@ -2576,7 +2582,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
func_8000EE58(actorIndex);
case 7:
func_8029E7DC(compare);
func_80296D10(compare, pos, rot, velocity, actorType);
actor_init(compare, pos, rot, velocity, actorType);
return actorIndex;
}
break;
@@ -2586,7 +2592,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case 4:
case 5:
func_8029E7DC(compare);
func_80296D10(compare, pos, rot, velocity, actorType);
actor_init(compare, pos, rot, velocity, actorType);
return actorIndex;
}
break;
@@ -2595,7 +2601,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
case 1:
case 2:
func_8029E7DC(compare);
func_80296D10(compare, pos, rot, velocity, actorType);
actor_init(compare, pos, rot, velocity, actorType);
return actorIndex;
}
break;
@@ -2607,7 +2613,7 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
return -1;
}
s16 func_8029EC88(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
s16 addActorToEmptySlot(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
s32 index;
if (gNumActors >= ACTOR_LIST_SIZE) {
@@ -2616,7 +2622,7 @@ s16 func_8029EC88(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
for(index = 0; index < ACTOR_LIST_SIZE; index++){
if (gActorList[index].flags == 0) {
gNumActors++;
func_80296D10(&gActorList[index], pos, rot, velocity, actorType);
actor_init(&gActorList[index], pos, rot, velocity, actorType);
return index;
}
}
@@ -2629,7 +2635,7 @@ s16 func_8029ED38(Vec3f pos, s16 actorType) {
vec3f_set(vel, 0.0f, 0.0f, 0.0f);
vec3s_set(rot, 0, 0, 0);
return func_8029EC88(pos, rot, vel, actorType);
return addActorToEmptySlot(pos, rot, vel, actorType);
}
// I swear we have a struct that looks like this already but I cannot find it anywhere
@@ -3577,15 +3583,15 @@ void func_802A14BC(f32 arg0, f32 arg1, f32 arg2) {
Vec3s sp20;
s16 temp_a0;
if (gModeSelection != TIME_TRIALS) {
vec3s_set(sp20, 0, 0, 0);
vec3f_set(sp28, 0, 0, 0);
sp34[0] = arg0;
sp34[1] = arg1;
sp34[2] = arg2;
temp_a0 = func_8029EC88(sp34, sp20, sp28, 43);
D_802BA05C = &gActorList[temp_a0];
}
if (gModeSelection == TIME_TRIALS) { return; }
vec3s_set(sp20, 0, 0, 0);
vec3f_set(sp28, 0, 0, 0);
sp34[0] = arg0;
sp34[1] = arg1;
sp34[2] = arg2;
temp_a0 = addActorToEmptySlot(sp34, sp20, sp28, 43);
D_802BA05C = &gActorList[temp_a0];
}
void update_obj_item_box_hot_air_balloon(struct ItemBox *itemBox) {
+3 -3
View File
@@ -5,7 +5,7 @@
#include "actor_types.h"
void func_80296A50(struct ShellActor*);
void func_80296D10(struct Actor*, f32*, s16*, f32*, s16);
void actor_init(struct Actor*, f32*, s16*, f32*, s16);
void func_80297230(Camera*, struct Actor*);
void func_802972B8(Camera*, struct Actor*);
void func_80297340(Camera*);
@@ -75,11 +75,11 @@ void place_segment_06(struct ActorSpawnData*);
void place_all_item_boxes(struct ActorSpawnData*);
void init_kiwano_fruit();
void destroy_all_actors();
void func_8029DB44();
void place_course_actors();
void func_8029E7DC(struct Actor*);
void destroy_actor(struct Actor*);
s16 func_8029E890(f32*, s16*, f32*, s16);
s16 func_8029EC88(Vec3f, Vec3s, Vec3f, s16);
s16 addActorToEmptySlot(Vec3f, Vec3s, Vec3f, s16);
s16 func_8029ED38(Vec3f, s16);
s32 func_8029EEB8(Player*, Vec3f, f32, f32, f32);
s32 func_8029F1F8(Player*, struct Actor*);
+8 -8
View File
@@ -511,7 +511,7 @@ s32 func_802B17F4(Player *player) {
s16 actorIndex;
struct BananaBunchParent *bananaBunch;
actorIndex = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_BANANA_BUNCH);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA_BUNCH);
if (actorIndex < 0) {
return actorIndex;
}
@@ -530,7 +530,7 @@ s32 func_802B18E4(Player *player, s16 tripleShellType) {
s16 actorIndex;
struct TripleShellParent *parent;
actorIndex = func_8029EC88(startingPos, startingRot, startingVelocity, tripleShellType);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, tripleShellType);
if (actorIndex < 0) {
return actorIndex;
}
@@ -560,7 +560,7 @@ s32 func_802B19EC(struct TripleShellParent *parent, Player *player, s16 shellTyp
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
actorIndex = func_8029EC88(startingPos, startingRot, startingVelocity, shellType);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, shellType);
if (actorIndex < 0) {
parent->shellIndices[shellId] = -1.0f;
return -1;
@@ -605,7 +605,7 @@ s32 func_802B1C9C(Player *player) {
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
actorIndex = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_GREEN_SHELL);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_GREEN_SHELL);
if (actorIndex < 0) {
return actorIndex;
}
@@ -638,7 +638,7 @@ s32 func_802B1E48(Player *player) {
startingPos[0] += player->pos[0];
startingPos[1] += player->pos[1];
startingPos[2] += player->pos[2];
actorIndex = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_RED_SHELL);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_RED_SHELL);
if (actorIndex < 0) {
return actorIndex;
}
@@ -865,7 +865,7 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b
startingRot[0] = 0;
startingRot[1] = 0;
startingRot[2] = 0;
actorIndex = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
if (actorIndex >= 0) {
newBanana = (struct BananaActor*)&gActorList[actorIndex];
startingPos[0] = player->pos[0];
@@ -942,7 +942,7 @@ s32 func_802B2C40(Player *player) {
startingRot[0] = 0;
startingRot[1] = 0;
startingRot[2] = 0;
actorIndex = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_FAKE_ITEM_BOX);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_FAKE_ITEM_BOX);
if (actorIndex < 0) {
return actorIndex;
}
@@ -981,7 +981,7 @@ s32 func_802B2D70(Player *player) {
startingRot[0] = 0;
startingRot[1] = 0;
startingRot[2] = 0;
actorIndex = func_8029EC88(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
actorIndex = addActorToEmptySlot(startingPos, startingRot, startingVelocity, ACTOR_BANANA);
if (actorIndex < 0) {
return actorIndex;
}
+4 -4
View File
@@ -248,7 +248,7 @@ void func_80003040(void) {
case COURSE_YOSHI_VALLEY:
vec3f_set(position, -2300.0f, 0.0f, 634.0f);
position[0] *= gCourseDirection;
func_8029EC88(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG);
addActorToEmptySlot(position, rotation, velocity, ACTOR_YOSHI_VALLEY_EGG);
break;
case COURSE_MOO_MOO_FARM:
func_802A84F4(D_0F04FE28, 0x3E8, 0x800);
@@ -276,11 +276,11 @@ void func_80003040(void) {
break;
case COURSE_WARIO_STADIUM:
vec3f_set(position, -131.0f, 83.0f, 286.0f);
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
vec3f_set(position, -2353.0f, 72.0f, -1608.0f);
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
vec3f_set(position, -2622.0f, 79.0f, 739.0f);
func_8029EC88(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
addActorToEmptySlot(position, rotation, velocity, ACTOR_WARIO_STADIUM_SIGN);
func_802AF8BC(0x7000C50, 0x64, 0xFF, 0xFF, 0xFF);
func_802AF8BC(0x7000BD8, 0x64, 0xFF, 0xFF, 0xFF);
func_802AF8BC(0x7000B60, 0x64, 0xFF, 0xFF, 0xFF);
+8 -8
View File
@@ -6356,7 +6356,7 @@ void func_800122D8(void) {
tempLocomotive->velocity[0] = tempLocomotive->position[0] - origXPos;
tempLocomotive->velocity[2] = tempLocomotive->position[2] - origZPos;
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
tempLocomotive->actorIndex = func_8029EC88(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE);
tempLocomotive->actorIndex = addActorToEmptySlot(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE);
tempTender = &D_801635A0[loopIndex].tender;
if (tempTender->isActive == 1) {
@@ -6366,7 +6366,7 @@ void func_800122D8(void) {
tempTender->velocity[0] = tempTender->position[0] - origXPos;
tempTender->velocity[2] = tempTender->position[2] - origZPos;
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
tempTender->actorIndex = func_8029EC88(tempTender->position, trainCarRot, tempTender->velocity, ACTOR_TRAIN_TENDER);
tempTender->actorIndex = addActorToEmptySlot(tempTender->position, trainCarRot, tempTender->velocity, ACTOR_TRAIN_TENDER);
}
for(loopIndex2 = 0; loopIndex2 < NUM_PASSENGER_CAR_ENTRIES; loopIndex2++) {
@@ -6378,7 +6378,7 @@ void func_800122D8(void) {
tempPassengerCar->velocity[0] = tempPassengerCar->position[0] - origXPos;
tempPassengerCar->velocity[2] = tempPassengerCar->position[2] - origZPos;
vec3s_set(trainCarRot, 0, trainCarYRot, 0);
tempPassengerCar->actorIndex = func_8029EC88(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, ACTOR_TRAIN_PASSENGER_CAR);
tempPassengerCar->actorIndex = addActorToEmptySlot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, ACTOR_TRAIN_PASSENGER_CAR);
}
}
}
@@ -6393,7 +6393,7 @@ void func_800122D8(void) {
tempPaddleWheelBoat->velocity[0] = tempPaddleWheelBoat->position[0] - origXPos;
tempPaddleWheelBoat->velocity[2] = tempPaddleWheelBoat->position[2] - origZPos;
vec3s_set(paddleWheelBoatRot, 0, tempPaddleWheelBoat->yRotation, 0);
tempPaddleWheelBoat->actorIndex = func_8029EC88(tempPaddleWheelBoat->position, paddleWheelBoatRot, tempPaddleWheelBoat->velocity, ACTOR_PADDLE_WHEEL_BOAT);
tempPaddleWheelBoat->actorIndex = addActorToEmptySlot(tempPaddleWheelBoat->position, paddleWheelBoatRot, tempPaddleWheelBoat->velocity, ACTOR_PADDLE_WHEEL_BOAT);
}
}
break;
@@ -6401,22 +6401,22 @@ void func_800122D8(void) {
for(loopIndex = 0; loopIndex < NUM_RACE_BOX_TRUCKS; loopIndex++) {
tempBoxTruck = &gBoxTruckList[loopIndex];
func_80012220(tempBoxTruck);
tempBoxTruck->actorIndex = func_8029EC88(tempBoxTruck->position, tempBoxTruck->rotation, tempBoxTruck->velocity, ACTOR_BOX_TRUCK);
tempBoxTruck->actorIndex = addActorToEmptySlot(tempBoxTruck->position, tempBoxTruck->rotation, tempBoxTruck->velocity, ACTOR_BOX_TRUCK);
}
for(loopIndex = 0; loopIndex < NUM_RACE_SCHOOL_BUSES; loopIndex++) {
tempSchoolBus = &gSchoolBusList[loopIndex];
func_80012220(tempSchoolBus);
tempSchoolBus->actorIndex = func_8029EC88(tempSchoolBus->position, tempSchoolBus->rotation, tempSchoolBus->velocity, ACTOR_SCHOOL_BUS);
tempSchoolBus->actorIndex = addActorToEmptySlot(tempSchoolBus->position, tempSchoolBus->rotation, tempSchoolBus->velocity, ACTOR_SCHOOL_BUS);
}
for(loopIndex = 0; loopIndex < NUM_RACE_TANKER_TRUCKS; loopIndex++) {
tempTankerTruck = &gTankerTruckList[loopIndex];
func_80012220(tempTankerTruck);
tempTankerTruck->actorIndex = func_8029EC88(tempTankerTruck->position, tempTankerTruck->rotation, tempTankerTruck->velocity, ACTOR_TANKER_TRUCK);
tempTankerTruck->actorIndex = addActorToEmptySlot(tempTankerTruck->position, tempTankerTruck->rotation, tempTankerTruck->velocity, ACTOR_TANKER_TRUCK);
}
for(loopIndex = 0; loopIndex < NUM_RACE_CARS; loopIndex++) {
tempCar = &gCarList[loopIndex];
func_80012220(tempCar);
tempCar->actorIndex = func_8029EC88(tempCar->position, tempCar->rotation, tempCar->velocity, ACTOR_CAR);
tempCar->actorIndex = addActorToEmptySlot(tempCar->position, tempCar->rotation, tempCar->velocity, ACTOR_CAR);
}
break;
}
+3 -1
View File
@@ -3,7 +3,8 @@
#include <PR/gbi.h>
/**
* @file Contains common course resources
* @file Contains common course data
* @segment 0x0D
* textures, vertices, displaylists, etc.
* A good example would be lakitu or shells as they exist in every course.
*/
@@ -2114,6 +2115,7 @@ f32 D_0D009808[] = {
0.0f, 0.0f, 0.0f
};
// todo: file split?
s32 unkPad = 0;
// Odometer speedometer
+33 -34
View File
@@ -1126,7 +1126,7 @@ void render_bowsers_castle(struct UnkStruct_800DC5EC *arg0) {
if (D_802B87BC > 255) {
D_802B87BC = 0;
}
load_surface_map(&bowsers_castle_dls, arg0);
load_surface_map(bowsers_castle_dls, arg0);
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
@@ -1160,7 +1160,7 @@ void render_banshee_boardwalk(struct UnkStruct_800DC5EC *arg0) {
gSPDisplayList(gDisplayListHead++, 0x07004E60);
gSPDisplayList(gDisplayListHead++, 0x070069B0);
load_surface_map(&banshee_boardwalk_dls, arg0);
load_surface_map(banshee_boardwalk_dls, arg0);
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
@@ -1190,7 +1190,7 @@ void render_yoshi_valley(struct UnkStruct_800DC5EC *arg0) {
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
load_surface_map(&yoshi_valley_dls, arg0);
load_surface_map(yoshi_valley_dls, arg0);
gDPPipeSync(gDisplayListHead++);
}
@@ -1208,7 +1208,7 @@ void render_frappe_snowland(struct UnkStruct_800DC5EC *arg0) {
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
load_surface_map(&frappe_snowland_dls, arg0);
load_surface_map(frappe_snowland_dls, arg0);
}
void render_koopa_troopa_beach(struct UnkStruct_800DC5EC *arg0) {
@@ -1226,7 +1226,7 @@ void render_koopa_troopa_beach(struct UnkStruct_800DC5EC *arg0) {
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gSPDisplayList(gDisplayListHead++, 0x07009688);
load_surface_map(&koopa_troopa_beach_dls, arg0);
load_surface_map(koopa_troopa_beach_dls, arg0);
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
@@ -1251,7 +1251,7 @@ void render_royal_raceway(struct UnkStruct_800DC5EC *arg0) {
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gSPDisplayList(gDisplayListHead++, 0x0700A648);
load_surface_map(&royal_raceway_dls, arg0);
load_surface_map(royal_raceway_dls, arg0);
gSPDisplayList(gDisplayListHead++, 0x070011A8);
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
@@ -1341,7 +1341,7 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC *arg0) {
gSPDisplayList(gDisplayListHead++, 0x07005640);
gSPFogPosition(gDisplayListHead++, D_802B87B0, D_802B87B4);
load_surface_map(&moo_moo_farm_dls, arg0);
load_surface_map(moo_moo_farm_dls, arg0);
if ((temp_s0 < 14) && (temp_s0 > 10)) {
if ((temp_s1 == 2) || (temp_s1 == 3) || (temp_s1 == 1))
@@ -1404,7 +1404,7 @@ void render_toads_turnpike(struct UnkStruct_800DC5EC *arg0) {
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_PASS2);
gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2);
load_surface_map(&toads_turnpike_dls, arg0);
load_surface_map(toads_turnpike_dls, arg0);
gDPSetRenderMode(gDisplayListHead++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2);
gDPSetCombineMode(gDisplayListHead++, G_CC_DECALRGBA, G_CC_PASS2);
@@ -1431,7 +1431,7 @@ void render_kalimari_desert(struct UnkStruct_800DC5EC *arg0) {
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
load_surface_map(&kalimari_desert_dls, arg0);
load_surface_map(kalimari_desert_dls, arg0);
gSPDisplayList(gDisplayListHead++, 0x07001ED8);
gSPDisplayList(gDisplayListHead++, 0x07001B18);
gSPDisplayList(gDisplayListHead++, 0x07008330);
@@ -1450,7 +1450,7 @@ void render_sherbet_land(struct UnkStruct_800DC5EC *arg0) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
load_surface_map(&sherbet_land_dls, arg0);
load_surface_map(sherbet_land_dls, arg0);
}
void render_rainbow_road(struct UnkStruct_800DC5EC *arg0) {
@@ -1580,10 +1580,9 @@ void render_dks_jungle_parkway(struct UnkStruct_800DC5EC *arg0) {
gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
load_surface_map(&dks_jungle_parkway_dls, arg0);
load_surface_map(dks_jungle_parkway_dls, arg0);
gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
}
void render_big_donut(struct UnkStruct_800DC5EC *arg0) {
@@ -1758,14 +1757,14 @@ void func_80295BF8(s32 playerIndex) {
}
void func_80295C6C(void) {
gPrevLoadedAddress += ALIGNF(D_8015F588 * sizeof(mk64_surface_map_ram));
gPrevLoadedAddress += ALIGN16(D_8015F588 * sizeof(mk64_surface_map_ram));
D_8015F6E8 += 20;
D_8015F6F0 += 20;
D_8015F6EA += -20;
D_8015F6F2 += -20;
D_8015F6EE += -20;
func_802AF314();
gPrevLoadedAddress += ALIGNF(D_8015F58A * 2);
gPrevLoadedAddress += ALIGN16(D_8015F58A * 2);
}
UNUSED void func_80295D50(s16 arg0, s16 arg1) {
@@ -1797,7 +1796,7 @@ void func_80295D88(void) {
D_800DC5BC = 0;
D_800DC5C8 = 0;
switch (gCurrentCourseId) {
case 0:
case COURSE_MARIO_RACEWAY:
func_802AF588(0x07001140);
if (gScreenModeSelection == SCREEN_MODE_1P) {
func_802AF588(0x070008E8);
@@ -1808,7 +1807,7 @@ void func_80295D88(void) {
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
break;
case 1:
case COURSE_CHOCO_MOUNTAIN:
D_800DC5BC = 1;
D_801625EC = 255;
D_801625F4 = 255;
@@ -1830,13 +1829,13 @@ void func_80295D88(void) {
func_80295C6C();
D_8015F8E4 = -80.0f;
break;
case 2:
case COURSE_BOWSER_CASTLE:
func_80290CAC(&D_060093D8);
func_80295C6C();
func_802AF8BC(0x07001350, 0x32, 0, 0, 0);
D_8015F8E4 = -50.0f;
break;
case 3:
case COURSE_BANSHEE_BOARDWALK:
D_800DC5BC = 1;
D_801625EC = 0;
D_801625F4 = 0;
@@ -1846,18 +1845,18 @@ void func_80295D88(void) {
func_802AF8BC(0x07000878, 128, 0, 0, 0);
D_8015F8E4 = -80.0f;
break;
case 4:
case COURSE_YOSHI_VALLEY:
func_802B5D64(D_06016558, -0x38F0, 0x1C70, 1);
func_80290CAC(D_06018240);
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
break;
case 5:
case COURSE_FRAPPE_SNOWLAND:
func_80290CAC(D_060079A0);
func_80295C6C();
D_8015F8E4 = -50.0f;
break;
case 6:
case COURSE_KOOPA_BEACH:
func_80290CAC(D_06018FD8);
func_80295C6C();
func_802AF8BC(0x0700ADE0, -0x6A, 255, 255, 255);
@@ -1865,22 +1864,22 @@ void func_80295D88(void) {
func_802AF8BC(0x07009E70, -0x6A, 255, 255, 255);
func_802AF8BC(0x07000358, -0x6A, 255, 255, 255);
break;
case 7:
case COURSE_ROYAL_RACEWAY:
func_80290CAC(D_0600DC28);
func_80295C6C();
D_8015F8E4 = -60.0f;
break;
case 8:
case COURSE_LUIGI_RACEWAY:
func_80290CAC(D_0600FF28);
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
break;
case 9:
case COURSE_MOO_MOO_FARM:
func_80290CAC(D_060144B8);
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
break;
case 10:
case COURSE_TOADS_TURNPIKE:
D_801625EC = 43;
D_801625F4 = 13;
D_801625F0 = 4;
@@ -1890,19 +1889,19 @@ void func_80295D88(void) {
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
break;
case 11:
case COURSE_KALAMARI_DESERT:
func_80290CAC(D_06023070);
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
break;
case 12:
case COURSE_SHERBET_LAND:
func_80290CAC(D_06009C20);
func_80295C6C();
D_8015F8E4 = -18.0f;
func_802AF8BC(0x07001EB8, -0x4C, 255, 255, 255);
func_802AF8BC(0x07002308, -0x6A, 255, 255, 255);
break;
case 13:
case COURSE_RAINBOW_ROAD:
D_800DC5C8 = 1;
func_80290CAC(D_06016440);
func_80295C6C();
@@ -1914,7 +1913,7 @@ void func_80295D88(void) {
func_802AF8BC(0x07001FB8, -0x6A, 255, 255, 255);
}
break;
case 14:
case COURSE_WARIO_STADIUM:
func_80290CAC(D_0600CC38);
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
@@ -1927,30 +1926,30 @@ void func_80295D88(void) {
func_802AF8BC(0x07000DD0, 100, 255, 255, 255);
func_802AF8BC(0x07000E48, 100, 255, 255, 255);
break;
case 15:
case COURSE_BLOCK_FORT:
func_802AF5AC(0x070015C0, 1);
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
break;
case 16:
case COURSE_SKYSCRAPER:
func_802AF5AC(0x07001110, 1);
func_802AF5AC(0x07000258, 1);
func_80295C6C();
D_8015F8E4 = -480.0f;
break;
case 17:
case COURSE_DOUBLE_DECK:
func_802AF5AC(0x07000738, 1);
func_80295C6C();
D_8015F8E4 = D_8015F6EE - 10.0f;
break;
case 18:
case COURSE_DK_JUNGLE:
func_80290CAC(D_06014338);
func_80295C6C();
D_8015F8E4 = -475.0f;
func_802AF8BC(0x07003FA8, 120, 255, 255, 255);
break;
case 19:
case COURSE_BIG_DONUT:
func_802AF5AC(0x07001018, 6);
func_802AF5AC(0x07000450, 6);
func_802AF5AC(0x07000AC0, 6);
+1 -3
View File
@@ -1,8 +1,6 @@
#ifndef RENDER_COURSES_H
#define RENDER_COURSES_H
#define ALIGNF(x) (((x) + 0xF) & ~0xF)
struct Unk0CAC {
s32 unk0;
u8 unk4;
@@ -74,7 +72,7 @@ extern s32 D_802B87BC;
extern Gfx bowsers_castle_dls[];
extern Gfx banshee_boardwalk_dls[];
extern Gfx D_0600B278[];
extern Gfx yoshi_valley_dls;
extern Gfx yoshi_valley_dls[];
extern u8 frappe_snowland_dls[];
extern Gfx koopa_troopa_beach_dls[];
extern Gfx royal_raceway_dls[];