diff --git a/HISTORY.txt b/HISTORY.txt index 63bd127..a0927dd 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -80,6 +80,7 @@ Genesis Plus GX 1.7.5 (xx/xx/xxxx) (Eke-Eke) * added emulation of Micro Machines USA on-board TMSS bypass logic hardware * added SRAM support for games larger than 8MB * improved console region auto-detection for a few PAL-only games (The Smurfs Travel the World & Williams Arcade's Greatest Hits) +* improved invalid SRAM header info detection (fixes crashes with some unlicensed hacks/translations) * improved I2C EEPROM boards emulation accuracy * improved SVP memory handlers accuracy (fixes Virtua Racing debug mode) * improved accuracy of 68k access to Z80 bus delays diff --git a/builds/genesis_plus_gx_libretro.dll b/builds/genesis_plus_gx_libretro.dll index 9da20de..09bd350 100644 Binary files a/builds/genesis_plus_gx_libretro.dll and b/builds/genesis_plus_gx_libretro.dll differ diff --git a/builds/genplus_cube.dol b/builds/genplus_cube.dol index 6b410fd..3057618 100644 Binary files a/builds/genplus_cube.dol and b/builds/genplus_cube.dol differ diff --git a/builds/genplus_wii.dol b/builds/genplus_wii.dol index d3d8af5..5f7d60c 100644 Binary files a/builds/genplus_wii.dol and b/builds/genplus_wii.dol differ diff --git a/core/cart_hw/sram.c b/core/cart_hw/sram.c index fc73fc5..13c093d 100644 --- a/core/cart_hw/sram.c +++ b/core/cart_hw/sram.c @@ -2,7 +2,7 @@ * Genesis Plus * Backup RAM support * - * Copyright (C) 2007-2021 Eke-Eke (Genesis Plus GX) + * Copyright (C) 2007-2024 Eke-Eke (Genesis Plus GX) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: @@ -99,16 +99,25 @@ void sram_init(void) sram.end = 0x203fff; } - /* fixe games indicating internal RAM as volatile external RAM (Feng Kuang Tao Hua Yuan) */ + /* fixes games indicating internal RAM as volatile external RAM (Feng Kuang Tao Hua Yuan) */ else if (sram.start == 0xff0000) { /* backup RAM should be disabled */ sram.on = 0; } - /* fixe other bad header informations */ + /* fixes games with invalid SRAM start address */ + else if (sram.start >= 0x800000) + { + /* forces 64KB static RAM mapped to $200000-$20ffff (default) */ + sram.start = 0x200000; + sram.end = 0x20ffff; + } + + /* fixes games with invalid SRAM end address */ else if ((sram.start > sram.end) || ((sram.end - sram.start) >= 0x10000)) { + /* forces 64KB static RAM max */ sram.end = sram.start + 0xffff; } } diff --git a/core/cart_hw/sram.h b/core/cart_hw/sram.h index 7865d27..54c1a00 100644 --- a/core/cart_hw/sram.h +++ b/core/cart_hw/sram.h @@ -2,7 +2,7 @@ * Genesis Plus * Backup RAM support * - * Copyright (C) 2007-2021 Eke-Eke (Genesis Plus GX) + * Copyright (C) 2007-2024 Eke-Eke (Genesis Plus GX) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: