From 1d8476a80755f626235a05a718adbcfaf0125d4c Mon Sep 17 00:00:00 2001 From: Dennis Boone Date: Sat, 18 Apr 2020 01:48:22 -0400 Subject: [PATCH] Fix crash executing from registers during boot In slow mode (compiled without -DFAST), Rev. 19 would crash during boot. On investigation, the code was branching to '4 after setting up an instruction there. However, instruction fetch found a '0 instead of the expected instruction. Instructions might be fetched from registers via trap. Fast iget16() checks for fault. Slow iget16() does not, and just calls get16() which does not check. --- em.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/em.c b/em.c index 0511c8f..915cda9 100644 --- a/em.c +++ b/em.c @@ -1322,7 +1322,7 @@ static inline unsigned short iget16(ea_t ea) { } #else -#define iget16(ea) get16((ea)) +#define iget16(ea) get16t((ea)) #define iget16t(ea) get16t((ea)) #endif