Matches in 80281fa0, render_courses, and create defines for sound cues. (#276)

* Matches, add permute, and add notice to quick runners

* 80281fa0 matches, render_courses, and create defines for audio

* Renamed 80281fa0.h, func naming, and deleted data_121DA0

* Added clang format

* Matched load_surface_map

* Match func in memory.c
This commit is contained in:
MegaMech
2022-11-21 04:06:12 -07:00
committed by GitHub
parent d7c9a14908
commit 0c10beae0e
39 changed files with 2693 additions and 3480 deletions
+4 -3
View File
@@ -15,6 +15,7 @@
#include "code_80005FD0.h"
#include "code_80071F00.h"
#include "code_8008C1D0.h"
#include <sounds.h>
s32 D_802BA050;
s32 D_802BA054;
@@ -858,7 +859,7 @@ void func_80298D7C(Camera *camera, Mat4 arg1, struct Actor *actor) {
Vec3s sp88 = { 0, 0, 0 };
s32 test;
if (gGamestate == 9) {
if (gGamestate == CREDITS_SEQUENCE) {
var_f22 = 9000000.0f;
} else {
var_f22 = 1000000.0f;
@@ -2142,7 +2143,7 @@ void place_segment_06(struct ActorSpawnData *arg0) {
}
temp_s0 = &gActorList[func_8029EC88(position, rotation, velocity, actorType)];
if (gGamestate == 9) {
if (gGamestate == CREDITS_SEQUENCE) {
func_802976D8(temp_s0->rot);
} else {
func_802ADDC8(&temp_s0->unk30, 5.0f, temp_s0->pos[0], temp_s0->pos[1], temp_s0->pos[2]);
@@ -3322,7 +3323,7 @@ void func_802A0450(Player *player, struct Actor *actor) {
case ACTOR_FALLING_ROCK:
if (!(player->unk_0BC & 0x80000000) && !(player->unk_000 & 0x100)) {
if (func_8029FB80(player, actor) == 1) {
func_800C98B8(actor->pos, actor->velocity, 0x19009005U);
func_800C98B8(actor->pos, actor->velocity, SOUND_ACTION_EXPLOSION);
if ((gModeSelection == TIME_TRIALS) && !(player->unk_000 & 0x1000)) {
D_80162DF8 = 1;
}
+9 -8
View File
@@ -7,6 +7,7 @@
#include "audio/external.h"
#include "audio/load.h"
#include "audio/data.h"
#include <sounds.h>
// REQUIRES void in the argument list to match properly
void func_800C13F0(void) {
@@ -4239,11 +4240,11 @@ void play_sound2(s32 arg0) {
s32 phi_a0_2;
phi_a0 = arg0;
if ((arg0 == 0x49008018) && (gCurrentCourseId == 0x12)) {
if ((arg0 == SOUND_ACTION_REV_ENGINE) && (gCurrentCourseId == 0x12)) {
phi_a0 = 0x49008027;
}
phi_a0_2 = phi_a0;
if ((phi_a0 == 0x49008019) && (gCurrentCourseId == 0x12)) {
if ((phi_a0 == SOUND_ACTION_REV_ENGINE_2) && (gCurrentCourseId == 0x12)) {
phi_a0_2 = 0x49008028;
}
play_sound(phi_a0_2, &D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
@@ -4848,12 +4849,12 @@ extern s8 D_800EA16C;
void func_800C9F90(s32 arg0) {
if ((arg0 & 0xFF) != 0) {
play_sound2(0x49008005);
play_sound2(SOUND_ACTION_GO_BACK_2);
func_800CBBB8(0xF1000000, 0);
D_800EA16C = 1;
return;
}
play_sound2(0x49008006);
play_sound2(SOUND_ACTION_UNKNOWN_CONFIRMATION);
func_800CBBB8(0xF2000000, 0);
D_800EA16C = 0;
}
@@ -5273,7 +5274,7 @@ void func_800CA984(s32 arg0) {
do {
temp_v0_2 = func_800C1C88(temp_s5 & 0xFF, temp_v0->pos, &D_800EA1C8, &temp_v0->unk_098, (u8) var_s0, 0x31029008U);
if (temp_v0_2 != NULL) {
play_sound(0x31029008U, temp_v0_2->unk18, var_s0 & 0xFF, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
play_sound(SOUND_ITEM_STAR, temp_v0_2->unk18, var_s0 & 0xFF, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
}
temp_t2 = (var_s0 + 1) & 0xFF;
var_s0 = temp_t2;
@@ -5327,7 +5328,7 @@ void func_800CAB4C(u8 arg0) {
block_4:
func_800C36C4(0, 1, 0x55, 5);
func_800C9060(arg0, 0x1900F013);
play_sound(0x5101C00C, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
play_sound(SOUND_ITEM_THUNDERBOLT, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
}
D_800EA168 = 1;
}
@@ -5368,10 +5369,10 @@ extern ? D_800EA1DC;
void func_800CAC60(s32 arg0) {
if ((D_800EA108 == 0) && (D_800EA0F0 == 0)) {
play_sound(0x1900F00C, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
play_sound(SOUND_ACTION_EXPLOSION_2, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
if ((D_800EA10C.unk0 != 1) && (D_800EA10C.unk1 != 1)) {
func_800C36C4(0, 1, 0x37, 5);
play_sound(0x5101C00C, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
play_sound(SOUND_ITEM_THUNDERBOLT, &D_800EA1C8, 0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
D_800EA168 = 1;
}
}
+4 -4
View File
@@ -1397,7 +1397,7 @@ GLOBAL_ASM("asm/non_matchings/camera/func_8001F394.s")
void func_8001F87C(s32 cameraId) {
s32 playerIndex;
// Why?
s32 test = cameraId;
s32 id = cameraId;
if(gPlayerOne){}
if (gActiveScreenMode == 0) {
@@ -1409,9 +1409,9 @@ void func_8001F87C(s32 cameraId) {
}
if ((playerIndex == 7) && (D_80164A2C == 0x0000003C)) {
D_80164A28 = 2;
D_80152300[test] = 1;
cameras[test].rot[1] = gPlayerOne[playerIndex].unk_02C[1];
cameras[test].unk_2C = gPlayerOne[playerIndex].unk_02C[1];
D_80152300[id] = 1;
cameras[id].rot[1] = gPlayerOne[playerIndex].unk_02C[1];
cameras[id].unk_2C = gPlayerOne[playerIndex].unk_02C[1];
}
}
}
+14
View File
@@ -3,6 +3,17 @@
#include "common_structs.h"
// todo put this define in types.h or similar.
// Certain functions are marked as having return values, but do not
// actually return a value. This causes undefined behavior, which we'd rather
// avoid on modern GCC. This only impacts -O2 and can matter for both the function
// itself and functions that call it.
#ifdef AVOID_UB
#define BAD_RETURN(cmd) void
#else
#define BAD_RETURN(cmd) cmd
#endif
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3f lookAt;
@@ -39,6 +50,9 @@ typedef struct {
/* 0xB4 */ f32 unk_B4;
} Camera; /* size = 0xB8 */
typedef BAD_RETURN(s32) (*CameraEvent)(struct Camera *c);
typedef CameraEvent CutsceneShot;
// The camera used for cutscenes appears to
// use a slightly different struct.
// Or even no struct at all.
File diff suppressed because it is too large Load Diff
+141
View File
@@ -0,0 +1,141 @@
#ifndef CEREMONY_AND_CREDITS_H
#define CEREMONY_AND_CREDITS_H
#include "common_structs.h"
struct struct_80282C40 {
s8 unk0;
s8 unk1;
s8 unk2;
u8 unk3;
s8 unk4;
s8 unk5;
Vec3s unk6;
};
struct struct_80285D80 {
u8 unk0[6];
s16 unk6[3];
};
struct struct_80286A04 {
u8 unk0;
u8 unk1;
struct struct_80285D80 *unk4;
struct struct_80285D80 *unk8;
u16 unkC;
};
/* Function Prototypes */
void vec3f_set_dupe(Vec3f, f32, f32, f32);
void vec3s_set_dupe(Vec3s, s16, s16, s16);
void vec3f_clear(Vec3f);
void vec3s_clear(Vec3s);
void vec3f_copy_dupe(Vec3f, Vec3f);
void vec3s_copy_dupe(Vec3s, Vec3s);
void func_80282040();
void func_80282048();
void func_80282050(Vec3f, Vec3f, s16);
void func_802820F8(Vec3f, Vec3f, s16);
s32 f32_lerp(f32*, f32, f32);
s32 func_80282200(s16*, s16, s16);
s32 set_transition_colour_fade_alpha_ending(f32*, f32, f32);
s32 func_80282364(s16*, s16, s16);
void reset_spline();
void func_80282434(Camera*);
void func_80282454(Vec3f, Vec3f, f32*, s16*, s16*);
void func_80282504(Vec3f, Vec3f, f32, s16, s16);
void func_802825C8(Vec3f, Vec3f, Vec3f, Vec3s);
s32 func_80282D90(Camera*, struct struct_80286A04*, struct struct_80286A04*, s32);
void func_80282E58(Camera*, struct struct_80282C40*, s32);
void func_80282F00(s16*, s16);
void func_80283240(s16);
s32 cutscene_event(CameraEvent event, Camera*, s16, s16);
s32 func_80283330(s32);
s32 func_80283428();
void func_80283968(Camera*);
void func_80283994(CinematicCamera*);
void func_802839B4(Camera*);
void func_802839CC(Camera*);
void func_802839E0(Camera*);
void func_80283A34(CinematicCamera*);
void func_80283A54(Camera*);
void func_80283A7C(CinematicCamera*);
void func_80283B6C(Camera*);
void func_80283BA4(Camera*);
void func_80283BF0(CinematicCamera*);
void func_80283C14(Camera*);
void func_80283C38(Camera*);
void func_80283C58(CinematicCamera*);
void func_80283C78(s32);
void func_80283CA8(CinematicCamera*);
void func_80283CD0(s32);
void play_sound_farewell(s32);
void func_80283D2C(CinematicCamera*);
void func_80283EA0(Camera*);
void func_80283ED0(Camera*);
void func_80283EF8(Camera*);
void func_80283F6C(Camera*);
void func_80283FCC(Camera*);
void func_80283FF4(Camera*);
void func_80284068(Camera*);
void func_802840C8(Camera*);
void func_80284154(Camera*);
void func_80284184(Camera*);
void func_802841E8(Camera*);
void func_8028422C(Camera*);
void func_802842A8(Camera*);
void func_802842D8(Camera*);
void func_80284418(Camera*);
void func_80284494(Camera*);
void func_802844FC(Camera*);
void func_8028454C(Camera*);
void func_802845EC(Camera*);
void func_8028461C(Camera*);
void func_80284648(Camera*);
void func_802846AC();
void func_802846B4(Camera*);
void func_80284CC0();
/* This is where I'd put my static data, if I had any */
extern u16 D_800DC5E4;
extern s32 D_80283FCC;
extern s32 D_80283FF4;
extern f32 D_802856B0;
extern f32 D_802856B4;
extern f32 D_802856B8;
extern f32 D_802856BC;
extern f32 D_802856C0;
extern struct struct_80282C40 D_802856DC[];
extern struct struct_80282C40 D_80285718[];
extern struct struct_80282C40 D_80285754[];
extern struct struct_80282C40 D_80285784[];
extern struct struct_80282C40 D_802857B4[];
extern struct struct_80282C40 D_802857CC[];
extern struct struct_80282C40 D_802857F0[];
extern struct struct_80282C40 D_80285850[];
extern struct struct_80282C40 D_802858B0[];
extern struct struct_80282C40 D_802858C8[];
extern struct struct_80282C40 D_80285910[];
extern struct struct_80282C40 D_80285928[];
extern struct struct_80282C40 D_80285940[];
extern struct struct_80282C40 D_80285A10[];
extern struct struct_80282C40 D_80285A4C[];
extern struct struct_80282C40 D_80285A88[];
extern struct struct_80282C40 D_80285AB8[];
extern struct struct_80282C40 D_80285AE8[];
extern struct struct_80282C40 D_80285B00[];
extern struct struct_80282C40 D_80285B18[];
extern struct struct_80282C40 D_80285B54[];
extern struct struct_80282C40 D_80285B90[];
extern struct struct_80282C40 D_80285BA8[];
extern struct struct_80282C40 D_80285C38[];
extern struct struct_80282C40 D_80285C74[];
extern s16 D_80285D14;
extern s32 D_802876D4;
extern s32 D_802876D8;
//extern struct credits_data_1FA0 *D_802876E0;
#endif // CEREMONY_AND_CREDITS_H
+7 -9
View File
@@ -3623,21 +3623,19 @@ f32 func_80030150(Player *player, s8 arg1) {
var_f2 = (player->unk_094 / 18.0f) * 216.0f;
if (var_f2 >= 8.0f) {
if ((player->unk_0BC & 0x200) != 0x200) {
if(1) {}
if ((s32) player->boundingBoxCorners[3].surfaceType >= 0xF) {
// ???????
} else {
} else
var_f0 += D_800E2E90[player->characterId][player->boundingBoxCorners[3].surfaceType];
}
if ((s32) player->boundingBoxCorners[2].surfaceType < 0xF) {
if ((s32) player->boundingBoxCorners[2].surfaceType < 0xF)
var_f0 += D_800E2E90[player->characterId][player->boundingBoxCorners[2].surfaceType];
}
if ((s32) player->boundingBoxCorners[1].surfaceType < 0xF) {
if ((s32) player->boundingBoxCorners[1].surfaceType < 0xF)
var_f0 += D_800E2EB0[player->characterId][player->boundingBoxCorners[1].surfaceType];
}
if ((s32) player->boundingBoxCorners[0].surfaceType < 0xF) {
if ((s32) player->boundingBoxCorners[0].surfaceType < 0xF)
var_f0 += D_800E2E90[player->characterId][player->boundingBoxCorners[0].surfaceType];
}
}
if (((player->unk_0BC & 8) != 8) && ((player->unk_0CA & 2) != 2)) {
temp_lo = player->unk_0C4 / 182;
+15 -8
View File
@@ -4,6 +4,7 @@
#include "code_8006E9C0.h"
#include "code_80071F00.h"
#include "objects.h"
#include <sounds.h>
void func_8006E9C0(void) {
@@ -610,22 +611,28 @@ block_26:
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F008.s")
#endif
#ifdef MIPS_TO_C
//#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void play_sound2(?); // extern
//void play_sound2(?); // extern
extern u16 D_800DC5FC;
extern s8 D_801657E4;
extern s8 D_801657E6;
extern s8 D_801657E8;
extern s8 D_801657F0;
extern s8 D_801657F8;
extern s8 D_80165800;
extern s8 D_80165808;
extern s8 D_80165810;
extern s8 D_80165818;
extern s8 D_80165820;
extern s8 D_80165828;
extern ? D_80165832;
struct UnkStr80165832 {
s8 unk0;
s8 unk1;
};
extern struct UnkStr80165832 D_80165800;
extern struct UnkStr80165832 D_80165832;
void func_8006F824(s32 arg0) {
D_80165808 = D_801657E4;
@@ -636,12 +643,12 @@ void func_8006F824(s32 arg0) {
D_80165832.unk0 = D_80165800.unk0;
D_80165832.unk1 = D_80165800.unk1;
if ((arg0 != 0) && (D_800DC5FC == 0)) {
play_sound2(0x4900801C);
play_sound2(SOUND_ACTION_PING);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F824.s")
#endif
//#else
//GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006F824.s")
//#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
+3 -3
View File
@@ -3846,7 +3846,7 @@ void func_80079380(s32 objectIndex, s32 arg1) {
if (func_8007278C(objectIndex, 0x00000014) != 0) {
temp_v1->unk_068 += 0x200;
if (arg1 == 0) {
play_sound2(0x49008003);
play_sound2(SOUND_ACTION_COUNTDOWN_LIGHT);
return;
}
}
@@ -3856,7 +3856,7 @@ void func_80079380(s32 objectIndex, s32 arg1) {
return;
case 9:
if ((func_8007278C(objectIndex, 8) != 0) && (arg1 == 0)) {
play_sound2(0x49008003);
play_sound2(SOUND_ACTION_COUNTDOWN_LIGHT);
return;
}
break;
@@ -3871,7 +3871,7 @@ void func_80079380(s32 objectIndex, s32 arg1) {
if (func_8007278C(objectIndex, 8) != 0) {
temp_v1->unk_068 += 0x200;
if (arg1 == 0) {
play_sound2(0x49008004);
play_sound2(SOUND_ACTION_GREEN_LIGHT);
return;
}
}
+4 -3
View File
@@ -12,6 +12,7 @@
#include "code_80057C60.h"
#include "code_8008C1D0.h"
#include <defines.h>
#include <sounds.h>
UNUSED void func_unnamed(void) {
@@ -237,7 +238,7 @@ void func_8008C528(Player *player, s8 arg1) {
player->unk_042 = 0;
if (((player->unk_000 & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->unk_000 & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) {
func_800C90F4(arg1, (temp_v1 * 0x10) + 0x29008005);
func_800C9060(arg1, 0x19009005);
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
} else {
func_800098FC(arg1, player);
}
@@ -1098,7 +1099,7 @@ void func_8008E6C0(Player *player, s8 arg1)
if (((gModeSelection == VERSUS) && ((player->unk_000 & 0x1000) != 0)) && (D_800DC51C == 0)) {
func_800CA24C(arg1);
}
func_800C9060(arg1, 0x19009005);
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
} else {
func_800098FC(arg1, player);
}
@@ -1196,7 +1197,7 @@ void func_8008EAE0(Player* player, s8 arg1) {
if (((player->unk_000 & 0x4000) == 0x4000) && ((player->unk_000 & 0x100) != 0x100)) {
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005);
func_800C9060(arg1, 0x19009005);
func_800C9060(arg1, SOUND_ACTION_EXPLOSION);
} else {
func_800098FC(arg1, player);
}
+58 -57
View File
@@ -13,6 +13,7 @@
#include "data_segment2.h"
#include "code_800AF9B0.h"
#include "variables.h"
#include <sounds.h>
// TODO: Move gGfxPool out of main.h
// Unfortunately that's not a small effort due to weird import structure in this project
#include "main.h"
@@ -1788,7 +1789,7 @@ void func_80095574(void) {
}
var_v0_2 = gMenuTimingCounter;
if (var_v0_2 == 2) {
play_sound2(0x49009009);
play_sound2(SOUND_INTRO_WELCOME);
var_v0_2 = gMenuTimingCounter;
}
if (var_v0_2 >= 0x12D) {
@@ -11709,7 +11710,7 @@ block_7:
}
if ((var_s1->unk20 != 0) && (var_s1->unk1C >= 3)) {
var_s1->unk20 = 0;
play_sound2(0x49018008);
play_sound2(SOUND_INTRO_LOGO);
}
break;
case 0xDA: /* switch 8 */
@@ -11727,7 +11728,7 @@ block_7:
case 0: /* switch 9 */
if (gControllerFive->unk4 & 0x10) {
var_s1->unk4 = (s32) 1U;
play_sound2(0x4900801C);
play_sound2(SOUND_ACTION_PING);
} else {
var_s1->visible = 0;
}
@@ -11753,7 +11754,7 @@ block_7:
case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 5 */
case CONFIRM_OK_SELECTION: /* switch 5 */
case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 5 */
case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 5 */
case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 5 */
func_800A9C40(var_s1);
break;
}
@@ -11776,7 +11777,7 @@ block_7:
case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 6 */
case CONFIRM_OK_SELECTION: /* switch 6 */
case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 6 */
case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 6 */
case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 6 */
func_800A9C40(var_s1);
break;
}
@@ -13032,7 +13033,7 @@ void func_800A9C40(struct_8018D9E0_entry *arg0) {
case 1:
func_800AA280();
temp_v0 = gMainMenuSelectionDepth;
if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT)) {
if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) {
arg0->unk1C = 0x20;
return;
}
@@ -13078,7 +13079,7 @@ void func_800A9D5C(struct_8018D9E0_entry *arg0) {
switch (temp_t1) {
case 2:
temp_v0 = gMainMenuSelectionDepth;
if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT)) {
if ((temp_v0 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v0 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) {
arg0->column = 0x00000080;
arg0->row = 0x0000003E;
return;
@@ -13185,7 +13186,7 @@ block_5:
arg0->row = (*(&D_800E86AC - 1 + D_8018EDF3) * 0x12) + temp_v0_2->row + 0x41;
return;
case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 2 */
case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 2 */
case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 2 */
temp_v0_3 = func_800AAE68(temp_a1, temp_a2, sp20);
temp_v1_2 = (arg0->type * 8) + -(sp24 * 8) + &D_800E70E8;
arg0->column = temp_v0_3->column + temp_v1_2->unk0;
@@ -13206,7 +13207,7 @@ block_5:
case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 3 */
case CONFIRM_OK_SELECTION: /* switch 3 */
case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 3 */
case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 3 */
case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 3 */
if ((temp_a1 != sp20) && (temp_a1 != sp1C)) {
arg0->visible = 0;
block_37:
@@ -13242,7 +13243,7 @@ block_37:
case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION: /* switch 4 */
case CONFIRM_OK_SELECTION: /* switch 4 */
case CONFIRM_OK_SELECTION_FROM_BACK_OUT: /* switch 4 */
case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT: /* switch 4 */
case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT: /* switch 4 */
if ((temp_a1 != sp20) && (temp_a1 != sp1C)) {
arg0->visible = 0;
goto block_37;
@@ -13281,7 +13282,7 @@ void func_800AA280(struct_8018D9E0_entry *arg0) {
temp_v1 = gMainMenuSelectionDepth;
temp_v0 = (arg0->type * 8) - 0x50 + &D_800E70A0;
if ((temp_v1 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v1 == TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT)) {
if ((temp_v1 == CONFIRM_OK_SELECTION_FROM_BACK_OUT) || (temp_v1 == TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT)) {
arg0->column = (s32) temp_v0->unk0;
arg0->row = (s32) temp_v0->unk2;
return;
@@ -13327,7 +13328,7 @@ void func_800AA2EC(struct_8018D9E0_entry *arg0) {
case GAME_MODE_CC_OR_TIME_TRIALS_OPTIONS_SELECTION:
case CONFIRM_OK_SELECTION:
case CONFIRM_OK_SELECTION_FROM_BACK_OUT:
case TIME_TRAILS_DATA_SELECTION_FROM_BACK_OUT:
case TIME_TRIALS_DATA_SELECTION_FROM_BACK_OUT:
if ((arg0->unk4 == 0) && (temp_v0 = D_8018EDF3, (temp_v0 == 1)) && (*(&D_800E86AC - 1 + temp_v0) == 1)) {
if (D_800E86F8 != 0) {
sp20 = 0;
@@ -14798,7 +14799,7 @@ void func_800AC458(struct_8018D9E0_entry *arg0) {
arg0 = temp_a3;
*temp_v1_2 += 1;
sp1C = temp_a1_2;
play_sound2(0x49008017, temp_a1_2, temp_a2_2, temp_a3);
play_sound2(SOUND_ACTION_COUNT_SCORE, temp_a1_2, temp_a2_2, temp_a3);
phi_a3 = arg0;
if ((*(D_8018D9BC + temp_a1_2) == 0) && (arg0->unk20 == 0)) {
arg0->unk20 = 1;
@@ -14883,7 +14884,7 @@ loop_41:
if ((D_8018D9D8 != 0) && (D_800DDB24 != 0)) {
temp_a3->unk4 = 0xC;
temp_a3->unk20 = temp_a3->row;
play_sound2(0x49008015);
play_sound2(SOUND_ACTION_NEXT_COURSE);
return;
}
break;
@@ -15003,7 +15004,7 @@ block_24:
if (temp_v0_3 >= 0xC) {
temp_a1_2->unk4 = temp_v0_3 - 1;
arg0 = temp_a1_2;
play_sound2(0x49008000, temp_a1_2);
play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2);
temp_f0 = (f64) arg0->unk24;
phi_a1 = arg0;
if (temp_f0 < 4.2) {
@@ -15022,7 +15023,7 @@ block_24:
if (temp_v0_4 < 0xC) {
phi_a1->unk4 = temp_v0_4 + 1;
arg0 = phi_a1;
play_sound2(0x49008000, phi_a1);
play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1);
temp_f0_2 = (f64) arg0->unk24;
phi_a1_2 = arg0;
if (temp_f0_2 < 4.2) {
@@ -15037,7 +15038,7 @@ block_24:
arg0 = phi_a1_2;
func_8009DFE0(0x1E, phi_a1_2);
func_800CA330(0x19);
play_sound2(0x4900801B);
play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN);
temp_f0_3 = (f64) arg0->unk24;
phi_a1_4 = arg0;
if (temp_f0_3 < 4.2) {
@@ -15146,7 +15147,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) {
if (temp_v0_2 >= 0xB) {
temp_a1_2->unk4 = temp_v0_2 - 1;
arg0 = temp_a1_2;
play_sound2(0x49008000, temp_a1_2);
play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2);
temp_f0 = (f64) arg0->unk24;
phi_a1 = arg0;
if (temp_f0 < 4.2) {
@@ -15165,7 +15166,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) {
if (temp_v0_3 < 0xD) {
phi_a1->unk4 = temp_v0_3 + 1;
arg0 = phi_a1;
play_sound2(0x49008000, phi_a1);
play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1);
temp_f0_2 = (f64) arg0->unk24;
phi_a1_2 = arg0;
if (temp_f0_2 < 4.2) {
@@ -15178,7 +15179,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) {
if ((phi_v1 & 0x9000) != 0) {
arg0 = phi_a1_2;
func_8009DFE0(0x1E, phi_a1_2);
play_sound2(0x49008016);
play_sound2(SOUND_MENU_OK_CLICKED);
if (gModeSelection == VERSUS) {
D_8018EDF4 = (s8) arg0->unk4;
} else {
@@ -15491,7 +15492,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) {
if ((D_80162DF8 == 1) && (temp_t2 == 9)) {
arg0->unk4 = temp_t2 - 1;
}
play_sound2(0x49008000, temp_a1);
play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1);
temp_f0 = (f64) arg0->unk24;
if (temp_f0 < 4.2) {
arg0->unk24 = (f32) (temp_f0 + 4.0);
@@ -15517,7 +15518,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) {
arg0->unk4 = temp_v0_5 - 2;
phi_a1_3 = gControllerOne->unk6;
} else {
play_sound2(0x49008000, phi_a1_2);
play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_2);
temp_f0_2 = (f64) arg0->unk24;
if (temp_f0_2 < 4.2) {
arg0->unk24 = (f32) (temp_f0_2 + 4.0);
@@ -15543,7 +15544,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) {
func_800B6708();
arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11;
sp28 = 1;
play_sound2(0x49008001);
play_sound2(SOUND_MENU_SELECT);
phi_v1 = 1;
break;
case 2: /* switch 4 */
@@ -15584,13 +15585,13 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) {
break;
}
if (phi_v1_2 != 0) {
play_sound2(0x4900FF07);
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) == 0) {
func_800B6708();
arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11;
play_sound2(0x49008001);
play_sound2(SOUND_MENU_SELECT);
return;
}
goto block_56;
@@ -15598,17 +15599,17 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) {
block_56:
if (D_8018EB7C >= D_8018EB78) {
arg0->unk4 = 0xE;
play_sound2(0x4900FF07);
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
if (gControllerPakNumPagesFree >= 0x79) {
arg0->unk4 = 0x13;
arg0->unk1C = 0;
play_sound2(0x49008001);
play_sound2(SOUND_MENU_SELECT);
return;
}
arg0->unk4 = 0xE;
play_sound2(0x4900FF07);
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
} else {
@@ -15616,7 +15617,7 @@ block_56:
D_8018EDF5 = (s8) temp_v0_6;
arg0->unk4 = 0x1E;
arg0->unk20 = arg0->row;
play_sound2(0x49008015, phi_a1_3);
play_sound2(SOUND_ACTION_NEXT_COURSE, phi_a1_3);
temp_f0_4 = (f64) arg0->unk24;
if (temp_f0_4 < 4.2) {
arg0->unk24 = (f32) (temp_f0_4 + 4.0);
@@ -15698,7 +15699,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) {
arg0->unk4 = temp_v0 - 1;
sp18 = temp_a2;
arg0 = arg0;
play_sound2(0x49008000);
play_sound2(SOUND_MENU_CURSOR_MOVE);
temp_f0 = (f64) arg0->unk24;
if (temp_f0 < 4.2) {
arg0->unk24 = (f32) (temp_f0 + 4.0);
@@ -15716,7 +15717,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) {
arg0->unk4 = temp_v0_2 + 1;
sp18 = temp_t2 + &gControllers;
arg0 = arg0;
play_sound2(0x49008000);
play_sound2(SOUND_MENU_CURSOR_MOVE);
temp_f0_2 = (f64) arg0->unk24;
phi_a1 = arg0;
if (temp_f0_2 < 4.2) {
@@ -15730,7 +15731,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) {
temp_v0_3 = *(&D_800F0B50 + gModeSelection);
if (phi_a1->unk4 != temp_v0_3) {
phi_a1->unk4 = (s32) temp_v0_3;
play_sound2(0x49008002);
play_sound2(SOUND_MENU_GO_BACK);
return;
}
}
@@ -15744,7 +15745,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) {
}
arg0 = phi_a1;
func_8009DFE0(0x1E, phi_a1, temp_t2 + &gControllers, &gModeSelection);
play_sound2(0x4900801B);
play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN);
func_800CA330(0x3C);
temp_f0_3 = (f64) arg0->unk24;
if (temp_f0_3 < 4.2) {
@@ -15847,7 +15848,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) {
}
if ((gControllerOne->unk6 & 0x1000) != 0) {
arg0->unk4 = 0xF;
play_sound2(0x49008005);
play_sound2(SOUND_ACTION_GO_BACK_2);
return;
}
if (D_8018CAE0 != 0) {
@@ -15881,7 +15882,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) {
temp_v1 = arg0->unk4;
if (temp_v1 >= 0xC) {
arg0->unk4 = temp_v1 - 1;
play_sound2(0x49008000, temp_a1);
play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1);
temp_f0 = (f64) arg0->unk24;
if (temp_f0 < 4.2) {
arg0->unk24 = (f32) (temp_f0 + 4.0);
@@ -15897,7 +15898,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) {
temp_v1_2 = arg0->unk4;
if (temp_v1_2 < 0x10) {
arg0->unk4 = temp_v1_2 + 1;
play_sound2(0x49008000, phi_a1);
play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1);
temp_f0_2 = (f64) arg0->unk24;
if (temp_f0_2 < 4.2) {
arg0->unk24 = (f32) (temp_f0_2 + 4.0);
@@ -15931,7 +15932,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) {
}
case 5: /* switch 3 */
if (phi_v1 != 0) {
play_sound2(0x49008001);
play_sound2(SOUND_MENU_SELECT);
return;
}
if (D_800E86F8 == 0) {
@@ -15963,13 +15964,13 @@ void func_800AE218(struct_8018D9E0_entry *arg0) {
break;
}
if (phi_v1_2 != 0) {
play_sound2(0x4900FF07);
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) == 0) {
func_800B6708();
arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x1E;
play_sound2(0x49008001);
play_sound2(SOUND_MENU_SELECT);
return;
}
goto block_49;
@@ -15977,21 +15978,21 @@ void func_800AE218(struct_8018D9E0_entry *arg0) {
block_49:
if (D_8018EB7C >= D_8018EB78) {
arg0->unk4 = 0x18;
play_sound2(0x4900FF07);
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
if (gControllerPakNumPagesFree >= 0x79) {
arg0->unk4 = 0x20;
arg0->unk1C = 0;
play_sound2(0x49008001);
play_sound2(SOUND_MENU_SELECT);
return;
}
arg0->unk4 = 0x18;
play_sound2(0x4900FF07);
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
func_8009DFE0(0x1E);
play_sound2(0x49008016);
play_sound2(SOUND_MENU_OK_CLICKED);
func_800CA330(0x19);
func_800CA388(0x19);
temp_f0_4 = (f64) arg0->unk24;
@@ -16011,7 +16012,7 @@ block_49:
case 41: /* switch 1 */
if ((gControllerOne->unk6 & 0xD000) != 0) {
arg0->unk4 = 0x10;
play_sound2(0x49008002);
play_sound2(SOUND_MENU_GO_BACK);
temp_f0_5 = (f64) arg0->unk24;
if (temp_f0_5 < 4.2) {
arg0->unk24 = (f32) (temp_f0_5 + 4.0);
@@ -16030,7 +16031,7 @@ block_49:
temp_v1_3 = arg0->unk4;
if (temp_v1_3 >= 0x1F) {
arg0->unk4 = temp_v1_3 - 1;
play_sound2(0x49008000, temp_a1_2);
play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_2);
temp_f0_6 = (f64) arg0->unk24;
if (temp_f0_6 < 4.2) {
arg0->unk24 = (f32) (temp_f0_6 + 4.0);
@@ -16044,7 +16045,7 @@ block_49:
temp_v1_4 = arg0->unk4;
if (temp_v1_4 < 0x1F) {
arg0->unk4 = temp_v1_4 + 1;
play_sound2(0x49008000, phi_a1_2);
play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_2);
temp_f0_7 = (f64) arg0->unk24;
if (temp_f0_7 < 4.2) {
arg0->unk24 = (f32) (temp_f0_7 + 4.0);
@@ -16056,7 +16057,7 @@ block_49:
temp_a0_3 = gControllerOne->unk6;
if ((temp_a0_3 & 0x4000) != 0) {
arg0->unk4 = 0x10;
play_sound2(0x49008002);
play_sound2(SOUND_MENU_GO_BACK);
return;
}
if ((temp_a0_3 & 0x9000) != 0) {
@@ -16069,7 +16070,7 @@ block_49:
} else {
arg0->unk4 = 0x23;
}
play_sound2(0x49008001);
play_sound2(SOUND_MENU_SELECT);
temp_f0_8 = (f64) arg0->unk24;
if (temp_f0_8 < 4.2) {
arg0->unk24 = (f32) (temp_f0_8 + 4.0);
@@ -16098,7 +16099,7 @@ block_49:
phi_a0_2 = temp_a0_5;
if (((temp_a1_3 & 0x800) != 0) && ((s32) (u32) arg0->unk4 >= 0x24)) {
arg0->unk4 = (u32) arg0->unk4 - 1;
play_sound2(0x49008000, temp_a1_3);
play_sound2(SOUND_MENU_CURSOR_MOVE, temp_a1_3);
temp_f0_9 = (f64) arg0->unk24;
if (temp_f0_9 < 4.2) {
arg0->unk24 = (f32) (temp_f0_9 + 4.0);
@@ -16113,7 +16114,7 @@ block_49:
temp_v1_5 = arg0->unk4;
if (temp_v1_5 < 0x24) {
arg0->unk4 = temp_v1_5 + 1;
play_sound2(0x49008000, phi_a1_3);
play_sound2(SOUND_MENU_CURSOR_MOVE, phi_a1_3);
temp_f0_10 = (f64) arg0->unk24;
if (temp_f0_10 < 4.2) {
arg0->unk24 = (f32) (temp_f0_10 + 4.0);
@@ -16124,14 +16125,14 @@ block_49:
}
if ((phi_a0_2 & 0x4000) != 0) {
arg0->unk4 = arg0->unk20 + 0x1E;
play_sound2(0x49008002);
play_sound2(SOUND_MENU_GO_BACK);
return;
}
if ((phi_a0_2 & 0x9000) != 0) {
if (arg0->unk4 == 0x24) {
arg0->unk4 = 0x28;
arg0->unk1C = 0;
play_sound2(0x49008001);
play_sound2(SOUND_MENU_SELECT);
temp_f0_11 = (f64) arg0->unk24;
if (temp_f0_11 < 4.2) {
arg0->unk24 = (f32) (temp_f0_11 + 4.0);
@@ -16139,7 +16140,7 @@ block_49:
}
} else {
arg0->unk4 = arg0->unk20 + 0x1E;
play_sound2(0x49008002);
play_sound2(SOUND_MENU_GO_BACK);
return;
}
}
@@ -16148,12 +16149,12 @@ block_49:
if (arg0->unk1C == 1) {
if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) != 0) {
arg0->unk4 = 0x29;
play_sound2(0x4900FF07);
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
if (func_800B6178(arg0->unk20) != 0) {
arg0->unk4 = 0x29;
play_sound2(0x4900FF07);
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
goto block_107;
@@ -16403,10 +16404,10 @@ void func_800AF004(struct_8018D9E0_entry *arg0) {
arg0->unk4 = 6;
arg0->unk1C = 0;
if ((s32) D_802874F5 < 3) {
play_sound2(0x49008016);
play_sound2(SOUND_MENU_OK_CLICKED);
return;
}
play_sound2(0x4900801B);
play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN);
return;
}
break;
+1 -1
View File
@@ -55,7 +55,7 @@ void func_80280268(s32 arg0) {
gIsInQuitToMenuTransition = 1;
gQuitToMenuTransitionCounter = 5;
D_802874A0 = 1;
if ((arg0 < 0) || ((arg0 >= 0x14))) {
if ((arg0 < 0) || ((arg0 >= 20))) {
arg0 = 0;
}
gCreditsCourseId = arg0;
+1 -1
View File
@@ -9,7 +9,7 @@
#include "code_80091750.h"
#include "code_80280650.h"
#include "code_80281C40.h"
#include "code_80281FA0.h"
#include "ceremony_and_credits.h"
void func_80281C40(void) {
s32 i;
-1810
View File
File diff suppressed because it is too large Load Diff
-124
View File
@@ -1,124 +0,0 @@
#ifndef CODE_80281FA0_h
#define CODE_80281FA0_h
#include "common_structs.h"
/* Function Prototypes */
void vec3f_set_dupe(Vec3f, f32, f32, f32);
void vec3s_set_dupe(Vec3s, s16, s16, s16);
void func_80281FDC(Vec3f);
void func_80281FF4(Vec3s);
void vec3f_copy_dupe(Vec3f, Vec3f);
void vec3s_copy_dupe(Vec3s, Vec3s);
void func_80282040();
void func_80282048();
void func_80282050(Vec3f, Vec3f, s16);
void func_802820F8(Vec3f, Vec3f, s16);
s32 func_802821A0(f32*, f32, f32);
s32 func_80282200(s16*, s16, s16);
s32 func_802822AC(f32*, f32, f32);
s32 func_80282364(s16*, s16, s16);
void func_8028240C();
void func_80282434(Camera*);
void func_80282454(Vec3f, Vec3f, f32*, s16*, s16*);
void func_80282504(Vec3f, Vec3f, f32, s16, s16);
void func_802825C8(Vec3f, Vec3f, Vec3f, Vec3s);
//s32 func_80282D90(Camera*, struct struct_80282C40*, struct struct_80282C40*, s32);
//void func_80282E58(Camera*, s16*, s32);
void func_80282F00(s16*, s16);
void func_80283240(s16);
s32 func_802832C4(void (*)(s32), Camera*, s16, s16);
s32 func_80283330(s32);
s32 func_80283428();
void func_80283968(s32);
void func_80283994(s32);
void func_802839B4(s32);
void func_802839CC(s32);
void func_802839E0(s32);
void func_80283A00(s32);
void func_80283A34(s32);
void func_80283A54(s32);
void func_80283A7C(s32);
void func_80283AA4(s32);
void func_80283ACC(s32);
void func_80283AF4(s32);
void func_80283B1C(s32);
void func_80283B44(s32);
void func_80283B6C(s32);
void func_80283BA4(s32);
void func_80283BF0(s32);
void func_80283C14(s32);
void func_80283C38(s32);
void func_80283C58(CinematicCamera*);
void func_80283C78(s32);
void func_80283CA8(s32);
void func_80283CD0(s32);
void func_80283D04(s32);
void func_80283D2C(Camera*);
void func_80283EA0(Camera*);
void func_80283ED0(Camera*);
void func_80283EF8(Camera*);
void func_80283F6C(Camera*);
void func_80283FCC(Camera*);
void func_80283FF4(Camera*);
void func_80284068(Camera*);
void func_802840C8(Camera*);
void func_80284154(Camera*);
void func_80284184(Camera*);
void func_802841E8(Camera*);
void func_8028422C(Camera*);
void func_802842A8(s32);
void func_802842D8(s32);
void func_80284418(s32 arg0);
void func_80284494(s32 arg0);
void func_802844FC(s32 arg0);
void func_8028454C(s32 arg0);
void func_802845EC(s32 arg0);
void func_8028461C(s32 arg0);
void func_80284648(s32 arg0);
void func_802846AC();
void func_802846B4(s32 arg0);
void func_80284CC0();
/* This is where I'd put my static data, if I had any */
extern u16 D_800DC5E4;
extern s32 D_80283FCC;
extern s32 D_80283FF4;
extern f32 D_802856B0;
extern f32 D_802856B4;
extern f32 D_802856B8;
extern f32 D_802856BC;
extern f32 D_802856C0;
//extern struct struct_80282C40 D_802856DC[];
//extern s32 D_80285718[];
//extern s32 D_80285754[];
//extern s32 D_80285784[];
//extern s32 D_802857B4[];
//extern s32 D_802857CC[];
//extern s32 D_802857F0;
//extern s32 D_80285850;
//extern s32 D_802858B0;
//extern s32 D_802858C8;
//extern s32 D_80285910;
//extern s32 D_80285928;
//extern s32 D_80285940;
//extern s32 D_80285A10;
//extern s32 D_80285A4C;
//extern s32 D_80285A88;
//extern s32 D_80285AB8;
//extern s32 D_80285AE8;
//extern s32 D_80285B00;
//extern s32 D_80285B18;
//extern s32 D_80285B54;
//extern s32 D_80285B90;
//extern s32 D_80285BA8;
//extern s32 D_80285C38;
//extern s32 D_80285C74;
extern s16 D_80285D14;
extern s32 D_802876D4;
extern s32 D_802876D8;
//extern struct credits_data_1FA0 *D_802876E0;
#endif
+12 -20
View File
@@ -430,29 +430,21 @@ void func_802A86A8(mk64_Vtx *arg0, u32 arg1) {
GLOBAL_ASM("asm/non_matchings/memory/func_802A86A8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
//void func_802A86A8(u8 *, s32); // extern
void func_802A87A8(s32 arg0, u32 arg1) {
//u8 *sp18;
u8 temp_v0;
u32 endptr;
u32 *addr;
void func_802A87A8(s32 arg0, u32 vertexCount) {
s32 pad;
u32 segment = SEGMENT_NUMBER2(arg0);
u32 offset = SEGMENT_OFFSET(arg0);
s32 old;
s32 addr = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
s32 temp_v0 = ALIGN16(vertexCount * 0x18);
temp_v0 = ALIGN16(arg1 * 0x18);
old = gPrevLoadedAddress;
gPrevLoadedAddress += temp_v0;
addr = VIRTUAL_TO_PHYSICAL2(&gSegmentTable[((arg0 >> 0x18) * 4)] + arg0);
// &gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000
//sp18 = temp_v0;
mio0decode(addr, temp_v0);
func_802A86A8(temp_v0, arg1);
endptr = gHeapEndPtr;
set_segment_base_addr(4, endptr);
}
#else
GLOBAL_ASM("asm/non_matchings/memory/func_802A87A8.s")
#endif
mio0decode(addr, old);
func_802A86A8(old, vertexCount);
set_segment_base_addr(4, gHeapEndPtr);
}
UNUSED void func_802A8844(void) {
+162 -161
View File
File diff suppressed because it is too large Load Diff
+4 -3
View File
@@ -4,6 +4,7 @@
#include <common_structs.h>
#include <config.h>
#include <defines.h>
#include <sounds.h>
#include "camera.h"
#include "waypoints.h"
#include "staff_ghosts.h"
@@ -903,7 +904,7 @@ loop_2:
if ((temp_t7 & 0xFFFF) >= 3) {
D_800DC5A8 = 0;
}
play_sound2(0x4900801C);
play_sound2(SOUND_ACTION_PING);
func_800029B0();
}
}
@@ -1006,8 +1007,8 @@ void func_8028FCBC(void) {
if (D_800DC51C == 0) {
if (gModeSelection == GRAND_PRIX) {
func_800C8EF8(11);
play_sound2(0x49008018);
play_sound2(0x49008019);
play_sound2(SOUND_ACTION_REV_ENGINE);
play_sound2(SOUND_ACTION_REV_ENGINE_2);
} else {
func_800C8EF8(22);
}
+111 -129
View File
@@ -9,6 +9,21 @@
#include "code_80281780.h"
#include "render_courses.h"
f32 gFloatArray802B8790[] = {
1.2, 1.0, 0.9, 0.7, 2.0, 1.8, 0.9, 2.3
};
s16 D_802B87B0 = 995;
s16 D_802B87B4 = 1000;
UNUSED s32 D_802B87B8 = 0;
s32 D_802B87BC = 0;
UNUSED s32 D_802B87C0 = 0;
s32 D_802B87C4 = 0;
s32 D_802B87C8 = 0;
s32 D_802B87CC = 0;
s16 D_802B87D0 = 0;
s16 D_802B87D4 = 0;
s16 D_802B87D8 = 0;
s32 func_80290C20(Camera *camera) {
if (camera->unk_54.unk34 == 0) {
return 1;
@@ -48,137 +63,119 @@ void func_80290CAC(uintptr_t arg0) {
}
}
#ifdef MIPS_TO_C
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
extern u16 D_80152300;
s16 gCurrentCourseId; /* unable to generate initializer */
extern u16 D_80152300[];
s16 func_802ABD40(u16);
void load_surface_map(u32 arg0, struct UnkStruct_800DC5EC *arg1) {
Player *sp34;
Camera *sp30;
void *sp24;
s16 sp22;
s16 sp1E;
Camera *temp_a2;
Gfx *temp_v1_3;
Player *temp_t1;
s16 temp_v0_3;
s16 temp_v0_4;
s16 temp_v1;
s16 temp_v1_2;
s16 var_a0;
void load_surface_map(s32 arg0, struct UnkStruct_800DC5EC *arg1) {
Player *temp_t1 = arg1->player;
Camera *temp_a2 = arg1->camera;
u32 segment = SEGMENT_NUMBER2(arg0);
u32 offset = SEGMENT_OFFSET(arg0);
s32 *addr = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
s16 var_a3;
s16 temp_v1;
s16 sp1E;
s16 temp_v0_3;
u16 temp_v0;
u16 temp_v0_2;
temp_t1 = arg1->player;
temp_a2 = arg1->camera;
sp24 = gSegmentTable[arg0 >> 0x18] + (arg0 & 0xFFFFFF) + 0x80000000;
if (gIsMirrorMode != 0) {
if (gIsMirrorMode) {
temp_v0 = (u16) temp_a2->rot[1];
if ((s32) temp_v0 < 0x2000) {
if (temp_v0 < 0x2000) {
var_a3 = 2;
} else if ((s32) temp_v0 < 0x6000) {
} else if (temp_v0 < 0x6000) {
var_a3 = 3;
} else if ((s32) temp_v0 < 0xA000) {
} else if (temp_v0 < 0xA000) {
var_a3 = 0;
} else if ((s32) temp_v0 < 0xE000) {
} else if (temp_v0 < 0xE000) {
var_a3 = 1;
} else {
var_a3 = 2;
}
} else {
temp_v0_2 = (u16) temp_a2->rot[1];
if ((s32) temp_v0_2 < 0x2000) {
temp_v0 = (u16) temp_a2->rot[1];
if (temp_v0 < 0x2000) {
var_a3 = 2;
} else if ((s32) temp_v0_2 < 0x6000) {
} else if (temp_v0 < 0x6000) {
var_a3 = 1;
} else if ((s32) temp_v0_2 < 0xA000) {
}
else if (temp_v0 < 0xA000) {
var_a3 = 0;
} else {
}
else if (temp_v0 < 0xE000) {
var_a3 = 3;
}
else {
var_a3 = 2;
if ((s32) temp_v0_2 < 0xE000) {
var_a3 = 3;
}
}
}
arg1->playerDirection = var_a3;
if (*(&D_80152300 + (((s32) (temp_a2 - camera1) / 184) * 2)) == 1) {
sp34 = temp_t1;
sp22 = var_a3;
sp30 = temp_a2;
if (D_80152300[temp_a2 - camera1] == 1) {
sp1E = func_802ABD40(temp_a2->unk_54.unk3A);
temp_v0_3 = func_802ABD40(temp_t1->unk_110.unk3A);
temp_v1 = sp1E - temp_v0_3;
if ((temp_v1 < 2) && (temp_v1 >= -1)) {
if (sp1E == 0x00FF) {
if (temp_v0_3 == 0x00FF) {
goto block_60;
if (sp1E == 255) {
if (temp_v0_3 == 255) {
temp_v1 = arg1->pathCounter;
} else if (temp_t1->unk_110.unk3C[2] > 30.0f) {
temp_v1 = arg1->pathCounter;
} else {
temp_v1 = temp_v0_3;
}
if (temp_t1->unk_110.unk44 > 30.0f) {
goto block_60;
}
var_a0 = temp_v0_3;
} else {
if (temp_a2->unk_54.unk44 > 30.0f) {
goto block_60;
}
var_a0 = sp1E;
} else if (temp_a2->unk_54.unk3C[2] > 30.0f) {
temp_v1 = arg1->pathCounter;
} else {
temp_v1 = sp1E;
}
} else {
temp_v1_2 = gCurrentCourseId;
if (temp_v1_2 != 1) {
if (temp_v1_2 == 2) {
if ((temp_v0_3 >= 0x11) && (temp_v0_3 < 0x18)) {
var_a0 = temp_v0_3;
} else if ((temp_v0_3 == 0x00FF) && (sp1E != 0x00FF)) {
var_a0 = sp1E;
} else if ((temp_v0_3 != 0x00FF) && (sp1E == 0x00FF)) {
var_a0 = temp_v0_3;
switch(gCurrentCourseId) {
case 2:
if ((temp_v0_3 >= 0x11) && (temp_v0_3 < 0x18)) {
temp_v1 = temp_v0_3;
} else if ((temp_v0_3 == 255) && (sp1E != 255)) {
temp_v1 = sp1E;
} else if ((temp_v0_3 != 255) && (sp1E == 255)) {
temp_v1 = temp_v0_3;
} else {
temp_v1 = arg1->pathCounter;
}
break;
case 1:
if ((temp_v0_3 >= 0xE) && (temp_v0_3 < 0x16)) {
temp_v1 = temp_v0_3;
} else if ((temp_v0_3 == 255) && (sp1E != 255)) {
temp_v1 = sp1E;
} else if ((temp_v0_3 != 255) && (sp1E == 255)) {
temp_v1 = temp_v0_3;
} else {
goto block_60;
temp_v1 = arg1->pathCounter;
}
} else {
if (temp_v0_3 == 0x00FF) {
goto block_60;
break;
default:
if (temp_v0_3 == 255) {
temp_v1 = arg1->pathCounter;
} else if (temp_t1->unk_110.unk3C[2] > 30.0f) {
temp_v1 = arg1->pathCounter;
} else {
temp_v1 = temp_v0_3;
}
if (temp_t1->unk_110.unk44 > 30.0f) {
goto block_60;
}
var_a0 = temp_v0_3;
}
} else if ((temp_v0_3 >= 0xE) && (temp_v0_3 < 0x16)) {
var_a0 = temp_v0_3;
} else if ((temp_v0_3 == 0x00FF) && (sp1E != 0x00FF)) {
var_a0 = sp1E;
} else if ((temp_v0_3 != 0x00FF) && (sp1E == 0x00FF)) {
var_a0 = temp_v0_3;
} else {
goto block_60;
break;
}
}
} else {
sp22 = var_a3;
sp30 = temp_a2;
temp_v0_4 = func_802ABD40(temp_a2->unk_54.unk3A);
var_a0 = temp_v0_4;
if (temp_a2->unk_54.unk44 > 30.0f) {
goto block_60;
}
if (temp_v0_4 == 0x00FF) {
block_60:
var_a0 = arg1->pathCounter;
temp_v1 = func_802ABD40(temp_a2->unk_54.unk3A);
if (temp_a2->unk_54.unk3C[2] > 30.0f) {
temp_v1 = arg1->pathCounter;
} else if (temp_v1 == 255) {
temp_v1 = arg1->pathCounter;
}
}
arg1->pathCounter = var_a0;
temp_v1_3 = gDisplayListHead;
gDisplayListHead = temp_v1_3 + 8;
temp_v1_3->words.w0 = 0x06000000;
temp_v1_3->words.w1 = *(sp24 + ((s16) (((var_a0 * 4) + var_a3) - 4) * 4));
arg1->pathCounter = temp_v1;
temp_v1 = ((temp_v1 - 1) * 4) + var_a3;
gSPDisplayList(gDisplayListHead++, addr[temp_v1]);
}
#else
GLOBAL_ASM("asm/non_matchings/render_courses/load_surface_map.s")
#endif
void func_80291198(void) {
gSPDisplayList(gDisplayListHead++, 0x07001140);
@@ -1329,21 +1326,9 @@ void render_luigi_raceway(struct UnkStruct_800DC5EC *arg0) {
}
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
//extern void func_802B5D64(u32, u16, s32, s32); // extern
extern Gfx D_06013FF8[];
extern Gfx D_06014060[];
extern Lights1 D_800DC610[];
extern s16 D_802B87B0;
extern s16 D_802B87B4;
extern s16 D_802B87D4;
extern Gfx moo_moo_farm_dls[];
extern Gfx D_06013FF8[];
extern Gfx D_06014060[];
// Missing {} around if statements necessary for matching.
void render_moo_moo_farm(struct UnkStruct_800DC5EC *arg0) {
s32 pad[12];
s32 pad[13];
s16 temp_s0 = arg0->pathCounter;
s16 temp_s1 = arg0->playerDirection;
@@ -1360,54 +1345,51 @@ void render_moo_moo_farm(struct UnkStruct_800DC5EC *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)) {
if ((temp_s1 == 2) || (temp_s1 == 3) || (temp_s1 == 1))
gSPDisplayList(gDisplayListHead++, D_06013FF8);
}
} else if (temp_s0 < 16) {
gSPDisplayList(gDisplayListHead++, D_06013FF8);
} else if (temp_s0 < 19) {
if (temp_s1 != 2) {
if (temp_s1 != 2)
gSPDisplayList(gDisplayListHead++, D_06013FF8);
}
} else if (temp_s0 < 20) {
if (temp_s1 == 0) {
if (temp_s1 == 0)
gSPDisplayList(gDisplayListHead++, D_06013FF8);
}
}
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEI, G_CC_MODULATEI);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
if ((temp_s0 >= 16) && (temp_s0 < 24)) {
if ((temp_s1 == 2) || (temp_s1 == 3)) {
if ((temp_s1 == 2) || (temp_s1 == 3))
gSPDisplayList(gDisplayListHead++, 0x07005410);
}
} else if (temp_s0 < 9) {
if (temp_s1 == 2) {
if (temp_s1 == 2)
gSPDisplayList(gDisplayListHead++, 0x07005410);
}
}
if (temp_s0 < 4) {
if (temp_s1 != 0) {
if (temp_s1 != 0)
gSPDisplayList(gDisplayListHead++, D_06014060);
}
} else if (temp_s0 < 8) {
if (temp_s1 == 2) {
if (temp_s1 == 2)
gSPDisplayList(gDisplayListHead++, D_06014060);
}
} else if (temp_s0 >= 22) {
gSPDisplayList(gDisplayListHead++, D_06014060);
} else if (temp_s0 >= 18) {
if ((temp_s1 == 0) || (temp_s1 == 3)) {
if ((temp_s1 == 0) || (temp_s1 == 3))
gSPDisplayList(gDisplayListHead++, D_06014060);
}
}
gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
gSPDisplayList(gDisplayListHead++, 0x070010C0);
}
#else
GLOBAL_ASM("asm/non_matchings/render_courses/render_moo_moo_farm.s")
#endif
void render_toads_turnpike(struct UnkStruct_800DC5EC *arg0) {
s32 pad[13];
+5 -7
View File
@@ -60,7 +60,6 @@ extern s32 D_8015F5A0;
extern s32 D_800DC5DC;
extern s32 D_800DC5E0;
extern s16 D_802B87D8;
extern s32 D_802B87C4;
extern s32 D_802B87C8;
extern s32 D_802B87CC;
@@ -70,8 +69,6 @@ extern Gfx mario_raceway_dls[];
extern s32 D_801625EC;
extern s32 D_801625F0;
extern s32 D_801625F4;
extern s16 D_802B87B0;
extern s16 D_802B87B4;
extern Gfx choco_mountain_dls[];
extern s32 D_802B87BC;
extern Gfx bowsers_castle_dls[];
@@ -85,9 +82,11 @@ extern Gfx luigi_raceway_dls[];
extern s32 D_801625EC;
extern s32 D_801625F0;
extern s32 D_801625F4;
extern s16 D_802B87B0;
extern s16 D_802B87B4;
extern s16 D_802B87D4;
extern Gfx D_06013FF8[];
extern Gfx D_06014060[];
extern Lights1 D_800DC610[];
extern Gfx moo_moo_farm_dls[];
extern Gfx toads_turnpike_dls[];
@@ -95,7 +94,6 @@ extern Lights1 D_800DC610[]; // Light data?
extern u8 kalimari_desert_dls[];
extern u8 sherbet_land_dls[];
extern Gfx wario_stadium_dls[];
extern s16 D_802B87D0;
extern Gfx dks_jungle_parkway_dls[];
extern Gfx D_060071B0[];