+++ /dev/null
-Place the bios here
-
-jagboot.rom (128 Kb)
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");
{
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:
generalTab->useBIOS->setChecked(vjs.useJaguarBIOS);
generalTab->useDSP->setChecked(vjs.DSPEnabled);
+ generalTab->useHostAudio->setChecked(vjs.audioEnabled);
}
void ConfigDialog::UpdateVJSettings(void)
vjs.useJaguarBIOS = generalTab->useBIOS->isChecked();
vjs.DSPEnabled = generalTab->useDSP->isChecked();
+ vjs.audioEnabled = generalTab->useHostAudio->isChecked();
}
// Checkboxes...
useBIOS = new QCheckBox(tr("Enable Jaguar BIOS"));
useDSP = new QCheckBox(tr("Enable DSP"));
+ useHostAudio = new QCheckBox(tr("Enable audio playback"));
useUnknownSoftware = new QCheckBox(tr("Allow unknown software in file chooser"));
layout4->addWidget(useBIOS);
layout4->addWidget(useDSP);
+ layout4->addWidget(useHostAudio);
layout4->addWidget(useUnknownSoftware);
setLayout(layout4);
QCheckBox * useBIOS;
QCheckBox * useDSP;
+ QCheckBox * useHostAudio;
QCheckBox * useUnknownSoftware;
};
#include "generaltab.h"
#include "version.h"
+#include "dac.h"
#include "jaguar.h"
#include "tom.h"
#include "log.h"
return;
QString before = vjs.ROMPath;
+ bool audioBefore = vjs.audioEnabled;
dlg.UpdateVJSettings();
QString after = vjs.ROMPath;
+ bool audioAfter = vjs.audioEnabled;
bool allowOld = allowUnknownSoftware;
//ick.
if ((before != after) || (allowOld != allowUnknownSoftware))
filePickWin->ScanSoftwareFolder(allowUnknownSoftware);
+ // If the "Enable audio" checkbox changed, then we have to re-init the DAC...
+ if (audioBefore != audioAfter)
+ {
+ DACDone();
+ DACInit();
+ }
+
// Just in case we crash before a clean exit...
WriteSettings();
}
vjs.frameSkip = settings.value("frameSkip", 0).toInt();
vjs.useJaguarBIOS = settings.value("useJaguarBIOS", false).toBool();
vjs.DSPEnabled = settings.value("DSPEnabled", false).toBool();
+ vjs.audioEnabled = settings.value("audioEnabled", true).toBool();
vjs.usePipelinedDSP = settings.value("usePipelinedDSP", false).toBool();
vjs.fullscreen = settings.value("fullscreen", false).toBool();
vjs.useOpenGL = settings.value("useOpenGL", true).toBool();
settings.setValue("frameSkip", vjs.frameSkip);
settings.setValue("useJaguarBIOS", vjs.useJaguarBIOS);
settings.setValue("DSPEnabled", vjs.DSPEnabled);
+ settings.setValue("audioEnabled", vjs.audioEnabled);
settings.setValue("usePipelinedDSP", vjs.usePipelinedDSP);
settings.setValue("fullscreen", vjs.fullscreen);
settings.setValue("useOpenGL", vjs.useOpenGL);
#define ABORT_ON_ILLEGAL_INSTRUCTIONS
//#define ABORT_ON_OFFICIAL_ILLEGAL_INSTRUCTION
#define CPU_DEBUG_MEMORY
+//#define LOG_CD_BIOS_CALLS
// Private function prototypes
WriteLog("--> [Calling BusWrite2] D2: %08X\n", m68k_get_reg(NULL, M68K_REG_D2));
// m68k_set_reg(M68K_REG_D2, 0x12345678);
}//*/
+
+#ifdef LOG_CD_BIOS_CALLS
/*
CD_init:: -> $3000
BIOS_VER:: -> $3004
WriteLog("\t\tA0=%08X, A1=%08X, D0=%08X, D1=%08X, D2=%08X\n",
m68k_get_reg(NULL, M68K_REG_A0), m68k_get_reg(NULL, M68K_REG_A1),
m68k_get_reg(NULL, M68K_REG_D0), m68k_get_reg(NULL, M68K_REG_D1), m68k_get_reg(NULL, M68K_REG_D2));
-//*/
+#endif
+
#ifdef ABORT_ON_ILLEGAL_INSTRUCTIONS
if (!m68k_is_valid_instruction(m68k_read_memory_16(m68kPC), M68K_CPU_TYPE_68000))
{
//extern uint32 * backbuffer;
void JaguarReset(void)
{
-//NOTE: This causes a (virtual) crash if this is set in the config but not found... !!! FIX !!!
- if (vjs.useJaguarBIOS)
+ // Only use the system BIOS if it's available...!
+ if (vjs.useJaguarBIOS && (biosAvailable & (BIOS_NORMAL | BIOS_STUB1 | BIOS_STUB2)))
memcpy(jaguarMainRAM, jaguarBootROM, 8);
else
SET32(jaguarMainRAM, 4, jaguarRunAddress);
// Who When What
// --- ---------- -------------------------------------------------------------
// JLH 01/16/2010 Created this log ;-)
+// JLH 07/11/2011 Instead of dumping out on max log file size being reached, we
+// now just silently ignore any more output. 10 megs ought to be
+// enough for anybody. ;-)
//
#include "log.h"
void LogDone(void)
{
- fclose(log_stream);
+ if (log_stream != NULL)
+ fclose(log_stream);
}
//
void WriteLog(const char * text, ...)
{
va_list arg;
-
va_start(arg, text);
+
+ if (log_stream == NULL)
+ {
+ va_end(arg);
+ return;
+ }
+
logSize += vfprintf(log_stream, text, arg);
if (logSize > MAX_LOG_SIZE)
{
fflush(log_stream);
fclose(log_stream);
- exit(1);
+ // Instead of dumping out, we just close the file and ignore any more output.
+ log_stream = NULL;
+// exit(1);
}//*/
va_end(arg);
if (path[strlen(path) - 1] != '/')
strcat(path, "/"); // NOTE: Possible buffer overflow
}
-#endif
\ No newline at end of file
+#endif
bool useOpenGL;
uint32 glFilter;
bool hardwareTypeAlpine;
+ bool audioEnabled;
uint32 frameSkip;
uint32 renderType;