summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-10-14 05:03:38 -0700
committerMichael Pavone <pavone@retrodev.com>2017-10-14 05:03:38 -0700
commit65de831ad38f0846261f3dd3fbab787234d45627 (patch)
tree5659691da598aeb04cd6249721f52917953a8f04
parent2a672fb806614a86ff2fa81c69e15023bb7779a3 (diff)
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
-rw-r--r--rom.db12
-rw-r--r--romdb.c6
2 files changed, 17 insertions, 1 deletions
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) {