trunk/src/emu/bus/msx_slot/cartridge.c
| r31010 | r31011 | |
| 137 | 137 | else |
| 138 | 138 | { |
| 139 | 139 | UINT32 length = this->length(); |
| 140 | | |
| 141 | | UINT32 length_aligned = 0x4000; |
| 142 | | while (length_aligned < length ) |
| 140 | |
| 141 | // determine how much space to allocate |
| 142 | UINT32 length_aligned = 0x10000; |
| 143 | |
| 144 | if (length <= 0x2000) |
| 145 | length_aligned = 0x2000; |
| 146 | else if (length <= 0x4000) |
| 147 | length_aligned = 0x4000; |
| 148 | else if (length <= 0x8000) |
| 149 | length_aligned = 0x8000; |
| 150 | else if (length <= 0xc000) |
| 151 | length_aligned = 0xc000; |
| 152 | else |
| 143 | 153 | { |
| 144 | | length_aligned *= 2; |
| 154 | while (length_aligned < length ) |
| 155 | length_aligned *= 2; |
| 145 | 156 | } |
| 146 | 157 | |
| 147 | 158 | m_cartridge->rom_alloc(length_aligned); |
trunk/src/emu/bus/msx_cart/cartridge.c
| r31010 | r31011 | |
| 66 | 66 | |
| 67 | 67 | void msx_cart_interface::rom_alloc(UINT32 size) |
| 68 | 68 | { |
| 69 | | m_rom.resize(size); |
| 69 | m_rom.resize_and_clear(size, 0xff); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | void msx_cart_interface::rom_vlm5030_alloc(UINT32 size) |
| 73 | 73 | { |
| 74 | | m_rom_vlm5030.resize(size); |
| 74 | m_rom_vlm5030.resize_and_clear(size, 0xff); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | void msx_cart_interface::ram_alloc(UINT32 size) |
| 78 | 78 | { |
| 79 | | m_ram.resize(size); |
| 79 | m_ram.resize_and_clear(size); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | void msx_cart_interface::sram_alloc(UINT32 size) |
| 83 | 83 | { |
| 84 | | m_sram.resize(size); |
| 84 | m_sram.resize_and_clear(size); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |