]> Shamusworld >> Repos - virtualjaguar/commitdiff
Fix to compile on win32.
authorShamus Hammons <jlhamm@acm.org>
Wed, 11 Apr 2012 17:10:26 +0000 (17:10 +0000)
committerShamus Hammons <jlhamm@acm.org>
Wed, 11 Apr 2012 17:10:26 +0000 (17:10 +0000)
src/dsp.cpp
src/gui/mainwin.cpp
src/jerry.cpp

index a620775cea2c5945b7c3af8f998f4f342f33adf2..3ab0b6246808b6885637f1b3722ad896f7fe9981 100644 (file)
 //#include "memory.h"
 
 
+#ifdef __GCCWIN32__
+// Apparently on win32, they left of the last little bits of these. So let's do this:
+#define random rand
+#define srandom srand
+#endif
+
 // Seems alignment in loads & stores was off...
 #define DSP_CORRECT_ALIGNMENT
 //#define DSP_CORRECT_ALIGNMENT_STORE
@@ -810,6 +816,9 @@ SET32(ram2, offset, data);
 // Maybe it works like this: It acknowledges the 1st interrupt, but never clears it.
 // So subsequent interrupts come into the chip, but they're never serviced but the
 // I2S subsystem keeps going.
+// After some testing on real hardware, it seems that if you enable TIMER0 and EXTERNAL
+// IRQs on J_INT ($F10020), you don't have to run an I2S interrupt on the DSP. Also,
+// It seems that it's only stable for values of SCLK <= 9.
 
                        if (data & INT_ENA1) // I2S interrupt
                        {
index ea4f8d46156b273f93cc936f04562bcfa36ffdb8..b8a7de0f610526534ee267d54edfc146133238ac 100644 (file)
@@ -260,13 +260,15 @@ MainWin::MainWin(QString filenameToRun): running(true), powerButtonOn(false),
        WriteLog("Virtual Jaguar %s (Last full build was on %s %s)\n", VJ_RELEASE_VERSION, __DATE__, __TIME__);
        WriteLog("VJ: Initializing jaguar subsystem...\n");
        JaguarInit();
+       memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Use the stock BIOS
 
+       // Check for filename passed in on the command line...
        if (!filenameToRun.isEmpty())
        {
                loadAndGo = true;
                // Attempt to load/run the file the user passed in...
                LoadSoftware(filenameToRun);
-               memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Use the stock BIOS
+//             memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Use the stock BIOS
                // Prevent the scanner from running...
                return;
        }
@@ -292,9 +294,11 @@ MainWin::MainWin(QString filenameToRun): running(true), powerButtonOn(false),
                // Prevent the scanner from running...
                return;
        }
-       else
-               memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Otherwise, use the stock BIOS
+//     else
+//             memcpy(jagMemSpace + 0xE00000, jaguarBootROM, 0x20000); // Otherwise, use the stock BIOS
 
+       // Run the scanner if nothing passed in and *not* Alpine mode...
+       // NB: Really need to look into caching the info scanned in here...
        filePickWin->ScanSoftwareFolder(allowUnknownSoftware);
 }
 
index cba9571c808a666326dc71e58dab7e7a383767ed..d0d44af429fc0bfade5f97c58157ed0e227ab69c 100644 (file)
@@ -814,8 +814,11 @@ else if (offset == 0xF10014)
 //     WriteLog("JERRY: D_FLAGS word written by %s: %u\n", whoName[who], data);
 //else if (offset == 0xF1A102)
 //     WriteLog("JERRY: D_FLAGS+2 word written by %s: %u\n", whoName[who], data);
-//else if (offset == 0xF10020)
-//     WriteLog("JERRY: JINTCTRL word written by %s: $%04X\n", whoName[who], data);
+else if (offset == 0xF10020)
+       WriteLog("JERRY: JINTCTRL word written by %s: $%04X (%s%s%s%s%s%s)\n", whoName[who], data,
+               (data & 0x01 ? "Extrnl " : ""), (data & 0x02 ? "DSP " : ""),
+               (data & 0x04 ? "Timer0 " : ""), (data & 0x08 ? "Timer1 " : ""),
+               (data & 0x10 ? "ASI " : ""), (data & 0x20 ? "I2S " : ""));
 #endif
 
        if ((offset >= DSP_CONTROL_RAM_BASE) && (offset < DSP_CONTROL_RAM_BASE+0x20))