Restrict S3 LFB to just below BIOS, do not let the 32MB region overlap
the BIOS. Limit Voodoo 3Dfx framebuffer to stay out of system RAM.
To prevent large memsize configurations that cause S3 and 3Dfx to
conflict, add a hardware assignment system to give each device it's own
assigned LFB region of memory. This really only has an effect when space
gets cramped with large mem sizes, otherwise it has no effect. Perhaps
someday the BIOS should assign the 3Dfx, S3, and any other PCI devices
their resources like a real PC system would.
first, avoid include <endian.h> which is not found on macOS, fixes:
g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/local/include -g -O2 -Wall -mmmx -msse -msse2 -D_FILE_OFFSET_BITS=64 -Wno-strict-aliasing -std=gnu++11 -c -o callback.o callback.cpp
In file included from callback.cpp:24:
In file included from ../../include/callback.h:24:
../../include/mem.h:34:11: fatal error: 'endian.h' file not found
# include <endian.h>
next, map some missing functions to macOS eqivalents, based on
https://gist.github.com/yinyin/2027912, fixes:
../../include/mem.h:115:9: error: use of undeclared identifier 'le16toh'
return le16toh((*(Bit16u *)off)); // BSD endian.h
^
../../include/mem.h:118:9: error: use of undeclared identifier 'le32toh'
return le32toh((*(Bit32u *)off)); // BSD endian.h
^
../../include/mem.h:121:9: error: use of undeclared identifier 'le64toh'
return le64toh((*(Bit64u *)off)); // BSD endian.h
^
../../include/mem.h:128:21: error: use of undeclared identifier 'htole16'
*(Bit16u *)(off) = htole16(val);
^
../../include/mem.h:131:21: error: use of undeclared identifier 'htole32'
*(Bit32u *)(off) = htole32(val);
^
../../include/mem.h:134:21: error: use of undeclared identifier 'htole64'
*(Bit64u *)(off) = htole64(val);
^