Commit Graph

3251 Commits

Author SHA1 Message Date
Rafael Kitover af6028a9dd
build: fix build for nix on macOS
Add the NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM env var to the macOS CI as
faudio has not been marked compatible with macOS yet.

Remove FindGettext.cmake as it is a core cmake module that is available
in the versions of cmake we support now.

Add support for nix to MacPackageManagers.cmake and add brew gettext to
CMAKE_IGNORE_PATH when not using brew. Also update the cmake style.

Add faudio, libintl and the System framework to buildInputs in
default.nix.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-16 15:30:30 +00:00
Rafael Kitover ff3b5ee042
build: update mac link tool to 1.4
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-16 02:13:37 +00:00
Rafael Kitover b52edf52ff
build: fix building on macOS with Homebrew
Move setting up the environment for macOS Homebrew earlier in
Options.cmake, as well as finding pkgconfig.

Update gcc/clang toolchain to not pass a gcc-specific option to clang.

Add faudio to list of brew packages to get in installdeps.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-15 23:30:34 +00:00
Rafael Kitover 6766b9ca54
build: fix ffmpeg 7.x compat
Update from the channels/channel_layout API to the new ch_layout API,
assume two channel stereo always.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-15 23:28:56 +00:00
Rafael Kitover 8eae2e5b90
build: add FAudio to nix deps
Add faudio to nix dependencies for both macOS and Linux.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-14 10:15:54 +00:00
Rafael Kitover 50d17363ea
build: fail finding FAudio silently
Change the find_package() call for FAudio to QUIET to not show a giant
warning when it's not available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-14 10:09:37 +00:00
Rafael Kitover 795f25bb85
build: fix nix deps for OpenGL
Change Linux nix dependencies in default.nix for OpenGL from mesa to
libGL and libGLU, also fixing the compile error for the SDL binary.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-14 10:06:54 +00:00
Ruben 647be137f6
gba: set cpsr=spsr when switching to FIQ mode
The CPSR register needs to be restored from SPSR when switching modes.
This is currently being done for all mode switches /except/ for FIQ,
which is very likely just an oversight rather than intended behaviour.

This fixes the random crashing in OpenLara, as well as fixing random
glitching of my own project that uses FIQ mode switches. The issue
happens "at random" because it requires an interrupt to occur while in
FIQ mode, and it must also fire inside a section of code that relies on
the status flags (or the CPSR register in general): When exiting the
interrupt exception, the CPSR register is supposed to be restored from
SPSR, but this isn't being done when switching from IRQ mode back to FIQ
mode, which results in CPSR (and thus the status flags) being corrupted.
For example, SUBS r0, #1; [interrupt]; BNE 1b would trigger the bug, but
[interrupt]; SUBS r0, #1; BNE 1b wouldn't, and neither would
SUBS r0,#1; BNE 1b; [interrupt].
2024-04-12 15:49:45 +00:00
Rafael Kitover 8abe3e79da
build: remove -lgcc from static link flags
Remove -lgcc from static link flags for gcc/clang, clang does not
support this and -static-libgcc is enough.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-12 15:44:27 +00:00
Rafael Kitover 710ffeb1b2
build: update mac build
Update dists for gettext and gsed to get around new compile errors from
clang.

Update SDL and ffmpeg and add FAudio.

Make some other minor adjustments for recent changes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-10 22:52:35 +00:00
Rafael Kitover a855ff54f4
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-10 16:00:21 +00:00
Rafael Kitover dbb5e534e4
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-10 00:00:21 +00:00
Rafael Kitover 753956963c
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-09 07:00:21 +00:00
Rafael Kitover b00e23f5b5
build: enable FAudio on non-Windows
Enable FAudio on non-Windows too if the cmake support is found.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-08 04:02:48 +00:00
Fabrice de Gans 8ef9a66b74 [FAudio] Switch to portable `condition_variable`
This removes remaining dependencies on Windows in the FAudio code by
removing the device notification code and switching to portable
`condition_variable` for the buffer end notification event.
2024-04-07 16:33:22 -07:00
Rafael Kitover 0e503a525e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-07 11:00:30 +00:00
Rafael Kitover b4b020401c
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-07 11:00:07 +00:00
Fabrice de Gans f4835674ed [Audio] Rework audio devices enumeration
This moves all of the audio code in the wx frontend to the
`src/wx/audio` folder and simplifies many call sites by having one
generic API to enumerate audio devices and create the audio driver.

In addition, this fixes many corner cases in device enumerations and
moves handling of the default device to the respective audio backends,
rather than pushing it to the UI.

Finally, this changes the `Sound/AudioDevice` setting to use the
underlying device ID, rather than the user-facing name.
2024-04-07 03:51:39 -07:00
Rafael Kitover 4104a3d179
build: fix codesigning Windows bins with signtool
Pass `/fd certHash /td certHash` to signtool as they are required
arguments.

signtool comes with Visual Studio and now works and we don't need to
require osslsigncode anymore.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-06 23:45:14 +00:00
Rafael Kitover 1e1ec2e330
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-06 18:00:20 +00:00
Rafael Kitover ff21f8da21
build: enable FAudio sound driver on Windows
Enable FAudio on Windows if cmake can find it.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-06 11:22:20 +00:00
Rafael Kitover 775a571f75
build: fix detecting Visual Studio default vcpkg
Make the regular expression against VCPKG_ROOT less specific for
detecting the default Visual Studio vcpkg, for some reason it stopped
working.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-06 11:09:34 +00:00
Fabrice de Gans 64abd3e8dc [Audio] Remove manual memory allocations
* Remove explicit calls to new or malloc in favor of owned objects.
* Move AudioSdl to the sdl frontend, it is no longer used by the wx
  frontend.
2024-04-06 03:42:33 -07:00
Rafael Kitover 56320ec6d1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-06 08:00:20 +00:00
Zach Bacon 311b232ee5 FAudio: Implement and have functional FAudio output
Corrected the current FAudio output code, FAudio api wasn't
a direct 1 for 1 code replacement. Adjusted the existing
code structure so that FAudioVoiceCallBack struct
was being properly called on.

Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2024-04-05 15:37:39 -07:00
Rafael Kitover 0e13cc9346
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-05 02:00:21 +00:00
Rafael Kitover b455de01c6
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-04 22:00:27 +00:00
Rafael Kitover c3053d3819
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-04 22:00:08 +00:00
Fabrice de Gans c8106573d8 [Dialogs] Move SoundConfig dialog to its own class
This fixes a number of issues with the current implementation. Namely,
some options were not properly saved and the audio driver was not
properly reloaded when some options were changed.
In addition, this moves most sound-related options to `g_owned_opts` and
simplifies many call sites.
2024-04-04 14:22:23 -07:00
Fabrice de Gans 047ad27777 [Dialogs] Prevent viewers from causing a crash
Some of the viewers dialogs were not properly set up and were causing a
crash at runtime.
2024-04-04 12:10:44 -07:00
Rafael Kitover ecd16a21dc
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-03 14:00:25 +00:00
Rafael Kitover 1594fda1b6
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-03 13:00:22 +00:00
Rafael Kitover de9b3a211b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-03 12:00:22 +00:00
Rafael Kitover 045c98d8fa
build: only use -Werror=lto-type-mismatch on gcc
Only pass -Werror=lto-type-mismatch to gcc, clang does not have this
option and throws a warning.

Also quote some barewords in if() statements.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-03 10:30:04 +00:00
Fabrice de Gans 4ace296b3a [Build] Improve the TRANSLATIONS_ONLY build speed
* Move CMake dependencies checkout to `cmake/Dependencies.cmake`.
* Disable most dependencies checkout from the `TRANSLATIONS_ONLY` build.
* Remove the debug/translations_only GitHub Action.
2024-04-02 11:56:19 -07:00
Rafael Kitover 011adce23e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-02 17:00:21 +00:00
Rafael Kitover cc99ec0c14
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-02 13:00:37 +00:00
Rafael Kitover 1d652edf83
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-02 13:00:07 +00:00
Fabrice de Gans db08ca93af [Build] Improve CI build coverage
This reworks the CI coverage to add `TRANSLATIONS_ONLY=ON` and libretro
builds to GitHub Actions.
2024-04-01 23:28:20 -07:00
Rafael Kitover 3518dc6a05 build: fix LTO on Linux
Add -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing to
compile and link options for gcc/clang always.

Rename struct yy_buffer_state in src/sdl/expr-lex.cpp to struct
yy_buffer_state_sdl because it breaks when linking the SDL binary with
-Werror=odr.

Fix #1260

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-01 21:40:35 -07:00
Rafael Kitover cc9a03ce48 Add toggle: SDL GameController mode for joysticks
Add a toggle for SDL GameController Mode in the game key configuration
dialog, default enabled.

On check or uncheck, change the option and reinitialize joysticks, not
using GameController mode if it is disabled.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-01 21:21:53 -07:00
Fabrice de Gans 8576733c0d [Build] Remove lingering references to OpenAl
OpenAl is now required to build.
2024-04-01 21:14:51 -07:00
Rafael Kitover c6da7e384e
build: add faudio to list of optional vcpkg deps
Add faudio to list of optional vcpkg deps linked to ENABLE_FAUDIO.

This codepath is not used right now as we are using binary packages.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-01 14:17:48 +00:00
Rafael Kitover 98abb8c2e8
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-31 02:00:22 +00:00
Rafael Kitover 0556192238
build: fix MSYS2 check
Fix cmake logic for detecting MSYS2 "$ENV{MSYSTEM_PREFIX}".

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-31 01:16:36 +00:00
Rafael Kitover d9432ebb14
build: fix build on MINGW{64,32}/UCRT64 on MSYS2
Pass -Wno-deprecated-copy only for C++, gcc gives a warning for C.

Pass -Wno-unused-command-line-argument for clang only, gcc gives a
warning about it.

Add a failsafe for gcc/clang static link flags if libstdc++ or
libpthread is not available as a static library.

Move link command adjustment script invocations to src/wx, the target is
not yet defined in the toolchain.

Add -lws2_32 to the end of the link command for gcc on Windows because
of link order issues with those symbols.

Disable LTO for gcc on Windows, as it is broken.

Don't install extra-cmake-modules on MINGW32, that package is not
available there.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-30 20:14:32 +00:00
Rafael Kitover f57cad67c4
build: fix static linking on MSYS2 CLANG64
Bring back setting the MSYS variable under MSYS2, it's still being used
in a few places.

Link the SDL2::SDL2-static target for static builds.

Add -static-libgcc and -static-libstdc++ to the gcc/clang toolchain for
static builds.

Edit wxWidgets_LIBRARIES under MSYS2 to specify liblzma.a explicitly
because for some reason it's not being linked statically by default for
static builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-30 18:06:25 +00:00
Rafael Kitover ce7cc4e223
build: add FAudio to MSYS2 deps
In preparation for FAudio support, add the dependency to ./installdeps
for MSYS2 toolchains.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-30 17:37:20 +00:00
Rafael Kitover 8183a005af
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-29 02:00:21 +00:00
Rafael Kitover 75a34cd098
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-28 02:00:21 +00:00