changeset 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 c4bfbf55d418
children 382614130914
files backend.c backend.h
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
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);
--- a/backend.h	Tue Oct 04 18:28:35 2016 -0700
+++ b/backend.h	Tue Oct 04 18:30:24 2016 -0700
@@ -55,6 +55,7 @@
 #define MMAP_ONLY_EVEN 0x20
 #define MMAP_FUNC_NULL 0x40
 #define MMAP_BYTESWAP  0x80
+#define MMAP_AUX_BUFF  0x100
 
 typedef uint16_t (*read_16_fun)(uint32_t address, void * context);
 typedef uint8_t (*read_8_fun)(uint32_t address, void * context);
@@ -65,6 +66,7 @@
 	uint32_t     start;
 	uint32_t     end;
 	uint32_t     mask;
+	uint32_t     aux_mask;
 	uint16_t     ptr_index;
 	uint16_t     flags;
 	void *       buffer;