<h2>System Requirements</h2>
-<p><i>Virtual Jaguar</i> should be able to run on most late model computers equipped with an OpenGL compliant video card. It requires a lot of raw <i>oomph</i> in it’s present form to run well; do not be surprised if it doesn’t run at 100% speed with all the options, such as sound and DSP, turned on. Certain subsystems of the Jaguar are not optimized yet and as such take more time than they would if they were optimized. To run <i>Virtual Jaguar</i> at full speed with all options on, we recommend using liquid nitrogen. At least until we get it properly optimized. ;-)</p>
+<p><i>Virtual Jaguar</i> should be able to run on most late model computers equipped with an OpenGL compliant video card. It requires a lot of raw <i>oomph</i> in it’s present form to run well; do not be surprised if it doesn’t run at 100% speed with all the options turned on. Certain subsystems of the Jaguar are not optimized yet and as such take more time than they would if they were optimized. To run <i>Virtual Jaguar</i> at full speed with all options on, we recommend using liquid nitrogen. At least until we get it properly optimized. ;-)</p>
<h2><i>Virtual Jaguar</i> In Depth</h2>
<li>Enable Jaguar BIOS</li>
<li>Enable GPU</li>
<li>Enable DSP</li>
-<li>Enable audio playback</li>
<li>Show all files in file chooser</li>
</ul>
<h3>Enable DSP</h3>
-<p>The DSP is one of the three main processors in the Jaguar, and checking this option enables it. Much software will work without it, however, there is some software that will not.</p>
-
-<h3>Enable audio playback</h3>
-
-<p>Checking this option will allow <i>Virtual Jaguar</i> to attempt to output sound to your sound card. It will <b>not</b> output <b>any</b> sound without the DSP being enabled.</p>
+<p>The DSP is one of the three main processors in the Jaguar, and checking this option enables it. Much software will work without it, however, there is some software that will not. Note that if the DSP is disabled, there will be <b>no</b> sound.</p>
<h3>Show all files in file chooser</h3>
--- /dev/null
+//
+// memorybrowser.cpp - Jaguar memory browser
+//
+// by James Hammons
+// (C) 2012 Underground Software
+//
+// JLH = James Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -------------------------------------------------------------
+// JLH 08/14/2012 Created this file
+//
+
+// STILL TO DO:
+//
+
+#include "memorybrowser.h"
+#include "memory.h"
+
+
+MemoryBrowserWindow::MemoryBrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog),
+// layout(new QVBoxLayout), text(new QTextBrowser),
+ layout(new QVBoxLayout), text(new QLabel),
+ refresh(new QPushButton(tr("Refresh"))),
+ memBase(0)
+{
+ setWindowTitle(tr("Memory Browser"));
+
+ // Need to set the size as well...
+// resize(560, 480);
+
+ QFont fixedFont("Lucida Console", 10, QFont::Normal);
+ text->setFont(fixedFont);
+//// layout->setSizeConstraint(QLayout::SetFixedSize);
+ setLayout(layout);
+
+ layout->addWidget(text);
+ layout->addWidget(refresh);
+
+ connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents()));
+}
+
+
+void MemoryBrowserWindow::RefreshContents(void)
+{
+ char string[1024], buf[64];
+ QString memDump;
+
+ for(uint32_t i=0; i<480; i+=16)
+ {
+ sprintf(string, "%s%06X: ", (i != 0 ? "<br>" : ""), memBase + i);
+
+ for(uint32_t j=0; j<16; j++)
+ {
+ sprintf(buf, "%02X ", jaguarMainRAM[memBase + i + j]);
+ strcat(string, buf);
+ }
+
+ sprintf(buf, "| ");
+ strcat(string, buf);
+
+ for(uint32_t j=0; j<16; j++)
+ {
+ uint8_t c = jaguarMainRAM[memBase + i + j];
+ sprintf(buf, "&#%i;", c);
+
+ if (c == 0x20)
+ sprintf(buf, " ");
+
+ if ((c < 0x20) || ((c > 0x7F) && (c < 0xA0)))
+ sprintf(buf, ".");
+
+ strcat(string, buf);
+ }
+
+ memDump += QString(string);
+ }
+
+ text->clear();
+ text->setText(memDump);
+}
+
+
+void MemoryBrowserWindow::keyPressEvent(QKeyEvent * e)
+{
+ if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return)
+ hide();
+ else if (e->key() == Qt::Key_PageUp)
+ {
+ memBase -= 480;
+
+ if (memBase < 0)
+ memBase = 0;
+
+ RefreshContents();
+ }
+ else if (e->key() == Qt::Key_PageDown)
+ {
+ memBase += 480;
+
+ if (memBase > (0x200000 - 480))
+ memBase = 0x200000 - 480;
+
+ RefreshContents();
+ }
+ else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus)
+ {
+ memBase -= 16;
+
+ if (memBase < 0)
+ memBase = 0;
+
+ RefreshContents();
+ }
+ else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal)
+ {
+ memBase += 16;
+
+ if (memBase > (0x200000 - 480))
+ memBase = 0x200000 - 480;
+
+ RefreshContents();
+ }
+}
--- /dev/null
+//
+// memorybrowser.h: Jaguar memory browser
+//
+// by James Hammons
+// (C) 2012 Underground Software
+//
+
+#ifndef __MEMORYBROWSER_H__
+#define __MEMORYBROWSER_H__
+
+#include <QtGui>
+#include <stdint.h>
+
+class MemoryBrowserWindow: public QWidget
+{
+ Q_OBJECT
+
+ public:
+ MemoryBrowserWindow(QWidget * parent = 0);
+
+
+ public slots:
+// void DefineAllKeys(void);
+ void RefreshContents(void);
+
+ protected:
+ void keyPressEvent(QKeyEvent *);
+
+ private:
+ QVBoxLayout * layout;
+// QTextBrowser * text;
+ QLabel * text;
+ QPushButton * refresh;
+
+ int32_t memBase;
+};
+
+#endif // __MEMORYBROWSER_H__
//
// help.cpp - Help file
//
-// by James L. Hammons
+// by James Hammons
// (C) 2011 Underground Software
//
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
//
// Who When What
// --- ---------- -------------------------------------------------------------
#include "configdialog.h"
#include "generaltab.h"
#include "version.h"
+#include "debug/memorybrowser.h"
#include "dac.h"
#include "jaguar.h"
aboutWin = new AboutWindow(this);
helpWin = new HelpWindow(this);
filePickWin = new FilePickerWindow(this);
+ memBrowseWin = new MemoryBrowserWindow(this);
videoWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
frameAdvanceAct->setShortcut(QKeySequence(tr("F7")));
connect(frameAdvanceAct, SIGNAL(triggered()), this, SLOT(FrameAdvance()));
+ // Debugger Actions
+ memBrowseAct = new QAction(QIcon(":/res/generic.png"), tr("Memory Browser"), this);
+ memBrowseAct->setStatusTip(tr("Shows the Jaguar memory browser window"));
+// memBrowseAct->setCheckable(true);
+ connect(memBrowseAct, SIGNAL(triggered()), this, SLOT(ShowMemoryBrowserWin()));
+
// Misc. connections...
connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString)));
connect(filePickWin, SIGNAL(FilePickerHiding()), this, SLOT(Unpause()));
fileMenu->addAction(configAct);
fileMenu->addAction(quitAppAct);
+ if (vjs.hardwareTypeAlpine)
+ {
+ debugMenu = menuBar()->addMenu(tr("&Debug"));
+ debugMenu->addAction(memBrowseAct);
+ }
+
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(helpAct);
helpMenu->addAction(aboutAct);
toolbar->addSeparator();
toolbar->addAction(blurAct);
+ if (vjs.hardwareTypeAlpine)
+ {
+ debugbar = addToolBar(tr("&Debug"));
+ debugbar->addAction(memBrowseAct);
+ }
+
// Create status bar
statusBar()->showMessage(tr("Ready"));
}
+void MainWin::ShowMemoryBrowserWin(void)
+{
+ memBrowseWin->show();
+ memBrowseWin->RefreshContents();
+}
+
+
void MainWin::ResizeMainWindow(void)
{
videoWidget->setFixedSize(zoomLevel * 320, zoomLevel * (vjs.hardwareTypeNTSC ? 240 : 256));
class AboutWindow;
class HelpWindow;
class FilePickerWindow;
+class MemoryBrowserWindow;
class MainWin: public QMainWindow
{
void ToggleCDUsage(void);
void FrameAdvance(void);
+ void ShowMemoryBrowserWin(void);
+
private:
void HandleKeys(QKeyEvent *, bool);
void ResizeMainWindow(void);
AboutWindow * aboutWin;
HelpWindow * helpWin;
FilePickerWindow * filePickWin;
+ MemoryBrowserWindow * memBrowseWin;
QTimer * timer;
bool running;
int zoomLevel;
private:
QMenu * fileMenu;
QMenu * helpMenu;
+ QMenu * debugMenu;
QToolBar * toolbar;
+ QToolBar * debugbar;
QActionGroup * zoomActs;
QActionGroup * tvTypeActs;
QAction * configAct;
QAction * useCDAct;
QAction * frameAdvanceAct;
-
+
+ QAction * memBrowseAct;
+
QIcon powerGreen;
QIcon powerRed;
};
//
void Exception(int nr, uint32_t oldpc, int ExceptionSource)
{
-printf("Exception #%i occurred!\n", nr);
+char excNames[33][64] = {
+ "???", "???", "Bus Error", "Address Error",
+ "Illegal Instruction", "Zero Divide", "CHK", "TrapV",
+ "Privilege Violation", "Trace", "Line A", "Line F",
+ "???", "???", "Format Error", "Uninitialized Interrupt",
+ "???", "???", "???", "???",
+ "???", "???", "???", "???",
+ "Spurious/Autovector", "???", "???", "???",
+ "???", "???", "???", "???",
+ "Trap #"
+};
+
+printf("Exception #%i occurred! (%s)\n", nr, (nr < 32 ? excNames[nr] : (nr < 48 ? "Trap #" : "????")));
printf("Vector @ #%i = %08X\n", nr, m68k_read_memory_32(nr * 4));
//abort();
uint32_t currpc = m68k_getpc(), newpc;
DEPENDPATH = \
src \
src/gui \
+ src/gui/debug \
src/m68000
# The GUI
src/gui/imagedelegate.h \
src/gui/keygrabber.h \
src/gui/mainwin.h \
+ src/gui/debug/memorybrowser.h \
# src/gui/sdljoystick.h
SOURCES = \
src/gui/imagedelegate.cpp \
src/gui/keygrabber.cpp \
src/gui/mainwin.cpp \
+ src/gui/debug/memorybrowser.cpp \
# src/gui/sdljoystick.cpp