mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-27 19:51:48 +01:00
[SMS] fixed number of pages for ROM sizes which are not a factor of page size
This commit is contained in:
parent
c294796fdc
commit
d042eebd83
@ -427,17 +427,17 @@ void sms_cart_init(void)
|
|||||||
if (cart_rom.mapper < MAPPER_SEGA)
|
if (cart_rom.mapper < MAPPER_SEGA)
|
||||||
{
|
{
|
||||||
/* 1k ROM banks */
|
/* 1k ROM banks */
|
||||||
cart_rom.pages = cart.romsize >> 10;
|
cart_rom.pages = (cart.romsize + (1 << 10) - 1) >> 10;
|
||||||
}
|
}
|
||||||
else if (cart_rom.mapper & MAPPER_KOREA_8K)
|
else if (cart_rom.mapper & MAPPER_KOREA_8K)
|
||||||
{
|
{
|
||||||
/* 8k ROM banks */
|
/* 8k ROM banks */
|
||||||
cart_rom.pages = cart.romsize >> 13;
|
cart_rom.pages = (cart.romsize + (1 << 13) - 1) >> 13;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* 16k ROM banks */
|
/* 16k ROM banks */
|
||||||
cart_rom.pages = cart.romsize >> 14;
|
cart_rom.pages = (cart.romsize + (1 << 14) - 1) >> 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize extra hardware */
|
/* initialize extra hardware */
|
||||||
|
Loading…
Reference in New Issue
Block a user