mirror of
https://github.com/holub/mame
synced 2025-10-08 17:37:56 +03:00
amstrad: allow for loading CPR cartridges with odd numbers of blocks
This commit is contained in:
parent
bbf7833bf5
commit
d1b4dae0e1
@ -2936,7 +2936,7 @@ void amstrad_state::enumerate_roms()
|
|||||||
if (m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000)
|
if (m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000)
|
||||||
{
|
{
|
||||||
uint8_t *crt = m_region_cart->base();
|
uint8_t *crt = m_region_cart->base();
|
||||||
int bank_mask = (m_cart->get_rom_size() / 0x4000) - 1;
|
int bank_num = (m_cart->get_rom_size() / 0x4000);
|
||||||
|
|
||||||
/* ROMs are stored on the inserted cartridge in the Plus/GX4000 */
|
/* ROMs are stored on the inserted cartridge in the Plus/GX4000 */
|
||||||
for (int i = 0; i < 128; i++) // fill ROM table
|
for (int i = 0; i < 128; i++) // fill ROM table
|
||||||
@ -2946,7 +2946,7 @@ void amstrad_state::enumerate_roms()
|
|||||||
|
|
||||||
for(int i = 128; i < 160; i++)
|
for(int i = 128; i < 160; i++)
|
||||||
{
|
{
|
||||||
m_Amstrad_ROM_Table[i] = &crt[((i - 128) & bank_mask) * 0x4000];
|
m_Amstrad_ROM_Table[i] = &crt[((i - 128) % bank_num) * 0x4000];
|
||||||
}
|
}
|
||||||
m_Amstrad_ROM_Table[7] = &crt[0xc000];
|
m_Amstrad_ROM_Table[7] = &crt[0xc000];
|
||||||
slot7 = true;
|
slot7 = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user