]> Shamusworld >> Repos - virtualjaguar/commitdiff
Fix for bad branch handling in OP.
authorShamus Hammons <jlhamm@acm.org>
Sat, 28 Feb 2015 14:30:19 +0000 (08:30 -0600)
committerShamus Hammons <jlhamm@acm.org>
Sat, 28 Feb 2015 14:30:19 +0000 (08:30 -0600)
13 files changed:
cross-compile
docs/INSTALL
docs/WHATSNEW
src/blitter.cpp
src/gui/debug/cpubrowser.cpp
src/gui/debug/m68kdasmbrowser.cpp
src/gui/debug/memorybrowser.cpp
src/gui/debug/opbrowser.cpp
src/gui/debug/riscdasmbrowser.cpp
src/gui/mainwin.cpp
src/gui/profile.cpp
src/op.cpp
src/tom.cpp

index 4a8c4438499a0fc319c62dc5086eb8c908e4ce2c..f09a78ea93d674b356b0d098d2ef67bb5229ab75 100755 (executable)
@@ -9,7 +9,7 @@
 #echo "Cross compiling for Win32..."
 echo "Cross compiling for Win64..."
 export PATH=/opt/mxe/usr/bin:$PATH
-rm makefile-qt
+#rm makefile-qt
 #make CROSS=i686-pc-mingw32.static-
 make CROSS=x86_64-w64-mingw32.static-
 #rel=`svn info | grep Revision | cut -f 2 -d ' '`
index 6c7c303488a2da18e753f4a834882822ce795326..14c2d73098fe3895ac2886c2db318c908e84a3fb 100644 (file)
@@ -13,7 +13,7 @@ The minimum requirements for compiling Virtual Jaguar from source are:
  o  zlib v1.2.5
  o  libcdio v0.90 or higher (optional, for Jaguar CD support)
  o  OpenGL libraries
- o  Qt 4.7.3 or higher (but not Qt 5!)
+ o  Qt 5.3.2 or higher
  o  supported OS (BeOS, Linux, FreeBSD and WIN32 through mingw, MacOS); other
     OSs may work to but you may need to change some items in the Makefile.
 
index 475198488a4237aa5067907de11754906b06cff8..1e3892096f9237e6e84a62942234669d39e49586 100644 (file)
@@ -20,7 +20,7 @@ Virtual Jaguar v2.1.1 GCC/Qt
   config for the new controller without destroying the old one. This also means
   that if you have *no* controllers, you can still play VJ with the keyboard.
   [Shamus]
-* Fixed a few problems with the DSP timing; as a result, the sound in Rayman
+* Fixed a few problems with the DSP timing; as a result, the sound in Rayman
   and the FACTS demo is correct now. [Shamus]
 * Removed toolbar from full screen mode. [Shamus]
 * Added analog inputs to gamepad support. [Shamus]
index 6a8c9ca4bafae1ad069cfd534c3414acb86ae513..776bc8c7165e9081142207ae8f2a504f8f36b433 100644 (file)
@@ -7,7 +7,7 @@
 // JLH = James Hammons <jlhamm@acm.org>
 //
 // Who  When        What
-// ---  ----------  -------------------------------------------------------------
+// ---  ----------  -----------------------------------------------------------
 // JLH  01/16/2010  Created this log ;-)
 //
 
@@ -32,7 +32,7 @@
 
 // Various conditional compilation goodies...
 
-//#define LOG_BLITS
+#define LOG_BLITS
 
 #define USE_ORIGINAL_BLITTER
 //#define USE_MIDSUMMER_BLITTER
index 2f478ce2eb3090952ed2f219e54caf75a1e7971d..331ac9059ac390f30f2536017876fa39d6a75603 100644 (file)
@@ -7,7 +7,7 @@
 // JLH = James Hammons <jlhamm@acm.org>
 //
 // Who  When        What
-// ---  ----------  -------------------------------------------------------------
+// ---  ----------  -----------------------------------------------------------
 // JLH  08/14/2012  Created this file
 //
 
@@ -38,8 +38,8 @@ CPUBrowserWindow::CPUBrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt:
        hbox1->addWidget(bpm);
        hbox1->addWidget(bpmAddress);
 
-//     QFont fixedFont("Lucida Console", 8, QFont::Normal);
-       QFont fixedFont("", 8, QFont::Normal);
+       QFont fixedFont("Lucida Console", 8, QFont::Normal);
+//     QFont fixedFont("", 8, QFont::Normal);
        fixedFont.setStyleHint(QFont::TypeWriter);
        text->setFont(fixedFont);
 ////   layout->setSizeConstraint(QLayout::SetFixedSize);
index 931b3db661289cbfd760455f728ab0fbf1066855..969c5e8f7226f81755a324fab08c85d9966ecfff 100644 (file)
@@ -40,8 +40,8 @@ M68KDasmBrowserWindow::M68KDasmBrowserWindow(QWidget * parent/*= 0*/): QWidget(p
        // Need to set the size as well...
 //     resize(560, 480);
 
-//     QFont fixedFont("Lucida Console", 8, QFont::Normal);
-       QFont fixedFont("", 8, QFont::Normal);
+       QFont fixedFont("Lucida Console", 8, QFont::Normal);
+//     QFont fixedFont("", 8, QFont::Normal);
        fixedFont.setStyleHint(QFont::TypeWriter);
        text->setFont(fixedFont);
 ////   layout->setSizeConstraint(QLayout::SetFixedSize);
index 745b3a80a86bf2d208e36846639a01f7c503225b..45bae7f7883f87d2a1b2259db8754bd7a69fb627 100644 (file)
@@ -7,7 +7,7 @@
 // JLH = James Hammons <jlhamm@acm.org>
 //
 // Who  When        What
-// ---  ----------  -------------------------------------------------------------
+// ---  ----------  -----------------------------------------------------------
 // JLH  08/14/2012  Created this file
 //
 
@@ -37,8 +37,8 @@ MemoryBrowserWindow::MemoryBrowserWindow(QWidget * parent/*= 0*/): QWidget(paren
        // Need to set the size as well...
 //     resize(560, 480);
 
-//     QFont fixedFont("Lucida Console", 8, QFont::Normal);
-       QFont fixedFont("", 8, QFont::Normal);
+       QFont fixedFont("Lucida Console", 8, QFont::Normal);
+//     QFont fixedFont("", 8, QFont::Normal);
        fixedFont.setStyleHint(QFont::TypeWriter);
        text->setFont(fixedFont);
 ////   layout->setSizeConstraint(QLayout::SetFixedSize);
index e30907b13ca83996c12eaba3d6195eb4a844b0b3..c4193d8798ce8438e0c183477aaf2970d2fa4c49 100644 (file)
@@ -29,8 +29,8 @@ OPBrowserWindow::OPBrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::D
        // Need to set the size as well...
 //     resize(560, 480);
 
-//     QFont fixedFont("Lucida Console", 8, QFont::Normal);
-       QFont fixedFont("", 8, QFont::Normal);
+       QFont fixedFont("Lucida Console", 8, QFont::Normal);
+//     QFont fixedFont("", 8, QFont::Normal);
        fixedFont.setStyleHint(QFont::TypeWriter);
        text->setFont(fixedFont);
 ////   layout->setSizeConstraint(QLayout::SetFixedSize);
@@ -107,9 +107,13 @@ void OPBrowserWindow::DiscoverObjects(uint32_t address)
 
                if (objectType == 3)
                {
-                       // Recursion needed to follow all links! This does depth-first recursion
-                       // on the not-taken objects
-                       DiscoverObjects(address + 8);
+                       // Branch if YPOS < 2047 can be treated as a GOTO, so don't do any
+                       // discovery in that case. Otherwise, have at it:
+                       if ((lo & 0xFFFF) != 0x7FFB)
+                       // Recursion needed to follow all links! This does depth-first
+                       // recursion on the not-taken objects (N.B.: The object following
+                       // the branch object is at +16, not +8!)
+                               DiscoverObjects(address + 16);
                }
 
                // Get the next object...
@@ -153,11 +157,12 @@ void OPBrowserWindow::DumpObjectList(QString & list)
                list += "<br>";
 
                if (objectType == 0)
-                       DumpFixedObject(list, OPLoadPhrase(address + 0), OPLoadPhrase(address + 8));
+                       DumpFixedObject(list, OPLoadPhrase(address + 0),
+                               OPLoadPhrase(address + 8));
 
                if (objectType == 1)
-                       DumpScaledObject(list, OPLoadPhrase(address + 0), OPLoadPhrase(address + 8),
-                               OPLoadPhrase(address + 16));
+                       DumpScaledObject(list, OPLoadPhrase(address + 0),
+                               OPLoadPhrase(address + 8), OPLoadPhrase(address + 16));
 
                if (address == link)    // Ruh roh...
                {
index 67e69c9733a54201ac72de9dd6b77655af745066..2d8fc0e63dd5a60156b3b9bbfb85bc46b6fff45b 100644 (file)
@@ -42,8 +42,8 @@ RISCDasmBrowserWindow::RISCDasmBrowserWindow(QWidget * parent/*= 0*/): QWidget(p
        // Need to set the size as well...
 //     resize(560, 480);
 
-//     QFont fixedFont("Lucida Console", 8, QFont::Normal);
-       QFont fixedFont("", 8, QFont::Normal);
+       QFont fixedFont("Lucida Console", 8, QFont::Normal);
+//     QFont fixedFont("", 8, QFont::Normal);
        fixedFont.setStyleHint(QFont::TypeWriter);
        text->setFont(fixedFont);
 ////   layout->setSizeConstraint(QLayout::SetFixedSize);
index f2c45ab00ebe8b22ffcc13920e5a77e50200e8fa..c9733d5d0a86aef320101787e97b035a89e8548c 100644 (file)
@@ -324,10 +324,9 @@ MainWin::MainWin(bool autoRun): running(true), powerButtonOn(false),
 
        //      Create status bar
        statusBar()->showMessage(tr("Ready"));
-
        ReadSettings();
-
-       // Do this in case original size isn't correct (mostly for the first-run case)
+       // Do this in case original size isn't correct (mostly for the first-run
+       // case)
        ResizeMainWindow();
 
        // Create our test pattern bitmaps
@@ -1162,6 +1161,7 @@ WriteLog("AlpineROMPath = \"%s\"\n", vjs.alpineROMPath);
 WriteLog("   absROMPath = \"%s\"\n", vjs.absROMPath);
 WriteLog("Pipelined DSP = %s\n", (vjs.usePipelinedDSP ? "ON" : "off"));
 
+#if 0
        // Keybindings in order of U, D, L, R, C, B, A, Op, Pa, 0-9, #, *
        vjs.p1KeyBindings[BUTTON_U] = settings.value("p1k_up", Qt::Key_S).toInt();
        vjs.p1KeyBindings[BUTTON_D] = settings.value("p1k_down", Qt::Key_X).toInt();
@@ -1206,6 +1206,7 @@ WriteLog("Pipelined DSP = %s\n", (vjs.usePipelinedDSP ? "ON" : "off"));
        vjs.p2KeyBindings[BUTTON_9] = settings.value("p2k_9", Qt::Key_9).toInt();
        vjs.p2KeyBindings[BUTTON_d] = settings.value("p2k_pound", Qt::Key_Slash).toInt();
        vjs.p2KeyBindings[BUTTON_s] = settings.value("p2k_star", Qt::Key_Asterisk).toInt();
+#endif
 
        ReadProfiles(&settings);
 }
@@ -1245,6 +1246,7 @@ void MainWin::WriteSettings(void)
        settings.setValue("DefaultROM", vjs.alpineROMPath);
        settings.setValue("DefaultABS", vjs.absROMPath);
 
+#if 0
        settings.setValue("p1k_up", vjs.p1KeyBindings[BUTTON_U]);
        settings.setValue("p1k_down", vjs.p1KeyBindings[BUTTON_D]);
        settings.setValue("p1k_left", vjs.p1KeyBindings[BUTTON_L]);
@@ -1288,6 +1290,7 @@ void MainWin::WriteSettings(void)
        settings.setValue("p2k_9", vjs.p2KeyBindings[BUTTON_9]);
        settings.setValue("p2k_pound", vjs.p2KeyBindings[BUTTON_d]);
        settings.setValue("p2k_star", vjs.p2KeyBindings[BUTTON_s]);
+#endif
 
        WriteProfiles(&settings);
 }
index a1bb92692534076041bb3b4794582f168b1e7ebf..5f1ca13035be6d23b1e2202ff99b83ff10f1bb7a 100644 (file)
@@ -371,7 +371,12 @@ void AutoConnectProfiles(void)
        // add it in.
        if (Gamepad::numJoysticks == 0)
        {
-               ConnectProfileToDevice(0);
+#ifdef DEBUG_PROFILES
+printf("AutoConnect: Setting up keyboard...\n");
+#endif
+//NO!          ConnectProfileToDevice(0);
+#warning "!!! Need to set up scanning for multiple keyboard profiles !!!"
+               ConnectProfileToController(0, 0);
                return;
        }
 
@@ -382,6 +387,9 @@ void AutoConnectProfiles(void)
        {
                int deviceNum = FindDeviceNumberForName(Gamepad::GetJoystickName(i));
 //             bool p1Overwriteable = 
+#ifdef DEBUG_PROFILES
+printf("AutoConnect: Attempting to set up profile for device '%s' (%i)\n", Gamepad::GetJoystickName(i), deviceNum);
+#endif
 
                for(int j=0; j<numberOfProfiles; j++)
                {
@@ -449,6 +457,9 @@ void AutoConnectProfiles(void)
        // N.B.: The keyboard is always mapped to profile #0, so we can locate it
        //       easily. :-)
        int slot = profile[0].preferredSlot;
+#ifdef DEBUG_PROFILES
+printf("AutoConnect: Attempting to connect keyboard... (gamepadIDSlot1/2 = %i/%i)\n", gamepadIDSlot1, gamepadIDSlot2);
+#endif
 
        if ((slot == CONTROLLER1) && (gamepadIDSlot1 == -1))
                controller1Profile = 0;
@@ -462,12 +473,16 @@ void AutoConnectProfiles(void)
                        controller2Profile = 0;
        }
 
+#ifdef DEBUG_PROFILES
+printf("AutoConnect: Profiles found: [%i, %i]\n", controller1Profile, controller2Profile);
+#endif
        // Finally, attempt to connect profiles to controllers
        ConnectProfileToController(controller1Profile, 0);
        ConnectProfileToController(controller2Profile, 1);
 }
 
 
+//unused...
 int ConnectProfileToDevice(int deviceNum, int gamepadID/*= -1*/)
 {
 //     bool found1 = false;
index d9b6c66d9d161b0d8c14e773595853bf69df3019..dfc9ece092cf495f4f1f0a0ecaf7b503bc746db2 100644 (file)
@@ -797,6 +797,10 @@ OP: Scaled bitmap 4x? 4bpp at 34,? hscale=80 fpix=0 data=000756E8 pitch 1 hflipp
                        uint8_t  cc   = (p0 >> 14) & 0x03;
                        uint32_t link = (p0 >> 21) & 0x3FFFF8;
 
+                       // If no branch is taken, we need to ensure that it goes to the
+                       // next object (it doesn't go +8, but +16 to following object)
+                       op_pointer += 8;
+
 //                     if ((ypos!=507)&&(ypos!=25))
 //                             WriteLog("\t%i%s%i link=0x%.8x\n",halfline,condition_to_str[cc],ypos>>1,link);
                        switch (cc)
index dc44995443b6888e1ca29a9f29942247474e0f14..6ce648be972e13f082f359397daa087763f76e32 100644 (file)
@@ -1649,7 +1649,7 @@ if (offset == MEMCON2)
 //if (offset == OBF)
 //     WriteLog("TOM: Object Processor Flag written by %s: %u\n", whoName[who], data);
 if (offset == VMODE)
-       WriteLog("TOM: Video Mode written by %s: %04X. PWIDTH = %u, MODE = %s, flags:%s%s (VC = %u)\n", whoName[who], data, ((data >> 9) & 0x07) + 1, videoMode_to_str[(data & MODE) >> 1], (data & BGEN ? " BGEN" : ""), (data & VARMOD ? " VARMOD" : ""), GET16(tomRam8, VC));
+       WriteLog("TOM: Video Mode written by %s: %04X. PWIDTH = %u, MODE = %s, flags:%s%s (VC = %u) (M68K PC = %06X)\n", whoName[who], data, ((data >> 9) & 0x07) + 1, videoMode_to_str[(data & MODE) >> 1], (data & BGEN ? " BGEN" : ""), (data & VARMOD ? " VARMOD" : ""), GET16(tomRam8, VC), m68k_get_reg(NULL, M68K_REG_PC));
 if (offset == BORD1)
        WriteLog("TOM: Border 1 written by %s: $%04X\n", whoName[who], data);
 if (offset == BORD2)