mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-26 19:21:49 +01:00
[Core/MD] fixed ROM padding for Sonic & Knuckles
This commit is contained in:
parent
053c66c19f
commit
331ec8b7cb
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
Binary file not shown.
Before Width: | Height: | Size: 3.8 MiB After Width: | Height: | Size: 3.8 MiB |
@ -292,14 +292,6 @@ void md_cart_init(void)
|
|||||||
while (cart.romsize > size)
|
while (cart.romsize > size)
|
||||||
size <<= 1;
|
size <<= 1;
|
||||||
|
|
||||||
/* total ROM size is not a factor of 2 */
|
|
||||||
/* TODO: handle all possible ROM configurations using cartridge database */
|
|
||||||
if ((size < MAXROMSIZE) && (cart.romsize < size))
|
|
||||||
{
|
|
||||||
/* ROM is padded up to 2^k bytes */
|
|
||||||
memset(cart.rom + cart.romsize, 0xff, size - cart.romsize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Sonic & Knuckles */
|
/* Sonic & Knuckles */
|
||||||
if (strstr(rominfo.international,"SONIC & KNUCKLES"))
|
if (strstr(rominfo.international,"SONIC & KNUCKLES"))
|
||||||
{
|
{
|
||||||
@ -307,6 +299,22 @@ void md_cart_init(void)
|
|||||||
size = 0x400000;
|
size = 0x400000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* total ROM size is not a factor of 2 */
|
||||||
|
/* TODO: handle all possible ROM configurations using cartridge database */
|
||||||
|
if (cart.romsize < size)
|
||||||
|
{
|
||||||
|
if (size < MAXROMSIZE)
|
||||||
|
{
|
||||||
|
/* ROM is padded up to 2^k bytes */
|
||||||
|
memset(cart.rom + cart.romsize, 0xff, size - cart.romsize);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* ROM is padded up to max ROM size */
|
||||||
|
memset(cart.rom + cart.romsize, 0xff, MAXROMSIZE - cart.romsize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ROM is mirrored each 2^k bytes */
|
/* ROM is mirrored each 2^k bytes */
|
||||||
cart.mask = size - 1;
|
cart.mask = size - 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user