From 8ad096f5309ac7c3876b22b6d048f229cdf5677d Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 14 May 2019 23:20:35 -0700 Subject: Differentiate between the full Sega mapper and the SRAM only one. Fixes crash on save state load for Phantasy Star IV and other games that use the same mapper --- sega_mapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sega_mapper.c') diff --git a/sega_mapper.c b/sega_mapper.c index 1410f0c..a217b8a 100644 --- a/sega_mapper.c +++ b/sega_mapper.c @@ -116,7 +116,7 @@ m68k_context * write_bank_reg_w(uint32_t address, m68k_context * context, uint16 context->mem_pointers[gen->mapper_start_index + i] = gen->cart + 0x40000*gen->bank_regs[i]; } } - } else { + } else if (gen->mapper_type == MAPPER_SEGA) { 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); -- cgit v1.2.3