diff --git a/include/functions.h b/include/functions.h index a4d535a3f2..16a26205a0 100644 --- a/include/functions.h +++ b/include/functions.h @@ -335,7 +335,7 @@ void add_vec2D_polar(f32* x, f32* y, f32 r, f32 theta); s32 sfx_adjust_env_sound_pos(s32 soundID, s32 arg1, f32 arg2, f32 arg3, f32 arg4); void sfx_play_sound(s32 soundID); -s32 sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ); +void sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ); void sfx_play_sound_at_player(s32 soundID, s32 arg0); void sfx_play_sound_at_npc(s32 soundID, s32 arg1, s32 npcID); s32 bgm_set_song(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume); diff --git a/src/DF950.c b/src/DF950.c index dd39734b70..760db19b5b 100644 --- a/src/DF950.c +++ b/src/DF950.c @@ -1,5 +1,24 @@ #include "common.h" +#define MAX_SOUND_INSTANCES 10 + +typedef struct SoundInstance { + /* 0x00 */ s32 flags; + /* 0x04 */ SoundID soundID; + /* 0x08 */ s32 sourceFlags; + /* 0x0C */ u8 volume; + /* 0x0D */ u8 pan; + /* 0x0E */ s16 pitchShift; + /* 0x10 */ Vec3f position; +} SoundInstance; // size = 0x1C + +extern SoundInstance D_801598A0[MAX_SOUND_INSTANCES]; +extern SoundInstance D_801599B8[MAX_SOUND_INSTANCES]; +extern SoundInstance* D_80159AD0; + +void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift); +void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift); + s32 D_8014F2D0[] = { 0x00000287, 0x000002A8, 0x00000054, 0x00000056, 0x00000024, 0x00000027, 0x00000021, 0x00000022, 0x00000349, 0x00000273, 0x00000275, 0x00000275, 0x00000274, 0x00000273, 0x00000274, 0x00000099, 0x0000009E, 0x0000032E, 0x0000008E, 0x00000089, 0x00000083, 0x00000388, 0x000000A0, 0x0000004A, @@ -51,16 +70,152 @@ s32 D_8014F58C[] = { 0x00002043, 0x00002044 }; s32 D_8014F594[] = { 0x00002078, 0x00002079 }; s32 D_8014F59C[] = { 0x000003B6, 0x000003B7 }; -s32 D_8014F5A4[] = { &D_8014F48C, 0x00020000, &D_8014F494, 0x00020000, &D_8014F49C, 0x00020000, &D_8014F4A4, 0x00020000, - &D_8014F4AC, 0x00020000, &D_8014F4B4, 0x00020000, &D_8014F4BC, 0x00020000, &D_8014F4C4, 0x00020000, - &D_8014F4CC, 0x00020000, &D_8014F4D4, 0x00020000, &D_8014F4DC, 0x00020000, &D_8014F4E4, 0x00020000, - &D_8014F4EC, 0x00020000, &D_8014F4F4, 0x00020000, &D_8014F4FC, 0x00020000, &D_8014F504, 0x00020000, - &D_8014F50C, 0x00020000, &D_8014F514, 0x00020000, &D_8014F51C, 0x00020000, &D_8014F524, 0x00020000, - &D_8014F52C, 0x00030000, &D_8014F538, 0x00020000, &D_8014F540, 0x00020000, &D_8014F548, 0x00030000, - &D_8014F554, 0x00020000, &D_8014F55C, 0x00020000, &D_8014F564, 0x00020000, &D_8014F56C, 0x00020000, - &D_8014F574, 0x00020000, &D_8014F57C, 0x00020000, &D_8014F584, 0x00020000, &D_8014F58C, 0x00020000, - &D_8014F594, 0x00020000, &D_8014F59C, 0x00020000, - }; +typedef struct AlternatingSoundSet { + /* 0x00 */ s32* sounds; + /* 0x04 */ s16 soundCount; + /* 0x06 */ s16 currentIndex; +} AlternatingSoundSet; // size = 0x08 + +AlternatingSoundSet D_8014F5A4[] = { + { + .sounds = D_8014F48C, + .soundCount = ARRAY_COUNT(D_8014F48C), + }, + { + .sounds = D_8014F494, + .soundCount = ARRAY_COUNT(D_8014F494), + }, + { + .sounds = D_8014F49C, + .soundCount = ARRAY_COUNT(D_8014F494), + }, + { + .sounds = D_8014F4A4, + .soundCount = ARRAY_COUNT(D_8014F4A4), + }, + { + .sounds = D_8014F4AC, + .soundCount = ARRAY_COUNT(D_8014F4AC), + }, + { + .sounds = D_8014F4B4, + .soundCount = ARRAY_COUNT(D_8014F4B4), + }, + { + .sounds = D_8014F4BC, + .soundCount = ARRAY_COUNT(D_8014F4BC), + }, + { + .sounds = D_8014F4C4, + .soundCount = ARRAY_COUNT(D_8014F4C4), + }, + { + .sounds = D_8014F4CC, + .soundCount = ARRAY_COUNT(D_8014F4CC), + }, + { + .sounds = D_8014F4D4, + .soundCount = ARRAY_COUNT(D_8014F4D4), + }, + { + .sounds = D_8014F4DC, + .soundCount = ARRAY_COUNT(D_8014F4DC), + }, + { + .sounds = D_8014F4E4, + .soundCount = ARRAY_COUNT(D_8014F4E4), + }, + { + .sounds = D_8014F4EC, + .soundCount = ARRAY_COUNT(D_8014F4EC), + }, + { + .sounds = D_8014F4F4, + .soundCount = ARRAY_COUNT(D_8014F4F4), + }, + { + .sounds = D_8014F4FC, + .soundCount = ARRAY_COUNT(D_8014F4FC), + }, + { + .sounds = D_8014F504, + .soundCount = ARRAY_COUNT(D_8014F504), + }, + { + .sounds = D_8014F50C, + .soundCount = ARRAY_COUNT(D_8014F50C), + }, + { + .sounds = D_8014F514, + .soundCount = ARRAY_COUNT(D_8014F514), + }, + { + .sounds = D_8014F51C, + .soundCount = ARRAY_COUNT(D_8014F51C), + }, + { + .sounds = D_8014F524, + .soundCount = ARRAY_COUNT(D_8014F524), + }, + { + .sounds = D_8014F52C, + .soundCount = ARRAY_COUNT(D_8014F52C), + }, + { + .sounds = D_8014F538, + .soundCount = ARRAY_COUNT(D_8014F538), + }, + { + .sounds = D_8014F540, + .soundCount = ARRAY_COUNT(D_8014F540), + + }, + { + .sounds = D_8014F548, + .soundCount = ARRAY_COUNT(D_8014F548), + + }, + { + .sounds = D_8014F554, + .soundCount = ARRAY_COUNT(D_8014F554), + }, + { + .sounds = D_8014F55C, + .soundCount = ARRAY_COUNT(D_8014F55C), + }, + { + .sounds = D_8014F564, + .soundCount = ARRAY_COUNT(D_8014F564), + }, + { + .sounds = D_8014F56C, + .soundCount = ARRAY_COUNT(D_8014F56C), + }, + { + .sounds = D_8014F574, + .soundCount = ARRAY_COUNT(D_8014F574), + }, + { + .sounds = D_8014F57C, + .soundCount = ARRAY_COUNT(D_8014F57C), + }, + { + .sounds = D_8014F584, + .soundCount = ARRAY_COUNT(D_8014F584), + }, + { + .sounds = D_8014F58C, + .soundCount = ARRAY_COUNT(D_8014F58C), + }, + { + .sounds = D_8014F594, + .soundCount = ARRAY_COUNT(D_8014F594), + }, + { + .sounds = D_8014F59C, + .soundCount = ARRAY_COUNT(D_8014F59C), + } +}; s32 D_8014F6B4[] = { 0x000001C1, 0x000001C2, 0x000001C3, 0x000001C4, 0x000001C5, 0x000001C6, 0x000001C7, 0x000001C8, 0x000001C9, 0x000001CA, 0x000001CB, 0x000001CC, 0x000020A3, 0x000020A4, 0x00000000, @@ -76,9 +231,35 @@ void sfx_reset_door_sounds(void) { D_80151308 = 0; } -INCLUDE_ASM(void, "DF950", sfx_clear_sounds); +void sfx_clear_sounds(void) { + bzero(&D_801598A0, sizeof(D_801598A0)); + bzero(&D_801599B8, sizeof(D_801599B8)); + D_80159AD0 = D_801598A0; + func_801497FC(0); + sfx_reset_door_sounds(); +} -INCLUDE_ASM(s32, "DF950", sfx_clear_env_sounds); +// name might be incorrect? +void sfx_clear_env_sounds(s16 playSounds) { + if (!gGameStatusPtr->isBattle) { + D_80159AD0 = D_801598A0; + } else { + D_80159AD0 = D_801599B8; + } + + if (playSounds) { + SoundInstance* sound = D_80159AD0; + s32 i; + + for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) { + if (sound->flags & 1) { + snd_start_sound_with_shift(sound->soundID, sound->volume, sound->pan, sound->pitchShift); + } + } + } else { + bzero(D_80159AD0, MAX_SOUND_INSTANCES * sizeof(SoundInstance)); + } +} INCLUDE_ASM(void, "DF950", sfx_update_looping_sound_params); @@ -91,24 +272,161 @@ s32 func_80149828(void) { return D_80159AD4; } -INCLUDE_ASM(s32, "DF950", sfx_stop_env_sounds); +void sfx_stop_env_sounds(void) { + SoundInstance* sound; + s32 i; -INCLUDE_ASM(s32, "DF950", sfx_get_env_sound_instance); + if (!gGameStatusPtr->isBattle) { + D_80159AD0 = D_801598A0; + } else { + D_80159AD0 = D_801599B8; + } -INCLUDE_ASM(s32, "DF950", sfx_play_sound_looping); + sound = D_80159AD0; + for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) { + if (sound->flags & 1) { + snd_stop_sound(sound->soundID); + } + } +} -INCLUDE_ASM(s32, "DF950", sfx_register_looping_sound_at_position); +SoundInstance* sfx_get_env_sound_instance(SoundID soundID) { + SoundInstance* sound = D_80159AD0; + s32 i; -INCLUDE_ASM(s32, "DF950", sfx_adjust_env_sound_pos, s32 soundID, s32 arg1, f32 arg2, f32 arg3, f32 arg4); + for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) { + if (sound->flags & 1 && sound->soundID == soundID) { + return sound; + } + } -INCLUDE_ASM(s32, "DF950", func_80149A6C); + return NULL; +} +void sfx_play_sound_looping(SoundID soundId, u8 volume, u8 pan, s16 pitchShift) { + SoundInstance* sound = D_80159AD0; + s32 i; + + for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) { + if (!(sound->flags & 1)) { + break; + } + } + + sound->pan = pan; + sound->soundID = soundId; + sound->volume = volume; + sound->pitchShift = pitchShift; + sound->flags |= 1; + + snd_start_sound_with_shift(soundId, volume, pan, pitchShift); +} + +void sfx_register_looping_sound_at_position(SoundID soundID, s32 flags, f32 x, f32 y, f32 z) { + SoundInstance* sound = D_80159AD0; + s32 i; + + for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) { + if (!(sound->flags & 1)) { + break; + } + } + + sound->sourceFlags = flags; + sound->position.x = x; + sound->position.y = y; + sound->position.z = z; + sound->soundID = soundID; + sound->flags |= 3; + + sfx_play_sound_at_position(soundID, flags, x, y, z); +} + +s32 sfx_adjust_env_sound_pos(SoundID soundID, s32 sourceFlags, f32 x, f32 y, f32 z) { + SoundInstance* sound = sfx_get_env_sound_instance(soundID); + + if (sound == NULL) { + return 0; + } + + sound->sourceFlags = sourceFlags; + sound->position.x = x; + sound->position.y = y; + sound->position.z = z; + sound->soundID = soundID; + sound->flags |= 3; + + return 1; +} + +void func_80149A6C(SoundID soundID, s32 keepPlaying) { + SoundInstance* sound = sfx_get_env_sound_instance(soundID); + + if (sound != NULL) { + sound->flags &= -4; + if (!keepPlaying) { + snd_stop_sound(sound->soundID); + } + } +} + +#ifdef NON_MATCHING // weird & 0xFF everywhere +void sfx_play_sound_with_params(SoundID soundID, u8 arg1, u8 arg2, s16 arg3) { + AlternatingSoundSet* alternatingSound; + + if (gGameStatusPtr->demoState) { + return; + } + + if (soundID < 0) { + SoundID sound = soundID & 0xFF; + switch ((soundID >> 0x1C) & 7) { + case 0: + sfx_play_sound_looping(D_8014F2D0[sound], arg1, arg2, arg3); + break; + case 1: + snd_start_sound_with_shift(D_8014F6B4[sound + ((u16)gCurrentDoorSoundsSet * 2)], arg1, arg2, arg3); + break; + case 2: + snd_start_sound_with_shift(D_8014F6B4[sound + ((u16)D_80151308 * 2)], arg1, arg2, arg3); + break; + case 3: + alternatingSound = &D_8014F5A4[sound]; + if (alternatingSound->currentIndex >= alternatingSound->soundCount) { + alternatingSound->currentIndex = 0; + } + snd_start_sound_with_shift(alternatingSound->sounds[alternatingSound->currentIndex++], arg1, arg2, arg3); + break; + default: + snd_start_sound_with_shift(soundID, arg1, arg2, arg3); + break; + } + } else { + snd_start_sound_with_shift(soundID, arg1, arg2, arg3); + } +} +#else INCLUDE_ASM(void, "DF950", sfx_play_sound_with_params, s32 arg0, u8 arg1, u8 arg2, s16 arg3); +#endif -INCLUDE_ASM(s32, "DF950", sfx_adjust_env_sound_params); +void sfx_adjust_env_sound_params(SoundID soundID, u8 volume, u8 pan, s16 pitchShift) { + SoundInstance* sound; + + if (soundID < 0) { + sound = sfx_get_env_sound_instance(D_8014F2D0[soundID & 0xFFFF]); + if (sound != NULL) { + sound->volume = volume; + sound->pan = pan; + sound->pitchShift = pitchShift; + } + } else { + snd_adjust_sound_with_shift(soundID, volume, pan, pitchShift); + } +} + +void sfx_stop_sound(SoundID soundID) { + SoundID sound = soundID; -void sfx_stop_sound(SongID soundID) { - SongID sound = soundID; if (sound < 0) { func_80149A6C(D_8014F2D0[sound & 0xFFFF], 0); } else { @@ -116,17 +434,17 @@ void sfx_stop_sound(SongID soundID) { } } -void sfx_play_sound(s32 soundID) { +void sfx_play_sound(SoundID soundID) { sfx_play_sound_with_params(soundID, 0, 0, 0); } -void sfx_play_sound_at_player(s32 soundID, s32 arg1) { +void sfx_play_sound_at_player(SoundID soundID, s32 arg1) { PlayerStatus* playerStatus = &gPlayerStatus; sfx_play_sound_at_position(soundID, arg1, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); } -void sfx_play_sound_at_npc(s32 soundID, s32 arg1, s32 npcID) { +void sfx_play_sound_at_npc(SoundID soundID, s32 arg1, s32 npcID) { Npc* npc = get_npc_safe(npcID); if (npc != NULL) { @@ -134,7 +452,7 @@ void sfx_play_sound_at_npc(s32 soundID, s32 arg1, s32 npcID) { } } -INCLUDE_ASM(s32, "DF950", sfx_play_sound_at_position, s32 soundID, s32 value2, f32 posX, f32 posY, +INCLUDE_ASM(s32, "DF950", sfx_play_sound_at_position, SoundID soundID, s32 value2, f32 posX, f32 posY, f32 posZ); INCLUDE_ASM(void, "DF950", sfx_get_spatialized_sound_params, f32 arg0, f32 arg1, f32 arg2, s16* arg3, s16* arg4, diff --git a/ver/us/asm/nonmatchings/DF950/func_80149A6C.s b/ver/us/asm/nonmatchings/DF950/func_80149A6C.s deleted file mode 100644 index cf9f9210a7..0000000000 --- a/ver/us/asm/nonmatchings/DF950/func_80149A6C.s +++ /dev/null @@ -1,24 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80149A6C -/* E016C 80149A6C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* E0170 80149A70 AFB00010 */ sw $s0, 0x10($sp) -/* E0174 80149A74 AFBF0014 */ sw $ra, 0x14($sp) -/* E0178 80149A78 0C052631 */ jal sfx_get_env_sound_instance -/* E017C 80149A7C 00A0802D */ daddu $s0, $a1, $zero -/* E0180 80149A80 0040202D */ daddu $a0, $v0, $zero -/* E0184 80149A84 10800008 */ beqz $a0, .L80149AA8 -/* E0188 80149A88 2403FFFC */ addiu $v1, $zero, -4 -/* E018C 80149A8C 8C820000 */ lw $v0, ($a0) -/* E0190 80149A90 00431024 */ and $v0, $v0, $v1 -/* E0194 80149A94 16000004 */ bnez $s0, .L80149AA8 -/* E0198 80149A98 AC820000 */ sw $v0, ($a0) -/* E019C 80149A9C 8C840004 */ lw $a0, 4($a0) -/* E01A0 80149AA0 0C0154F0 */ jal snd_stop_sound -/* E01A4 80149AA4 00000000 */ nop -.L80149AA8: -/* E01A8 80149AA8 8FBF0014 */ lw $ra, 0x14($sp) -/* E01AC 80149AAC 8FB00010 */ lw $s0, 0x10($sp) -/* E01B0 80149AB0 03E00008 */ jr $ra -/* E01B4 80149AB4 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/DF950/sfx_adjust_env_sound_params.s b/ver/us/asm/nonmatchings/DF950/sfx_adjust_env_sound_params.s deleted file mode 100644 index 16796a6fb7..0000000000 --- a/ver/us/asm/nonmatchings/DF950/sfx_adjust_env_sound_params.s +++ /dev/null @@ -1,40 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel sfx_adjust_env_sound_params -/* E02E4 80149BE4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E02E8 80149BE8 AFB00010 */ sw $s0, 0x10($sp) -/* E02EC 80149BEC 00A0802D */ daddu $s0, $a1, $zero -/* E02F0 80149BF0 AFB10014 */ sw $s1, 0x14($sp) -/* E02F4 80149BF4 00C0882D */ daddu $s1, $a2, $zero -/* E02F8 80149BF8 AFB20018 */ sw $s2, 0x18($sp) -/* E02FC 80149BFC 00E0902D */ daddu $s2, $a3, $zero -/* E0300 80149C00 0200282D */ daddu $a1, $s0, $zero -/* E0304 80149C04 0220302D */ daddu $a2, $s1, $zero -/* E0308 80149C08 0481000D */ bgez $a0, .L80149C40 -/* E030C 80149C0C AFBF001C */ sw $ra, 0x1c($sp) -/* E0310 80149C10 3082FFFF */ andi $v0, $a0, 0xffff -/* E0314 80149C14 00021080 */ sll $v0, $v0, 2 -/* E0318 80149C18 3C048015 */ lui $a0, %hi(D_8014F2D0) -/* E031C 80149C1C 00822021 */ addu $a0, $a0, $v0 -/* E0320 80149C20 0C052631 */ jal sfx_get_env_sound_instance -/* E0324 80149C24 8C84F2D0 */ lw $a0, %lo(D_8014F2D0)($a0) -/* E0328 80149C28 1040000A */ beqz $v0, .L80149C54 -/* E032C 80149C2C 00000000 */ nop -/* E0330 80149C30 A050000C */ sb $s0, 0xc($v0) -/* E0334 80149C34 A051000D */ sb $s1, 0xd($v0) -/* E0338 80149C38 08052715 */ j .L80149C54 -/* E033C 80149C3C A452000E */ sh $s2, 0xe($v0) -.L80149C40: -/* E0340 80149C40 00123C00 */ sll $a3, $s2, 0x10 -/* E0344 80149C44 30A500FF */ andi $a1, $a1, 0xff -/* E0348 80149C48 30C600FF */ andi $a2, $a2, 0xff -/* E034C 80149C4C 0C0154CC */ jal snd_adjust_sound_with_shift -/* E0350 80149C50 00073C03 */ sra $a3, $a3, 0x10 -.L80149C54: -/* E0354 80149C54 8FBF001C */ lw $ra, 0x1c($sp) -/* E0358 80149C58 8FB20018 */ lw $s2, 0x18($sp) -/* E035C 80149C5C 8FB10014 */ lw $s1, 0x14($sp) -/* E0360 80149C60 8FB00010 */ lw $s0, 0x10($sp) -/* E0364 80149C64 03E00008 */ jr $ra -/* E0368 80149C68 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/DF950/sfx_adjust_env_sound_pos.s b/ver/us/asm/nonmatchings/DF950/sfx_adjust_env_sound_pos.s deleted file mode 100644 index 24fc476e74..0000000000 --- a/ver/us/asm/nonmatchings/DF950/sfx_adjust_env_sound_pos.s +++ /dev/null @@ -1,38 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel sfx_adjust_env_sound_pos -/* E00EC 801499EC 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* E00F0 801499F0 F7B40020 */ sdc1 $f20, 0x20($sp) -/* E00F4 801499F4 4486A000 */ mtc1 $a2, $f20 -/* E00F8 801499F8 AFB00010 */ sw $s0, 0x10($sp) -/* E00FC 801499FC 0080802D */ daddu $s0, $a0, $zero -/* E0100 80149A00 AFB10014 */ sw $s1, 0x14($sp) -/* E0104 80149A04 F7B60028 */ sdc1 $f22, 0x28($sp) -/* E0108 80149A08 4487B000 */ mtc1 $a3, $f22 -/* E010C 80149A0C AFBF0018 */ sw $ra, 0x18($sp) -/* E0110 80149A10 0C052631 */ jal sfx_get_env_sound_instance -/* E0114 80149A14 00A0882D */ daddu $s1, $a1, $zero -/* E0118 80149A18 0040202D */ daddu $a0, $v0, $zero -/* E011C 80149A1C 1080000B */ beqz $a0, .L80149A4C -/* E0120 80149A20 24020001 */ addiu $v0, $zero, 1 -/* E0124 80149A24 8C830000 */ lw $v1, ($a0) -/* E0128 80149A28 AC910008 */ sw $s1, 8($a0) -/* E012C 80149A2C E4940010 */ swc1 $f20, 0x10($a0) -/* E0130 80149A30 E4960014 */ swc1 $f22, 0x14($a0) -/* E0134 80149A34 C7A00040 */ lwc1 $f0, 0x40($sp) -/* E0138 80149A38 AC900004 */ sw $s0, 4($a0) -/* E013C 80149A3C 34630003 */ ori $v1, $v1, 3 -/* E0140 80149A40 E4800018 */ swc1 $f0, 0x18($a0) -/* E0144 80149A44 08052694 */ j .L80149A50 -/* E0148 80149A48 AC830000 */ sw $v1, ($a0) -.L80149A4C: -/* E014C 80149A4C 0000102D */ daddu $v0, $zero, $zero -.L80149A50: -/* E0150 80149A50 8FBF0018 */ lw $ra, 0x18($sp) -/* E0154 80149A54 8FB10014 */ lw $s1, 0x14($sp) -/* E0158 80149A58 8FB00010 */ lw $s0, 0x10($sp) -/* E015C 80149A5C D7B60028 */ ldc1 $f22, 0x28($sp) -/* E0160 80149A60 D7B40020 */ ldc1 $f20, 0x20($sp) -/* E0164 80149A64 03E00008 */ jr $ra -/* E0168 80149A68 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/ver/us/asm/nonmatchings/DF950/sfx_clear_env_sounds.s b/ver/us/asm/nonmatchings/DF950/sfx_clear_env_sounds.s deleted file mode 100644 index 21358712fe..0000000000 --- a/ver/us/asm/nonmatchings/DF950/sfx_clear_env_sounds.s +++ /dev/null @@ -1,59 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel sfx_clear_env_sounds -/* DFD70 80149670 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* DFD74 80149674 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* DFD78 80149678 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* DFD7C 8014967C AFBF001C */ sw $ra, 0x1c($sp) -/* DFD80 80149680 AFB20018 */ sw $s2, 0x18($sp) -/* DFD84 80149684 AFB10014 */ sw $s1, 0x14($sp) -/* DFD88 80149688 AFB00010 */ sw $s0, 0x10($sp) -/* DFD8C 8014968C 80420070 */ lb $v0, 0x70($v0) -/* DFD90 80149690 14400005 */ bnez $v0, .L801496A8 -/* DFD94 80149694 00000000 */ nop -/* DFD98 80149698 3C028016 */ lui $v0, %hi(D_801598A0) -/* DFD9C 8014969C 244298A0 */ addiu $v0, $v0, %lo(D_801598A0) -/* DFDA0 801496A0 080525AC */ j .L801496B0 -/* DFDA4 801496A4 00000000 */ nop -.L801496A8: -/* DFDA8 801496A8 3C028016 */ lui $v0, %hi(D_801599B8) -/* DFDAC 801496AC 244299B8 */ addiu $v0, $v0, %lo(D_801599B8) -.L801496B0: -/* DFDB0 801496B0 3C018016 */ lui $at, %hi(D_80159AD0) -/* DFDB4 801496B4 AC229AD0 */ sw $v0, %lo(D_80159AD0)($at) -/* DFDB8 801496B8 00041400 */ sll $v0, $a0, 0x10 -/* DFDBC 801496BC 10400013 */ beqz $v0, .L8014970C -/* DFDC0 801496C0 0000902D */ daddu $s2, $zero, $zero -/* DFDC4 801496C4 3C118016 */ lui $s1, %hi(D_80159AD0) -/* DFDC8 801496C8 8E319AD0 */ lw $s1, %lo(D_80159AD0)($s1) -/* DFDCC 801496CC 26300004 */ addiu $s0, $s1, 4 -.L801496D0: -/* DFDD0 801496D0 8E220000 */ lw $v0, ($s1) -/* DFDD4 801496D4 30420001 */ andi $v0, $v0, 1 -/* DFDD8 801496D8 10400006 */ beqz $v0, .L801496F4 -/* DFDDC 801496DC 26520001 */ addiu $s2, $s2, 1 -/* DFDE0 801496E0 8E040000 */ lw $a0, ($s0) -/* DFDE4 801496E4 92050008 */ lbu $a1, 8($s0) -/* DFDE8 801496E8 92060009 */ lbu $a2, 9($s0) -/* DFDEC 801496EC 0C015490 */ jal snd_start_sound_with_shift -/* DFDF0 801496F0 8607000A */ lh $a3, 0xa($s0) -.L801496F4: -/* DFDF4 801496F4 2610001C */ addiu $s0, $s0, 0x1c -/* DFDF8 801496F8 2A42000A */ slti $v0, $s2, 0xa -/* DFDFC 801496FC 1440FFF4 */ bnez $v0, .L801496D0 -/* DFE00 80149700 2631001C */ addiu $s1, $s1, 0x1c -/* DFE04 80149704 080525C7 */ j .L8014971C -/* DFE08 80149708 00000000 */ nop -.L8014970C: -/* DFE0C 8014970C 3C048016 */ lui $a0, %hi(D_80159AD0) -/* DFE10 80149710 8C849AD0 */ lw $a0, %lo(D_80159AD0)($a0) -/* DFE14 80149714 0C01925C */ jal bzero -/* DFE18 80149718 24050118 */ addiu $a1, $zero, 0x118 -.L8014971C: -/* DFE1C 8014971C 8FBF001C */ lw $ra, 0x1c($sp) -/* DFE20 80149720 8FB20018 */ lw $s2, 0x18($sp) -/* DFE24 80149724 8FB10014 */ lw $s1, 0x14($sp) -/* DFE28 80149728 8FB00010 */ lw $s0, 0x10($sp) -/* DFE2C 8014972C 03E00008 */ jr $ra -/* DFE30 80149730 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/DF950/sfx_clear_sounds.s b/ver/us/asm/nonmatchings/DF950/sfx_clear_sounds.s deleted file mode 100644 index 982d581408..0000000000 --- a/ver/us/asm/nonmatchings/DF950/sfx_clear_sounds.s +++ /dev/null @@ -1,26 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel sfx_clear_sounds -/* DFD18 80149618 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* DFD1C 8014961C AFB00010 */ sw $s0, 0x10($sp) -/* DFD20 80149620 3C108016 */ lui $s0, %hi(D_801598A0) -/* DFD24 80149624 261098A0 */ addiu $s0, $s0, %lo(D_801598A0) -/* DFD28 80149628 0200202D */ daddu $a0, $s0, $zero -/* DFD2C 8014962C AFBF0014 */ sw $ra, 0x14($sp) -/* DFD30 80149630 0C01925C */ jal bzero -/* DFD34 80149634 24050118 */ addiu $a1, $zero, 0x118 -/* DFD38 80149638 3C048016 */ lui $a0, %hi(D_801599B8) -/* DFD3C 8014963C 248499B8 */ addiu $a0, $a0, %lo(D_801599B8) -/* DFD40 80149640 0C01925C */ jal bzero -/* DFD44 80149644 24050118 */ addiu $a1, $zero, 0x118 -/* DFD48 80149648 3C018016 */ lui $at, %hi(D_80159AD0) -/* DFD4C 8014964C AC309AD0 */ sw $s0, %lo(D_80159AD0)($at) -/* DFD50 80149650 0C0525FF */ jal func_801497FC -/* DFD54 80149654 0000202D */ daddu $a0, $zero, $zero -/* DFD58 80149658 0C052580 */ jal sfx_reset_door_sounds -/* DFD5C 8014965C 00000000 */ nop -/* DFD60 80149660 8FBF0014 */ lw $ra, 0x14($sp) -/* DFD64 80149664 8FB00010 */ lw $s0, 0x10($sp) -/* DFD68 80149668 03E00008 */ jr $ra -/* DFD6C 8014966C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/DF950/sfx_get_env_sound_instance.s b/ver/us/asm/nonmatchings/DF950/sfx_get_env_sound_instance.s deleted file mode 100644 index b3c9d1836a..0000000000 --- a/ver/us/asm/nonmatchings/DF950/sfx_get_env_sound_instance.s +++ /dev/null @@ -1,24 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel sfx_get_env_sound_instance -/* DFFC4 801498C4 3C038016 */ lui $v1, %hi(D_80159AD0) -/* DFFC8 801498C8 8C639AD0 */ lw $v1, %lo(D_80159AD0)($v1) -/* DFFCC 801498CC 0000282D */ daddu $a1, $zero, $zero -.L801498D0: -/* DFFD0 801498D0 8C620000 */ lw $v0, ($v1) -/* DFFD4 801498D4 30420001 */ andi $v0, $v0, 1 -/* DFFD8 801498D8 10400006 */ beqz $v0, .L801498F4 -/* DFFDC 801498DC 24A50001 */ addiu $a1, $a1, 1 -/* DFFE0 801498E0 8C620004 */ lw $v0, 4($v1) -/* DFFE4 801498E4 14440004 */ bne $v0, $a0, .L801498F8 -/* DFFE8 801498E8 28A2000A */ slti $v0, $a1, 0xa -/* DFFEC 801498EC 03E00008 */ jr $ra -/* DFFF0 801498F0 0060102D */ daddu $v0, $v1, $zero -.L801498F4: -/* DFFF4 801498F4 28A2000A */ slti $v0, $a1, 0xa -.L801498F8: -/* DFFF8 801498F8 1440FFF5 */ bnez $v0, .L801498D0 -/* DFFFC 801498FC 2463001C */ addiu $v1, $v1, 0x1c -/* E0000 80149900 03E00008 */ jr $ra -/* E0004 80149904 0000102D */ daddu $v0, $zero, $zero diff --git a/ver/us/asm/nonmatchings/DF950/sfx_play_sound_looping.s b/ver/us/asm/nonmatchings/DF950/sfx_play_sound_looping.s deleted file mode 100644 index 2c3ab346d9..0000000000 --- a/ver/us/asm/nonmatchings/DF950/sfx_play_sound_looping.s +++ /dev/null @@ -1,33 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel sfx_play_sound_looping -/* E0008 80149908 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* E000C 8014990C 3C038016 */ lui $v1, %hi(D_80159AD0) -/* E0010 80149910 8C639AD0 */ lw $v1, %lo(D_80159AD0)($v1) -/* E0014 80149914 0000402D */ daddu $t0, $zero, $zero -/* E0018 80149918 AFBF0010 */ sw $ra, 0x10($sp) -.L8014991C: -/* E001C 8014991C 8C620000 */ lw $v0, ($v1) -/* E0020 80149920 30420001 */ andi $v0, $v0, 1 -/* E0024 80149924 10400004 */ beqz $v0, .L80149938 -/* E0028 80149928 25080001 */ addiu $t0, $t0, 1 -/* E002C 8014992C 2902000A */ slti $v0, $t0, 0xa -/* E0030 80149930 1440FFFA */ bnez $v0, .L8014991C -/* E0034 80149934 2463001C */ addiu $v1, $v1, 0x1c -.L80149938: -/* E0038 80149938 A467000E */ sh $a3, 0xe($v1) -/* E003C 8014993C 00073C00 */ sll $a3, $a3, 0x10 -/* E0040 80149940 A065000C */ sb $a1, 0xc($v1) -/* E0044 80149944 30A500FF */ andi $a1, $a1, 0xff -/* E0048 80149948 A066000D */ sb $a2, 0xd($v1) -/* E004C 8014994C 30C600FF */ andi $a2, $a2, 0xff -/* E0050 80149950 8C620000 */ lw $v0, ($v1) -/* E0054 80149954 00073C03 */ sra $a3, $a3, 0x10 -/* E0058 80149958 AC640004 */ sw $a0, 4($v1) -/* E005C 8014995C 34420001 */ ori $v0, $v0, 1 -/* E0060 80149960 0C015490 */ jal snd_start_sound_with_shift -/* E0064 80149964 AC620000 */ sw $v0, ($v1) -/* E0068 80149968 8FBF0010 */ lw $ra, 0x10($sp) -/* E006C 8014996C 03E00008 */ jr $ra -/* E0070 80149970 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/DF950/sfx_register_looping_sound_at_position.s b/ver/us/asm/nonmatchings/DF950/sfx_register_looping_sound_at_position.s deleted file mode 100644 index 635c72854d..0000000000 --- a/ver/us/asm/nonmatchings/DF950/sfx_register_looping_sound_at_position.s +++ /dev/null @@ -1,36 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel sfx_register_looping_sound_at_position -/* E0074 80149974 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E0078 80149978 44861000 */ mtc1 $a2, $f2 -/* E007C 8014997C 44872000 */ mtc1 $a3, $f4 -/* E0080 80149980 C7A00030 */ lwc1 $f0, 0x30($sp) -/* E0084 80149984 3C038016 */ lui $v1, %hi(D_80159AD0) -/* E0088 80149988 8C639AD0 */ lw $v1, %lo(D_80159AD0)($v1) -/* E008C 8014998C 0000302D */ daddu $a2, $zero, $zero -/* E0090 80149990 AFBF0018 */ sw $ra, 0x18($sp) -.L80149994: -/* E0094 80149994 8C620000 */ lw $v0, ($v1) -/* E0098 80149998 30420001 */ andi $v0, $v0, 1 -/* E009C 8014999C 10400004 */ beqz $v0, .L801499B0 -/* E00A0 801499A0 24C60001 */ addiu $a2, $a2, 1 -/* E00A4 801499A4 28C2000A */ slti $v0, $a2, 0xa -/* E00A8 801499A8 1440FFFA */ bnez $v0, .L80149994 -/* E00AC 801499AC 2463001C */ addiu $v1, $v1, 0x1c -.L801499B0: -/* E00B0 801499B0 8C620000 */ lw $v0, ($v1) -/* E00B4 801499B4 44061000 */ mfc1 $a2, $f2 -/* E00B8 801499B8 44072000 */ mfc1 $a3, $f4 -/* E00BC 801499BC AC650008 */ sw $a1, 8($v1) -/* E00C0 801499C0 E4620010 */ swc1 $f2, 0x10($v1) -/* E00C4 801499C4 E4640014 */ swc1 $f4, 0x14($v1) -/* E00C8 801499C8 E4600018 */ swc1 $f0, 0x18($v1) -/* E00CC 801499CC AC640004 */ sw $a0, 4($v1) -/* E00D0 801499D0 34420003 */ ori $v0, $v0, 3 -/* E00D4 801499D4 AC620000 */ sw $v0, ($v1) -/* E00D8 801499D8 0C052757 */ jal sfx_play_sound_at_position -/* E00DC 801499DC E7A00010 */ swc1 $f0, 0x10($sp) -/* E00E0 801499E0 8FBF0018 */ lw $ra, 0x18($sp) -/* E00E4 801499E4 03E00008 */ jr $ra -/* E00E8 801499E8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/ver/us/asm/nonmatchings/DF950/sfx_stop_env_sounds.s b/ver/us/asm/nonmatchings/DF950/sfx_stop_env_sounds.s deleted file mode 100644 index 9b6d7e710a..0000000000 --- a/ver/us/asm/nonmatchings/DF950/sfx_stop_env_sounds.s +++ /dev/null @@ -1,43 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel sfx_stop_env_sounds -/* DFF38 80149838 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* DFF3C 8014983C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* DFF40 80149840 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* DFF44 80149844 AFBF0018 */ sw $ra, 0x18($sp) -/* DFF48 80149848 AFB10014 */ sw $s1, 0x14($sp) -/* DFF4C 8014984C AFB00010 */ sw $s0, 0x10($sp) -/* DFF50 80149850 80420070 */ lb $v0, 0x70($v0) -/* DFF54 80149854 14400005 */ bnez $v0, .L8014986C -/* DFF58 80149858 00000000 */ nop -/* DFF5C 8014985C 3C028016 */ lui $v0, %hi(D_801598A0) -/* DFF60 80149860 244298A0 */ addiu $v0, $v0, %lo(D_801598A0) -/* DFF64 80149864 0805261D */ j .L80149874 -/* DFF68 80149868 00000000 */ nop -.L8014986C: -/* DFF6C 8014986C 3C028016 */ lui $v0, %hi(D_801599B8) -/* DFF70 80149870 244299B8 */ addiu $v0, $v0, %lo(D_801599B8) -.L80149874: -/* DFF74 80149874 3C018016 */ lui $at, %hi(D_80159AD0) -/* DFF78 80149878 AC229AD0 */ sw $v0, %lo(D_80159AD0)($at) -/* DFF7C 8014987C 3C108016 */ lui $s0, %hi(D_80159AD0) -/* DFF80 80149880 8E109AD0 */ lw $s0, %lo(D_80159AD0)($s0) -/* DFF84 80149884 0000882D */ daddu $s1, $zero, $zero -.L80149888: -/* DFF88 80149888 8E020000 */ lw $v0, ($s0) -/* DFF8C 8014988C 30420001 */ andi $v0, $v0, 1 -/* DFF90 80149890 10400004 */ beqz $v0, .L801498A4 -/* DFF94 80149894 26310001 */ addiu $s1, $s1, 1 -/* DFF98 80149898 8E040004 */ lw $a0, 4($s0) -/* DFF9C 8014989C 0C0154F0 */ jal snd_stop_sound -/* DFFA0 801498A0 00000000 */ nop -.L801498A4: -/* DFFA4 801498A4 2A22000A */ slti $v0, $s1, 0xa -/* DFFA8 801498A8 1440FFF7 */ bnez $v0, .L80149888 -/* DFFAC 801498AC 2610001C */ addiu $s0, $s0, 0x1c -/* DFFB0 801498B0 8FBF0018 */ lw $ra, 0x18($sp) -/* DFFB4 801498B4 8FB10014 */ lw $s1, 0x14($sp) -/* DFFB8 801498B8 8FB00010 */ lw $s0, 0x10($sp) -/* DFFBC 801498BC 03E00008 */ jr $ra -/* DFFC0 801498C0 27BD0020 */ addiu $sp, $sp, 0x20