567 |
|
// Speculatively enables 33-bit addressing |
568 |
|
ThirtyThreeBitAddressing = true; |
569 |
|
#endif |
570 |
< |
RAMBaseHost = (uint8 *)vm_acquire_mac(RAMSize); |
571 |
< |
ROMBaseHost = (uint8 *)vm_acquire_mac(0x100000); |
572 |
< |
if (RAMBaseHost == VM_MAP_FAILED || ROMBaseHost == VM_MAP_FAILED) { |
570 |
> |
uint8 *ram_rom_area = (uint8 *)vm_acquire_mac(RAMSize + 0x100000); |
571 |
> |
if (ram_rom_area == VM_MAP_FAILED) { |
572 |
|
ErrorAlert(STR_NO_MEM_ERR); |
573 |
|
QuitEmulator(); |
574 |
|
} |
575 |
+ |
RAMBaseHost = ram_rom_area; |
576 |
+ |
ROMBaseHost = RAMBaseHost + RAMSize; |
577 |
|
} |
578 |
|
|
579 |
|
#if USE_SCRATCHMEM_SUBTERFUGE |
851 |
|
|
852 |
|
// Free ROM/RAM areas |
853 |
|
if (RAMBaseHost != VM_MAP_FAILED) { |
854 |
< |
vm_release(RAMBaseHost, RAMSize); |
854 |
> |
vm_release(RAMBaseHost, RAMSize + 0x100000); |
855 |
|
RAMBaseHost = NULL; |
855 |
– |
} |
856 |
– |
if (ROMBaseHost != VM_MAP_FAILED) { |
857 |
– |
vm_release(ROMBaseHost, 0x100000); |
856 |
|
ROMBaseHost = NULL; |
857 |
|
} |
858 |
|
|