From d6663422b04e54e86838b56243cbdef27496d706 Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:27:58 +0100 Subject: [PATCH] fix warning, type and document audio (#559) * Document audio * Update external.h * fix warnings * put a do while on one line --- asm/eu_nonmatchings/audio_init.s | 2 +- .../audio/external/func_800C2A2C.s | 2 +- asm/non_matchings/audio/load/audio_init.s | 2 +- include/PR/ultratypes.h | 1 + include/sounds.h | 99 ++-- src/actors/falling_rocks.inc.c | 6 +- src/audio/data.c | 4 +- src/audio/data.h | 4 +- src/audio/external.c | 533 +++++++++--------- src/audio/external.h | 39 +- src/audio/heap.c | 7 +- src/audio/heap.h | 12 +- src/audio/internal.h | 10 +- src/audio/load.c | 48 +- src/audio/load.h | 2 +- src/audio/port_eu.c | 63 +-- src/audio/port_eu.h | 4 +- src/audio/seqplayer.c | 12 +- src/audio/synthesis.c | 12 +- src/code_80004740.c | 8 +- src/code_80004740.h | 2 +- src/code_80005FD0.c | 61 +- src/code_80057C60.c | 46 +- src/code_80057C60.h | 4 +- src/code_80071F00.c | 132 ++--- src/code_80071F00.h | 1 + src/code_80086E70.c | 30 +- src/code_80086E70.h | 2 +- src/code_8008C1D0.c | 79 +-- src/code_80091750.c | 116 ++-- src/effects.c | 32 +- src/math_util_2.c | 16 +- src/player_controller.c | 19 +- src/racing/actors.c | 86 +-- src/racing/actors.h | 4 +- src/racing/actors_extended.c | 61 +- src/racing/race_logic.c | 2 +- tools/doxygen_syms.md | 12 +- 38 files changed, 798 insertions(+), 777 deletions(-) diff --git a/asm/eu_nonmatchings/audio_init.s b/asm/eu_nonmatchings/audio_init.s index e83539c74..653906ad3 100644 --- a/asm/eu_nonmatchings/audio_init.s +++ b/asm/eu_nonmatchings/audio_init.s @@ -59,7 +59,7 @@ glabel audio_init /* BCD98 800BC198 240E0032 */ addiu $t6, $zero, 0x32 /* BCD9C 800BC19C E4247178 */ swc1 $ft0, %lo(D_803B7178)($at) /* BCDA0 800BC1A0 3C01803B */ lui $at, %hi(gRefreshRate) -/* BCDA4 800BC1A4 0C032FF6 */ jal func_800CBF48 +/* BCDA4 800BC1A4 0C032FF6 */ jal port_eu_init /* BCDA8 800BC1A8 AC2E717C */ sw $t6, %lo(gRefreshRate)($at) /* BCDAC 800BC1AC 3C02803B */ lui $v0, %hi(gAiBufferLengths) /* BCDB0 800BC1B0 3C04803B */ lui $a0, %hi(D_803B7192) diff --git a/asm/non_matchings/audio/external/func_800C2A2C.s b/asm/non_matchings/audio/external/func_800C2A2C.s index 9ba8d8ff2..8f1e8f93e 100644 --- a/asm/non_matchings/audio/external/func_800C2A2C.s +++ b/asm/non_matchings/audio/external/func_800C2A2C.s @@ -686,7 +686,7 @@ glabel L800C33E0 /* 0C3FF4 800C33F4 306400FF */ andi $a0, $v1, 0xff /* 0C3FF8 800C33F8 00801825 */ move $v1, $a0 /* 0C3FFC 800C33FC AFC40048 */ sw $a0, 0x48($fp) -/* 0C4000 800C3400 0C0304FF */ jal func_800C13FC +/* 0C4000 800C3400 0C0304FF */ jal audio_reset_session_eu /* 0C4004 800C3404 AFCE004C */ sw $t6, 0x4c($fp) /* 0C4008 800C3408 8FC5004C */ lw $a1, 0x4c($fp) /* 0C400C 800C340C 8FCD0048 */ lw $t5, 0x48($fp) diff --git a/asm/non_matchings/audio/load/audio_init.s b/asm/non_matchings/audio/load/audio_init.s index 725b65b95..60dee61bd 100644 --- a/asm/non_matchings/audio/load/audio_init.s +++ b/asm/non_matchings/audio/load/audio_init.s @@ -98,7 +98,7 @@ glabel audio_init /* 0BCE08 800BC208 3C01803B */ lui $at, %hi(gRefreshRate) # $at, 0x803b /* 0BCE0C 800BC20C AC39717C */ sw $t9, %lo(gRefreshRate)($at) .L800BC210: -/* 0BCE10 800BC210 0C032FD2 */ jal func_800CBF48 +/* 0BCE10 800BC210 0C032FD2 */ jal port_eu_init /* 0BCE14 800BC214 00000000 */ nop /* 0BCE18 800BC218 3C02803B */ lui $v0, %hi(gAiBufferLengths) # $v0, 0x803b /* 0BCE1C 800BC21C 3C04803B */ lui $a0, %hi(D_803B7192) # $a0, 0x803b diff --git a/include/PR/ultratypes.h b/include/PR/ultratypes.h index 7c347fe3b..5a7ba5a93 100644 --- a/include/PR/ultratypes.h +++ b/include/PR/ultratypes.h @@ -19,6 +19,7 @@ typedef unsigned long long int u64; typedef signed int bool; typedef signed char bool8; +typedef unsigned char ubool8; typedef volatile u8 vu8; typedef volatile u16 vu16; diff --git a/include/sounds.h b/include/sounds.h index bf82dfba1..2e5fdc49f 100644 --- a/include/sounds.h +++ b/include/sounds.h @@ -4,110 +4,119 @@ //! @todo format like sm64 sounds.h // The sound cue bit fields can be split up into its basic pieces and put back together. +// Sound Magic Definition: +// First Byte (Upper Nibble): Sound Bank (not the same as audio bank!) +// First Byte (Lower Nibble): Bitflags for audio playback? +// Third/Second Byte: Priority +// Third/Second Byte (Upper Nibble): More bitflags +// Third/Second Byte (Lower Nibble): Sound Status (this is set to SOUND_STATUS_PLAYING when passed to the audio driver.) +// Fourth Byte: Sound ID +#define SOUND_ARG_LOAD(sound_bank, byte2, byte3, sound_id) \ + ((sound_bank << 24) | (byte2 << 16) | (byte3 << 8) | sound_id) /* Intro */ -#define SOUND_INTRO_LOGO 0x49018008 +#define SOUND_INTRO_LOGO SOUND_ARG_LOAD(0x49, 0x01, 0x80, 0x08) //SOUND_ARG_LOAD(0x49, 0x01, 0x80, 0x08) // Welcome to Mario Kart. Used in intro and credits. -#define SOUND_INTRO_WELCOME 0x49009009 -#define SOUND_INTRO_ENTER_MENU 0x4900801A +#define SOUND_INTRO_WELCOME SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x09) +#define SOUND_INTRO_ENTER_MENU SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x1A) /* Menus */ -#define SOUND_MENU_OK_CLICKED 0x49008016 +#define SOUND_MENU_OK_CLICKED SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x16) -#define SOUND_MENU_CURSOR_MOVE 0x49008000 -#define SOUND_MENU_GO_BACK 0x49008002 +#define SOUND_MENU_CURSOR_MOVE SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x00) +#define SOUND_MENU_GO_BACK SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x02) // Used elsewhere, seems same as above sound. -#define SOUND_ACTION_GO_BACK_2 0x49008005 +#define SOUND_ACTION_GO_BACK_2 SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x05) -#define SOUND_ACTION_UNKNOWN_CONFIRMATION 0x49008006 +#define SOUND_ACTION_UNKNOWN_CONFIRMATION SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x06) -#define SOUND_MENU_SELECT 0x49008001 +#define SOUND_MENU_SELECT SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x01) // Mario Grand Prix -#define SOUND_MENU_GP 0x4900900A +#define SOUND_MENU_GP SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x0A) // Versus -#define SOUND_MENU_VERSUS 0x4900900C +#define SOUND_MENU_VERSUS SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x0C) // Time Trials -#define SOUND_MENU_TIME_TRIALS 0x4900900B +#define SOUND_MENU_TIME_TRIALS SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x0B) // Battle -#define SOUND_MENU_BATTLE 0x4900900D +#define SOUND_MENU_BATTLE SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x0D) // Select a level (Select a CC) -#define SOUND_MENU_SELECT_LEVEL 0x4900900E +#define SOUND_MENU_SELECT_LEVEL SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x0E) // OK? -#define SOUND_MENU_OK 0x4900900F +#define SOUND_MENU_OK SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x0F) // Select your player -#define SOUND_MENU_SELECT_PLAYER 0x49009012 +#define SOUND_MENU_SELECT_PLAYER SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x12) // Select map -#define SOUND_MENU_SELECT_MAP 0x49009013 +#define SOUND_MENU_SELECT_MAP SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x13) // Plays in option if no controller pak. -#define SOUND_MENU_FILE_NOT_FOUND 0x4900FF07 +#define SOUND_MENU_FILE_NOT_FOUND SOUND_ARG_LOAD(0x49, 0x00, 0xFF, 0x07) // Option -#define SOUND_MENU_OPTION 0x49009010 +#define SOUND_MENU_OPTION SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x10) // Data -#define SOUND_MENU_DATA 0x49009011 +#define SOUND_MENU_DATA SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x11) // On delete course record? -#define SOUND_MENU_EXPLOSION 0x4900801D +#define SOUND_MENU_EXPLOSION SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x1D) -#define SOUND_MENU_STEREO 0x49008024 -#define SOUND_MENU_HEADPHONES 0x49008025 -#define SOUND_MENU_MONO 0x49008029 +#define SOUND_MENU_STEREO SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x24) +#define SOUND_MENU_HEADPHONES SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x25) +#define SOUND_MENU_MONO SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x29) /* Staging */ // Red and orange staging lights that Lakitu holds. -#define SOUND_ACTION_COUNTDOWN_LIGHT 0x49008003 -#define SOUND_ACTION_GREEN_LIGHT 0x49008004 +#define SOUND_ACTION_COUNTDOWN_LIGHT SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x03) +#define SOUND_ACTION_GREEN_LIGHT SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x04) // Activates when light turns green. -#define SOUND_ACTION_REV_ENGINE 0x49008018 -#define SOUND_ACTION_REV_ENGINE_2 0x49008019 +#define SOUND_ACTION_REV_ENGINE SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x18) +#define SOUND_ACTION_REV_ENGINE_2 SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x19) /* Racing */ // Volume Mode and unknown -#define SOUND_ACTION_PING 0x4900801C +#define SOUND_ACTION_PING SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x1C) -#define SOUND_ACTION_TYRE_SQUEAL 0x100F908 +#define SOUND_ACTION_TYRE_SQUEAL SOUND_ARG_LOAD(0x01, 0x00, 0xF9, 0x08) // Falling rock and bomb sound. -#define SOUND_ACTION_EXPLOSION 0x19009005 +#define SOUND_ACTION_EXPLOSION SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x05) -#define SOUND_ACTION_EXPLOSION_2 0x1900F00C +#define SOUND_ACTION_EXPLOSION_2 SOUND_ARG_LOAD(0x19, 0x00, 0xF0, 0x0C) /* Items */ // There's likely more of these but they are in func arguments. // Did not rename in-case unrelated. -#define SOUND_ITEM_STAR 0x31029008 -#define SOUND_ITEM_THUNDERBOLT 0x5101C00C +#define SOUND_ITEM_STAR SOUND_ARG_LOAD(0x31, 0x02, 0x90, 0x08) +#define SOUND_ITEM_THUNDERBOLT SOUND_ARG_LOAD(0x51, 0x01, 0xC0, 0x0C) /* Score Screen */ // Coin pickup sound (perfect fourth; B to E) -#define SOUND_ACTION_COUNT_SCORE 0x49008017 -#define SOUND_ACTION_NEXT_COURSE 0x49008015 +#define SOUND_ACTION_COUNT_SCORE SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x17) +#define SOUND_ACTION_NEXT_COURSE SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x15) // Same sound as ENTER_MENU -#define SOUND_ACTION_CONTINUE_UNKNOWN 0x4900801B +#define SOUND_ACTION_CONTINUE_UNKNOWN SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x1B) /* Ceremony */ // Congratulation -#define SOUND_CEREMONY_CONGRATULATION 0x49009014 -#define SOUND_CEREMONY_BALLOON_POP 0x4900801E -#define SOUND_CEREMONY_FISH 0x4900801F -#define SOUND_CEREMONY_FISH_2 0x49008020 -#define SOUND_CEREMONY_SHOOT_TROPHY 0x49008021 -#define SOUND_CEREMONY_PODIUM 0x49008022 +#define SOUND_CEREMONY_CONGRATULATION SOUND_ARG_LOAD(0x49, 0x00, 0x90, 0x14) +#define SOUND_CEREMONY_BALLOON_POP SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x1E) +#define SOUND_CEREMONY_FISH SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x1F) +#define SOUND_CEREMONY_FISH_2 SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x20) +#define SOUND_CEREMONY_SHOOT_TROPHY SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x21) +#define SOUND_CEREMONY_PODIUM SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x22) // The sound of the trophy. Plays in the background -#define SOUND_CEREMONY_TROPHY 0x49008023 +#define SOUND_CEREMONY_TROPHY SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x23) /* Credits */ // Hey, you're very good. See you next time! -#define SOUND_CREDITS_FAREWELL 0x49008026 +#define SOUND_CREDITS_FAREWELL SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x26) diff --git a/src/actors/falling_rocks.inc.c b/src/actors/falling_rocks.inc.c index 95b6599aa..0d5985128 100644 --- a/src/actors/falling_rocks.inc.c +++ b/src/actors/falling_rocks.inc.c @@ -71,7 +71,7 @@ void update_actor_falling_rocks(struct FallingRock *rock) { rock->pos[2] += unkVec[2] * rock->unk30.unk3C[2]; func_802AC114(unkVec, pad0, rock->velocity, 2.0f); rock->velocity[1] = -1.2f * pad1; - func_800C98B8(rock->pos, rock->velocity, 0x1900800FU); + func_800C98B8(rock->pos, rock->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x0F)); } pad0 = rock->unk30.unk3C[0]; if (pad0 < 0.0f) { @@ -88,7 +88,7 @@ void update_actor_falling_rocks(struct FallingRock *rock) { rock->pos[2] += unkVec[2] * rock->unk30.unk3C[0]; func_802AC114(unkVec, pad0, rock->velocity, 2.0f); rock->velocity[1] = -1.2f * pad1; - func_800C98B8(rock->pos, rock->velocity, 0x1900800FU); + func_800C98B8(rock->pos, rock->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x0F)); } } pad0 = rock->unk30.unk3C[1]; @@ -106,7 +106,7 @@ void update_actor_falling_rocks(struct FallingRock *rock) { pad1 = rock->velocity[1]; func_802AC114(unkVec, pad0, rock->velocity, 2.0f); rock->velocity[1] = -1.2f * pad1; - func_800C98B8(rock->pos, rock->velocity, 0x1900800FU); + func_800C98B8(rock->pos, rock->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x0F)); } } } diff --git a/src/audio/data.c b/src/audio/data.c index cc08fd832..ffaf3aa58 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -428,8 +428,8 @@ f32 gDefaultPanVolume[128] = { s32 gAudioTaskIndex; s32 gCurrAiBufferIndex; -u64 *gAudioCmdBuffers[2]; // probably wrong -u64 *gAudioCmd; +Acmd *gAudioCmdBuffers[2]; // probably wrong +Acmd *gAudioCmd; struct SPTask *gAudioTask; // gAudioTask? struct SPTask gAudioTasks[2]; // gAudioTasks? f32 D_803B7178; diff --git a/src/audio/data.h b/src/audio/data.h index 5c1763d2b..fe9ca89b0 100644 --- a/src/audio/data.h +++ b/src/audio/data.h @@ -45,8 +45,8 @@ extern volatile s32 gAudioLoadLock; // D_800EA5DC extern s32 gAudioTaskIndex; extern s32 gCurrAiBufferIndex; -extern u64 *gAudioCmdBuffers[2]; // probably wrong -extern u64 *gAudioCmd; // D_803B70D0 +extern Acmd *gAudioCmdBuffers[2]; // probably wrong +extern Acmd *gAudioCmd; // D_803B70D0 extern struct SPTask *gAudioTask; // D_803B70D4 extern struct SPTask gAudioTasks[2]; // D_803B70D8 extern f32 D_803B7178; diff --git a/src/audio/external.c b/src/audio/external.c index baf61d380..a3ae6d612 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -3,32 +3,33 @@ #include #include "camera.h" #include "math_util_2.h" +#include #include "audio/external.h" #include "audio/load.h" #include "audio/data.h" -#include -#include "port_eu.h" +#include "audio/port_eu.h" #include "code_800029B0.h" #include "code_80091750.h" s8 D_8018EF10; UnkStruct8018EF18 D_8018EF18[16]; +// chained list struct Unk_8018EFD8 D_8018EFD8[50]; u8 D_8018FB90; u8 D_8018FB91; -Camera *D_8018FB98[4]; -Vec3f D_8018FBA8[4]; -Vec3f D_8018FBD8[4]; +Camera *gCopyCamera[4]; +Vec3f gVelocityCamera[4]; +Vec3f gCameraLastPos[4]; u8 D_8018FC08; u16 D_8018FC10[4][2]; -struct Unk_8018FC20 sSoundRequests[0x100]; -struct Unk_80191420 sSoundBanks[SOUND_BANK_COUNT][20]; +struct Sound sSoundRequests[0x100]; +struct SoundCharacteristics sSoundBanks[SOUND_BANK_COUNT][20]; u8 sSoundBankUsedListBack[SOUND_BANK_COUNT]; u8 sSoundBankFreeListFront[SOUND_BANK_COUNT]; u8 sNumSoundsInBank[SOUND_BANK_COUNT]; u8 D_80192AB8[SOUND_BANK_COUNT][8][8]; u8 D_80192C38; -u8 sSoundBankDisabled[SOUND_BANK_COUNT]; +ubool8 sSoundBankDisabled[SOUND_BANK_COUNT]; struct ChannelVolumeScaleFade D_80192C48[SOUND_BANK_COUNT]; u8 D_80192CA8[3][10]; u8 D_80192CC6[3]; @@ -68,7 +69,7 @@ u8 D_800E9F24[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -u8 D_800E9F2C[] = { +u8 D_800E9F2C[NUM_PLAYERS] = { 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -236,7 +237,7 @@ char external_unused_string_eu_03[] = "SE FADE OUT TIME %d\n"; void func_800C13F0(void) { } -void func_800C13FC(OSMesg presetId) { +void audio_reset_session_eu(OSMesg presetId) { OSMesg mesg; osRecvMesg(D_800EA3B4, &mesg, 0); osSendMesg(D_800EA3B0, presetId, 0); @@ -250,7 +251,7 @@ f32 func_800C1480(u8 bank, u8 soundId) { f32 temp_f0; f32 var_f2; s32 var_v0; - struct Unk_80191420 *temp_v0; + struct SoundCharacteristics *temp_v0; temp_v0 = &sSoundBanks[bank][soundId]; if (temp_v0->soundBits & 0x400000) { @@ -382,7 +383,7 @@ void func_800C19D0(u8 arg0, u8 arg1, u8 arg2) { f32 sp34; s8 sp33; UnkStruct8018EF18 *temp_s0_2; - struct Unk_80191420 *temp_s0; + struct SoundCharacteristics *temp_s0; sp3B = 0; sp33 = 0x40; @@ -399,7 +400,7 @@ void func_800C19D0(u8 arg0, u8 arg1, u8 arg2) { sp3C = (func_800C1480(arg0, arg1) * *temp_s0->unk14) * D_80192C48[arg0].current; sp3B = func_800C15D0(arg0, arg1, arg2); sp34 = func_800C1934(arg0, arg1) * *temp_s0->unk10; - sp33 = func_800C16E8(*temp_s0->unk00, *temp_s0->unk08, temp_s0->cameraId); + sp33 = func_800C16E8(*temp_s0->unk00[0], *temp_s0->unk08, temp_s0->cameraId); break; } temp_s0_2 = &D_8018EF18[arg2]; @@ -423,7 +424,7 @@ void func_800C19D0(u8 arg0, u8 arg1, u8 arg2) { #ifdef MIPS_TO_C //generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Oct-16-2023 -struct Unk_8018EFD8 *func_800C1C88(u8 arg0, f32 *position, f32 *velocity, f32 *arg3, u8 arg4, u32 soundBits) { +struct Unk_8018EFD8 *func_800C1C88(u8 arg0, Vec3f position, f32 *velocity, f32 *arg3, u8 arg4, u32 soundBits) { struct Unk_8018EFD8 *temp_a1; struct Unk_8018EFD8 *temp_v1; u8 temp_t7; @@ -457,37 +458,37 @@ struct Unk_8018EFD8 *func_800C1C88(u8 arg0, f32 *position, f32 *velocity, f32 *a GLOBAL_ASM("asm/non_matchings/audio/external/func_800C1C88.s") #endif -void func_800C1DA4(Camera *arg0, Vec3s arg1, struct Unk_8018EFD8 *arg2) { - f32 temp_f12; - f32 temp_f14; +void func_800C1DA4(Camera *arg0, Vec3s rot, struct Unk_8018EFD8 *arg2) { + f32 x; + f32 y; - temp_f12 = arg0->pos[0] - *arg2->posX; - temp_f14 = arg0->pos[2] - *arg2->posZ; - arg2->unk18[0] = func_800416D8(temp_f12, temp_f14, arg1[1]); - arg2->unk18[2] = func_80041724(temp_f12, temp_f14, arg1[1]); + x = arg0->pos[0] - *arg2->posX; + y = arg0->pos[2] - *arg2->posZ; + arg2->unk18[0] = func_800416D8(x, y, rot[1]); + arg2->unk18[2] = func_80041724(x, y, rot[1]); } -void func_800C1E2C(Camera *camera, Vec3f arg1, struct Unk_8018EFD8 *arg2) { +void func_800C1E2C(Camera *camera, Vec3f velocity, struct Unk_8018EFD8 *arg2) { f32 sp44; f32 temp_f6; - f32 temp_f16; - f32 temp_f18; + f32 x; + f32 y; f32 dist0; f32 dist1; f32 thing0; f32 thing1; f32 temp_f2; - temp_f16 = (*arg2->posX) - camera->pos[0]; - temp_f18 = (*arg2->posZ) - camera->pos[2]; + x = (*arg2->posX) - camera->pos[0]; + y = (*arg2->posZ) - camera->pos[2]; - sp44 = (*arg2->velX) - arg1[0]; - temp_f6 = (*arg2->velZ) - arg1[2]; + sp44 = (*arg2->velX) - velocity[0]; + temp_f6 = (*arg2->velZ) - velocity[2]; - thing0 = temp_f16 + sp44; - thing1 = temp_f18 + temp_f6; + thing0 = x + sp44; + thing1 = y + temp_f6; - dist0 = sqrtf((temp_f16 * temp_f16) + (temp_f18 * temp_f18)); + dist0 = sqrtf((x * x) + (y * y)); dist1 = sqrtf((thing0 * thing0) + (thing1 * thing1)); temp_f2 = 1.0f / (1.0f - ((dist0 - dist1) / arg2->unk34)); @@ -511,10 +512,10 @@ void func_800C1F8C(void) { var_a1 = D_800EA1C0 + 1; for (var_s1 = 0; var_s1 < var_a1; var_s1++) { - D_8018FBA8[var_s1][0] = D_8018FB98[var_s1]->pos[0] - D_8018FBD8[var_s1][0]; - D_8018FBA8[var_s1][2] = D_8018FB98[var_s1]->pos[2] - D_8018FBD8[var_s1][2]; - D_8018FBD8[var_s1][0] = D_8018FB98[var_s1]->pos[0]; - D_8018FBD8[var_s1][2] = D_8018FB98[var_s1]->pos[2]; + gVelocityCamera[var_s1][0] = gCopyCamera[var_s1]->pos[0] - gCameraLastPos[var_s1][0]; + gVelocityCamera[var_s1][2] = gCopyCamera[var_s1]->pos[2] - gCameraLastPos[var_s1][2]; + gCameraLastPos[var_s1][0] = gCopyCamera[var_s1]->pos[0]; + gCameraLastPos[var_s1][2] = gCopyCamera[var_s1]->pos[2]; } var_a1 = 0; @@ -534,10 +535,10 @@ void func_800C1F8C(void) { } else { cameraId = D_8018EFD8[var_s1].cameraId; // Why? Why would you do it this way? For what possible reason? - camera = &D_8018FB98[cameraId]; + camera = &gCopyCamera[cameraId]; func_800C1DA4(*camera, (*camera)->rot, &D_8018EFD8[var_s1]); if (D_800EA1C8 != D_8018EFD8[var_s1].velX) { - func_800C1E2C(*camera, D_8018FBA8[0], &D_8018EFD8[var_s1]); + func_800C1E2C(*camera, gVelocityCamera[0], &D_8018EFD8[var_s1]); } var_a1 = var_s1; } @@ -548,30 +549,30 @@ void func_800C1F8C(void) { } } -f32 *func_800C21E8(Vec3f arg0, u32 arg1) { - u8 var_v0; - f32 *ret; +Vec3f *func_800C21E8(Vec3f pos, u32 soundBits) { + u8 it; // iterator + Vec3f *ret; // Only here to force a match - UNUSED f32 *thing = arg0; + UNUSED f32 *thing = pos; struct Unk_8018EFD8 *temp_a1; ret = 0; - var_v0 = D_8018EFD8[0].next; - while (var_v0 != 0xFF) { - temp_a1 = &D_8018EFD8[var_v0]; + it = D_8018EFD8[0].next; + while (it != 0xFF) { + temp_a1 = &D_8018EFD8[it]; // It doesn't matter what you set var_v0 to here actually - var_v0 = D_8018EFD8[0].next; - if ((arg0 == temp_a1->posX) && (arg1 == temp_a1->soundBits)) { + it = D_8018EFD8[0].next; + if ((pos == temp_a1->posX) && (soundBits == temp_a1->soundBits)) { // I suspect all this weirdness here is a result of someone not knowing the 'break' keyword - var_v0 = 0xFF; + it = 0xFF; if (temp_a1->unk18[1] != 100000.0f) { - ret = temp_a1->unk18; + ret = &temp_a1->unk18; } else { goto test; } } else { test: - var_v0 = temp_a1->next; + it = temp_a1->next; } } return ret; @@ -656,10 +657,10 @@ void func_800C2474(void) { u8 var_v0; D_8018EF10 = 0; - D_8018FB98[0] = camera1; - D_8018FB98[1] = camera2; - D_8018FB98[2] = camera3; - D_8018FB98[3] = camera4; + gCopyCamera[0] = camera1; + gCopyCamera[1] = camera2; + gCopyCamera[2] = camera3; + gCopyCamera[3] = camera4; D_8018FB91 = 0; D_8018FB90 = 1; D_800EA0F4 = 0; @@ -680,12 +681,12 @@ void func_800C2474(void) { for (var_v0 = 0; var_v0 < 4; var_v0++) { D_800E9DB4[var_v0] = 0; D_800E9DF4[var_v0] = 0; // This is an f32 FYI, but 0.0f doesn't match right :) - D_8018FBA8[var_v0][0] = 0.0f; - D_8018FBA8[var_v0][1] = 0.0f; - D_8018FBA8[var_v0][2] = 0.0f; - D_8018FBD8[var_v0][0] = 0.0f; - D_8018FBD8[var_v0][1] = 0.0f; - D_8018FBD8[var_v0][2] = 0.0f; + gVelocityCamera[var_v0][0] = 0.0f; + gVelocityCamera[var_v0][1] = 0.0f; + gVelocityCamera[var_v0][2] = 0.0f; + gCameraLastPos[var_v0][0] = 0.0f; + gCameraLastPos[var_v0][1] = 0.0f; + gCameraLastPos[var_v0][2] = 0.0f; D_800EA0EC[var_v0] = 0; D_800E9EA4[var_v0] = 0; D_800E9F7C[var_v0].unk_14 = 0; @@ -705,7 +706,7 @@ void func_800C2474(void) { D_800E9F74[var_v0] = 0; D_800E9F78[var_v0] = 0; } - for (var_v0 = 0; var_v0 < 8; var_v0++) { + for (var_v0 = 0; var_v0 < NUM_PLAYERS; var_v0++) { D_800E9F24[var_v0] = 0; D_800E9F2C[var_v0] = 0; D_800E9F34[var_v0] = 0.0f; @@ -764,7 +765,7 @@ void func_800C29B4(u8 arg0, u16 arg1) { #ifdef MIPS_TO_C //generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Oct-18-2023 -void func_800C2A2C(u16 arg0) { +void func_800C2A2C(u32 arg0) { u8 sp5B; u32 sp4C; s32 sp48; @@ -1108,7 +1109,7 @@ void func_800C2A2C(u16 arg0) { temp_a0_5 = arg0 & 0xFF; sp48 = temp_a0_5; sp4C = temp_t6_4; - func_800C13FC((void *) temp_a0_5); + audio_reset_session_eu((void *) temp_a0_5); *D_800EA1F4 = (u8) sp48; func_800CBBE8(0x46020000U, (s8) sp4C); func_800C5C40(); @@ -1142,10 +1143,10 @@ u8 func_800C357C(s32 arg0) { u8 i; i = D_800EA1E8; - var_v1 = 1; + var_v1 = TRUE; for(i = D_800EA1E8; i < (s32) D_800EA1E4; i++) { - if (arg0 == D_80192CD0[i]) { - var_v1 = 0; + if ((u32) arg0 == D_80192CD0[i]) { + var_v1 = FALSE; i = D_800EA1E4; } } @@ -1519,16 +1520,16 @@ void func_800C40F0(u8 arg0) { } } -void play_sound(u32 soundBits, f32 *position, u8 arg2, f32 *arg3, f32 *arg4, u8 *arg5) { +void play_sound(u32 soundBits, Vec3f *position, u8 cameraId, f32 *arg3, f32 *arg4, u8 *arg5) { u8 bank; - struct Unk_8018FC20 *temp_v0; + struct Sound *temp_v0; bank = soundBits >> 0x1C; if (sSoundBankDisabled[bank] == FALSE) { temp_v0 = &sSoundRequests[sSoundRequestCount]; temp_v0->soundBits = soundBits; temp_v0->position = position; - temp_v0->cameraId = arg2; + temp_v0->cameraId = cameraId; temp_v0->unk0C = arg3; temp_v0->unk10 = arg4; temp_v0->unk14 = arg5; @@ -1536,10 +1537,10 @@ void play_sound(u32 soundBits, f32 *position, u8 arg2, f32 *arg3, f32 *arg4, u8 } } -void func_800C41CC(u8 arg0, struct Unk_80191420 *arg1) { +void func_800C41CC(u8 arg0, struct SoundCharacteristics *arg1) { s32 found; u8 soundId; - struct Unk_8018FC20 *sound; + struct Sound *sound; for (soundId = sNumProcessedSoundRequests; soundId != sSoundRequestCount; soundId++) { found = FALSE; @@ -1578,8 +1579,8 @@ void func_800C41CC(u8 arg0, struct Unk_80191420 *arg1) { } if (found) { sound->soundBits = 0; - if (sound->position != D_800EA1C8) { - sound->position[1] = 100000.0f; + if (*sound->position != D_800EA1C8) { + (*sound->position)[1] = 100000.0f; } } } @@ -1591,18 +1592,18 @@ void func_800C41CC(u8 arg0, struct Unk_80191420 *arg1) { void func_800C4398(void) { u8 sp4F; u8 sp4D; - struct Unk_8018FC20 *sp48; + struct Sound *sp48; u8 sp43; u32 sp3C; - struct Unk_80191420 *sp30; + struct SoundCharacteristics *sp30; f32 *temp_v0_3; - struct Unk_8018FC20 *var_a2; - struct Unk_80191420 *temp_s0; - struct Unk_80191420 *temp_s0_2; - struct Unk_80191420 *temp_s0_3; - struct Unk_80191420 *temp_t0; - struct Unk_80191420 *temp_t1; - struct Unk_80191420 *var_t1; + struct Sound *var_a2; + struct SoundCharacteristics *temp_s0; + struct SoundCharacteristics *temp_s0_2; + struct SoundCharacteristics *temp_s0_3; + struct SoundCharacteristics *temp_t0; + struct SoundCharacteristics *temp_t1; + struct SoundCharacteristics *var_t1; u32 temp_a1; u32 temp_a1_2; u32 temp_v0; @@ -1740,9 +1741,9 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800C4398.s") #endif void delete_sound_from_bank(u8 bankId, u8 soundId) { - s32 stackPadding; - struct Unk_80191420 *temp = &sSoundBanks[bankId][soundId]; - if (temp->unk00 != D_800EA1C8) { + UNUSED s32 stackPadding; + struct SoundCharacteristics *temp = &sSoundBanks[bankId][soundId]; + if (*temp->unk00 != D_800EA1C8) { *temp->unk04 = 100000.0f; } if (temp->soundBits & 0x80000) { @@ -1769,8 +1770,8 @@ void func_800C4888(u8 bankId) { u8 spCC; ? sp7C; struct_D_80192AB8_entry *sp70; - struct Unk_80191420 *sp6C; - struct Unk_80191420 *sp68; + struct SoundCharacteristics *sp6C; + struct SoundCharacteristics *sp68; s32 sp60; f32 *temp_v0; f32 temp_f0; @@ -1802,9 +1803,9 @@ void func_800C4888(u8 bankId) { s32 var_t3_2; s32 var_t3_3; s32 var_v1; - struct Unk_80191420 *temp_a0_2; - struct Unk_80191420 *temp_t2; - struct Unk_80191420 *temp_v0_7; + struct SoundCharacteristics *temp_a0_2; + struct SoundCharacteristics *temp_t2; + struct SoundCharacteristics *temp_v0_7; struct_D_80192AB8_entry *temp_s3; struct_D_80192AB8_entry *var_a2; u32 temp_t8_2; @@ -2032,8 +2033,8 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800C4888.s") void func_800C4FE4(u8 bankId) { u8 soundId; u8 var_s4; - u32 cmd; - struct Unk_80191420 *temp_s0; + UNUSED u32 cmd; + struct SoundCharacteristics *temp_s0; struct SequenceChannel *thing; for (var_s4 = 0; var_s4 < D_800EA188[D_800EA1C0][bankId]; var_s4++) { @@ -2070,10 +2071,10 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800C4FE4.s") #ifdef MIPS_TO_C //generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Oct-17-2023 void func_800C5278(u8 bankId) { - struct Unk_80191420 sp60; + struct SoundCharacteristics sp60; s32 temp_s7; - struct Unk_80191420 *temp_s0; - struct Unk_80191420 *temp_s2; + struct SoundCharacteristics *temp_s0; + struct SoundCharacteristics *temp_s2; temp_s7 = bankId & 0xFF; temp_s2 = sSoundBanks[temp_s7]; @@ -2095,7 +2096,7 @@ void func_800C5278(u8 bankId) { GLOBAL_ASM("asm/non_matchings/audio/external/func_800C5278.s") #endif -void func_800C5384(u8 arg0, f32 *arg1) { +void func_800C5384(u8 arg0, Vec3f *arg1) { u8 curr; u8 next; @@ -2103,7 +2104,7 @@ void func_800C5384(u8 arg0, f32 *arg1) { next = sSoundBanks[arg0][0].next; while (next != 0xff) { - if (arg1 == sSoundBanks[arg0][next].unk00) { + if (*arg1 == *sSoundBanks[arg0][next].unk00) { if (sSoundBanks[arg0][next].soundStatus >= 3) { func_800CBBE8((0x06020000 | ((sSoundBanks[arg0][next].unk2C & 0xff) << 8)), 0); } @@ -2119,40 +2120,40 @@ void func_800C5384(u8 arg0, f32 *arg1) { } } -void func_800C54B8(u8 arg0, f32 *arg1) { - struct Unk_80191420 unk; +void func_800C54B8(u8 arg0, Vec3f *arg1) { + struct SoundCharacteristics unk; func_800C5384(arg0, arg1); unk.soundBits = arg0 << 0x1C; unk.unk00 = arg1; func_800C41CC(1, &unk); } -void func_800C550C(s32 arg0) { +void func_800C550C(Vec3f *arg0) { UNUSED s32 pad[11]; u8 i; - s32 sp3C; + Vec3f *sp3C; for(i = 0; i < 6; i++) { func_800C5384(i, arg0); } sp3C = arg0; - func_800C41CC(2U, (struct Unk_80191420*) &sp3C); + func_800C41CC(2U, (struct SoundCharacteristics*) &sp3C); } #ifdef MIPS_TO_C //generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Oct-18-2023 -void func_800C5578(f32 *arg0, u32 arg1) { +void func_800C5578(Vec3f arg0, u32 soundBits) { u32 sp84; f32 *sp60; s32 temp_t8; s32 var_s3; - struct Unk_80191420 *temp_s0; - struct Unk_80191420 *temp_s4; + struct SoundCharacteristics *temp_s0; + struct SoundCharacteristics *temp_s4; u8 var_s1; u8 var_v0; - temp_t8 = ((u32) (arg1 & 0xF0000000) >> 0x1C) & 0xFF; + temp_t8 = ((u32) (soundBits & 0xF0000000) >> 0x1C) & 0xFF; var_s1 = sSoundBanks[temp_t8]->next; var_s3 = 0; var_v0 = var_s1; @@ -2160,7 +2161,7 @@ void func_800C5578(f32 *arg0, u32 arg1) { temp_s4 = sSoundBanks[temp_t8]; do { temp_s0 = &temp_s4[var_s1]; - if ((arg0 == temp_s0->unk00) && (arg1 == temp_s0->soundBits)) { + if ((arg0 == temp_s0->unk00) && (soundBits == temp_s0->soundBits)) { if ((s32) temp_s0->soundStatus >= 3) { func_800CBBE8((temp_s0->unk2C << 8) | 0x06020000, 0); } @@ -2179,8 +2180,8 @@ void func_800C5578(f32 *arg0, u32 arg1) { } while (var_v0 != 0xFF); } sp60 = arg0; - sp84 = arg1; - func_800C41CC(3U, (struct Unk_80191420 *) &sp60); + sp84 = soundBits; + func_800C41CC(3U, (struct SoundCharacteristics *) &sp60); } #else GLOBAL_ASM("asm/non_matchings/audio/external/func_800C5578.s") @@ -2188,22 +2189,22 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800C5578.s") #ifdef MIPS_TO_C //generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Oct-17-2023 -void func_800C56F0(u32 arg0) { - struct Unk_80191420 sp68; +void func_800C56F0(u32 soundBits) { + struct SoundCharacteristics sp68; s32 temp_t8; s32 var_s2; - struct Unk_80191420 *temp_s0; - struct Unk_80191420 *temp_s3; + struct SoundCharacteristics *temp_s0; + struct SoundCharacteristics *temp_s3; u8 var_s1; - temp_t8 = ((u32) (arg0 & 0xF0000000) >> 0x1C) & 0xFF; + temp_t8 = ((u32) (soundBits & 0xF0000000) >> 0x1C) & 0xFF; var_s1 = sSoundBanks[temp_t8]->next; var_s2 = 0; if (var_s1 != 0xFF) { temp_s3 = sSoundBanks[temp_t8]; do { temp_s0 = &temp_s3[var_s1]; - if (arg0 == temp_s0->soundBits) { + if (soundBits == temp_s0->soundBits) { if ((s32) temp_s0->soundStatus >= 3) { func_800CBBE8((temp_s0->unk2C << 8) | 0x06020000, 0); } @@ -2217,7 +2218,7 @@ void func_800C56F0(u32 arg0) { } } while (var_s1 != 0xFF); } - sp68.soundBits = arg0; + sp68.soundBits = soundBits; func_800C41CC(5U, &sp68); } #else @@ -2280,11 +2281,11 @@ void sound_init(void) { sSoundRequestCount = 0; sNumProcessedSoundRequests = 0; D_800EA1C4 = 0; - for (var_v0 = 0; var_v0 < 6; var_v0++) { + for (var_v0 = 0; var_v0 < SOUND_BANK_COUNT; var_v0++) { sSoundBankUsedListBack[var_v0] = 0; sSoundBankFreeListFront[var_v0] = 1; sNumSoundsInBank[var_v0] = 0; - sSoundBankDisabled[var_v0] = 0; + sSoundBankDisabled[var_v0] = FALSE; D_80192C48[var_v0].current = 1.0f; D_80192C48[var_v0].remainingFrames = 0; } @@ -2378,9 +2379,9 @@ void func_800C5E38(u8 playerId) { case 0: if ((D_800E9F74[playerId] == 0) && (gPlayers[playerId].characterId != 3)) { if ((s32) D_800EA1C0 < 2) { - play_sound(0x0100F926U, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF9, 0x26), &D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); } else { - play_sound(0x01008026U, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x26), &D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_38, &D_800E9F04[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); } } break; @@ -2391,9 +2392,9 @@ void func_800C5E38(u8 playerId) { } else { if (D_800E9E24[playerId] == 0x0000000A) { if ((s32) D_800EA1C0 < 2) { - func_800C9018(playerId, 0x0100F926); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xF9, 0x26)); } else { - func_800C9018(playerId, 0x01008026); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x26)); } } D_800E9E14[playerId] = 0; @@ -2414,7 +2415,7 @@ void func_800C6108(u8 playerId) { D_800E9E64[playerId] = (temp_v1->unk_098 / D_800E9DC4[playerId]) + D_800E9DD4[playerId]; if ((temp_v1->unk_098 < 1800.0f) && ((temp_v1->unk_044 & 0x20) != 0x20)) { D_800E9E64[playerId] = (temp_v1->unk_098 / D_800E9F7C[playerId].unk_34) + D_800E9F7C[playerId].unk_28; - if (D_800E9EC4) {} // ? + if(D_800E9EC4){} // ? } if (temp_v1->unk_094 > 4.75f) { if (D_800E9EB4[playerId] < (D_800E9F7C[playerId].unk_18 + 0.4f)) { @@ -2538,131 +2539,131 @@ void func_800C6758(u8 playerId) { } } -void func_800C683C(u8 arg0) { - if ((D_800EA108 == 0) && (D_800EA0EC[arg0] == 0)) { - if (D_800E9E74[arg0] != D_800E9E84[arg0]) { - func_800C5578(D_800E9F7C[arg0].pos, D_800E9E94[arg0]); - switch (D_800E9E74[arg0]) { +void func_800C683C(u8 cameraId) { + if ((D_800EA108 == 0) && (D_800EA0EC[cameraId] == 0)) { + if (D_800E9E74[cameraId] != D_800E9E84[cameraId]) { + func_800C5578(D_800E9F7C[cameraId].pos, D_800E9E94[cameraId]); + switch (D_800E9E74[cameraId]) { case 3: - play_sound(0x0100F908U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F908; + play_sound(SOUND_ACTION_TYRE_SQUEAL, &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ACTION_TYRE_SQUEAL; break; case 18: - play_sound(0x0100F81DU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F81D; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF8, 0x1D), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF8, 0x1D); break; case 19: - play_sound(0x0100F822U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F822; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF8, 0x22), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF8, 0x22); break; case 1: - play_sound(0x0100F009U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F009; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x09), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x09); break; case 2: - play_sound(0x0100F40AU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F40A; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF4, 0x0A), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF4, 0x0A); break; case 17: - play_sound(0x0100F01EU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F01E; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x1E), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x1E); break; case 15: - play_sound(0x0100F01FU, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F01F; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x1F), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x1F); break; case 16: - play_sound(0x0100F021U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F021; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x21), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x21); break; case 20: - play_sound(0x0100F027U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F027; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x27), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x27); break; case 25: - play_sound(0x0100F020U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F020; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x20), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x20); break; case 26: - play_sound(0x0100F023U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F023; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x23), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x23); break; case 27: - play_sound(0x01008046U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x01008046; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x46), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x46); break; case 28: - play_sound(0x0100F025U, D_800E9F7C[arg0].pos, arg0, &D_800E9F14[arg0], &D_800EA1D4, (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F025; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x25), &D_800E9F7C[cameraId].pos, cameraId, &D_800E9F14[cameraId], &D_800EA1D4, (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x25); break; case 4: - play_sound(0x0100F00BU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00B; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0B), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0B); break; case 5: - play_sound(0x0100F00CU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00C; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0C), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0C); break; case 6: - play_sound(0x0100F00DU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00D; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0D), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0D); break; case 7: - play_sound(0x0100F00EU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00E; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0E), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0E); break; case 8: - play_sound(0x0100F00FU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F00F; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0F), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x0F); break; case 9: - play_sound(0x0100F010U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F010; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x10), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x10); break; case 10: case 14: - play_sound(0x0100F011U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F011; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x11), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x11); break; case 11: - play_sound(0x0100F012U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F012; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x12), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x12); break; case 12: - play_sound(0x0100F013U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F013; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x13), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x13); break; case 29: - play_sound(0x0100F048U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F048; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x48), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x48); break; case 30: - play_sound(0x0100F049U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F049; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x49), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x49); break; case 31: - play_sound(0x0100F04AU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F04A; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x4A), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x4A); break; case 13: case 22: - play_sound(0x0100F029U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F029; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x29), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x29); break; case 23: - play_sound(0x0100F02AU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F02A; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x2A), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x2A); break; case 24: - play_sound(0x0100F02BU, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800E9EF4[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); - D_800E9E94[arg0] = 0x0100F02B; + play_sound(SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x2B), &D_800E9F7C[cameraId].pos, cameraId, &D_800EA1D4, &D_800E9EF4[cameraId], (u8 *) &D_800E9F7C[cameraId].unk_14); + D_800E9E94[cameraId] = SOUND_ARG_LOAD(0x01, 0x00, 0xF0, 0x2B); break; default: - func_800C5578(D_800E9F7C[arg0].pos, D_800E9E94[arg0]); + func_800C5578(D_800E9F7C[cameraId].pos, D_800E9E94[cameraId]); break; } } - D_800E9E84[arg0] = D_800E9E74[arg0]; + D_800E9E84[cameraId] = D_800E9E74[cameraId]; } } @@ -2874,15 +2875,15 @@ void func_800C76C0(u8 playerId) { D_800E9EA4[playerId]++; } if (D_800E9EA4[playerId] == 2) { - func_800C9018(playerId, 0x0100FA28); - func_800C9018(playerId, 0x0100FF2C); - func_800C9018(playerId, 0x0100FA4C); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFF, 0x2C)); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x4C)); func_800C5578(D_800E9F7C[playerId].pos, D_800E9E94[playerId]); D_800E9E74[playerId] = 0; switch (gModeSelection) { /* irregular */ case GRAND_PRIX: D_800EA0EC[playerId] = 2; - func_800C9060(playerId, 0x1900F103U); + func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0xF1, 0x03)); if (D_800EA1C0 == 0) { func_800C3448(0x100100FF); func_800C3448(0x110100FF); @@ -3011,27 +3012,27 @@ void func_800C76C0(u8 playerId) { func_800C3448(0x100100FF); func_800C3448(0x110100FF); func_800C5278(5U); - func_800C9018(playerId, 0x0100F926); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xF9, 0x26)); func_800C8EF8(0x0017U); D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); + func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); break; case 2: /* switch 2 */ if ((D_800EA0EC[0] == 1) && (D_800EA0EC[1] == 1) && (D_800EA0EC[2] == 1)) { func_800C5278(5U); - func_800C9018(playerId, 0x01008026); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x26)); func_800C8EF8(0x0017U); D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); + func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } break; case 3: /* switch 2 */ if ((D_800EA0EC[0] == 1) && (D_800EA0EC[1] == 1) && (D_800EA0EC[2] == 1) && (D_800EA0EC[3] == 1)) { func_800C5278(5U); - func_800C9018(playerId, 0x01008026); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x26)); func_800C8EF8(0x0017U); D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + 0x2900800D); + func_800C90F4(playerId, (gPlayers[gPlayerWinningIndex].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } break; } @@ -3047,28 +3048,28 @@ void func_800C76C0(u8 playerId) { case GRAND_PRIX: /* switch 3 */ if (gPlayers[playerId].currentRank == 0) { D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008007); + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x07)); } else if (gPlayers[playerId].currentRank < 4) { D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } else { D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008003); + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x03)); } break; case VERSUS: /* switch 3 */ if (gPlayers[playerId].currentRank == 0) { D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } break; case TIME_TRIALS: /* switch 3 */ if (D_801657E5 == 1) { D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008007); + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x07)); } else if (D_8018ED90 == (u8) 1) { D_800EA0EC[playerId] = 2; - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x2900800D); + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } break; } @@ -3142,9 +3143,9 @@ void func_800C847C(u8 playerId) { if ((gPlayers[playerId].unk_0DE & 1) == 1) { if (D_800E9F74[playerId] == 0) { if ((s32) D_800EA1C0 < 2) { - func_800C9018(playerId, 0x0100F926); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xF9, 0x26)); } else { - func_800C9018(playerId, 0x01008026); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0x80, 0x26)); } func_800C97C4(playerId); D_800E9F74[playerId] = 1; @@ -3159,7 +3160,7 @@ void func_800C847C(u8 playerId) { || (gCurrentCourseId == COURSE_SHERBET_LAND) || (gCurrentCourseId == COURSE_DK_JUNGLE) || (gCurrentCourseId == COURSE_BIG_DONUT)) && (D_800EA0EC[playerId] == 0)) { - play_sound((gPlayers[playerId].characterId * 0x10) + 0x29008005, D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); + play_sound((gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05), &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); } } } else { @@ -3169,7 +3170,7 @@ void func_800C847C(u8 playerId) { func_800C94A4(playerId); D_800E9F74[playerId] = 0; if ((gCurrentCourseId == COURSE_KOOPA_BEACH) && (D_800EA0EC[playerId] == 0)) { - play_sound((gPlayers[playerId].characterId * 0x10) + 0x29008008, D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); + play_sound((gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08), &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); } } } @@ -3177,7 +3178,7 @@ void func_800C847C(u8 playerId) { void func_800C86D8(u8 playerId) { if (((gPlayers[playerId].effects & 0x40000000) != 0x40000000) && (D_800E9F24[playerId] == 1)) { - func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + 0x29008008); + func_800C90F4(playerId, (gPlayers[playerId].characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08)); } } @@ -3330,13 +3331,13 @@ void func_800C8CCC() { void play_sound2(s32 soundBits) { if ((soundBits == SOUND_ACTION_REV_ENGINE) && (gCurrentCourseId == COURSE_DK_JUNGLE)) { - soundBits = 0x49008027; + soundBits = SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x27); } if ((soundBits == SOUND_ACTION_REV_ENGINE_2) && (gCurrentCourseId == COURSE_DK_JUNGLE)) { - soundBits = 0x49008028; + soundBits = SOUND_ARG_LOAD(0x49, 0x00, 0x80, 0x28); } - play_sound(soundBits, D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(soundBits, &D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); } void func_800C8EAC(u16 arg0) { @@ -3353,47 +3354,47 @@ void func_800C8F44(u8 arg0) { func_800C36C4(0, 0, arg0, 1); } -void func_800C8F80(u8 arg0, u32 arg1) { +void func_800C8F80(u8 arg0, u32 soundBits) { if (D_800EA108 == 0) { switch(D_800EA0EC[arg0]) { case 2: D_800EA0EC[arg0] = 1; case 0: - play_sound(arg1, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(soundBits, &D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); break; } } } -void func_800C9018(u8 arg0, s32 arg1) { - func_800C5578(D_800E9F7C[arg0].pos, arg1); +void func_800C9018(u8 arg0, u32 soundBits) { + func_800C5578(D_800E9F7C[arg0].pos, soundBits); } -void func_800C9060(u8 playerId, u32 arg1) { +void func_800C9060(u8 playerId, u32 soundBits) { if (D_800EA108 == 0) { switch(D_800EA0EC[playerId]) { case 2: D_800EA0EC[playerId] = 1; case 0: - play_sound(arg1, D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, &D_800E9F7C[playerId].unk_14); + play_sound(soundBits, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4,(u8 *) &D_800E9F7C[playerId].unk_14); break; } } } -void func_800C90F4(u8 playerId, u32 arg1) { +void func_800C90F4(u8 playerId, u32 soundBits) { if (D_800EA108 == 0) { switch (D_800EA0EC[playerId]) { case 2: D_800EA0EC[playerId] = 1; case 0: - if (((arg1 & ~0xF0) == 0x29008003) || ((arg1 & ~0xF0) == 0x29008004) || ((arg1 & ~0xF0) == 0x29008005)) { + if (((soundBits & ~0xF0) == SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x03)) || ((soundBits & ~0xF0) == SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x04)) || ((soundBits & ~0xF0) == SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05))) { D_800EA180 = 1; } if (((gPlayers[playerId].effects & 0x40000000) == 0x40000000) && ((s32) D_800E9F2C[playerId] >= 0x1F)) { - play_sound(arg1, D_800E9F7C[playerId].pos, playerId, &D_800EA150, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); + play_sound(soundBits, &D_800E9F7C[playerId].pos, playerId, &D_800EA150, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); } else { - play_sound(arg1, D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); + play_sound(soundBits, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); } break; default: @@ -3403,7 +3404,7 @@ void func_800C90F4(u8 playerId, u32 arg1) { } void func_800C9250(u8 arg0) { - func_800C90F4(arg0, (gPlayers[arg0].characterId * 0x10) + (gAudioRandom & 1) + 0x29008001); + func_800C90F4(arg0, (gPlayers[arg0].characterId * 0x10) + (gAudioRandom & 1) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x01)); } void func_800C92CC(u8 playerId, u32 soundBits) { @@ -3416,9 +3417,9 @@ void func_800C92CC(u8 playerId, u32 soundBits) { if (temp_v0 != NULL) { temp_v0->unk34 = 170.0f; if (((gPlayers[playerId].effects & 0x40000000) == 0x40000000) && ((s32) D_800E9F2C[playerId] >= 0x1F)) { - play_sound((gPlayers[playerId].characterId * 0x10) + soundBits, temp_v0->unk18, var_s0, &D_800EA150, &D_800EA1D4, &D_800EA06C[playerId].unk0C); + play_sound((gPlayers[playerId].characterId * 0x10) + soundBits, &temp_v0->unk18, var_s0, &D_800EA150, &D_800EA1D4, &D_800EA06C[playerId].unk0C); } else { - play_sound((gPlayers[playerId].characterId * 0x10) + soundBits, temp_v0->unk18, var_s0, &temp_v0->unk2C, &D_800EA1D4, &D_800EA06C[playerId].unk0C); + play_sound((gPlayers[playerId].characterId * 0x10) + soundBits, &temp_v0->unk18, var_s0, &temp_v0->unk2C, &D_800EA1D4, &D_800EA06C[playerId].unk0C); } } } @@ -3508,7 +3509,7 @@ void func_800C94A4(u8 playerId) { } break; } - play_sound(var_a0, D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_0C, &D_800E9F7C[playerId].unk_10, (u8 *) &D_800E9F7C[playerId].unk_14); + play_sound(var_a0, &D_800E9F7C[playerId].pos, playerId, &D_800E9F7C[playerId].unk_0C, &D_800E9F7C[playerId].unk_10, (u8 *) &D_800E9F7C[playerId].unk_14); break; default: break; @@ -3517,11 +3518,11 @@ void func_800C94A4(u8 playerId) { } void func_800C97C4(u8 arg0) { - func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + 0x0104FF00); - func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + 0x0104FF14); - func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + 0x0104FF2E); - func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + 0x0104FF36); - func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + 0x0104FF3E); + func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + SOUND_ARG_LOAD(0x01, 0x04, 0xFF, 0x00)); + func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + SOUND_ARG_LOAD(0x01, 0x04, 0xFF, 0x14)); + func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + SOUND_ARG_LOAD(0x01, 0x04, 0xFF, 0x2E)); + func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + SOUND_ARG_LOAD(0x01, 0x04, 0xFF, 0x36)); + func_800C5578(D_800E9F7C[arg0].pos, gPlayers[arg0].characterId + SOUND_ARG_LOAD(0x01, 0x04, 0xFF, 0x3E)); } void func_800C98B8(Vec3f position, Vec3f velocity, u32 soundBits) { @@ -3533,21 +3534,21 @@ void func_800C98B8(Vec3f position, Vec3f velocity, u32 soundBits) { temp_v0 = func_800C1C88(0U, position, velocity, D_800EA1C8, (u8) var_s0, soundBits); if (temp_v0 != 0) { temp_v0->unk34 = 170.0f; - play_sound(soundBits, temp_v0->unk18, var_s0, &temp_v0->unk2C, &D_800EA1D4, &D_800EA1DC); + play_sound(soundBits, &temp_v0->unk18, var_s0, &temp_v0->unk2C, &D_800EA1D4, &D_800EA1DC); } } } } -void func_800C99E0(Vec3f arg0, s32 arg1) { - f32* temp_v0; +void func_800C99E0(Vec3f arg0, s32 soundBits) { + Vec3f* temp_v0; u8 temp_t9; if (D_800EA108 == 0) { for(temp_t9 = 0; temp_t9 < D_800EA1C0 + 1; temp_t9++) { - temp_v0 = func_800C21E8(arg0, arg1); - if (temp_v0 != 0x0) { - func_800C5578(temp_v0, arg1); + temp_v0 = func_800C21E8(arg0, soundBits); + if (temp_v0 != NULL) { + func_800C5578(*temp_v0, soundBits); } } } @@ -3590,11 +3591,11 @@ void func_800C9A88(u8 playerId) { } if (D_800EA1C0 < 2) { for (var_s0 = 0; var_s0 < D_800EA1C0 + 1; var_s0++) { - soundBits = gPlayers[playerId].characterId + 0x31028000; + soundBits = gPlayers[playerId].characterId + SOUND_ARG_LOAD(0x31, 0x02, 0x80, 0x00); temp_v0_6 = func_800C1C88(playerId, gPlayers[playerId].pos, gPlayers[playerId].velocity, &gPlayers[playerId].unk_098, var_s0, soundBits); if (temp_v0_6 != NULL) { temp_v0_6->unk34 = 40.0f; - play_sound(soundBits, temp_v0_6->unk18, var_s0, &temp_v0_6->unk2C, &D_800EA06C[playerId].unk00[2], &D_800EA06C[playerId].unk0C); + play_sound(soundBits, &temp_v0_6->unk18, var_s0, &temp_v0_6->unk2C, &D_800EA06C[playerId].unk00[2], &D_800EA06C[playerId].unk0C); } } } @@ -3606,7 +3607,7 @@ void func_800C9A88(u8 playerId) { } void func_800C9D0C(u8 playerId) { - func_800C550C(func_800C21E8(gPlayers[playerId].pos, gPlayers[playerId].characterId + 0x31028000)); + func_800C550C(func_800C21E8(gPlayers[playerId].pos, gPlayers[playerId].characterId + SOUND_ARG_LOAD(0x31, 0x02, 0x80, 0x00))); } void func_800C9D80(Vec3f position, Vec3f velocity, u32 soundBits) { @@ -3618,10 +3619,10 @@ void func_800C9D80(Vec3f position, Vec3f velocity, u32 soundBits) { temp_v0 = func_800C1C88(0U, position, velocity, D_800EA1C8, (u8) var_s0, soundBits); if (temp_v0 != 0) { temp_v0->unk34 = 170.0f; - if (soundBits == 0x5103700B) { - play_sound(soundBits, temp_v0->unk18, var_s0, &D_800EA178, &D_800EA17C, &D_800EA1DC); + if (soundBits == SOUND_ARG_LOAD(0x51, 0x03, 0x70, 0x0B)) { + play_sound(soundBits, &temp_v0->unk18, var_s0, &D_800EA178, &D_800EA17C, &D_800EA1DC); } else { - play_sound(soundBits, temp_v0->unk18, var_s0, &temp_v0->unk2C, &D_800EA1D4, &D_800EA1DC); + play_sound(soundBits, &temp_v0->unk18, var_s0, &temp_v0->unk2C, &D_800EA1D4, &D_800EA1DC); } } } @@ -3629,14 +3630,14 @@ void func_800C9D80(Vec3f position, Vec3f velocity, u32 soundBits) { } -void func_800C9EF4(Vec3f arg0, u32 arg1) { - f32 *temp; +void func_800C9EF4(Vec3f arg0, u32 soundBits) { + Vec3f *temp; u8 i; for (i = 0; i < D_800EA1C0 + 1; i++) { - temp = func_800C21E8(arg0, arg1); + temp = func_800C21E8(arg0, soundBits); if (temp != NULL) { - func_800C5578(temp, arg1); + func_800C5578(*temp, soundBits); } } } @@ -3785,7 +3786,7 @@ void func_800CA49C(u8 arg0) { void func_800CA59C(u8 playerId) { if ((D_800EA0EC[playerId] == 0) && (D_800EA108 == 0)) { - play_sound((gPlayers[playerId].characterId * 0x10) + 0x29008001, D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); + play_sound((gPlayers[playerId].characterId * 0x10) + 0x29008001, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA1D4, (u8 *) &D_800E9F7C[playerId].unk_14); D_800EA164 = 1; if ((s32) D_800EA1C0 >= 2) { func_800C8F80(playerId, 0x0100FF2C); @@ -3812,14 +3813,14 @@ void func_800CA59C(u8 playerId) { void func_800CA730(u8 arg0) { if (D_800EA0EC[arg0] == 0) { if ((D_800EA108 == 0) && (D_800EA10C[arg0] != 0)) { - play_sound(gPlayers[arg0].characterId * 0x10 + 0x29008008, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8*) &D_800E9F7C[arg0].unk_14); + play_sound(gPlayers[arg0].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08), &D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA1D4, (u8*) &D_800E9F7C[arg0].unk_14); if (D_800EA10C[arg0] != 0) { if ((s32) D_800EA1C0 >= 2) { - func_800C9018(arg0, 0x0100FF2C); + func_800C9018(arg0, SOUND_ARG_LOAD(0x01, 0x00, 0xFF, 0x2C)); } else { D_800EA10C[arg0] = 0; if (D_800EA104 != 0) { - func_800C9018(arg0, 0x0100FF2C); + func_800C9018(arg0, SOUND_ARG_LOAD(0x01, 0x00, 0xFF, 0x2C)); } else if ((D_800EA10C[0] == 0) && (D_800EA10C[1] == 0)) { if (D_8018FC08 != 0) { if (((u32) (gSequencePlayers[1].enabled)) == 0) { @@ -3854,9 +3855,9 @@ void func_800CA984(u8 arg0) { if ((D_800EA108 == 0) && (D_800EA0F0 == 0)) { for (i = 0; i < D_800EA1C0 + 1; i++) { - temp_v0_2 = func_800C1C88(arg0, &gPlayers[arg0].pos, D_800EA1C8, &gPlayers[arg0].unk_098, (u8) i, 0x31029008U); + temp_v0_2 = func_800C1C88(arg0, gPlayers[arg0].pos, D_800EA1C8, &gPlayers[arg0].unk_098, (u8) i, SOUND_ITEM_STAR); if (temp_v0_2) { - play_sound(0x31029008U, temp_v0_2->unk18, i, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(SOUND_ITEM_STAR, &temp_v0_2->unk18, i, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); } } } @@ -3864,13 +3865,13 @@ void func_800CA984(u8 arg0) { void func_800CAACC(u8 playerId) { if ((u8) D_800EA108 == 0) { - func_800C5578(func_800C21E8(gPlayers[playerId].pos, 0x31029008U), 0x31029008); + func_800C5578(*func_800C21E8(gPlayers[playerId].pos, SOUND_ITEM_STAR), SOUND_ITEM_STAR); } } void func_800CAB4C(u8 arg0) { - u8 *temp_v1; - u8 temp_v0; + UNUSED u8 *temp_v1; + UNUSED u8 temp_v0; if (D_800EA108 == 0) { switch(D_800EA0EC[arg0]) { @@ -3879,7 +3880,7 @@ void func_800CAB4C(u8 arg0) { case 0: func_800C36C4(0, 1U, 0x55U, 5); func_800C9060(arg0, 0x1900F013U); - play_sound(0x5101C00CU, D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(SOUND_ITEM_THUNDERBOLT, &D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); break; default: break; @@ -3891,17 +3892,17 @@ void func_800CAB4C(u8 arg0) { void func_800CAC08() { if (D_800EA108 == 0) { func_800C36C4(0, 1U, 0x7FU, 0x19); - func_800C56F0(0x5101C00C); + func_800C56F0(SOUND_ITEM_THUNDERBOLT); D_800EA168 = 0; } } void func_800CAC60(UNUSED s32 arg0) { if ((D_800EA108 == 0) && (D_800EA0F0 == 0)) { - play_sound(SOUND_ACTION_EXPLOSION_2, D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(SOUND_ACTION_EXPLOSION_2, &D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); if ((D_800EA10C[0] != 1) && (D_800EA10C[1] != 1)) { func_800C36C4(0, 1, 0x37U, 5); - play_sound(SOUND_ITEM_THUNDERBOLT, D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); + play_sound(SOUND_ITEM_THUNDERBOLT, &D_800EA1C8, 0U, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC); D_800EA168 = 1; } } @@ -3912,7 +3913,7 @@ void func_800CAD40(UNUSED s32 arg0) { if ((D_800EA170[0] == 0) && (D_800EA170[1] == 0) && (D_800EA170[2] == 0) && (D_800EA170[3] == 0)) { func_800C36C4(0, 1, 0x7FU, 0x19); } - func_800C56F0(0x5101C00C); + func_800C56F0(SOUND_ITEM_THUNDERBOLT); D_800EA168 = 0; } } @@ -3932,7 +3933,7 @@ void func_800CADD0(u8 arg0, f32 arg1) { arg1 = 0.0f; } D_800EA110[arg0] = arg1; - play_sound(0x1900A209U, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA110[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + play_sound(0x1900A209U, &D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA110[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); break; default: break; @@ -3940,11 +3941,11 @@ void func_800CADD0(u8 arg0, f32 arg1) { } } -void func_800CAEC4(u8 arg0, f32 arg1) { +void func_800CAEC4(u8 playerId, f32 arg1) { if (D_800EA108 == 0) { - switch (D_800EA0EC[arg0]) { + switch (D_800EA0EC[playerId]) { case 2: - D_800EA0EC[arg0] = 1; + D_800EA0EC[playerId] = 1; // Purposeful fallthrough case 0: arg1 = (arg1 * 0.7f) + 0.1f; @@ -3954,8 +3955,8 @@ void func_800CAEC4(u8 arg0, f32 arg1) { if (arg1 < 0.0f) { arg1 = 0.0f; } - D_800EA120[arg0] = arg1; - play_sound(gCurrentCourseId + 0x19007020, D_800E9F7C[arg0].pos, arg0, &D_800EA1D4, &D_800EA120[arg0], (u8 *) &D_800E9F7C[arg0].unk_14); + D_800EA120[playerId] = arg1; + play_sound(gCurrentCourseId + 0x19007020, &D_800E9F7C[playerId].pos, playerId, &D_800EA1D4, &D_800EA120[playerId], (u8 *) &D_800E9F7C[playerId].unk_14); break; default: break; @@ -3985,8 +3986,8 @@ void func_800CB064(u8 arg0) { if ((u8) D_800EA168 == 0) { func_800C36C4(0, 1U, 0x7FU, 0x19); } - func_800C90F4(arg0, gPlayers[arg0].characterId * 0x10 + 0x29008008); - func_800C9018(arg0, 0x0100FA4C); + func_800C90F4(arg0, gPlayers[arg0].characterId * 0x10 + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08)); + func_800C9018(arg0, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x4C)); D_800EA170[arg0] = 0; } } diff --git a/src/audio/external.h b/src/audio/external.h index fedc173e9..7762aea1f 100644 --- a/src/audio/external.h +++ b/src/audio/external.h @@ -45,9 +45,9 @@ #define SOUND_BANK_COUNT 6 // Almost certainly an expanded version of struct Sound from SM64 -struct Unk_8018FC20 { +struct Sound { /* 0x00 */ u32 soundBits; - /* 0x04 */ f32 *position; + /* 0x04 */ Vec3f *position; /* 0x08 */ u8 cameraId; // playerId? some indicator of "who" the sound is desitned for /* 0x09 */ // u8 compilerPadding0[3]; /* 0x0C */ f32 *unk0C; @@ -98,9 +98,9 @@ struct Unk_8018EFD8 { }; // size = 0x3C // This is almost certainly an expanded version of SoundCharacteristics from SM64 -struct Unk_80191420 { +struct SoundCharacteristics { // These f32 pointers appear to point to the `Vec3f unk18` members in a struct Unk_8018EFD8 - /* 0x00 */ f32 *unk00; + /* 0x00 */ Vec3f *unk00; /* 0x04 */ f32 *unk04; /* 0x08 */ f32 *unk08; /* 0x0C */ u8 cameraId; // playerId? some indicator of "who" the sound is desitned for @@ -188,10 +188,12 @@ typedef struct { u8 unk9; } UnkStruct8018EF18; // size = 0xC +/** @cond */ + void func_800C94A4(u8); void func_800CADD0(u8, f32); void func_800C13F0(void); -void func_800C13FC(OSMesg); +void audio_reset_session_eu(OSMesg); f32 func_800C1480(u8, u8); s8 func_800C15D0(u8, u8, u8); s8 func_800C16E8(f32, f32, u8); @@ -202,13 +204,14 @@ void func_800C1DA4(Camera*, Vec3s, struct Unk_8018EFD8*); void func_800C1E2C(Camera*, Vec3f, struct Unk_8018EFD8*); void func_800C1F8C(void); -f32 *func_800C21E8(Vec3f, u32); +Vec3f *func_800C21E8(Vec3f, u32); void func_800C2274(u8); void func_800C2474(void); void func_800C284C(u8, u8, u8, u16); void func_800C29B4(u8, u16); void func_800C3724(void); +void func_800C2A2C(u32); void func_800C3448(u32); void func_800C3478(void); u16 func_800C3508(u8); @@ -221,17 +224,17 @@ void func_800C3F70(void); void func_800C400C(void); void func_800C4084(u16); void func_800C40F0(u8); -void play_sound(u32, f32*, u8, f32*, f32*, u8*); -void func_800C41CC(u8, struct Unk_80191420*); +void play_sound(u32, Vec3f*, u8, f32*, f32*, u8*); +void func_800C41CC(u8, struct SoundCharacteristics*); void func_800C4398(void); void delete_sound_from_bank(u8, u8); void func_800C4888(u8); void func_800C4FE4(u8); void func_800C5278(u8); -void func_800C5384(u8, f32*); -void func_800C54B8(u8, f32*); -void func_800C550C(s32); +void func_800C5384(u8, Vec3f*); +void func_800C54B8(u8, Vec3f*); +void func_800C550C(Vec3f*); void func_800C5578(Vec3f, u32); u8 func_800C56F0(u32); void func_800C5848(void); @@ -267,7 +270,7 @@ void func_800C8EF8(u16); void func_800C8F44(u8); void func_800C8F80(u8, u32); -void func_800C9018(u8, s32); +void func_800C9018(u8, u32); void func_800C9060(u8, u32); void func_800C90F4(u8, u32); void func_800C9250(u8); @@ -325,13 +328,13 @@ extern struct Unk_8018EFD8 D_8018EFD8[]; // These are indexes for D_8018EFD8, but their purpose is unknown extern u8 D_8018FB90; extern u8 D_8018FB91; -extern Camera *D_8018FB98[4]; -extern Vec3f D_8018FBA8[4]; -extern Vec3f D_8018FBD8[4]; +extern Camera *gCopyCamera[4]; +extern Vec3f gVelocityCamera[4]; +extern Vec3f gCameraLastPos[4]; extern u8 D_8018FC08; extern u16 D_8018FC10[4][2]; -extern struct Unk_80191420 sSoundBanks[SOUND_BANK_COUNT][20]; +extern struct SoundCharacteristics sSoundBanks[SOUND_BANK_COUNT][20]; extern u8 sSoundBankUsedListBack[SOUND_BANK_COUNT]; extern u8 sSoundBankFreeListFront[SOUND_BANK_COUNT]; extern u8 sNumSoundsInBank[SOUND_BANK_COUNT]; @@ -345,7 +348,7 @@ extern u32 D_80192CD0[256]; extern struct_D_801930D0_entry D_801930D0[3]; extern u8 sNumProcessedSoundRequests; extern u8 sSoundRequestCount; -extern struct Unk_8018FC20 sSoundRequests[0x100]; +extern struct Sound sSoundRequests[0x100]; // Data entries extern u8 D_800E9DA0; @@ -421,4 +424,6 @@ extern s8 D_800EA16C; extern OSMesgQueue *D_800EA3B0; extern OSMesgQueue *D_800EA3B4; +/** @endcond */ + #endif diff --git a/src/audio/heap.c b/src/audio/heap.c index 02d9b8971..59eadb63b 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -1,5 +1,6 @@ #include #include + #include "audio/data.h" #include "audio/effects.h" #include "audio/heap.h" @@ -703,8 +704,8 @@ void func_800BA8B0(s32 poolIdx, s32 id) { s32 temp_a2; u32 temp_a1; u8 *var_a3; - u8 *temp_v0; - s32 pad; + UNUSED u8 *temp_v0; + UNUSED s32 pad; switch (poolIdx) { /* irregular */ case 0: @@ -718,7 +719,7 @@ void func_800BA8B0(s32 poolIdx, s32 id) { break; } if (sp3C->seqArray[id].len == 0) { - id = sp3C->seqArray[id].offset; + id = (s32) sp3C->seqArray[id].offset; } if (unk_pool1_lookup(poolIdx, id) == NULL) { temp_a2 = gUnkPool1.pool.numAllocatedEntries; diff --git a/src/audio/heap.h b/src/audio/heap.h index 45aa87357..d759eab18 100644 --- a/src/audio/heap.h +++ b/src/audio/heap.h @@ -118,14 +118,12 @@ void func_800BA8B0(s32, s32); extern s32 D_800EA5D0; extern u8 D_803B71B0[]; -extern u8 gAudioResetPresetIdToLoad; // D_803B0501 -extern s32 gMaxAudioCmds; // D_803B70AC -extern s16 gTempoInternalToExternal; // D_803B70B4 -extern u64 *gAudioCmdBuffers[]; // D_803B70C8 +extern s32 gMaxAudioCmds; +extern s16 gTempoInternalToExternal; extern f32 D_803B7178; -extern s32 gRefreshRate; // D_803B717C -extern u32 gSampleDmaNumListItems; // D_803B6E58 -extern struct AudioSessionSettingsEU gAudioSessionPresets[]; // D_800EA4D8 +extern s32 gRefreshRate; +extern u32 gSampleDmaNumListItems; +extern struct AudioSessionSettingsEU gAudioSessionPresets[]; // Note: In some .asm files D_803AFBC8 has been replaced with gLeftVolRampings diff --git a/src/audio/internal.h b/src/audio/internal.h index 33665af01..5a96d950b 100644 --- a/src/audio/internal.h +++ b/src/audio/internal.h @@ -157,9 +157,9 @@ struct Instrument { }; // size = 0x20 struct Drum { - u8 releaseRate; - u8 pan; - u8 loaded; + /*0x00*/ u8 releaseRate; + /*0x01*/ u8 pan; + /*0x02*/ u8 loaded; struct AudioBankSound sound; struct AdsrEnvelope *envelope; }; @@ -602,11 +602,11 @@ struct EuAudioCmd { union { struct { u8 op; - u8 arg1; + u8 bankId; u8 arg2; u8 arg3; } s; - s32 first; + u32 first; } u; union { s32 as_s32; diff --git a/src/audio/load.c b/src/audio/load.c index e71a0a66c..e390470ee 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -1,11 +1,14 @@ #include #include + #include "audio/load.h" #include "audio/data.h" #include "audio/heap.h" #include "audio/internal.h" #include "audio/playback.h" #include "audio/synthesis.h" +#include "audio/seqplayer.h" +#include "audio/port_eu.h" #include "data/gfx_output_buffer.h" #define ALIGN16(val) (((val) + 0xF) & ~0xF) @@ -103,7 +106,7 @@ char loadAudioString38[] = "---------------------------------------\n"; /** * Performs an immediate DMA copy */ -void audio_dma_copy_immediate(uintptr_t devAddr, void *vAddr, size_t nbytes) { +void audio_dma_copy_immediate(u8 *devAddr, void *vAddr, size_t nbytes) { // eu_stubbed_printf_3("Romcopy %x -> %x ,size %x\n", devAddr, vAddr, nbytes); osInvalDCache(vAddr, nbytes); osPiStartDma(&D_803B6740, OS_MESG_PRI_HIGH, OS_READ, devAddr, vAddr, nbytes, &D_803B6720); @@ -322,7 +325,7 @@ s32 func_800BB304(struct AudioBankSample *sample) { if (mem == (void *)NULL) { return -1; } - audio_dma_copy_immediate((uintptr_t)sample->sampleAddr, mem, sample->sampleSize); + audio_dma_copy_immediate(sample->sampleAddr, mem, sample->sampleSize); sample->loaded = 0x81; sample->sampleAddr = mem; // sound->unk4 } @@ -381,26 +384,26 @@ void patch_sound(struct AudioBankSound *sound, u8 *memBase, u8 *offsetBase) { #define PATCH(x, base) (patched = (void *)((uintptr_t) (x) + (uintptr_t) base)) if (sound->sample != NULL) { - sample = sound->sample = PATCH(sound->sample, memBase); + sample = sound->sample = (struct AdpcmLoop *) PATCH(sound->sample, memBase); if (sample->loaded == 0) { - sample->sampleAddr = PATCH(sample->sampleAddr, offsetBase); - sample->loop = PATCH(sample->loop, memBase); - sample->book = PATCH(sample->book, memBase); + sample->sampleAddr = (struct u8 *) PATCH(sample->sampleAddr, offsetBase); + sample->loop = (struct AdpcmLoop *) PATCH(sample->loop, memBase); + sample->book = (struct AdpcmBook *) PATCH(sample->book, memBase); sample->loaded = 1; } else if (sample->loaded == 0x80) { PATCH(sample->sampleAddr, offsetBase); mem = soundAlloc(&gNotesAndBuffersPool, sample->sampleSize); if (mem == NULL) { - sample->sampleAddr = patched; + sample->sampleAddr = (u8 *) patched; sample->loaded = 1; } else { - audio_dma_copy_immediate((uintptr_t) patched, mem, sample->sampleSize); + audio_dma_copy_immediate((u8 *) patched, mem, sample->sampleSize); sample->loaded = 0x81; sample->sampleAddr = mem; } - sample->loop = PATCH(sample->loop, memBase); - sample->book = PATCH(sample->book, memBase); + sample->loop = (struct AdpcmLoop *) PATCH(sample->loop, memBase); + sample->book = (struct AdpcmBook *) PATCH(sample->book, memBase); } } @@ -417,8 +420,8 @@ void func_800BB584(s32 bankId) { var_a1 = gAlTbl->seqArray[bankId].offset; } // wtf is up with the `gCtlEntries[bankId].instruments - 1` stuff? - patch_audio_bank((gCtlEntries[bankId].instruments - 1), var_a1, gCtlEntries[bankId].numInstruments, gCtlEntries[bankId].numDrums); - gCtlEntries[bankId].drums = *(gCtlEntries[bankId].instruments - 1); + patch_audio_bank((struct AudioBank*) (gCtlEntries[bankId].instruments - 1), var_a1, gCtlEntries[bankId].numInstruments, gCtlEntries[bankId].numDrums); + gCtlEntries[bankId].drums = (struct Drum**) *(gCtlEntries[bankId].instruments - 1); } void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 numDrums) { @@ -492,8 +495,7 @@ void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1) { s32 alloc; - s32 stackPadding0[4]; - s32 stackPadding1[5]; + UNUSED s32 stackPadding0[9]; struct AudioBank *ret; u8 *ctlData; @@ -505,7 +507,7 @@ struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1) { if (ret == NULL) { return NULL; } - audio_dma_copy_immediate((u32) (ctlData + 0x10), ret, (u32) alloc); + audio_dma_copy_immediate(ctlData + 0x10, ret, (u32) alloc); gCtlEntries[bankId].instruments = ret->instruments; func_800BB584(bankId); if (gBankLoadStatus[bankId] != 5) { @@ -516,10 +518,10 @@ struct AudioBank *bank_load_immediate(s32 bankId, s32 arg1) { struct AudioBank *bank_load_async(s32 bankId, s32 arg1, struct SequencePlayer *seqPlayer) { size_t alloc; - s32 stackPadding0[9]; + UNUSED s32 stackPadding0[9]; struct AudioBank *ret; u8 *ctlData; - s32 stackPadding1[2]; + UNUSED s32 stackPadding1[2]; alloc = gAlCtlHeader->seqArray[bankId].len + 0xF; alloc = ALIGN16(alloc); @@ -558,7 +560,7 @@ void *sequence_dma_immediate(s32 seqId, s32 arg1) { return NULL; } - audio_dma_copy_immediate((uintptr_t) seqData, ptr, seqLength); + audio_dma_copy_immediate(seqData, ptr, seqLength); if (gSeqLoadStatus[seqId] != 5) { gSeqLoadStatus[seqId] = 2; } @@ -579,13 +581,13 @@ void *sequence_dma_async(s32 seqId, s32 arg1, struct SequencePlayer *seqPlayer) return NULL; } if (seqLength < 0x41) { - audio_dma_copy_immediate((uintptr_t) seqData, ptr, (u32) seqLength); + audio_dma_copy_immediate(seqData, ptr, (u32) seqLength); if (1) {} if (gSeqLoadStatus[seqId] != 5) { gSeqLoadStatus[seqId] = 2; } } else { - audio_dma_copy_immediate((uintptr_t) seqData, ptr, 0x00000040U); + audio_dma_copy_immediate(seqData, ptr, 0x00000040U); mesgQueue = &seqPlayer->seqDmaMesgQueue; osCreateMesgQueue(mesgQueue, &seqPlayer->seqDmaMesg, 1); seqPlayer->seqDmaInProgress = TRUE; @@ -775,7 +777,7 @@ void audio_init() { s32 UNUSED lim2, lim3; UNUSED s32 size; UNUSED u64 *ptr64; - void *data; + UNUSED void *data; UNUSED s32 one = 1; u8 *test; @@ -809,7 +811,7 @@ void audio_init() { gRefreshRate = 0x0000003C; break; } - func_800CBF48(); + port_eu_init(); for (i = 0; i < NUMAIBUFFERS; i++) { gAiBufferLengths[i] = 0xa0; } @@ -872,7 +874,7 @@ void audio_init() { audio_dma_copy_immediate(test, gAlTbl, size); func_800BB43C(gAlTbl, test); gAlBankSets = soundAlloc(&gAudioInitPool, 0x00000100U); - audio_dma_copy_immediate((u32) &_instrument_setsSegmentRomStart, gAlBankSets, 0x00000100U); + audio_dma_copy_immediate(&_instrument_setsSegmentRomStart, gAlBankSets, 0x00000100U); sound_alloc_pool_init(&gUnkPool1.pool, soundAlloc(&gAudioInitPool, (u32) D_800EA5D8), (u32) D_800EA5D8); init_sequence_players(); gAudioLoadLock = 0x76557364; diff --git a/src/audio/load.h b/src/audio/load.h index 5b2b089fc..4feedf970 100644 --- a/src/audio/load.h +++ b/src/audio/load.h @@ -21,7 +21,7 @@ struct SharedDma { /*0xE*/ u8 ttl; // duration after which the DMA can be discarded }; // size = 0x10 -void audio_dma_copy_immediate(uintptr_t devAddr, void *vAddr, size_t nbytes); +void audio_dma_copy_immediate(u8* devAddr, void *vAddr, size_t nbytes); void audio_dma_copy_async(uintptr_t, void*, size_t, OSMesgQueue*, OSIoMesg*); void audio_dma_partial_copy_async(uintptr_t*, u8**, ssize_t*, OSMesgQueue*, OSIoMesg*); void decrease_sample_dma_ttls(void); diff --git a/src/audio/port_eu.c b/src/audio/port_eu.c index 7c1629696..e5b3c7e01 100644 --- a/src/audio/port_eu.c +++ b/src/audio/port_eu.c @@ -93,13 +93,13 @@ struct SPTask *create_next_audio_frame_task(void) { gCurrAudioFrameDmaCount = 0; decrease_sample_dma_ttls(); if (osRecvMesg(D_800EA3B0, &sp58, 0) != -1) { - gAudioResetPresetIdToLoad = (u8) sp58; + gAudioResetPresetIdToLoad = (u8) (u32) sp58; gAudioResetStatus = 5; } if (gAudioResetStatus != 0) { if (audio_shut_down_and_reset_step() == 0) { if (gAudioResetStatus == 0) { - osSendMesg(D_800EA3B4, (OSMesg) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK); + osSendMesg(D_800EA3B4, (OSMesg) (u32) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK); } return NULL; } @@ -142,7 +142,7 @@ struct SPTask *create_next_audio_frame_task(void) { task->dram_stack_size = 0; task->output_buff = NULL; task->output_buff_size = NULL; - task->data_ptr = gAudioCmdBuffers[index]; + task->data_ptr = (u64 *) gAudioCmdBuffers[index]; task->data_size = writtenCmds * sizeof(u64); task->yield_data_ptr = NULL; task->yield_data_size = 0; @@ -163,17 +163,17 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) { case 0x82: case 0x88: - load_sequence(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3); - func_800CBA64(cmd->u.s.arg1, cmd->u2.as_s32); + load_sequence(cmd->u.s.bankId, cmd->u.s.arg2, cmd->u.s.arg3); + func_800CBA64(cmd->u.s.bankId, cmd->u2.as_s32); break; case 0x83: - if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) { + if (gSequencePlayers[cmd->u.s.bankId].enabled != FALSE) { if (cmd->u2.as_s32 == 0) { - sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]); + sequence_player_disable(&gSequencePlayers[cmd->u.s.bankId]); } else { - seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32); + seq_player_fade_to_zero_volume(cmd->u.s.bankId, cmd->u2.as_s32); } } break; @@ -196,7 +196,7 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) { } break; case 0xF3: - func_800BB388(cmd->u.s.arg1, cmd->u.s.arg2, cmd->u.s.arg3); + func_800BB388(cmd->u.s.bankId, cmd->u.s.arg2, cmd->u.s.arg3); break; } } @@ -226,7 +226,7 @@ void func_800CBA64(s32 playerIndex, s32 fadeInTime) { } } -void func_800CBAB4(void) { +void port_eu_init_queues(void) { D_800EA3A0[0] = 0; D_800EA3A4[0] = 0; osCreateMesgQueue(D_800EA3A8, D_80194020, 1); @@ -247,7 +247,7 @@ void func_800CBB88(u32 arg0, f32 arg1) { } void func_800CBBB8(u32 arg0, u32 arg1) { - func_800CBB48(arg0, &arg1); + func_800CBB48(arg0, (s32 *) &arg1); } void func_800CBBE8(u32 arg0, s8 arg1) { @@ -256,25 +256,20 @@ void func_800CBBE8(u32 arg0, s8 arg1) { } //! @todo clenanup, something's weird with the variables. D_800EA4A4 is probably EuAudioCmd bc of the + 0x100 -void func_800CBC24(void) -{ - s32 temp_t6; - s32 test; - OSMesg thing; - temp_t6 = D_800EA3A0[0] - D_800EA3A4[0]; - test = (u8) temp_t6; - test = (test + 0x100) & 0xFF; - do - { - } - while (0); - if (D_800EA4A4 < test) - { - D_800EA4A4 = test; - } - thing = (OSMesg) ((D_800EA3A0[0] & 0xFF) | ((D_800EA3A4[0] & 0xFF) << 8)); - osSendMesg(D_800EA3AC, thing, 0); - D_800EA3A4[0] = D_800EA3A0[0]; +void func_800CBC24(void){ + s32 temp_t6; + s32 test; + OSMesg thing; + temp_t6 = D_800EA3A0[0] - D_800EA3A4[0]; + test = (u8) temp_t6; + test = (test + 0x100) & 0xFF; + do {} while (0); + if (D_800EA4A4 < test) { + D_800EA4A4 = test; + } + thing = (OSMesg) ((D_800EA3A0[0] & 0xFF) | ((D_800EA3A4[0] & 0xFF) << 8)); + osSendMesg(D_800EA3AC, thing, 0); + D_800EA3A4[0] = D_800EA3A0[0]; } void func_800CBCB0(u32 arg0) { @@ -293,8 +288,8 @@ void func_800CBCB0(u32 arg0) { goto why; } - if (cmd->u.s.arg1 < SEQUENCE_PLAYERS) { - seqPlayer = &gSequencePlayers[cmd->u.s.arg1]; + if (cmd->u.s.bankId < SEQUENCE_PLAYERS) { + seqPlayer = &gSequencePlayers[cmd->u.s.bankId]; if ((cmd->u.s.op & 0x80) != 0) { eu_process_audio_cmd(cmd); } @@ -358,6 +353,6 @@ void func_800CBCB0(u32 arg0) { } } -void func_800CBF48() { - func_800CBAB4(); +void port_eu_init() { + port_eu_init_queues(); } diff --git a/src/audio/port_eu.h b/src/audio/port_eu.h index 039ade730..8972797b8 100644 --- a/src/audio/port_eu.h +++ b/src/audio/port_eu.h @@ -9,14 +9,14 @@ void eu_process_audio_cmd(struct EuAudioCmd*); void seq_player_fade_to_zero_volume(s32 arg0, s32 fadeOutTime); void func_800CBA64(s32 playerIndex, s32 fadeInTime); -void func_800CBAB4(void); +void port_eu_init_queues(void); void func_800CBB48(s32, s32*); void func_800CBB88(u32, f32); void func_800CBBB8(u32, u32); void func_800CBBE8(u32, s8); void func_800CBC24(void); void func_800CBCB0(u32 arg0); -void func_800CBF48(void); +void port_eu_init(void); extern OSMesgQueue D_801937C0; extern OSMesgQueue D_801937D8; diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c index 5deae9765..131c32984 100644 --- a/src/audio/seqplayer.c +++ b/src/audio/seqplayer.c @@ -812,10 +812,10 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { if (cmd > 0xc0) { switch (cmd) { case 0xFF: - if (state->depth); - if(1); - if(1); - if(1); + if(state->depth){}; + if(1){}; + if(1){}; + if(1){}; if (state->depth == 0) { sequence_channel_disable(seqChannel); goto out; @@ -1068,7 +1068,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { case 0xE4: if (value != (-1)) { - if (state->depth); + if (state->depth){}; seqData = (*seqChannel->dynTable)[value]; state->stack[state->depth++] = state->pc; sp38 = (u16) ((seqData[0] << 8) + seqData[1]); @@ -1540,7 +1540,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { } } -void process_sequences(s32 iterationsRemaining) { +void process_sequences(UNUSED s32 iterationsRemaining) { s32 i; for (i = 0; i < SEQUENCE_PLAYERS; i++) { if (gSequencePlayers[i].enabled == TRUE) { diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c index 9eb76b52a..56f3e2a6d 100644 --- a/src/audio/synthesis.c +++ b/src/audio/synthesis.c @@ -4,7 +4,7 @@ #include "audio/heap.h" #include "audio/data.h" #include "audio/load.h" -//#include "audio/seqplayer.h" +#include "audio/seqplayer.h" #include "audio/internal.h" //#include "audio/external.h" #include "PR/abi.h" @@ -162,7 +162,7 @@ Acmd *synthesis_execute(Acmd *acmd, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { synthesis_load_note_subs_eu(gAudioBufferParameters.updatesPerFrame - i); } aSegment(cmd++, 0, 0); - aiBufPtr = aiBuf; + aiBufPtr = (u32 *) aiBuf; for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) { if (i == 1) { chunkLen = bufLen; @@ -698,16 +698,16 @@ Acmd *final_resample(Acmd *acmd, struct NoteSynthesisState *synthesisState, s32 // What's here appears to have the right "shape" based on // the M2C output, but beyond that I can't really tell what's // going on -Acmd *func_800B86A0(Acmd *cmd, struct NoteSubEu *note, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags) { +Acmd *func_800B86A0(Acmd *cmd, struct NoteSubEu *note, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { u16 sourceRight; u16 sourceLeft; u16 targetLeft; u16 targetRight; s32 rampLeft; s32 rampRight; - s32 sourceReverbVol; - s16 rampReverb; - s32 reverbVolDiff = 0; + UNUSED s32 sourceReverbVol; + UNUSED s16 rampReverb; + UNUSED s32 reverbVolDiff = 0; sourceLeft = synthesisState->curVolLeft; sourceRight = synthesisState->curVolRight; diff --git a/src/code_80004740.c b/src/code_80004740.c index 1a71a0016..135461e61 100644 --- a/src/code_80004740.c +++ b/src/code_80004740.c @@ -103,8 +103,8 @@ void func_80004A1C(animation_type_1 *arg0, s16 *arg1, animation_type_3_triplet a } } -void func_80004C30(u32 *arg0, animation_type_2 *arg1, s16 arg2) { - u32 *temp; +void func_80004C30(animation_type_1 *arg0, animation_type_2 *arg1, s16 arg2) { + UNUSED u32 *temp; s16 *sp40; s32 some_offset; animation_type_3_triplet *temp_v0; @@ -126,7 +126,7 @@ void func_80004C30(u32 *arg0, animation_type_2 *arg1, s16 arg2) { temp_v0++; D_80162D78 = 0; do { - new_var = ((animation_type_1 *) arg0)->type; + new_var = arg0->type; switch (new_var) { /* irregular */ case 3: break; @@ -147,7 +147,7 @@ void func_80004C30(u32 *arg0, animation_type_2 *arg1, s16 arg2) { temp_v0++; break; } - arg0 += ((animation_type_1*)arg0)->size; + arg0 = (animation_type_1 *) ((u32 *) arg0 + arg0->size); } while (new_var != 3); } diff --git a/src/code_80004740.h b/src/code_80004740.h index 31ec6707a..efafdd122 100644 --- a/src/code_80004740.h +++ b/src/code_80004740.h @@ -194,7 +194,7 @@ void func_80004740(Mtx *dest, Mat4 src); void mtxf_translate_rotate2(Mat4 dest, Vec3f b, Vec3s c); s16 func_80004EAC(void*, s16); void func_80004A1C(animation_type_1*, s16*, animation_type_3_triplet, s32); -void func_80004C30(u32*, animation_type_2*, s16); +void func_80004C30(animation_type_1*, animation_type_2*, s16); s16 func_80004DFC(animation_type_1*, animation_type_2**, s16, s16); #endif diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index 7befd174d..1d95b441d 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -28,6 +28,7 @@ #include "audio/external.h" #include "ending/podium_ceremony_actors.h" #include "spawn_players.h" +#include "sounds.h" s32 unk_code_80005FD0_pad[24]; Collision D_80162E70; @@ -4659,9 +4660,9 @@ void func_80012AC0(void) { if ((temp_s0 != gTrainList[i].locomotive.waypointIndex) && ((gTrainList[i].locomotive.waypointIndex == 0x00BE) || (gTrainList[i].locomotive.waypointIndex == 0x0140))) { - func_800C98B8(gTrainList[i].locomotive.position, gTrainList[i].locomotive.velocity, 0x1901800E); + func_800C98B8(gTrainList[i].locomotive.position, gTrainList[i].locomotive.velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0E)); } else if (random_int(100) == 0) { - func_800C98B8(gTrainList[i].locomotive.position, gTrainList[i].locomotive.velocity, 0x1901800D); + func_800C98B8(gTrainList[i].locomotive.position, gTrainList[i].locomotive.velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0D)); } gTrainList[i].someFlags = func_800061DC(gTrainList[i].locomotive.position, 2000.0f, gTrainList[i].someFlags); @@ -4877,9 +4878,9 @@ void func_800133C4(void) { } if (random_int(100) == 0) { if (random_int(2) == 0) { - func_800C98B8(ferry->position, ferry->velocity, 0x19018047U); + func_800C98B8(ferry->position, ferry->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x47)); } else { - func_800C98B8(ferry->position, ferry->velocity, 0x19018048U); + func_800C98B8(ferry->position, ferry->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x48)); } } sp94[0] = temp_f26; @@ -5110,7 +5111,7 @@ void func_80013D20(VehicleStuff *vehicle) { vehicleActor->velocity[2] = vehicle->velocity[2]; } -void func_80013F7C(s32 playerId, Player *player, VehicleStuff *vehicle, f32 arg3, f32 arg4, s32 arg5, u32 arg6) { +void func_80013F7C(s32 playerId, Player *player, VehicleStuff *vehicle, f32 arg3, f32 arg4, s32 arg5, u32 soundBits) { f32 temp_f12; f32 temp_f14; f32 temp_f22; @@ -5149,14 +5150,14 @@ void func_80013F7C(s32 playerId, Player *player, VehicleStuff *vehicle, f32 arg3 if ((D_801631C8 > 0) && (vehicle->someFlags == 0)) { D_801631C8 -= 1; vehicle->someFlags |= (1 << playerId); - func_800C9D80(vehicle->position, vehicle->velocity, arg6); + func_800C9D80(vehicle->position, vehicle->velocity, soundBits); } } else { if (vehicle->someFlags != 0) { vehicle->someFlags &= ~(1 << playerId); if (vehicle->someFlags == 0) { D_801631C8 += 1; - func_800C9EF4(vehicle->position, arg6); + func_800C9EF4(vehicle->position, soundBits); } } } @@ -5199,39 +5200,39 @@ void func_80013F7C(s32 playerId, Player *player, VehicleStuff *vehicle, f32 arg3 } if (var_s1 == 1) { - u32 var_a2 = 0x1901703B; + u32 soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3B); - switch (arg6) { - case 0x51018005: - var_a2 = 0x1901703B; + switch (soundBits) { + case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x05): + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3B); if (random_int(4) == 0) { - var_a2 = 0x1901703C; + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3C); } break; - case 0x51018002: + case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x02): if (random_int(2) != 0) { - var_a2 = 0x1901703D; + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3D); } else { - var_a2 = 0x1901703E; + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3E); } break; - case 0x51018003: + case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03): if (random_int(2) != 0) { - var_a2 = 0x1901703F; + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x3F); } else { - var_a2 = 0x19017040; + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x40); } break; - case 0x51018004: + case SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x04): if (random_int(2) != 0) { - var_a2 = 0x19017041; + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x41); } else { - var_a2 = 0x19017042; + soundBits2 = SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x42); } break; } vehicle->someFlagsTheSequel |= ((1 << playerId)); - func_800C98B8(vehicle->position, vehicle->velocity, var_a2); + func_800C98B8(vehicle->position, vehicle->velocity, soundBits2); } } } else { @@ -5324,7 +5325,7 @@ void func_8001487C(void) { } void func_800148C4(s32 playerId, Player *player) { - func_80013F7C(playerId, player, gBoxTruckList, 55.0f, 12.5f, NUM_RACE_BOX_TRUCKS, 0x51018003); + func_80013F7C(playerId, player, gBoxTruckList, 55.0f, 12.5f, NUM_RACE_BOX_TRUCKS, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x03)); } void func_8001490C(s32 playerId) { @@ -5351,7 +5352,7 @@ void func_800149D0(void) { } void func_80014A18(s32 playerId, Player *player) { - func_80013F7C(playerId, player, gSchoolBusList, 70.0f, 12.5f, NUM_RACE_SCHOOL_BUSES, 0x51018002); + func_80013F7C(playerId, player, gSchoolBusList, 70.0f, 12.5f, NUM_RACE_SCHOOL_BUSES, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x02)); } void func_80014A60(s32 playerId) { @@ -5378,7 +5379,7 @@ void func_80014B24(void) { } void func_80014B6C(s32 playerId, Player *player) { - func_80013F7C(playerId, player, gTankerTruckList, 55.0f, 12.5f, NUM_RACE_TANKER_TRUCKS, 0x51018004); + func_80013F7C(playerId, player, gTankerTruckList, 55.0f, 12.5f, NUM_RACE_TANKER_TRUCKS, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x04)); } void func_80014BB4(s32 playerId) { @@ -5405,7 +5406,7 @@ void func_80014C78(void) { } void func_80014CC0(s32 playerId, Player *player) { - func_80013F7C(playerId, player, gCarList, 11.5f, 8.5f, NUM_RACE_CARS, 0x51018005); + func_80013F7C(playerId, player, gCarList, 11.5f, 8.5f, NUM_RACE_CARS, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x05)); } void func_80014D08(s32 playerId) { @@ -7192,14 +7193,14 @@ void func_80019C50(s32 arg0) { case 0: if (D_80164608[arg0] == 1) { D_80164678[arg0] = 1; - func_800C9060(arg0, 0x1900904FU); + func_800C9060(arg0, SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x4F)); D_80164670[arg0] = D_80164678[arg0]; } break; case 1: if (D_80164608[arg0] == 1) { D_80164678[arg0] = 0; - func_800C9060(arg0, 0x19009050U); + func_800C9060(arg0, SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x50)); D_80164670[arg0] = D_80164678[arg0]; } break; @@ -7711,8 +7712,8 @@ void cpu_use_item_strategy(s32 playerId) { banana->velocity[1] = ((waypoint->posY - player->pos[1]) / 20.0) + 4.0; banana->velocity[2] = (waypoint->posZ - player->pos[2]) / 20.0; banana->pos[1] = player->pos[1]; - func_800C92CC(playerId, 0x29008009U); - func_800C98B8(player->pos, player->velocity, 0x19018014U); + func_800C92CC(playerId, SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x09)); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x14)); } else { temp_s0->unk_00 = 0; temp_s0->unk_04 = 0; diff --git a/src/code_80057C60.c b/src/code_80057C60.c index e230f2306..b541813f3 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -32,6 +32,8 @@ #include "menus.h" #include "data/other_textures.h" #include "spawn_players.h" +#include "sounds.h" +#include "code_80071F00.h" //! @warning this macro is undef'd at the end of this file @@ -68,7 +70,7 @@ s32 D_80165618; UNUSED s32 D_80165620[2]; s32 D_80165628; UNUSED s32 D_80165630[2]; -s32 D_80165638; +u32 D_80165638; UNUSED s32 D_80165640[2]; u32 D_80165648; UNUSED u32 D_80165650[2]; @@ -1080,7 +1082,7 @@ void func_80059360(void) { if (D_801657B0 == 0) { func_8004FA78(0); if (playerHUD[PLAYER_ONE].lapCount != 3) { - func_8004CB60(playerHUD[PLAYER_ONE].lapX, playerHUD[PLAYER_ONE].lapY, common_texture_hud_lap); + func_8004CB60(playerHUD[PLAYER_ONE].lapX, playerHUD[PLAYER_ONE].lapY, (u8*) common_texture_hud_lap); func_8004FC78(playerHUD[PLAYER_ONE].lapX + 0xC, playerHUD[PLAYER_ONE].lapY - 4, playerHUD[PLAYER_ONE].alsoLapCount); func_8004E638(0); } @@ -1095,7 +1097,7 @@ void func_800593F8(void) { if (D_801657B0 == 0) { func_8004FA78(1); if (playerHUD[PLAYER_TWO].lapCount != 3) { - func_8004CB60(playerHUD[PLAYER_TWO].lapX, playerHUD[PLAYER_TWO].lapY, common_texture_hud_lap); + func_8004CB60(playerHUD[PLAYER_TWO].lapX, playerHUD[PLAYER_TWO].lapY, (u8*) common_texture_hud_lap); func_8004FC78(playerHUD[PLAYER_TWO].lapX + 0xC, playerHUD[PLAYER_TWO].lapY - 4, playerHUD[PLAYER_TWO].alsoLapCount); func_8004E638(1); } @@ -1133,12 +1135,12 @@ void func_80059530(void) { void func_80059560(s32 playerId) { if (gModeSelection != BATTLE) { if (D_801657F8 && gIsHUDVisible) { - func_8004CB60(playerHUD[playerId].lapX, playerHUD[playerId].lapY, common_texture_hud_lap); + func_8004CB60(playerHUD[playerId].lapX, playerHUD[playerId].lapY, (u8*) common_texture_hud_lap); func_8004FC78(playerHUD[playerId].lapX - 12, playerHUD[playerId].lapY + 4, playerHUD[playerId].alsoLapCount); } if (D_801657E4 == 2) { if (playerHUD[playerId].unk_74 && D_80165608) { - func_80047910(playerHUD[playerId].unk_6C, playerHUD[playerId].unk_6E, 0, 1.0f, common_tlut_portrait_bomb_kart_and_question_mark, common_texture_portrait_bomb_kart, D_0D005AE0, 0x20, 0x20, 0x20, 0x20); + func_80047910(playerHUD[playerId].unk_6C, playerHUD[playerId].unk_6E, 0, 1.0f, (u8*) common_tlut_portrait_bomb_kart_and_question_mark, common_texture_portrait_bomb_kart, D_0D005AE0, 0x20, 0x20, 0x20, 0x20); } } } @@ -2574,11 +2576,11 @@ void func_8005CB60(s32 playerId, s32 lapCount) { playerHUD[playerId].someTimer = playerHUD[playerId].lapCompletionTimes[*huh]; } if (gModeSelection == (s32) 1) { - if ((u32) D_80165638 >= playerHUD[playerId].someTimer1) { + if (D_80165638 >= playerHUD[playerId].someTimer1) { if (D_80165638 != playerHUD[playerId].someTimer1) { D_80165658[0] = D_80165658[1] = 0; } - func_800C90F4(0U, (player->characterId * 0x10) + 0x2900800D); + func_800C90F4(0U, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); D_80165638 = playerHUD[playerId].someTimer1; D_80165658[lapCount-1] = 1; D_801657E3 = 1; @@ -2598,7 +2600,7 @@ void func_8005CB60(s32 playerId, s32 lapCount) { break; case 1: /* switch 1 */ func_80079084(playerId); - func_800C9060(playerId, 0x1900F015U); + func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0xF0, 0x15)); if ((gCurrentCourseId == 8) && (D_80165898 == 0) && (gModeSelection != (s32) 1)) { D_80165898 = 1; } @@ -2894,7 +2896,7 @@ void func_8005DAD8(UnkPlayerStruct258* arg0, s16 arg1, s16 arg2, s16 arg3) { arg0->unk_040 = arg2; } -void func_8005DAF4(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, s8 arg4) { +void func_8005DAF4(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { UNUSED s32 stackPadding; s32 surfaceType; s32 var_t3; @@ -3071,13 +3073,13 @@ void func_8005DAF4(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, s8 arg4) case STONE: case BRIDGE: if ((arg1 == 0) && ((player->unk_258[10 + arg2].unk_01E > 0) || (player->unk_258[10 + arg2].unk_01C == 0))) { - if ((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) && ((((player->unk_0C0 / 182) > 0x14) || ((player->unk_0C0 / 182) < (-0x14)))) || ((player->unk_22C - player->unk_094) >= 0.04)) { + if (((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) && ((((player->unk_0C0 / 182) > 0x14) || ((player->unk_0C0 / 182) < (-0x14))))) || ((player->unk_22C - player->unk_094) >= 0.04)) { func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, (s8) var_t3); func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); func_8005DAD8(&player->unk_258[10 + arg1], 0, 0, 0x0080); player->unk_258[10 + arg1].unk_03A = random_int(0x0010U); } - } else if ((player->unk_258[10 + arg2].unk_01E > 0) && ((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) && (((player->unk_0C0 / 182) >= 0x15) || ((player->unk_0C0 / 182) < -0x14)) || ((player->unk_22C - player->unk_094) >= 0.04))) { + } else if ((player->unk_258[10 + arg2].unk_01E > 0) && (((((player->unk_094 / 18.0f) * 216.0f) >= 30.0f) && (((player->unk_0C0 / 182) >= 0x15) || ((player->unk_0C0 / 182) < -0x14))) || ((player->unk_22C - player->unk_094) >= 0.04))) { func_8005D794(player, &player->unk_258[10 + arg1], var_f2, var_f12, var_f14, (s8) surfaceType, (s8) var_t3); func_8005D7D8(&player->unk_258[10 + arg1], 2, 0.46f); func_8005DAD8(&player->unk_258[10 + arg1], 0, 0, 0x0080); @@ -3089,7 +3091,7 @@ void func_8005DAF4(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, s8 arg4) } } -void func_8005EA94(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { +void func_8005EA94(Player *player, s16 arg1, s32 arg2, s8 arg3, UNUSED s8 arg4) { s32 temp_v0; s32 var_t0; s32 var_t1; @@ -3134,7 +3136,7 @@ void func_8005EA94(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { } } -void func_8005ED48(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, s8 arg4) { +void func_8005ED48(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { s32 temp_v0; s32 surfaceType; s32 var_t3; @@ -3316,7 +3318,7 @@ void func_8005ED48(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, s8 arg4) // Permuter hasn't found anything // https://decomp.me/scratch/WjMqd -void func_8005F90C(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, s8 arg4) { +void func_8005F90C(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { s32 var_t1; u8 surfaceType; f32 var_f0; @@ -3491,7 +3493,7 @@ void func_8005F90C(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, s8 arg4) GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005F90C.s") #endif -void func_80060504(Player *player, s16 arg1, s32 arg2, s32 arg3) { +void func_80060504(Player *player, s16 arg1, s32 arg2, UNUSED s32 arg3) { UNUSED s32 thing1; s16 thing2; UNUSED s32 thing3; @@ -3596,7 +3598,7 @@ void func_80060B14(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { } } -void func_80060BCC(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, s8 arg4) { +void func_80060BCC(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3, UNUSED s8 arg4) { s32 sp54; UNUSED s32 pad; s32 sp4C; @@ -3818,7 +3820,7 @@ void func_80061A34(Player *player, s16 arg1, s32 arg2, UNUSED s8 arg3) { void func_80061D4C(Player *player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3) { s32 test = 2; - s32 stackPadding0; + UNUSED s32 stackPadding0; UNUSED s32 stackPadding1; UNUSED s32 stackPadding2; f32 sp20[10] = { -182.0f, 182.0f, 364.0f, -364.0f, 546.0f, -546.0f, 728.0f, -728.0f, 910.0f, -910.0f }; @@ -4138,7 +4140,7 @@ void func_80062B18(f32 *arg0, f32 *arg1, f32 *arg2, f32 arg3, f32 arg4, f32 arg5 *arg2 = (coss(arg6) * arg5) + (((arg3 * temp_f20) * sp30) + ((arg4 * sp2C) * sp28)); } -void func_80062C74(Player *player, s16 arg1, UNUSED s32 arg2, s32 arg3) { +void func_80062C74(Player *player, s16 arg1, UNUSED s32 arg2, UNUSED s32 arg3) { f32 sp48[8] = { 4.5f, 4.5f, 4.5f, 4.5f, 4.5f, 5.5f, 4.5f, 6.5f }; f32 var_f6; f32 sp40; @@ -4967,7 +4969,7 @@ void func_80065F0C(Player *player, UNUSED s8 arg1, s16 arg2, s8 arg3) { spD4[0] = 0; spD4[1] = player->unk_048[arg3]; spD4[2] = 0; - func_800652D4(&spDC, &spD4, player->unk_258[10 + arg2].unk_00C * player->size); + func_800652D4(spDC, spD4, player->unk_258[10 + arg2].unk_00C * player->size); if ((s32)player->unk_258[10 + arg2].unk_014 != 8) { primRed = ((D_800E47DC[player->unk_258[10 + arg2].unk_038] >> 0x10) & 0xFF) - player->unk_258[10 + arg2].unk_03A; primGreen = ((D_800E47DC[player->unk_258[10 + arg2].unk_038] >> 0x08) & 0xFF) - player->unk_258[10 + arg2].unk_03A; @@ -5816,7 +5818,7 @@ void func_8006B8B4(Player *player, s8 playerIndex) { gPlayerBalloonStatus[playerIndex][gPlayerBalloonCount[playerIndex]] &= ~1; gPlayerBalloonStatus[playerIndex][gPlayerBalloonCount[playerIndex]] |= 2; gPlayerBalloonCount[playerIndex]--; - func_800C9060(playerIndex, 0x19009051U); + func_800C9060(playerIndex, SOUND_ARG_LOAD(0x19, 0x00, 0x90, 0x51)); if (gPlayerBalloonCount[playerIndex] < 0) { func_8008FD4C(player, playerIndex); } @@ -5888,8 +5890,8 @@ void render_balloon(Vec3f arg0, f32 arg1, s16 arg2, s16 arg3) { spF4[0] = 0; spF4[1] = camera1->rot[1]; spF4[2] = arg2; - mtxf_translate_rotate(sp108[0], spFC, spF4); - mtxf_scale2(sp108[0], arg1); + mtxf_translate_rotate(sp108, spFC, spF4); + mtxf_scale2(sp108, arg1); convert_to_fixed_point_matrix(&gGfxPool->mtxEffect[gMatrixEffectCount], sp108); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, D_0D008DB8); diff --git a/src/code_80057C60.h b/src/code_80057C60.h index ffff27443..ef721ec85 100644 --- a/src/code_80057C60.h +++ b/src/code_80057C60.h @@ -243,6 +243,8 @@ void func_8006E7CC(Player*, s8, s8); void func_8006E848(Player*, s8, s8); void func_8006E8C4(Player*, s8, s8); void func_8006E940(Player*, s8, s8); +void func_80075CA8(void); +void func_80085214(); // data/data_code_80071F00_2.s @@ -293,7 +295,7 @@ extern s32 D_801655F8; extern s32 D_80165608; extern s32 D_80165618; extern s32 D_80165628; -extern s32 D_80165638; +extern u32 D_80165638; extern u32 D_80165648; extern u32 D_80165658[]; extern s32 D_80165678; diff --git a/src/code_80071F00.c b/src/code_80071F00.c index c33eb24ba..709463b96 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -1803,7 +1803,7 @@ void func_8007601C(s32 objectIndex) { if (gObjectList[objectIndex].unk_048 > 0) { gObjectList[objectIndex].unk_048--; if (gObjectList[objectIndex].unk_048 == 0) { - func_800C9EF4(gObjectList[objectIndex].pos, 0x5102800A); + func_800C9EF4(gObjectList[objectIndex].pos, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x0A)); } } @@ -1812,7 +1812,7 @@ void func_8007601C(s32 objectIndex) { if ((is_obj_index_flag_unk_054_active(objectIndex, 0x40000) != 0) && (func_80072354(objectIndex, 1) != 0)) { func_800722A4(objectIndex, 1); func_80075F98(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle[1], 1.0f); - func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x5102800A); + func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x0A)); if (gObjectList[objectIndex].type > 0) { gObjectList[objectIndex].type--; gObjectList[objectIndex].unk_04C = 0x5A; @@ -1963,7 +1963,7 @@ void func_8007661C(void) { if (gObjectList[objectIndex].unk_048 > 0) { gObjectList[objectIndex].unk_048--; if (gObjectList[objectIndex].unk_048 == 0) { - func_800C9EF4(gObjectList[objectIndex].pos, 0x51038009U); + func_800C9EF4(gObjectList[objectIndex].pos, SOUND_ARG_LOAD(0x51, 0x03, 0x80, 0x09)); } } if (gObjectList[objectIndex].unk_04C == 0) { @@ -2968,7 +2968,7 @@ void func_800791F0(s32 objectIndex, s32 playerId) { func_800722CC(objectIndex, 0x00000010); temp_v1->unk_0CA &= 0xFFDF; } - func_800C9018(playerId, 0x0100FA28); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); } void init_obj_laikitu_red_flag_countdown(s32 objectIndex, s32 arg1) { @@ -3223,7 +3223,7 @@ void update_obj_laikitu_fishing(s32 objectIndex, s32 playerId) { break; case 5: func_800722CC(objectIndex, 1); - func_800C9018((u8) playerId, 0x0100FA28); + func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); func_80072428(objectIndex); func_80073720(objectIndex); break; @@ -3303,7 +3303,7 @@ void update_obj_laikitu_fishing2(s32 objectIndex, s32 playerId) { func_80072428(objectIndex); temp_s1->unk_0CA &= 0xFFDF; func_800722CC(objectIndex, 1); - func_800C9018((u8) playerId, 0x0100FA28); + func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); break; } @@ -3453,7 +3453,7 @@ void update_obj_laikitu_reverse(s32 objectIndex, s32 playerId) { func_80086F10(objectIndex, 6, D_800E69F4); gObjectList[objectIndex].unk_0D6 = 2; gObjectList[objectIndex].unk_04C = 0x00000050; - func_800C9018((u8) playerId, 0x0100FA28); + func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); return; } return; @@ -3845,8 +3845,8 @@ void func_8007B34C(s32 playerId) { temp_t0->unk_04C = 8; temp_t0->unk_0D6 = 2; func_80072488(temp_s0); - func_800C9018((u8) playerId, 0x0100FE1C); - func_800C8F80((u8) playerId, 0x0100FE47U); + func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFE, 0x1C)); + func_800C8F80((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFE, 0x47)); break; case 7: func_80072D3C(temp_s0, (s32) temp_t0->unk_0A2, 0, 8, 0x0000000A); @@ -4339,7 +4339,7 @@ void func_8007C7B4(s32 someIndex, s32 arg1) { temp_s5 = random_int(0x0050U) - 0x28; random_int(0x1000U); something = D_800E5D9C[temp_a0]; - gObjectList[objectIndex].unk_080 = something; + gObjectList[objectIndex].unk_080 = (Vec4s *) something; gObjectList[objectIndex].origin_pos[0] = (f32) temp_s1_2; gObjectList[objectIndex].origin_pos[1] = (f32) temp_s4; gObjectList[objectIndex].origin_pos[2] = (f32) temp_s5; @@ -4535,8 +4535,8 @@ void func_8007CEDC(s32 objectIndex) { } void func_8007D070(void) { - s32 stackPadding; - s32 stackPadding2; + UNUSED s32 stackPadding; + UNUSED s32 stackPadding2; u16 temp_s3; s16 temp_t5; s16 temp_s2; @@ -4562,7 +4562,7 @@ void func_8007D070(void) { gObjectList[objectIndex].origin_pos[0] = D_8018CF1C->pos[0] + (sins(temp_t2) * temp_s2); gObjectList[objectIndex].origin_pos[1] = temp_t5; gObjectList[objectIndex].origin_pos[2] = D_8018CF1C->pos[2] + (coss(temp_t2) * temp_s2); - gObjectList[objectIndex].unk_080 = D_800E5D54; + gObjectList[objectIndex].unk_080 = (Vec4s *) D_800E5D54; } } } @@ -4805,7 +4805,7 @@ void func_8007DDC0(s32 objectIndex) { if (temp_s0->unk_048 > 0) { temp_s0->unk_048--; if (temp_s0->unk_048 == 0) { - func_800C9EF4(temp_s0->pos, 0x51028006U); + func_800C9EF4(temp_s0->pos, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x06)); } } if (temp_s0->unk_04C == 0) { @@ -4815,7 +4815,7 @@ void func_8007DDC0(s32 objectIndex) { func_8008A6DC(objectIndex, sp2C); if ((is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) && (func_80072354(objectIndex, 1) != 0)) { func_800722A4(objectIndex, 1); - func_800C9D80(temp_s0->pos, temp_s0->velocity, 0x51028006U); + func_800C9D80(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x06)); func_800726CC(objectIndex, 3); if (temp_s0->type > 0) { temp_s0->type--; @@ -4876,7 +4876,7 @@ void func_8007E00C(s32 objectIndex) { func_80073CB0(objectIndex, &gObjectList[objectIndex].unk_0A0, -0x00002000, 0, 0x00000400, 0, -1); gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].unk_0A0; if (gObjectList[objectIndex].unk_084[7] == 0) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x1901904EU); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x4E)); gObjectList[objectIndex].unk_084[7] = 0x0014; } else { gObjectList[objectIndex].unk_084[7]--; @@ -4923,7 +4923,7 @@ void func_8007E1F4(s32 objectIndex) { if (temp_s0->unk_048 > 0) { temp_s0->unk_048--; if (temp_s0->unk_048 == 0) { - func_800C9EF4(temp_s0->pos, 0x51028006U); + func_800C9EF4(temp_s0->pos, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x06)); } } if (temp_s0->unk_04C == 0) { @@ -4933,7 +4933,7 @@ void func_8007E1F4(s32 objectIndex) { func_8008A6DC(objectIndex, sp2C); if ((is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) && (func_80072354(objectIndex, 1) != 0)) { func_800722A4(objectIndex, 1); - func_800C9D80(temp_s0->pos, temp_s0->velocity, 0x51028006U); + func_800C9D80(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x06)); func_800726CC(objectIndex, 3); if (temp_s0->type > 0) { temp_s0->type--; @@ -5112,7 +5112,7 @@ void func_8007E63C(s32 objectIndex) { func_800722A4(objectIndex, 0x00000020); } } - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x19018045U); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45)); func_80072488(objectIndex); } break; @@ -5177,7 +5177,7 @@ void func_8007EC30(s32 objectIndex) { set_obj_direction_angle(objectIndex, 0U, 0xC000U, 0U); set_obj_orientation(objectIndex, 0U, 0xC000U, 0U); } - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); temp_s1->model = d_course_bowsers_castle_dl_thwomp; temp_s1->boundingBoxSize = 0x000C; temp_s1->sizeScaling = 1.0f; @@ -5190,7 +5190,7 @@ void func_8007EC30(s32 objectIndex) { } void func_8007ED6C(s32 objectIndex) { - s32 stackPadding[4]; + UNUSED s32 stackPadding[4]; switch (gObjectList[objectIndex].state) { case 0: break; @@ -5220,7 +5220,7 @@ void func_8007ED6C(s32 objectIndex) { void func_8007EE5C(s32 objectIndex) { Objects *temp_s0; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); temp_s0 = &gObjectList[objectIndex]; temp_s0->sizeScaling = 1.0f; temp_s0->model = d_course_bowsers_castle_dl_thwomp; @@ -5519,7 +5519,7 @@ void func_8007F8D8(void) { void func_8007FA08(s32 objectIndex) { Objects *temp_s0; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); temp_s0 = &gObjectList[objectIndex]; temp_s0->model = d_course_bowsers_castle_dl_thwomp; temp_s0->boundingBoxSize = 0x000C; @@ -5546,7 +5546,7 @@ void func_8007FA08(s32 objectIndex) { void func_8007FB48(s32 objectIndex) { s32 var_v0; - s32 stackPadding; + UNUSED s32 stackPadding; Player *player; player = &gPlayerOne[gObjectList[objectIndex].unk_0D1]; @@ -5679,7 +5679,7 @@ void func_8007FFC0(s32 objectIndex) { void func_80080078(s32 objectIndex) { Objects *temp_s0; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); temp_s0 = &gObjectList[objectIndex]; temp_s0->model = d_course_bowsers_castle_dl_thwomp; temp_s0->boundingBoxSize = 0x000C; @@ -5746,7 +5746,7 @@ void func_800802C0(s32 objectIndex) { temp_s0 = &gObjectList[objectIndex]; temp_s0->unk_0D8 = 0; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); temp_s0->model = d_course_bowsers_castle_dl_thwomp; temp_s0->itemDisplay = 0; temp_s0->boundingBoxSize = 0x000C; @@ -5781,7 +5781,7 @@ void func_80080408(s32 objectIndex) { case 2: func_8008A6DC(objectIndex, 100.0f); if (is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x19018045U); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45)); func_80072488(objectIndex); } break; @@ -5803,7 +5803,7 @@ void func_80080408(s32 objectIndex) { void func_80080524(s32 objectIndex) { Objects *temp_s0; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); temp_s0 = &gObjectList[objectIndex]; temp_s0->model = d_course_bowsers_castle_dl_thwomp; temp_s0->boundingBoxSize = 0x000C; @@ -5904,10 +5904,10 @@ void func_800808CC(s32 objectIndex) { func_80073514(objectIndex); if (gGamestate != 9) { if ((D_8018D40C == 0) && (gObjectList[objectIndex].state == 2)) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x19036045U); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x03, 0x60, 0x45)); } } else if ((gCutsceneShotTimer < 0xBF) && (((s16) gCutsceneShotTimer % 88) == 0x0000001E)) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x19036045U); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x03, 0x60, 0x45)); } } } @@ -5923,9 +5923,9 @@ void func_80080A4C(s32 objectIndex, s32 cameraPlayerId) { Player *player = &gPlayerOne[cameraPlayerId]; if (gScreenModeSelection != SCREEN_MODE_3P_4P_SPLITSCREEN) { - if ((func_80072320(objectIndex, 0x00000010) != 0) && (is_within_horizontal_distance_of_player(objectIndex, player, 500.0f) != 0)) { + if ((func_80072320(objectIndex, 0x00000010) != 0) && (is_within_horizontal_distance_of_player(objectIndex, player, 500.0f) != FALSE)) { func_8001CA10(camera); - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x1900800FU); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x0F)); } } } @@ -5941,12 +5941,12 @@ void func_80080B28(s32 objectIndex, s32 playerId) { if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) && (has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) { if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) { if (!(temp_s0->effects & 0x200)) { - func_80089474(objectIndex, playerId, 1.4f, 1.1f, 0x1900A04CU); + func_80089474(objectIndex, playerId, 1.4f, 1.1f, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C)); } else if (func_80072354(objectIndex, 0x00000040) != 0) { if (temp_s0->type & 0x1000) { - func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x1901A24AU); + func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); } else { - func_800C9060((u8) playerId, 0x1901A24AU); + func_800C9060((u8) playerId, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); } func_80080DE4(objectIndex); func_80075304(gObjectList[objectIndex].pos, 3, 3, D_8018D3C4); @@ -6143,7 +6143,7 @@ void func_80081210(void) { } void func_8008153C(s32 objectIndex) { - s32 stackPadding[3]; + UNUSED s32 stackPadding[3]; s32 sp70; s32 var_s1; s32 var_s7; @@ -6196,7 +6196,7 @@ void func_80081790(s32 objectIndex) { } void func_80081848(s32 objectIndex) { - init_texture_object(objectIndex, d_course_moo_moo_farm_mole_tlut, d_course_moo_moo_farm_mole_frames, 0x20U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_moo_moo_farm_mole_tlut, (u8*) d_course_moo_moo_farm_mole_frames, 0x20U, (u16) 0x00000040); gObjectList[objectIndex].sizeScaling = 0.15f; gObjectList[objectIndex].itemDisplay = 0; func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f); @@ -6281,7 +6281,7 @@ void func_80081AFC(s32 objectIndex, s32 arg1) { func_80086EAC(objectIndex, 2, 4); func_8008153C(objectIndex); func_80072488(objectIndex); - func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x19018007U); + func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x07)); } break; case 0x4: @@ -6380,8 +6380,8 @@ void func_80081D34(s32 objectIndex) { * So there' something kind of fucky happening **/ void func_80081FF4(s32 objectIndex, s32 arg1) { - s32 stackPadding0; - s32 stackPadding1; + UNUSED s32 stackPadding0; + UNUSED s32 stackPadding1; s32 moleCount; s16 var_v1; s16 offset; @@ -6441,7 +6441,7 @@ void func_800821AC(s32 objectIndex, s32 arg1) { void func_800821FC(void) { s32 var_s1; s32 objectIndex; - s32 stackPadding; + UNUSED s32 stackPadding; for (var_s1 = 0; var_s1 < D_8018D1C8; var_s1++) { objectIndex = indexObjectList1[var_s1]; @@ -6485,7 +6485,7 @@ void func_800821FC(void) { } void func_8008241C(s32 objectIndex, s32 arg1) { - s16 stackPadding0; + UNUSED s16 stackPadding0; s16 temp_f4; s16 sp22; s16 sp20; @@ -6508,7 +6508,7 @@ void func_8008241C(s32 objectIndex, s32 arg1) { set_obj_direction_angle(objectIndex, 0U, 0U, 0U); gObjectList[objectIndex].unk_034 = 1.0f; func_80086EF0(objectIndex); - gObjectList[objectIndex].unk_080 = D_800E633C[arg1 % 4]; + gObjectList[objectIndex].unk_080 = (Vec4s *) D_800E633C[arg1 % 4]; set_object_flag_unk_054_true(objectIndex, 0x00000800); func_80072488(objectIndex); } @@ -6525,7 +6525,7 @@ void func_80082714(s32 objectIndex, s32 arg1) { } void func_8008275C(s32 objectIndex) { - s32 stackPadding; + UNUSED s32 stackPadding; switch (gObjectList[objectIndex].unk_0DD) { /* irregular */ case 1: func_8008B78C(objectIndex); @@ -6534,7 +6534,7 @@ void func_8008275C(s32 objectIndex) { case 2: func_8008B78C(objectIndex); vec3f_copy(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos); - func_8000D940(gObjectList[objectIndex].origin_pos, &gObjectList[objectIndex].unk_0C6, gObjectList[objectIndex].unk_034, 0.0f, 0); + func_8000D940(gObjectList[objectIndex].origin_pos, (s16 *) &gObjectList[objectIndex].unk_0C6, gObjectList[objectIndex].unk_034, 0.0f, 0); gObjectList[objectIndex].unk_028[0] *= 2.0; gObjectList[objectIndex].unk_028[1] *= 2.5; gObjectList[objectIndex].unk_028[2] *= 2.0; @@ -6547,7 +6547,7 @@ void func_8008275C(s32 objectIndex) { void func_80082870(void) { Objects *temp_s1; - s32 *var_s4; + UNUSED s32 *var_s4; s32 temp_s0; s32 var_s3; @@ -6567,12 +6567,12 @@ void func_80082870(void) { D_80183E40[1] = 0.0f; D_80183E40[2] = 0.0f; if (gGamestate != 9) { - func_800C98B8(temp_s1->pos, D_80183E40, 0x19017043U); + func_800C98B8(temp_s1->pos, D_80183E40, SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x43)); } else { temp_s0 = indexObjectList2[1]; if (gCutsceneShotTimer < 0x97) { temp_s1 = &gObjectList[temp_s0]; - func_800C98B8(temp_s1->pos, D_80183E40, 0x19017043U); + func_800C98B8(temp_s1->pos, D_80183E40, SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x43)); } } } @@ -6596,7 +6596,7 @@ void func_80082870(void) { void init_ktb_crab(s32 objectIndex) { Objects *object; - init_texture_object(objectIndex, d_course_koopa_troopa_beach_crab_tlut, d_course_koopa_troopa_beach_crab_frames, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_koopa_troopa_beach_crab_tlut, (u8*) d_course_koopa_troopa_beach_crab_frames, 0x40U, (u16) 0x00000040); object = &gObjectList[objectIndex]; object->sizeScaling = 0.15f; object->itemDisplay = 0; @@ -6610,7 +6610,7 @@ void init_ktb_crab(s32 objectIndex) { set_object_flag_unk_054_true(objectIndex, 0x00000200); } -void func_80082B34(s32 objectIndex, s32 unused) { +void func_80082B34(s32 objectIndex, UNUSED s32 unused) { switch (gObjectList[objectIndex].state) { /* irregular */ case 0: break; @@ -6695,8 +6695,8 @@ void func_80082E5C(void) { // https://decomp.me/scratch/RquH0 // Gollygee I sure love register allocation :^) void func_80082F1C(s32 objectIndex, s32 arg1) { - gObjectList[objectIndex].model = d_course_yoshi_valley_unk5; - gObjectList[objectIndex].vertex = d_course_yoshi_valley_unk4; + gObjectList[objectIndex].model = (Gfx *) d_course_yoshi_valley_unk5; + gObjectList[objectIndex].vertex = (Vtx *) d_course_yoshi_valley_unk4; gObjectList[objectIndex].sizeScaling = 0.027f; func_80072488(objectIndex); set_obj_origin_pos(objectIndex, D_800E5DF4[arg1].pos[0] * xOrientation, D_800E5DF4[arg1].pos[1], D_800E5DF4[arg1].pos[2]); @@ -7074,7 +7074,7 @@ void func_80083FD0(s32 objectIndex, s32 arg1, s32 playerId) { temp_s0->origin_pos[2] = (sp20->pos[2] + random_int(0x0014U)) - 10.0f; } -void func_8008421C(s32 arg0, s32 playerId) { +void func_8008421C(UNUSED s32 arg0, s32 playerId) { s32 objectIndex; s32 var_s0; @@ -7115,7 +7115,7 @@ void func_800842C8(void) { } } -void func_80084430(s32 objectIndex, s32 arg1) { +void func_80084430(s32 objectIndex, UNUSED s32 arg1) { Objects *temp_s0; temp_s0 = &gObjectList[objectIndex]; @@ -7129,7 +7129,7 @@ void func_80084430(s32 objectIndex, s32 arg1) { set_obj_direction_angle(objectIndex, 0U, 0U, 0U); temp_s0->unk_0DD = 1; func_80086EF0(objectIndex); - temp_s0->unk_080 = *D_800E672C; + temp_s0->unk_080 = (Vec4s *) *D_800E672C; set_object_flag_unk_054_true(objectIndex, 0x04000800); temp_s0->type = func_80004EAC(d_course_sherbet_land_unk_data11, 0); func_80072488(objectIndex); @@ -7155,8 +7155,8 @@ void func_800845C8(s32 objectIndex, s32 arg1) { temp_s0 = &gObjectList[objectIndex]; temp_s0->unk_0D8 = 0; - temp_s0->model = d_course_sherbet_land_unk_data1; - temp_s0->vertex = d_course_sherbet_land_unk_data11; + temp_s0->model = (Gfx *) d_course_sherbet_land_unk_data1; + temp_s0->vertex = (Vtx *) d_course_sherbet_land_unk_data11; temp_s0->boundingBoxSize = 4; temp_s0->unk_09C = 2; temp_s0->unk_04C = random_int(0x012CU); @@ -7293,9 +7293,9 @@ void func_80084B7C(s32 objectIndex, s32 arg1) { if (func_80072320(objectIndex, 0x00000080) != 0) { func_800722CC(objectIndex, 0x00000080); if (func_80072320(objectIndex, 0x00000010) != 0) { - func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x19007049U); + func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x49)); } else { - func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x19007017U); + func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x17)); } } } @@ -7444,7 +7444,7 @@ void func_800850B0(s32 objectIndex, s32 arg1) { } void func_80085214(void) { - s32 var_s2; + UNUSED s32 var_s2; s32 objectIndex; s32 var_s1; @@ -7574,8 +7574,8 @@ void func_80085878(s32 objectIndex, s32 arg1) { temp_s0 = &gObjectList[objectIndex]; temp_s0->unk_0D8 = 1; - temp_s0->model = d_rainbow_road_unk4; - temp_s0->vertex = d_rainbow_road_unk3; + temp_s0->model = (Gfx *) d_rainbow_road_unk4; + temp_s0->vertex = (Vtx *) d_rainbow_road_unk3; temp_s0->sizeScaling = 0.03f; temp_s0->boundingBoxSize = 0x000A; set_object_flag_unk_054_true(objectIndex, 0x04000200); @@ -7604,7 +7604,7 @@ void func_800859C8(s32 objectIndex, s32 arg1) { break; } if (D_8018D40C == 0) { - func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x19018057U); + func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x57)); } func_80074344(objectIndex, &temp_s0->unk_044, -0.8f, 0.8f, 0.03f, 0, -1); } @@ -7637,7 +7637,7 @@ void func_80085BB4(s32 objectIndex) { void init_obj_neon_mushroom(s32 objectIndex) { set_obj_origin_pos(objectIndex, xOrientation * -1431.0, 827.0f, -2957.0f); - init_texture_object(objectIndex, d_course_rainbow_road_neon_mushroom_tlut_list, d_course_rainbow_road_neon_mushroom, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8*) d_course_rainbow_road_neon_mushroom_tlut_list, d_course_rainbow_road_neon_mushroom, 0x40U, (u16) 0x00000040); func_80085BB4(objectIndex); } @@ -7675,7 +7675,7 @@ void func_80085CA0(s32 objectIndex) { void func_80085DB8(s32 objectIndex) { set_obj_origin_pos(objectIndex, xOrientation * 799.0, 1193.0f, -5891.0f); - init_texture_object(objectIndex, d_course_rainbow_road_neon_mario_tlut_list, d_course_rainbow_road_neon_mario, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8*) d_course_rainbow_road_neon_mario_tlut_list, d_course_rainbow_road_neon_mario, 0x40U, (u16) 0x00000040); func_80085BB4(objectIndex); } @@ -7704,7 +7704,7 @@ void func_80085E38(s32 objectIndex) { void func_80085EF8(s32 objectIndex) { set_obj_origin_pos(objectIndex, xOrientation * -2013.0, 555.0f, 0.0f); - init_texture_object(objectIndex, d_course_rainbow_road_neon_boo_tlut_list, d_course_rainbow_road_neon_boo, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8*) d_course_rainbow_road_neon_boo_tlut_list, d_course_rainbow_road_neon_boo, 0x40U, (u16) 0x00000040); func_80085BB4(objectIndex); } diff --git a/src/code_80071F00.h b/src/code_80071F00.h index 4ef65fec5..c48a3f09a 100644 --- a/src/code_80071F00.h +++ b/src/code_80071F00.h @@ -130,6 +130,7 @@ void func_80075574(s32, Vec3f, f32); s32 func_800755FC(s32, Vec3f, f32); void func_80075698(s32); void func_80075714(s32); +void func_80075838(void); void func_800759EC(s32, Vec3f, f32); s32 func_80075A6C(s32, Vec3f, f32); void func_80075B08(s32); diff --git a/src/code_80086E70.c b/src/code_80086E70.c index 38a583b84..724fb7234 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -31,10 +31,10 @@ void func_80086EF0(s32 objectIndex) { func_80086E70(objectIndex); } -void func_80086F10(s32 objectIndex, s32 arg1, u16 arg2[][4]) { +void func_80086F10(s32 objectIndex, s32 arg1, Vec4s arg2[]) { func_80086E70(objectIndex); gObjectList[objectIndex].unk_0DE = arg1; - gObjectList[objectIndex].unk_080 = (u16 *) arg2; + gObjectList[objectIndex].unk_080 = arg2; } void func_80086F60(s32 objectIndex) { @@ -1031,8 +1031,8 @@ f32 func_8008933C(Player *player, s32 objectIndex, f32 arg2, f32 arg3) { return var_f2; } -void func_80089474(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 arg4) { - s32 stackPadding; +void func_80089474(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 soundBits) { + UNUSED s32 stackPadding; Player *player; player = &gPlayerOne[playerId]; @@ -1040,17 +1040,17 @@ void func_80089474(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 arg4) func_80072180(); } if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && ((player->type & PLAYER_CPU) != PLAYER_CPU)) { - func_800C9060(playerId, arg4); + func_800C9060(playerId, soundBits); } } -void func_80089538(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 arg4) { - s32 stackPadding; +void func_80089538(s32 objectIndex, s32 playerId, f32 arg2, f32 arg3, u32 soundBits) { + UNUSED s32 stackPadding; Player *player; player = &gPlayerOne[playerId]; if ((func_8008933C(player, objectIndex, arg2, arg3) >= 4.0) && ((player->type & PLAYER_CPU) != PLAYER_CPU)) { - func_800C9060((u8) playerId, arg4); + func_800C9060((u8) playerId, soundBits); } } @@ -1444,7 +1444,7 @@ void func_8008A920(s32 objectIndex) { } void func_8008A9B8(s32 objectIndex) { - s32 temp_t9; + UNUSED s32 temp_t9; Objects *temp_v0; temp_v0 = &gObjectList[objectIndex]; @@ -1474,7 +1474,7 @@ void func_8008AA3C(s32 objectIndex) { } void func_8008AB10(s32 objectIndex) { - s16 temp_t3; + UNUSED s16 temp_t3; Objects *temp_v0; temp_v0 = &gObjectList[objectIndex]; @@ -1668,7 +1668,7 @@ void func_8008B284(s32 objectIndex) { D_80165780[someIndex] = (*test)[2]; if (sp0 == someIndex) { // Huh???????? This makes no sense - test = &gObjectList[objectIndex].unk_080[0][1]; + test = (Vec4s *) &gObjectList[objectIndex].unk_080[0][1]; } else { test++; } @@ -1676,14 +1676,14 @@ void func_8008B284(s32 objectIndex) { } void func_8008B3E4(s32 objectIndex) { - Vec4s *test; + UNUSED Vec4s *test; Objects *temp_v0; if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != 0) { temp_v0 = &gObjectList[objectIndex]; temp_v0->unk_084[9] = 0; temp_v0->timer = 0; - temp_v0->unk_07C = &gObjectList[objectIndex].unk_080[0][1]; + temp_v0->unk_07C = (Vec4s *) &gObjectList[objectIndex].unk_080[0][1]; // Huh????????? Negative array indexing is a near certain sign // that something has gone wrong on our end. temp_v0->unk_084[8] = temp_v0->unk_07C[0][-1]; @@ -1699,7 +1699,7 @@ void func_8008B44C(s32 objectIndex) { void func_8008B478(s32 objectIndex, s32 arg1) { f32 sp34; f32 temp; - f32 temp2; + UNUSED f32 temp2; f32 var_f6; func_8008B3E4(objectIndex); @@ -1723,7 +1723,7 @@ void func_8008B478(s32 objectIndex, s32 arg1) { } void func_8008B620(s32 objectIndex) { - s16 temp_t0; + UNUSED s16 temp_t0; Objects *temp_v0; func_8008B478(objectIndex, 0); diff --git a/src/code_80086E70.h b/src/code_80086E70.h index 586d8c310..558f33f0f 100644 --- a/src/code_80086E70.h +++ b/src/code_80086E70.h @@ -7,7 +7,7 @@ void func_80086E70(s32); void func_80086EAC(s32, s32, s16); void func_80086EF0(s32); -void func_80086F10(s32, s32, u16[][4]); +void func_80086F10(s32, s32, Vec4s[]); void func_80086F60(s32); s32 func_80086FA4(s32); void func_80086FD4(s32); diff --git a/src/code_8008C1D0.c b/src/code_8008C1D0.c index 3e4d922cb..fd6c0ec4d 100644 --- a/src/code_8008C1D0.c +++ b/src/code_8008C1D0.c @@ -16,6 +16,7 @@ #include "effects.h" #include "audio/external.h" #include "spawn_players.h" +#include "code_80091750.h" s32 D_8018D900[8]; s16 D_8018D920[8]; @@ -231,15 +232,15 @@ void clean_effect(Player *player, s8 arg1) { void func_8008C528(Player *player, s8 arg1) { UNUSED s32 sp24; - s32 temp_v1; + s32 characterId; clean_effect(player, arg1); func_8008C310(player); - temp_v1 = player->characterId; + characterId = player->characterId; player->unk_0C2 = 0; - player->kartHopJerk = D_800E37B0[temp_v1]; + player->kartHopJerk = D_800E37B0[characterId]; player->kartHopAcceleration = 0.0f; - player->kartHopVelocity = D_800E3790[temp_v1]; + player->kartHopVelocity = D_800E3790[characterId]; player->unk_0A8 = 0; player->effects = player->effects | 0x400; player->effects = player->effects & ~0x10; @@ -247,7 +248,7 @@ void func_8008C528(Player *player, s8 arg1) { player->unk_236 = 2; player->unk_042 = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (temp_v1 * 0x10) + 0x29008005); + func_800C90F4(arg1, (characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05)); func_800C9060(arg1, SOUND_ACTION_EXPLOSION); } else { func_800098FC(arg1, player); @@ -316,7 +317,7 @@ void func_8008C73C(Player *player, s8 arg1) { D_8018D920[arg1] = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); + func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x03)); } else { func_800098FC(arg1, player); } @@ -394,7 +395,7 @@ void func_8008C9EC(Player *player, s8 arg1) { } } if ((gIsPlayerTripleAButtonCombo[arg1] == TRUE) && ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN)) { - gTimerBoostTripleACombo[arg1] = 0x00000078; + gTimerBoostTripleACombo[arg1] = 120; if (player->currentSpeed <= 90.0f) { player->currentSpeed = 90.0f; } @@ -446,7 +447,7 @@ void func_8008CEB0(Player *player, s8 arg1) { player->effects &= ~0x40000; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); + func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08)); var_v1 = 0; } } @@ -512,7 +513,7 @@ void func_8008D170(Player *player, s8 arg1) { player->effects &= ~0x40000; if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008); + func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x08)); var_v1 = 0; } } @@ -551,12 +552,12 @@ void apply_boost_sound_effect(Player* player, s8 arg1) { if (D_8015F890 != 1) { if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { func_800C9250(arg1); - func_800C9060(arg1, 0x1900A40B); + func_800C9060(arg1, SOUND_ARG_LOAD(0x19, 0x00, 0xA4, 0x0B)); } } else { if (player == gPlayerOne) { func_800C9250(arg1); - func_800C9060(arg1, 0x1900A40B); + func_800C9060(arg1, SOUND_ARG_LOAD(0x19, 0x00, 0xA4, 0x0B)); } } @@ -602,11 +603,11 @@ void func_8008D570(Player *player, s8 arg1) { D_8018D920[arg1] = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C9060(arg1, 0x19008002); + func_800C9060(arg1, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x02)); } if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x2900800C); + func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0C)); } } @@ -637,7 +638,7 @@ void func_8008D760(Player* player) { player->unk_07C = 0; player->unk_0C0 = 0; player->rotation[1] = player->unk_0AE; - player->effects &= 0xFFF7FFFF; + player->effects &= ~0x80000; player->kartGravity = gKartGravityTable[player->characterId]; player->type &= 0xFF7F; } @@ -659,7 +660,7 @@ void func_8008D7B0(Player* player, s8 arg1) { player->unk_078 = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_INVISIBLE_OR_BOMB) != PLAYER_INVISIBLE_OR_BOMB)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008003); + func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x03)); } } @@ -690,7 +691,7 @@ void func_8008D97C(Player *player) { player->unk_07C = 0; player->unk_0C0 = 0; player->rotation[1] = player->unk_0AE; - player->effects &= 0xFF7FFFFF; + player->effects &= ~0x80000; player->kartGravity = gKartGravityTable[player->characterId]; } @@ -724,7 +725,7 @@ void func_8008DABC(Player *player, s8 arg1) { player->unk_238 = 0; player->unk_DB4.unk10 = 4.5f; D_8018D990[arg1] = 0; - player->effects &= ~0x08000010; + player->effects &= ~(0x08000000 | 0x10); D_80165190[0][arg1] = 1; D_80165190[1][arg1] = 1; D_80165190[2][arg1] = 1; @@ -738,7 +739,7 @@ void func_8008DABC(Player *player, s8 arg1) { } if (((player->type & PLAYER_HUMAN) != 0) && ((player->effects & 0x04000000) == 0)) { - func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005); + func_800C90F4(arg1, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x05)); } player->effects |= 0x04000000; @@ -1838,21 +1839,21 @@ void func_80090868(Player* player) { } } -void func_80090970(Player *player, s8 arg1, s8 arg2) { - s32 stackPadding0; - s32 stackPadding1; +void func_80090970(Player *player, s8 playerId, s8 arg2) { + UNUSED s32 stackPadding0; + UNUSED s32 stackPadding1; Vec3f sp44; Vec3f sp38; TrackWaypoint *waypoint; - s32 stackPadding2; - s32 stackPadding3; + UNUSED s32 stackPadding2; + UNUSED s32 stackPadding3; player->unk_0C2 = 0x000C; player->unk_078 = 0; player->unk_07C = 0; player->unk_0C0 = 0; player->unk_08C = 0.0f; - clean_effect(player, arg1); + clean_effect(player, playerId); switch (player->unk_222) { case 0: if ((player->unk_0CA & 1) == 1) { @@ -1862,9 +1863,9 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_0C8 = 0x003C; } } else { - move_f32_towards(&player->pos[1], D_801652A0[arg1] + 100.0f, 0.012f); + move_f32_towards(&player->pos[1], D_801652A0[playerId] + 100.0f, 0.012f); move_s16_towards(&player->unk_0CC[arg2], 0, 0.2f); - if ((D_801652A0[arg1] + 40.0f) <= player->pos[1]) { + if ((D_801652A0[playerId] + 40.0f) <= player->pos[1]) { player->unk_222 = 1; player->unk_0CA |= 4; player->unk_0C6 = 0x00FF; @@ -1880,15 +1881,15 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { } } if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { - func_8008FB30(player, arg1); + func_8008FB30(player, playerId); } break; case 1: if (((player->type & PLAYER_HUMAN) == 0x4000) && ((player->type & PLAYER_CPU) == 0)) { - func_8009E088(arg1, 0xA); + func_8009E088(playerId, 0xA); } if ((player->unk_0CA & 1) == 1) { - move_f32_towards(&player->pos[1], D_801652A0[arg1] + 40.0f, 0.02f); + move_f32_towards(&player->pos[1], D_801652A0[playerId] + 40.0f, 0.02f); player->unk_0C6 -= 8; if (player->unk_0C6 < 9) { player->unk_0C6 = 0; @@ -1906,7 +1907,7 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_0CA &= ~0x2000; break; case 2: - func_80090178(player, arg1, sp44, sp38); + func_80090178(player, playerId, sp44, sp38); // Fakematch found by Verti, who knows what's going on here player->rotation[1] = (u16) -get_angle_between_points(sp44, sp38) & 0xFFFF; player->pos[0] = sp44[0]; @@ -1915,16 +1916,16 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_222 = 3; break; case 3: - D_80165330[arg1] = 0; + D_80165330[playerId] = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_CPU) == 0)) { - func_8009E020(arg1, 0x14); + func_8009E020(playerId, 0x14); } - func_80090178(player, arg1, sp44, sp38); + func_80090178(player, playerId, sp44, sp38); player->pos[0] = sp44[0]; player->pos[1] = sp44[1] + 40.0f; player->pos[2] = sp44[2]; - player->pos[2] = player->pos[2] + coss((arg1 * 0x1C70) - player->rotation[1]) * -5.0f; - player->pos[0] = player->pos[0] + sins((arg1 * 0x1C70) - player->rotation[1]) * -5.0f; + player->pos[2] = player->pos[2] + coss((playerId * 0x1C70) - player->rotation[1]) * -5.0f; + player->pos[0] = player->pos[0] + sins((playerId * 0x1C70) - player->rotation[1]) * -5.0f; player->unk_0C6 += 8; if (player->unk_0C6 >= 0xF0) { player->unk_0C6 = 0x00FF; @@ -1950,17 +1951,17 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_0CA &= ~0x1000; if (player->unk_0C8 >= 0x5B) { if (player->type & PLAYER_HUMAN) { - func_800C9018(arg1, 0x0100FA28); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); } if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + func_8006B8B4(player, playerId); } player->unk_0CA &= ~0x0002; player->unk_0DE &= ~0x0004; if ((player->unk_0CA & 0x80) != 0x80) { player->unk_0CA &= ~0x0008; if ((player->topSpeed * 0.9) <= player->currentSpeed) { - func_8008F104(player, arg1); + func_8008F104(player, playerId); } } } @@ -2059,7 +2060,7 @@ void func_800911B4(Player* player, s8 arg1) { void func_80091298(Player *player, s8 arg1) { s16 var_v1; - s32 stackPadding1; + UNUSED s32 stackPadding1; Vec3f spC = { 27.167f, 25.167f, 23.167f }; player->unk_044 |= 0x2000; diff --git a/src/code_80091750.c b/src/code_80091750.c index cc4cd505b..14d8ffaa0 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -2898,7 +2898,7 @@ void func_80095574(void) { gMenuTimingCounter = 3; } if (gMenuTimingCounter == DEBUG_MENU_DEBUG_MODE) { - play_sound2(0x49009009); + play_sound2(SOUND_INTRO_WELCOME); } if (gMenuTimingCounter >= 0x12D) { func_8009E230(); @@ -9983,7 +9983,7 @@ void func_800A7A4C(s32 arg0) { } 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 */ @@ -10000,7 +10000,7 @@ void func_800A7A4C(s32 arg0) { case 0: /* switch 9 */ if (gControllerFive->button & R_TRIG) { var_s1->unk4 = (s32) 1U; - play_sound2(0x4900801C); + play_sound2(SOUND_ACTION_PING); } else { var_s1->visible = 0; } @@ -12281,7 +12281,7 @@ void func_800AC458(struct_8018D9E0_entry *arg0) { if (D_8018D9BC[var_a1] > 0) { D_8018D9BC[var_a1]--; gGPPointsByCharacterId[gPlayers[gGPCurrentRacePlayerIdByRank[var_a1]].characterId] += 1; - play_sound2(0x49008017); + play_sound2(SOUND_ACTION_COUNT_SCORE); var_t1 = 0; if ((D_8018D9BC[var_a1] == 0) && (arg0->unk20 == 0)) { arg0->unk20 = 1; @@ -12348,7 +12348,7 @@ void func_800AC458(struct_8018D9E0_entry *arg0) { if ((D_8018D9D8 != 0) && (D_800DDB24 != 0)) { arg0->unk4 = 0x0000000C; arg0->unk20 = arg0->row; - play_sound2(0x49008015); + play_sound2(SOUND_ACTION_NEXT_COURSE); } break; case 12: @@ -12417,7 +12417,7 @@ void func_800ACA14(struct_8018D9E0_entry *arg0) { if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x800) { if (arg0->unk4 >= 0xC) { arg0->unk4--; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12427,7 +12427,7 @@ void func_800ACA14(struct_8018D9E0_entry *arg0) { if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x400) { if (arg0->unk4 < 0xC) { arg0->unk4++; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12437,7 +12437,7 @@ void func_800ACA14(struct_8018D9E0_entry *arg0) { if (gControllerFive->buttonPressed & 0x9000) { func_8009DFE0(0x0000001E); func_800CA330(0x19U); - play_sound2(0x4900801B); + play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12489,7 +12489,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x800) { if (arg0->unk4 >= 0xB) { arg0->unk4--; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12499,7 +12499,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { if ((gControllerFive->buttonPressed | gControllerFive->stickPressed) & 0x400) { if (arg0->unk4 < 0xD) { arg0->unk4++; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12508,7 +12508,7 @@ void func_800ACC50(struct_8018D9E0_entry *arg0) { } if (gControllerFive->buttonPressed & 0x9000) { func_8009DFE0(0x0000001E); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); if (gModeSelection == VERSUS) { D_8018EDF4 = (s8) arg0->unk4; } else { @@ -12692,7 +12692,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { if ((D_80162DF8 == 1) && (arg0->unk4 == 9)) { arg0->unk4--; } - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12708,7 +12708,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { if ((arg0->unk4 == 0x0000000A) && (D_80162DD4 != 0)) { arg0->unk4 -= 2; } else { - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12731,7 +12731,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11; var_v1 = 1; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); break; case 2: /* switch 4 */ gControllerPak1State = 0; @@ -12770,36 +12770,36 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { break; } if (var_v1 != 0) { - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, gGameName, gExtCode, &gControllerPak1FileNote) == 0) { func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x11; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } } if (gControllerPak1MaxWriteableFiles >= gControllerPak1NumFilesUsed) { arg0->unk4 = 0x0000000E; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (gControllerPak1NumPagesFree >= 0x79) { arg0->unk4 = 0x00000013; arg0->unk1C = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } arg0->unk4 = 0x0000000E; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); } } else { arg0->unk1C = arg0->unk4; D_8018EDF5 = arg0->unk4; arg0->unk4 = 0x0000001E; arg0->unk20 = arg0->row; - play_sound2(0x49008015); + play_sound2(SOUND_ACTION_NEXT_COURSE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12816,7 +12816,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { case 26: /* switch 1 */ if (gControllerOne->buttonPressed & 0xD000) { arg0->unk4 = 0x0000000A; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12829,7 +12829,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) { if (arg0->unk4 >= 0x12) { arg0->unk4--; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12839,7 +12839,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { if (arg0->unk4 < 0x12) { arg0->unk4++; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12849,7 +12849,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { } if (gControllerOne->buttonPressed & 0x4000) { arg0->unk4 = 0x0000000A; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if (gControllerOne->buttonPressed & 0x9000) { @@ -12862,7 +12862,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { } else { arg0->unk4 = 0x00000014; } - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12883,7 +12883,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { case 21: /* switch 1 */ if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) && (arg0->unk4 >= 0x15)) { arg0->unk4--; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12892,7 +12892,7 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { if (arg0->unk4 < 0x15) { arg0->unk4++; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -12901,20 +12901,20 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { } if (gControllerOne->buttonPressed & 0x4000) { arg0->unk4 = arg0->unk20 + 0x11; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } if (gControllerOne->buttonPressed & 0x9000) { if (arg0->unk4 == 0x00000015) { arg0->unk4 = 0x00000019; arg0->unk1C = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } } else { arg0->unk4 = arg0->unk20 + 0x11; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } } @@ -12923,12 +12923,12 @@ void func_800AD2E8(struct_8018D9E0_entry *arg0) { if (arg0->unk1C == 1) { if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, gGameName, gExtCode, &gControllerPak1FileNote) != 0) { arg0->unk4 = 0x0000001A; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (func_800B6178(arg0->unk20) != 0) { arg0->unk4 = 0x0000001A; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } } @@ -13013,7 +13013,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { if ((controller->buttonPressed | controller->stickPressed) & 0x800) { if (D_800F0B50[gModeSelection] < arg0->unk4) { arg0->unk4--; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13023,7 +13023,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { if ((controller->buttonPressed | controller->stickPressed) & 0x400) { if (arg0->unk4 < D_800F0B54[gModeSelection]) { arg0->unk4++; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13033,7 +13033,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { if (controller->buttonPressed & B_BUTTON) { if (arg0->unk4 != D_800F0B50[gModeSelection]) { arg0->unk4 = D_800F0B50[gModeSelection]; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); return; } } @@ -13045,7 +13045,7 @@ void func_800ADF48(struct_8018D9E0_entry *arg0) { func_800C9F90(0U); } else { func_8009DFE0(30); - play_sound2(0x4900801B); + play_sound2(SOUND_ACTION_CONTINUE_UNKNOWN); func_800CA330(FUNC_800ADF48DEF); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; @@ -13076,7 +13076,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { } if (gControllerOne->buttonPressed & 0x1000) { arg0->unk4 = 0x0000000F; - play_sound2(0x49008005); + play_sound2(SOUND_ACTION_GO_BACK_2); } else if (playerHUD[PLAYER_ONE].raceCompleteBool != 0) { arg0->unk4 = 1; arg0->unk1C = 0; @@ -13100,7 +13100,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) { if (arg0->unk4 >= 0xC) { arg0->unk4--; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13110,7 +13110,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { if (arg0->unk4 < 0x10) { arg0->unk4++; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13142,7 +13142,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { } } if (var_v1 != 0) { - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } if (gControllerPak1State == 0) { @@ -13173,30 +13173,30 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { break; } if (var_v1 != 0) { - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, gGameName, gExtCode, &gControllerPak1FileNote) == 0) { func_800B6708(); arg0->unk4 = func_800B6348((gCupSelection * 4) + gCupCourseSelection) + 0x1E; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); return; } } if (gControllerPak1MaxWriteableFiles >= gControllerPak1NumFilesUsed) { arg0->unk4 = 0x00000018; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); } else if (gControllerPak1NumPagesFree >= 0x79) { arg0->unk4 = 0x00000020; arg0->unk1C = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); } else { arg0->unk4 = 0x00000018; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); } } else { func_8009DFE0(0x0000001E); - play_sound2(0x49008016); + play_sound2(SOUND_MENU_OK_CLICKED); func_800CA330(0x19U); func_800CA388(0x19U); if (arg0->unk24 < 4.2) { @@ -13215,7 +13215,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { case 41: /* switch 1 */ if (gControllerOne->buttonPressed & 0xD000) { arg0->unk4 = 0x00000010; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13228,7 +13228,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) { if (arg0->unk4 >= 0x1F) { arg0->unk4--; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13238,7 +13238,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { if (arg0->unk4 < 0x1F) { arg0->unk4++; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13248,7 +13248,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { } if (gControllerOne->buttonPressed & 0x4000) { arg0->unk4 = 0x00000010; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else if (gControllerOne->buttonPressed & 0x9000) { thing = &D_8018EE10[arg0->unk20]; if (thing->ghostDataSaved == 0) { @@ -13259,7 +13259,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { } else { arg0->unk4 = 0x00000023; } - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13279,7 +13279,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { case 36: /* switch 1 */ if (((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x800) && ((s32) (u32) arg0->unk4 >= 0x24)) { arg0->unk4--; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13288,7 +13288,7 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { if ((gControllerOne->buttonPressed | gControllerOne->stickPressed) & 0x400) { if (arg0->unk4 < 0x24) { arg0->unk4++; - play_sound2(0x49008000); + play_sound2(SOUND_MENU_CURSOR_MOVE); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } @@ -13297,18 +13297,18 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { } if (gControllerOne->buttonPressed & 0x4000) { arg0->unk4 = arg0->unk20 + 0x1E; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } else if (gControllerOne->buttonPressed & 0x9000) { if (arg0->unk4 == 0x00000024) { arg0->unk4 = 0x00000028; arg0->unk1C = 0; - play_sound2(0x49008001); + play_sound2(SOUND_MENU_SELECT); if (arg0->unk24 < 4.2) { arg0->unk24 += 4.0; } } else { arg0->unk4 = arg0->unk20 + 0x1E; - play_sound2(0x49008002); + play_sound2(SOUND_MENU_GO_BACK); } } break; @@ -13316,12 +13316,12 @@ void func_800AE218(struct_8018D9E0_entry *arg0) { if (arg0->unk1C == 1) { if (osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, gGameName, gExtCode, &gControllerPak1FileNote) != 0) { arg0->unk4 = 0x00000029; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } if (func_800B6178(arg0->unk20) != 0) { arg0->unk4 = 0x00000029; - play_sound2(0x4900FF07); + play_sound2(SOUND_MENU_FILE_NOT_FOUND); return; } } diff --git a/src/effects.c b/src/effects.c index 3e4d922cb..280d61105 100644 --- a/src/effects.c +++ b/src/effects.c @@ -1838,7 +1838,7 @@ void func_80090868(Player* player) { } } -void func_80090970(Player *player, s8 arg1, s8 arg2) { +void func_80090970(Player *player, s8 playerId, s8 arg2) { s32 stackPadding0; s32 stackPadding1; Vec3f sp44; @@ -1852,7 +1852,7 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_07C = 0; player->unk_0C0 = 0; player->unk_08C = 0.0f; - clean_effect(player, arg1); + clean_effect(player, playerId); switch (player->unk_222) { case 0: if ((player->unk_0CA & 1) == 1) { @@ -1862,9 +1862,9 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_0C8 = 0x003C; } } else { - move_f32_towards(&player->pos[1], D_801652A0[arg1] + 100.0f, 0.012f); + move_f32_towards(&player->pos[1], D_801652A0[playerId] + 100.0f, 0.012f); move_s16_towards(&player->unk_0CC[arg2], 0, 0.2f); - if ((D_801652A0[arg1] + 40.0f) <= player->pos[1]) { + if ((D_801652A0[playerId] + 40.0f) <= player->pos[1]) { player->unk_222 = 1; player->unk_0CA |= 4; player->unk_0C6 = 0x00FF; @@ -1880,15 +1880,15 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { } } if ((player->effects & BOO_EFFECT) == BOO_EFFECT) { - func_8008FB30(player, arg1); + func_8008FB30(player, playerId); } break; case 1: if (((player->type & PLAYER_HUMAN) == 0x4000) && ((player->type & PLAYER_CPU) == 0)) { - func_8009E088(arg1, 0xA); + func_8009E088(playerId, 0xA); } if ((player->unk_0CA & 1) == 1) { - move_f32_towards(&player->pos[1], D_801652A0[arg1] + 40.0f, 0.02f); + move_f32_towards(&player->pos[1], D_801652A0[playerId] + 40.0f, 0.02f); player->unk_0C6 -= 8; if (player->unk_0C6 < 9) { player->unk_0C6 = 0; @@ -1906,7 +1906,7 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_0CA &= ~0x2000; break; case 2: - func_80090178(player, arg1, sp44, sp38); + func_80090178(player, playerId, sp44, sp38); // Fakematch found by Verti, who knows what's going on here player->rotation[1] = (u16) -get_angle_between_points(sp44, sp38) & 0xFFFF; player->pos[0] = sp44[0]; @@ -1915,16 +1915,16 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_222 = 3; break; case 3: - D_80165330[arg1] = 0; + D_80165330[playerId] = 0; if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && ((player->type & PLAYER_CPU) == 0)) { - func_8009E020(arg1, 0x14); + func_8009E020(playerId, 0x14); } - func_80090178(player, arg1, sp44, sp38); + func_80090178(player, playerId, sp44, sp38); player->pos[0] = sp44[0]; player->pos[1] = sp44[1] + 40.0f; player->pos[2] = sp44[2]; - player->pos[2] = player->pos[2] + coss((arg1 * 0x1C70) - player->rotation[1]) * -5.0f; - player->pos[0] = player->pos[0] + sins((arg1 * 0x1C70) - player->rotation[1]) * -5.0f; + player->pos[2] = player->pos[2] + coss((playerId * 0x1C70) - player->rotation[1]) * -5.0f; + player->pos[0] = player->pos[0] + sins((playerId * 0x1C70) - player->rotation[1]) * -5.0f; player->unk_0C6 += 8; if (player->unk_0C6 >= 0xF0) { player->unk_0C6 = 0x00FF; @@ -1950,17 +1950,17 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { player->unk_0CA &= ~0x1000; if (player->unk_0C8 >= 0x5B) { if (player->type & PLAYER_HUMAN) { - func_800C9018(arg1, 0x0100FA28); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFA, 0x28)); } if (gModeSelection == BATTLE) { - func_8006B8B4(player, arg1); + func_8006B8B4(player, playerId); } player->unk_0CA &= ~0x0002; player->unk_0DE &= ~0x0004; if ((player->unk_0CA & 0x80) != 0x80) { player->unk_0CA &= ~0x0008; if ((player->topSpeed * 0.9) <= player->currentSpeed) { - func_8008F104(player, arg1); + func_8008F104(player, playerId); } } } diff --git a/src/math_util_2.c b/src/math_util_2.c index 809e8907a..314e9789c 100644 --- a/src/math_util_2.c +++ b/src/math_util_2.c @@ -386,18 +386,18 @@ UNUSED s32 func_800416AC(f32 arg0, f32 arg1) { return atan2s(arg1, arg0); } -f32 func_800416D8(f32 arg0, f32 arg1, u16 arg2) { - f32 sp1C; +f32 func_800416D8(f32 x, f32 z, u16 angle) { + f32 cosAngle; - sp1C = coss(arg2); - return (sp1C * arg0) - (sins(arg2) * arg1); + cosAngle = coss(angle); + return (cosAngle * x) - (sins(angle) * z); } -f32 func_80041724(f32 arg0, f32 arg1, u16 arg2) { - f32 sp1C; +f32 func_80041724(f32 x, f32 z, u16 angle) { + f32 sinAngle; - sp1C = sins(arg2); - return (coss(arg2) * arg1) + (sp1C * arg0); + sinAngle = sins(angle); + return (coss(angle) * z) + (sinAngle * x); } s32 func_80041770(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { diff --git a/src/player_controller.c b/src/player_controller.c index c720ea89b..d3695f48c 100644 --- a/src/player_controller.c +++ b/src/player_controller.c @@ -19,6 +19,7 @@ #include "spawn_players.h" #include "code_80057C60.h" #include "code_80005FD0.h" +#include "sounds.h" extern s32 D_8018D168; @@ -495,7 +496,7 @@ void func_80027EDC(Player *player, s8 playerId) { func_800CA2B8(playerId); } if (D_80165300[playerId] == 2) { - func_800C9018(playerId, 0x0170802D); + func_800C9018(playerId, SOUND_ARG_LOAD(0x01, 0x70, 0x80, 0x2D)); } D_80165300[playerId] = 0; } @@ -2008,7 +2009,7 @@ void func_8002C7E4(Player *player, s8 arg1, s8 arg2) { } } -void func_8002C954(Player *player, s8 arg1, Vec3f arg2) { +void func_8002C954(Player *player, s8 playerId, Vec3f arg2) { f32 temp_f0; f32 var_f14; f32 xdist; @@ -2026,7 +2027,7 @@ void func_8002C954(Player *player, s8 arg1, Vec3f arg2) { ((player->effects & 0x10000) == 0))) && (((player->unk_0CA & 2) == 0) || (!(player->unk_0CA & 8)))) { - func_8008F494(player, arg1); + func_8008F494(player, playerId); } if ((player->unk_046 & 0x20) != 0x20) { if ((player->unk_110.unk3C[0] < (-1.0f)) || (player->unk_110.unk3C[1] < (-1.0f))) { @@ -2046,10 +2047,10 @@ void func_8002C954(Player *player, s8 arg1, Vec3f arg2) { func_80031F48(player, 18.0f); } if ((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) { - xdist = D_80165070[arg1][0] - arg2[0]; - var_f14 = D_80165070[arg1][1] - arg2[1]; + xdist = D_80165070[playerId][0] - arg2[0]; + var_f14 = D_80165070[playerId][1] - arg2[1]; ydist = var_f14; // okay - zdist = D_80165070[arg1][2] - arg2[2]; + zdist = D_80165070[playerId][2] - arg2[2]; var_f14 = sqrtf((xdist * xdist) + (ydist * ydist) + (zdist * zdist)) / 3; if (var_f14 >= 1.0) { var_f14 = 1.0f; @@ -2057,14 +2058,14 @@ void func_8002C954(Player *player, s8 arg1, Vec3f arg2) { if ((var_f14 <= 0.6) && (((player->unk_094 / 18.0f) * 216.0f) >= 40.0f) && (!(player->type & PLAYER_INVISIBLE_OR_BOMB))) { - func_800CAEC4(arg1, 0.6F); + func_800CAEC4(playerId, 0.6F); } else if (!(player->type & PLAYER_INVISIBLE_OR_BOMB)) { if ((var_f14 <= 0.6) && (((player->unk_094 / 18.0f) * 216.0f) < 40.0f) && (((player->unk_094 / 18.0f) * 216.0f) >= 10.0f)) { - func_800CAEC4(arg1, 0.3F); + func_800CAEC4(playerId, 0.3F); } else { - func_800CAEC4(arg1, var_f14); + func_800CAEC4(playerId, var_f14); } } } diff --git a/src/racing/actors.c b/src/racing/actors.c index ab2b78e7b..34b7d9240 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -532,14 +532,14 @@ void update_actor_kiwano_fruit(struct KiwanoFruit *fruit) { fruit->velocity[1] = 2.3f; fruit->velocity[2] = 0.0f; if ((player->effects & STAR_EFFECT) != 0) { - func_800C9060(player - gPlayerOne, 0x1900A052U); + func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x52)); } else { player->effects |= 0x8000; player->pos[0] -= temp_f2 * 4.0f; player->pos[2] -= temp_f14 * 4.0f; player->velocity[0] -= temp_f2 * 0.7f; player->velocity[2] -= temp_f14 * 0.7f; - func_800C9060(player - gPlayerOne, 0x19007018U); + func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x18)); if (gModeSelection != GRAND_PRIX) { D_80162DF8 = 1; } @@ -732,7 +732,7 @@ void func_802986B4(Camera *camera, Mat4 arg1, UNUSED struct Actor *actor) { struct ActorSpawnData *var_s1; struct ActorSpawnData *var_s5; Vec3f sp88; - u32 soundThing = 0x1901904D; + u32 soundThing = SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x4D); s32 segment = SEGMENT_NUMBER2(d_course_moo_moo_farm_cow_spawn); s32 offset = SEGMENT_OFFSET(d_course_moo_moo_farm_cow_spawn); @@ -811,12 +811,12 @@ void func_80298AC0(Player *player) { sp64[2] = data->pos[2]; if (func_8029EEB8(player, sp64, 5.0f, 40.0f, 0.8f) == 1) { if ((player->effects & STAR_EFFECT) != 0) { - func_800C98B8(player->pos, player->velocity, 0x19018010); - func_800C90F4((u8) (player - gPlayerOne), (player->characterId * 0x10) + 0x2900800D); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); + func_800C90F4((u8) (player - gPlayerOne), (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); data->someId |= 0x400; } if ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0) { - func_800C9060((u8) (player - gPlayerOne), 0x19007018); + func_800C9060((u8) (player - gPlayerOne), SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x18)); } break; } @@ -1338,7 +1338,7 @@ void update_actor_railroad_crossing(struct RailroadCrossing *crossing) { } // Play Bell sound when timer hits 20 or 1. if ((crossing->someTimer == 1) || (crossing->someTimer == 20)) { - func_800C98B8(crossing->pos, crossing->velocity, 0x19017016); + func_800C98B8(crossing->pos, crossing->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x70, 0x16)); } } } @@ -2386,15 +2386,15 @@ void func_8029E7DC(struct Actor *actor) { s16 temp_v0 = actor->flags; if ((temp_v0 & 0x200) != 0) { - func_800C99E0(actor->pos, 0x19019053); + func_800C99E0(actor->pos, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } if ((temp_v0 & 0x100) != 0) { - func_800C99E0(actor->pos, 0x19018010); + func_800C99E0(actor->pos, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); return; } if ((temp_v0 & 0x80) != 0) { - func_800C99E0(actor->pos, 0x19008054); + func_800C99E0(actor->pos, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54)); } } @@ -2669,10 +2669,10 @@ s32 func_8029F1F8(Player *player, struct Actor *marioRacewaySign) { if ((player->type & PLAYER_HUMAN) != 0) { if ((player->effects & STAR_EFFECT) != 0) { marioRacewaySign->flags |= 0x400; - func_800C98B8(player->pos, player->velocity, 0x19018010U); - func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); + func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } else if ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0) { - func_800C9060(player - gPlayerOne, 0x1900701AU); + func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x1A)); } } return 1; @@ -2685,10 +2685,10 @@ s32 func_8029F2FC(Player *player, struct PiranhaPlant *plant) { if ((player->type & PLAYER_HUMAN) != 0) { if ((player->effects & STAR_EFFECT) != 0) { plant->flags |= 0x400; - func_800C98B8(player->pos, player->velocity, 0x1901A24AU); - func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); + func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } else if ((player->type & PLAYER_INVISIBLE_OR_BOMB) == 0) { - func_800C9060(player - gPlayerOne, 0x1900A052U); + func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x52)); } } return 1; @@ -2737,8 +2737,8 @@ s32 func_8029F408(Player *player, struct YoshiValleyEgg *egg) { if ((player->effects & STAR_EFFECT) != 0) { egg->flags |= 0x400; egg->pathCenter[1] = 8.0f; - func_800C98B8(player->pos, player->velocity, 0x19018010); - func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); + func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); } else { func_8008DABC(player, player - gPlayerOne); if ((gModeSelection == TIME_TRIALS) && ((player->type & PLAYER_CPU) == 0)) { @@ -2801,12 +2801,12 @@ s32 func_8029F69C(Player *player, struct Actor *actor) { if (player->type & PLAYER_HUMAN) { if (player->effects & STAR_EFFECT) { actor->flags |= 0x400; - func_800C98B8(player->pos, player->velocity, 0x19018010U); - func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + 0x2900800D); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); + func_800C90F4(player - gPlayerOne, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x0D)); return 1; } if (!(player->type & PLAYER_INVISIBLE_OR_BOMB)) { - func_800C9060(player - gPlayerOne, 0x19007018U); + func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x70, 0x18)); } } if (!(player->effects & STAR_EFFECT)) { @@ -2988,7 +2988,7 @@ void func_8029FDC8(struct Actor *actor) { case GREEN_SHELL_HIT_A_RACER: case BLUE_SHELL_LOCK_ON: case BLUE_SHELL_TARGET_ELIMINATED: - func_800C9EF4(shell->pos, 0x51018008); + func_800C9EF4(shell->pos, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08)); func_8000EE58(actor - gActorList); /* fallthrough */ case HELD_SHELL: @@ -3050,28 +3050,28 @@ void func_802A00E8(struct Actor *arg0, struct Actor *arg1) { case ACTOR_GREEN_SHELL: if ((arg0->state == HELD_SHELL) || (arg0->state == TRIPLE_GREEN_SHELL)) { arg0->flags |= 0x200; - func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); + func_800C98B8(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } break; case ACTOR_RED_SHELL: if ((arg0->state == HELD_SHELL) || (arg0->state == TRIPLE_RED_SHELL)) { arg0->flags |= 0x200; - func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); + func_800C98B8(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } break; case ACTOR_BLUE_SPINY_SHELL: if (arg0->state == HELD_SHELL) { arg0->flags |= 0x200; - func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); + func_800C98B8(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } break; case ACTOR_FAKE_ITEM_BOX: if (arg0->state == HELD_FAKE_ITEM_BOX) { arg0->flags |= 0x200; - func_800C98B8(arg0->pos, arg0->velocity, 0x19019053); + func_800C98B8(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } break; @@ -3081,35 +3081,35 @@ void func_802A00E8(struct Actor *arg0, struct Actor *arg1) { case ACTOR_GREEN_SHELL: if ((arg1->state == HELD_SHELL) || (arg1->state == TRIPLE_GREEN_SHELL)) { arg1->flags |= 0x200; - func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); + func_800C98B8(arg1->pos, arg1->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } break; case ACTOR_RED_SHELL: if ((arg1->state == HELD_SHELL) || (arg1->state == TRIPLE_RED_SHELL)) { arg1->flags |= 0x200; - func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); + func_800C98B8(arg1->pos, arg1->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } break; case ACTOR_BLUE_SPINY_SHELL: if (arg1->state == HELD_SHELL) { arg1->flags |= 0x200; - func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); + func_800C98B8(arg1->pos, arg1->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } break; case ACTOR_FAKE_ITEM_BOX: if (arg1->state == HELD_FAKE_ITEM_BOX) { arg1->flags |= 0x200; - func_800C98B8(arg1->pos, arg1->velocity, 0x19019053); + func_800C98B8(arg1->pos, arg1->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); return; } break; } arg0->flags |= 0x100; - func_800C98B8(arg0->pos, arg0->velocity, 0x19018010); + func_800C98B8(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); } void func_802A0350(struct Actor *arg0, struct Actor *arg1) { @@ -3118,7 +3118,7 @@ void func_802A0350(struct Actor *arg0, struct Actor *arg1) { func_8029FDC8(arg0); func_8029FDC8(arg1); arg0->flags |= 256; - func_800C98B8(arg0->pos, arg0->velocity, 0x19018010); + func_800C98B8(arg0->pos, arg0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); return; } if (arg0->type == ACTOR_BLUE_SPINY_SHELL) { @@ -3165,13 +3165,13 @@ void func_802A0450(Player *player, struct Actor *actor) { if (owner->type & 0x4000) { if (actor->flags & 0xF) { if (temp_lo != temp_v1) { - func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006); + func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } } else { temp_f0 = actor->pos[0] - owner->pos[0]; temp_f2 = actor->pos[2] - owner->pos[2]; if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 360000.0f) && (temp_lo != temp_v1)) { - func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006); + func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } } } @@ -3183,10 +3183,10 @@ void func_802A0450(Player *player, struct Actor *actor) { temp_v1 = actor->rot[2]; if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; } player->soundEffects |= 4; - func_800C98B8(player->pos, player->velocity, 0x19018010U); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); owner = &gPlayers[temp_v1]; if ((owner->type & 0x4000) && (temp_lo != temp_v1)) { - func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006); + func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } func_8029FDC8(actor); break; @@ -3196,11 +3196,11 @@ void func_802A0450(Player *player, struct Actor *actor) { if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; } if (!(player->effects & BOO_EFFECT)) { player->soundEffects |= 2; - func_800C98B8(player->pos, player->velocity, 0x19018010U); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); } owner = &gPlayers[temp_v1]; if ((owner->type & 0x4000) && (temp_lo != temp_v1)) { - func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006); + func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } if (temp_lo == actor->unk_04) { func_8029FDC8(actor); @@ -3214,11 +3214,11 @@ void func_802A0450(Player *player, struct Actor *actor) { if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; } if (!(player->effects & BOO_EFFECT)) { player->soundEffects |= 2; - func_800C98B8(player->pos, player->velocity, 0x19018010U); + func_800C98B8(player->pos, player->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x10)); } owner = &gPlayers[temp_v1]; if ((owner->type & 0x4000) && (temp_lo != temp_v1)) { - func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006); + func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } func_8029FDC8(actor); break; @@ -3273,13 +3273,13 @@ void func_802A0450(Player *player, struct Actor *actor) { if (owner->type & 0x4000) { if (actor->flags & 0xF) { if (temp_lo != temp_v1) { - func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006); + func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } } else { temp_f0 = actor->pos[0] - owner->pos[0]; temp_f2 = actor->pos[2] - owner->pos[2]; if ((((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 360000.0f) && (temp_lo != temp_v1)) { - func_800C90F4(temp_v1, (owner->characterId * 0x10) + 0x29008006); + func_800C90F4(temp_v1, (owner->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x06)); } } if (actor->state == 0) { @@ -3452,7 +3452,7 @@ void update_actor_fake_item_box(struct FakeItemBox *fake_item_box) { temp_v1_3->buttonDepressed &= 0xDFFF; func_802A1064(fake_item_box); temp_v0_4->soundEffects &= 0xFFFBFFFF; - func_800C9060((u8)(temp_v0_4 - gPlayerOne), 0x19008012); + func_800C9060((u8)(temp_v0_4 - gPlayerOne), SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); } } break; diff --git a/src/racing/actors.h b/src/racing/actors.h index 6828866e2..746ded6e6 100644 --- a/src/racing/actors.h +++ b/src/racing/actors.h @@ -5,7 +5,7 @@ #include "actor_types.h" void cleanup_red_and_green_shells(struct ShellActor*); -void actor_init(struct Actor*, Vec3f, s16*, f32*, s16); +void actor_init(struct Actor*, Vec3f, Vec3s, Vec3f, s16); void func_80297230(Camera*, struct Actor*); void func_802972B8(Camera*, struct Actor*); void func_80297340(Camera*); @@ -75,7 +75,7 @@ void place_course_actors(void); void func_8029E158(void); void func_8029E7DC(struct Actor*); void destroy_actor(struct Actor*); -s16 func_8029E890(f32*, s16*, f32*, s16); +s16 func_8029E890(Vec3f, Vec3s, Vec3f, s16); s16 addActorToEmptySlot(Vec3f, Vec3s, Vec3f, s16); s16 func_8029ED38(Vec3f, s16); s32 func_8029EEB8(Player*, Vec3f, f32, f32, f32); diff --git a/src/racing/actors_extended.c b/src/racing/actors_extended.c index c473206a9..af5063bec 100644 --- a/src/racing/actors_extended.c +++ b/src/racing/actors_extended.c @@ -14,6 +14,7 @@ #include "audio/external.h" #include "code_80071F00.h" #include "effects.h" +#include "sounds.h" void copy_collision(Collision *arg0, Collision *arg1) { arg1->unk30 = arg0->unk30; @@ -100,7 +101,7 @@ void func_802B0570(struct BananaActor *banana) { func_802B0464(banana->youngerIndex); func_802B04E8(banana, banana->elderIndex); if ((gPlayers[banana->playerId].type & 0x4000) != 0) { - func_800C9060(banana->playerId, 0x19019053); + func_800C9060(banana->playerId, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x53)); } banana->flags = -0x8000; banana->unk_04 = 0x003C; @@ -297,7 +298,7 @@ void update_actor_banana_bunch(struct BananaBunchParent *banana_bunch) { controller = &gControllers[banana_bunch->playerId]; if ((controller->buttonPressed & Z_TRIG) != 0) { controller->buttonPressed &= ~Z_TRIG; - func_800C9060(owner - gPlayerOne, 0x19008012); + func_800C9060(owner - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); if ((controller->rawStickY >= 0x1F) && ((controller->rawStickX < 0x28) && (controller->rawStickX >= -0x27))) { func_802B0788(controller->rawStickY, banana_bunch, owner); } else { @@ -347,7 +348,7 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) { switch (parent->state) { case SPAWN_FIRST_SHELL: if (init_triple_shell(parent, &gPlayers[playerId], shellType, 0U) != -1) { - func_800C9060(playerId, 0x19008012); + func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); parent->shellsAvailable += 1; } parent->state = SPAWN_SECOND_SHELL; @@ -356,7 +357,7 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) { if (parent->rotVelocity > 0) { if (someRotAngle >= 0xD556) { if (init_triple_shell(parent, &gPlayers[playerId], shellType, 1U) != -1) { - func_800C9060(playerId, 0x19008012); + func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); parent->shellsAvailable += 1; } parent->state = SPAWN_THIRD_SHELL; @@ -364,7 +365,7 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) { } else { if (someRotAngle < 0x2AAA) { if (init_triple_shell(parent, &gPlayers[playerId], shellType, 1U) != -1) { - func_800C9060(playerId, 0x19008012); + func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); parent->shellsAvailable += 1; } parent->state = SPAWN_THIRD_SHELL; @@ -375,14 +376,14 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) { if (parent->rotVelocity > 0) { if ((someRotAngle >= 0x2AAB) && (someRotAngle < 0x31C7)) { if (init_triple_shell(parent, &gPlayers[playerId], shellType, 2U) != -1) { - func_800C9060(playerId, 0x19008012); + func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); parent->shellsAvailable += 1; } parent->state = 3; } } else if ((someRotAngle < 0xD555) && (someRotAngle >= 0xCE39)) { if (init_triple_shell(parent, &gPlayers[playerId], shellType, 2U) != -1) { - func_800C9060(playerId, 0x19008012); + func_800C9060(playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); parent->shellsAvailable += 1; } parent->state = 3; @@ -435,8 +436,8 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) { shell->velocity[2] = someVelocity[2]; shell->state = MOVING_SHELL; shell->someTimer = 0x001E; - func_800C9060(parent->playerId, 0x19008004); - func_800C90F4(parent->playerId, (player->characterId * 0x10) + 0x29008000); + func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04)); + func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00)); if (parent->type == ACTOR_TRIPLE_RED_SHELL) { func_8000ED80(parent->shellIndices[0]); } else { @@ -460,8 +461,8 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) { shell->velocity[2] = someVelocity[2]; shell->state = MOVING_SHELL; shell->someTimer = 0x001E; - func_800C90F4(parent->playerId, (player->characterId * 0x10) + 0x29008000); - func_800C9060(parent->playerId, 0x19008004); + func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00)); + func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04)); if (parent->type == ACTOR_TRIPLE_RED_SHELL) { func_8000ED80(parent->shellIndices[1]); } else { @@ -485,8 +486,8 @@ void update_actor_triple_shell(TripleShellParent *parent, s16 shellType) { shell->velocity[2] = someVelocity[2]; shell->state = MOVING_SHELL; shell->someTimer = 0x001E; - func_800C9060(parent->playerId, 0x19008004); - func_800C90F4(parent->playerId, (player->characterId * 0x10) + 0x29008000); + func_800C9060(parent->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04)); + func_800C90F4(parent->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00)); if (parent->type == ACTOR_TRIPLE_RED_SHELL) { func_8000ED80(parent->shellIndices[2]); } else { @@ -727,7 +728,7 @@ void update_actor_banana(struct BananaActor *banana) { banana->state = 1; banana->unk_04 = 0x00B4; player->soundEffects &= ~HOLD_BANANA_SOUND_EFFECT; - func_800C9060(player - gPlayerOne, 0x19008012U); + func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); pad3 = controller->rawStickY; if ((pad3 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) { pad3 = pad3 - ((f32) 30); @@ -926,7 +927,7 @@ void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 b break; } if ((player->type & PLAYER_HUMAN) != 0) { - func_800C9060(player - gPlayerOne, 0x19008012); + func_800C9060(player - gPlayerOne, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x12)); } } } @@ -1190,8 +1191,8 @@ void update_actor_green_shell(struct ShellActor *shell) { shell->velocity[1] = somePosVel[1]; shell->velocity[2] = somePosVel[2]; shell->state = 2; - func_800C9060(shell->playerId, 0x19008004U); - func_800C90F4(shell->playerId, (player->characterId * 0x10) + 0x29008000); + func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04)); + func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00)); func_8000EDC8((struct Actor*)shell - gActorList); return; } else { @@ -1212,8 +1213,8 @@ void update_actor_green_shell(struct ShellActor *shell) { if (shell->rotAngle < 0) { shell->state = 2; shell->someTimer = 0x001E; - func_800C9060(shell->playerId, 0x19008004U); - func_800C90F4(shell->playerId, (player->characterId * 0x10) + 0x29008000); + func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04)); + func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00)); func_8000EDC8((struct Actor*)shell - gActorList); } } else { @@ -1221,8 +1222,8 @@ void update_actor_green_shell(struct ShellActor *shell) { if (shell->rotAngle > 0) { shell->state = 2; shell->someTimer = 0x001E; - func_800C9060(shell->playerId, 0x19008004U); - func_800C90F4(shell->playerId, (player->characterId * 0x10) + 0x29008000); + func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04)); + func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00)); func_8000EDC8((struct Actor*)shell - gActorList); } } @@ -1269,7 +1270,7 @@ void update_actor_green_shell(struct ShellActor *shell) { func_802B4E30((struct Actor *) shell); if ((shell->unk30.unk3C[0] < 0.0f) || (shell->unk30.unk3C[1] < 0.0f)) { shell_collision(&shell->unk30, shell->velocity); - func_800C98B8(shell->pos, shell->velocity, 0x19008054U); + func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54)); shell->flags |= 0x80; } break; @@ -1486,11 +1487,11 @@ s16 func_802B3FD0(Player *owner, struct ShellActor *shell) { void func_802B4104(struct ShellActor *shell) { if ((shell->unk30.unk3C[0] < 0.0f) && ((shell->unk30.unk48[1] < 0.25f) || (shell->unk30.unk48[1] > -0.25f))) { func_8029FDC8((struct Actor *) shell); - func_800C98B8(shell->pos, shell->velocity, 0x19008054U); + func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54)); shell->flags |= 0x80; } else if ((shell->unk30.unk3C[1] < 0.0f) && ((shell->unk30.unk54[1] < 0.25f) || (shell->unk30.unk54[1] < -0.25f))) { func_8029FDC8((struct Actor *) shell); - func_800C98B8(shell->pos, shell->velocity, 0x19008054U); + func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54)); shell->flags |= 0x80; } } @@ -1580,26 +1581,26 @@ void update_actor_red_blue_shell(struct ShellActor *shell) { shell->rotAngle -= 0x71C; if (shell->rotAngle < 0) { shell->state = MOVING_SHELL; - func_800C9060(shell->playerId, 0x19008004U); - func_800C90F4(shell->playerId, (player->characterId * 0x10) + 0x29008000); + func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04)); + func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00)); if (pad13 == ACTOR_RED_SHELL) { func_8000ED80((struct Actor*)shell - gActorList); } else { func_8000EE10((struct Actor*)shell - gActorList); - func_800C9D80(shell->pos, shell->velocity, 0x51018008U); + func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08)); } } } else { shell->rotAngle += 0x71C; if (shell->rotAngle > 0) { shell->state = MOVING_SHELL; - func_800C9060(shell->playerId, 0x19008004U); - func_800C90F4(shell->playerId, (player->characterId * 0x10) + 0x29008000); + func_800C9060(shell->playerId, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x04)); + func_800C90F4(shell->playerId, (player->characterId * 0x10) + SOUND_ARG_LOAD(0x29, 0x00, 0x80, 0x00)); if (pad13 == ACTOR_RED_SHELL) { func_8000ED80((struct Actor*)shell - gActorList); } else { func_8000EE10((struct Actor*)shell - gActorList); - func_800C9D80(shell->pos, shell->velocity, 0x51018008U); + func_800C9D80(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x51, 0x01, 0x80, 0x08)); } } } diff --git a/src/racing/race_logic.c b/src/racing/race_logic.c index a1126ece5..1363ea806 100644 --- a/src/racing/race_logic.c +++ b/src/racing/race_logic.c @@ -811,7 +811,7 @@ void func_8028F970(void) { if (D_800DC5A8 >= 3) { D_800DC5A8 = 0; } - play_sound2(0x4900801C); + play_sound2(SOUND_ACTION_PING); func_800029B0(); } } diff --git a/tools/doxygen_syms.md b/tools/doxygen_syms.md index a0d48ae6b..782f700d0 100644 --- a/tools/doxygen_syms.md +++ b/tools/doxygen_syms.md @@ -2349,7 +2349,7 @@ Variable Name | Memory Address [init_sequence_player](@ref init_sequence_player) | 0x800C11B0 [init_sequence_players](@ref init_sequence_players) | 0x800C125C [func_800C13F0](@ref func_800C13F0) | 0x800C13F0 -[func_800C13FC](@ref func_800C13FC) | 0x800C13FC +[audio_reset_session_eu](@ref audio_reset_session_eu) | 0x800C13FC [func_800C1480](@ref func_800C1480) | 0x800C1480 [func_800C15D0](@ref func_800C15D0) | 0x800C15D0 [func_800C16E8](@ref func_800C16E8) | 0x800C16E8 @@ -2467,14 +2467,14 @@ Variable Name | Memory Address [eu_process_audio_cmd](@ref eu_process_audio_cmd) | 0x800CB818 [seq_player_fade_to_zero_volume](@ref seq_player_fade_to_zero_volume) | 0x800CBA08 [func_800CBA64](@ref func_800CBA64) | 0x800CBA64 -[func_800CBAB4](@ref func_800CBAB4) | 0x800CBAB4 +[port_eu_init_queues](@ref port_eu_init_queues) | 0x800CBAB4 [func_800CBB48](@ref func_800CBB48) | 0x800CBB48 [func_800CBB88](@ref func_800CBB88) | 0x800CBB88 [func_800CBBB8](@ref func_800CBBB8) | 0x800CBBB8 [func_800CBBE8](@ref func_800CBBE8) | 0x800CBBE8 [func_800CBC24](@ref func_800CBC24) | 0x800CBC24 [func_800CBCB0](@ref func_800CBCB0) | 0x800CBCB0 -[func_800CBF48](@ref func_800CBF48) | 0x800CBF48 +[port_eu_init](@ref port_eu_init) | 0x800CBF48 [osCreateThread](@ref osCreateThread) | 0x800CBF70 [osInitialize](@ref osInitialize) | 0x800CC0C0 [osStartThread](@ref osStartThread) | 0x800CC360 @@ -4784,9 +4784,9 @@ Variable Name | Memory Address [D_8018EFD8](@ref D_8018EFD8) | 0x8018EFD8 [D_8018FB90](@ref D_8018FB90) | 0x8018FB90 [D_8018FB91](@ref D_8018FB91) | 0x8018FB91 -[D_8018FB98](@ref D_8018FB98) | 0x8018FB98 -[D_8018FBA8](@ref D_8018FBA8) | 0x8018FBA8 -[D_8018FBD8](@ref D_8018FBD8) | 0x8018FBD8 +[gCopyCamera](@ref gCopyCamera) | 0x8018FB98 +[gVelocityCamera](@ref gVelocityCamera) | 0x8018FBA8 +[gCameraLastPos](@ref gCameraLastPos) | 0x8018FBD8 [D_8018FC08](@ref D_8018FC08) | 0x8018FC08 [D_8018FC10](@ref D_8018FC10) | 0x8018FC10 [sSoundRequests](@ref sSoundRequests) | 0x8018FC20