Renamed sAudioEnabled to gAudioEnabled

This commit is contained in:
Mr-Wiseguy
2021-12-21 23:45:40 -05:00
committed by Mr-Wiseguy
parent ccea32c26d
commit eb2211948d
3 changed files with 9 additions and 9 deletions

View File

@@ -7,6 +7,7 @@
#include "external.h"
#include "playback.h"
#include "synthesis.h"
#include "game/main.h"
#include "game/level_update.h"
#include "game/object_list_processor.h"
#include "game/camera.h"
@@ -579,8 +580,6 @@ void func_eu_802e9bec(s32 player, s32 channel, s32 arg2) {
#else
extern s8 sAudioEnabled;
/**
* Called from threads: thread4_sound
*/
@@ -651,7 +650,7 @@ struct SPTask *create_next_audio_frame_task(void) {
// For the function to match we have to preserve some arbitrary variable
// across this function call.
flags = 0;
if (sAudioEnabled)
if (gAudioEnabled)
{
gAudioCmd = synthesis_execute(gAudioCmd, &writtenCmds, gCurrAiBuffer, gAiBufferLengths[index]);
gAudioRandom = ((gAudioRandom + gAudioFrameCount) * gAudioFrameCount);

View File

@@ -62,7 +62,7 @@ struct SPTask *sCurrentAudioSPTask = NULL;
struct SPTask *sCurrentDisplaySPTask = NULL;
struct SPTask *sNextAudioSPTask = NULL;
struct SPTask *sNextDisplaySPTask = NULL;
s8 sAudioEnabled = TRUE;
s8 gAudioEnabled = TRUE;
u32 gNumVblanks = 0;
s8 gResetTimer = 0;
s8 gNmiResetBarsTimer = 0;
@@ -215,7 +215,7 @@ void handle_vblank(void) {
if (gActiveSPTask != NULL) {
interrupt_gfx_sptask();
} else {
if (sAudioEnabled) {
if (gAudioEnabled) {
start_sptask(M_AUDTASK);
} else {
pretend_audio_sptask_done();
@@ -259,7 +259,7 @@ void handle_sp_complete(void) {
}
// Start the audio task, as expected by handle_vblank.
if (sAudioEnabled) {
if (gAudioEnabled) {
start_sptask(M_AUDTASK);
} else {
pretend_audio_sptask_done();
@@ -375,7 +375,7 @@ void send_sp_task_message(OSMesg *msg) {
}
void dispatch_audio_sptask(struct SPTask *spTask) {
if (sAudioEnabled && spTask != NULL) {
if (gAudioEnabled && spTask != NULL) {
osWritebackDCacheAll();
osSendMesg(&gSPTaskMesgQueue, spTask, OS_MESG_NOBLOCK);
}
@@ -396,11 +396,11 @@ void exec_display_list(struct SPTask *spTask) {
}
void turn_on_audio(void) {
sAudioEnabled = TRUE;
gAudioEnabled = TRUE;
}
void turn_off_audio(void) {
sAudioEnabled = FALSE;
gAudioEnabled = FALSE;
while (sCurrentAudioSPTask != NULL) {
;
}

View File

@@ -75,6 +75,7 @@ extern struct RumbleSettings gCurrRumbleSettings;
extern struct VblankHandler *gVblankHandler1;
extern struct VblankHandler *gVblankHandler2;
extern struct SPTask *gActiveSPTask;
extern s8 gAudioEnabled;
extern u32 gNumVblanks;
extern s8 gResetTimer;
extern s8 gNmiResetBarsTimer;