From 2e3a9a7467a1740dff9985203f10f7bae01c9d0d Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Wed, 3 Aug 2011 12:10:48 +0000 Subject: [PATCH] Minor fix to IRQ subsystem. Should fix games that expected DSP IRQs masked. --- src/filedb.cpp | 1 + src/gui/about.h | 18 ----------- src/gui/help.cpp | 73 +++++++++++++++++++++++++++++++++++++++++++++ src/gui/help.h | 25 ++++++++++++++++ src/gui/mainwin.cpp | 12 ++++++++ src/gui/mainwin.h | 4 +++ src/jerry.cpp | 28 ++++++++++++----- virtualjaguar.pro | 2 ++ 8 files changed, 138 insertions(+), 25 deletions(-) create mode 100644 src/gui/help.cpp create mode 100644 src/gui/help.h diff --git a/src/filedb.cpp b/src/filedb.cpp index 2e80818..e4e9e1f 100644 --- a/src/filedb.cpp +++ b/src/filedb.cpp @@ -61,6 +61,7 @@ RomIdentifier romList[] = { { 0x4471BFA0, "Skyhammer (World)", FF_ALPINE | FF_VERIFIED }, { 0x47EBC158, "Theme Park (World)", FF_ROM | FF_VERIFIED }, { 0x4899628F, "Hover Strike (World)", FF_ROM | FF_VERIFIED }, + { 0x4A08A2BD, "SuperCross 3D (World)", FF_ROM | FF_BAD_DUMP }, { 0x55A0669C, "[BIOS] Atari Jaguar Developer CD (World)", FF_BIOS }, { 0x58272540, "Syndicate (World)", FF_ROM | FF_VERIFIED }, { 0x5A101212, "Sensible Soccer - International Edition (World)", FF_ROM | FF_VERIFIED }, diff --git a/src/gui/about.h b/src/gui/about.h index 7397e3b..854ebc8 100644 --- a/src/gui/about.h +++ b/src/gui/about.h @@ -22,21 +22,3 @@ class AboutWindow: public QWidget }; #endif // __ABOUT_H__ - - -#if 0 -class AboutWindow : public QbWindow { - Q_OBJECT - -public: - QVBoxLayout *layout; - struct Logo : public QWidget { - void paintEvent(QPaintEvent*); - } *logo; - QLabel *info; - - AboutWindow(); -}; - -extern AboutWindow *aboutWindow; -#endif diff --git a/src/gui/help.cpp b/src/gui/help.cpp new file mode 100644 index 0000000..cb4f2eb --- /dev/null +++ b/src/gui/help.cpp @@ -0,0 +1,73 @@ +// +// help.cpp - Help file +// +// by James L. Hammons +// (C) 2011 Underground Software +// +// JLH = James L. Hammons +// +// Who When What +// --- ---------- ------------------------------------------------------------- +// JLH 08/01/2011 Created this file +// + +// STILL TO DO: +// + +#include "help.h" + +HelpWindow::HelpWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog) +{ + setWindowTitle(tr("Virtual Jaguar Help")); + + // Need to set the size as well... +// resize(560, 480); + resize(560, 480); + + layout = new QVBoxLayout(); + layout->setSizeConstraint(QLayout::SetFixedSize); + setLayout(layout); + +// image = new QLabel(); +// image->setAlignment(Qt::AlignRight); +// image->setPixmap(QPixmap(":/res/vj_title_small.png")); +// layout->addWidget(image); + +// QString s = QString(tr("SVN %1
")).arg(__DATE__); + QString s;// = QString(""); + s.append(tr( + "

Virtual Jaguar Documentation

" + "

" + "Coming soon!" + )); + text = new QTextBrowser; + text->setHtml(s); + layout->addWidget(text); +} + + +#if 0 +#include "htmlviewer.moc" +HtmlViewerWindow *htmlViewerWindow; + +HtmlViewerWindow::HtmlViewerWindow() { + setObjectName("html-window"); + resize(560, 480); + setGeometryString(&config().geometry.htmlViewerWindow); + application.windowList.add(this); + + layout = new QVBoxLayout; + layout->setMargin(Style::WindowMargin); + layout->setSpacing(0); + setLayout(layout); + + document = new QTextBrowser; + layout->addWidget(document); +} + +void HtmlViewerWindow::show(const char *title, const char *htmlData) { + document->setHtml(string() << htmlData); + setWindowTitle(title); + Window::show(); +} +#endif diff --git a/src/gui/help.h b/src/gui/help.h new file mode 100644 index 0000000..7b4b48e --- /dev/null +++ b/src/gui/help.h @@ -0,0 +1,25 @@ +// +// help.h: Built-in help system +// +// by James L. Hammons +// (C) 2011 Underground Software +// + +#ifndef __HELP_H__ +#define __HELP_H__ + +#include + +class HelpWindow: public QWidget +{ + public: + HelpWindow(QWidget * parent = 0); + + private: + QVBoxLayout * layout; + QTextBrowser * text; +// QLabel * text; +// QLabel * image; +}; + +#endif // __HELP_H__ diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 3ff3ded..4841190 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -35,6 +35,7 @@ #include "SDL.h" #include "glwidget.h" #include "about.h" +#include "help.h" #include "settings.h" #include "filepicker.h" #include "configdialog.h" @@ -95,6 +96,7 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit setWindowTitle(title); aboutWin = new AboutWindow(this); + helpWin = new HelpWindow(this); filePickWin = new FilePickerWindow(this); videoWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -161,6 +163,10 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit aboutAct->setStatusTip(tr("Blatant self-promotion")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(ShowAboutWin())); + helpAct = new QAction(QIcon(":/res/vj-icon.png"), tr("&Contents..."), this); + helpAct->setStatusTip(tr("Help is available, if you should need it")); + connect(helpAct, SIGNAL(triggered()), this, SLOT(ShowHelpWin())); + filePickAct = new QAction(QIcon(":/res/software.png"), tr("&Insert Cartridge..."), this); filePickAct->setStatusTip(tr("Insert a cartridge into Virtual Jaguar")); filePickAct->setShortcut(QKeySequence(tr("Ctrl+i"))); @@ -192,6 +198,7 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit fileMenu->addAction(quitAppAct); helpMenu = menuBar()->addMenu(tr("&Help")); + helpMenu->addAction(helpAct); helpMenu->addAction(aboutAct); toolbar = addToolBar(tr("Stuff")); @@ -548,6 +555,11 @@ void MainWin::ShowAboutWin(void) aboutWin->show(); } +void MainWin::ShowHelpWin(void) +{ + helpWin->show(); +} + void MainWin::InsertCart(void) { // If the emulator is running, we pause it here and unpause it later diff --git a/src/gui/mainwin.h b/src/gui/mainwin.h index e53515a..cc7d160 100644 --- a/src/gui/mainwin.h +++ b/src/gui/mainwin.h @@ -14,6 +14,7 @@ // Forward declarations class GLWidget; class AboutWindow; +class HelpWindow; class FilePickerWindow; class MainWin: public QMainWindow @@ -42,6 +43,7 @@ class MainWin: public QMainWindow void SetPAL(void); void ToggleBlur(void); void ShowAboutWin(void); + void ShowHelpWin(void); void InsertCart(void); void Unpause(void); void LoadSoftware(QString); @@ -56,6 +58,7 @@ class MainWin: public QMainWindow // public: GLWidget * videoWidget; AboutWindow * aboutWin; + HelpWindow * helpWin; FilePickerWindow * filePickWin; QTimer * timer; bool running; @@ -85,6 +88,7 @@ class MainWin: public QMainWindow QAction * palAct; QAction * blurAct; QAction * aboutAct; + QAction * helpAct; QAction * filePickAct; QAction * configAct; QAction * useCDAct; diff --git a/src/jerry.cpp b/src/jerry.cpp index 2212cf2..4b05236 100644 --- a/src/jerry.cpp +++ b/src/jerry.cpp @@ -164,6 +164,7 @@ #include "joystick.h" #include "log.h" #include "m68k.h" +#include "tom.h" //#include "memory.h" #include "wavetable.h" @@ -352,16 +353,24 @@ void JERRYResetPIT2(void) #endif } +// This is the cause of the regressions in Cybermorph and Missile Command 3D... +// Solution: Probably have to check the DSP enable bit before sending these thru. +//#define JERRY_NO_IRQS void JERRYPIT1Callback(void) { +#ifndef JERRY_NO_IRQS //WriteLog("JERRY: In PIT1 callback, IRQM=$%04X\n", jerryInterruptMask); - if (jerryInterruptMask & IRQ2_TIMER1) // CPU Timer 1 IRQ + if (TOMIRQEnabled(IRQ_DSP)) { + if (jerryInterruptMask & IRQ2_TIMER1) // CPU Timer 1 IRQ + { // Not sure, but I think we don't generate another IRQ if one's already going... // But this seems to work... :-/ - jerryPendingInterrupt |= IRQ2_TIMER1; - m68k_set_irq(2); // Generate 68K IPL 2 + jerryPendingInterrupt |= IRQ2_TIMER1; + m68k_set_irq(2); // Generate 68K IPL 2 + } } +#endif DSPSetIRQLine(DSPIRQ_TIMER0, ASSERT_LINE); // This does the 'IRQ enabled' checking... JERRYResetPIT1(); @@ -369,12 +378,17 @@ void JERRYPIT1Callback(void) void JERRYPIT2Callback(void) { -//WriteLog("JERRY: In PIT2 callback, IRQM=$%04X\n", jerryInterruptMask); - if (jerryInterruptMask & IRQ2_TIMER2) // CPU Timer 2 IRQ +#ifndef JERRY_NO_IRQS + if (TOMIRQEnabled(IRQ_DSP)) { - jerryPendingInterrupt |= IRQ2_TIMER2; - m68k_set_irq(2); // Generate 68K IPL 2 +//WriteLog("JERRY: In PIT2 callback, IRQM=$%04X\n", jerryInterruptMask); + if (jerryInterruptMask & IRQ2_TIMER2) // CPU Timer 2 IRQ + { + jerryPendingInterrupt |= IRQ2_TIMER2; + m68k_set_irq(2); // Generate 68K IPL 2 + } } +#endif DSPSetIRQLine(DSPIRQ_TIMER1, ASSERT_LINE); // This does the 'IRQ enabled' checking... JERRYResetPIT2(); diff --git a/virtualjaguar.pro b/virtualjaguar.pro index abc4e7f..492b568 100644 --- a/virtualjaguar.pro +++ b/virtualjaguar.pro @@ -63,6 +63,7 @@ HEADERS = \ src/gui/filethread.h \ src/gui/generaltab.h \ src/gui/glwidget.h \ + src/gui/help.h \ src/gui/imagedelegate.h \ src/gui/keygrabber.h \ src/gui/mainwin.h @@ -79,6 +80,7 @@ SOURCES = \ src/gui/filethread.cpp \ src/gui/generaltab.cpp \ src/gui/glwidget.cpp \ + src/gui/help.cpp \ src/gui/imagedelegate.cpp \ src/gui/keygrabber.cpp \ src/gui/mainwin.cpp -- 2.37.2