allow 8kb and 48kb sizes

This commit is contained in:
Michaël Banaan Ananas 2014-06-17 19:20:01 +00:00
parent d775dfb341
commit 3714cc3043
2 changed files with 19 additions and 8 deletions

View File

@ -66,22 +66,22 @@ msx_cart_interface::msx_cart_interface(const machine_config &mconfig, device_t &
void msx_cart_interface::rom_alloc(UINT32 size)
{
m_rom.resize(size);
m_rom.resize_and_clear(size, 0xff);
}
void msx_cart_interface::rom_vlm5030_alloc(UINT32 size)
{
m_rom_vlm5030.resize(size);
m_rom_vlm5030.resize_and_clear(size, 0xff);
}
void msx_cart_interface::ram_alloc(UINT32 size)
{
m_ram.resize(size);
m_ram.resize_and_clear(size);
}
void msx_cart_interface::sram_alloc(UINT32 size)
{
m_sram.resize(size);
m_sram.resize_and_clear(size);
}

View File

@ -138,9 +138,20 @@ bool msx_slot_cartridge_device::call_load()
{
UINT32 length = this->length();
UINT32 length_aligned = 0x4000;
while (length_aligned < length )
// determine how much space to allocate
UINT32 length_aligned = 0x10000;
if (length <= 0x2000)
length_aligned = 0x2000;
else if (length <= 0x4000)
length_aligned = 0x4000;
else if (length <= 0x8000)
length_aligned = 0x8000;
else if (length <= 0xc000)
length_aligned = 0xc000;
else
{
while (length_aligned < length )
length_aligned *= 2;
}