From 351d052e846b3fd7ffc20ce2b61dcd1b09d6eec8 Mon Sep 17 00:00:00 2001 From: ekeeke Date: Sat, 20 Apr 2024 18:26:32 +0200 Subject: [PATCH] [Core/MD] fixed regression in some unlicensed games mapper emulation (introduced by https://github.com/ekeeke/Genesis-Plus-GX/commit/731650733946116cdd7cfe061d4c014b2124df51) --- core/cart_hw/md_cart.c | 7 +++++-- core/cart_hw/md_cart.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/cart_hw/md_cart.c b/core/cart_hw/md_cart.c index 7753f4e..a5fdb0f 100644 --- a/core/cart_hw/md_cart.c +++ b/core/cart_hw/md_cart.c @@ -2,7 +2,7 @@ * Genesis Plus * Mega Drive cartridge hardware support * - * Copyright (C) 2007-2023 Eke-Eke (Genesis Plus GX) + * Copyright (C) 2007-2024 Eke-Eke (Genesis Plus GX) * * Many cartridge protections were initially documented by Haze * (http://haze.mameworld.info/) @@ -465,7 +465,10 @@ void md_cart_init(void) memset(&cart.hw, 0, sizeof(cart.hw)); /* initialize default $200000-$20ffff mapping (for games using SRAM & ROM bankswitching) */ - cart.hw.regs[0] = (0x200000 & cart.mask) >> 16; + if (m68k.memory_map[0x20].base == sram.sram) + { + cart.hw.regs[0] = (0x200000 & cart.mask) >> 16; + } /* search for game into database */ for (i=0; i<(sizeof(rom_database)/sizeof(md_entry_t)); i++) diff --git a/core/cart_hw/md_cart.h b/core/cart_hw/md_cart.h index ad8b985..943f8e8 100644 --- a/core/cart_hw/md_cart.h +++ b/core/cart_hw/md_cart.h @@ -2,7 +2,7 @@ * Genesis Plus * Mega Drive cartridge hardware support * - * Copyright (C) 2007-2023 Eke-Eke (Genesis Plus GX) + * Copyright (C) 2007-2024 Eke-Eke (Genesis Plus GX) * * Most cartridge protections were initially documented by Haze * (http://haze.mameworld.info/)