From 2a13a69116a9fed94f74fca659dd66a65c20bbf4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Mari Date: Wed, 2 Oct 2019 16:17:54 -0400 Subject: [PATCH] Fix potential emulator freeze after an exception has occured --- docs/vj_HistoryNotes.txt | 1 + src/jaguar.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/vj_HistoryNotes.txt b/docs/vj_HistoryNotes.txt index c52c658..a42986c 100644 --- a/docs/vj_HistoryNotes.txt +++ b/docs/vj_HistoryNotes.txt @@ -10,6 +10,7 @@ Release 5 (TBA) 4) Added detection for the unsigned/signed short type -- Will allow the return of a short type variable's value 5) Added a specific breakpoint for the M68K Unimplemented instruction, and Exception not referenced exceptions +6) Fix potential emulator freeze after an exception has occured Release 4a (15th August 2019) ----------------------------- diff --git a/src/jaguar.cpp b/src/jaguar.cpp index 6e4b04a..15c3215 100644 --- a/src/jaguar.cpp +++ b/src/jaguar.cpp @@ -16,6 +16,7 @@ // JPM 09/04/2018 Added the new Models and BIOS handler // 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 // @@ -126,6 +127,7 @@ uint32_t bpmAddress1; S_BrkInfo *brkInfo; size_t brkNbr; +bool frameDone; // // Callback function to detect illegal instructions @@ -1480,6 +1482,8 @@ unsigned int m68k_read_memory_32(unsigned int address) m68k_read_exception_vector(address, "Exception not referenced"); break; } + + frameDone = true; // Hack to avoid the freeze of the emulator } else { @@ -2579,7 +2583,6 @@ uint8_t * GetRamPtr(void) // New Jaguar execution stack // This executes 1 frame's worth of code. // -bool frameDone; void JaguarExecuteNew(void) { frameDone = false; -- 2.20.1