10 Commits

Author SHA1 Message Date
589676854c Replace TARGET_ARM_MODE pragma with ARM_MODE function attributes 2024-08-03 17:28:27 -06:00
eb4412847e Add noexcept specifier to fixed point operations 2024-08-03 16:18:20 -06:00
b3a6dd48d0 Fix incorrect attribute placement on fixed::operator/
Function attributes should be placed in the function declaration, not
definition.
2024-08-03 16:15:17 -06:00
d0557bad3e Fix incorrect fixed point division result
Division was not returning the result as raw.
2024-08-02 23:26:24 -06:00
8d23f2cf09 Fix fixed point number compilation failures during attempted inlining
Currently, some fixed point operations (notably multiplication) fail to
compile when used in Thumb-mode routines. This occurs because GCC
attempts to inline the operation into the Thumb-mode routine, but the
operation uses ARM-mode only instructions. This commit adds the ".arm"
directive into the inline assembly of the implementation, which informs
GCC that the assembly uses ARM-mode instructions and prevents inlining.
As a result, fixed point numbers can be used from both ARM-mode and
Thumb-mode code without issues! Usage in ARM-mode should still be
preferred for optimal performance though.
2024-08-02 22:10:39 -06:00
2181557d9d Remove conditional fixed point number inlining
Caused issues with ODR rule violations. Now fixed point numbers should
only be used in ARM-mode. Attempting to use them in Thumb-mode will
cause a compilation failure. This commit also moves operator/ into IWRAM
on the GBA.
2024-07-30 11:45:08 -06:00
f87111abbf Add ability to disable logging
If MTL_LOGGING_DISABLED is defined, logging is disabled. Otherwise, it
is enabled.
2024-06-19 19:36:26 -06:00
f354b2d733 Change log level to use an enum instead of uint 2024-06-19 19:29:45 -06:00
82f60f4767 Refactor string_stream and string_streamx, and provide ENDL selection
option

This commit refactors string_stream and string_streamx into a common
basic_string_stream template class. When the EXT template == true, the
string_streamx formatting options are enabled, they default to disabled.
These options are enabled at compile time, and do not affect performance
when they are disabled. By implementing the two streams in this manner,
duplicated code is removed.

This commit also adds the ENDL template paramter. When ENDL is set to
zero, no endline character is printed when piping mtl::endl. Otherwise,
the character is printed. Defaults to '\n'. This allows logging on the
GBA to handle mtl::endl correctly and not print two newlines on the MGBA
emulator.
2024-04-10 08:39:30 -06:00
3efafa84c2 Add log 2024-03-27 00:32:54 -06:00