\
obj/about.o \
obj/app.o \
- obj/configwin.o \
+ obj/configdialog.o \
+ obj/moc_configdialog.o \
+ obj/generaltab.o \
+ obj/moc_generaltab.o \
+ obj/controllertab.o \
+ obj/moc_controllertab.o \
obj/filepicker.o \
obj/moc_filepicker.o \
obj/filelistmodel.o \
--- /dev/null
+//
+// configdialog.cpp - Configuration dialog
+//
+// by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -------------------------------------------------------------
+// JLH 01/29/2010 Created this file
+// JLH 06/23/2011 Added initial implementation
+//
+
+#include "configdialog.h"
+
+#include "generaltab.h"
+#include "controllertab.h"
+#include "settings.h"
+
+
+ConfigDialog::ConfigDialog(QWidget * parent/*= 0*/): QDialog(parent)
+{
+ tabWidget = new QTabWidget;
+ generalTab = new GeneralTab(this);
+ controllerTab = new ControllerTab(this);
+ tabWidget->addTab(generalTab, tr("General"));
+ tabWidget->addTab(controllerTab, tr("Controller"));
+
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+
+ QVBoxLayout * mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(tabWidget);
+ mainLayout->addWidget(buttonBox);
+ setLayout(mainLayout);
+
+ setWindowTitle(tr("Virtual Jaguar Settings"));
+
+ LoadDialogFromSettings();
+}
+
+ConfigDialog::~ConfigDialog()
+{
+}
+
+void ConfigDialog::LoadDialogFromSettings(void)
+{
+ generalTab->edit1->setText(vjs.jagBootPath);
+ generalTab->edit2->setText(vjs.CDBootPath);
+ generalTab->edit3->setText(vjs.EEPROMPath);
+ generalTab->edit4->setText(vjs.ROMPath);
+}
+
+void ConfigDialog::UpdateVJSettings(void)
+{
+ strcpy(vjs.jagBootPath, generalTab->edit1->text().toAscii().data());
+ strcpy(vjs.CDBootPath, generalTab->edit2->text().toAscii().data());
+ strcpy(vjs.EEPROMPath, generalTab->edit3->text().toAscii().data());
+ strcpy(vjs.ROMPath, generalTab->edit4->text().toAscii().data());
+}
--- /dev/null
+//
+// configdialog.h - Configuration dialog
+//
+// by James L. Hammons
+// (C) 2010 Underground Software
+//
+
+#ifndef __CONFIGDIALOG_H__
+#define __CONFIGDIALOG_H__
+
+#include <QtGui>
+
+class GeneralTab;
+class ControllerTab;
+
+class ConfigDialog: public QDialog
+{
+ Q_OBJECT
+
+ public:
+ ConfigDialog(QWidget * parent = 0);
+ ~ConfigDialog();
+ void UpdateVJSettings(void);
+
+ private:
+ void LoadDialogFromSettings(void);
+
+ private:
+ QTabWidget * tabWidget;
+ QDialogButtonBox * buttonBox;
+
+ public:
+ GeneralTab * generalTab;
+ ControllerTab * controllerTab;
+};
+
+#endif // __CONFIGDIALOG_H__
+++ /dev/null
-//
-// configwin.cpp - Configuration window
-//
-// by James L. Hammons
-// (C) 2010 Underground Software
-//
-// JLH = James L. Hammons <jlhamm@acm.org>
-//
-// Who When What
-// --- ---------- -------------------------------------------------------------
-// JLH 01/29/2010 Created this file
-//
-
-#include "configwin.h"
-
-#warning "!!! I NEED TO BE WRITTEN !!! PLEASE WRITE ME !!!"
+++ /dev/null
-//
-// configwin.h - Configuration window
-//
-// by James L. Hammons
-// (C) 2010 Underground Software
-//
-
-#ifndef __CONFIGWIN_H__
-#define __CONFIGWIN_H__
-
-
-
-#endif // __CONFIGWIN_H__
--- /dev/null
+//
+// controllertab.cpp: "Controller" tab on the config dialog
+//
+// Part of the Virtual Jaguar Project
+// (C) 2011 Underground Software
+// See the README and GPLv3 files for licensing and warranty information
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// WHO WHEN WHAT
+// --- ---------- ------------------------------------------------------------
+// JLH 06/23/2011 Created this file
+
+#include "controllertab.h"
+
+
+ControllerTab::ControllerTab(QWidget * parent/*= 0*/): QWidget(parent)
+{
+ QLabel * img = new QLabel;
+ img->setPixmap(QPixmap(":/res/controller.png"));
+
+ QVBoxLayout * layout = new QVBoxLayout;
+ layout->addWidget(img);
+ setLayout(layout);
+}
+
+ControllerTab::~ControllerTab()
+{
+}
+
+#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_Up).toInt();
+ vjs.p1KeyBindings[BUTTON_D] = settings.value("p1k_down", Qt::Key_Down).toInt();
+ vjs.p1KeyBindings[BUTTON_L] = settings.value("p1k_left", Qt::Key_Left).toInt();
+ vjs.p1KeyBindings[BUTTON_R] = settings.value("p1k_right", Qt::Key_Right).toInt();
+ vjs.p1KeyBindings[BUTTON_C] = settings.value("p1k_c", Qt::Key_Z).toInt();
+ vjs.p1KeyBindings[BUTTON_B] = settings.value("p1k_b", Qt::Key_X).toInt();
+ vjs.p1KeyBindings[BUTTON_A] = settings.value("p1k_a", Qt::Key_C).toInt();
+ vjs.p1KeyBindings[BUTTON_OPTION] = settings.value("p1k_option", Qt::Key_Apostrophe).toInt();
+ vjs.p1KeyBindings[BUTTON_PAUSE] = settings.value("p1k_pause", Qt::Key_Return).toInt();
+ vjs.p1KeyBindings[BUTTON_0] = settings.value("p1k_0", Qt::Key_0).toInt();
+ vjs.p1KeyBindings[BUTTON_1] = settings.value("p1k_1", Qt::Key_1).toInt();
+ vjs.p1KeyBindings[BUTTON_2] = settings.value("p1k_2", Qt::Key_2).toInt();
+ vjs.p1KeyBindings[BUTTON_3] = settings.value("p1k_3", Qt::Key_3).toInt();
+ vjs.p1KeyBindings[BUTTON_4] = settings.value("p1k_4", Qt::Key_4).toInt();
+ vjs.p1KeyBindings[BUTTON_5] = settings.value("p1k_5", Qt::Key_5).toInt();
+ vjs.p1KeyBindings[BUTTON_6] = settings.value("p1k_6", Qt::Key_6).toInt();
+ vjs.p1KeyBindings[BUTTON_7] = settings.value("p1k_7", Qt::Key_7).toInt();
+ vjs.p1KeyBindings[BUTTON_8] = settings.value("p1k_8", Qt::Key_8).toInt();
+ vjs.p1KeyBindings[BUTTON_9] = settings.value("p1k_9", Qt::Key_9).toInt();
+ vjs.p1KeyBindings[BUTTON_d] = settings.value("p1k_pound", Qt::Key_Slash).toInt();
+ vjs.p1KeyBindings[BUTTON_s] = settings.value("p1k_star", Qt::Key_Asterisk).toInt();
+
+ vjs.p2KeyBindings[BUTTON_U] = settings.value("p2k_up", Qt::Key_Up).toInt();
+ vjs.p2KeyBindings[BUTTON_D] = settings.value("p2k_down", Qt::Key_Down).toInt();
+ vjs.p2KeyBindings[BUTTON_L] = settings.value("p2k_left", Qt::Key_Left).toInt();
+ vjs.p2KeyBindings[BUTTON_R] = settings.value("p2k_right", Qt::Key_Right).toInt();
+ vjs.p2KeyBindings[BUTTON_C] = settings.value("p2k_c", Qt::Key_Z).toInt();
+ vjs.p2KeyBindings[BUTTON_B] = settings.value("p2k_b", Qt::Key_X).toInt();
+ vjs.p2KeyBindings[BUTTON_A] = settings.value("p2k_a", Qt::Key_C).toInt();
+ vjs.p2KeyBindings[BUTTON_OPTION] = settings.value("p2k_option", Qt::Key_Apostrophe).toInt();
+ vjs.p2KeyBindings[BUTTON_PAUSE] = settings.value("p2k_pause", Qt::Key_Return).toInt();
+ vjs.p2KeyBindings[BUTTON_0] = settings.value("p2k_0", Qt::Key_0).toInt();
+ vjs.p2KeyBindings[BUTTON_1] = settings.value("p2k_1", Qt::Key_1).toInt();
+ vjs.p2KeyBindings[BUTTON_2] = settings.value("p2k_2", Qt::Key_2).toInt();
+ vjs.p2KeyBindings[BUTTON_3] = settings.value("p2k_3", Qt::Key_3).toInt();
+ vjs.p2KeyBindings[BUTTON_4] = settings.value("p2k_4", Qt::Key_4).toInt();
+ vjs.p2KeyBindings[BUTTON_5] = settings.value("p2k_5", Qt::Key_5).toInt();
+ vjs.p2KeyBindings[BUTTON_6] = settings.value("p2k_6", Qt::Key_6).toInt();
+ vjs.p2KeyBindings[BUTTON_7] = settings.value("p2k_7", Qt::Key_7).toInt();
+ vjs.p2KeyBindings[BUTTON_8] = settings.value("p2k_8", Qt::Key_8).toInt();
+ 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
--- /dev/null
+#ifndef __CONTROLLERTAB_H__
+#define __CONTROLLERTAB_H__
+
+#include <QtGui>
+
+class ControllerTab: public QWidget
+{
+ Q_OBJECT
+
+ public:
+ ControllerTab(QWidget * parent = 0);
+ ~ControllerTab();
+
+ public:
+ QCheckBox * antialiasChk;
+};
+
+#endif // __CONTROLLERTAB_H__
--- /dev/null
+//
+// generaltab.cpp: "General" tab on the settings dialog
+//
+// Part of the Virtual Jaguar Project
+// (C) 2011 Underground Software
+// See the README and GPLv3 files for licensing and warranty information
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// WHO WHEN WHAT
+// --- ---------- ------------------------------------------------------------
+// JLH 06/23/2011 Created this file
+
+#include "generaltab.h"
+
+
+GeneralTab::GeneralTab(QWidget * parent/*= 0*/): QWidget(parent)
+{
+// antialiasChk = new QCheckBox(tr("Use Qt's built-in antialiasing"));
+
+// I'm thinking we should scan the bios folder for the 5 known BIOSes, and
+// just present a radio button to choose between them...
+ QLabel * label1 = new QLabel("Boot ROM:");
+ QLabel * label2 = new QLabel("CD Boot ROM:");
+ QLabel * label3 = new QLabel("EEPROMs:");
+ QLabel * label4 = new QLabel("Software:");
+
+ edit1 = new QLineEdit("");
+ edit2 = new QLineEdit("");
+ edit3 = new QLineEdit("");
+ edit4 = new QLineEdit("");
+ edit1->setPlaceholderText("Boot ROM location");
+ edit2->setPlaceholderText("CD Boot ROM location");
+ edit3->setPlaceholderText("EEPROM path");
+ edit4->setPlaceholderText("Software path");
+
+ QVBoxLayout * layout1 = new QVBoxLayout;
+ layout1->addWidget(label1);
+ layout1->addWidget(label2);
+ layout1->addWidget(label3);
+ layout1->addWidget(label4);
+
+ QVBoxLayout * layout2 = new QVBoxLayout;
+ layout2->addWidget(edit1);
+ layout2->addWidget(edit2);
+ layout2->addWidget(edit3);
+ layout2->addWidget(edit4);
+
+ QHBoxLayout * layout3 = new QHBoxLayout;
+ layout3->addLayout(layout1);
+ layout3->addLayout(layout2);
+
+ setLayout(layout3);
+}
+
+GeneralTab::~GeneralTab()
+{
+}
+
+#if 0
+ vjs.useJoystick = settings.value("useJoystick", false).toBool();
+ vjs.joyport = settings.value("joyport", 0).toInt();
+ vjs.frameSkip = settings.value("frameSkip", 0).toInt();
+ vjs.useJaguarBIOS = settings.value("useJaguarBIOS", false).toBool();
+ vjs.DSPEnabled = settings.value("DSPEnabled", false).toBool();
+ vjs.usePipelinedDSP = settings.value("usePipelinedDSP", false).toBool();
+ vjs.fullscreen = settings.value("fullscreen", false).toBool();
+ vjs.renderType = settings.value("renderType", 0).toInt();
+ strcpy(vjs.jagBootPath, settings.value("JagBootROM", "./bios/[BIOS] Atari Jaguar (USA, Europe).zip").toString().toAscii().data());
+ strcpy(vjs.CDBootPath, settings.value("CDBootROM", "./bios/jagcd.rom").toString().toAscii().data());
+ strcpy(vjs.EEPROMPath, settings.value("EEPROMs", "./eeproms").toString().toAscii().data());
+ strcpy(vjs.ROMPath, settings.value("ROMs", "./software").toString().toAscii().data());
+#endif
--- /dev/null
+#ifndef __GENERALTAB_H__
+#define __GENERALTAB_H__
+
+#include <QtGui>
+
+class GeneralTab: public QWidget
+{
+ Q_OBJECT
+
+ public:
+ GeneralTab(QWidget * parent = 0);
+ ~GeneralTab();
+
+ public:
+ QLineEdit * edit1;
+ QLineEdit * edit2;
+ QLineEdit * edit3;
+ QLineEdit * edit4;
+};
+
+#endif // __GENERALTAB_H__
#include "about.h"
#include "settings.h"
#include "filepicker.h"
+#include "configdialog.h"
#include "jaguar.h"
#include "video.h"
filePickAct->setStatusTip(tr("Insert a cartridge into Virtual Jaguar"));
connect(filePickAct, SIGNAL(triggered()), this, SLOT(InsertCart()));
+ configAct = new QAction(QIcon(":/res/generic.png"), tr("&Configure"), this);
+ configAct->setStatusTip(tr("Configure options for Virtual Jaguar"));
+ connect(configAct, SIGNAL(triggered()), this, SLOT(Configure()));
+
// Misc. connections...
connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString)));
fileMenu->addAction(filePickAct);
fileMenu->addAction(powerAct);
fileMenu->addAction(pauseAct);
+ fileMenu->addAction(configAct);
fileMenu->addAction(quitAppAct);
helpMenu = menuBar()->addMenu(tr("&Help"));
{
}
+void MainWin::Configure(void)
+{
+ // Call the configuration dialog and update settings
+ ConfigDialog dlg(this);
+
+ if (dlg.exec() == false)
+ return;
+
+ dlg.UpdateVJSettings();
+}
+
//
// Here's the main emulator loop
//
private slots:
void Open(void);
+ void Configure(void);
void Timer(void);
void TogglePowerState(void);
void ToggleRunState(void);
QAction * blurAct;
QAction * aboutAct;
QAction * filePickAct;
+ QAction * configAct;
};
#endif // __MAINWIN_H__
HEADERS += about.h
HEADERS += filepicker.h
HEADERS += filethread.h
-HEADERS += configwin.h
+HEADERS += configdialog.h
+HEADERS += generaltab.h
SOURCES += app.cpp
SOURCES += mainwin.cpp
SOURCES += about.cpp
SOURCES += filepicker.cpp
SOURCES += filethread.cpp
-SOURCES += configwin.cpp
+SOURCES += configdialog.cpp
+SOURCES += generaltab.cpp
RESOURCES += virtualjaguar.qrc