mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
amstrad: restore CPR bank mask, force it to be based on the size of an actual ROM
This commit is contained in:
parent
1e82f36a94
commit
f0e300e234
1 changed files with 9 additions and 2 deletions
|
@ -2936,7 +2936,14 @@ void amstrad_state::enumerate_roms()
|
|||
if (m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000)
|
||||
{
|
||||
uint8_t *crt = m_region_cart->base();
|
||||
int bank_num = (m_cart->get_rom_size() / 0x4000);
|
||||
int bank_mask = 0x7ffff;
|
||||
|
||||
if (m_cart->get_rom_size() <= 0x20000)
|
||||
bank_mask = 0x1ffff;
|
||||
else if (m_cart->get_rom_size() <= 0x40000)
|
||||
bank_mask = 0x3ffff;
|
||||
else if (m_cart->get_rom_size() <= 0x80000)
|
||||
bank_mask = 0x7ffff;
|
||||
|
||||
/* ROMs are stored on the inserted cartridge in the Plus/GX4000 */
|
||||
for (int i = 0; i < 128; i++) // fill ROM table
|
||||
|
@ -2946,7 +2953,7 @@ void amstrad_state::enumerate_roms()
|
|||
|
||||
for(int i = 128; i < 160; i++)
|
||||
{
|
||||
m_Amstrad_ROM_Table[i] = &crt[((i - 128) % bank_num) * 0x4000];
|
||||
m_Amstrad_ROM_Table[i] = &crt[((i - 128) & bank_mask) * 0x4000];
|
||||
}
|
||||
m_Amstrad_ROM_Table[7] = &crt[0xc000];
|
||||
slot7 = true;
|
||||
|
|
Loading…
Reference in a new issue