mirror of
https://github.com/n64decomp/mk64
synced 2026-09-12 20:06:05 -04:00
very cool debug display list (#348)
* added a very cool debug display list ^^ (prints variables to screen) * Decompiled various functions
This commit is contained in:
+273
-267
@@ -20,7 +20,6 @@
|
||||
#include "audio/external.h"
|
||||
#include "common_textures.h"
|
||||
|
||||
|
||||
// Appears to be textures
|
||||
// or tluts
|
||||
u8 *D_802BA050;
|
||||
@@ -32,17 +31,21 @@ struct Actor *D_802BA05C;
|
||||
s8 D_802BA060[512]; // tlut 256
|
||||
u16 D_802BA260;
|
||||
|
||||
void func_80296A50(struct ShellActor *shell) {
|
||||
/**
|
||||
* Once the amount of spawned player red and green shell count has reached 21 or higher
|
||||
* the game will cleanup any dead red or green shells by deleting their actors.
|
||||
*/
|
||||
void cleanup_red_and_green_shells(struct ShellActor *shell) {
|
||||
s32 actorIndex;
|
||||
struct ShellActor *compare;
|
||||
|
||||
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
|
||||
compare = (struct ShellActor *)&gActorList[actorIndex];
|
||||
if ((shell != compare) && !(compare->flags & 0xF) && (compare->type == ACTOR_GREEN_SHELL)) {
|
||||
if (compare->state == 2) {
|
||||
if ((shell != compare) && !(compare->flags & ACTOR_IS_NOT_EXPIRED) && (compare->type == ACTOR_GREEN_SHELL)) {
|
||||
if (compare->state == MOVING_SHELL) {
|
||||
func_8000EE58(actorIndex);
|
||||
}
|
||||
D_8015F6FE -= 1;
|
||||
gNumSpawnedShells -= 1;
|
||||
destroy_actor((struct Actor *)compare);
|
||||
return;
|
||||
}
|
||||
@@ -50,21 +53,21 @@ void func_80296A50(struct ShellActor *shell) {
|
||||
|
||||
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
|
||||
compare = (struct ShellActor *) &gActorList[actorIndex];
|
||||
if ((shell != compare) && !(compare->flags & 0xF) && (compare->type == ACTOR_RED_SHELL)) {
|
||||
if ((shell != compare) && !(compare->flags & ACTOR_IS_NOT_EXPIRED) && (compare->type == ACTOR_RED_SHELL)) {
|
||||
switch(compare->state) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
func_8000EE58(actorIndex);
|
||||
case 7:
|
||||
D_8015F6FE -= 1;
|
||||
destroy_actor((struct Actor *)compare);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
case MOVING_SHELL:
|
||||
case RED_SHELL_LOCK_ON:
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
case BLUE_SHELL_TARGET_ELIMINATED:
|
||||
func_8000EE58(actorIndex);
|
||||
case DESTROYED_SHELL:
|
||||
gNumSpawnedShells -= 1;
|
||||
destroy_actor((struct Actor *)compare);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,12 +76,12 @@ void func_80296A50(struct ShellActor *shell) {
|
||||
compare = (struct ShellActor *) &gActorList[actorIndex];
|
||||
if ((shell != compare) && (compare->type == ACTOR_GREEN_SHELL)) {
|
||||
switch(compare->state) {
|
||||
case 2:
|
||||
func_8000EE58(actorIndex);
|
||||
case 7:
|
||||
D_8015F6FE -= 1;
|
||||
destroy_actor((struct Actor *)compare);
|
||||
return;
|
||||
case MOVING_SHELL:
|
||||
func_8000EE58(actorIndex);
|
||||
case DESTROYED_SHELL:
|
||||
gNumSpawnedShells -= 1;
|
||||
destroy_actor((struct Actor *)compare);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,17 +90,17 @@ void func_80296A50(struct ShellActor *shell) {
|
||||
compare = (struct ShellActor *)&gActorList[actorIndex];
|
||||
if ((shell != compare) && (compare->type == ACTOR_RED_SHELL)) {
|
||||
switch(compare->state) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
func_8000EE58(actorIndex);
|
||||
case 7:
|
||||
D_8015F6FE -= 1;
|
||||
destroy_actor((struct Actor *)compare);
|
||||
return;
|
||||
case MOVING_SHELL:
|
||||
case RED_SHELL_LOCK_ON:
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
case BLUE_SHELL_TARGET_ELIMINATED:
|
||||
func_8000EE58(actorIndex);
|
||||
case DESTROYED_SHELL:
|
||||
gNumSpawnedShells -= 1;
|
||||
destroy_actor((struct Actor *)compare);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,7 +122,7 @@ void actor_init(struct Actor *actor, Vec3f startingPos, Vec3s startingRot, Vec3f
|
||||
case ACTOR_BOX_TRUCK:
|
||||
if ((s32) D_802BA260 >= 3) {
|
||||
D_802BA260 = 0;
|
||||
}
|
||||
}
|
||||
actor->state = (s16) D_802BA260;
|
||||
D_802BA260 += 1;
|
||||
break;
|
||||
@@ -150,25 +153,25 @@ void actor_init(struct Actor *actor, Vec3f startingPos, Vec3s startingRot, Vec3f
|
||||
actor->boundingBoxSize = 2.0f;
|
||||
break;
|
||||
case ACTOR_GREEN_SHELL:
|
||||
D_8015F6FE += 1;
|
||||
gNumSpawnedShells += 1;
|
||||
actor->unk_04 = 0;
|
||||
actor->boundingBoxSize = 4.0f;
|
||||
actor->flags = actor->flags | 0x4000 | 0x2000 | 0x1000;
|
||||
if ((s32) D_8015F6FE >= 0x15) {
|
||||
func_80296A50((struct ShellActor *) actor);
|
||||
if ((s32) gNumSpawnedShells >= 0x15) {
|
||||
cleanup_red_and_green_shells((struct ShellActor *) actor);
|
||||
}
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
D_8015F6FE += 1;
|
||||
gNumSpawnedShells += 1;
|
||||
actor->unk_04 = 0;
|
||||
actor->boundingBoxSize = 4.0f;
|
||||
actor->flags = actor->flags | 0x4000 | 0x2000 | 0x1000;
|
||||
if ((s32) D_8015F6FE >= 0x15) {
|
||||
func_80296A50((struct ShellActor *) actor);
|
||||
if ((s32) gNumSpawnedShells >= 0x15) {
|
||||
cleanup_red_and_green_shells((struct ShellActor *) actor);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
D_8015F6FE += 1;
|
||||
gNumSpawnedShells += 1;
|
||||
actor->flags |= 0x4000;
|
||||
actor->state = 0x0043;
|
||||
actor->boundingBoxSize = 3.0f;
|
||||
@@ -286,7 +289,7 @@ void func_80297230(Camera *arg0, struct Actor *arg1) {
|
||||
}
|
||||
|
||||
void func_802972B8(Camera *arg0, struct Actor *arg1) {
|
||||
switch(arg0 - camera1) {
|
||||
switch(arg0 - camera1) {
|
||||
case 0:
|
||||
arg1->flags |= 1;
|
||||
break;
|
||||
@@ -881,7 +884,7 @@ void func_80298D7C(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((test & 0x0400) && ((D_800DC5FC == 0) || (camera == camera1))) {
|
||||
if ((test & 0x0400) && ((gIsGamePaused == 0) || (camera == camera1))) {
|
||||
var_s1->pos[1] += 0xA;
|
||||
if (var_s1->pos[1] >= 0x321) {
|
||||
var_s1->someId |= 0x0800;
|
||||
@@ -1222,6 +1225,7 @@ void func_8029A3AC(Camera *camera, Mat4 matrix, struct ShellActor *shell) {
|
||||
func_80297230(camera, (struct Actor *)shell);
|
||||
return;
|
||||
}
|
||||
|
||||
func_802972B8(camera, (struct Actor *) shell);
|
||||
if (temp_f0 < 40000.0f) {
|
||||
func_802979F8((struct Actor *) shell, 3.4f);
|
||||
@@ -1297,6 +1301,7 @@ void func_8029A8F4(Camera *camera, UNUSED Mat4 arg1, struct BananaActor *banana)
|
||||
func_80297230(camera, (struct Actor *) banana);
|
||||
return;
|
||||
}
|
||||
|
||||
func_802972B8(camera, (struct Actor *) banana);
|
||||
|
||||
if (banana->state == 5) {
|
||||
@@ -2520,56 +2525,56 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
|
||||
|
||||
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
|
||||
compare = (struct ShellActor *) &gActorList[actorIndex];
|
||||
if (!(compare->flags & 0xF)) {
|
||||
if (!(compare->flags & ACTOR_IS_NOT_EXPIRED)) {
|
||||
switch(compare->type) {
|
||||
case ACTOR_RED_SHELL:
|
||||
switch(compare->state) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
func_8000EE58(actorIndex);
|
||||
case 7:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ACTOR_GREEN_SHELL:
|
||||
switch(compare->state) {
|
||||
case 2:
|
||||
func_8000EE58(actorIndex);
|
||||
case 7:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
case ACTOR_BANANA:
|
||||
switch(compare->state) {
|
||||
case 1:
|
||||
case 4:
|
||||
case 5:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
case ACTOR_FAKE_ITEM_BOX:
|
||||
switch(compare->state) {
|
||||
case 1:
|
||||
case 2:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
switch(compare->state) {
|
||||
case MOVING_SHELL:
|
||||
case RED_SHELL_LOCK_ON:
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
case BLUE_SHELL_TARGET_ELIMINATED:
|
||||
func_8000EE58(actorIndex);
|
||||
case DESTROYED_SHELL:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ACTOR_GREEN_SHELL:
|
||||
switch(compare->state) {
|
||||
case MOVING_SHELL:
|
||||
func_8000EE58(actorIndex);
|
||||
case DESTROYED_SHELL:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
case ACTOR_BANANA:
|
||||
switch(compare->state) {
|
||||
case DROPPED_BANANA:
|
||||
case BANANA_ON_GROUND:
|
||||
case DESTROYED_BANANA:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
case ACTOR_FAKE_ITEM_BOX:
|
||||
switch(compare->state) {
|
||||
case FAKE_ITEM_BOX_ON_GROUND:
|
||||
case DESTROYED_FAKE_ITEM_BOX:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2577,54 +2582,54 @@ s16 func_8029E890(Vec3f pos, Vec3s rot, Vec3f velocity, s16 actorType) {
|
||||
for (actorIndex = gNumPermanentActors; actorIndex < ACTOR_LIST_SIZE; actorIndex++) {
|
||||
compare = (struct ShellActor *) &gActorList[actorIndex];
|
||||
switch(compare->type) {
|
||||
case ACTOR_RED_SHELL:
|
||||
switch(compare->state) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
func_8000EE58(actorIndex);
|
||||
case 7:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ACTOR_GREEN_SHELL:
|
||||
switch(compare->state) {
|
||||
case 2:
|
||||
func_8000EE58(actorIndex);
|
||||
case 7:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
case ACTOR_BANANA:
|
||||
switch(compare->state) {
|
||||
case 1:
|
||||
case 4:
|
||||
case 5:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
case ACTOR_FAKE_ITEM_BOX:
|
||||
switch(compare->state) {
|
||||
case 1:
|
||||
case 2:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
switch(compare->state) {
|
||||
case MOVING_SHELL:
|
||||
case RED_SHELL_LOCK_ON:
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
case BLUE_SHELL_TARGET_ELIMINATED:
|
||||
func_8000EE58(actorIndex);
|
||||
case DESTROYED_SHELL:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ACTOR_GREEN_SHELL:
|
||||
switch(compare->state) {
|
||||
case MOVING_SHELL:
|
||||
func_8000EE58(actorIndex);
|
||||
case DESTROYED_SHELL:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
case ACTOR_BANANA:
|
||||
switch(compare->state) {
|
||||
case DROPPED_BANANA:
|
||||
case BANANA_ON_GROUND:
|
||||
case DESTROYED_BANANA:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
case ACTOR_FAKE_ITEM_BOX:
|
||||
switch(compare->state) {
|
||||
case FAKE_ITEM_BOX_ON_GROUND:
|
||||
case DESTROYED_FAKE_ITEM_BOX:
|
||||
func_8029E7DC((struct Actor *) compare);
|
||||
actor_init((struct Actor *) compare, pos, rot, velocity, actorType);
|
||||
return actorIndex;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3028,144 +3033,144 @@ void func_8029FDC8(struct Actor *actor) {
|
||||
Player *player;
|
||||
|
||||
switch (actor->type) {
|
||||
case ACTOR_BANANA:
|
||||
banana = (struct BananaActor *)actor;
|
||||
switch (banana->state) {
|
||||
case 2:
|
||||
case 3:
|
||||
func_802B0570(banana);
|
||||
break;
|
||||
case 0:
|
||||
player = &gPlayers[banana->playerId];
|
||||
player->statusEffects &= ~0x00040000;
|
||||
/* fallthrough */
|
||||
case 4:
|
||||
banana->flags = -0x8000;
|
||||
banana->unk_04 = 0x003C;
|
||||
banana->state = 5;
|
||||
banana->velocity[1] = 3.0f;
|
||||
break;
|
||||
case 1:
|
||||
case 5:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ACTOR_GREEN_SHELL:
|
||||
shell = (struct ShellActor *)actor;
|
||||
if (shell->state != 5) {
|
||||
switch (shell->state) {
|
||||
case 2:
|
||||
func_8000EE58(actor - gActorList);
|
||||
/* fallthrough */
|
||||
case 0:
|
||||
case 1:
|
||||
shell->flags = -0x8000;
|
||||
shell->rotAngle = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = 5;
|
||||
shell->velocity[1] = 3.0f;
|
||||
break;
|
||||
case 4:
|
||||
func_802B02B4(shell, ACTOR_GREEN_SHELL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTOR_BLUE_SPINY_SHELL:
|
||||
shell = (struct ShellActor *)actor;
|
||||
if (shell->state != 7) {
|
||||
switch (shell->state) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
func_800C9EF4(shell->pos, 0x51018008);
|
||||
func_8000EE58(actor - gActorList);
|
||||
/* fallthrough */
|
||||
case 0:
|
||||
case 1:
|
||||
shell->flags = -0x8000;
|
||||
shell->rotAngle = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = 7;
|
||||
shell->velocity[1] = 3.0f;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
shell = (struct ShellActor *)actor;
|
||||
if (shell->state != 7) {
|
||||
switch (shell->state) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
func_8000EE58(actor - gActorList);
|
||||
/* fallthrough */
|
||||
case 0:
|
||||
case 1:
|
||||
shell->flags = -0x8000;
|
||||
shell->rotAngle = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = 7;
|
||||
shell->velocity[1] = 3.0f;
|
||||
break;
|
||||
case 6:
|
||||
func_802B02B4(shell, ACTOR_RED_SHELL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTOR_FAKE_ITEM_BOX:
|
||||
fakeItemBox = (struct FakeItemBox *)actor;
|
||||
player = &gPlayers[(s16)fakeItemBox->playerId];
|
||||
if (fakeItemBox->state == 0) {
|
||||
player->statusEffects &= ~0x00040000;
|
||||
}
|
||||
fakeItemBox->state = 2;
|
||||
fakeItemBox->flags = -0x8000;
|
||||
fakeItemBox->someTimer = 0;
|
||||
break;
|
||||
case ACTOR_BANANA:
|
||||
banana = (struct BananaActor *)actor;
|
||||
switch (banana->state) {
|
||||
case FIRST_BANANA_BUNCH_BANANA:
|
||||
case BANANA_BUNCH_BANANA:
|
||||
func_802B0570(banana);
|
||||
break;
|
||||
case HELD_BANANA:
|
||||
player = &gPlayers[banana->playerId];
|
||||
player->statusEffects &= ~0x00040000;
|
||||
/* fallthrough */
|
||||
case BANANA_ON_GROUND:
|
||||
banana->flags = -0x8000;
|
||||
banana->unk_04 = 0x003C;
|
||||
banana->state = 5;
|
||||
banana->velocity[1] = 3.0f;
|
||||
break;
|
||||
case DROPPED_BANANA:
|
||||
case DESTROYED_BANANA:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ACTOR_GREEN_SHELL:
|
||||
shell = (struct ShellActor *)actor;
|
||||
if (shell->state != GREEN_SHELL_HIT_A_RACER) {
|
||||
switch (shell->state) {
|
||||
case MOVING_SHELL:
|
||||
func_8000EE58(actor - gActorList);
|
||||
/* fallthrough */
|
||||
case HELD_SHELL:
|
||||
case RELEASED_SHELL:
|
||||
shell->flags = -0x8000;
|
||||
shell->rotAngle = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = GREEN_SHELL_HIT_A_RACER;
|
||||
shell->velocity[1] = 3.0f;
|
||||
break;
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
func_802B02B4(shell, ACTOR_GREEN_SHELL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTOR_BLUE_SPINY_SHELL:
|
||||
shell = (struct ShellActor *)actor;
|
||||
if (shell->state != DESTROYED_SHELL) {
|
||||
switch (shell->state) {
|
||||
case MOVING_SHELL:
|
||||
case RED_SHELL_LOCK_ON:
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
case BLUE_SHELL_TARGET_ELIMINATED:
|
||||
func_800C9EF4(shell->pos, 0x51018008);
|
||||
func_8000EE58(actor - gActorList);
|
||||
/* fallthrough */
|
||||
case HELD_SHELL:
|
||||
case RELEASED_SHELL:
|
||||
shell->flags = -0x8000;
|
||||
shell->rotAngle = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = DESTROYED_SHELL;
|
||||
shell->velocity[1] = 3.0f;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
shell = (struct ShellActor *)actor;
|
||||
if (shell->state != DESTROYED_SHELL) {
|
||||
switch (shell->state) {
|
||||
case MOVING_SHELL:
|
||||
case RED_SHELL_LOCK_ON:
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
case BLUE_SHELL_TARGET_ELIMINATED:
|
||||
func_8000EE58(actor - gActorList);
|
||||
/* fallthrough */
|
||||
case HELD_SHELL:
|
||||
case RELEASED_SHELL:
|
||||
shell->flags = -0x8000;
|
||||
shell->rotAngle = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = DESTROYED_SHELL;
|
||||
shell->velocity[1] = 3.0f;
|
||||
break;
|
||||
case TRIPLE_RED_SHELL:
|
||||
func_802B02B4(shell, ACTOR_RED_SHELL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTOR_FAKE_ITEM_BOX:
|
||||
fakeItemBox = (struct FakeItemBox *)actor;
|
||||
player = &gPlayers[(s16)fakeItemBox->playerId];
|
||||
if (fakeItemBox->state == HELD_FAKE_ITEM_BOX) {
|
||||
player->statusEffects &= ~0x00040000;
|
||||
}
|
||||
fakeItemBox->state = DESTROYED_FAKE_ITEM_BOX;
|
||||
fakeItemBox->flags = -0x8000;
|
||||
fakeItemBox->someTimer = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_802A00E8(struct Actor *arg0, struct Actor *arg1) {
|
||||
switch(arg0->type) {
|
||||
case ACTOR_GREEN_SHELL:
|
||||
if ((arg0->state == 0) || (arg0->state == 4)) {
|
||||
if ((arg0->state == HELD_SHELL) || (arg0->state == TRIPLE_GREEN_SHELL)) {
|
||||
arg0->flags |= 0x200;
|
||||
func_800C98B8(arg0->pos, arg0->velocity, 0x19019053);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
if ((arg0->state == 0) || (arg0->state == 6)) {
|
||||
if ((arg0->state == HELD_SHELL) || (arg0->state == TRIPLE_RED_SHELL)) {
|
||||
arg0->flags |= 0x200;
|
||||
func_800C98B8(arg0->pos, arg0->velocity, 0x19019053);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case ACTOR_BLUE_SPINY_SHELL:
|
||||
if (arg0->state == 0) {
|
||||
if (arg0->state == HELD_SHELL) {
|
||||
arg0->flags |= 0x200;
|
||||
func_800C98B8(arg0->pos, arg0->velocity, 0x19019053);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case ACTOR_FAKE_ITEM_BOX:
|
||||
if (arg0->state == 0) {
|
||||
if (arg0->state == HELD_FAKE_ITEM_BOX) {
|
||||
arg0->flags |= 0x200;
|
||||
func_800C98B8(arg0->pos, arg0->velocity, 0x19019053);
|
||||
return;
|
||||
@@ -3175,28 +3180,28 @@ void func_802A00E8(struct Actor *arg0, struct Actor *arg1) {
|
||||
|
||||
switch(arg1->type) {
|
||||
case ACTOR_GREEN_SHELL:
|
||||
if ((arg1->state == 0) || (arg1->state == 4)) {
|
||||
arg1->flags |= 0x200;
|
||||
func_800C98B8(arg1->pos, arg1->velocity, 0x19019053);
|
||||
return;
|
||||
if ((arg1->state == HELD_SHELL) || (arg1->state == TRIPLE_GREEN_SHELL)) {
|
||||
arg1->flags |= 0x200;
|
||||
func_800C98B8(arg1->pos, arg1->velocity, 0x19019053);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
if ((arg1->state == 0) || (arg1->state == 6)) {
|
||||
if ((arg1->state == HELD_SHELL) || (arg1->state == TRIPLE_RED_SHELL)) {
|
||||
arg1->flags |= 0x200;
|
||||
func_800C98B8(arg1->pos, arg1->velocity, 0x19019053);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case ACTOR_BLUE_SPINY_SHELL:
|
||||
if (arg1->state == 0) {
|
||||
if (arg1->state == HELD_SHELL) {
|
||||
arg1->flags |= 0x200;
|
||||
func_800C98B8(arg1->pos, arg1->velocity, 0x19019053);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case ACTOR_FAKE_ITEM_BOX:
|
||||
if (arg1->state == 0) {
|
||||
if (arg1->state == HELD_FAKE_ITEM_BOX) {
|
||||
arg1->flags |= 0x200;
|
||||
func_800C98B8(arg1->pos, arg1->velocity, 0x19019053);
|
||||
return;
|
||||
@@ -3218,14 +3223,14 @@ void func_802A0350(struct Actor *arg0, struct Actor *arg1) {
|
||||
return;
|
||||
}
|
||||
if (arg0->type == ACTOR_BLUE_SPINY_SHELL) {
|
||||
if (arg0->state == 0) {
|
||||
if (arg0->state == HELD_SHELL) {
|
||||
func_8029FDC8(arg0);
|
||||
}
|
||||
} else {
|
||||
func_8029FDC8(arg0);
|
||||
}
|
||||
if (arg1->type == ACTOR_BLUE_SPINY_SHELL) {
|
||||
if (arg1->state == 0) {
|
||||
if (arg1->state == HELD_SHELL) {
|
||||
func_8029FDC8(arg1);
|
||||
}
|
||||
} else {
|
||||
@@ -3692,6 +3697,7 @@ void func_802A171C(Camera *camera, struct FakeItemBox *fakeItemBox) {
|
||||
func_80297230(camera, (struct Actor *) fakeItemBox);
|
||||
return;
|
||||
}
|
||||
|
||||
func_802972B8(camera, (struct Actor *) fakeItemBox);
|
||||
someRot[0] = 0;
|
||||
someRot[1] = fakeItemBox->rot[1];
|
||||
|
||||
+8
-3
@@ -5,7 +5,7 @@
|
||||
#include "actor_types.h"
|
||||
|
||||
void func_8029E158(void);
|
||||
void func_80296A50(struct ShellActor*);
|
||||
void cleanup_red_and_green_shells(struct ShellActor*);
|
||||
void actor_init(struct Actor*, f32*, s16*, f32*, s16);
|
||||
void func_80297230(Camera*, struct Actor*);
|
||||
void func_802972B8(Camera*, struct Actor*);
|
||||
@@ -129,7 +129,12 @@ extern struct Actor gActorList[];
|
||||
extern Player gPlayers[];
|
||||
extern u16 gNumActors;
|
||||
extern u16 gNumPermanentActors;
|
||||
extern u16 D_8015F6FE; // Shell count? But why does actor type 2 (some kind of shrub?) increase it and not blue shells?
|
||||
|
||||
/**
|
||||
* Incremented by one every time the player spawns a new shell actor.
|
||||
* A cleaning routine runs once twenty-one shells have spawned.
|
||||
*/
|
||||
extern u16 gNumSpawnedShells;
|
||||
extern u16 D_802BA260; // Box Truck sub-type?
|
||||
|
||||
extern Player *gPlayerOne;
|
||||
@@ -388,7 +393,7 @@ extern u8 gTextureShrub[];
|
||||
|
||||
extern s8 D_800DC628[];
|
||||
extern s8 D_800DC630[];
|
||||
extern u16 D_800DC5FC;
|
||||
extern u16 gIsGamePaused;
|
||||
extern s8 D_802B8864[];
|
||||
|
||||
extern u16 D_800DC5BC;
|
||||
|
||||
+50
-50
@@ -54,10 +54,10 @@ void func_802B02B4(struct ShellActor *shell, s32 shellType) {
|
||||
|
||||
switch(shellType) {
|
||||
case ACTOR_GREEN_SHELL:
|
||||
shell->state = 5;
|
||||
shell->state = GREEN_SHELL_HIT_A_RACER;
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
shell->state = 7;
|
||||
shell->state = DESTROYED_SHELL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ void func_802B02B4(struct ShellActor *shell, s32 shellType) {
|
||||
// Sets velocities for a banana, used when a racer runs into
|
||||
// a banana bunch.
|
||||
void func_802B039C(struct BananaActor *banana) {
|
||||
banana->state = 1;
|
||||
banana->state = DROPPED_BANANA;
|
||||
banana->unk_04 = 0x00B4;
|
||||
banana->velocity[0] = ((f32) (random_int(0x00C8) - 0x64) * 0.015);
|
||||
banana->velocity[1] = ((f32) random_int(0x00C8)) * 0.015;
|
||||
@@ -103,7 +103,7 @@ void func_802B0570(struct BananaActor *banana) {
|
||||
}
|
||||
banana->flags = -0x8000;
|
||||
banana->unk_04 = 0x003C;
|
||||
banana->state = 5;
|
||||
banana->state = DESTROYED_BANANA;
|
||||
banana->velocity[1] = 3.0f;
|
||||
temp_v0_2 = (struct BananaBunchParent *) &gActorList[banana->parentIndex];
|
||||
temp_v0_2->bananaIndices[0] = -1;
|
||||
@@ -138,7 +138,7 @@ void func_802B0648(struct BananaBunchParent *banana_bunch) {
|
||||
return;
|
||||
}
|
||||
|
||||
banana->state = 1;
|
||||
banana->state = DROPPED_BANANA;
|
||||
banana->unk_04 = 0x00B4;
|
||||
banana->velocity[0] = 0.0f;
|
||||
banana->velocity[1] = 1.5f;
|
||||
@@ -177,7 +177,7 @@ void func_802B0788(s16 rawStickY, struct BananaBunchParent *banana_bunch, Player
|
||||
return;
|
||||
}
|
||||
|
||||
banana->state = 1;
|
||||
banana->state = DROPPED_BANANA;
|
||||
banana->unk_04 = 0x001E;
|
||||
if (banana->elderIndex != -1) {
|
||||
elderBanana = (struct BananaActor*)&gActorList[banana->elderIndex];
|
||||
@@ -203,10 +203,10 @@ s32 func_802B09C0(s16 bananaId) {
|
||||
return 0;
|
||||
}
|
||||
banana = (struct BananaActor*) &gActorList[bananaId];
|
||||
if (banana->state == 2) {
|
||||
if (banana->state == FIRST_BANANA_BUNCH_BANANA) {
|
||||
return 1;
|
||||
}
|
||||
if (banana->state == 3) {
|
||||
if (banana->state == BANANA_BUNCH_BANANA) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -317,12 +317,12 @@ s32 func_802B0E14(s16 arg0) {
|
||||
}
|
||||
temp = (struct ShellActor*) &gActorList[arg0];
|
||||
if (temp->type == ACTOR_GREEN_SHELL) {
|
||||
if (temp->state == 4) {
|
||||
if (temp->state == TRIPLE_GREEN_SHELL) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (temp->state == 6) {
|
||||
if (temp->state == TRIPLE_RED_SHELL) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -432,7 +432,7 @@ void update_obj_triple_shell(TripleShellParent *parent, s16 shellType) {
|
||||
shell->velocity[0] = someVelocity[0];
|
||||
shell->velocity[1] = someVelocity[1];
|
||||
shell->velocity[2] = someVelocity[2];
|
||||
shell->state = 2;
|
||||
shell->state = MOVING_SHELL;
|
||||
shell->someTimer = 0x001E;
|
||||
func_800C9060(parent->playerId, 0x19008004);
|
||||
func_800C90F4(parent->playerId, (player->characterId * 0x10) + 0x29008000);
|
||||
@@ -457,7 +457,7 @@ void update_obj_triple_shell(TripleShellParent *parent, s16 shellType) {
|
||||
shell->velocity[0] = someVelocity[0];
|
||||
shell->velocity[1] = someVelocity[1];
|
||||
shell->velocity[2] = someVelocity[2];
|
||||
shell->state = 2;
|
||||
shell->state = MOVING_SHELL;
|
||||
shell->someTimer = 0x001E;
|
||||
func_800C90F4(parent->playerId, (player->characterId * 0x10) + 0x29008000);
|
||||
func_800C9060(parent->playerId, 0x19008004);
|
||||
@@ -482,7 +482,7 @@ void update_obj_triple_shell(TripleShellParent *parent, s16 shellType) {
|
||||
shell->velocity[0] = someVelocity[0];
|
||||
shell->velocity[1] = someVelocity[1];
|
||||
shell->velocity[2] = someVelocity[2];
|
||||
shell->state = 2;
|
||||
shell->state = MOVING_SHELL;
|
||||
shell->someTimer = 0x001E;
|
||||
func_800C9060(parent->playerId, 0x19008004);
|
||||
func_800C90F4(parent->playerId, (player->characterId * 0x10) + 0x29008000);
|
||||
@@ -576,10 +576,10 @@ s32 func_802B19EC(TripleShellParent *parent, Player *player, s16 shellType, u16
|
||||
shell->flags = 0x9000;
|
||||
switch (shellType) {
|
||||
case ACTOR_GREEN_SHELL:
|
||||
shell->state = 4;
|
||||
shell->state = TRIPLE_GREEN_SHELL;
|
||||
break;
|
||||
case ACTOR_RED_SHELL:
|
||||
shell->state = 6;
|
||||
shell->state = TRIPLE_RED_SHELL;
|
||||
break;
|
||||
}
|
||||
shell->rotVelocity = 0;
|
||||
@@ -617,7 +617,7 @@ s32 func_802B1C9C(Player *player) {
|
||||
startingPos[2] = player->pos[2];
|
||||
func_802AD950(&shell->unk30, shell->boundingBoxSize + 1.0f, shell->pos[0], shell->pos[1], shell->pos[2], startingPos[0], startingPos[1], startingPos[2]);
|
||||
func_802B4E30((struct Actor *)shell);
|
||||
shell->state = 0;
|
||||
shell->state = HELD_SHELL;
|
||||
shell->rotVelocity = 0;
|
||||
shell->rotAngle = -0x8000;
|
||||
shell->playerId = player - gPlayerOne;
|
||||
@@ -650,7 +650,7 @@ s32 func_802B1E48(Player *player) {
|
||||
startingPos[2] = player->pos[2];
|
||||
func_802AD950(&shell->unk30, shell->boundingBoxSize + 1.0f, shell->pos[0], shell->pos[1], shell->pos[2], startingPos[0], startingPos[1], startingPos[2]);
|
||||
func_802B4E30((struct Actor *)shell);
|
||||
shell->state = 0;
|
||||
shell->state = HELD_SHELL;
|
||||
shell->rotVelocity = 0;
|
||||
shell->rotAngle = player->unk_02C[1] - 0x8000;
|
||||
shell->playerId = player - gPlayerOne;
|
||||
@@ -686,7 +686,7 @@ void update_obj_banana(struct BananaActor *banana) {
|
||||
|
||||
player = &gPlayers[banana->rot[0]];
|
||||
switch (banana->state) {
|
||||
case 0:
|
||||
case HELD_BANANA:
|
||||
temp_f2 = player->pos[0] - banana->pos[0];
|
||||
temp_f14 = player->pos[1] - banana->pos[1];
|
||||
temp_f16 = player->pos[2] - banana->pos[2];
|
||||
@@ -739,7 +739,7 @@ void update_obj_banana(struct BananaActor *banana) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case DROPPED_BANANA:
|
||||
if (banana->unk_04 != 0) {
|
||||
banana->unk_04 -= 1;
|
||||
if (banana->unk_04 == 0) {
|
||||
@@ -769,7 +769,7 @@ void update_obj_banana(struct BananaActor *banana) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case FIRST_BANANA_BUNCH_BANANA:
|
||||
someVelocity[0] = 0.0f;
|
||||
someVelocity[1] = 0.0f;
|
||||
someVelocity[2] = -5.0f;
|
||||
@@ -796,7 +796,7 @@ void update_obj_banana(struct BananaActor *banana) {
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
func_802B4E30((struct Actor *) banana);
|
||||
break;
|
||||
case 3:
|
||||
case BANANA_BUNCH_BANANA:
|
||||
elderBanana = (struct BananaActor*)&gActorList[banana->elderIndex];
|
||||
temp_f2 = elderBanana->pos[0] - banana->pos[0];
|
||||
temp_f14 = elderBanana->pos[1] - banana->pos[1];
|
||||
@@ -818,7 +818,7 @@ void update_obj_banana(struct BananaActor *banana) {
|
||||
func_802ADDC8(&banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
|
||||
func_802B4E30((struct Actor *) banana);
|
||||
break;
|
||||
case 5:
|
||||
case DESTROYED_BANANA:
|
||||
banana->velocity[1] -= 0.3f;
|
||||
if (banana->velocity[1] < -5.0f) {
|
||||
banana->velocity[1] = -5.0f;
|
||||
@@ -832,7 +832,7 @@ void update_obj_banana(struct BananaActor *banana) {
|
||||
destroy_actor((struct Actor *) banana);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case BANANA_ON_GROUND:
|
||||
banana->flags |= 0xC000;
|
||||
banana->flags &= ~0x1000;
|
||||
break;
|
||||
@@ -987,7 +987,7 @@ s32 func_802B2D70(Player *player) {
|
||||
}
|
||||
banana = (struct BananaActor *) &gActorList[actorIndex];
|
||||
banana->playerId = playerId;
|
||||
banana->state = 0;
|
||||
banana->state = HELD_BANANA;
|
||||
banana->unk_04 = 0x0014;
|
||||
player->statusEffects |= 0x40000;
|
||||
return actorIndex;
|
||||
@@ -1129,7 +1129,7 @@ void update_obj_green_shell(struct ShellActor *shell) {
|
||||
}
|
||||
shell->rotVelocity += 0x71C;
|
||||
switch (shell->state) {
|
||||
case 0:
|
||||
case HELD_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
func_802B0210(&player->unk_110, &shell->unk30);
|
||||
somePosVel[0] = 0.0f;
|
||||
@@ -1178,7 +1178,7 @@ void update_obj_green_shell(struct ShellActor *shell) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case RELEASED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->rotAngle -= 0xE38;
|
||||
@@ -1221,7 +1221,7 @@ void update_obj_green_shell(struct ShellActor *shell) {
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case MOVING_SHELL:
|
||||
if (shell->parentIndex > 0) {
|
||||
shell->parentIndex -= 1;
|
||||
if (shell->parentIndex == 0) {
|
||||
@@ -1246,7 +1246,7 @@ void update_obj_green_shell(struct ShellActor *shell) {
|
||||
shell->flags |= 0x80;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
parent = (TripleShellParent *) &gActorList[shell->parentIndex];
|
||||
if (parent->type != ACTOR_TRIPLE_GREEN_SHELL) {
|
||||
@@ -1267,7 +1267,7 @@ void update_obj_green_shell(struct ShellActor *shell) {
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
// Somehow, this fake match affects stack management up in case 2
|
||||
shell->velocity[1] -= (0, 0.3f);
|
||||
if (shell->velocity[1] < -5.0f) {
|
||||
@@ -1508,7 +1508,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
|
||||
shell->rotVelocity += 0x71C;
|
||||
switch (shell->state) {
|
||||
case 0:
|
||||
case HELD_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
func_802B0210(&player->unk_110, &shell->unk30);
|
||||
somePosVel[0] = 0.0f;
|
||||
@@ -1539,7 +1539,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
|
||||
if ((controller->buttonDepressed & 0x2000) != 0) {
|
||||
controller->buttonDepressed &= ~0x2000;
|
||||
shell->state = 1;
|
||||
shell->state = RELEASED_SHELL;
|
||||
if (player->unk_0C0 > 0) {
|
||||
shell->rotAngle = 0x78E3;
|
||||
} else {
|
||||
@@ -1547,12 +1547,12 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case RELEASED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->rotAngle -= 0x71C;
|
||||
if (shell->rotAngle < 0) {
|
||||
shell->state = 2;
|
||||
shell->state = MOVING_SHELL;
|
||||
func_800C9060(shell->playerId, 0x19008004U);
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + 0x29008000);
|
||||
if (pad13 == ACTOR_RED_SHELL) {
|
||||
@@ -1565,7 +1565,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
} else {
|
||||
shell->rotAngle += 0x71C;
|
||||
if (shell->rotAngle > 0) {
|
||||
shell->state = 2;
|
||||
shell->state = MOVING_SHELL;
|
||||
func_800C9060(shell->playerId, 0x19008004U);
|
||||
func_800C90F4(shell->playerId, (player->characterId * 0x10) + 0x29008000);
|
||||
if (pad13 == ACTOR_RED_SHELL) {
|
||||
@@ -1576,7 +1576,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shell->state == 2) {
|
||||
if (shell->state == MOVING_SHELL) {
|
||||
shell->someTimer = 0x001E;
|
||||
temp_f0 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
@@ -1599,14 +1599,14 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
shell->pos[2] = player->pos[2] + somePosVel[2];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case MOVING_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
shell->someTimer -= 1;
|
||||
if (shell->someTimer == 0) {
|
||||
shell->flags &= 0xEFFF;
|
||||
if (shell->type == ACTOR_BLUE_SPINY_SHELL) {
|
||||
shell->targetPlayer = gPlayerPositionLUT[0];
|
||||
shell->state = 8;
|
||||
shell->state = BLUE_SHELL_LOCK_ON;
|
||||
shell->shellId = 1000.0f;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
@@ -1621,13 +1621,13 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
shell->velocity[1] = 3.0f;
|
||||
shell->pathIndex = 0;
|
||||
shell->someTimer = 0x003C;
|
||||
shell->state = 7;
|
||||
shell->state = DESTROYED_SHELL;
|
||||
} else {
|
||||
shell->state = 3;
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
}
|
||||
} else {
|
||||
if (player->currentRank == 0) {
|
||||
shell->state = 4;
|
||||
shell->state = TRIPLE_GREEN_SHELL;
|
||||
shell->someTimer = 0x0258;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
@@ -1635,7 +1635,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
}
|
||||
shell->pathIndex = temp_v0;
|
||||
} else if (player->currentRank >= 5) {
|
||||
shell->state = 5;
|
||||
shell->state = GREEN_SHELL_HIT_A_RACER;
|
||||
shell->shellId = 1000.0f;
|
||||
temp_v0 = gNearestWaypointByPlayerId[player - gPlayerOne] + 8;
|
||||
if ((s32) D_80164430 < temp_v0) {
|
||||
@@ -1644,7 +1644,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
shell->pathIndex = temp_v0;
|
||||
shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
|
||||
} else {
|
||||
shell->state = 3;
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
shell->shellId = 1000.0f;
|
||||
shell->targetPlayer = gPlayerPositionLUT[player->currentRank - 1];
|
||||
}
|
||||
@@ -1664,10 +1664,10 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
func_802B4104(shell);
|
||||
break;
|
||||
case 3:
|
||||
case RED_SHELL_LOCK_ON:
|
||||
func_802B3E7C(shell, &gPlayers[shell->targetPlayer]);
|
||||
break;
|
||||
case 4:
|
||||
case TRIPLE_GREEN_SHELL:
|
||||
func_802B3B44(shell);
|
||||
if (shell->someTimer == 0) {
|
||||
if ((shell->flags & 0xF) == 0) {
|
||||
@@ -1677,7 +1677,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case GREEN_SHELL_HIT_A_RACER:
|
||||
func_802B3B44(shell);
|
||||
player = &gPlayers[shell->targetPlayer];
|
||||
temp_f0 = player->pos[0];
|
||||
@@ -1685,10 +1685,10 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
temp_f2 = player->pos[2];
|
||||
temp_f2 -= shell->pos[2];
|
||||
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
|
||||
shell->state = 3;
|
||||
shell->state = RED_SHELL_LOCK_ON;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
case TRIPLE_RED_SHELL:
|
||||
player = &gPlayers[shell->playerId];
|
||||
parent = (TripleShellParent *) &gActorList[shell->parentIndex];
|
||||
if (parent->type != ACTOR_TRIPLE_RED_SHELL) {
|
||||
@@ -1709,7 +1709,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
func_802B4E30((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
case DESTROYED_SHELL:
|
||||
shell->velocity[1] -= 0.3f;
|
||||
if (shell->velocity[1] < -5.0f) {
|
||||
shell->velocity[1] = -5.0f;
|
||||
@@ -1721,7 +1721,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
destroy_actor((struct Actor *) shell);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
case BLUE_SHELL_LOCK_ON:
|
||||
func_802B3B44(shell);
|
||||
shell->targetPlayer = gPlayerPositionLUT[0];
|
||||
player = &gPlayers[gPlayerPositionLUT[0]];
|
||||
@@ -1730,7 +1730,7 @@ void update_obj_red_blue_shell(struct ShellActor *shell) {
|
||||
temp_f2 = player->pos[2];
|
||||
temp_f2 -= shell->pos[2];
|
||||
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 40000.0f) {
|
||||
shell->state = 9;
|
||||
shell->state = BLUE_SHELL_TARGET_ELIMINATED;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
|
||||
+5
-5
@@ -1099,7 +1099,7 @@ void func_8001EE98(Player *player, Camera *camera, s8 arg2) {
|
||||
case 0:
|
||||
if (((player->unk_000 & 0x800) == 0x800) || (D_800DC51C == 1)) {
|
||||
D_80152300[var_s0] = 3;
|
||||
} else if (D_800DC5FC == 1) {
|
||||
} else if (gIsGamePaused == 1) {
|
||||
func_8001A0A4((s32) &D_80152300[var_s0], (s32) camera, (s32) player, (s32) arg2, var_s0);
|
||||
} else {
|
||||
func_8001A0DC((s16 *) &D_80152300[var_s0], camera, player, arg2, var_s0);
|
||||
@@ -1117,7 +1117,7 @@ void func_8001EE98(Player *player, Camera *camera, s8 arg2) {
|
||||
D_80152300->unk6 = 3U;
|
||||
} else {
|
||||
D_80164A88 = 0;
|
||||
if (D_800DC5FC == (u16) 1) {
|
||||
if (gIsGamePaused == (u16) 1) {
|
||||
temp_a0 = &D_80152300[var_s0];
|
||||
sp2C = temp_a0;
|
||||
func_8001A0A4((s32) temp_a0, (s32) camera, (s32) player, (s32) arg2, var_s0);
|
||||
@@ -1136,7 +1136,7 @@ void func_8001EE98(Player *player, Camera *camera, s8 arg2) {
|
||||
*(D_80152300 + 4) = 3;
|
||||
*(D_80152300 + 6) = 3;
|
||||
} else {
|
||||
if (D_800DC5FC == (u16) 1) {
|
||||
if (gIsGamePaused == (u16) 1) {
|
||||
temp_a0_3 = &D_80152300[var_s0];
|
||||
sp2C = temp_a0_3;
|
||||
func_8001A0A4((s32) temp_a0_3, (s32) camera, (s32) player, (s32) arg2, var_s0);
|
||||
@@ -1152,7 +1152,7 @@ void func_8001EE98(Player *player, Camera *camera, s8 arg2) {
|
||||
if (((player->unk_000 & 0x800) == 0x800) || (D_800DC51C == (u16) 1) || (D_8015F894 == 2)) {
|
||||
D_80152300[var_s0] = 3;
|
||||
} else {
|
||||
if (D_800DC5FC == (u16) 1) {
|
||||
if (gIsGamePaused == (u16) 1) {
|
||||
temp_a0_5 = &D_80152300[var_s0];
|
||||
sp2C = temp_a0_5;
|
||||
func_8001A0A4((s32) temp_a0_5, (s32) camera, (s32) player, (s32) arg2, var_s0);
|
||||
@@ -1165,7 +1165,7 @@ void func_8001EE98(Player *player, Camera *camera, s8 arg2) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (D_800DC5FC == 0) {
|
||||
if (gIsGamePaused == 0) {
|
||||
temp_a0_7 = &D_80152300[var_s0];
|
||||
temp_v0 = *temp_a0_7;
|
||||
switch (temp_v0) { /* switch 1; irregular */
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@
|
||||
extern u16 D_800DC5A8;
|
||||
|
||||
extern s32 D_800DC510;
|
||||
extern u16 D_8015F6FE;
|
||||
extern u16 gNumSpawnedShells;
|
||||
extern u16 D_80152308;
|
||||
extern s32 D_802BA038;
|
||||
extern s16 D_802BA048;
|
||||
@@ -64,7 +64,7 @@ struct UnkStruct_800DC5EC *D_800DC5EC = &D_8015F480[0];
|
||||
struct UnkStruct_800DC5EC *D_800DC5F0 = &D_8015F480[1];
|
||||
struct UnkStruct_800DC5EC *D_800DC5F4 = &D_8015F480[2];
|
||||
struct UnkStruct_800DC5EC *D_800DC5F8 = &D_8015F480[3];
|
||||
u16 D_800DC5FC = 0;
|
||||
u16 gIsGamePaused = 0;
|
||||
u8 *pAppNmiBuffer = (u8 *) &osAppNmiBuffer;
|
||||
s32 gIsMirrorMode = 0;
|
||||
f32 vtxStretchY = 1.0f;
|
||||
@@ -122,7 +122,7 @@ void setup_race(void) {
|
||||
func_8003D080();
|
||||
func_8006E9C0();
|
||||
D_800DC510 = 0;
|
||||
D_8015F6FE = 0;
|
||||
gNumSpawnedShells = 0;
|
||||
D_800DC5B8 = 0;
|
||||
D_80152308 = 0;
|
||||
D_802BA038 = -1;
|
||||
|
||||
+25
-25
@@ -4314,7 +4314,7 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DBAC.s")
|
||||
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
|
||||
extern ? D_80163DE8;
|
||||
extern UnkActorInner D_80164038;
|
||||
extern ? D_801641F8;
|
||||
extern ? gUnexpiredActorsList;
|
||||
static struct _struct_D_800DCC08_0xA8 D_800DCC08[0]; /* unable to generate initializer */
|
||||
s16 gCurrentCourseId; /* unable to generate initializer */
|
||||
|
||||
@@ -4380,7 +4380,7 @@ void func_8000DD78(void) {
|
||||
var_s2 += 0x40;
|
||||
var_s3 += 0x18;
|
||||
var_s0 += 0x54;
|
||||
} while (var_s2 != &D_801641F8);
|
||||
} while (var_s2 != &gUnexpiredActorsList);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DD78.s")
|
||||
@@ -4736,17 +4736,17 @@ void func_8000DF8C(s32 arg0) {
|
||||
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000DF8C.s")
|
||||
#endif
|
||||
|
||||
s32 func_8000ED14(s32 arg0, s16 arg1) {
|
||||
s32 func_8000ED14(s32 actorIndex, s16 arg1) {
|
||||
s32 i;
|
||||
s32 a2 = 0;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
|
||||
if (D_801641F8[i].unkC == 0) {
|
||||
D_801641F8[i].unkC = 1;
|
||||
D_801641F8[i].unkE = arg0;
|
||||
D_801641F8[i].unk10 = arg1;
|
||||
D_801641F8[i].unk14 = 0;
|
||||
if (gUnexpiredActorsList[i].unkC == 0) {
|
||||
gUnexpiredActorsList[i].unkC = 1;
|
||||
gUnexpiredActorsList[i].actorIndex = actorIndex;
|
||||
gUnexpiredActorsList[i].unk10 = arg1;
|
||||
gUnexpiredActorsList[i].unk14 = 0;
|
||||
a2 = 1;
|
||||
break;
|
||||
}
|
||||
@@ -4757,20 +4757,20 @@ s32 func_8000ED14(s32 arg0, s16 arg1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 func_8000ED80(s32 arg0) {
|
||||
struct Actor *actor = &gActorList[arg0];
|
||||
s32 func_8000ED80(s32 actorIndex) {
|
||||
struct Actor *actor = &gActorList[actorIndex];
|
||||
if (actor->type != 8) {
|
||||
return -1;
|
||||
}
|
||||
return func_8000ED14(arg0, 0);
|
||||
return func_8000ED14(actorIndex, 0);
|
||||
}
|
||||
|
||||
s32 func_8000EDC8(s32 arg0) {
|
||||
struct Actor *actor = &gActorList[arg0];
|
||||
s32 func_8000EDC8(s32 actorIndex) {
|
||||
struct Actor *actor = &gActorList[actorIndex];
|
||||
if (actor->type != 7) {
|
||||
return -1;
|
||||
}
|
||||
return func_8000ED14(arg0, 1);
|
||||
return func_8000ED14(actorIndex, 1);
|
||||
}
|
||||
|
||||
s32 func_8000EE10(s32 arg0) {
|
||||
@@ -4781,27 +4781,27 @@ s32 func_8000EE10(s32 arg0) {
|
||||
return func_8000ED14(arg0, 2);
|
||||
}
|
||||
|
||||
void func_8000EE58(s32 arg0) {
|
||||
struct unk_41F8 *phi;
|
||||
void func_8000EE58(s32 actorIndex) {
|
||||
struct unexpiredActors *phi;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
phi = &D_801641F8[i];
|
||||
if (arg0 == phi->unkE) {
|
||||
phi = &gUnexpiredActorsList[i];
|
||||
if (actorIndex == phi->actorIndex) {
|
||||
phi->unkC = 0;
|
||||
phi->unkE = 1000;
|
||||
phi->actorIndex = 1000; // out of bounds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_8000EEDC(void) {
|
||||
struct unk_41F8 *phi;
|
||||
struct unexpiredActors *phi;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
phi = &D_801641F8[i];
|
||||
phi = &gUnexpiredActorsList[i];
|
||||
phi->unkC = 0;
|
||||
phi->unkE = 1000;
|
||||
phi->actorIndex = 1000; // out of bounds
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4809,12 +4809,12 @@ void func_8000EF20(void) {
|
||||
s32 someIndex;
|
||||
f32 var_f20;
|
||||
struct Actor *temp_s1;
|
||||
struct unk_41F8 *var_s0;
|
||||
struct unexpiredActors *var_s0;
|
||||
|
||||
for (someIndex = 0; someIndex < 8; someIndex++) {
|
||||
var_s0 = &D_801641F8[someIndex];
|
||||
var_s0 = &gUnexpiredActorsList[someIndex];
|
||||
if (var_s0->unkC == 1) {
|
||||
temp_s1 = &gActorList[var_s0->unkE];
|
||||
temp_s1 = &gActorList[var_s0->actorIndex];
|
||||
var_s0->unk14++;
|
||||
switch (var_s0->unk10) {
|
||||
case 0:
|
||||
|
||||
+3
-3
@@ -14,12 +14,12 @@ struct struct_801642D8 {
|
||||
/* 0xC */ s32 unkC;
|
||||
};
|
||||
|
||||
struct unk_41F8 {
|
||||
struct unexpiredActors {
|
||||
s32 unk0;
|
||||
s32 unk4;
|
||||
s32 unk8;
|
||||
u16 unkC;
|
||||
u16 unkE;
|
||||
u16 actorIndex;
|
||||
s16 unk10;
|
||||
// s16 compilerPadding;
|
||||
u32 unk14;
|
||||
@@ -144,7 +144,7 @@ extern s32 D_80163488;
|
||||
|
||||
extern s32 D_8016337C;
|
||||
extern s32 gModeSelection;
|
||||
extern struct unk_41F8 D_801641F8[];
|
||||
extern struct unexpiredActors gUnexpiredActorsList[];
|
||||
extern s16 D_80164670;
|
||||
extern s16 D_80164672;
|
||||
extern s16 D_80164674;
|
||||
|
||||
+272
-467
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -910,7 +910,7 @@ void func_80059AC8(void) {
|
||||
s32 var_s0;
|
||||
s32 var_s1;
|
||||
|
||||
if (D_800DC5FC == 0) {
|
||||
if (gIsGamePaused == 0) {
|
||||
func_8008C1D8(&D_80165678);
|
||||
gRaceFrameCounter += 1;
|
||||
var_s2 = D_8018CF68;
|
||||
@@ -1082,7 +1082,7 @@ void func_8005A070(void) {
|
||||
D_8018D120 = 0;
|
||||
D_801655C0 = 0;
|
||||
func_80041D34();
|
||||
if (D_800DC5FC == 0) {
|
||||
if (gIsGamePaused == 0) {
|
||||
func_8005C728();
|
||||
if (gGamestate == ENDING_SEQUENCE) {
|
||||
func_80086604();
|
||||
|
||||
+1
-1
@@ -234,7 +234,7 @@ extern struct UnkStruct_800DC5EC *D_800DC5F0;
|
||||
extern struct UnkStruct_800DC5EC *D_800DC5F4;
|
||||
extern struct UnkStruct_800DC5EC *D_800DC5F8;
|
||||
|
||||
extern u16 D_800DC5FC;
|
||||
extern u16 gIsGamePaused;
|
||||
|
||||
extern s32 D_80164394;
|
||||
extern s32 D_80164398;
|
||||
|
||||
+2
-2
@@ -599,7 +599,7 @@ GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F008.s")
|
||||
//#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
//void play_sound2(?); // extern
|
||||
extern u16 D_800DC5FC;
|
||||
extern u16 gIsGamePaused;
|
||||
extern s8 D_801657E4;
|
||||
extern s8 D_801657E6;
|
||||
extern s8 D_801657E8;
|
||||
@@ -627,7 +627,7 @@ void func_8006F824(s32 arg0) {
|
||||
D_80165828 = D_801657F8;
|
||||
D_80165832.unk0 = D_80165800.unk0;
|
||||
D_80165832.unk1 = D_80165800.unk1;
|
||||
if ((arg0 != 0) && (D_800DC5FC == 0)) {
|
||||
if ((arg0 != 0) && (gIsGamePaused == 0)) {
|
||||
play_sound2(SOUND_ACTION_PING);
|
||||
}
|
||||
}
|
||||
|
||||
+16
-16
@@ -5188,7 +5188,7 @@ void func_8009CA6C(s32 arg0) {
|
||||
temp_v1->words.w0 = 0x06000000;
|
||||
temp_v1->words.w1 = (u32) &D_0D0076F8;
|
||||
phi_a1 = 0;
|
||||
if ((arg0 != 4) && (D_800DC5FC != 0)) {
|
||||
if ((arg0 != 4) && (gIsGamePaused != 0)) {
|
||||
phi_a1 = 1;
|
||||
}
|
||||
temp_t0 = *(&D_8018E7AC + arg0);
|
||||
@@ -5444,7 +5444,7 @@ void func_8009CE64(s32 *arg0, s32 arg2, s32 arg3) {
|
||||
break;
|
||||
}
|
||||
if (var_a1_2 != 0) {
|
||||
D_800DC5FC = 0;
|
||||
gIsGamePaused = 0;
|
||||
}
|
||||
}
|
||||
temp_v0_5 = find_8018D9E0_entry(0x000000BD);
|
||||
@@ -9877,7 +9877,7 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A4A24.s")
|
||||
#endif
|
||||
|
||||
void func_800A4B38(struct_8018D9E0_entry *arg0) {
|
||||
if (D_800DC5FC != 0) {
|
||||
if (gIsGamePaused != 0) {
|
||||
switch (gModeSelection) {
|
||||
case TIME_TRIALS:
|
||||
func_800A4BC8(arg0);
|
||||
@@ -10002,13 +10002,13 @@ void func_800A4EF8(struct_8018D9E0_entry *arg0) {
|
||||
s32 phi_s1;
|
||||
s32 phi_s0;
|
||||
|
||||
temp_v0 = (D_800DC5FC << 6) - 0x40 + &D_8015F480;
|
||||
temp_v0 = (gIsGamePaused << 6) - 0x40 + &D_8015F480;
|
||||
temp_v1 = temp_v0->unk30;
|
||||
temp_t0 = temp_v0->unk32;
|
||||
temp_t3 = (s32) temp_v0->unk2C / 2;
|
||||
temp_t4 = (s32) temp_v0->unk2E / 2;
|
||||
gDisplayListHead = draw_box(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3, temp_t0 + temp_t4, 0, 0, 0, 0x8C);
|
||||
temp_s3 = ((gScreenModeSelection << 5) + (D_800DC5FC * 8)) - 8 + &D_800E8540;
|
||||
temp_s3 = ((gScreenModeSelection << 5) + (gIsGamePaused * 8)) - 8 + &D_800E8540;
|
||||
phi_a1 = 0;
|
||||
phi_s2 = 0;
|
||||
do {
|
||||
@@ -10082,13 +10082,13 @@ void func_800A5084(struct_8018D9E0_entry *arg0) {
|
||||
s32 phi_s1;
|
||||
s8 **phi_s2;
|
||||
|
||||
temp_v0 = (D_800DC5FC << 6) - 0x40 + &D_8015F480;
|
||||
temp_v0 = (gIsGamePaused << 6) - 0x40 + &D_8015F480;
|
||||
temp_v1 = temp_v0->unk30;
|
||||
temp_t0 = temp_v0->unk32;
|
||||
temp_t3 = (s32) temp_v0->unk2C / 2;
|
||||
temp_t4 = (s32) temp_v0->unk2E / 2;
|
||||
gDisplayListHead = draw_box(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3, temp_t0 + temp_t4, 0, 0, 0, 0x8C);
|
||||
temp_s3 = ((gScreenModeSelection << 5) + (D_800DC5FC * 8)) - 8 + &D_800E85C0;
|
||||
temp_s3 = ((gScreenModeSelection << 5) + (gIsGamePaused * 8)) - 8 + &D_800E85C0;
|
||||
temp_s0 = (s32) ((((f32) get_string_width(D_800E7500[gCupSelection]) * 1.0f) + 10.0f) / 2.0f);
|
||||
temp_s1 = (s32) ((((f32) get_string_width(D_800E76CC[gCCSelection]) * 1.0f) + 10.0f) / 2.0f);
|
||||
set_text_color(3);
|
||||
@@ -10141,13 +10141,13 @@ void func_800A5360(struct_8018D9E0_entry *arg0) {
|
||||
s32 phi_s1;
|
||||
s32 phi_s0;
|
||||
|
||||
temp_v0 = (D_800DC5FC << 6) - 0x40 + &D_8015F480;
|
||||
temp_v0 = (gIsGamePaused << 6) - 0x40 + &D_8015F480;
|
||||
temp_v1 = temp_v0->unk30;
|
||||
temp_t0 = temp_v0->unk32;
|
||||
temp_t3 = (s32) temp_v0->unk2C / 2;
|
||||
temp_t4 = (s32) temp_v0->unk2E / 2;
|
||||
gDisplayListHead = draw_box(gDisplayListHead, temp_v1 - temp_t3, temp_t0 - temp_t4, temp_v1 + temp_t3, temp_t0 + temp_t4, 0, 0, 0, 0x8C);
|
||||
temp_s3 = ((gScreenModeSelection << 5) + (D_800DC5FC * 8)) - 8 + &D_800E8600;
|
||||
temp_s3 = ((gScreenModeSelection << 5) + (gIsGamePaused * 8)) - 8 + &D_800E8600;
|
||||
phi_a1 = 0;
|
||||
phi_s2 = 0;
|
||||
do {
|
||||
@@ -10190,7 +10190,7 @@ void func_800A54EC(void) {
|
||||
s32 temp_t2;
|
||||
? *phi_v1;
|
||||
|
||||
if (D_800DC5FC != 0) {
|
||||
if (gIsGamePaused != 0) {
|
||||
temp_t2 = gModeSelection;
|
||||
sp40 = temp_t2;
|
||||
temp_v1 = gDisplayListHead;
|
||||
@@ -10213,13 +10213,13 @@ void func_800A54EC(void) {
|
||||
phi_v1 = &D_800E8538;
|
||||
break;
|
||||
case VERSUS:
|
||||
phi_v1 = ((gScreenModeSelection << 5) + (D_800DC5FC * 8)) - 8 + &D_800E8540;
|
||||
phi_v1 = ((gScreenModeSelection << 5) + (gIsGamePaused * 8)) - 8 + &D_800E8540;
|
||||
break;
|
||||
case GRAND_PRIX:
|
||||
phi_v1 = ((gScreenModeSelection << 5) + (D_800DC5FC * 8)) - 8 + &D_800E85C0;
|
||||
phi_v1 = ((gScreenModeSelection << 5) + (gIsGamePaused * 8)) - 8 + &D_800E85C0;
|
||||
break;
|
||||
case BATTLE:
|
||||
phi_v1 = ((gScreenModeSelection << 5) + (D_800DC5FC * 8)) - 8 + &D_800E8600;
|
||||
phi_v1 = ((gScreenModeSelection << 5) + (gIsGamePaused * 8)) - 8 + &D_800E8600;
|
||||
break;
|
||||
}
|
||||
sp50 = phi_v1->unk0 - 8;
|
||||
@@ -14873,7 +14873,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) {
|
||||
s32 stackPadding;
|
||||
struct Controller *controller;
|
||||
|
||||
if (D_800DC5FC != 0) {
|
||||
if (gIsGamePaused != 0) {
|
||||
switch (arg0->unk4) {
|
||||
case 0:
|
||||
arg0->unk4 = D_800F0B50[gModeSelection];
|
||||
@@ -14894,7 +14894,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) {
|
||||
case 43:
|
||||
case 44:
|
||||
if (func_800B4520() == 0) {
|
||||
controller = &gControllers[D_800DC5FC - 1];
|
||||
controller = &gControllers[gIsGamePaused - 1];
|
||||
if ((controller->buttonPressed | controller->stickPressed) & 0x800) {
|
||||
if (D_800F0B50[gModeSelection] < arg0->unk4) {
|
||||
arg0->unk4--;
|
||||
@@ -14925,7 +14925,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) {
|
||||
if (controller->buttonPressed & 0x9000) {
|
||||
if (arg0->unk4 == D_800F0B50[gModeSelection]) {
|
||||
arg0->unk4 = 0;
|
||||
D_800DC5FC = 0;
|
||||
gIsGamePaused = 0;
|
||||
func_8028DF38();
|
||||
func_800C9F90(0U);
|
||||
} else {
|
||||
|
||||
+16
-22
@@ -878,31 +878,25 @@ s32 func_800B6088(s32 arg0) {
|
||||
return osPfsReadWriteFile(&gControllerPak1FileHandle, gControllerPak1FileNote, PFS_WRITE, arg0 * 0x80 /* 0x80 == sizeof(struct_8018EE10_entry) */, sizeof(struct_8018EE10_entry), (u8*) temp_v1);
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
extern s32 D_800DC714;
|
||||
#ifdef NON_MATCHING
|
||||
|
||||
s32 func_800B60E8(s32 arg0) {
|
||||
s32 temp_a2;
|
||||
s32 temp_v0;
|
||||
s32 temp_v1;
|
||||
s32 phi_v0;
|
||||
s32 phi_v1;
|
||||
void *phi_a1;
|
||||
struct struct_D_800DC714
|
||||
{
|
||||
u8 filler[0x100];
|
||||
};
|
||||
|
||||
temp_a2 = arg0 + 1;
|
||||
phi_v0 = 0;
|
||||
phi_v1 = 0;
|
||||
phi_a1 = D_800DC714 + (arg0 << 8);
|
||||
do {
|
||||
temp_v0 = phi_v0 + 4;
|
||||
temp_v1 = phi_v1 + ((phi_a1->unk0 * temp_a2) + phi_v0) + ((phi_a1->unk1 * temp_a2) + phi_v0) + 1 + ((phi_a1->unk2 * temp_a2) + phi_v0) + 2 + ((phi_a1->unk3 * temp_a2) + phi_v0) + 3;
|
||||
phi_v0 = temp_v0;
|
||||
phi_v1 = temp_v1;
|
||||
phi_a1 += 4;
|
||||
} while (temp_v0 != 0x100);
|
||||
return temp_v1 & 0xFF;
|
||||
u8 func_800B60E8(s32 arg0)
|
||||
{
|
||||
u8 *addr = *(s32 *)&D_800DC714 + (arg0 << 8);
|
||||
s32 checksum = 0, i;
|
||||
|
||||
for (i = 0; i < sizeof(struct struct_D_800DC714); i++)
|
||||
{
|
||||
checksum = i + ((arg0 + 1) * *addr++) + checksum;
|
||||
}
|
||||
return checksum;
|
||||
}
|
||||
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/menus/func_800B60E8.s")
|
||||
#endif
|
||||
|
||||
+5
-1
@@ -1,6 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <macros.h>
|
||||
#include <defines.h>
|
||||
#include <debug.h>
|
||||
#include <PR/gu.h>
|
||||
|
||||
#include "main.h"
|
||||
@@ -75,7 +76,7 @@ void func_80280268(s32 arg0) {
|
||||
|
||||
void credits_loop(void) {
|
||||
Camera *camera = &cameras[0];
|
||||
|
||||
|
||||
f32 temp_f12;
|
||||
f32 temp;
|
||||
f32 temp_f14;
|
||||
@@ -103,6 +104,9 @@ void credits_loop(void) {
|
||||
} else {
|
||||
func_80280000();
|
||||
func_80280038();
|
||||
#if DVDL
|
||||
display_dvdl();
|
||||
#endif
|
||||
gDPFullSync(gDisplayListHead++);
|
||||
gSPEndDisplayList(gDisplayListHead++);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <macros.h>
|
||||
#include <types.h>
|
||||
#include <debug.h>
|
||||
#include <common_structs.h>
|
||||
#include "main.h"
|
||||
#include "memory.h"
|
||||
@@ -483,6 +484,9 @@ void ending_sequence_loop(void) {
|
||||
}
|
||||
func_80281D00();
|
||||
func_80281540();
|
||||
#if VARIABLE_WATCH_DEBUG_LIST
|
||||
display_dvdl();
|
||||
#endif
|
||||
gDPFullSync(gDisplayListHead++);
|
||||
gSPEndDisplayList(gDisplayListHead++);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* please do not include this file.
|
||||
* ONLY FOR DEBUG PURPOSE
|
||||
*/
|
||||
#ifndef _VARIABLES_H_
|
||||
#define _VARIABLES_H_
|
||||
|
||||
// #include <actors_extended.h> does not work
|
||||
#include <actors.h>
|
||||
#include <camera.h>
|
||||
#include <camera_junk.h>
|
||||
#include <ceremony_and_credits.h>
|
||||
#include <code_800029B0.h>
|
||||
#include <code_80004740.h>
|
||||
#include <code_80005FD0.h>
|
||||
#include <code_8001F980.h>
|
||||
#include <code_80027D00.h>
|
||||
#include <code_8003DC40.h>
|
||||
#include <code_80057C60.h>
|
||||
#include <code_8006E9C0.h>
|
||||
#include <code_80071F00.h>
|
||||
#include <code_80086E70.h>
|
||||
#include <code_8008C1D0.h>
|
||||
#include <code_80091440.h>
|
||||
#include <code_80091750.h>
|
||||
#include <code_800AF9B0.h>
|
||||
#include <code_800B45E0.h>
|
||||
#include <code_80280000.h>
|
||||
#include <code_80280650.h>
|
||||
#include <code_80281780.h>
|
||||
#include <code_80281C40.h>
|
||||
#include <code_802AAA70.h>
|
||||
#include <common_textures.h>
|
||||
#include <credits.h>
|
||||
#include <data_segment2.h>
|
||||
#include <framebuffers.h>
|
||||
#include <hud_renderer.h>
|
||||
#include <kart_dma.h>
|
||||
#include <main.h>
|
||||
#include <math_util_2.h>
|
||||
#include <math_util.h>
|
||||
#include <memory.h>
|
||||
#include <menus.h>
|
||||
#include <profiler.h>
|
||||
#include <race_logic.h>
|
||||
#include <render_courses.h>
|
||||
#include <skybox_and_splitscreen.h>
|
||||
#include <spawn_players.h>
|
||||
#include <staff_ghosts.h>
|
||||
#include <textures.h>
|
||||
|
||||
#include <actor_types.h>
|
||||
#include <common_structs.h>
|
||||
#include <config.h>
|
||||
#include <course.h>
|
||||
#include <course_offsets.h>
|
||||
#include <debug.h>
|
||||
#include <defines.h>
|
||||
#include <functions.h>
|
||||
#include <global.h>
|
||||
#include <kart_attributes.h>
|
||||
#include <macros.h>
|
||||
#include <mk64.h>
|
||||
#include <objects.h>
|
||||
// #include <packed_displaylist_symbols_gen.h> does not work
|
||||
#include <packed_displaylist_symbols.h>
|
||||
#include <segments.h>
|
||||
#include <segment_symbols.h>
|
||||
#include <sounds.h>
|
||||
#include <trig_tables.h>
|
||||
#include <types.h>
|
||||
#include <ultra64.h>
|
||||
#include <variables.h>
|
||||
#include <vehicles.h>
|
||||
#include <vertice_count_gen.h>
|
||||
#include <waypoints.h>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,251 @@
|
||||
#include <ultra64.h>
|
||||
#include <debug.h>
|
||||
#include "debug.inc.c"
|
||||
#include <libc/stdio.h>
|
||||
|
||||
#if DVDL
|
||||
|
||||
u8 sDisplayListState = OK;
|
||||
|
||||
static u32 variable_to_u64(variableWatchAttributes *);
|
||||
static void round_up_float(u32 *, u8);
|
||||
static void u64_to_string(variableWatchAttributes *, u32, u8);
|
||||
static u32 _strlen(const char *);
|
||||
static void _memcpy(char *, const char *, u32);
|
||||
|
||||
void display_dvdl(void) {
|
||||
u32 variable;
|
||||
u32 i, vNameLen;
|
||||
u32 arraySize = sizeof(gMainVariableWatchList) / sizeof(variableWatchAttributes);
|
||||
s32 text_y_possition = TEXT_Y_POSSITION;
|
||||
u8 base;
|
||||
char *vName, *cBuffer;
|
||||
|
||||
load_debug_font();
|
||||
for (i = 0; i < arraySize; i++) {
|
||||
variableWatchAttributes *currentAttribute = &gMainVariableWatchList[i];
|
||||
currentAttribute->characterBuffer = currentAttribute->buffer;
|
||||
cBuffer = currentAttribute->characterBuffer;
|
||||
vName = currentAttribute->variableName;
|
||||
|
||||
variable = variable_to_u64(currentAttribute);
|
||||
base = 0;
|
||||
|
||||
if (currentAttribute->variableFlag & (DISPLAY_FLOAT_AS_TYPE | DISPLAY_FLOAT_WITH_ROUNDING)) {
|
||||
if (currentAttribute->variableFlag & DISPLAY_FLOAT_NUMBER) {
|
||||
sDisplayListState = BAD;
|
||||
} else if (currentAttribute->variableFlag & DISPLAY_FLOAT_WITH_ROUNDING) {
|
||||
round_up_float(&variable, currentAttribute->variableSize);
|
||||
}
|
||||
}
|
||||
|
||||
switch (currentAttribute->variableFlag & 0x8F) {
|
||||
case DISPLAY_FLOAT_NUMBER:
|
||||
sprintf(cBuffer, "%.3f", *(f32*)&variable);
|
||||
break;
|
||||
case DISPLAY_HEXIDECIMAL_NUMBER:
|
||||
base = HEXIDECIMAL;
|
||||
break;
|
||||
case DISPLAY_DECIMAL_NUMBER:
|
||||
base = DECIMAL;
|
||||
break;
|
||||
case DISPLAY_OCTAL_NUMBER:
|
||||
base = OCTAL;
|
||||
break;
|
||||
case DISPLAY_BINARY_NUMBER:
|
||||
base = BINARY;
|
||||
break;
|
||||
default:
|
||||
sDisplayListState = BAD;
|
||||
}
|
||||
if (base) {
|
||||
u64_to_string(currentAttribute, variable, base);
|
||||
}
|
||||
|
||||
if (sDisplayListState == BAD) {
|
||||
cBuffer = "NaN";
|
||||
}
|
||||
sDisplayListState = OK;
|
||||
|
||||
vNameLen = _strlen(vName);
|
||||
|
||||
debug_print_str2(TEXT_X_POSSITION, text_y_possition, vName);
|
||||
debug_print_str2(TEXT_X_POSSITION + (vNameLen * 0x8), text_y_possition, cBuffer);
|
||||
text_y_possition += 0x8;
|
||||
}
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
|
||||
gSPDisplayList(gDisplayListHead++, D_020076E0);
|
||||
func_80093C98(1);
|
||||
}
|
||||
|
||||
static u32 variable_to_u64(variableWatchAttributes *attribute) {
|
||||
u32 variable;
|
||||
|
||||
switch (attribute->variableSize) {
|
||||
case sizeof(u8):
|
||||
variable = *((u8*) attribute->variablePointer);
|
||||
break;
|
||||
case sizeof(u16):
|
||||
variable = *((u16*) attribute->variablePointer);
|
||||
break;
|
||||
case sizeof(u32):
|
||||
case sizeof(u64):
|
||||
variable = *((u32*) attribute->variablePointer); // no floating point rounding
|
||||
break;
|
||||
default:
|
||||
sDisplayListState = BAD;
|
||||
}
|
||||
|
||||
return variable;
|
||||
}
|
||||
|
||||
static void round_up_float(u32 *variable, u8 variableSize) {
|
||||
switch (variableSize) {
|
||||
case sizeof(u64):
|
||||
case sizeof(u32):
|
||||
*variable = (u32) (*(f32*) &*variable);
|
||||
break;
|
||||
default:
|
||||
sDisplayListState = BAD;
|
||||
}
|
||||
}
|
||||
|
||||
static void u64_to_string(variableWatchAttributes *attribute, u32 variable, u8 base) {
|
||||
s32 signedVariable;
|
||||
u32 stringDifference, indexesToFillAVariable, stringLengthWithZero;
|
||||
u32 indexesToFillAByte, upperIndex, remainder;
|
||||
u32 stringLength, lowerIndex, i;
|
||||
u8 variableSize;
|
||||
char *bufferedString;
|
||||
char swapRegister;
|
||||
|
||||
if (sDisplayListState == BAD) {
|
||||
return;
|
||||
}
|
||||
|
||||
bufferedString = attribute->characterBuffer;
|
||||
variableSize = attribute->variableSize;
|
||||
|
||||
// converts a minus number into it's unsigned equivalent for proper string conversion
|
||||
if (attribute->variableFlag & DISPLAY_SIGNED_NUMBER) {
|
||||
switch (variableSize) {
|
||||
case sizeof(u8):
|
||||
signedVariable = (s8) variable;
|
||||
if (signedVariable < 0) {
|
||||
signedVariable = -signedVariable;
|
||||
variable = (u8) signedVariable;
|
||||
*bufferedString = '-';
|
||||
bufferedString++;
|
||||
}
|
||||
break;
|
||||
case sizeof(u16):
|
||||
signedVariable = (s16) variable;
|
||||
if (signedVariable < 0) {
|
||||
signedVariable = -signedVariable;
|
||||
variable = (u16) signedVariable;
|
||||
*bufferedString = '-';
|
||||
bufferedString++;
|
||||
}
|
||||
break;
|
||||
case sizeof(u32):
|
||||
case sizeof(u64):
|
||||
signedVariable = (s32) variable;
|
||||
if (signedVariable < 0) {
|
||||
signedVariable = -signedVariable;
|
||||
variable = (u32) signedVariable;
|
||||
*bufferedString = '-';
|
||||
bufferedString++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
stringLength = 0;
|
||||
|
||||
// convert u64 into a string but it gets put in reverse
|
||||
if (base != HEXIDECIMAL) {
|
||||
do {
|
||||
stringLength++;
|
||||
*bufferedString = variable % base + '0';
|
||||
bufferedString++;
|
||||
variable /= base;
|
||||
} while (variable != 0);
|
||||
} else {
|
||||
do {
|
||||
stringLength++;
|
||||
remainder = variable % 16;
|
||||
|
||||
if ((remainder >= 0) && (remainder <= 9)) {
|
||||
*bufferedString = '0' + remainder;
|
||||
} else {
|
||||
*bufferedString = 'A' + (remainder - 10);
|
||||
}
|
||||
|
||||
bufferedString++;
|
||||
variable /= 16;
|
||||
} while (variable != 0);
|
||||
}
|
||||
|
||||
bufferedString -= stringLength;
|
||||
upperIndex = stringLength - 1;
|
||||
|
||||
// flip string 4321 --> 1234
|
||||
for (lowerIndex = 0; lowerIndex < stringLength >> 1; lowerIndex++) {
|
||||
swapRegister = bufferedString[lowerIndex];
|
||||
bufferedString[lowerIndex] = bufferedString[upperIndex];
|
||||
bufferedString[upperIndex] = swapRegister;
|
||||
upperIndex--;
|
||||
}
|
||||
|
||||
switch (base) {
|
||||
case BINARY:
|
||||
indexesToFillAByte = 8;
|
||||
break;
|
||||
case OCTAL:
|
||||
indexesToFillAByte = 3;
|
||||
break;
|
||||
case DECIMAL:
|
||||
bufferedString[stringLength] = '\0';
|
||||
return;
|
||||
case HEXIDECIMAL:
|
||||
indexesToFillAByte = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
stringLengthWithZero = stringLength - 1;
|
||||
indexesToFillAVariable = indexesToFillAByte * variableSize;
|
||||
stringDifference = indexesToFillAVariable - stringLengthWithZero;
|
||||
|
||||
// makes space and fills in extra space. u32 FE -> 000000FE
|
||||
for (i = stringLength; i > 0; i--) {
|
||||
bufferedString[stringDifference + i - 2] = bufferedString[i - 1];
|
||||
}
|
||||
for (i = 0; i < stringDifference - 1; i++) {
|
||||
bufferedString[i] = '0';
|
||||
}
|
||||
bufferedString[indexesToFillAVariable] = '\0';
|
||||
}
|
||||
|
||||
static u32 _strlen(const char *str) {
|
||||
u32 len;
|
||||
|
||||
len = 0;
|
||||
for (; *str != '\0'; str++) {
|
||||
len++;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
// unused but may be useful
|
||||
static void _memcpy(char *destStr, const char *copyStr, u32 copySize) {
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < copySize; i++) {
|
||||
*destStr = *copyStr;
|
||||
destStr++;
|
||||
copyStr++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
#include <ultra64.h>
|
||||
#include <debug.h>
|
||||
#include "all_variables.h"
|
||||
|
||||
#if DVDL
|
||||
|
||||
extern s32 gGlobalTimer;
|
||||
|
||||
/**
|
||||
* Edit this to edit what displays on the screen while the DVDL is active.
|
||||
* The Size of the structure array is calculated at compile time.
|
||||
*/
|
||||
variableWatchAttributes gMainVariableWatchList[] = {
|
||||
{
|
||||
"Global Timer: ",
|
||||
&gGlobalTimer,
|
||||
sizeof(gGlobalTimer),
|
||||
DISPLAY_DECIMAL_NUMBER | DISPLAY_SIGNED_NUMBER,
|
||||
0, 0
|
||||
},
|
||||
{
|
||||
"Actors: ",
|
||||
&gNumActors,
|
||||
sizeof(gNumActors),
|
||||
DISPLAY_DECIMAL_NUMBER,
|
||||
0, 0
|
||||
},
|
||||
{
|
||||
"Player Type: ",
|
||||
&gPlayers[0].unk_000,
|
||||
sizeof(gPlayerOne->unk_000),
|
||||
DISPLAY_HEXIDECIMAL_NUMBER,
|
||||
0, 0
|
||||
},
|
||||
{
|
||||
"X ",
|
||||
&gPlayers[0].pos[0],
|
||||
sizeof(gPlayerOne->pos[0]),
|
||||
DISPLAY_FLOAT_NUMBER,
|
||||
0, 0
|
||||
},
|
||||
{
|
||||
"Y ",
|
||||
&gPlayers[0].pos[1],
|
||||
sizeof(gPlayerOne->pos[1]),
|
||||
DISPLAY_FLOAT_NUMBER,
|
||||
0, 0
|
||||
},
|
||||
{
|
||||
"Z ",
|
||||
&gPlayers[0].pos[2],
|
||||
sizeof(gPlayerOne->pos[2]),
|
||||
DISPLAY_FLOAT_NUMBER,
|
||||
0, 0
|
||||
},
|
||||
};
|
||||
|
||||
#endif
|
||||
+4
-4
@@ -5202,7 +5202,7 @@ void func_80055164(s32 objectIndex) {
|
||||
temp_a3->words.w1 = (u32) D_0D0077A0;
|
||||
sp18 = temp_v1;
|
||||
func_80042E00(temp_v1->unk_004, (s16 *) temp_v1->unk_0BE, temp_v1->unk_000);
|
||||
if (D_800DC5FC == 0) {
|
||||
if (gIsGamePaused == 0) {
|
||||
sp18 = temp_v1;
|
||||
temp_v1->unk_0A2 = func_80004DFC(temp_v1->unk_070, temp_v1->unk_074, 0, temp_v1->unk_0A2);
|
||||
return;
|
||||
@@ -5254,7 +5254,7 @@ void func_800552BC(s32 objectIndex) {
|
||||
gDisplayListHead = temp_a0 + 8;
|
||||
temp_a0->words.w0 = 0x06000000;
|
||||
temp_a0->words.w1 = (u32) D_0D0077D0;
|
||||
if (D_800DC5FC == 0) {
|
||||
if (gIsGamePaused == 0) {
|
||||
sp18 = temp_v1;
|
||||
temp_v1->unk_0A2 = func_80004DFC(temp_v1->unk_070, temp_v1->unk_074, 0, temp_v1->unk_0A2);
|
||||
return;
|
||||
@@ -6198,8 +6198,8 @@ void func_80057778(void) {
|
||||
gSPDisplayList(gDisplayListHead++, D_0D007EB8);
|
||||
}
|
||||
|
||||
void debug_print_str2(s32 arg0, s32 arg1, char *arg2) {
|
||||
debug_print_string(&arg0, &arg1, arg2);
|
||||
void debug_print_str2(s32 xPos, s32 yPos, char *str) {
|
||||
debug_print_string(&xPos, &yPos, str);
|
||||
}
|
||||
|
||||
void print_str_num(s32 arg0, s32 arg1, char *arg2, u32 arg3) {
|
||||
|
||||
+26
-7
@@ -32,7 +32,7 @@
|
||||
#include "render_courses.h"
|
||||
#include "actors.h"
|
||||
#include "staff_ghosts.h"
|
||||
#include <defines.h>
|
||||
#include <debug.h>
|
||||
|
||||
// Declarations (not in this file)
|
||||
void func_80091B78(void);
|
||||
@@ -538,7 +538,7 @@ void race_logic_loop(void) {
|
||||
|
||||
D_80150112 = 0;
|
||||
D_80164AF0 = 0;
|
||||
if (D_800DC5FC != 0) {
|
||||
if (gIsGamePaused != 0) {
|
||||
func_80290B14();
|
||||
}
|
||||
if (gIsInQuitToMenuTransition != 0) {
|
||||
@@ -557,8 +557,7 @@ void race_logic_loop(void) {
|
||||
case SCREEN_MODE_1P:
|
||||
gTickSpeed = 2;
|
||||
staff_ghosts_loop();
|
||||
if (D_800DC5FC == 0) {
|
||||
|
||||
if (gIsGamePaused == 0) {
|
||||
for (i = 0; i < gTickSpeed; i++) {
|
||||
if (D_8015011E) {
|
||||
gCourseTimer += 0.01666666; // 1 / 60
|
||||
@@ -623,7 +622,7 @@ void race_logic_loop(void) {
|
||||
} else {
|
||||
gTickSpeed = 2;
|
||||
}
|
||||
if (D_800DC5FC == 0) {
|
||||
if (gIsGamePaused == 0) {
|
||||
for (i = 0; i < gTickSpeed; i++) {
|
||||
if (D_8015011E != 0) {
|
||||
gCourseTimer += 0.01666666;
|
||||
@@ -669,7 +668,7 @@ void race_logic_loop(void) {
|
||||
gTickSpeed = 2;
|
||||
}
|
||||
|
||||
if (D_800DC5FC == 0) {
|
||||
if (gIsGamePaused == 0) {
|
||||
for (i = 0; i < gTickSpeed; i++) {
|
||||
if (D_8015011E != 0) {
|
||||
gCourseTimer += 0.01666666;
|
||||
@@ -737,7 +736,7 @@ void race_logic_loop(void) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (D_800DC5FC == 0) {
|
||||
if (gIsGamePaused == 0) {
|
||||
for (i = 0; i < gTickSpeed; i++) {
|
||||
if (D_8015011E != 0) {
|
||||
gCourseTimer += 0.01666666;
|
||||
@@ -815,6 +814,9 @@ void race_logic_loop(void) {
|
||||
func_802A4300();
|
||||
func_800591B4();
|
||||
func_80093E20();
|
||||
#if DVDL
|
||||
display_dvdl();
|
||||
#endif
|
||||
gDPFullSync(gDisplayListHead++);
|
||||
gSPEndDisplayList(gDisplayListHead++);
|
||||
}
|
||||
@@ -833,6 +835,20 @@ void race_logic_loop(void) {
|
||||
*/
|
||||
|
||||
void game_state_handler(void) {
|
||||
#if DVDL
|
||||
if ((gControllerOne->button & L_TRIG) &&
|
||||
(gControllerOne->button & R_TRIG) &&
|
||||
(gControllerOne->button & Z_TRIG) &&
|
||||
(gControllerOne->button & A_BUTTON)) {
|
||||
gGamestateNext = CREDITS_SEQUENCE;
|
||||
} else if ((gControllerOne->button & L_TRIG) &&
|
||||
(gControllerOne->button & R_TRIG) &&
|
||||
(gControllerOne->button & Z_TRIG) &&
|
||||
(gControllerOne->button & B_BUTTON)) {
|
||||
gGamestateNext = ENDING_SEQUENCE;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (gGamestate) {
|
||||
case 7:
|
||||
game_init_clear_framebuffer();
|
||||
@@ -847,6 +863,9 @@ void game_state_handler(void) {
|
||||
init_rcp();
|
||||
// gGfxPool->mtxPool->m or gGfxPool?
|
||||
func_80094A64((Mtx *) gGfxPool->mtxPool->m);
|
||||
#if DVDL
|
||||
display_dvdl();
|
||||
#endif
|
||||
break;
|
||||
case RACING:
|
||||
race_logic_loop();
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ extern s16 gCurrentlyLoadedCourseId;
|
||||
extern s16 gCurrentCourseId;
|
||||
|
||||
extern s16 D_80164AF0;
|
||||
extern u16 D_800DC5FC;
|
||||
extern u16 gIsGamePaused; // 1 if the game is paused and 0 if the game is not paused
|
||||
extern u16 gIsInQuitToMenuTransition;
|
||||
|
||||
|
||||
|
||||
+8
-2
@@ -3,6 +3,12 @@
|
||||
#include <string.h>
|
||||
#include "printf.h"
|
||||
|
||||
#if DEBUG
|
||||
#define STATIC
|
||||
#else
|
||||
#define STATIC static
|
||||
#endif
|
||||
|
||||
#define ATOI(i, a) \
|
||||
for (i = 0; *a >= '0' && *a <= '9'; a++) \
|
||||
if (i < 999) \
|
||||
@@ -31,7 +37,7 @@ const u32 flags_arr[] = { FLAGS_SPACE, FLAGS_PLUS, FLAGS_MINUS, FLAGS_HASH, FLAG
|
||||
char _spaces[] = " ";
|
||||
char _zeroes[] = "00000000000000000000000000000000";
|
||||
|
||||
static void _Putfld(printf_struct *, va_list *, u8, u8 *);
|
||||
STATIC void _Putfld(printf_struct *, va_list *, u8, u8 *);
|
||||
|
||||
s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char *fmt, va_list args) {
|
||||
printf_struct sp78;
|
||||
@@ -111,7 +117,7 @@ s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char
|
||||
}
|
||||
}
|
||||
|
||||
static void _Putfld(printf_struct *a0, va_list *args, u8 type, u8 *buff) {
|
||||
STATIC void _Putfld(printf_struct *a0, va_list *args, u8 type, u8 *buff) {
|
||||
a0->part1_len = a0->num_leading_zeros = a0->part2_len = a0->num_mid_zeros = a0->part3_len =
|
||||
a0->num_trailing_zeros = 0;
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ int sprintf(char *dst, const char *fmt, ...) {
|
||||
s32 written;
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
written = _Putfld(proutSprintf, dst, fmt, args);
|
||||
written = _Printf(proutSprintf, dst, fmt, args);
|
||||
if (written >= 0) {
|
||||
dst[written] = 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -886,7 +886,7 @@ loop_2:
|
||||
}
|
||||
if ((temp_s0->buttonPressed & START_BUTTON) && (temp_v0_3 = temp_s0->button, ((temp_v0_3 & R_TRIG) == 0)) && !(temp_v0_3 & L_TRIG)) {
|
||||
func_8028DF00();
|
||||
D_800DC5FC = ((s32) (temp_s0 - gControllerOne) >> 4) + 1;
|
||||
gIsGamePaused = ((s32) (temp_s0 - gControllerOne) >> 4) + 1;
|
||||
temp_s0->buttonPressed = 0;
|
||||
func_800C9F90(1);
|
||||
D_80162DF0 = 1;
|
||||
|
||||
Reference in New Issue
Block a user