# HG changeset patch # User Michael Pavone # Date 1492762780 25200 # Node ID 2fc444b69351dc10fe4e7ffa2e6ff147302fc7c7 # Parent c9dc2603b0876407304f1350da0d935caacb91a2 Minor optimization to avoid invalidating translated code when the bank has not actually changed. Makes a nasty edge case in the 68K debugger slightly less severe when dealing with code that uses banking diff -r c9dc2603b087 -r 2fc444b69351 romdb.c --- a/romdb.c Thu Apr 20 22:28:58 2017 -0700 +++ b/romdb.c Fri Apr 21 01:19:40 2017 -0700 @@ -296,8 +296,11 @@ } } } 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; }