[Core/MD] improved invalid SRAM header info detection (fixes crashes with some unlicensed hacks/translations)

This commit is contained in:
ekeeke 2024-02-27 01:47:21 +01:00
parent ed7988f8ca
commit 302fe82fcc
6 changed files with 14 additions and 4 deletions

View File

@ -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 emulation of Micro Machines USA on-board TMSS bypass logic hardware
* added SRAM support for games larger than 8MB * 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 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 I2C EEPROM boards emulation accuracy
* improved SVP memory handlers accuracy (fixes Virtua Racing debug mode) * improved SVP memory handlers accuracy (fixes Virtua Racing debug mode)
* improved accuracy of 68k access to Z80 bus delays * improved accuracy of 68k access to Z80 bus delays

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* Backup RAM support * 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 * Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: * provided that the following conditions are met:
@ -99,16 +99,25 @@ void sram_init(void)
sram.end = 0x203fff; 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) else if (sram.start == 0xff0000)
{ {
/* backup RAM should be disabled */ /* backup RAM should be disabled */
sram.on = 0; 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)) else if ((sram.start > sram.end) || ((sram.end - sram.start) >= 0x10000))
{ {
/* forces 64KB static RAM max */
sram.end = sram.start + 0xffff; sram.end = sram.start + 0xffff;
} }
} }

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* Backup RAM support * 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 * Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: * provided that the following conditions are met: