X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdac.cpp;h=0e266841d692c6a43e274cd4e54c71414b5f9059;hb=d239de704f276a75d927900e3d413a44cc87116c;hp=4b4bfab2e8b2254dbd4a9fac852e902a530b5f7c;hpb=6c19e4098a43c47f8cd1824902f7335e124b834f;p=virtualjaguar diff --git a/src/dac.cpp b/src/dac.cpp index 4b4bfab..0e26684 100644 --- a/src/dac.cpp +++ b/src/dac.cpp @@ -11,13 +11,22 @@ // work correctly...! Perhaps just need to set up SSI stuff so BUTCH doesn't get // confused... +// ALSO: Need to implement some form of proper locking to replace the clusterfuck +// that is the current spinlock implementation. Since the DSP is a separate +// entity, could we get away with running it in the sound IRQ? + +// ALSO: It may be a good idea to physically separate the left and right buffers +// to prevent things like the DSP filling only one side and such. Do such +// mono modes exist on the Jag? Seems to according to Super Burnout. + #include "dac.h" #include "SDL.h" -#include "m68k.h" +#include "gui.h" #include "jaguar.h" -#include "settings.h" #include "log.h" +#include "m68k.h" +#include "settings.h" //#define DEBUG_DAC @@ -211,8 +220,10 @@ WriteLog("Tail=%X, Head=%X", ltail, lhead); WriteLog("LTail=%X, LHead=%X, BUFFER_SIZE-1=%X\n", LeftFIFOTailPtr, LeftFIFOHeadPtr, BUFFER_SIZE - 1); WriteLog("RTail=%X, RHead=%X, BUFFER_SIZE-1=%X\n", RightFIFOTailPtr, RightFIFOHeadPtr, BUFFER_SIZE - 1); WriteLog("From while: Tail=%X, Head=%X", (LeftFIFOTailPtr + 2) & (BUFFER_SIZE - 1), LeftFIFOHeadPtr); - log_done(); - exit(0); +// LogDone(); +// exit(0); + GUICrashGracefully("Stuck in left DAC spinlock!"); + return; } }//*/ @@ -298,8 +309,10 @@ WriteLog("Tail=%X, Head=%X", rtail, rhead); WriteLog("LTail=%X, LHead=%X, BUFFER_SIZE-1=%X\n", LeftFIFOTailPtr, LeftFIFOHeadPtr, BUFFER_SIZE - 1); WriteLog("RTail=%X, RHead=%X, BUFFER_SIZE-1=%X\n", RightFIFOTailPtr, RightFIFOHeadPtr, BUFFER_SIZE - 1); WriteLog("From while: Tail=%X, Head=%X", (RightFIFOTailPtr + 2) & (BUFFER_SIZE - 1), RightFIFOHeadPtr); - log_done(); - exit(0); +// LogDone(); +// exit(0); + GUICrashGracefully("Stuck in right DAC spinlock!"); + return; } }//*/ @@ -331,9 +344,13 @@ WriteLog("Tail=%X, Head=%X", rtail, rhead); { if (SDL_OpenAudio(&desired, NULL) < 0) // NULL means SDL guarantees what we want { +// This is bad, Bad, BAD !!! DON'T ABORT BECAUSE WE DIDN'T GET OUR FREQ! !!! FIX !!! +#warning !!! FIX !!! Aborting because of SDL audio problem is bad! WriteLog("DAC: Failed to initialize SDL sound: %s.\nDesired freq: %u\nShutting down!\n", SDL_GetError(), desired.freq); - log_done(); - exit(1); +// LogDone(); +// exit(1); + GUICrashGracefully("Failed to initialize SDL sound!"); + return; } } @@ -382,5 +399,5 @@ uint16 DACReadWord(uint32 offset, uint32 who/*= UNKNOWN*/) else if (offset == RRXD + 2) return rrxd; - return 0xFFFF; // May need SSTAT as well... (but may be a Jaguar II only feature) + return 0xFFFF; // May need SSTAT as well... (but may be a Jaguar II only feature) }