From 28c2bdc6e261bb48e71df896d9292f47189a0e3f Mon Sep 17 00:00:00 2001 From: Jean-Paul Mari Date: Sun, 28 Feb 2021 21:50:06 -0500 Subject: [PATCH] Updated the M68K exception catch Added a check in the Alpine tab settings Added a specific breakpoint for the M68K bus error exception --- docs/vj_HistoryNotes.txt | 3 +++ src/gui/alpinetab.cpp | 7 ++++++- src/gui/alpinetab.h | 1 + src/gui/mainwin.cpp | 2 ++ src/jaguar.cpp | 7 ++++++- src/settings.h | 1 + 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/vj_HistoryNotes.txt b/docs/vj_HistoryNotes.txt index d4821be..dab23b7 100644 --- a/docs/vj_HistoryNotes.txt +++ b/docs/vj_HistoryNotes.txt @@ -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) ----------------------------- diff --git a/src/gui/alpinetab.cpp b/src/gui/alpinetab.cpp index 23f8b24..bbd12b6 100644 --- a/src/gui/alpinetab.cpp +++ b/src/gui/alpinetab.cpp @@ -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(); } diff --git a/src/gui/alpinetab.h b/src/gui/alpinetab.h index 0ccb777..13312c3 100644 --- a/src/gui/alpinetab.h +++ b/src/gui/alpinetab.h @@ -23,6 +23,7 @@ class AlpineTab: public QWidget // QLineEdit * edit3; // QLineEdit * edit4; QCheckBox * writeROM; + QCheckBox * M68KExceptionCatch; // QCheckBox * useDSP; // QCheckBox * useHostAudio; // QCheckBox * useUnknownSoftware; diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index eca4846..478dcd2 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -1952,6 +1952,7 @@ void MainWin::ReadSettings(void) strcpy(vjs.absROMPath, settings.value("DefaultABS", "").toString().toUtf8().data()); vjs.refresh = settings.value("refresh", 60).toUInt(); vjs.allowWritesToROM = settings.value("writeROM", false).toBool(); + vjs.allowM68KExceptionCatch = settings.value("M68KExceptionCatch", false).toBool(); settings.endGroup(); // Read settings from the Keybindings @@ -2252,6 +2253,7 @@ void MainWin::WriteSettings(void) settings.setValue("DefaultROM", vjs.alpineROMPath); settings.setValue("DefaultABS", vjs.absROMPath); settings.setValue("writeROM", vjs.allowWritesToROM); + settings.setValue("M68KExceptionCatch", vjs.allowM68KExceptionCatch); settings.endGroup(); // Write settings from the Debugger mode diff --git a/src/jaguar.cpp b/src/jaguar.cpp index da06a96..4f7cb91 100644 --- a/src/jaguar.cpp +++ b/src/jaguar.cpp @@ -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; diff --git a/src/settings.h b/src/settings.h index eef2963..e762201 100644 --- a/src/settings.h +++ b/src/settings.h @@ -79,6 +79,7 @@ struct VJSettings uint32_t frameSkip; uint32_t renderType; uint32_t refresh; + bool allowM68KExceptionCatch; // Allow M68K exception catch bool allowWritesToROM; // Allow writing to ROM cartdridge uint32_t biosType; // Bios type used uint32_t jaguarModel; // Jaguar model -- 2.20.1