]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/dac.cpp
First attempt at configuration dialog.
[virtualjaguar] / src / dac.cpp
index 59019f8d14d5fd25d83c717ee415a5246eefd575..f37dd843ba71093171b399dd204e85b7f0f950e1 100644 (file)
@@ -4,6 +4,13 @@
 // Originally by David Raingeard
 // GCC/SDL port by Niels Wagenaar (Linux/WIN32) and Caz (BeOS)
 // Rewritten by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who  When        What
+// ---  ----------  -------------------------------------------------------------
+// JLH  01/16/2010  Created this log ;-)
 //
 
 // Need to set up defaults that the BIOS sets for the SSI here in DACInit()... !!! FIX !!!
 #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 "memory.h"
+#include "settings.h"
 
 //#define DEBUG_DAC
 
@@ -42,7 +51,7 @@
 
 // Global variables
 
-uint16 lrxd, rrxd;                                                                     // I2S ports (into Jaguar)
+//uint16 lrxd, rrxd;                                                                   // I2S ports (into Jaguar)
 
 // Local variables
 
@@ -173,7 +182,7 @@ if (numLeftSamplesReady == 0 || numRightSamplesReady == 0)
 }
 
 //
-// Calculate the frequency of SCLK * 32 using the divider
+// Calculate the freq9uency of SCLK * 32 using the divider
 //
 int GetCalculatedFrequency(void)
 {
@@ -219,8 +228,11 @@ 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);
+#warning "Reimplement GUICrashGracefully!"
+//     GUICrashGracefully("Stuck in left DAC spinlock!");
+       return;
 }
                }//*/
 
@@ -289,6 +301,8 @@ LTail=60D8, LHead=60D8, BUFFER_SIZE-1=FFFF
 RTail=DB, RHead=60D9, BUFFER_SIZE-1=FFFF
 From while: Tail=60DA, Head=60D8
 */
+#warning Spinlock problem--!!! FIX !!!
+#warning Odd: The right FIFO is empty, but the left FIFO is full!
                // Spin until buffer has been drained (for too fast processors!)...
 uint32 spin = 0;
                while (((RightFIFOTailPtr + 2) & (BUFFER_SIZE - 1)) == RightFIFOHeadPtr)//;
@@ -306,8 +320,11 @@ 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);
+#warning "Reimplement GUICrashGracefully!"
+//     GUICrashGracefully("Stuck in right DAC spinlock!");
+       return;
 }
                }//*/
 
@@ -342,8 +359,11 @@ WriteLog("Tail=%X, Head=%X", rtail, rhead);
 // 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);
+#warning "Reimplement GUICrashGracefully!"
+//                                             GUICrashGracefully("Failed to initialize SDL sound!");
+                                               return;
                                        }
                                }