changeset 2151:01ad74197414

Fix regression in Sonic & Knuckles
author Michael Pavone <pavone@retrodev.com>
date Wed, 30 Mar 2022 23:20:45 -0700
parents a418fa599b2e
children c3ee42c89b27
files m68k_core.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/m68k_core.c	Wed Mar 30 23:15:45 2022 -0700
+++ b/m68k_core.c	Wed Mar 30 23:20:45 2022 -0700
@@ -1035,6 +1035,13 @@
 				break;
 			}
 			memmap_chunk const *chunk = find_map_chunk(address, &opts->gen, 0, NULL);
+			if (!(chunk->flags & MMAP_READ)) {
+				code_ptr start = code->cur;
+				defer_translation(&opts->gen, address, opts->retrans_stub);
+				code_ptr after = code->cur;
+				map_native_address(context, address, start, 2, after-start);
+				break;
+			}
 			if (!starting_chunk) {
 				starting_chunk = chunk;
 			} else if (starting_chunk != chunk) {