The amount of memory available for shm objects is limited on some
systems, so use a normal file instead of an shm object as the backing
store for emulated memory.
Also document the cause and workaround for SIGBUS crashes.
Also fix other shadowing warnings throughout the codebase, and
enable shadowing warnings flag by default for CMake builds (using
-Werror=shadow except in decaf-cli and decaf-sdl, where excmd.h
triggers shadowing warnings).
This commit refactors the audio system to properly dispatch
all of the callbacks (I think). It also does mixing at the
correct bit levels. It also fixes some bugs with ADPCM
decoding. It also properly downmixes the AUX buffers. It
probably also does other things, but I can't remember
anymore...
This caused allocations that fit exactly to fail to be
allocated due to adjSize being increased to allow alignment
as a pre-step. This modifies it to check for the ability
to do alignment on a per-block basis instead.
Our calculation of the number of mip levels for a surface
incorrectly used Log2, which returned one less level than
was intended. Additionally, the specific logic between
how Log2 works and cntlzw might be relevant, so I fixed it
to use exactly the same logic as GX2.
We now use the fixed point class to handle some cases
of fixed point. I also reversed a bunch of things out
of sndcore2.rpl. Not all of the things I reversed are
currently being used (currentOffsetFrac for instance).
GCC is a bit funny here, fmt::format must be taking a const T& which
ends up requiring a proper definition of MaxValue in a .cpp somewhere
so it can take address. So to get around that we use static_cast to
force an lvalue to be passed in instead.
Thanks gcc!
LLVM miscompiles code which checks floating-point exceptions because it
doesn't know about them (http://llvm.org/bugs/show_bug.cgi?id=6050).
This affects the ps_sum1 implementation, so work around it by disabling
optimization for that function when building with Clang.