diff options
author | 2018-04-30 15:12:08 +1200 | |
---|---|---|
committer | 2018-04-30 15:12:08 +1200 | |
commit | d1b4dae0e14458793b46aaa3f264dbffe1d01249 (patch) | |
tree | 8ccf11a7d6fe3af669f11603261da2b50310ea39 | |
parent | bbf7833bf5eb244fa6fb6d2ec1d0cc64d5bad6b5 (diff) |
amstrad: allow for loading CPR cartridges with odd numbers of blocks
-rw-r--r-- | src/mame/machine/amstrad.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index 15757d3baeb..d12e4d597a3 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -2936,7 +2936,7 @@ 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_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 */ 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++) { - 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]; slot7 = true; |