From 32f569e1bd09f5d7f07005d119f6408805106381 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Sat, 28 Feb 2015 08:30:19 -0600 Subject: [PATCH] Fix for bad branch handling in OP. --- cross-compile | 2 +- docs/INSTALL | 2 +- docs/WHATSNEW | 2 +- src/blitter.cpp | 4 ++-- src/gui/debug/cpubrowser.cpp | 6 +++--- src/gui/debug/m68kdasmbrowser.cpp | 4 ++-- src/gui/debug/memorybrowser.cpp | 6 +++--- src/gui/debug/opbrowser.cpp | 21 +++++++++++++-------- src/gui/debug/riscdasmbrowser.cpp | 4 ++-- src/gui/mainwin.cpp | 9 ++++++--- src/gui/profile.cpp | 17 ++++++++++++++++- src/op.cpp | 4 ++++ src/tom.cpp | 2 +- 13 files changed, 55 insertions(+), 28 deletions(-) diff --git a/cross-compile b/cross-compile index 4a8c443..f09a78e 100755 --- a/cross-compile +++ b/cross-compile @@ -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 ' '` diff --git a/docs/INSTALL b/docs/INSTALL index 6c7c303..14c2d73 100644 --- a/docs/INSTALL +++ b/docs/INSTALL @@ -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. diff --git a/docs/WHATSNEW b/docs/WHATSNEW index 4751984..1e38920 100644 --- a/docs/WHATSNEW +++ b/docs/WHATSNEW @@ -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 a 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] diff --git a/src/blitter.cpp b/src/blitter.cpp index 6a8c9ca..776bc8c 100644 --- a/src/blitter.cpp +++ b/src/blitter.cpp @@ -7,7 +7,7 @@ // JLH = James Hammons // // 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 diff --git a/src/gui/debug/cpubrowser.cpp b/src/gui/debug/cpubrowser.cpp index 2f478ce..331ac90 100644 --- a/src/gui/debug/cpubrowser.cpp +++ b/src/gui/debug/cpubrowser.cpp @@ -7,7 +7,7 @@ // JLH = James Hammons // // 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); diff --git a/src/gui/debug/m68kdasmbrowser.cpp b/src/gui/debug/m68kdasmbrowser.cpp index 931b3db..969c5e8 100644 --- a/src/gui/debug/m68kdasmbrowser.cpp +++ b/src/gui/debug/m68kdasmbrowser.cpp @@ -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); diff --git a/src/gui/debug/memorybrowser.cpp b/src/gui/debug/memorybrowser.cpp index 745b3a8..45bae7f 100644 --- a/src/gui/debug/memorybrowser.cpp +++ b/src/gui/debug/memorybrowser.cpp @@ -7,7 +7,7 @@ // JLH = James Hammons // // 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); diff --git a/src/gui/debug/opbrowser.cpp b/src/gui/debug/opbrowser.cpp index e30907b..c4193d8 100644 --- a/src/gui/debug/opbrowser.cpp +++ b/src/gui/debug/opbrowser.cpp @@ -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 += "
"; 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... { diff --git a/src/gui/debug/riscdasmbrowser.cpp b/src/gui/debug/riscdasmbrowser.cpp index 67e69c9..2d8fc0e 100644 --- a/src/gui/debug/riscdasmbrowser.cpp +++ b/src/gui/debug/riscdasmbrowser.cpp @@ -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); diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index f2c45ab..c9733d5 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -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); } diff --git a/src/gui/profile.cpp b/src/gui/profile.cpp index a1bb926..5f1ca13 100644 --- a/src/gui/profile.cpp +++ b/src/gui/profile.cpp @@ -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> 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) diff --git a/src/tom.cpp b/src/tom.cpp index dc44995..6ce648b 100644 --- a/src/tom.cpp +++ b/src/tom.cpp @@ -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) -- 2.37.2