]> Shamusworld >> Repos - virtualjaguar/commitdiff
Hooked up CD BIOS loading/running.
authorShamus Hammons <jlhamm@acm.org>
Tue, 5 Jul 2011 05:16:55 +0000 (05:16 +0000)
committerShamus Hammons <jlhamm@acm.org>
Tue, 5 Jul 2011 05:16:55 +0000 (05:16 +0000)
src/gui/filelistmodel.cpp
src/gui/mainwin.cpp
src/gui/mainwin.h
src/memory.cpp
src/memory.h

index 8308c5c946123c3511c1eb07f7b776e8519c1123..626b296d9b637af178649f089da61cb4d164e421 100644 (file)
@@ -131,6 +131,9 @@ void FileListModel::AddData(unsigned long index, QString str, QImage img, unsign
        data.crc = fileCrc;
 
        list.push_back(data);
+//This is probably not the best way to do this, it prevents the user from using the
+//list while it populates.
+#warning "!!! AddData calls reset() for every addition, this is bad !!!"
        reset();
 }
 
index c700976d798c4ff8498286dc7f3df52d5b75b24c..88e55f80ee37a30ceed540b82b864988bdcca4a5 100644 (file)
 //
 // STILL TO BE DONE:
 //
+// - Autoscan/autoload all available BIOS from 'software' folder
+// - Controller configuration
+// - Remove SDL dependencies (sound, mainly) from Jaguar core lib
+// - Add 1 key jumping in cartridge list (press 'R', jumps to carts starting with 'R', etc)
+// - Add dbl click/enter to select in cart list, ESC to dimiss
 //
 
+/*
+For BIOS autoscan, infrastructure is already there in filethread.cpp; just need to figure out
+if we want to scan every time, or stuff filenames found into the config file, or what.
+Should filethread emit signal that's intercepted here? Maybe...
+*/
+
 // Uncomment this for debugging...
 //#define DEBUG
 //#define DEBUGFOO                     // Various tool debugging...
@@ -47,6 +58,7 @@
 
 // Uncomment this to use built-in BIOS/CD-ROM BIOS
 // You'll need a copy of jagboot.h & jagcd.h for this to work...!
+// Creating those is left as an exercise for the reader. ;-)
 //#define USE_BUILT_IN_BIOS
 
 #ifdef USE_BUILT_IN_BIOS
@@ -67,7 +79,7 @@
 // use, we can drop it in anywhere and use it as-is.
 
 MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit(true),
-       cartridgeLoaded(false)
+       cartridgeLoaded(false), CDActive(false)
 {
        videoWidget = new GLWidget(this);
        setCentralWidget(videoWidget);
@@ -152,6 +164,12 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit
        configAct->setShortcut(QKeySequence(tr("Ctrl+c")));
        connect(configAct, SIGNAL(triggered()), this, SLOT(Configure()));
 
+       useCDAct = new QAction(QIcon(":/res/generic.png"), tr("&Use CD Unit"), this);
+       useCDAct->setStatusTip(tr("Use Jaguar Virtual CD unit"));
+//     useCDAct->setShortcut(QKeySequence(tr("Ctrl+c")));
+       useCDAct->setCheckable(true);
+       connect(useCDAct, SIGNAL(triggered()), this, SLOT(ToggleCDUsage()));
+
        // Misc. connections...
        connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString)));
 
@@ -159,6 +177,7 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit
 
        fileMenu = menuBar()->addMenu(tr("&File"));
        fileMenu->addAction(filePickAct);
+       fileMenu->addAction(useCDAct);
        fileMenu->addAction(powerAct);
        fileMenu->addAction(pauseAct);
        fileMenu->addAction(configAct);
@@ -171,6 +190,7 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit
        toolbar->addAction(powerAct);
        toolbar->addAction(pauseAct);
        toolbar->addAction(filePickAct);
+       toolbar->addAction(useCDAct);
        toolbar->addSeparator();
        toolbar->addAction(x1Act);
        toolbar->addAction(x2Act);
@@ -461,9 +481,19 @@ void MainWin::TogglePowerState(void)
        }
        else
        {
-               showUntunedTankCircuit = (cartridgeLoaded ? false : true);
-               pauseAct->setChecked(false);
-               pauseAct->setDisabled(!cartridgeLoaded);
+               if (!CDActive)
+               {
+                       showUntunedTankCircuit = (cartridgeLoaded ? false : true);
+                       pauseAct->setChecked(false);
+                       pauseAct->setDisabled(!cartridgeLoaded);
+               }
+               else
+               {
+                       showUntunedTankCircuit = false;
+                       pauseAct->setChecked(false);
+                       pauseAct->setDisabled(false);
+                       memcpy(jagMemSpace + 0x800000, jaguarCDBootROM, 0x40000);
+               }
 
 //(Err, what's so crappy about this? It seems to do what it's supposed to...)
 //This is crappy!!! !!! FIX !!!
@@ -568,6 +598,20 @@ void MainWin::LoadSoftware(QString file)
        setWindowTitle(newTitle);
 }
 
+void MainWin::ToggleCDUsage(void)
+{
+       CDActive = !CDActive;
+
+       if (CDActive)
+       {
+               powerAct->setDisabled(false);
+       }
+       else
+       {
+               powerAct->setDisabled(true);
+       }
+}
+
 void MainWin::ResizeMainWindow(void)
 {
        videoWidget->setFixedSize(zoomLevel * 320, zoomLevel * (vjs.hardwareTypeNTSC ? 240 : 256));
index 9149c554803a6f05ed32052c2c0b1d1232e99b20..55766682a6bb72f4e0ff45c1d74099fc00d89bb8 100644 (file)
@@ -44,6 +44,7 @@ class MainWin: public QMainWindow
                void ShowAboutWin(void);
                void InsertCart(void);
                void LoadSoftware(QString);
+               void ToggleCDUsage(void);
 
        private:
                void HandleKeys(QKeyEvent *, bool);
@@ -62,6 +63,7 @@ class MainWin: public QMainWindow
                bool showUntunedTankCircuit;
                bool cartridgeLoaded;
                bool allowUnknownSoftware;
+               bool CDActive;
 
                QMenu * fileMenu;
                QMenu * helpMenu;
@@ -82,6 +84,7 @@ class MainWin: public QMainWindow
                QAction * aboutAct;
                QAction * filePickAct;
                QAction * configAct;
+               QAction * useCDAct;
 };
 
 #endif // __MAINWIN_H__
index 0343f612755aa5c5bc262a6a6aebf7923ea1b51c..f37168ba9db9cb04bdecc06cbc8fb0a9079aeef8 100644 (file)
@@ -37,6 +37,9 @@ uint8 * dspRAM        = &jagMemSpace[0xF1B000];
 
 uint8 jaguarBootROM[0x040000];                                 // 68K CPU BIOS ROM--uses only half of this!
 uint8 jaguarCDBootROM[0x040000];                               // 68K CPU CD BIOS ROM (256K)
+uint8 jaguarDevBootROM1[0x040000];                             // 68K CPU Stubulator 1 ROM--uses only half of this!
+uint8 jaguarDevBootROM2[0x040000];                             // 68K CPU Stubulator 2 ROM--uses only half of this!
+uint8 jaguarDevCDBootROM[0x040000];                            // 68K CPU Dev CD BIOS ROM (256K)
 
 
 #if 0
@@ -148,7 +151,7 @@ uint32 butch, dscntrl, ds_data, i2cntrl, sbcntrl, subdata, subdatb, sb_time, fif
 //this isn't endian safe...
 #define BSWAP64(x) ((htonl(x & 0xFFFFFFFF) << 32) | htonl(x >> 32))
 // Actually, we use ESAFExx() macros instead of this, and we use GCC to check the endianness...
-// Acutally, considering that "byteswap.h" doesn't exist elsewhere, the above
+// Actually, considering that "byteswap.h" doesn't exist elsewhere, the above
 // is probably our best bet here. Just need to rename them to ESAFExx().
 
 uint16 & memcon1   = *((uint16 *)&jagMemSpace[0xF00000]);
index 900325e82a6259540bbaf020626bba611c9af828..75a9e18de7b228a86f1818fabb119f08e59b597d 100644 (file)
@@ -15,6 +15,9 @@ extern uint8 * jaguarMainRAM;
 extern uint8 * jaguarMainROM;
 extern uint8 jaguarBootROM[];
 extern uint8 jaguarCDBootROM[];
+extern uint8 jaguarDevBootROM1[];
+extern uint8 jaguarDevBootROM2[];
+extern uint8 jaguarDevCDBootROM[];
 extern uint8 * gpuRAM;
 extern uint8 * dspRAM;