diff backend.c @ 1079:329ff62ea391

Add a new memory map flag to support an auxilliary buffer for translating code from MMAP_PTR_IDX chunks for which the pointer is null
author Michael Pavone <pavone@retrodev.com>
date Tue, 04 Oct 2016 18:30:24 -0700
parents fc04781f4d28
children 8f14767661fa
line wrap: on
line diff
--- a/backend.c	Tue Oct 04 18:28:35 2016 -0700
+++ b/backend.c	Tue Oct 04 18:30:24 2016 -0700
@@ -65,6 +65,9 @@
 				? mem_pointers[memmap[chunk].ptr_index]
 				: memmap[chunk].buffer;
 			if (!base) {
+				if (memmap[chunk].flags & MMAP_AUX_BUFF) {
+					return memmap[chunk].buffer + (address & memmap[chunk].aux_mask);
+				}
 				return NULL;
 			}
 			return base + (address & memmap[chunk].mask);