summaryrefslogtreecommitdiff
path: root/romdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'romdb.c')
-rw-r--r--romdb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/romdb.c b/romdb.c
index 48a76a7..c603521 100644
--- a/romdb.c
+++ b/romdb.c
@@ -296,8 +296,11 @@ m68k_context * write_bank_reg_w(uint32_t address, m68k_context * context, uint16
}
}
} else {
- m68k_invalidate_code_range(gen->m68k, address * 0x80000, (address + 1) * 0x80000);
- context->mem_pointers[gen->mapper_start_index + address] = gen->cart + 0x40000*value;
+ void *new_ptr = gen->cart + 0x40000*value;
+ if (context->mem_pointers[gen->mapper_start_index + address] != new_ptr) {
+ m68k_invalidate_code_range(gen->m68k, address * 0x80000, (address + 1) * 0x80000);
+ context->mem_pointers[gen->mapper_start_index + address] = new_ptr;
+ }
}
return context;
}