1) Mac OS X mmap() doesn't work.
It always sets errno=ENOTSUP - Not Supported.
I may be able to use a Mach primitive in the future,
but for now, REAL_ADDRESSING is out of the question.
2) main_unix.cpp currently does this for DIRECT_ADDRESSING:
// Create areas for Mac RAM and ROM
#if REAL_ADDRESSING || DIRECT_ADDRESSING
...
{
RAMBaseHost = (uint8 *)mmap(0, mapped_ram_rom_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, zero_fd, 0);
if (RAMBaseHost == (uint8 *)MAP_FAILED) {
ErrorAlert(GetString(STR_NO_MEM_ERR));
QuitEmulator();
}
ROMBaseHost = RAMBaseHost + aligned_ram_size;
}
#else
RAMBaseHost = (uint8 *)malloc(RAMSize);
ROMBaseHost = (uint8 *)malloc(0x100000);
if (RAMBaseHost == NULL || ROMBaseHost == NULL) {
ErrorAlert(GetString(STR_NO_MEM_ERR));
QuitEmulator();
}
#endif
Now, because mmap() always fails, direct addressing also seems
out of the question. But, my question is, why can't we just do
a malloc() in this case?
What is this mmap() actually doing, apart from allocating memory?
--
| Nigel Pearson, ni...@in... | "Reality is that which, |
| Telstra NW-D, Sydney, Australia. | when you stop believing |
| Office: 9206 3468 Fax: 9212 6329 | in it, doesn't go away." |
| Mobile: 0408 664435 Home: 9792 6998 | Philip K. Dick - 'Valis.' |
|