// Global variables
-uint16 lrxd, rrxd; // I2S ports (into Jaguar)
+//uint16 lrxd, rrxd; // I2S ports (into Jaguar)
// Local variables
static uint32 LeftFIFOHeadPtr, LeftFIFOTailPtr, RightFIFOHeadPtr, RightFIFOTailPtr;
static SDL_AudioSpec desired;
-static bool SDLSoundInitialized = false;
+static bool SDLSoundInitialized;
// We can get away with using native endian here because we can tell SDL to use the native
// endian when looking at the sample buffer, i.e., no need to worry about it.
//
void DACInit(void)
{
+ SDLSoundInitialized = false;
+
+ if (!vjs.audioEnabled)
+ {
+ WriteLog("DAC: Host audio playback disabled.\n");
+ return;
+ }
+
// memory_malloc_secure((void **)&DACBuffer, BUFFER_SIZE * sizeof(uint16), "DAC buffer");
// DACBuffer = (uint16 *)memory_malloc(BUFFER_SIZE * sizeof(uint16), "DAC buffer");
}
//
-// Calculate the freq9uency of SCLK * 32 using the divider
+// Calculate the frequency of SCLK * 32 using the divider
//
int GetCalculatedFrequency(void)
{
{
if (offset == LTXD + 2)
{
+ if (!SDLSoundInitialized)
+ return;
// Spin until buffer has been drained (for too fast processors!)...
//Small problem--if Head == 0 and Tail == buffer end, then this will fail... !!! FIX !!!
//[DONE]
}
else if (offset == RTXD + 2)
{
+ if (!SDLSoundInitialized)
+ return;
/*
Here's what's happening now: