From 65de831ad38f0846261f3dd3fbab787234d45627 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 14 Oct 2017 05:03:38 -0700 Subject: 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 --- rom.db | 12 ++++++++++++ romdb.c | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/rom.db b/rom.db index a1d9706..1be4279 100644 --- a/rom.db +++ b/rom.db @@ -1287,3 +1287,15 @@ e1c041ba69da087c428dcda16850159f3caebd4b { } } } +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 + } + } +} diff --git a/romdb.c b/romdb.c index a6afc80..983829b 100644 --- a/romdb.c +++ b/romdb.c @@ -559,8 +559,12 @@ void map_iter_fun(char *key, tern_val val, uint8_t valtype, void *data) 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) { -- cgit v1.2.3