From: Jean-Paul Mari Date: Sat, 17 Aug 2019 21:14:56 +0000 (-0400) Subject: Added a specific breakpoint for the M68K illegal instruction exception X-Git-Tag: v2.1.3-R5^2~49 X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/commitdiff_plain/f6eb33e689fbe0fd88d910b23b62a4e64ecf87cb Added a specific breakpoint for the M68K illegal instruction exception --- diff --git a/.gitignore b/.gitignore index ffc38f5..d3a73c2 100644 --- a/.gitignore +++ b/.gitignore @@ -31,5 +31,6 @@ Win-VS2017/virtualjaguar.VC.VC.opendb Win-VS2017/virtualjaguar.sdf Win-VS2017/virtualjaguar.vcxproj.user Win-VS2017/GeneratedFiles/ +Win-VS2017/GeneratedFiles/qrc_virtualjaguar.cpp Win-VS2015/ -Win-VS2019/ +Win-VS2019/ diff --git a/docs/vj_HistoryNotes.txt b/docs/vj_HistoryNotes.txt index 87d145b..ecefb68 100644 --- a/docs/vj_HistoryNotes.txt +++ b/docs/vj_HistoryNotes.txt @@ -2,6 +2,8 @@ Release 5 (TBA) --------------- 0) Added a date creation stamp in the application command line information - This date already appears in the Release 4 executable but was not referenced in his history note +1) Added a specific breakpoint for the M68K illegal instruction exception +-- Alert box will display a message and then the code will stop Release 4a (15th August 2019) ----------------------------- diff --git a/src/jaguar.cpp b/src/jaguar.cpp index 638cfe3..69a22d5 100644 --- a/src/jaguar.cpp +++ b/src/jaguar.cpp @@ -1418,6 +1418,22 @@ unsigned int m68k_read_memory_16(unsigned int address) } +// Alert message in case of exception vector request +bool m68k_read_exception_vector(unsigned int address, char *text) +{ + QString msg; + QMessageBox msgBox; + + msg.sprintf("$%06x: %s", pcQueue[pcQPtr ? (pcQPtr - 1) : 0x3FF], text); + msgBox.setText(msg); + msgBox.setStandardButtons(QMessageBox::Abort); + msgBox.setDefaultButton(QMessageBox::Abort); + msgBox.exec(); + return M68KDebugHalt(); +} + + +// Read 4 bytes from memory unsigned int m68k_read_memory_32(unsigned int address) { #ifdef ALPINE_FUNCTIONS @@ -1436,23 +1452,36 @@ unsigned int m68k_read_memory_32(unsigned int address) //WriteLog("--> [RM32]\n"); #ifndef USE_NEW_MMU - uint32_t retVal = 0; + //uint32_t retVal = 0; - if ((address >= 0x800000) && (address <= 0xDFFEFE)) + // check exception vectors access + if ((address >= 0x8) && (address <= 0x7c)) { - // Memory Track reading... - if (((TOMGetMEMCON1() & 0x0006) == (2 << 1)) && (jaguarMainROMCRC32 == 0xFDF37F47)) + switch (address) { - retVal = MTReadLong(address); + case 0x10: + m68k_read_exception_vector(address, "Illegal instruction"); + break; } - else + } + else + { + // check ROM or Memory Track access + if ((address >= 0x800000) && (address <= 0xDFFEFE)) { - retVal = GET32(jaguarMainROM, address - 0x800000); + // Memory Track reading... + if (((TOMGetMEMCON1() & 0x0006) == (2 << 1)) && (jaguarMainROMCRC32 == 0xFDF37F47)) + { + return MTReadLong(address); + } + else + { + return GET32(jaguarMainROM, address - 0x800000); + } } - - return retVal; } + // return value from memory return (m68k_read_memory_16(address) << 16) | m68k_read_memory_16(address + 2); #else return MMURead32(address, M68K);