From 0da3182c38f90ca6f2c7a1e5847036ccea4dd5e8 Mon Sep 17 00:00:00 2001 From: EkeEke Date: Sun, 19 Aug 2012 01:13:03 +0200 Subject: [PATCH] [MD] fixed crash when loading TMSS ROM while MD BIOS is enabled / not found --- source/genesis.c | 6 ++++-- source/membnk.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/genesis.c b/source/genesis.c index 21953a7..0b88097 100644 --- a/source/genesis.c +++ b/source/genesis.c @@ -378,7 +378,8 @@ void gen_tmss_w(unsigned int offset, unsigned int data) void gen_bankswitch_w(unsigned int data) { - if (system_hw == SYSTEM_MD) + /* check if BOOT ROM is loaded */ + if (system_bios & SYSTEM_MD) { if (data & 1) { @@ -395,7 +396,8 @@ void gen_bankswitch_w(unsigned int data) unsigned int gen_bankswitch_r(void) { - if (system_hw == SYSTEM_MD) + /* check if BOOT ROM is loaded */ + if (system_bios & SYSTEM_MD) { return (m68k.memory_map[0].base == cart.base); } diff --git a/source/membnk.c b/source/membnk.c index 5b1369c..136ea42 100644 --- a/source/membnk.c +++ b/source/membnk.c @@ -193,7 +193,7 @@ void zbank_write_ctrl_io(unsigned int address, unsigned int data) case 0x41: /* OS ROM */ { - if (address & 1) + if ((config.bios & 1) && (address & 1)) { gen_bankswitch_w(data & 1); return;