Skip to content

Commit

Permalink
Merge pull request #85 from JCog/warp-sounds
Browse files Browse the repository at this point in the history
Stop all ambient sounds/looping sfx when warping
  • Loading branch information
JCog authored Sep 24, 2024
2 parents 7a2935d + 3535673 commit 9b525a1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
5 changes: 3 additions & 2 deletions lib/libpm-jp.a
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pm_gAreas = 0x800934C0;
pm_viFrames = 0x80093B64;
pm_timeFreezeMode = 0x8009A5B8;
pm_gameState = 0x8009A5E0;
pm_gSoundManager = 0x8009A620;
nuGfxCfb_ptr = 0x8009A62C;
pm_masterGfxPos = 0x8009A64C;
pm_logicalSaveInfo = 0x8009BA10;
Expand Down Expand Up @@ -47,7 +48,8 @@ pm_setCurtainDrawCallback = 0x8002BEC4;
pm_setCurtainFadeGoal = 0x8002BED4;
pm_setGameMode = 0x80033180;
pm_get_npc_safe = 0x8003A808;
pm_func_800554A4 = 0x80055154;
pm_au_sfx_reset_players = 0x8004D168;
pm_snd_ambient_stop_all = 0x8005547C;
pm_removeEffect = 0x8005A100;
nuPiReadRom = 0x8005F140;
__osPiGetAccess = 0x80061474;
Expand Down Expand Up @@ -75,7 +77,6 @@ pm_setMapTransitionEffect = 0x8013D350;
pm_updateExitMapScreenOverlay = 0x8013D35C;
pm_clearWindows = 0x8014C4A0;
pm_playSfx = 0x8014ED64;
pm_sfxStopSound = 0x8014ED1C;
pm_bgmSetSong = 0x8014F9C8;
pm_useIdleAnimation = 0x8026F26C;
pm_gotoMap = 0x802CA400;
Expand Down
5 changes: 3 additions & 2 deletions lib/libpm-us.a
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pm_gAreas = 0x800934F0;
pm_viFrames = 0x80093B94;
pm_timeFreezeMode = 0x8009A5D8;
pm_gameState = 0x8009A600;
pm_gSoundManager = 0x8009A640;
nuGfxCfb_ptr = 0x8009A64C;
pm_masterGfxPos = 0x8009A66C;
pm_logicalSaveInfo = 0x8009BA30;
Expand Down Expand Up @@ -47,7 +48,8 @@ pm_update_cameras = 0x8002D400;
pm_update_camera_zone_interp = 0x80031494;
pm_setGameMode = 0x800334F0;
pm_get_npc_safe = 0x8003AB48;
pm_func_800554A4 = 0x800554A4;
pm_au_sfx_reset_players = 0x8004D4BC;
pm_snd_ambient_stop_all = 0x800557CC;
pm_removeEffect = 0x8005A450;
nuPiReadRom = 0x8005F490;
__osPiGetAccess = 0x800614A4;
Expand Down Expand Up @@ -75,7 +77,6 @@ pm_setMapTransitionEffect = 0x801382A0;
pm_updateExitMapScreenOverlay = 0x801382AC;
pm_clearWindows = 0x801473F0;
pm_playSfx = 0x80149CB4;
pm_sfxStopSound = 0x80149C6C;
pm_bgmSetSong = 0x8014A918;
pm_useIdleAnimation = 0x8026F0EC;
pm_gotoMap = 0x802CA400;
Expand Down
9 changes: 2 additions & 7 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,9 @@ void fpSetInputMask(u16 pad, u8 x, u8 y) {
}

bool fpWarp(enum Areas area, u16 map, u16 entrance) {
pm_func_800554A4(0); // stop koopa village radio from playing
pm_func_800554A4(1);
pm_func_800554A4(2);
pm_func_800554A4(3);
pm_bgmSetSong(1, -1, 0, 0, 8); // clear secondary songs
pm_sfxStopSound(0xA5); // clear Goomba King's Castle rumble
pm_sfxStopSound(0x19C); // clear upward vine sound
pm_sfxStopSound(0x19D); // clear downward vine sound
pm_snd_ambient_stop_all(0);
pm_au_sfx_reset_players(pm_gSoundManager);
pm_disable_player_input();
pm_gGameStatus.loadingZoneTangent = 0;
pm_gGameStatus.areaID = area;
Expand Down
5 changes: 3 additions & 2 deletions src/pm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,7 @@ extern_data pm_Area pm_gAreas[29];
extern_data u32 pm_viFrames;
extern_data s32 pm_timeFreezeMode;
extern_data s32 pm_gameState;
extern_data void *pm_gSoundManager;
extern_data u16 *nuGfxCfb_ptr;
extern_data Gfx *pm_masterGfxPos;
extern_data s32 pm_logicalSaveInfo[4][2];
Expand Down Expand Up @@ -1256,7 +1257,8 @@ void pm_update_cameras(void);
void pm_update_camera_zone_interp(pm_Camera *camera);
void pm_setGameMode(s32 mode);
pm_Npc *pm_get_npc_safe(s32 npcID);
s32 pm_func_800554A4(s32);
void pm_au_sfx_reset_players(void *soundManager);
void pm_snd_ambient_stop_all(s32 time);
void pm_removeEffect(pm_EffectInstance *effect);
void nuPiReadRom(u32 rom_addr, void *buf_ptr, u32 size);
void osWritebackDCacheAll(void);
Expand All @@ -1276,7 +1278,6 @@ s32 pm_setMapTransitionEffect(s32 transition);
s32 pm_updateExitMapScreenOverlay(s16 *progress);
void pm_clearWindows(void);
void pm_playSfx(s32 sound_id);
void pm_sfxStopSound(s32 sound_id);
void pm_bgmSetSong(s32 player_index, s32 song_id, s32 variation, s32 fade_out_time, s16 volume);
pm_ApiStatus pm_useIdleAnimation(pm_Evt *script, s32 isInitialCall);
pm_ApiStatus pm_gotoMap(pm_Evt *script, s32 isInitialCall);
Expand Down

0 comments on commit 9b525a1

Please sign in to comment.