1. __builtin_bswap{32,64} were added in GCC 4.3, and __builtin_bswap16
was added in GCC 4.8, however, currently, the GCC requirements in
bswap.h file has >= 10. This requirement of GCC version is false for
bswap* but true for __has_builtin() (as it first was added in GCC 10.1).
As bswap* builtins were added before GCC 10, the preprocessor check will
always going to be true for bswap but will be false if GCC version is
< 10 as __has_builtin() won't be present. Since the byteswap function,
on x86-64, can boil down to a single bswap instruction, this optimization
may left behind (unless GCC do some pattern matching). To avoid this,
just use the compiler macros (for GCC: __GNUC__, clang: __GNUC__ or
__clang__) and if the compiler is neither GCC or Clang, fall-back to
native implementation.
2. Remove the useless casts (uint{16,32,64}_t) from the constants. These
constants already has their own suffix, and casting to a different type
will just get ignored as the return value already gets casts to it's
appropriate type.
3. Previously, Clang couldn't able to use __builtin_bswap* (even if it was
newer) as LLVM define __GNUC__ macro to a specific constant (usually lower
than GCC's (__GNUC__) and on my system it's 4) which is indeed < 10. The
first comment also fixes this issue.
Link: <https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Other-Builtins.html>
Link: <https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Other-Builtins.html>
Link: <https://libc-alpha.sourceware.narkive.com/PfaB4BGP/patch-byteswap-h-fix-gcc-ver-test-for-builtin-bswap32>
1. The Debian issue mystery lies around chain2_read/write being required when the LFB mapping is enabled too when MGA modes are set without blitting, however, when it is blitting, immediately tell chain2 to not interfere with the mapping. Fixes Debian once and for all as well as VRAM detection correctly while keeping existing compatibility fine.
2. Undev branch the G100 per above. (Revert if more bugs are revealed).
3. An AND with 0 is not tolerable as it nulls the LFB, fixes hang ups with Win2000 using the Millennium II and possibly the G100.
4. the Extended CRTCs now have a call for timing recalculation, fixes mode changes when blitting is going on.
1. When the 128K banking is activated, use a mask of 0xffff instead of 0x1ffff.
2. Debian uses standard VGA mapping when in chain4 mode and its lfb is adapted accordingly.
3. Fixed the decode VRAM mask on the Millennium II so that the vram is detected correctly and no more glitches.
4. Undev the Millennium II as well.
1. Second attempt to fix the banking in the Cirrus (sigh, why doesn't banking get nulled automatically...)
2. Introduce a new timer to the 8514/A side so it won't slow the VGA clock down it was shared before.
1.Re-implemented in the best way possible the muted part of the Toshiba/NEC Play Audio commands and related, per spec.
2. Forgot to add a check to a Sony Vendor Data Out command when the len is 0 it should become a Status command, fixes emulator crashes when len is 0 using some CD software.