cebix/macemu — pull request #20 by dougg3 (2013-03-02 22:12:24+00:00)
Title: Fix Windows black screen problem

This patch should fix the Basilisk II black screen problem that happens with Windows Vista and 7. After making this change, I haven't been able to reproduce the black screen problem at all through many tests on two Windows 7 computers that both had the problem before.

The OS X and Linux ports, when set for an addressing mode other than REAL_ADDRESSING, allocate the space for ROM and RAM in one single chunk. For example, if I have Basilisk set for 128 MB of RAM, it allocates 129 MB of RAM. It uses the first 128 MB for RAM and the last 1 MB for ROM.

The Windows version, prior to this patch, allocated the RAM and ROM using two separate calls to vm_acquire_mac. My experimental result is that if the space for ROM happens to be allocated at an address lower than the space for RAM, the video and ethernet drivers won't load. It appears to be something inside the actual emulated 68k machine that decides not to load the video/ethernet drivers from the Slot ROM in this case, but I haven't been able to determine exactly what it is. Anyway, some of the time it was allocating ROM above RAM and everything was fine, but the rest of the time the ROM was below RAM and the black screen would occur.

This patch changes the Windows port to allocate RAM the same way as the other ports -- a single chunk, guaranteeing that the ROM will always be above RAM. After applying this change, I have been unable to reproduce the black screen problem.

I have also included a case sensitivity #include fix to allow Basilisk II for Windows to be cross-compiled through MinGW on a Linux machine. basetsd.h is all lowercase in MinGW, and on Linux with a case-sensitive filesystem, it matters. :-( I realize that the Windows SDK file is actually named BaseTsd.h, but it shouldn't affect compilation on an actual Windows machine because it's not case sensitive. Sorry about combining it together, but I didn't realize github would require me to send them together when I did the pull request.