Merge branch 'master' into feature/make-rom-buffer-const
This commit is contained in:
+4
-2
@@ -146,7 +146,7 @@ SM64_LIB_FN void sm64_audio_init( const uint8_t *rom ) {
|
|||||||
#define SAMPLES_LOW 528
|
#define SAMPLES_LOW 528
|
||||||
|
|
||||||
extern SM64_LIB_FN uint32_t sm64_audio_tick( uint32_t numQueuedSamples, uint32_t numDesiredSamples, int16_t *audio_buffer ) {
|
extern SM64_LIB_FN uint32_t sm64_audio_tick( uint32_t numQueuedSamples, uint32_t numDesiredSamples, int16_t *audio_buffer ) {
|
||||||
if ( !is_audio_initialized ) {
|
if ( !g_is_audio_initialized ) {
|
||||||
DEBUG_PRINT("Attempted to tick audio, but sm64_audio_init() has not been called yet.");
|
DEBUG_PRINT("Attempted to tick audio, but sm64_audio_init() has not been called yet.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,9 @@ SM64_LIB_FN void sm64_mario_delete( int32_t marioId )
|
|||||||
struct GlobalState *globalState = ((struct MarioInstance *)s_mario_instance_pool.objects[ marioId ])->globalState;
|
struct GlobalState *globalState = ((struct MarioInstance *)s_mario_instance_pool.objects[ marioId ])->globalState;
|
||||||
global_state_bind( globalState );
|
global_state_bind( globalState );
|
||||||
|
|
||||||
stop_sound(SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject);
|
if ( g_is_audio_initialized ) {
|
||||||
|
stop_sound(SOUND_MARIO_SNORING3, gMarioState->marioObj->header.gfx.cameraToObject);
|
||||||
|
}
|
||||||
|
|
||||||
free( gMarioObject );
|
free( gMarioObject );
|
||||||
free_area( gCurrentArea );
|
free_area( gCurrentArea );
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "decomp/audio/load.h"
|
#include "decomp/audio/load.h"
|
||||||
#include "decomp/audio/load_dat.h"
|
#include "decomp/audio/load_dat.h"
|
||||||
|
|
||||||
bool is_audio_initialized = false;
|
bool g_is_audio_initialized = false;
|
||||||
|
|
||||||
extern void load_audio_banks( const uint8_t *rom ) {
|
extern void load_audio_banks( const uint8_t *rom ) {
|
||||||
// FIXME: rom_copy purposfully leaks here
|
// FIXME: rom_copy purposfully leaks here
|
||||||
@@ -24,5 +24,5 @@ extern void load_audio_banks( const uint8_t *rom ) {
|
|||||||
sound_init();
|
sound_init();
|
||||||
sound_reset( 0 );
|
sound_reset( 0 );
|
||||||
|
|
||||||
is_audio_initialized = true;
|
g_is_audio_initialized = true;
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern bool is_audio_initialized;
|
extern bool g_is_audio_initialized;
|
||||||
|
|
||||||
extern void load_audio_banks( const uint8_t *rom );
|
extern void load_audio_banks( const uint8_t *rom );
|
||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
SM64PlaySoundFunctionPtr g_play_sound_func = NULL;
|
SM64PlaySoundFunctionPtr g_play_sound_func = NULL;
|
||||||
|
|
||||||
extern void play_sound( uint32_t soundBits, f32 *pos ) {
|
extern void play_sound( uint32_t soundBits, f32 *pos ) {
|
||||||
if ( is_audio_initialized ) {
|
if ( g_is_audio_initialized ) {
|
||||||
DEBUG_PRINT("$ play_sound(%d) request %d; pos %f %f %f\n", soundBits,sSoundRequestCount,pos[0],pos[1],pos[2]);
|
DEBUG_PRINT("$ play_sound(%d) request %d; pos %f %f %f\n", soundBits,sSoundRequestCount,pos[0],pos[1],pos[2]);
|
||||||
sSoundRequests[sSoundRequestCount].soundBits = soundBits;
|
sSoundRequests[sSoundRequestCount].soundBits = soundBits;
|
||||||
sSoundRequests[sSoundRequestCount].position = pos;
|
sSoundRequests[sSoundRequestCount].position = pos;
|
||||||
|
|||||||
Reference in New Issue
Block a user