Updated the M68K exception catch
authorJean-Paul Mari <djipi.mari@gmail.com>
Mon, 1 Mar 2021 02:50:06 +0000 (21:50 -0500)
committerJean-Paul Mari <djipi.mari@gmail.com>
Mon, 1 Mar 2021 02:50:06 +0000 (21:50 -0500)
Added a check in the Alpine tab settings
Added a specific breakpoint for the M68K bus error exception

docs/vj_HistoryNotes.txt
src/gui/alpinetab.cpp
src/gui/alpinetab.h
src/gui/mainwin.cpp
src/jaguar.cpp
src/settings.h

index d4821be..dab23b7 100644 (file)
@@ -29,6 +29,9 @@ Release 5 (TBA)
 -- Added the relative directory path for the Qt include files
 20) Merge the Linux build fixes from @richard42
 -- Jaguar core's makefile and Qt pro file updates, fix filenames case sensitive & fixes for Linux
+21) Updated the M68K exception catch
+-- Added a M68K exception catch check in the Alpine tab settings
+-- Added a specific breakpoint for the M68K bus error exception
 
 Release 4a (15th August 2019)
 -----------------------------
index 23f8b24..bbd12b6 100644 (file)
@@ -12,6 +12,7 @@
 // ---  ----------  ------------------------------------------------------------
 // JLH  07/15/2011  Created this file
 // JPM  09/03/2018  Depend the platform transform slashes or backslashes
+// JPM   Feb./2021  Added a M68K exception catch check
 //
 
 #include "alpinetab.h"
@@ -59,7 +60,8 @@ AlpineTab::AlpineTab(QWidget * parent/*= 0*/): QWidget(parent)
        layout4->addLayout(layout3);
 
        // Checkboxes...
-       writeROM         = new QCheckBox(tr("Allow writes to cartridge ROM"));
+       writeROM = new QCheckBox(tr("Allow writes to cartridge ROM"));
+       M68KExceptionCatch = new QCheckBox(tr("Allow M68000 exception catch"));
 //     useDSP             = new QCheckBox(tr("Enable DSP"));
 //     useHostAudio       = new QCheckBox(tr("Enable audio playback"));
 //     useUnknownSoftware = new QCheckBox(tr("Allow unknown software in file chooser"));
@@ -67,6 +69,7 @@ AlpineTab::AlpineTab(QWidget * parent/*= 0*/): QWidget(parent)
        //writeROM->setDisabled(true);
 
        layout4->addWidget(writeROM);
+       layout4->addWidget(M68KExceptionCatch);
 //     layout4->addWidget(useDSP);
 //     layout4->addWidget(useHostAudio);
 //     layout4->addWidget(useUnknownSoftware);
@@ -89,6 +92,7 @@ void AlpineTab::GetSettings(void)
        edit2->setText(vjs.absROMPath);
        edit3->setText(v.toString());
        writeROM->setChecked(vjs.allowWritesToROM);
+       M68KExceptionCatch->setChecked(vjs.allowM68KExceptionCatch);
 }
 
 
@@ -101,6 +105,7 @@ void AlpineTab::SetSettings(void)
        strcpy(vjs.absROMPath, CheckForSlashes(edit2->text()).toUtf8().data());
        vjs.refresh = edit3->text().toUInt(&ok, 10);
        vjs.allowWritesToROM = writeROM->isChecked();
+       vjs.allowM68KExceptionCatch = M68KExceptionCatch->isChecked();
 }
 
 
index 0ccb777..13312c3 100644 (file)
@@ -23,6 +23,7 @@ class AlpineTab: public QWidget
 //             QLineEdit * edit3;\r
 //             QLineEdit * edit4;\r
                QCheckBox * writeROM;\r
+               QCheckBox * M68KExceptionCatch;\r
 //             QCheckBox * useDSP;\r
 //             QCheckBox * useHostAudio;\r
 //             QCheckBox * useUnknownSoftware;\r
index eca4846..478dcd2 100644 (file)
@@ -1952,6 +1952,7 @@ void MainWin::ReadSettings(void)
        strcpy(vjs.absROMPath, settings.value("DefaultABS", "").toString().toUtf8().data());\r
        vjs.refresh = settings.value("refresh", 60).toUInt();\r
        vjs.allowWritesToROM = settings.value("writeROM", false).toBool();\r
+       vjs.allowM68KExceptionCatch = settings.value("M68KExceptionCatch", false).toBool();\r
        settings.endGroup();\r
 \r
        // Read settings from the Keybindings\r
@@ -2252,6 +2253,7 @@ void MainWin::WriteSettings(void)
        settings.setValue("DefaultROM", vjs.alpineROMPath);\r
        settings.setValue("DefaultABS", vjs.absROMPath);\r
        settings.setValue("writeROM", vjs.allowWritesToROM);\r
+       settings.setValue("M68KExceptionCatch", vjs.allowM68KExceptionCatch);\r
        settings.endGroup();\r
 \r
        // Write settings from the Debugger mode\r
index da06a96..4f7cb91 100644 (file)
@@ -17,6 +17,7 @@
 // JPM  10/13/2018  Added breakpoints features
 // JPM   Aug./2019  Fix specific breakpoint for ROM cartridge or unknown memory location writing; added a specific breakpoint for the M68K illegal & unimplemented instruction, unknown exceptions and address error exceptions
 // JPM   Aug./2019  Fix potential emulator freeze after an exception has occured
+// JPM   Feb./2021  Added a specific breakpoint for the M68K bus error exception, and a M68K exception catch detection
 //
 
 
@@ -1462,10 +1463,14 @@ unsigned int m68k_read_memory_32(unsigned int address)
        //uint32_t retVal = 0;
 
        // check exception vectors access
-       if ((address >= 0x8) && (address <= 0x7c))
+       if (vjs.allowM68KExceptionCatch && (address >= 0x8) && (address <= 0x7c))
        {
                switch (address)
                {
+               case 0x08:
+                       m68k_read_exception_vector(address, "Bus error");
+                       break;
+
                case 0x0c:
                        m68k_read_exception_vector(address, "Address error");
                        break;
index eef2963..e762201 100644 (file)
@@ -79,6 +79,7 @@ struct VJSettings
        uint32_t frameSkip;\r
        uint32_t renderType;\r
        uint32_t refresh;\r
+       bool allowM68KExceptionCatch;                                                           // Allow M68K exception catch\r
        bool allowWritesToROM;                                                                          // Allow writing to ROM cartdridge\r
        uint32_t biosType;                                                                                      // Bios type used\r
        uint32_t jaguarModel;                                                                           // Jaguar model\r