changeset 1470:1e3e0205640f

Add support for writeable ROM and an entry for Game no Kanzume Otokuyou using that support as it expects the cart area to be writable
author Michael Pavone <pavone@retrodev.com>
date Sat, 14 Oct 2017 05:03:38 -0700
parents 723f6381cffa
children 2e6320d261ff
files rom.db romdb.c
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rom.db	Mon Oct 09 07:48:48 2017 -0700
+++ b/rom.db	Sat Oct 14 05:03:38 2017 -0700
@@ -1287,3 +1287,15 @@
 		}
 	}
 }
+31c66bd13abf4ae8271c09ec5286a0ee0289dbbc {
+	#Designed to run on Sega Channel hardware which is RAM-based
+	#writes to the this RAM qutie a bit to select games
+	name Game no Kanzume Otokuyou
+	map {
+		0 {
+			device ROM
+			last 3FFFFF
+			writeable yes
+		}
+	}
+}
--- a/romdb.c	Mon Oct 09 07:48:48 2017 -0700
+++ b/romdb.c	Sat Oct 14 05:03:38 2017 -0700
@@ -559,8 +559,12 @@
 	map->end = end + 1;
 	if (!strcmp(dtype, "ROM")) {
 		map->buffer = state->rom + offset;
-		map->flags = MMAP_READ;
 		map->mask = calc_mask(state->rom_size - offset, start, end);
+		if (strcmp(tern_find_ptr_default(node, "writeable", "no"), "yes")) {
+			map->flags = MMAP_READ;
+		} else {
+			map->flags = MMAP_READ | MMAP_WRITE | MMAP_CODE;
+		}
 	} else if (!strcmp(dtype, "LOCK-ON")) {
 		rom_info lock_info;
 		if (state->lock_on) {