Compare commits

...

1329 Commits

Author SHA1 Message Date
Rafael Kitover 6139428207
translations: remove dup Chinese translations
Remove zh.po, which is not on Transifex anymore and zh-Hans.po, which I
have removed from Transifex just now, leaving zh-CN.po, as suggested by
@wuweiran.

Fix #1435.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-02 13:45:14 +00:00
Rafael Kitover 5a5579d27f
build: minor followup on SFML 3.x API change
Followup on 29e85e5d (build: update Link SFML usage to SFML 3.x APIs,
2025-04-01) to alias an optional.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-02 09:07:54 +00:00
Rafael Kitover 29e85e5d87 build: update Link SFML usage to SFML 3.x APIs
Make some changes for the SFML Network library for the 3.x APIs.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-01 23:34:58 +00:00
Fabrice de Gans e228394656 [Input] Process key down event for some controls
In #1424, the app event handler was disabling all key down events,
preventing controls that depend on them to properly handle these. This
was done to work around an issue on macOS where unhandled keyboard
events would fire an audio alert.
Since this breaks text controls, these changes check for the currently
focused window and let the event propagate for text controls.

Fixes #1434
2025-04-01 18:57:26 +02:00
Rafael Kitover d5ac2a853b
Revert "Update Link SFML usage to SFML 3.x APIs"
This reverts commit e82ae7bb13.

Sorry, somehow I pushed to the wrong branch.
2025-03-29 19:40:59 +00:00
Rafael Kitover e82ae7bb13
Update Link SFML usage to SFML 3.x APIs
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-03-29 18:54:53 +00:00
Rafael Kitover 20b82d8ab7
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-03-29 04:00:24 +00:00
Rafael Kitover 8d26b4f49f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-03-25 23:00:22 +00:00
Fabrice de Gans 3fdc30f7d7
Mark `wxEVT_KEY_DOWN` as processed in `wxvbamApp` (#1424)
This prevents wxWidgets from triggering the alert sound on macOS.
There should be no side effect from this.

Fixes #1384
2025-03-22 16:24:14 -07:00
Rafael Kitover 57211ddc77
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-03-20 19:00:21 +00:00
Squall Leonhart 2de7efd9eb
Reallocate GBA ROM to the the new size(#1422)
The GBA ROM was erroneously reallocated to the constant `ROM_SIZE`.

Closes #1421
2025-03-15 13:39:57 -07:00
Rafael Kitover 5b4559f4ee
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-03-07 13:00:21 +00:00
Rafael Kitover 6178526cd9
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-03-06 09:00:20 +00:00
Rafael Kitover c8a1d8eb2e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-02-28 23:00:26 +00:00
Rafael Kitover 6e3883937b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-02-28 22:00:21 +00:00
Rafael Kitover 8dd647914a
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-02-20 17:00:21 +00:00
Rafael Kitover 0dae126a29
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-02-20 16:00:22 +00:00
Rafael Kitover 5038cd7ba5
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-02-16 23:00:22 +00:00
Rafael Kitover ddd8fca044
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-02-11 19:00:21 +00:00
Rafael Kitover 25c85a83d9
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-02-11 18:00:21 +00:00
Fabrice de Gans 32dd410954
[build] Disable link (#1411)
SFML 2 no longer compiles with a modern compiler and we are blocked on
SFML 3 being available in vcpkg to fix it. There is no easy way to
backport fixes to SFML 2 so disable link for the time being.
2025-02-08 15:13:10 -08:00
Fabrice de Gans e4f17d33ce
[Sound] Set volume on game startup (#1410)
On startup, the internal emulator sound volume is set to 100%. The user
value in the wx frontend is not used until the emulator volume slider is
modified, resulting in games starting with volume at 100% on startup.

This fixes #1407 by always setting the internal emulator sound volume on
game startup.
2025-02-08 12:57:12 -08:00
Rafael Kitover 2ab707c0ca
build: update default.nix
Update default.nix to remove gcc from the macOS package set and add
clang/llvm/libcxx to the Linux package set.

Change 'epoxy' in the Linux package set to the new package name
'libepoxy'.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-02-02 09:42:05 +00:00
Rafael Kitover 4dba928765
build: update installdeps for OpenSUSE
Update `installdeps` for current OpenSUSE wxWidgets and FFmpeg packages.

Disable 32 bit cross builds in OpenSUSE because those packages are no
longer available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-29 20:21:32 +00:00
Rafael Kitover 3d6550d161
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-25 18:00:22 +00:00
Rafael Kitover 3cf12f2594
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-15 15:00:25 +00:00
Rafael Kitover de1ec01c78
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-13 18:00:26 +00:00
Rafael Kitover 295abb9cd0
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-13 15:00:26 +00:00
Rafael Kitover 8260b62482
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-13 13:00:22 +00:00
Rafael Kitover d18c6f115f
Use faster sqrt() for xBRZ for XP builds
Use the `sqrt()` introduced in 615e5863 (Add fast-inverse SSE1 sqrt()
from Quake 3 Arena, 2025-01-12) or the xBRZ filters for Windows XP 32
bit builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-12 15:50:29 +00:00
Squall Leonhart d36f80b5e6
Add fast-inverse SSE1 sqrt() from Quake 3 Arena
Add the Quake 3 Arena fast-inverse `sqrt()` using SSE1 intrinsics to
third_party.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-12 15:50:02 +00:00
Rafael Kitover 44aa859e6d
build: add cmake var and cpp macro for XP builds
Add the WINXP CMake variable and WINXP CPP macro for MinGW 32 bit
Windows XP builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-12 15:04:14 +00:00
Rafael Kitover 5a2d3a6f95
build: set arch to pentium3 not -mmx for XP builds
Set the gcc architecture to pentium3 not pentium-mmx for Windows XP 32
bit builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-12 10:04:07 +00:00
PunkPangolin d6b939c428
Set developer id/component type in metainfo.xml
Add developer block to `metainfo.xml` with id 'visualboyadvance-m.org'.

Also set component type to 'desktop-application'.

This file is used to describe the application on Linux.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-09 20:07:45 +00:00
Rafael Kitover 8b8be7d4a8
Revert "Change domain to temporary"
This reverts commit 72364fd1a4.
2025-01-08 13:12:40 +00:00
Rafael Kitover 72364fd1a4
Change domain to temporary
Domain has expired, change links to temporary domain.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-01-08 13:09:49 +00:00
Rafael Kitover c6da07feb3
build: link avrt for OpenAL on WIN32
For static builds for Windows, link `avrt`, a system library that is now
required by OpenAL.

Also remove our version of `FindOpenAL.cmake` in favor of the
system-provided version.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-12-16 13:47:48 +00:00
Rafael Kitover 94979eff97
build: initialize GTest submodule in CMake
Try to initialize the GTest Git submodule from the CMake code if it has
not been.

If that fails, turn off `BUILD_TESTING`.

We do not want to require recursive clones or initializing submodules
for users by default.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-12-16 13:09:02 +00:00
Rafael Kitover e8494b56d1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-12-13 05:08:59 +00:00
Fabrice de Gans c85397518b
[win32-deps] Update win32-deps (#1375) 2024-11-24 22:03:05 -08:00
Fabrice de Gans cf2339822d
[win32-deps] Use specific commit in submodule (#1374)
This will help make older builds reproducible.
2024-11-24 21:37:11 -08:00
Fabrice de Gans dcb9ccca90
[gtest] Use googletest as a submodule (#1373)
Some Linux distributions use a hermetic build environment to build. This
resulted in issues with `FetchContent` attempting to download googletest
at configure time.
This fixes the issue by integrating googletest as a git submodule
instead of downloading it at configure time.
2024-11-24 12:39:10 -08:00
Fabrice de Gans a8ec85d536
[GB] Add support for per-game overrides (#1370)
* [GB] Add support for per-game overrides

Alleyway is a buggy game that does not work properly when a Game Boy
Printer is connected. In order to work around this issue, this adds
upport for built-in per-software Game Boy overrides. In addition, this
renames various variables to make their meaning clearer.

* This only supports built-in overrides. External INI files are not
  supported.
* Only the Game Boy Printer option is supported, this only takes effect
  on game startup and the general configuration option is restored when
  the game is unloaded.
* As a result, it is possible to override the per-game override by
  manually setting the option while the game is running, this is working
  as intended.
* Future refactors of the option handling will manage overrides better.
* Switch `gbPrinterEnabled` default to off.

Fixes #1368
2024-11-24 12:15:26 -08:00
Rafael Kitover 611f3a3409
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-11-04 02:00:27 +00:00
Rafael Kitover b6da6c490c
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-11-04 01:00:23 +00:00
Fabrice de Gans 9d20ce9b59
[Input] Reset keyboard tracking on focus loss (#1357)
When pressing Alt+Tab, the "Alt" and "Tab" keys were considered in the
"pressed" state until the user pressed them again because the window is
no longer receiving keyboard events. This resulted in some shortcuts no
longer working, since "Alt" was always in the pressed state. This
changes the keyboard tracking to be reset when the application loses
focus, fixing the issue.

This change also adds tests for the keyboard tracking.
2024-10-08 18:22:17 -07:00
Squall Leonhart 709a322337
cherry pick d5d01a8b68 2024-10-07 00:26:31 +11:00
Rafael Kitover cdfd37fc4e
build: rename dependencies submodule -> win32-deps
Rename the Git submodule `dependencies` used for some dependent files
for Win32 builds to `win32-deps` and make the necessary adjustments to
the CMake code.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-10-04 20:05:52 +00:00
Rafael Kitover 4f8d0a8867
build: update harfbuzz for macOS builder
Update harfbuzz in the macOS builder from the ancient version to the
current release and switch it to using Meson.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-10-03 13:50:16 +00:00
Fabrice de Gans b22e9fb709
Ignore illegal opcodes used by Wii U VC (#1351)
The Wii U VC emulator incorrectly allows for armv6 thumb instructions
(like LSRS). These cause an undefined instruction error on real hardware
but the Wii U VC emulator just ignores them. This change mimicks the Wii
U VC emulator behavior.
2024-09-29 23:13:11 -07:00
Rafael Kitover 4e2799b582
build: don't hardcode Windows certificate password
Use a file for the Windows code-signing certificate instead of
hardcoding it into the CMake code.

Update the developer manual with instructions on where to put the
Windows code-signing certificate and the file containing the password
for it.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-29 20:59:40 +00:00
Fabrice de Gans 7fa90531e6
Disable open menu tracking outside of Windows (#1350)
Tracking whether or not the menus are opened is necessary on Windows since menus stop
the main loop. This is not necessary on other platforms. In particular, on Mac, we do
not get a `wxEVT_MENU_CLOSE` event when opening a dialog from a shortcut, resulting in
the menu status tracking being incorrect.

Fixes #1348
2024-09-29 13:59:19 -07:00
Fabrice de Gans e1c2ecc584
[dialogs] Display all controls in AccelConfig on Mac (#1349)
Calling `ExpandAll()` on the `wxTreeCtrl` would cause it to display outside of its
intended view, hiding other controls. Instead, this sets a minimum size for the tree
control, so the default window size is reasonable.

Fixes #1348
2024-09-28 10:38:28 -07:00
Rafael Kitover 4c450ab360
build: fix linking FAudio statically on MINGW
Link `FAudio.a` explicitly on MINGW toolchains, for some reason linking
`FAudio` with static preference no longer works.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-19 09:22:38 +00:00
Fabrice de Gans d5e1a1f36b [GB] Properly set OPRI on startup
Previously, the OPRI register was always set to be in CGB mode when not
using the CGB BIOS, resulting in graphics corruption when running DMG
software in CGB mode without using the CGB BIOS. This fixes the issue by
properly setting bit 1 of the OPRI register as expected.

This was broken in #1119.
2024-09-17 18:52:35 -07:00
Rafael Kitover 821b9176bd
build: do not use debug libs for RelWithDebInfo
Stop trying to use debug libs for `CMAKE_BUILD_TYPE=RelWithDebInfo`,
this also fixes the current link error with SFML.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-17 18:35:39 +00:00
Rafael Kitover 9031103c9a
build: fix linking non-debug pcre for debug wx
Remove the cmake code that adds the pcre library because the wxWidgets
cmake code correctly includes it now, on both vcpkg and MSYS2.

Also fix up `wxWidgets_ROOT_DIR` and `wxWidgets_LIB_DIR` for debug
builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-15 19:53:27 +00:00
Rafael Kitover 557f897ead
build: fix using host pkgconf for ARM64 cross bld
Set `VCPKG_HOST_TRIPLET` and `VCPKG_USE_HOST_TOOLS` when using an X64
host for an ARM64 cross build in order to use the host `pkgconf` and
possibly other tools.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-15 15:47:28 +00:00
Rafael Kitover c8a4f66cf8
build: fix UpdateAppcast.cmake
Hardcode `git` instead of using `${GIT_EXECUTABLE}` which we are not
using anymore.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-15 12:50:00 +00:00
Zach Bacon ddc93ec6e1
release v2.1.11
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2024-09-15 01:48:38 -04:00
Rafael Kitover ab38ae8f24
doc: add keychain/notarization for Mac in dev man
Add information on unlocking the keychain for codesigning and setting up
credentials for notarization to the macOS binary section in the release
process section of the developer manual.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-14 08:38:02 +00:00
Rafael Kitover d337688fa7
build: use ccache correctly in the macOS builder
Make compiler symlinks in the macOS builder instead of prepending
`ccache` to the compiler in the CC/CXX environment variables.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-14 07:53:34 +00:00
Rafael Kitover 3eea90afb6
build: set BUILD_TESTING=OFF when not git checkout
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-13 16:29:25 +00:00
Rafael Kitover b3952d74a8
build: fix ENABLE_LIRC=ON
Fix the `ENABLE_LIRC` cmake option, pass an interface specifier to
`target_compile_definitions()`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-13 15:29:16 +00:00
Fabrice de Gans be09125d52 Use relative paths for installation
The CMake documentation [1] advises against using `CMAKE_INSTALL_FULL_*`
in `install()` commands.

[1] https://cmake.org/cmake/help/v3.30/module/GNUInstallDirs.html#result-variables
2024-09-13 01:05:38 +00:00
Rafael Kitover f264e7f807
Fix Help -> Translations URL
Fix the URL a browser is launched with when the `Help -> Translations`
menu item is selected to point to the project page on Transifex.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-12 17:35:40 +00:00
Rafael Kitover fe0791762a
build: update Windows dependencies submodule
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-12 14:17:16 +00:00
Fabrice de Gans 61f427dec1
Write shortcuts in the proper section (#1335)
Shortcuts were mistakenly written in `Keyboard/Keyboard` rather than in
the `Keyboard` section.
In addition, this properly fixes toggling checkable menu item options
via a shortcut.

Fixes #1334
2024-09-11 22:48:06 -07:00
Rafael Kitover d619ee2bb1
build: fix installing GoogleTest
Add the `EXCLUDE_FROM_ALL` keyword to the `FetchContent_Declare` call
for GoogleTest, so that gtest/gmock are not installed with the project.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 14:43:34 +00:00
Rafael Kitover 7128e6dd08
build: update wxWidgets for macOS builder to 3.2.6
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 12:40:27 +00:00
Rafael Kitover 0decffea8d
build: update macOS builder dists
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 11:42:26 +00:00
Rafael Kitover 9b60e17746
build: default to ENABLE_FFMPEG=OFF for MinGW32
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 11:20:02 +00:00
Rafael Kitover 26207038c9
Update WinSparkle to 0.8.1 and add ARM64
Update the included WinSparkle dll to 0.8.1 and add support for using
the ARM64 WinSparkle dll as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 11:07:19 +00:00
Rafael Kitover 90867bc802
doc: update developer manual release steps
Update the release steps in the developer manual to mention the
requirement for a GnuPG key, emphasize the editing the changelog step
and add instructions for putting `signtool.exe` in the `PATH` for the 32
bit Windows binary.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 10:10:13 +00:00
Rafael Kitover 7f49cd33ad
build: rm FAudio from installdeps MINGW32 target
Do not try to install FAudio for the MINGW32 32 bit Windows MSYS2 target
in `installdeps`. We do not use it for the 32 bit build and there is no
package for it for MINGW32.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 09:23:27 +00:00
Rafael Kitover d8342d3d67
doc: add ENABLE_FAUDIO to CMake opts in README.md
Describe `ENABLE_FAUDIO` in the table of CMake options in `README.md`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 08:59:26 +00:00
Rafael Kitover 12e840a8fa
Remove non-user-facing changes from CHANGELOG.md
Remove non-user-facing changes from `CHANGELOG.md` for 2.1.10.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 08:52:12 +00:00
Zach Bacon 6ca609ac7e
release v2.1.10
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2024-09-08 22:55:37 -04:00
Fabrice de Gans 2b8f9f71ff Copy string options rather than referencing them
This can lead to dandling references, though this is very unlikely. This
commit also removes a useless check.
2024-09-09 02:29:11 +00:00
Fabrice de Gans e76cef79d2 Remove cast for UTF-16 -> UTF-8 conversion
Add convenience functions to call `config::utf16_to_utf8()` without a
cast.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-09 02:29:11 +00:00
Fabrice de Gans 7f06428df8
Disable dialog position save/restore on wxGTK (#1331)
This is currently broken on Wayland, resulting in dialogs showing up in
random locations.
2024-09-08 16:56:30 -07:00
Rafael Kitover e4a9340409
Update README.md and Developer Manual
Update README.md and remove outdated information.

Update the Developer Manual and describe the current release process.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-08 05:42:34 +00:00
Rafael Kitover 5d7023a5d6
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-07 18:00:22 +00:00
Rafael Kitover 3bd7c918cc
build: fix cmake -DTAG_RELEASE functionality
Update the cmake -DTAG_RELEASE script to work with recent cmake changes.

Change it to not automatically make the release commit and tag, instead
specifying in the instructions that the person making the release must
edit the CHANGELOG.md and then run the commands, given in the
instructions, to make the release commit and tag.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-07 06:30:14 +00:00
Rafael Kitover 67e4944cdb
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-01 10:00:23 +00:00
Rafael Kitover df4ff16e2c
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-09-01 09:00:24 +00:00
Rafael Kitover d4805065b3
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-08-31 14:00:23 +00:00
Rafael Kitover e39b1f2c53
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-08-28 01:00:24 +00:00
Rafael Kitover 73b65a6553
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-08-28 00:00:23 +00:00
Rafael Kitover 9e556e6a56
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-08-21 14:00:34 +00:00
Rafael Kitover 11e73f2c61
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-08-21 13:00:24 +00:00
Rafael Kitover e97b0448b7
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-08-20 17:00:22 +00:00
Fabrice de Gans aa6ed14b2a
[FAudio] Always convert UTF-16 names (#1328)
On Windows, wchar_t is 16 bits and represents UTF-16 code units.
However, on other platforms, wchar_t is typically implemented as 32 bits
to represent UTF-32 code units. In order to work around this problem, we
always convert the string we get from FAudio, which is represented as
UTF-16 code units, into UTF-8 and let wxString handle the conversion to
its native type internally.
2024-08-17 21:02:01 -07:00
Rafael Kitover 2ce20c4f59
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-08-16 06:00:25 +00:00
Fabrice de Gans e4ef4aa625
Propagate key events (#1323)
Previously, `wxEVT_KEY_DOWN` and `wxEVT_KEY_UP` were transformed into
`VBAM_EVT_USER_INPUT` and marked as processed early. This broke a number
of controls that rely on the traditional widgets events.

To fix this, we now filter the `wxEVT_KEY_*` and `wxEVT_CHAR` events in
the only widget we use that cares about them, `UserInputCtrl` instead of
filtering them at the application level.
2024-07-28 15:19:19 -07:00
Rafael Kitover cf5cb40cb9
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-26 09:00:24 +00:00
Rafael Kitover c450d14311
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-26 08:00:24 +00:00
Rafael Kitover 41572be3f2
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-24 11:00:23 +00:00
Rafael Kitover 4f8da1c574
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-24 09:00:24 +00:00
Rafael Kitover 32091669d4
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-23 12:00:29 +00:00
Rafael Kitover abd72a5b2e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-23 02:00:23 +00:00
Rafael Kitover 7e6349b19f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-22 13:00:22 +00:00
Rafael Kitover 0782be749e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-22 12:00:24 +00:00
Rafael Kitover a7b545ab1a
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-15 03:00:22 +00:00
Rafael Kitover 1a564f900c
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-13 10:00:25 +00:00
Rafael Kitover 3d4e03f85f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-08 12:00:23 +00:00
Rafael Kitover fc17209ac7
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-06 05:00:23 +00:00
Rafael Kitover 38877ef209
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-05 21:00:24 +00:00
Rafael Kitover 8691a15be8
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-05 20:00:32 +00:00
Rafael Kitover 961fd0304c
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-05 20:00:15 +00:00
Rafael Kitover e2cf6ecba6 Add option to mute sound during speedup
Add core option to mute sound during speedup, implemented in the gba
core. Link the option to the SDL port as well.

Add the new Mute Sound option as a checkbox to the xrc for the
Speedup/Turbo dialog and improve the dialog appearance.

Fix the max values for the options speedup_throttle and
speedup_frame_skip.

Add base class for numeric OptionProxy types implementing the +=, -=
operators, increment/decrement operators and operator T(). Add tests for
these operators on numeric types.

Move Speedup/Turbo dialog code from guiinit.cpp to a dialog class and
rewrite it using validators.

Remove the "GL VIEWPORT" debug prints from panel.cpp.

Fix #865

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-07-05 12:14:58 -07:00
Avindra Goolcharan 7a0826a60c Migrate vba-m.com links in .github folder 2024-06-21 18:02:38 -04:00
Rafael Kitover d516683a77
build: fix for wx using GTK2
Use the __WXGTK3__ macro to check for GTK3 when setting the gdk backend
to X11 when Wayland EGL is not available, GTK2 does not have this
function and always uses X11 anyway.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-06-14 11:10:00 +00:00
Rafael Kitover 834c7de86c
build: update macOS builder dists
Update sdl2, faudio, wxWidgets and ffmpeg to the latest versions for the
macOS builder.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-06-06 05:32:51 +00:00
Fabrice de Gans 4f1a5dd726 [Test] Add tests for widgets code
This creates a vbam-wx-widgets target for the custom widgets code and
adds tests for them.
2024-05-29 19:30:35 -07:00
Rafael Kitover 5766b9b9c7
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-27 10:00:25 +00:00
Rafael Kitover 5d8426d317
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-27 09:00:26 +00:00
Rafael Kitover 63ec3528f1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-26 07:00:24 +00:00
Fabrice de Gans f646c3848c [Test] Change assert to custom CHECK macros
This changes the way we handle asserts to use a set of custom macros.
This greatly speeds up crashing, especially on Windows, and provides
assertions in release mode too.
2024-05-21 18:47:50 +00:00
Fabrice de Gans 09433875bc [CI] Remove workaround for MSVC CI
Upstream GitHub actions now uses a single toolchain version.
Fixes #1297
2024-05-19 16:14:22 -07:00
Fabrice de Gans 05c09ff506 [Build] Add devkitpro-based libretro targets to CI 2024-05-10 13:36:05 -07:00
Rafael Kitover 7f78fbb3c5
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-10 03:00:24 +00:00
Rafael Kitover 261e26f488
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-10 02:00:25 +00:00
Rafael Kitover ed820708af
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-10 01:00:27 +00:00
Fabrice de Gans 5b8b6a0b47 [Test] Add tests for the EmulatedGamepad class 2024-05-09 17:48:48 -07:00
Fabrice de Gans 8809ce26b3 [Test] Add tests for the Bindings class
In addition to fixing a couple of minor bugs, this also creates some
utility functions to access the cmdtab data.

Finally, this disables tests on MSYS2 as they can be flaky.
2024-05-09 13:15:16 -07:00
Fabrice de Gans a48625855b [Build] Share wx-related targets configuration
Breaking the main wx target down to multiple libraries had the side
effect that many build options were not properly applied to libraries.
This fixes the issue by having a common configuration function in CMake
to share most of the configuration between all of the wx-related
targets.
2024-05-09 12:28:05 -07:00
Rafael Kitover 55c1477d69
build: disable FAudio for 32 bit Windows builds
Disable FAudio for 32 bit Windows builds because it uses libraries that
Windows XP does not have.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-09 02:34:25 +00:00
Rafael Kitover 2d7a1ea25b
build: fix faudio linkage regression on MSVC+vcpkg
Followup on 244149c0 (build: fix faudio static linkage, 2024-05-09)
which broke linking faudio on MSVC+vcpkg, go back to using the
FAudio::FAudio cmake target for MSVC.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-09 01:38:44 +00:00
Rafael Kitover 244149c00e
build: fix faudio static linkage
Use "faudio" and dependent dlls on Windows instead of the FAudio::FAudio
cmake target, because the cmake target always links the faudio dll.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-09 01:25:05 +00:00
Fabrice de Gans c0bcf3bfdf [Test] Add tests for many config classes
This also fixes a coupld of minor issues that were found while adding
tests.
2024-05-08 13:08:07 -07:00
Fabrice de Gans 13756bcbf9 [Test] Replace doctest with googletest
* Convert the only existing test (strutils) to googletest.
* Create a test target for vbam-wx-config.
* Add necessary fakes for the test binary.
* Add tests to CI.
2024-05-08 13:00:56 -07:00
Rafael Kitover fc82e06270
build: do not build SDL bin on Windows or macOS
Stop enabling the SDL binary by default on Windows or macOS because it
usually only of interest to Linux users.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-08 12:53:52 +00:00
Rafael Kitover df89beb256
build: disable gpg signatures by default
Add the GPG_SIGNATURES cmake option to control creating gpg clearsign
signatures for the translations and exe zips for UPSTREAM_RELEASE,
defaulting to OFF.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-07 02:59:17 +00:00
Rafael Kitover 82eda48e8f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-06 06:00:30 +00:00
Rafael Kitover b47787b317
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-06 06:00:12 +00:00
Fabrice de Gans c9668d9a88 [config] Create the vbam-wx-config target
Circular dependencies between the config sub-module and the rest of the
wx frontend have been removed. This change separates the config code to
its own submodule.

This is a preliminary change to improve testing coverage.
2024-05-05 22:57:47 -07:00
Fabrice de Gans 90a56c6937 [config] Move strutils to src/config/
This removes circular dependencies between the main wx target and the
config/ sub-directory.
2024-05-05 21:38:14 -07:00
Fabrice de Gans d377f7abff [CI] Install only one MSVC toolchain
A change in GitHub Actions broke our MSVC build flow due to different
toolchains being used at different steps of the build process. While the
upstream issue will eventually be fixed, we need to explicitly specify
the toolchain version for now.

Bug: #1297
2024-05-05 14:54:58 -07:00
Rafael Kitover 1fac129746
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-05 15:00:20 +00:00
Rafael Kitover af7d5f7b89
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-05 14:00:21 +00:00
Rafael Kitover 28f7c2010b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-05 10:00:20 +00:00
Rafael Kitover 486330f23d
Activate GitHub Sponsors
Add .github/FUNDING.yml with my username to activate GitHub Sponsors for
this repository.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-05 01:27:11 +00:00
Rafael Kitover 1ae78a04a8
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-05 00:00:26 +00:00
Rafael Kitover c776da7120
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-05-05 00:00:08 +00:00
Fabrice de Gans d543784a3d [UserInput] Filter key events globally
This changes key events to be filtered globally by the application,
preventing any widget from accessing them. Widgets should instead use
the new VBAM_USER_INPUT_EVENT event.

In addition, this explicitly removes accelerator handling from wxWidgets
main menu, allowing us to populate joystick options in the menu without
firing wxWidgets assertions.
2024-05-04 16:07:25 -07:00
Fabrice de Gans 902c6c8e4b [UserInput] Only process shortcut commands once
This modifies the UserInputEvent class to fire a vector of events at
once, rather than individual down/up events for each UserInput. This
simplifies handling of the global event filter and prevents the firing
of spurious events.

This also fixes a bug when pressing "Ctrl+1" would trigger the command
for both the command assigned to "Ctrl+1" and to "1". Now, only the
"Ctrl+1" command will fire.
2024-05-04 13:38:43 -07:00
Fabrice de Gans d32be9ddbe Move cmdtab and command enable flags to config/
* Moves cmdtab to config/. This removes the dependency on the wxvbam.h
  header from the config/ directory.
* Fixes a number of issues in the shortcuts configuration window:
  * The "Remove" command was not working properly due to an incorrect
    refactor.
  * The window is now fully expandable.
2024-05-04 10:44:06 -07:00
Fabrice de Gans b776509287 [bindings] Set default shortcut for recent file 3
This was lost in translation between 2 refactors.
2024-05-03 17:30:51 -07:00
Rafael Kitover 56eb97c846
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-29 13:00:23 +00:00
Rafael Kitover 9f46c575fd
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-29 10:00:21 +00:00
Rafael Kitover e0402a9b0b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-28 20:00:23 +00:00
Rafael Kitover 3e30f54d5f
translations: fix strings starting with lowercase
Fix translated strings that start with lowercase to start with
uppercase.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-28 19:16:26 +00:00
Rafael Kitover d73085a88c
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-25 08:00:21 +00:00
Rafael Kitover 8eb6a6900f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-25 04:00:20 +00:00
Rafael Kitover 3615137c12
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-24 19:00:20 +00:00
Rafael Kitover bbd5b76f2a
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-24 02:00:25 +00:00
Rafael Kitover bb3604f333
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-24 02:00:07 +00:00
Fabrice de Gans 18a0067ca7 [Input] Unify command handling
This unifies command handling between game and shortcut commands. Both
types of commands are now handled in a common manner and the binding
configuration is shared. In particular, this prevents assigning the same
user input (joypad or keyboard) to a game command or a shortcut command.

Bug: #745
2024-04-23 18:02:25 -07:00
Fabrice de Gans cfdbdc4ec2 [Input] Move input configuration objects to app
Previously, some input-related configuration objects were either owned
by `gopts` or global values. This moves these objects to be owned by the
app object instead.

Rather than directly accessing the app object, other objects (like
dialogs) that need to access the input-related configuration objects are
passed a `ConfigurationObjectProvider` function. This will make it
easier to test these objects independently down the line.

Bug: #745
2024-04-23 15:38:39 -07:00
Rafael Kitover 32ca2ae42f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-23 22:00:25 +00:00
Rafael Kitover bad96cf91e
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-23 22:00:07 +00:00
Fabrice de Gans 62294702e4 [Input] Remove transitional key, mod, joy triplet
Originally, UserInput was built around the key, mod, joy triplet values
to maintain compatibility with other parts of the code base that made
use of these values. Since the UserInput class was introduced, all use
cases have been transitioned off these values in favor of treating the
UserInput as an abstract input.

UserInput is now a simple wrapper around either a KeyboardInput or a
JoyInput structure that only contain data pertinent to their input type.

This concludes the transition to the UserInput type.

Bug: #745
2024-04-23 14:26:59 -07:00
Rafael Kitover 72c4f33d63
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-23 19:00:27 +00:00
Rafael Kitover 3fe57f540d
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-23 19:00:07 +00:00
Fabrice de Gans 1e1a369c8d [Input] Unify UserInput event handling
This adds a custom UserInputEvent for handling joypad and keyboard input
for both accelerators and emulator control configuration.

These changes fix a number of issues with the wxWidgets implementation
of key down / up event handling. In particular, every "down" event now
has a corresponding "up" event. All of the special handling that was
done in multiple places to handle shortcuts is now done in a new class,
`UserInputEventSender`, simplifying multiple call sites.

This is another step towards complete unification of UserInput handling,
which will prevent double assignment between shortcuts and emulator
controls.

Bug: #745
2024-04-23 11:30:20 -07:00
Squall Leonhart cc65ef2849
doc: add system requirements to README.md
Add system requirements and a link to the DirectX redist for Windows to
the README.md.
2024-04-18 09:13:39 +00:00
Fabrice de Gans 32627f6b85 [Dialogs] Save and restore dialog positions
This changes most dialogs in the wx frontend to use a common base
abstraction, `dialogs::BaseDialog`. This base class sets up common
style options for every dialog and automatically saves and restores the
dialog position.

In addition, this moves the first time show position of the dialog to be
slightly to the bottom and right of the main window, even if the main
window is on a screen other than the main screen.
2024-04-18 09:02:08 +00:00
Rafael Kitover 41952d0625
build: update macOS linker tool to 1.5
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-18 08:02:51 +00:00
Rafael Kitover 0c39a5ba7a
build: override FindGettext to not update po files
Copy the cmake 3.28.3 FindGettext.cmake to cmake/ and comment out the
line that updates the po file from the pot. Because we download po files
from transifex we don't want this.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-16 22:12:46 +00:00
Rafael Kitover 1b77d6594c
build: update macOS build to ffmpeg 7.0
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-16 16:59:28 +00:00
Rafael Kitover 8d08223dbc
build: fix compatibility with older ffmpeg
Check LIBAVCODEC_VERSION_MAJOR and use the older channel_layout API if
it's below 60.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-04-16 16:19:12 +00:00
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
Rafael Kitover 23e1573442
build: set wxWidgets_DIR with vcpkg
When using vcpkg as the toolchain, pass NO_DEFAULT_PATH to
find_package(wxWidgets ...) so that the default cmake
FindwxWidgets.cmake is not included.

Set wxWidgets_DIR to the
<vcpkg-root>/installed/<triplet>/share/wxwidgets vcpkg port directory
for the subsequent find_package() calls to find the port-installed
wxWidgetsConfig.cmake file.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-27 03:02:33 +00:00
Fabrice de Gans 98b51910eb [Build] Remove ENABLE_NLS, fix TRANSLATIONS_ONLY
* Remove the ENABLE_NLS option, it is now always enabled.
* Fix the TRANSLATIONS_ONLY build to properly build the zip file.
2024-03-26 17:38:12 -07:00
Rafael Kitover c3f0aa2edf
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-26 22:18:10 +00:00
Rafael Kitover ea596e4cb0
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-26 22:17:52 +00:00
Fabrice de Gans 68adb14b07 [Build] Use Toolchain-gcc-clang for non-MSVC
Apple compiler ID is defined as `AppleClang`. Rather than explicitly
adding every single compiler ID, this changes the build to try to apply
settings for GCC for every non-MSVC-like compilers.
2024-03-18 17:12:51 -07:00
Fabrice de Gans a565cea8e9 [Build] Remove the OpenGL check
This is no longer necessary with modern CMake.
2024-03-18 23:56:22 +00:00
Fabrice de Gans 6ac95d373f [Build] Rework wx/CMakeLists.txt
* Bring the wx frontend more in-line with the rest of the codebase.
* Always default to Unicode APIs on Windows.
* Clean up all include guards and headers.
2024-03-18 23:56:22 +00:00
Fabrice de Gans d4430ca440 [Build] Move SDL build configuration to `sdl/`
* Clean up SDL includes and include guards.
* Add the sdl target to `sdl/CMakeLists.txt`.
2024-03-17 14:41:07 -07:00
Fabrice de Gans 000c7f854c [Build] Move non-core common code to `components/`
* Create multiple components library. These depend on the core code and
  are used by multiple frontends.
* Clean up the filters declaration by moving them to a common header in
  `components/filters/filters.h`.
* Clean up the include guards and include orders.
* Fix the modified paths in `src/debian/copyright` to match their new
  location.
2024-03-16 17:32:09 -07:00
Fabrice de Gans 047bd935ea [Build] Move the core emulator to src/core/
* Move src/apu/, src/gb/ and src/gba/ to src/core/.
* Clean up include guards and headers.
* Rename `BKPT_SUPPORT` to `VBAM_ENABLE_DEBUGGER` and remove the
  `NO_DEBUGGER` define.
2024-03-16 14:35:36 -07:00
Fabrice de Gans 33cb9a66d4 [Build] Move System.h and most of Util.h to core/
* Move System.h to core/base.
* Move most of the functionality out of Util.h to core/base.
* Fix corresponding headers.
2024-03-15 20:43:57 -07:00
Fabrice de Gans f8374b52a8 [Build] Move more of src/common to src/core/base
* Clean out all of the dependent headers.
* Modify generated version.h to improve the dependency chain and isolate
  the generated file to its own sub-directory within the build
  directory.
2024-03-15 19:51:52 -07:00
Fabrice de Gans 2f10e71f1d [Build] Cleanup files in src/common
* Remove unused files.
* Move files used only by the SDL frontend to the sdl folder.
* Remove contains.h in favor of manual iterator parsing.
2024-03-15 17:05:16 -07:00
Fabrice de Gans 8f92d99968 [Build] Move file-related utilities to core/base
* Remove duplicate function definitions between the libretro and other
  frontends by merging them into a common source file.
* Also move `systemMessage()` and message IDs definitions to core/base.
* Clean up and modernize many file utility methods.
2024-03-15 16:04:45 -07:00
Fabrice de Gans ce12db1e06 [Build] Move fex/ to src/core/fex/
* Clean up source set and public headers.
* Make the fex library an OBJECT library to speed up build.
* Clean up the only fex include to use the full path to the header.
2024-03-15 12:16:40 -07:00
Fabrice de Gans d8a1886ccb [Build] Use new way of setting /Z flag with MSVC
CMake 3.25 introduced the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT to set the
/Z flag for MSVC toolchains. Use it rather than modifying the compile
options if possible. We revert to setting the compile options manually
if the CMake version is too old.
2024-03-15 11:32:38 -07:00
Fabrice de Gans 1d051d0e6e
[Build] Make powershell optional on non-Windows (#1248)
Fixes: #1247
2024-03-15 11:32:24 -07:00
Fabrice de Gans f96e42fe04
build: cmake refactor and improvements
* Use add_compile_definitions everywhere.
* Remove unused intermediate target.
* Add ASAN support for MSVC.
* Remove duplicate option definitions.
* Configure MinGW separately from the toolchain
2024-03-15 16:19:01 +00:00
Fabrice de Gans aa59d94490
[Build] Add toolchain-specific files (#1244)
* Move toolchain-specific options to their own files.
* Clean up and modernize the use of toolchain options.
* Use modern cmake LTO support.
* Remove dead cmake code and cmake functions available in upstream cmake.
* Update README.md to remove references to removed build options.
2024-03-13 11:13:55 -07:00
Fabrice de Gans 07e490254c
Fix most remaining release warnings (#1243)
Bug: #1003
2024-03-11 18:56:01 -07:00
Fabrice de Gans 18b97b4342
Fix various build warnings (#1242)
* Mass-rename some global variables with clangd
* Fix various int conversion issues

Bug: #1003
2024-03-11 16:47:45 -07:00
Rafael Kitover b45a4066b1
ci: add clang+bintools for macOS, disable LTO
Add llvmPackages_latest.clang and bintools to the macOS part of
default.nix for nix, because for some reason the `ar` utility is not
found in GitHub actions right now.

Disable LTO for the macOS action for now, this is a consequence of
recent cmake refactoring and needs to be fixed.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-11 08:53:47 +00:00
Fabrice de Gans 1fff5cb1f7 Move build options to their own file
This moves all build options to their own file to clean up the main
CMakeLists.txt. In addition, this upgrades the minimum required CMake
version and changes the build to use CMAKE_MSVC_RUNTIME_LIBRARY rather
than hardcoding the MSVC ABI flag.
2024-03-11 01:38:25 +00:00
Fabrice de Gans 13a16eb79c
Fix various warnings in filters and headers (#1241)
Bug: #1003
2024-03-10 17:33:11 -07:00
Fabrice de Gans 69769c1bef [CI] Use proper POWERSHELL variable casing
The POWERSHELL cmake variable was sometimes used lowercase.
2024-03-10 16:24:02 -07:00
Fabrice de Gans e998a4016a
[CI] Properly inclue SDL2 directories for vbamcore (#1240)
The variable name should have been changed to SDL2_INCLUDE_DIRS
2024-03-10 16:14:52 -07:00
Fabrice de Gans f17a9855f3
[CI] Look for pwsh in addition to powerhsell (#1239)
Newer github actions bot setup no longer include a powershell.exe
binary, only pwsh.exe
2024-03-10 15:58:25 -07:00
Rafael Kitover 85b7cf7aec
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-10 02:00:30 +00:00
Rafael Kitover f46da1c525
build: remove our version of FindSDL2.cmake
SDL2 now comes with a cmake find_package() module, so we will use it
instead of this one that came from someone's github a decade ago.

Keep the fixup for libsamplerate with vcpkg and move it into the main
cmake code.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-08 23:41:26 +00:00
Rafael Kitover 404e9a1a55
build: add clang to ./installdeps for MSYS2
Add clang when installing for CLANG* environments in MSYS2 because this
package is no longer included by default in the set of packages we
install.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-08 23:13:32 +00:00
Rafael Kitover 3ec8960f1a
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-08 02:00:29 +00:00
Weiran Wu 613bd4038a
Make menu more reasonably organized (#1230)
* Make menu more reasonably organized
* Revert name and order change of configs

---------

Co-authored-by: wuweiran <wwrnfls@126.com>
2024-03-06 18:25:42 -08:00
Rafael Kitover ecb69a240a
build: add pthreads w/vcpkg, link FAudio target
In preparation for including the finished FAudio support, link the cmake
FAudio target FAudio::FAudio when the feature is enabled.

Add pthreads to vcpkg deps and use the installed PThreads4W on Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-03-06 21:58:43 +00:00
Rafael Kitover 215e3c5ae9
build: use find_program() to find powershell
Use cmake find_program() to find powershell.exe on Windows because
invoking `powershell` or `powershell.exe` without a path sometimes fails
for some reason. Use the standard location on Windows 11 as a hint.

Make the `pwsh` executable REQUIRED when installing vcpkg packages
on non-Windows.

Use find_program() to find the zip executable before downloading it on
Windows vcpkg builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-02-28 13:44:22 +00:00
Rafael Kitover e5aa685f70
build: don't use wx utils as UNIX cmds on Windows
Don't convert wx-config and wxrc into UNIX commands on a Windows host,
as the paths may have spaces in them and this will break the invocation.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-02-28 13:11:23 +00:00
Rafael Kitover 53e1f44a69
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-02-26 02:00:28 +00:00
beef 9e4c8e1753 build: fix gentoo dependency namespaces
Change sys-devel to dev-build to match current gentoo package naming
convention. Also add --ask flag to prompt for confirmation before
merging packages.

Signed-off-by: Mohamad Issawi <68k@segv.moe>
2024-02-20 06:20:07 -08:00
Jhonny Oliveira 5f853b99ad
Update metainfo.xml to new standards
Update metainfo.xml to new standards.

Fix #1221
2024-02-20 06:15:17 -08:00
Rafael Kitover e7d135dbf1
Update links to new domain visualboyadvance-m.org
Update all URLs in the code and documentation to the new domain
visualboyadvance-m.org and also fix the date for the last release in the
CHANGELOG.md.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-02-06 15:55:19 +00:00
Rafael Kitover 60fc096f1a
build: add libglu-devel for solus in installdeps
Add libglu-devel to the list of dependencies for solus in installdeps,
this is required for wxWidgets and OpenGL.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-02-05 17:32:45 +00:00
Rafael Kitover 32bc9c9dc7
release v2.1.9
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-02-03 21:15:24 +00:00
Rafael Kitover 84b0a3e366
Remove SDL sound driver
Because of reported framerate issues with the SDL sound driver, remove
it and make XAudio2 the default on Windows and OpenAL the default
everywhere else.

Rewrite the "sdl" value from users' configs to the new default.

Make OpenAL a mandatory dependency as well.

Fix #709

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-02-03 20:59:37 +00:00
Rafael Kitover 418b7b64dc
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-02-01 02:00:29 +00:00
Ruben 2ad7dd1a79
Fix wav audio recording
Always use `av_wrte_trailer()` even for audio recordings, because an
invalid wav file was generated otherwise.
2024-01-24 00:39:48 +00:00
Rafael Kitover f915ec5972
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-01-19 02:00:47 +00:00
Rafael Kitover 37acfc8d50
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-01-17 02:00:31 +00:00
Rafael Kitover 9202bfd55e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-01-16 02:00:33 +00:00
Zach Bacon 23ef8ef0f9
Dialog appearance improvements + link warning
In SoundConfig.xrc and DisplayConfig.xrc use the 'option' property
to fully expand the contents.

In NetLink.xrc add a label at the top of the dialog explaining that Link
will likely not work over the internet or over LAN.

Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-01-15 16:19:52 -08:00
Rafael Kitover 390482a719
build: use libsamplerate with vcpkg sdl2 port
Enable the samplerate feature for the vcpkg sdl2 port to use
libsamplerate for resampling.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2024-01-02 02:57:09 +00:00
Rafael Kitover d1aa4eb23d
build: detect vcpkg host triplet for build deps
On Windows, detect the host triplet for vcpkg and prepend it to the
triplet list to get the binary packages for vcpkg build dependencies
correctly.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-31 16:06:41 +00:00
Rafael Kitover 7dc95076e5
build: fix vcpkg binary package list parsing
Fix parsing of package list from the server html, which was ignoring
brotli because it was on the same line as another package. Use a
different method to extract the links that does not rely on them being
on separate lines.

Also fix the errors from `vcpkg list` on new vcpkg clones.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-31 15:41:05 +00:00
Rafael Kitover 92d9230e2c
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-30 02:00:36 +00:00
Rafael Kitover 6e2f1f1103
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-29 14:48:16 +00:00
Rafael Kitover fa720aea07
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-29 14:47:50 +00:00
Stanley Kid e70e57a5c0
translations: remove strings to not translate
Mark some strings that don't need to be translated as such to remove
them from the catalog.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-29 14:23:16 +00:00
Rafael Kitover 9e2a9b479a
doc: update commit message guide in dev manual
Describe the requirements for commit messages in this project in detail
and add a standard set of area prefixes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-25 15:20:21 +00:00
Zach Bacon 3ab048bebf
translations: remove < 50% done translations
Remove all translations that are less than 50% done from Transifex and
the repo.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-25 14:28:48 +00:00
Rafael Kitover a045270164
build: don't fseeko64()/ftello64() on musl libc
Check for musl libc in Patch.cpp and use fseeko()/ftello() in that case
instead of fseeko64()/ftello64() as well, as the 64 variants are glibc
extensions.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-23 10:23:25 +00:00
Rafael Kitover 3c5348983b
build: add Alpine Linux support to installdeps
Add basic support for Alpine Linux to installdeps.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-23 09:46:47 +00:00
Zach Bacon db355126d3 README.md: Minor spelling corrections
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2023-12-22 13:38:09 -05:00
Zach Bacon eea649ae16 README.md: Added a link to the flathub page to install vba-m as a flatpak
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2023-12-22 13:35:18 -05:00
Zach Bacon 9e9fe812d2 visualboyadvance-m.metainfo.xml: add screenshots to the metainfo
Useful for app stores like KDE's discover and gnome software
Also updated to current specifications of appstream
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2023-12-20 22:06:21 -05:00
Rafael Kitover c0e71b0cb4
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-20 02:00:59 +00:00
Rafael Kitover ddc6fd7080
release v2.1.8
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-13 15:06:53 +00:00
Rafael Kitover 8184522c6d
build: don't use vcpkg on non-WIN32 w/o triplet
Fix the logic in the vcpkg automatic support to return on non-WIN32 if
VCPKG_TARGET_TRIPLET is not defined.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-13 14:50:54 +00:00
Rafael Kitover e955501f61
build: update macOS dependencies
Update sdl2, sfml, wxwidgets and ffmpeg dependencies to the latest
versions in the macOS builder.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-13 13:49:54 +00:00
Rafael Kitover ef09fca4d1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-07 02:00:59 +00:00
Rafael Kitover 78b99d8b23
build: fix wrong syntax in vcpkg cmake
Fix if(EXISTS var) statements to be written as if(EXISTS ${var}) because
the EXISTS operator does not accept variable references.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-04 00:13:29 +00:00
Rafael Kitover 717ac7ed74
build: fix inst check for VS default vcpkg
Since the new default VS vcpkg does not implement list, use list from
the powershell module to check for packages that are already installed.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-03 16:50:44 +00:00
Rafael Kitover 59d67fe703
build: fix check for vcpkg ports in vcpkg clones
Fix checking for already installed vcpkg ports in user vcpkg clones,
broken in 491f104b (build: better binpkg support for default VS vcpkg,
2023-11-30).

Checking for installed ports in the VS default vcpkg is still broken,
because it does not implement the list command.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-01 10:38:20 +00:00
Rafael Kitover de1f4dffba
build: prefer user vcpkg root over VS system-wide
If the vcpkg clone exists in our preferred location, and VCPKG_ROOT has
not been passed to the build system, use it over the Visual Studio
default one, which is much more problematic.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-12-01 09:54:51 +00:00
Rafael Kitover 491f104b89
build: better binpkg support for default VS vcpkg
Check for cl.exe in the PATH to also automatically enable vcpkg support.

Ignore git errors for default VS vcpkg, as it is not in git.

Get host triplet packages (build depends currently) for static triplets,
e.g. get x64-windows packages also when getting x64-windows-static
packages. This helps with the default VS vcpkg too, as it cannot run
regular install commands for build deps.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-30 17:53:24 +00:00
Rafael Kitover 244ee8ebfa
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-30 02:00:59 +00:00
Rafael Kitover 3683938ec7
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-22 02:01:02 +00:00
Rafael Kitover 64d8cfffc2
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-17 02:01:00 +00:00
Rafael Kitover 18f3449c31
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-16 02:01:01 +00:00
Rafael Kitover 8db618625d
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-15 02:01:01 +00:00
Rafael Kitover a262a2facf
build: make inferred vcpkg triplet default static
Make the vcpkg triplet inferring code only run on WIN32 explicitly, and
make all inferred triplets -static, not only when BUILD_SHARED_LIBS is
FALSE.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-14 08:40:10 +00:00
Fabrice de Gans beab088139 Store the PC register at the appropriate offset
In ARM mode, the GBA CPU stores the PC (r15) register with an offset of
4. This was not handled correctly by the core emulator.

Fixes #1200
2023-11-10 15:55:41 -08:00
Rafael Kitover 215e9b1ac2
build: fix vcpkg support for Linux
Fix the Linux-specific date command in the cmake code, and skip the ABI
check for vcpkg, because it is failing for some reason on Linux+vcpkg.

The resulting executable works perfectly.

This should also help on mac, I will test this later.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-10 09:50:50 +00:00
Rafael Kitover 0e68a2340c
build: compare vcpkg bin pkg revisions explicitly
Compare port revisions explicitly instead of appending to version
string.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-10 06:48:33 +00:00
Rafael Kitover 0eb65a0eb3
build: fix finding vcpkg binary packages on server
Fix the regex against the file listing module on the server for the
vcpkg binary package list.

Also replace all the dashes in versions with periods for comparison
purposes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-07 18:32:02 +00:00
Rafael Kitover 1af7aa2333
build: install vcpkg binary packages in dep order
Use the new code in the powershell module for vcpkg binary packages to
install the downloaded binary packages in dependency order with build
dependencies so that the database is not corrupted at any point in the
installation process or after.

Also remove the build binary package directory after installation, so
that all the previous packages are not reinstalled if a package is
updated on a subsequent run.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-07 15:36:40 +00:00
Rafael Kitover e9162a0d28
build: handle revisions for vcpkg binary packages
Read the revision from the vcpkg binary package zip file names and from
`vcpkg list` and use them in version comparisons.

Also fix up the indentation a bit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-11-02 18:01:18 +00:00
Rafael Kitover 99923dd126
ci: add Visual Studio workflow
Add a Visual Studio build workflow to the CI, test building using ninja
(msbuild support needs to be fixed) for both 64 and 32 bit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-28 14:44:02 +00:00
Rafael Kitover 3a1b577d0a
build: prototype binary packages for vcpkg
Now that there is a task on the Windows build VM to upgrade all vcpkg
ports and generate packages, update the cmake vcpkg code to install
them.

This is a working prototype implementation, all of this will require a
significant amount of further work.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-27 06:41:32 +00:00
Fabrice de Gans bf2452aab9 Resize GameArea after MainFrame initialization
The GameArea was setting incorrect minimum size during initialization
due to the MainFrame not being entirely loaded, this caused the
MainFrame to not be resized properly on initialization. Resetting the
MainFrame minimum size after everything has been loaded fixes the issue.

This also changes MainFrame to ignore events sent before initialization
is complete, which should speed up startup a bit.

Fixes #1186
2023-10-24 12:49:34 -07:00
Fabrice de Gans 71ca0fb270
Properly hide the status bar at startup
Previously, the status bar was always shown at startup, even if the
status bar had been previously disabled. This fixes the issue by hiding
the status bar when it is first set up, if needed.
2023-10-24 17:51:02 +00:00
Rafael Kitover e19e13fa0a
build: use std:: proxy for nonstd:: on non-macOS
The nonstd:: implementation of nonstd::variant was causing a link error
in the Debug configuration on MSYS2 CLANG64.

Set the macros for choosing the implementation of both nonstd::optional
and nonstd::variant to the std:: forwarding behavior on all platforms
other than macOS.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-24 17:22:47 +00:00
Zach Bacon 1c76e3b0f4 snapcraft.yml: Rebuilt the snapcraft yaml to utilize core22
Also added the joystick plug, however it doesn't autoconnect.
to autoconnect manually you'll need to use snapctl

Permission will be asked by the snapcraft forums to allow it to autoconnect

Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2023-10-23 14:14:35 -04:00
Rafael Kitover c36c3e0250 doc: simplify vscode instructions
Remove the suggested project config in favor of a suggested global
settings.json configuration change to use ninja and automatically run
cmake.

The other parts are all automatic now and don't need to be mentioned.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-23 15:16:34 +00:00
Rafael Kitover 6c38eaa2a5
build: rm gone ffmpeg deps in link flags for macOS
Followup on d8d3ee2b (build: remove unneeded ffmpeg/sfml deps for macOS,
2023-10-20). Also remove the link flags for these deps in the cmake
code, otherwise linking fails.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-20 23:25:14 +00:00
Rafael Kitover 7e1afcd37c
Fix reading joystick hat config values
Use the wxString-returning form of wxRegex.GetMatch() because the bool
form always returns true if the initial match succeeded, causing every
hat direction in the config to be interpreted as north, the first
condition in the if statement.

Fix #1192

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-20 17:45:54 +00:00
Rafael Kitover d8d3ee2b48
build: remove unneeded ffmpeg/sfml deps for macOS
Remove all extra dists for ffmpeg deps since we only use core ffmpeg,
adding those in the first place was a mistake.

Remove libogg and liborbis and stop building sfml-audio, since we only
use sfml-network.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-20 10:40:58 +00:00
Rafael Kitover df83b4ba80
build: macOS builder updates
Bump openssl, curl, glib, sdl2, sfml, wxWidgets and ffmpeg.

Add support for DIST_INSTALL_TARGETS in order to use `make install_sw`
instead of `make install` for openssl because installing the man pages
and symlinks to them is very painfully slow with my install code. It's
even more painfully slow with whatever whoever did to my macOS virtual
machine.

Add `brew unlink openssl@3` in the brew setup code because someone broke
my compiler and it's not giving precedence to the include directories
passed on the command line, breaking the build.

Remove `-stdlib=libc++` from compiler flags. This was only necessary
when using a 10.7 macOS target, which has both libstdc++ and libc++,
libc++ being the newer and current distribution of the C++ standard
library for clang and macOS. We are now using a 10.10 macOS target which
does not have the old libstdc++, and this compiler option no longer
exists, causing a build failure in glib due to -Werror and an unused
command line option warning.

Remove my patch to link gettext statically for glib, this has been fixed
in the newer versions.

Install meson using pip in the python3 POST_BUILD instead of using a
dist.

Add the variables MAKE and MESON to point to the respective invoking
commands.

Check for /usr/bin/perl before /usr/local/bin/perl, the brew perl no
longer works but the macOS perl does.

Fix overwriting meson with a symlink when meson has already been
installed.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-18 23:40:22 +00:00
nuive 32581966ae Link: Fix menu not refreshing correctly
Start Network Link is not allowed while Local mode is selected, but
state change of Local mode was ignored until an option which triggers
EnableNetworkMenu() was selected.

Removed EnableNetworkMenu() from the Configuration option because it
doesn't change anything related to Link menu state.
2023-10-15 03:36:38 +00:00
Rafael Kitover 67af67278e
ci: use nix instead of brew for macOS workflow
Since brew has been failing frequently lately, use the nix action
instead.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-04 20:26:15 +00:00
Rafael Kitover e17d2cbaf5
build: fixes for nix on macOS
Add references to frameworks being linked to `buildInputs` in
`default.nix`.  Remove `-framework System` from `wxWidgets_LIBRARIES` in
the cmake code as it's not necessary and nix does it have it in
`darwin.apple_sdk.frameworks`.

TODO:

Debug build currently builds and runs. Release build builds but does not
run because of a problem with the dylib bundling.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-04 13:19:44 -07:00
Rafael Kitover 7e46939826
build: add pcre2 and openal to default.nix
Add openal, which was missing, and pcre2 which is required by glib,
which is an indirect dependency.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-10-04 16:26:46 +00:00
Rafael Kitover 0501f985a3
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-22 02:00:59 +00:00
Rafael Kitover cee1789259
release v2.1.7
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-11 05:05:56 +00:00
Rafael Kitover aca206a721 Launch on xwayland under Wayland if no EGL
On initialization, if wxWidgets was compiled without EGL support, check
in environment variables if running under Wayland and if so tell GDK to
prefer using an X11 backend, causing the program to launch under
xwayland.

Fix #1028

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-10 21:14:45 -07:00
Rafael Kitover 93a24bee3c Disable mirroring for ROMs > 32MB
In doMirroring() do nothing if the ROM size is greater than 32MB. This
fixes these ROMs automatically working without disabling mirroring in
settings.

Fix #1046

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-06 18:52:35 +00:00
Rafael Kitover ea5cbba016
build: update default.nix for macOS and new wx
Update the default.nix, which is used on nixOS and other nix
installations for loading the build dependencies into a shell for
building.

Update the wxWidgets package to wxGTK32, the current version.

Add an if statement to check for macOS and load the right package set
for it.

Building with nix on macOS does not currently work, but the build
dependencies do work now.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-05 16:49:21 +00:00
Rafael Kitover f6e3daf9d8
ci: use matrix, disable macos for now
Change CI actions to a matrix with cmake options, for both release and
debug builds, with ENABLE_LINK=OFF and ENABLE_SDL=ON configurations, for
all 3 runners.

Also add both g++ and clang++ to the matrix for the Ubuntu runner to
test on clang.

Disable the macOS workflow for now because brew is failing to install
dependencies.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-04 22:55:51 +00:00
Fabrice de Gans 0f4ec57557 [Build] Fix the NO_LINK build
The NO_LINK build had bitrot and was no longer building. This fixes the
issue by properly disabling Link-related code, including unreachable
functions when the project is built with ENABLE_LINK=FALSE
2023-09-04 13:46:29 -07:00
Rafael Kitover 7a7778c644
build: fix installdeps for new Debian wx packages
Update installdeps for Debian to find the new version wx packages, but
still use the -gtk3 variants on very old versions of Debian.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-04 20:41:17 +00:00
Fabrice de Gans 803ab35269 [GB] Save MBC7 EEPROM data to `gbRam`
Previously, MBC7 EEPROM was saved at address 0xa000 in memory, rather
than inside the `gbRam` data buffer. This was inconsistent with other
mappers, resulting in issues like the EEPROM data being cleared on
`gbReset`.

Fixes #1173
2023-08-27 17:08:09 -07:00
Fabrice de Gans 24b6ac5a28 [GBA] Implement missing Thumb instruction
The CMP Thumb instruction was missing one variant. This is used in the
Chinese fan translation of Mega Man Battle Network 2.

Fixes #889
2023-08-27 16:52:36 -07:00
Rafael Kitover 0e5d63cd9a
build: update to Mac third_party_libs_tool 1.3
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-27 17:19:08 +00:00
Rafael Kitover cd8d65bddd
build: set cmake C++ version to 17, fix Mac build
Fix Mac build regression caused by 2407923f (build: fix cmake version
warnings, 2023-08-26) due to vbamcore and vbam targets using C++11 but
no longer being compatible with it.

When cmake_minimum_required() was set to a much older version, the
CXX_STANDARD property for vbamcore and vbam were ignored.

With the change mentioned above setting a higher
cmake_minimum_required(), the -std=gnu++11 flag started being passed when
compiling these two targets, making them fail due to recent changes no
longer being C++11 compatible.

Set cmake_minimum_required() to 3.8.2, the first version of cmake
supporting C++17, remove the CXX_STANDARD and CXX_STANDARD_REQUIRED
properties from these two targets, and set CMAKE_CXX_STANDARD to 17 to
set this property to C++17 for all targets in the project.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-27 08:04:57 +00:00
Rafael Kitover 2407923fc0
build: fix cmake version warnings
To fix some cmake dev warnings in recent cmake versions, move
cmake_minimum_required() to before project() and set the minimum
required cmake version to 3.5.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-26 02:32:50 +00:00
Rafael Kitover 37f4affe55
Merge remote-tracking branch 'libretro/master' 2023-08-26 02:26:44 +00:00
saulfabreg Wii VC Project 76cb71464d Fix GameCube builds for VBA-M Libretro too
The GameCube, like the Wii and Wii U, is also big-endian, so let's fix VBA-M for GCN too.
2023-08-19 15:26:08 +00:00
saulfabreg Wii VC Project 0cd79a96f5 Add VBA-M to Wii/Wii U nightly buildbot. 2023-08-19 15:26:08 +00:00
saulfabreg Wii VC Project 3745eea419 Fix Wii & Wii U builds of VBA-M for Libretro (Ploggy)
Since Wii and Wii U are both big-endian systems, we need to call in the Makefile for Libretro cores that these must use big endian code for be able to work, otherwise the emulation will just give a white screen.
Fix by Ploggy, many thanks to him.
2023-08-19 15:26:08 +00:00
LibretroAdmin a2378f05f6
Merge pull request #116 from saulfabregwiivc/wii-wiiu-fix
Fix VBA-M Libretro builds on Wii/Wii U. (Ploggy)
2023-08-18 12:39:10 -07:00
saulfabreg Wii VC Project f7d4370789
Add VBA-M to Wii/Wii U nightly buildbot. 2023-08-18 14:17:16 -05:00
saulfabreg Wii VC Project 46de99a0da Fix Wii & Wii U builds (Ploggy)
Since Wii and Wii U are both big-endian systems, we need to call in the Makefile for Libretro cores that these must use big endian code for be able to work, otherwise the emulation will just give a white screen.
Fix by Ploggy, many thanks to him.
2023-08-18 14:12:25 -05:00
Rafael Kitover 5583175559
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-15 02:00:58 +00:00
Fabrice de Gans 14a4b6f820 [dialogs] Move JoypadConfig to its own class. 2023-08-13 16:07:31 -07:00
Rafael Kitover 5f421b53c0
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-08 02:00:57 +00:00
Rafael Kitover 32d273ad78
build: notarize mac release binary
Notarize the mac release binary from cmake as described here:

https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow?language=objc

. This involves adding `--options runtime` when codesigning to enable
the hardened build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-22 20:51:48 +00:00
Rafael Kitover 774fbab7cc
build: write version to macOS plist
Separate writing the version into the Info.plist on macOS into a
separate action from the online updates Sparkle framework into a
separate POST_BUILD action because we are not using Sparkle for macOS
builds right now due to codesigning issues.

Also sort tags by reverse tag name in the cmake git version extractor
because a tag was rewritten.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-12 06:24:20 +00:00
Rafael Kitover 00645906a5
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-11 02:01:00 +00:00
Rafael Kitover bde372bc72
build: fix codesigning arm64 release binaries
CMAKE_CROSSCOMPILING is true when building arm64 on an x64 host, so
ignore this on MSVC.

Eventually we want to run osslsigncode through wine when cross compiling
for win32 on other platforms, or use the native signtool.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-10 01:37:55 +00:00
Rafael Kitover d0194d9a75
release v2.1.6
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-09 15:44:48 +00:00
Squall-Leonhart 7561ca97c1
Fix Discord streaming for OpenGL
Check if the OpenGL context is valid on every operation, and if not
re-initialize it. Also rebind the textures every time the frame is
drawn.

Also rename the SetCurrent method to SetContext, which is clearer.

Fix #643
Fix #767
Fix #840
Fix #843

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-06 20:40:54 +00:00
Rafael Kitover 24b92462f9
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-03 02:02:24 +00:00
Rafael Kitover ffec5aba5e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-30 02:01:01 +00:00
Rafael Kitover 882957a2d3
Override SetCurrent() in GLDrawingPanel
Make a bool SetCurrent() wrapper over checking the wxGL_IMPLICIT_CONTEXT
define and executing the appropriate behavior to set the OpenGL context.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-28 21:12:01 +00:00
Rafael Kitover 5b65066bf8
build: on mac install trans into debug builds too
Change the cmake code to install the translations gettext .mo files into
the .app bundle for non-release builds too.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-27 22:14:37 +00:00
Rafael Kitover 790618102d
builder: bump SDL2 2.24.0 -> 2.28.0
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-23 00:56:37 +00:00
Rafael Kitover 9331dbf9c8
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-04 02:01:00 +00:00
Fabrice de Gans 6f68bfcf71 Create the config directory at first launch
First launch would fail because wx does not create the configuration
directory by itself if it does not exist.
This also fixes an incorrect menu option.
2023-06-01 18:28:14 +00:00
Rafael Kitover 7b8c4242fb
builder: macOS build updates
Update glib/gvdb to fix a compile error with newer clang compilers.

Add link flags for ffmpeg to link the static libraries and frameworks it
needs.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-31 13:38:44 +00:00
Rafael Kitover df84f2b005
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-31 02:01:00 +00:00
Rafael Kitover d08c9137c1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-29 02:01:01 +00:00
Rafael Kitover 7aafce0665
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-28 02:01:01 +00:00
Fabrice de Gans e26f807355 [bios] Fix lz77 and add BIOS_SndDriverVsyncOn
The lz77 uncompresssion software BIOS implementation was exiting early
when uncompressing data, if the overall length was larger than
advertised in the function parameter. However, real GBA BIOS does read
further than the advertised length, so we do here too. This fixes
Advance Wars title screen.

This also adds a SoundDriverVSyncOn implementation, silencing an error
for some Shrek games, though they still cannot properly boot with an
emulated BIOS.

Fixes #789
2023-05-27 22:51:39 +00:00
Rafael Kitover 4c8b54de89
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-26 03:28:10 +00:00
Fabrice de Gans bad388e0aa Move the GB ROM Info dialog to its own class
* Move the Game Maker information to a separate helper method.
* Make the dialog strings more localizable.
2023-05-23 15:19:39 -07:00
Fabrice de Gans d1f6500098 Refactor accelerator / global shortcuts handling
* Removes wxAcceleratorEntryUnicode and assorted arrays in favor of a
  new class, `config::Shortcuts`, which handles UserInput assignment to
  commands and resolution at runtime. `config::Shortcuts` also handles the
  INI user configuration in a backwards-compatible way. Runtime
  resolution of UserInput to command is also now logarithmic rather than
  linear.
* The same shortcut can no longer be assigned to 2 different commands,
  which fixes #158.
* Moves the `AccelConfig` dialog to its own dedicated class.
2023-05-23 11:56:32 -07:00
Fabrice de Gans fda429fc64 [GBA] Do not draw BG tiles from outside of BG VRAM
This was fixed by endrift in mGBA in commit
4ce9b83362
2023-05-09 17:12:30 -07:00
Fabrice de Gans b139572424 Convert wxJoyKeyCtrl to UserInputControl
This replaces all uses of wxJoyKeyCtrl with a new custom widget,
UserInputControl. Internally, this class keeps track of UserInputs
associated with the current control, allowing direct access to the
UserInputs, rather than going through string conversions.

Acceleration handling is simplified by going through UserInput -
converted to the key, mod, joy triplet for now - rather than handling
string comparisons.
2023-05-08 01:42:39 +00:00
Rafael Kitover b9694e1900
build: fixes for mac Homebrew
Add some fixes for building on macOS Homebrew.

- Set ZLIB_ROOT because zlib is now keg-only. Unfortunately the cmake
  warning about policy CMP0074 cannot be suppressed because of some kind
  of cmake bug.

- Update FindFFmpeg.cmake from:
  https://github.com/snikulov/cmake-modules/blob/master/FindFFmpeg.cmake
  , this fixes a problem with FFmpeg not being found.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-07 23:41:51 +00:00
Fabrice de Gans 5aa3ea92b9 Properly initialize wxAcceleratorTable
The `wxAcceleratorTable` for the `GameArea` panel was initialized with an
array of `wxAcceleratorEntryUnicode`, while the API calls for an array
of `wxAcceleratorEntry`. This resulted in the array not being properly
interpreted by the `wxAcceleratorEntry`. This fixes the issue by using
`wxAcceleratorEntry` to instantiate the array.
2023-04-24 18:04:43 -07:00
Fabrice de Gans 7b5d4a82d7 Remove unused code and use explicit type coercions 2023-04-24 18:04:32 -07:00
Fabrice de Gans 1f57d5f797 Remove global variables for ROM data
These can be accessed via the global gbCartData object. In addition,
this cleans up gbMemory to remove dead code that was used as a
workaround for ROM hacks.
2023-04-24 13:52:12 -07:00
Fabrice de Gans 0e29be8735 Support multiple RAM sizes for MBC7
We rely on the rom size in the cartridge header as a proxy for the RAM
size. Only 3 cartridges exist that use MBC7, Korokoro Kirby / Kirby
Tilt'n'Rumble and Command Master. Both versions of Kirby use a 256 bytes
EEPROM while Command Master uses a 512 bytes EEPROM. There does not seem
to be any other way to reliably get the EEPROM size for MBC7 cartridges.
2023-04-17 17:07:18 -07:00
Fabrice de Gans 75b79d91f1 Change MBC7 reported RAM size to 512 bytes
Some MBC7 cartridges use 512 bytes EEPROM rather than 256 bytes. For
compatibility with older versions, we keep saving and loading 256 bytes
of EEPROM for every MBC7 cartridge. TODOs have been left to figure out
how to identify the EEPROM capacity properly.
2023-04-17 17:07:18 -07:00
Fabrice de Gans 52c05c7147 Simplify battery save / load
* Removes all of the per-mapper helper functions in favor of an
  iovec-like structure that is set on ROM load and ROM patch.
* Changes the MBC7 RAM size to 256 bytes, which is what the cart
  actually uses.
* Works around issues with homebrews by overriding some of the header
  data. For instance, battery is disabled if a cart specifies a battery
  but no RAM and no RTC.

Test: This was tested with every known RTC/RAM/Battery variations by
creating a battery file before these changes and checking that the
battery file is still loaded properly with these changes applied. The
reverse was also tested to ensure compatibility.
2023-04-17 17:07:18 -07:00
Fabrice de Gans d8d6991c4b Refactor the save/load state and battery code
* Simplifies most of the GB save/load state code and changes many
  of the global variable uses to go through gbCartData instead.
* Changes all battery reads to use gzFiles. This seems to have been an
  oversight in an earlier refactor of the code.
* Removes some unused variables and stops exporting internal-only
  functions in GB.cpp/gb.h.

Breaking change: Cartridges with no mapper, but a save battery should
now properly save and load changes. However, this type of cartridge has
not been used in any commercially released software for Game Boy so the
exact intended behavior is speculative.
2023-04-17 17:07:18 -07:00
Rafael Kitover 36e88fafb6
Fix dsound looping when moving/resizing window
Add MOVE_START/MOVE_END events to detect when the window is moved or
resized and pause sound on Windows to prevent the DirectSound driver
from looping.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-04-13 13:47:17 +00:00
Rafael Kitover 93fbb5618d
build: add arm64 VS build configs
Add arm64 configurations to CMakeSettings.json for Visual Studio.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-04-12 03:01:25 +00:00
Rafael Kitover 6a1be5d4ad
build: update VS build configs
Update the Visual Studio build configurations in CMakeSettings.json to
remove dynamic builds and add RelWithDebInfo.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-04-12 02:52:02 +00:00
Rafael Kitover 23aa083cd4
build: support RelWithDebInfo for vcpkg
Make some tweaks to the cmake files to support
CMAKE_BUILD_TYPE=RelWithDebInfo, release with debug information for MSVC
vcpkg builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-04-12 02:43:13 +00:00
Rafael Kitover 40711fa5c9
build: lowercase vcpkg package names
vcpkg now requires that package names be lowercase, change all package
names to lowercase.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-04-11 23:17:06 +00:00
Fabrice de Gans 86bef62faf Move more options to g_owned_opts
* Moves most remaining options toggled by menu items to g_owned_opts and
  modifies associated usage.
* Adds more obervers to handle option changes.
2023-04-07 15:36:45 -07:00
Fabrice de Gans 928a61704f Move directory options to g_owned_opts
* Moves most directory settings to g_owned_opts.
* Converts the DirectoriesConfig dialog to the new structure.
* Various includes clean-ups.

Breaking change: Loading a GB/GBC/GBA ROM when the ROM directory setting
is unset for that platform will now populate the per-platform ROM
directory setting.
2023-04-06 00:49:55 -07:00
Fabrice de Gans 019fcda9c1
Sanitize and improve the GB header parsing (#1109)
Further testing showed some limitations with the current GB header
parsing. Many homebrew and some licensed cartridges do not follow the
expected format. In particular, the manufacturer code used in the "new
format" is not always used properly.

Some mapper flags seem to not actually exist in practice. These have
been documented as comments.

The header parsing code was creating string objects with '\0' bytes,
this is now properly sanitized.

The destination code flag was not being set properly. This has been
fixed.
2023-04-06 00:49:08 -07:00
Fabrice de Gans 7005b92840
Sanitize allocations in the Game Boy emulator (#1105)
This adds checks for every allocation failure in the core Game Boy
emulator. In addition, this replaces some magic values defined
constant expressions and removes an unused function.
This also removes asserts for failed allocations in GB.cpp, they now
report a failure to the caller.
2023-04-03 12:47:55 -07:00
Fabrice de Gans e91e4dcf17 Add nanosvg library dependency for vcpkg static builds
nanosvg is now a required dependency with recent wxWidgets builds.
2023-04-01 17:15:22 -07:00
Rafael Kitover 88b07df394
build: add pkgconf to vcpkg deps
Add pkgconf to list of vcpkg deps. We are not using it right now for
vcpkg builds, but it may be good to have available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-03-31 00:08:15 +00:00
Rafael Kitover 3cef52b72d
Fix pause/next-frame
Pause only sound on menu open on Windows, and resume on menu close if
emulator is not paused.

This is to avoid DirectSound looping on menu open.

Fix #788
Fix #1077

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-03-30 00:22:54 +00:00
multiSnow Liu d3f8cc1714
Option to suspend the X11 screensaver when running
On Linux, when not running under Wayland and the app was built with XSS
(X ScreenSaver) support, optionally suspend the X11 screensaver when a
ROM is loaded and not paused.

Add a "Suspend ScreenSaver" checkbox in UI Settings bound to an option
to enable this feature, visible only under X11.

Defaults to off, as there is already a call to suspend the screensaver
on joystick input, which may be sufficient for the user.

TODO: Add necessary support for other platforms.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-03-28 16:28:36 +00:00
Rafael Kitover df81959825
builder: update macOS build to 10.10, Wx 3.2.2.1
Bump the macOS target OS from 10.7 Lion to 10.10 Yosemite to use the
newest Wx, 3.2.2.1.

This also fixes dark mode support on macOS 13 Ventura.

Remove --enable-static from base CONFIGURE_ARGS because it breaks Wx,
and add it to DIST_ARGS where it's needed, libffi, libicu and libx264.

Make the necessary adjustments to build the new Wx and a couple of other
minor fixes.

Fix #1102

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-03-27 14:59:10 +00:00
Fabrice de Gans 0132c76100 Move GB/GBC header parsing to gbCartData
This adds a new class, gbCartData to do all of the GB/GBC header parsing
in a single location.

Breaking change: ROMs advertising a 2 KiB RAM size now properly only
have 2 KiB allocated for RAM, whereas it used to be 8 KiB. This was
tested with the one aftermarket ROM making use of this RAM size
(Quartet), with no issue. Save files and save state files should still
be compatible since the RAM was saved with the correct 2 KiB size.
2023-03-27 10:55:00 +00:00
Rafael Kitover e505236ec4
Merge remote-tracking branch 'libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-03-25 12:23:58 +00:00
Rafael Kitover 785af394f6
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-03-24 02:01:03 +00:00
Rafael Kitover f15b09f8e5
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-03-20 22:43:31 +00:00
Fabrice de Gans 1ab46f704f Update SIOCNT when the link driver is disconnected
Some software (like the EU version of Digimon Racing) relies on the
SIOCNT register being properly updated when no cable is connected.
Otherwise, they risk getting stuck in a loop waiting for an update on
the SIOCNT register.
2023-03-19 22:22:43 +00:00
Fabrice de Gans 9889ef4fa8 Move GameBoyConfig dialog to its own class
This changes all of the options handled by the GameBoyConfig dialog to
use the new Option type. This also fixes a number of small issues
related to palette handling and GB emulation:
* Modifying the custom GB palette no longer incorrectly applies to GBC
  and SGB modes.
* Loading a GB save state (not GBC or SGB) properly applies the
  user-defined palettte and not the one in the save state.
* The GBC core now accepts .gbc BIOS files.

Finally, this modifies and renames wxFarRadio to widgets::GroupCheckBox.
In addition GroupCheckBoxes can now be loaded and fully configured from
the XRC file rather than having to be manually configured on dialog
initialization.
2023-03-15 00:45:22 +00:00
Rafael Kitover 1d7e8ae4ed build: fix build with new OpenAL
Remove the AL_NO_PROTOTYPES #define, it breaks the build with new
versions of OpenAL.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-03-12 15:06:42 +00:00
Fabrice de Gans 892527e53b Move ConfigManager to SDL
This removes ConfigManager from common source and header files and moves
it to be only used by the SDL frontend.
2023-03-07 14:11:52 -08:00
Fabrice de Gans bd7eac6c4b Add options shared with sdl to wx g_owned_opts
This removed the dependency on ConfigManager from the wx frontend.
Next: Move ConfigManager to be only used by the SDL frontend.
2023-03-07 13:38:46 -08:00
Zach Bacon efffe7c333 Add the repology badge to the readme.
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2023-02-27 21:07:25 -05:00
Squall Leonhart a529ddfe49 remove non-working override. 2023-02-27 20:31:02 +00:00
Squall Leonhart 9a8a077443 Lets fix Stuart Little 2 properly (maybe?)
This game cart may have a flashcontroller but no flashram onboard, the game automatically goes down the Flash Type path and hits a stackoverflow at cpuSaveGameFunc after cpuSramEnabled returns as false

I'm not sure of the specifics, but with this change it seems to avoid this condition.

I have tested a number of titles that create Sram, 512 and 1024Mbit flash and they all still seem to just fine.
2023-02-27 20:31:02 +00:00
Squall Leonhart a9284b3d66 workaround for Stuart Little 2 crashing when set to none
despite not having backup ram.
2023-02-27 17:17:28 +00:00
Squall Leonhart 166299cda6 Implements Read/Writes for HUC3
Also seperates HUC1 from MBC1
2023-02-27 02:18:27 +00:00
Rafael Kitover 1a63a27c62
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-27 02:01:01 +00:00
libretroadmin 640ce45325 Change SOUND_CLOCK_TICKS to 280896 cycles - ~1074 samples per frame 2023-02-27 00:14:05 +01:00
Rafael Kitover 83d24828df
build: fix default debug build for vscode
Check if CMAKE_BUILD_TYPE is false and not just empty string, as it is
some kind of other empty value in the default vscode build and the check
fails.

If CMAKE_BUILD_TYPE is unset, default to Debug, which is what vscode and
most things expect as the default CMAKE_BUILD_TYPE.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-21 20:53:20 +00:00
Fabrice de Gans f1d3f631d2 Fix automatic dynamic frame skipping
The previously used algorithm was too aggressive. This fixes the issue
by using the last second data and using a more gentle adjustment curve
to prevent huge changes in frame skipping.
2023-02-15 13:52:16 +00:00
Fabrice de Gans d1733c4505 [ConfigManager] Move wx options to g_owned_opts
This is a preliminary change towards removing ConfigManager from the wx
build. Usage of these options has also been modified in the wx frontend.
2023-02-14 18:06:41 -08:00
Fabrice de Gans d37a3a32e1 Move remaining options used by core to CoreOptions 2023-02-14 16:33:03 -08:00
Rafael Kitover 3f507b6c6a
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-14 02:01:02 +00:00
Rafael Kitover e560efb08f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-12 02:00:57 +00:00
Rafael Kitover ca841e9bae
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-11 02:00:59 +00:00
Rafael Kitover 4b605b4b1a
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-10 05:53:02 +00:00
Stanley Kid d756f6716f
translations: fix some source strings
Fix some more strings marked for translation in the source code to be
more correct and easier to localize.

References #1071 #1029

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-10 05:50:20 +00:00
Rafael Kitover 49140fe5dd
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-10 02:01:01 +00:00
Rafael Kitover 5d4f1bd0d9
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-09 16:18:49 +00:00
Fabrice de Gans 91873254d3 Add INI file versioning
This introduces a new INI config option called "IniVersion". Whenever
default values change or options are renmaed, the latest version number is
incremented and an update path is run.
This change also rewrites part of the initialization routine by adding
more safety checks before creating or reading the configuration file.
2023-02-08 01:31:40 +00:00
Rafael Kitover ae09ae7d59
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-07 02:01:00 +00:00
Fabrice de Gans 950a4070c1 Move display options to owned_opts
This also removes limits on the main window position so it can now be
negative. This is necessary on Windows where multiple screens to the
left and top of the main screen have negative coordinates. A check at
startup ensures we always restore the window within the drawable area.
2023-02-06 04:49:36 +00:00
Fabrice de Gans 216bf4d7e4 Restore "Fullscreen at startup" handler
This was mistakenly removed.
2023-02-05 20:29:14 -08:00
Rafael Kitover f0fd9208b7
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-06 03:27:56 +00:00
Fabrice de Gans 31e17c1ba4 Add less verbose proxy object accessor
This introduces an OPTION macro, as well as assignment operators and
convenience conversion operators to make it easier to treat the
OptionProxy object (renamed from Proxy) as a variable.
2023-02-06 03:25:37 +00:00
Fabrice de Gans 2b950e282f [Option] Add Proxy template class for Option
This removes the global accessors for individual options in favor of a
proxy template class with a simpler per-type API. This adds compile-time
checks to validate that the right option is used with the right type
when accessing it directly.
2023-02-06 03:25:37 +00:00
Rafael Kitover f84a164072
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-06 02:00:59 +00:00
Fabrice de Gans 60568d26e0 Move core options to a struct
Options used by the core emulator were set with global variables. This
moves all of the options used by the core emulator into a new struct,
shared by all 3 frontends.
2023-02-06 01:22:19 +00:00
Stanley Kid 64921c6535
translations: fix some source strings
Fix some source strings in the source code that are marked for
translation to be more formally/grammatically correct and easier to
localize.

References #1029

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-05 19:55:06 +00:00
Rafael Kitover 257150f46b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-05 17:29:58 +00:00
Rafael Kitover 61046c76bf
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-05 17:29:14 +00:00
Fabrice de Gans fad2e7a310
Fix issues with the DisplayConfig dialog (#1066)
The DisplayConfig dialog had a few issues:
* The OK/Cancel buttons were not working as expected. The configuration
  options would be immediately written whenever some control values were
  changed. The configuration options are now properly being set on a
  click to OK, and ignored on a click to Cancel.
* The X button works again.
* There is now proper validation for the Display Scale option,
  validation ensures that the value is in the right range and incorrect
  data can no longer be input in that field.
* The Direct3D option is now properly enabled on Direct3D builds.
2023-02-04 21:59:04 -08:00
Fabrice de Gans 2cec46f825
Clean-up ConfigManager options (#1067)
* Clean-up ConfigManager options

Many of the options in ConfigManager were not actually used.
* Some options are only used by wx, they have been moved to gopts. In
  addition, the type of the option has been changed to "bool" when
  applicable.
* Some options are only used by SDL and do not have a corresponding
  configuration option, they have been moved to the SDL implementation.
* Some options are not used at all, they have been removed.
2023-02-04 21:39:13 -08:00
Rafael Kitover dc6659857c
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-05 02:01:03 +00:00
Rafael Kitover 1c2a62f055 Include cstdint for wx
Close #1065

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-04 06:51:34 +00:00
Rafael Kitover 7d9cb2b5f0
Default GBA LCD filter to off.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-04 01:46:38 +00:00
Rafael Kitover 5385b477da
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-02 02:01:02 +00:00
Rafael Kitover aabb70cb85
Followup on be1e5ca1, wrong ref var declaration
Fix rvalue variable declarations in be1e5ca1, the && associates with the
variable, not the type.

This has no effect on functionality.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-01 13:27:22 +00:00
Rafael Kitover 266512fbbc
translations: move ru trans to ru_RU, delete ru
Move ru.po to ru_RU.po because it is the more complete translation, and
the latter is checked first.

Fix #1057

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-01 05:06:35 +00:00
Rafael Kitover be1e5ca18c
Check for wx < 3.2.2 for EGL move fix backport
When executing the EGL subsurface move backport fix, check for loaded
library version < 3.2.2 so as not to execute an unnecessary EGL
subsurface move operation on versions which will already have the fix.

References #1028

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-02-01 04:58:56 +00:00
Lars Wendler 1fb18b320f Rename appdata to metainfo
See https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html
chapter 2.1.2 "Filesystem locations"

Signed-off-by: Lars Wendler <polynomial-c@gmx.de>
2023-01-20 06:14:56 -08:00
Rafael Kitover 561d6e1ab0
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-01-17 02:01:00 +00:00
Rafael Kitover 78724bc893
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-01-16 02:01:00 +00:00
Fabrice de Gans addd53b69d Remove all warnings in gba/bios.cpp
A regression from #1008 was identified as the root cause for #1050 and
fixed in #1051. This is a follow-up that changes the constants used
for `sineTable` to be unsigned hex, which fixes warnings in MSVC
without breaking changes.

Bug: #1003
2023-01-14 16:32:58 -08:00
Rafael Kitover 2e3ce863c7
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-01-14 02:01:01 +00:00
Rafael Kitover 4c4ce3cf37
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-01-13 02:01:00 +00:00
Squall Leonhart ca7ae3363e
Fix regression in bios, port DMA fix from libretro 2023-01-10 06:29:40 +00:00
Rafael Kitover 25bcf2e42d
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-01-10 02:00:59 +00:00
Squall Leonhart b34448c9eb
Fix record/play dialogs for native recordings
Resolves assertions when opening the file selection dialog windows for
recordings.
2023-01-08 14:17:07 +00:00
Rafael Kitover 3989146fa5
build: enable severe warnings for MSVC release
Enable severe warnings for MSVC release builds with /W1.

Disable macro redefinition warnings explicitly with /wd4005.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-01-06 16:58:52 +00:00
Rafael Kitover 0a96d84581
build: make release build quieter
Silence output of nuget commands used to get gettext tools for the
Windows build.

Remove Objective-C++ source files (.mm extension) from the list of all
sources passed to xgettext to silence the warning about the file type
being unrecognized. These do not have any strings that need to be
translated.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-01-06 16:24:12 +00:00
Rafael Kitover 6a4115ca45 ci: fix macOS runner
It seems the GitHub Actions macOS image has a conflicting python in
/usr/local, invoke:

brew -v install python
brew link --overwrite python

, before installing dependencies.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-29 20:29:53 -08:00
Rafael Kitover 6307348cbc build: support MSVC arm64 cross build on x86
Adjust cmake code to support building a Windows arm64 binary on a
Windows x86/x64 host.

Add /EHsc to MSVC compiler flags for exception unwind support.

Check VCPKG_TARGET_TRIPLET in Architecture.cmake to set the appropriate
cmake variables for cross-compiling for arm64.

Add MSVC_x86_Host_Compile.cmake script, used from HostCompile.cmake, to
adjust the path of the cl.exe compiler and ENV{LIB} to build a C program
for x86 when cross-compiling, necessary for the bin2c utility.

Use wxrc from dependencies submodule when cross-compiling, because the
cross wxrc executable cannot be run on the host.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-29 20:29:53 -08:00
Rafael Kitover 77f1235a95 build: update Windows dependencies submodule
Update contains wxrc.exe for cross builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-29 20:29:53 -08:00
Rafael Kitover 9963b81506
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-30 02:04:11 +00:00
Rafael Kitover 7a45c16539
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-29 02:04:08 +00:00
Rafael Kitover 87bdc93e15
Revert "translations: use %% instead of percent"
This reverts commit 1ac7ac999b.

The %% sequence turned out to not be dealt with specially by gettext
tools.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-28 18:51:37 +00:00
Rafael Kitover ab4ae96e05
Clarify/set condition: wayland && !wayland_egl
Check for the condition where the windowing system has wayland support
but not wayland EGL support for wxGLCanvas in wx, in which case the
Simple renderer must be forced.

This is currently how the wx packages are built on Fedora.

Refer #1028

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-28 18:27:04 +00:00
Rafael Kitover 8e4acfc91d
Fix build w/wxUSE_GLCANVAS_EGL=0, on Fedora
Disable the EGL subsurface move backport for Wayland GLCanvas if the wx
config sets wxUSE_GLCANVAS_EGL=0 (off.)

This fixes the build failure on Fedora. To fix the functionality,
however, they need to enable the EGL GLCanvas in their wx builds.

Also use a different hack to access the private wxGLCanvasEGL member
using template instantiation instead of redefining a keyword as a macro.

Refer #1028

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-28 17:24:08 +00:00
Fabrice de Gans 3c41b68d51 Fix the Windows ARM64 build
* Remove arch constraints in a CMake block.
* Convert some tab identation to spaces.
2022-12-27 21:59:33 +00:00
Rafael Kitover e10bf7bc4b
installdeps: check for newest wx on Fedora
For Fedora ./installdeps support, install either wxGTK-devel or
wxGTK3-devel, depending on which has a higher version.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-24 06:41:00 +00:00
Rafael Kitover 8329ba9646
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-22 02:02:15 +00:00
Rafael Kitover 7aa1f59128
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-21 02:01:00 +00:00
Rafael Kitover a16dd2c9f7
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-20 02:01:00 +00:00
Rafael Kitover 26818177e8
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-19 02:01:02 +00:00
Rafael Kitover 22578d02eb
Increase MAX_CART_SIZE from 32MiB to 128MiB
Some ROM hacks are larger than 32MiB.

Fix #1046

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-16 16:35:15 +00:00
Rafael Kitover f8c1d31294
release v2.1.5
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-15 11:58:01 +00:00
Rafael Kitover fd2df853b6
build: turn off Sparkle on macOS
Disable the Sparkle online updater for the mac build because it requires
10.13 and we currently only build for 10.7.

Once I add a newer macOS build, I will reenable it for that build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-15 10:03:02 +00:00
Rafael Kitover cf600890bf
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-08 02:00:59 +00:00
Rafael Kitover 0ca1771a49
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-05 02:01:02 +00:00
Rafael Kitover 1ac7ac999b
translations: use %% instead of percent
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-04 15:55:42 +00:00
Rafael Kitover 77e9ea6a2f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-04 02:01:01 +00:00
Rafael Kitover ccb9af2c64
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-02 22:50:51 +00:00
Rafael Kitover dcc5ae07d0
translations: update .tx/config to new format
Re-run `tx init` and `tx add` to rewrite the .tx/config file to the new
required format.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-02 22:48:44 +00:00
Rafael Kitover ea10306daa
translations: minor additions/adjustments
Add a few translation markers for strings that are translated in the
wxWidgets catalogs, which we do not pull yet.

Also change the string "% of normal:" to "percent of normal:" because
the percent sign was causing an error in poedit.

Fix #1029.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-12-02 22:21:13 +00:00
Rafael Kitover a42e166e94
build: fix syntax and rm dbg prints from 2a65e92d
Remove two debug messages and add a missing paren to the cmake source.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-28 18:34:48 +00:00
Rafael Kitover 2a65e92da2
build: remove StrawberryPerl from ENV{PATH}
On Windows, StrawberryPerl tools and libraries exposed in the PATH
environment variable can pollute and break the build, remove any such
entries for WIN32 as a startup cmake action.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-28 10:27:06 -08:00
Rafael Kitover 6d8ca723d0
build: restrict MSVC static libs to .lib only
The MSVC linker can now apparently link MinGW .a static libs too, and
StrawberryPerl pollutes the build with its own.

Set CMAKE_FIND_LIBRARY_SUFFIXES to .lib only when MSVC is true for
static builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-28 10:23:33 -08:00
Rafael Kitover 5807376fba
build: fix finding SDL2 on vcpkg (again)
Sometimes vcpkg calls the SDL2 library SDL2-static for static toolchains
and sometimes it doesn't, change FindSDL2.cmake to search some possible
library names in order of priority.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-27 19:34:29 +00:00
Rafael Kitover 1a687e564b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-24 02:02:13 +00:00
Rafael Kitover 8f1b5dae90
Merge remote-tracking branch 'libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-18 00:24:23 +00:00
Fabrice de Gans 0483524870 [build] Add VS Code integration
* Infer the VCPKG triplet for MSVC-like environments.
* Add recommended VS Code settings.
* Add instructions for using clangd.
2022-11-12 13:26:23 +00:00
Rafael Kitover 61b503ada4 builder: update core dists and macOS build
cmake:

Add cmake option `DISABLE_MACOS_PACKAGE_MANAGERS` to disable
automatically using macOS Homebrew, MacPorts or Fink.

Use `-Ofast` instead of `-O2` for default compiler optimization flags,
which enables `-ffast-math` among a few other tweaks. There is a lot of
controversy about this, but in our testing on MSVC with `/fp:fast` the
performance increase for this specific app is dramatic.

Update version regexps on the SFML headers in `FindSFML.cmake` to allow
for a variable number of spaces between the macro and its definition.

Update the version of the Sparkle update checker framework for macOS
from 1.23.0 to 2.3.0-beta.2, and add a command to the cmake commands for
copying the framework to the `.app` to delete it first if already
copied.

Builder dist changes:

Updates:

dist                    old v                   new v
==============================================================
xz                      5.2.4                   5.2.6
openssl                 1.1.1f                  1.1.1g
curl                    7.65.3                  7.85.0
ccache                  3.4.3                   4.6.3
cmake                   3.19.4                  3.24.1
autoconf                2.69                    2.71
autoconf-archive        2017.09.28              2022.09.03
libtool                 2.4.6                   2.4.7
help2man                1.47.5                  1.49.2
libiconv                1.16                    1.17
gsed                    4.4                     4.8
bison                   3.0.5                   3.8.2
texinfo                 6.5                     6.8
flex                    e7d45afc                ea6493d9
libicu                  65_1                    71_1
nasm                    2.14.02                 2.15.05
pcre                    8.41                    8.45
libffi                  3.2.1                   3.4.2
libxml2                 2.9.12                  2.10.2
libxslt                 1.1.33-rc2              1.1.37
XML-SAX                 0.99                    1.02
expat                   2.2.4                   2.4.8
libjpeg-turbo           2.0.4                   2.1.4
libtiff                 4.1.0                   4.4.0
freetype                2.10.0                  2.12.1
libgd                   2.2.5                   2.3.3
liberation              2.0.1                   2.1.5
urw                     91edd6ec                20200910
graphviz                4bf0ec9b                5.0.1
python2                 2.7.15                  2.7.18
python3                 3.9.1                   3.10.6
swig                    3.0.12                  4.0.2
doxygen                 1.8.14                  1.9.5
bakefile                33c270a5                7a218d89
XML-Parser              2.44                    2.46
ninja                   1.9.0                   1.11.1
meson                   0.51.2                  0.63.2
glib                    2.62.2                  51251940
libgpg-error            1.41                    1.45
libgcrypt               1.8.5                   1.10.1
libsecret               0.19.1                  0.20.5
sdl2                    2.0.10                  2.24.0
flac                    1.3.3                   1.3.4
libogg                  1.3.4                   1.3.5
libvorbis               1.3.6                   1.3.7
harfbuzz                1.7.5                   5.1.0
sfml                    03375688                2.5.1
shared-mime-info        1.9                     2.2
wxwidgets               9cc0c9a0                31720e1e
graphite2               ce0e793f                425da3d0
xvidcore                1.3.5                   1.3.7
fribidi                 1.0.1                   1.0.12
libgsm                  1.0.18                  1.0.22
libmodplug              5a39f591                d1b97ed0
libopencore-amrnb       0.1.5                   0.1.6
snappy                  1.1.7                   af720f9a
speex                   1.2.0                   1.2.1
vidstab                 1.1.0                   90c76aca
libvo-amrwbenc          0.1.3                   3b3fcd0d
libass                  0.14.0                  0.16.0
libbluray               1.1.2                   1.3.2
libvpx                  1.8.1                   1.12.0
libx264                 20190913-2245           f7074e12
libxavs                 distrotech-xavs-git     8300fbf4
libzmq                  4.2.2                   4.3.4
ffmpeg                  4.3.1                   5.1.1

Removed dists:

dist            ver
=========================
zlib            1.2.11
pkgconfig       0.29.2
docbook5.0      5.0
libwavpack      5.1.0

Added dists:

dist            ver
========================
zlib-ng         ce01b1e4
zstd            1.5.2
hiredis         1.0.2
pkgconf         1.9.3
pcre2           10.40
docbook5.0.1    5.0.1
docbook5.1      5.1

Changes:

Update all non-working dist URLs.

Replace zlib 1.2.11 with a recent zlib-ng built with `--zlib-compat`.

Add zstd and hiredis, new deps of ccache.

Replace pkgconfig with pkgconf.

Use both pcre1 and pcre2.

Remove the libxml2-python dist alias and rebuild libxml2 `--with-python`
and `--with-python3` after python 2 and 3 have built.

Remove libwavpack as ffmpeg 5 no longer uses it as a dependency.

Builder core:

Rename some of the directories and files to be a bit nicer.

Add `-Ofast -march=core2 -mtune=generic -pipe` to the global
`{C,CXX,OBJC,LD}FLAGS`. These are the optimization settings used by
default in the project as well, while `-pipe` significantly reduces
build time by making the compiler use pipes internally.

Add `-DFLOAT_APPROX` to the global `{CPP,C,CXX,OBJC}FLAGS` because we
are now using `-Ofast` and consequently, `-ffast-math`.

Set the `LIBRARY_PATH` variable in the global environment.

Make some adjustments for the new dist versions and make some other
improvements.

macOS builder fixes (tested on High Sierra 10.13 and Catalina 10.15):

Add support for predefined BUILD_ROOT and append BUILD_ROOT_SUFFIX.

Allow pre-defined CHECKOUT directory for building the project sources.

Sanitize `PATH` before build to remove `/usr/local` etc., use
/usr/local/bin/brew explicitly for deps instead.

If llvm and clang is installed from nix or brew, prepend the path of the
highest version found to `PATH`.

Remove `-lm` from build environment as macOS has never had an `m` math
library and this causes problems in some config checks.

Add LLVM `libunwind` from the LLVM archive.

Add a patch for `glib`'s `meson.build` to statically link
`gettext`/`libintl`, adds `-liconv -framework CoreFoundation`.

Add an extra location to check for `stdint.h` in XCode.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-12 13:23:54 +00:00
Rafael Kitover d6aa168718
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-08 02:03:11 +00:00
Benjamin Siskoo 364dad84a9 Fixed typos and translated strings... 2022-11-07 02:21:39 +00:00
Fabrice de Gans 02f516f646 Set wxWS_EX_VALIDATE_RECURSIVELY style for dialog
This is no longer required since wxWidgets 3.1.0 but is needed for
prior versions.
2022-10-31 17:57:10 +03:00
Rafael Kitover f138b44a50
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-27 02:02:19 +00:00
Fabrice de Gans 080be1a325 [config] Make usage of Option less verbose
* Add convenience direct accessors to individual Options.
* Move BasicOptionObserver to a separate header and allow it to
  observer multiple options. This also removes the include for
  "config/option.h" for using this observer, reducing build time.
* Never skip the "Plugin" option when changing filters. This is
  already handled properly in the GameArea class. If the plugin is
  unusable, GameArea resets the filter to the default value.
* Make the OptionID names slightly less long and fix the inconsistent
  naming in the enum.
2022-10-26 12:28:14 +00:00
Rafael Kitover 0a104a9a9d
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-26 02:02:20 +00:00
Rafael Kitover 0bfb88d0e3
Fix regression in ea2a929f, check for Wayland
Fix regression in ea2a929f, which broke x11 support by not checking for
Wayland when making the Wayland EGL subsurface move call.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-25 19:17:40 +00:00
Rafael Kitover 873de5f667
build: update default.nix
Change dbus_libs to dbus, which is the new package name.

This is for `nix-shell` to build on NixOS.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-25 19:14:38 +00:00
Rafael Kitover 9bf6a25048
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-24 02:02:24 +00:00
Rafael Kitover ea2a929f5e Backport 800d6ed69b from wx to fix Wayland EGL pos
Backport 800d6ed69b from wxWidgets git to fix resizing the
`GLDrawingPanel` in Wayland using the EGL `wxGLCanvas`.

Also rename `IsItWayland()` to `IsWayland()`.

Fix #1028

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-23 13:14:03 -07:00
Fabrice de Gans 0ca5184dda [option] Convert all uses of geometry options to use config::Option
Moving and resizing the window no longer updates the entire option
set, reducing jank on move and resize.
2022-10-23 11:42:08 +00:00
Rafael Kitover d2d070b52f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-23 02:03:18 +00:00
Rafael Kitover c40a141792
Write vsync toggle msg to debug log not OSD
Write vsync enable/disable messages to debug log and not the OSD, they
are kind of annoying.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-22 11:55:56 +00:00
Rafael Kitover 5d2dd01e85
Call Layout() after DrawingPanel OnSize event
When processing the `OnSize` event in the `GameArea` and calling the
embedded `DrawingPanel` `OnSize` event, call `Layout()` afterwards.

This seems to improve the resizing behavior of the EGL `wxGLCanvas`
`DrawingPanel` on Wayland.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-22 11:51:13 +00:00
Rafael Kitover 00344ca8f1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-22 02:02:19 +00:00
Fabrice de Gans af4951511e [config] Add Observers for Options
This adds a generic Observer interface to config::Option. To
demonstrate its intended usage, the Display Configuration dialog and
the options it controls have been updated to be entirely handled via
the config::Option class.

Implementations for wxValidator are used to validate the flow between
the UI and the underlying Option. In turn, modifying the Option value
triggers all of its observers that should then do what they need to
do.

Rather than explicitly calling all of the needed methods after
modifying a global option value, the UI elements that need to be
notified when an Option value is modified will be notified via their
observers. Runtime assert checks are put in place to prevent infinite
recursion if an observer attempts to modify an Option while handling
the observer callback.

Once all uses of Options have been updated, we should get into a state
where the following will be true:
* cmdevents.cpp will no longer rely on the application state.
* All dialogs will have been moved to specific implementations,
  reducing the size of guiinit.cpp
* update_opts() will no longer need to be called and will be removed.

This will then make it easier to update accelerator handling to be
done with config::UserInput.

Bug: #745
2022-10-22 01:47:39 +00:00
Rafael Kitover da686a4827
Reinit panel on vsync toggle.
Destroy the DrawingPanel on vsync checkbox toggle so that it is
re-created with the vsync option in effect.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-21 21:43:13 +00:00
Rafael Kitover ec27885c36
Support EGL VSync on Wayland.
Add support for `eglSwapInterval()` to enable or disable VSync on
Wayland.

Also add status messages for enabling or disabling VSync, for both EGL
and GLX.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-21 19:19:28 +00:00
Rafael Kitover c27d384a53
Enable GL on Wayland for wx 3.2+, no vsync.
wxWidgets 3.2+ has experimental `wxGLCanvas` support for Wayland EGL,
enable it for those versions.

The `glXQueryExtensionsString()` method for enabling or disabling vsync
does not work on Wayland currently, so it's disabled.

TODO: Enable/disable vsync on Wayland EGL.

Fix #1028.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-21 17:24:46 +00:00
Rafael Kitover 75e46b7117
build: update macOS third_party_libs_tool from git
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-19 00:00:59 +00:00
Rafael Kitover c249115b7a
build: set -mtune=generic
Nach explained that this is the safest and best option.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-16 18:37:03 +00:00
Rafael Kitover d23b374fbf
ci: add basic macos-latest runner
Add basic macos-latest build to have one macOS runner.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-16 18:22:37 +00:00
Rafael Kitover 2985b46926
ci: add ubuntu-latest workflow
Add basic build on ubuntu-latest to have at least one ci build on Linux.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-16 14:18:13 +00:00
Adam Sampson 54b8192d30 Fix prototype for main.
A typo in 297d7c06c4 meant main had the
wrong prototype on non-Windows systems, breaking the build.
2022-10-16 13:08:25 +00:00
Rafael Kitover 927ccf0bc8
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-16 02:02:40 +00:00
Fabrice de Gans 8c1bd84f40 [config] Move VbamOption and wxGameControl to config namespace 2022-10-15 23:11:41 +00:00
Fabrice de Gans 297d7c06c4 [hidpi] Use wxWidgets 3.2 on Windows
* Remove the custom handling for pre-3.1.4 builds on Windows since
  both the mingw and msvc builds now use 3.2.
* Remove wxDPIChangedEvent handling, since this triggers a resize,
  which has the same effect.
* Implement main/WinMain ourselves, rather than relying on wxWidgets
  macros. This allows us to initialize the console earlier in the
  process.
* Add an explicit dependency on the manifest file to trigger a link
  when it is modified.
2022-10-15 22:25:54 +00:00
Fabrice de Gans 0d86432a31 [hidpi] Implement full HiDPI support
This converts the HiDPIAware into a series of helper functions, using
wxWidgets native support starting with wxWidgets 3.1.4. Custom
implementations are provided for Mac and Windows.

In addition, this fixes a few issues with the Windows build:
* Use the same defines variables in the MSVC and MinGW builds, with
  g++ and Clang.
* Add a custom manifest for the application, indicating full DPI
  support and support for recent Windows versions so the application
  will no longer run in compatibility mode by default.
* Manually spawn a console in debug builds if none is attached and
  always use the parent console if it is available otherwise, even in
  release builds. This also removes the /subsystem:console linker
  argument.
2022-10-15 22:25:54 +00:00
Fabrice de Gans 95337da558 [build] Add basic clang-cl support
XAudio2 is disabled because the included header needs to be updated to
be parseable by clang.
2022-10-15 22:25:34 +00:00
Rafael Kitover d6331ff92e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-14 02:02:29 +00:00
Rafael Kitover 69a4061ab9
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-13 02:02:23 +00:00
Rafael Kitover 8f27869715
build: fix finding static vcpkg SDL2
The static lib is now called `SDL2-static.lib` and the debug version is
called `SDL2-staticd.lib`.

Adjust our `cmake/FindSDL2.cmake` for the new vcpkg naming convention.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-09 04:00:26 +00:00
LibretroAdmin 7e30b03889
Merge pull request #109 from negativeExponent/silence_bios_sign_compare_warnings
HLE: Fix sign-compare warnings
2022-10-07 10:59:16 +02:00
LibretroAdmin 09bb3c3acf Remove fallthrough - breaks Clang on Mac/iOS 2022-10-07 10:58:00 +02:00
LibretroAdmin 655cfb929d
Merge pull request #111 from negativeExponent/fix_warnings
Fix warnings and more cleanups
2022-10-07 10:57:48 +02:00
negativeExponent e2f3a64143 Cleanup more libretro-specific branches 2022-10-07 15:28:31 +08:00
negativeExponent 1c95df1212 Simplify save state handling
- size and version parameters are unused in the libretro implementation,
  so remove them
2022-10-07 14:46:29 +08:00
negativeExponent 3158b73d69 Wrap functions unused by LIBRETRO 2022-10-07 14:21:29 +08:00
LibretroAdmin 62671753a9
Merge pull request #108 from negativeExponent/fix_implicit-fallthrough
Fix implicit fallthrough and other warnings
2022-10-07 08:21:19 +02:00
LibretroAdmin cb3fc44789
Merge pull request #110 from negativeExponent/fix_missing_field_initializers
Fix missing-field-initializer warnings
2022-10-07 08:20:51 +02:00
negativeExponent ac2a56be7f Silence other warnings 2022-10-07 13:41:06 +08:00
negativeExponent ba2513b511 Fix missing break statements 2022-10-07 13:23:02 +08:00
negativeExponent 0594fa2a2c Silence implicit-fallthrough warnings
Used [[fallthrough]]; to mark affected areas. Such keyword should be
available since C++11
2022-10-07 13:21:49 +08:00
negativeExponent 9864dc2853 Fix missing-field-initializer warnings 2022-10-07 12:52:29 +08:00
negativeExponent 12f39b86b1 HLE: Fix sign-compare warnings 2022-10-07 12:34:32 +08:00
Rafael Kitover eed171aac0
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-02 02:02:17 +00:00
Rafael Kitover 603d6a3872
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-10-01 02:02:18 +00:00
Fabrice de Gans f8974d8870
Merge pull request #1012 from Ds886/fix-missing-header
* adds missing header to memgzio ("stdint")
2022-09-30 13:11:50 -07:00
Ds886 6be626d4c7 * adds missing header("stdint") 2022-09-30 22:56:58 +03:00
Rafael Kitover 8771172d19
build: silence cmake warning on macOS for Sparkle
Silence cmake policy set warning for FetchContent
DOWNLOAD_EXTRACT_TIMESTAMP by setting it to TRUE.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-29 23:04:27 +00:00
Rafael Kitover 85a95dcde0
build: macOS C++ compatibility fixes
Remove constexpr in user-input.h as LLVM 13 complains that it is
illegal.

Use variant-lite as nonstd::variant and related types as some variant
functions are macOS 10.14 Mojave only.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-29 22:34:59 +00:00
Rafael Kitover 343eafc477
build: add variant-lite as nonstd::variant
From:

https://github.com/martinmoene/variant-lite

. Needed for macOS build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-29 22:34:59 +00:00
Rafael Kitover 1425248072
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-29 02:02:19 +00:00
Rafael Kitover 4bdd3798f1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-28 02:02:21 +00:00
LibretroAdmin 7c25d64d69
Merge pull request #106 from ds22x/master
Update to core options v2 interface
2022-09-28 00:02:59 +02:00
Fabrice de Gans 69d24fb53e [build][msvc] Fix debug information and set hidpi support
* Add /ZI compiler flag in Debug mode to get proper debug symbols.
* Specify hidpi support in the app manifest.
2022-09-27 01:25:20 +00:00
Fabrice de Gans b027e64753 [config] Move wxUserInput to the config namespace
* Remove the wx prefix and make UserInput a class in the config
  namespace.
* Make UserInput constexpr-constructible. This should reduce program
  startup time by having the compiler pre-allocate UserInput objects.
* Change initialization of UserInput objects to be made via
  constructor. A previous approach would have limited creation of
  UserInput objects to a few places but that proved unworkable in the
  long run.
2022-09-26 02:20:12 +00:00
Fabrice de Gans 1d4eb48a68 [build] Fix all warnings in src/gba/bios.cpp
This adds some helper methods to safely downcast integer types.

Bug: #1003
2022-09-26 02:17:26 +00:00
Fabrice de Gans 1e1451c57f [build] Fix warnings in src/common
Bug: #1003
2022-09-26 02:14:53 +00:00
Fabrice de Gans b2ec1544be [build] Regenerate lex and yacc files
The source grammar files were also updated. This fixes compiler
warnings for these files.

Bug: #1003
2022-09-26 02:13:12 +00:00
Fabrice de Gans 239b244640 [build] Fix warnings in memgzio.c
Bug: #1003
2022-09-26 02:11:52 +00:00
Rafael Kitover 9cc45c355b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-26 02:02:20 +00:00
Fabrice de Gans 4a056c7720 [options] Remove duplicate string constants
* Changed the string to enum conversions to be built at runtime from
  the existing constant array rather than redefining the strings.
* Fixed an issue in the initialization of the `checkable_mi` array.
  A test had been mistakenly removed during the refactor.
* Fixed an issue where changing a bool or int option would cause an
  assertion error at runtime. Changed helper methods definitions to
  use a pointer to a variable rather than take a parameter by
  reference, clarifying the intent from the caller perspective.
* Fixed the `renderer` enum definition to properly exclude Direct3D or
  Quartz2D depending on the platform.
* Various comment fixes.
2022-09-25 05:47:34 +00:00
Fabrice de Gans c4d46a713f [options] Refactor INI options
This change introduces a new class to handle all of the INI options
data, VbamOption. A VbamOption represents a single option in the INI
file. It is not constructible outside of its implementation, which
prevents the initialization of incorrectly formatted options.

Internally, a VbamOption points to a global variable in memory, which
holds the value used at runtime. This is because various parts of the
codebase edit the global variable rather than going through a central
registry. This also means we need to separately update the INI values.

In the future, we may be able to convert all existing reads and writes
to the global variable to go through VbamOption. Individual UX elements
could link directly to getters/setters for a specific VbamOption rather
than have duplicate data.

VbamOption replaces the opt_desc struct and the global opts array. All
users of opt_desc and the global opts array have been updated.

This is a necessary preliminary change to better support a refactor of
accelerators, through wxUserInput.

Issue: #745, #158
2022-09-25 05:47:34 +00:00
Rafael Kitover dd6071e5cb
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-25 02:02:21 +00:00
Rafael Kitover c10338a854
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-24 02:02:22 +00:00
Fabrice de Gans a92c448405
Merge pull request #1002 from visualboyadvance-m/interframe-blending-changer
Interframe blending changer OSD improvement
2022-09-23 16:55:41 -07:00
Rafael Kitover 90fc3e12e2
Default CTRL+I to change interframe blender
Add default menu accelerator `CTRL+I` to `ChangeIFB` which is the menu
item to change the interframe blending algorithm.

CMD+I on macOS.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-23 23:44:37 +00:00
Rafael Kitover a57d81e1af
Show name of interframe blender not num in OSD
When changing the interframe blending algorithm via:

`Options -> Video -> Change interframe blending`

, show the short name of the algorithm instead of the list number in the
OSD.

Store a pointer to the wxChoice of interframe algorithms read from the
XRC for easy access.

Shorten the names of the algorithms in the XRC selection list.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-23 23:44:36 +00:00
Rafael Kitover 97c24ec2d2
Minor refactor of strutils and add 3 new functions
Use namespace strutils:: instead of the `str_` prefix for the functions.

Remove `vec_find` as it's just an alias for `wxArrayString::Index(str)`
and is not a function on a string.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-23 23:43:31 +00:00
Rafael Kitover 2d3610b5c6
translations: remove Hebrew he locale, use he_IL
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-23 22:12:34 +00:00
Rafael Kitover adb9f62080
Copy Hebrew translation from he to he_IL locale
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-23 21:59:26 +00:00
ds22x 67e7cfc200 Update to core options v2 interface 2022-09-17 17:37:51 +02:00
Rafael Kitover bad9538ed4
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-12 02:02:22 +00:00
Rafael Kitover 8e83209121
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-06 02:02:22 +00:00
Rafael Kitover 13c558ac9f
Disable wireless link type
Always disable wireless link type as it has never worked.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-04 03:17:35 +00:00
Fabrice de Gans 3eb9fbdb7e [snap] Fix snapcraft build for core20 2022-09-03 19:01:17 -04:00
Rafael Kitover e140ba816c
installdeps: remove wxgtk2 for Arch on failure
The wxgtk2 package being installed may prevent the installation of the
newer wxwidgets-gtk3 package, remove it on pacman failure and try again.

See:

https://archlinux.org/news/wxwidgets-32-update-may-need-manual-intervention/

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-09-03 09:34:05 +00:00
Squall Leonhart 355c8efeb4 change invite code
resolves expired code error
2022-09-02 17:57:38 -04:00
Squall Leonhart 7d606f7065 fix it better 2022-09-02 17:47:42 -04:00
Squall Leonhart ec90072c28 Fix discord link 2022-09-02 17:47:42 -04:00
Rafael Kitover 0fd1daae54
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-27 02:02:26 +00:00
Rafael Kitover 913db72d12
build: check that -mtune=znver3 is supported
On gcc/clang check that the -mtune=znver3 compiler flag is supported, on
Debian 11 it is not and this breaks everything.

If it is not supported fallback to znver2, znver1, skylake-avx512 then
skylake in that order.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-26 17:12:09 +00:00
Rafael Kitover 2da9696a50
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-26 02:02:22 +00:00
Rafael Kitover b1c7476f2c
build: update finding vcpkg wxWidgets for 3.2
Use a glob instead of hardcoding '31' in lib name.

Fix #992.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-26 00:59:38 +00:00
Rafael Kitover cf57af4a83
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-25 02:02:21 +00:00
Rafael Kitover e0ae114f2e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-24 02:02:25 +00:00
Rafael Kitover 6b8b6b6450
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-23 02:02:24 +00:00
Rafael Kitover 7f1d49d3d0
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-21 23:23:23 +00:00
Rafael Kitover 9bda107d3c
build: update dev msg for translations .pot update
In the warning for detected translations source .pot changes, state that
the .pot will be automatically pushed to Transifex, instead of asking
the developer to do that, as they may not have access or the utilities.

The Transifex pull job has been updated to do this.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-18 15:00:40 +00:00
Rafael Kitover dd10b8075f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-18 14:53:25 +00:00
Rafael Kitover 2d5fdf8e79
translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-18 14:46:00 +00:00
Rafael Kitover f68492cbbf
build: fix deps from/to translations source .pot
Make the wxvbam.pot output a top-level build target and the check and
warning message for developers a POST_BUILD command for it.

Broken by 60caad86.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-18 14:31:19 +00:00
Rafael Kitover 639003a8b6
Show pixel filter name not number on cycle
Save the wxChoice* for the pixel filter name selection list in the XRC
and use it to display the filter name in the status message on pixel
filter cycle instead of the filter number.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-18 13:52:13 +00:00
Rafael Kitover a3b2a35395
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-18 11:49:19 +00:00
Rafael Kitover 60caad8666
build: improve translations.zip creation
Make translations.zip a dependency of the app and remove it as a
dependency of other commands/targets that do not use it as a source.

Silence the very spammy output of the zip program.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-10 15:29:20 +00:00
Rafael Kitover a87a6a2cc1
refactor: add static GetX11Display() in panel.cpp
Add static GetX11Display() function to get the app X11 Display* instead
of making the GDK/GTK calls in two places.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-10 13:31:22 +00:00
Rafael Kitover 236cffb42b
Make another adjustment to glXQueryExtensions
Use GDK/GTK to get the X display instead of glXGetCurrentDisplay().

For #985.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-09 22:27:07 +00:00
Rafael Kitover 643ec0f7b6
Pass DefaultScreen(display) to glXQueryExtensions
Pass DefaultScreen(display) as the screen number to
glXQueryExtensionsString(display, screen), this may work more reliably
for some configurations than always assuming screen 0.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-09 14:45:11 +00:00
Rafael Kitover 395ed0eb2a
build: fix tests build on Linux by doctest update
Update doctest.h because the old version causes build failures on Linux.

Also move it from third_party/include/doctest to third_party/include.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-09 14:18:40 +00:00
Fabrice de Gans 50a1391232 Simplify Hat handling
* Parse the hat bitfield directly rather than going through an
  intermediate enum state.
* Clean up some of the sdljoy code to use less vertical space.
2022-08-09 11:00:34 +00:00
Fabrice de Gans a56ea0225a Revamp wxJoyEvent to simplify handling of joystick events
Previously, wxJoyEvent surfaced the internal state of the joystick
changes, forcing consumers of this class to convert the values to the
mod and key values used in the rest of the code base. This streamlines
the wxJoyEvent API so the events sent to the consumers can be used
as-is. In particular, this allows us to remove manual generation of
"ghost" events in GameArea.

Breaking change: This has the side effect of disabling setting
diagonals from a joystick HAT as a discrete control. However, this only
ever worked with game controllers not compatible with the newer SDL
GameController API, since it handles HATs as 4 discrete buttons. For
compatibility purposes, these have been moved 1/8 turn
counter-clockwise - i.e. NE is now N.

Issue: #745
2022-08-09 11:00:34 +00:00
laqieer 60d7ead565
Fix menu state after playing a movie
Fix the state of the File -> Play -> Start/Stop menu after playing a
movie by calling systemStopGamePlayback() when the playback stops.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-08 04:01:45 +00:00
laqieer d2fee771fd
Add VBA Movie Version 2
Add new format for recording VBA Movies that records inputs since the
time of the last input instead of the beginning of the movie.

Keep the extension `.vmv` the same, the format is determined from the
header of the file.

Make this the new default format for recording VBA Movies.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-08 04:01:45 +00:00
Rafael Kitover 5008ffbacf
Stop using MINGW64 windres rc compiler for CLANG64
On MSYS2, stop using the MINGW64 windres.exe Windows resource file
compiler instead of the CLANG64 provided one, because the CLANG64
windres.exe works correctly now, while using the MINGW64 windres.exe no
longer works.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-07 21:13:52 +00:00
Rafael Kitover e29032d48a
Switch to nonstd::optional due to mac build issues
Switch usage of std::optional to nonstd::optional for now because of an
error from the Mac builder script, I cannot reproduce the problem yet
but will try to fix it later, it may not be fixable when targeting 10.7.

The header is from:

https://github.com/martinmoene/optional-lite
.

Usage is about the same, to include:

`#include "nonstd/optional.hpp"`

Then use nonstd::optional and nonstd::nullopt instead of the std::
counterparts.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-08-06 12:59:10 +00:00
noabody fb99a07625 error typedef Status fix for #904 2022-08-06 12:19:45 +03:00
Fabrice de Gans 51473a7c53 Refactor game controls bindings
This introduces abstractions for a game key (`wxGameKey`), a game
control (`wxGameControl`) and a common global handler for in-game
user input processing (`wxGameControlState`).
User configuration is changed from a vector to a map of `wxGameControl`
to a set of `wxUserInput`, which simplifies input configuration updates.

User input processing for in-game controls is now unified between
keyboard and joypad input, and is much faster in general since access
to game control state is now always logarithmic rather than linear.
This comes at the expense of slightly slower user input configuration
updates. However, in the worst case scenario, this is still done in
O(log(n)).

This removes all uses of `wxJoyKeyBinding`. However, some uses of the
key, mod, joy triplets remain and will be cleaned up in follow-up PRs.

Issue: #745
2022-08-06 12:18:35 +03:00
Fabrice de Gans 3f2d3c139d Remove manual joystick polling
Previously, a manual polling of every joystick was performed every 25ms,
resulting in many CPU resources being wasted. This seems to have been
put in place to deal with issues in SDL where joysticks connected after
SDL was initialized did not fire SDL events properly. From manual
testing, this issue seems to have been fixed.

This also fixes a bug in handling of legacy joystick hats, where an
incorrect conversion for the event value was performed.

Finally, this fixes minor typoes and renames
`wxSDLJoyState::ProcessEvent()` to `wxSDLJoyState::ProcessSDLEvent()` to
suppress a warning about a method override.
2022-08-06 12:17:35 +03:00
Rafael Kitover 1cfe275012
doc: add Discord/IRC links to README.md
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-07-25 07:12:24 +00:00
Fabrice de Gans 4aebd0b802 Introduce wxUserInput class
This introduces a new abstraction for any user input. The long-term goal
is to replace every usage of "custom" {key, mod, joy} triplets in the
code base with this new class.

This class implements comparison operators, allowing for faster access
in a set or as a key in a map, compared to the vectors currently used.

Issue: #745
2022-07-12 18:20:09 +00:00
Colton G. Rushton d7abc27438
doc: remove travis and appveyor from README.md
We are using GitHub actions now.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-07-06 23:34:33 +00:00
Deen O'Connor 76bf554161
installdeps: use correct package name for libsdl2
The actual package name for libsdl2 is libsdl2-2.0-0 not libsdl2-2.0 in
Debian/Ubuntu and probably others, and this only worked by accident
due to apt doing a regex search for packages.

Get the correct package for the latest version of libsdl2 from
apt-cache.

Also fix the other lib package searches via apt-cache to return the
latest version.

Resolve #882.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-07-04 19:32:09 +00:00
Fabrice de Gans-Riberi f132e15511 Abstract player_index into wxJoystick
* Add wxJoystick to abstract what was previously referred to as
  |player_index|. This is a first step towards a larger refactor of
  input handling.
* Remove "SDL" from types that are not directly SDL-related, namely
  "wxSDLJoyEvent", "wxSDLControl".
* Rename "wxSDLJoy" into "wxJoyPoller". This clarifies the use of this
  class.

Issue: #745
2022-07-04 13:58:28 +03:00
Rafael Kitover 37dc95b930
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-06-16 21:02:11 +00:00
Rafael Kitover 941eef918b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-06-15 21:02:08 +00:00
Rafael Kitover 94627c1e8e
build: link pcre2 with vcpkg wxwidgets
wxregex uses pcre2, link it when using static vcpkg wxwidgets.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-06-15 20:52:29 +00:00
Rafael Kitover 3e224bab40
build: enable ccache for MSVC
ccache supports MSVC now, so don't disable it for MSVC builds.

Remove the global RULE_LAUNCH_COMPILE property because it breaks
resource compilation on MSVC and just use CMAKE_CXX_COMPILER_LAUNCHER
etc..

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-06-15 01:00:13 +00:00
Squall Leonhart 72d772189a Add before creating request to feature.yml
and encourage searching
2022-06-05 02:10:54 -04:00
Zach Bacon a413eb048c
switch from wxmsw3.1 to wxWidgets 3.0 and pkg-config to pkgconf
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2022-06-05 01:22:24 -04:00
Zach Bacon fed8c3697e
Yeah... one last tweak to get submodules pulled
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2022-06-05 01:08:34 -04:00
Zach Bacon 3abf084f2f
last tweak to the CI build system
at least till clang is fixed for windows targets

Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2022-06-05 00:57:20 -04:00
Zach Bacon 05e58ba0a7 update the workflow script 2022-06-05 00:49:02 -04:00
Rafael Kitover c9994c284a
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-06-03 21:02:14 +00:00
Rafael Kitover 595a9e49c0
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-05-23 21:02:05 +00:00
Rafael Kitover 732524a77b
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-05-21 21:02:10 +00:00
Rafael Kitover f7ce25f496
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-05-14 21:02:10 +00:00
Zach Bacon 61d494af4e
Merge pull request #951 from Squall-Leonhart/patch-1
encourage users to search for existing issues in bug report template
2022-05-14 09:49:56 -04:00
Squall Leonhart 17038c27d1
Update bug_report.yml
encourage users to search for existing issues
2022-05-14 23:46:05 +10:00
Rafael Kitover 75f0a061be
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-05-04 21:02:23 +00:00
Rafael Kitover 27a0d41ad8
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-05-01 21:02:05 +00:00
Rafael Kitover 4f9d161c02
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-04-26 21:02:11 +00:00
Rafael Kitover 571d42d2fa
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-04-20 21:02:07 +00:00
Rafael Kitover 1bd2f049cb
cmake: default VBAM_STATIC=ON for MinGW/MSYS2
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-04-19 04:07:30 +03:00
Rafael Kitover b28982a89a
installdeps: support UCRT64 on MSYS2
Same as MINGW64, works fine.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-04-19 03:58:01 +03:00
Rafael Kitover d91e5db524
cmake: fix static linking winpthread on MINGW
Include linker flags to link winpthread statically on MINGW when static
build is on.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-04-13 21:26:27 +00:00
Rafael Kitover cbd7d7d2d1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-04-09 21:02:01 +00:00
Rafael Kitover 570596266f
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-04-05 21:02:08 +00:00
Rafael Kitover cf39d9bbd1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-04-04 21:02:11 +00:00
Rafael Kitover d014ebd2b2
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-27 21:02:06 +00:00
Rafael Kitover 8483fde365
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-26 21:02:08 +00:00
Rafael Kitover ad7dbf253c
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-25 21:02:34 +00:00
Rafael Kitover 461c4a7bd4
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-24 21:01:40 +00:00
Rafael Kitover 1fc449b2c7
installdeps: don't link mac brew ffmpeg
Stop linking brew ffmpeg, it links itself by default.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-20 18:10:37 +00:00
Rafael Kitover 1a6f40a79c
installdeps: re-enable ffmpeg for mac brew
Thanks to @ZachBacon in 1e0eea3c (recording: fix ffmpeg5 compat, 2022-03-18) the build works with ffmpeg5 from brew.

Update build instructions from installdeps to not disable ffmpeg
anymore.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-20 13:53:32 +00:00
Zach Bacon 1e0eea3c08
recording: fix ffmpeg5 compat
Include avcodec.h and change AVCodec* and AVOutputFormat* to const.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-20 12:01:59 +00:00
Rafael Kitover 9a325f086e
issues: fix nightly URL in bug_report template
We're at https://nightly.vba-m.com now.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-19 07:46:27 +00:00
Rafael Kitover 2810f4b228
installdeps: update for mac brew
Replace wxmac obsolete package with wxwidgets.

Use brew install -f (--force) to install all deps.

Unlink and relink gettext, wxwidgets and ffmpeg for every invocation.

Add -DENABLE_FFMPEG=FALSE to cmake invocation instructions because brew
has ffmpeg 5 and we cannot build with it yet.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-18 19:19:23 +00:00
Rafael Kitover 8caea3ae6c
installdeps: add -DCMAKE_BUILD_TYPE=Release
Add -DCMAKE_BUILD_TYPE=Release to cmake invocation in build instructions
in installdeps.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-18 19:18:08 +00:00
Rafael Kitover 8c1ebf4d59
builder: update automake 1.15.1 -> 1.16.5
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-18 18:57:58 +00:00
Rafael Kitover 715c66b52c
builder: update gettext 0.19.8.1 -> 0.21
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-18 18:51:35 +00:00
Rafael Kitover dedfb615d5
build: use GLOB to detect wx dep lib suffixes
Use file(GLOB ${lib_name}*.lib) to detect the appropriate suffixes for
wx dependency libs, because the suffix keeps changing, sometimes there
is a 'd' added for debug builds and sometimes it changes to not adding
the suffix, this will make the code more robust and lead to fewer build
failures.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-18 14:47:50 +00:00
Rafael Kitover ec434a7c2f
build: rm vcpkg build_prefix* in vcpkg wx setup
Stop setting the build_prefix* variables as they are no longer used and
relying on build trees being available would break /installed caches
etc..

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-18 14:37:08 +00:00
Rafael Kitover a6affd3807
build: remove d suffix from lzmad.lib for vcpkg
The debug build of lzma.lib is no longer called lzmad.lib in vcpkg,
remove the 'd' suffix.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-17 21:16:43 +00:00
Rafael Kitover 7f4b5b6f93
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-03-17 19:03:19 +00:00
Zach Bacon 287bb5f3a2
Merge pull request #931 from Squall-Leonhart/master
Updates the Feature Request form from MD to YML
2022-03-10 05:16:52 -05:00
Squall Leonhart 50f64b0e8b
we don't use plugins
so remove reference
2022-03-09 14:41:53 +11:00
Squall Leonhart e7924caca0
cleanups 2022-03-09 14:41:28 +11:00
Squall Leonhart f16d1d0725
convert feature request into a yml
copying @DerekTurtleRoe homework
2022-03-09 14:17:04 +11:00
Zach Bacon 8ea020d373
Merge pull request #929 from Squall-Leonhart/master
fix x86 builds crashing when /Gs set by Optimizations, turns on full optimizations for x86
2022-03-08 06:49:22 -05:00
Squall Leonhart 7726d26f9c Enable full optimizations and fix x86 builds
a bool isn't a BOOL and wglGetExtensionsStringEXT returns a const char*
2022-03-08 13:23:54 +11:00
Zach Bacon 252b65b13c
Merge pull request #927 from Squall-Leonhart/master
Adding Forum link to config.yml, fixes title and a typo in feature.md
2022-03-07 10:26:07 -05:00
Squall Leonhart 56ffb12758
typo fixed 2022-03-08 02:20:58 +11:00
Squall Leonhart 66c224e122
change title template to [Feature request] 2022-03-08 02:18:45 +11:00
Squall Leonhart dc4d431d7a
Merge branch 'visualboyadvance-m:master' into master 2022-03-08 02:14:45 +11:00
Squall Leonhart 09eb6628e8
Update config.yml 2022-03-08 02:06:36 +11:00
Squall Leonhart 9b84396adb
Update config.yml 2022-03-08 02:05:51 +11:00
Zach Bacon bb1d44ae0a
Merge pull request #925 from Squall-Leonhart/master
Updating to YML Issue form for Bug, adding Feature request form, link to IRC and disbling blank issues.
2022-03-07 09:01:22 -05:00
Squall Leonhart df991bae0a
remove required flag for "What game were you playing"
Some issues occur before a rom is even in use
2022-03-08 00:47:47 +11:00
Squall Leonhart a00e4345d0
remove required flag for Error Messages
Not all issues reporte will have an error message.
2022-03-08 00:46:09 +11:00
Squall Leonhart be7b1ef1d2
updating rom details
clarifying how to obtain information for rom and save types of gba titles
2022-03-08 00:44:57 +11:00
Squall Leonhart f7633ca274
move the SDL block to the top
so that people don't waste their time filling out the form only to find out we don't take sdl related controller issues.
2022-03-08 00:39:17 +11:00
Squall Leonhart 03d962dfea clarification on filter, and capital letter.
some more small cleanup
2022-03-08 00:20:51 +11:00
Squall Leonhart c1c4daf5e3 further template changes
just cleaning up
2022-03-08 00:20:51 +11:00
Squall Leonhart a9e594a38a add some missing tidbits
from the present issue template
2022-03-08 00:20:51 +11:00
Squall Leonhart 18a84e5cad Update feature.md 2022-03-08 00:20:51 +11:00
Squall Leonhart bd1adc87e0 Update feature.md 2022-03-08 00:20:51 +11:00
Squall Leonhart 2d6457c0f4 Update feature.md 2022-03-08 00:20:51 +11:00
Squall Leonhart 85e991a0e8 Update feature.md 2022-03-08 00:20:51 +11:00
Squall Leonhart 265342135d Update bug_report.yml 2022-03-08 00:20:51 +11:00
Squall Leonhart d729ac3ff2 Update bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart 8688d9f8e7 Update feature.md 2022-03-08 00:20:50 +11:00
Squall Leonhart 256008dffc Create config.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart a1f2ac8caf Delete ISSUE_TEMPLATE.md 2022-03-08 00:20:50 +11:00
Squall Leonhart 32503fd03a Create feature.md 2022-03-08 00:20:50 +11:00
Squall Leonhart fd3029c858 Update bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart 27213d9626 Update bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart b198c6b549 Update bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart 5961c1480b Update bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart 961b27f21d Update bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart 738b6406b8 Update bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart 5583effa89 Update bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart ef8efd3187 Update and rename bug_report.md to bug_report.yml 2022-03-08 00:20:50 +11:00
Squall Leonhart 6c9c53a119 Update issue templates 2022-03-08 00:20:50 +11:00
Squall Leonhart 12ec072b25 add colorization hack support to Wx
Revert "add colorization hack support to Wx"

This reverts commit c676333c7157698657b774bdf8e068824e0fc43e.
2022-03-08 00:20:49 +11:00
Rafael Kitover cdeb1027cc
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-07 12:19:59 +00:00
Rafael Kitover 796dfe78f9
Fix Wx OpenGL and ABI checks for MSYS2 CLANG64.
Probably fixes this in other environments as well, or breaks it.

Move the wxWidgets_LIBRARIES paths conversion to the already existing
normalize_wx_paths() function that was using a different method that no
longer works. This converts the variable to the right format before the
tests run, fixing the Wx OpenGL test.

For the ABI checks, wrap the function pointers for the minhook
trampoline API in reinterpret_cast<LPVOID>(&fp), why this is necessary I
don't know, and it may break on other compilers. The trampoline is used
to catch message boxes opened by Wx for fatal errors.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-05 01:00:25 +00:00
Rafael Kitover 87e41300f1
Speedup wx-config search on MSYS2.
Search for wx-config-static for static builds first, and wx-config
otherwise, before trying any config and version suffixes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-04 04:45:07 +00:00
Rafael Kitover 7853718627
Add winmm to SDL2 libs for WIN32.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-04 04:44:14 +00:00
Rafael Kitover a7eeb17645
Use gcc binutils for rc compiler on MSYS2 CLANG64.
Update installdeps and cmake to use windres from gcc binutils from
MINGW64 on MSYS2 CLANG64, because llvm-rc doesn't work sometimes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-04 04:18:36 +00:00
Rafael Kitover 347df44497
Add ccache to pkg list in installdeps for MSYS2.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-04 04:16:26 +00:00
Rafael Kitover 8bd09c9012
Revert "Use MSVC intrinsic sqrt() on x86 for XBRZ"
This reverts commit 55a0a52a39.

Does not make any difference, the performance issue is elsewhere.
2022-02-03 07:57:51 +00:00
Rafael Kitover 55a0a52a39
Use MSVC intrinsic sqrt() on x86 for XBRZ too.
Instead of the inline asm fsqrt instruction.
Already being used on x64.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-03 07:22:05 +00:00
Rafael Kitover 4af78f6482
Fix MSVC VCPKG build and Debug build type checks.
Use jpeg.lib instead of jpegd.lib for jpeg debug lib, it no longer has
the "d" suffix.

Fix all CMAKE_BUILD_TYPE checks for debug builds to either also check
for RelWithDebInfo or match "Debug" exactly.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-03 00:18:08 +00:00
Rafael Kitover 7d454e054a
Fix MSVC compiler/linker flags.
Turn off ccache for vcpkg builds (this is only relevant to MSVC, where
ccache does not work yet.)

Throw an error if CMAKE_BUILD_TYPE is not valid or does not match case
exactly (to make comparisons simple.)

Add SetCompilerLinkerFlags.cmake lib with the functions:

add_compiler_flags()

For each flag passed in, add it to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS if
not already present. Also clears all build-specific flag variables on
every call, if using this functions you must set build-specific flags
yourself.

add_linker_flags()

For each flag passed in, add it to
CMAKE_(EXE|SHARED|MODULE|STATIC)_LINKER_FLAGS if not already present.

Add remove_dupes() function to VbamFunctions.cmake from:

https://stackoverflow.com/a/41416298/262458

This is used to remove duplicate flags in SetCompilerLinkerFlags.cmake
described above.

Use the new functions to set compiler and linker flags for MSVC.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-02 22:27:39 +00:00
Zach Bacon 5ed544aad3 [Workflow] Ensure checkout is autocrlf for github actions 2022-02-02 09:43:52 -05:00
Rafael Kitover 9ba5645964
Fix Win32 build regression in fa562426.
Move list of media libs ffmpeg depends on to the right cmake file.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-02-02 00:44:41 +00:00
Rafael Kitover fa56242669
Add MSYS2 CLANG64/32 support.
Update installdeps to support CLANG64/CLANG32 MSYS2 targets.

cmake:

Set POLICY CMP0060 to NEW to not convert full lib paths, this is the
default.
Stop disabling ffmpeg on WIN32+i686.
On MSYS2+clang add windows import libs to CMAKE_PREFIX_PATH.
For static builds on MSYS2 append full paths for static libs for tiff,
jbig and lzma to FFMPEG_LIBRARIES.
Add -Wno-unused-command-line-argument to all CFLAGS/CXXFLAGS so that
clang does not warn about gcc-specific options.
Enable -march/-mtune optimizations by default instead of only for
UPSTREAM_RELEASE.
Update find_wx_util() to search suffixes for WIN32 and add the "static"
suffix for static builds.
Remove all linker flags from wxWidgets_LIBRARIES and translate all wx*
libs as well as jpeg, tiff, jbig lzma and expat to full .a paths for
static builds.
Disable strutil tests on MSYS2+clang, currently does not build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-01-31 03:26:52 +00:00
Rafael Kitover 65b5affe7d
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-01-30 02:39:02 +00:00
Rafael Kitover c4733bcf03
Fix x86 build, tweak MSVC opt flags.
Use:

/Ot /Oy /Ob3 /GF /Gy

, instead of /O2 for x86, this makes it not crash on ROM load for the
OpenGL renderer.

Supposedly /O2 is equivalent to:

/Og /Oi /Ot /Oy /Ob2 /GF /Gy

, but the documentation states that /Og is automatically enabled when
any other optimizations are enabled automatically. So this should make
absolutely no difference, yet it does.

For x64 use:

/O2 /Ob3

, this overrides /Ob2 from /O2 to use more aggressive inlining, VS 2019
is required for this.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-01-18 03:01:13 +00:00
Rafael Kitover 73223445d6
MSVC opt /fp:fast /Oi, intrinsic sqrt() w/ XBRZ.
For MSVC, add the optimization flags:

/fp:fast /Oi

, to favor speed for floating point operations and use intrinsic
operations where possible.

For release builds also add:

/O2

. Use sqrt() instead of std::sqrt() in XBRZ for MSVC x64 just in case to
make sure it uses the intrinsic version.

Test build is reported to run much faster.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-01-16 15:55:02 +00:00
Rafael Kitover 2eb45cd967
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-12-22 15:02:48 +00:00
Rafael Kitover a5b2d070dc
Add cmake TRANSLATIONS_ONLY for translations.zip.
Builds translations.zip and nothing else.

This is for the nightly builder when only translations are changed.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-12-19 13:57:05 +00:00
Rafael Kitover ea9d95dfa0
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-12-19 12:26:39 +00:00
Rafael Kitover 21ccbcb120
Minor fix in builder script.
Delete build directories prior to build in build_project().

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-12-19 12:04:18 +00:00
Zach Bacon a33695cd55 Update the snapcraft yaml to core20
Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2021-12-16 07:51:37 -05:00
Rafael Kitover 94b4a7982c
Update nightly builds URL in README.md.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-12-14 08:55:48 +00:00
Squall Leonhart 972f151310
Enable GB colorization hack support in GUI.
This is used by some hacked ROMs like Metroid II DX.

Add a config variable to enable the already existent core support for
this.

This conflicts with using a GB BIOS file, add checks and error dialogs
for this.

Also move including "ConfigManager.h" into "wxvbam.h".

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-11-24 21:30:37 +00:00
Rafael Kitover 89028de852
Regenerate dev guide TOC.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-11-10 23:08:25 +00:00
Rafael Kitover b9fb76043e
Move Windows dev guide to its own repository.
It is now at:

https://github.com/rkitover/windows-dev-guide

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-11-10 22:37:15 +00:00
Rafael Kitover 35d4d44a9b
Update Windows Terminal settings in dev guide.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-11-10 18:56:15 +00:00
Rafael Kitover b3cc663344
Minor architecture/optimization improvements.
Use the X86_64 variable instead of AMD64 for this architecture in cmake.

For our upstream binary builds, use -march=core2 -mtune=rocketlake for
X86_64 on macOS, -march=core2 -mtune=znver3 for X86_64 on non-macOS (not
currently used) and -march=pentium-mmx -mtune=core2 for the future
Windows XP 32 bit MinGW build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-10-31 18:23:34 -07:00
Rafael Kitover b6837cea05
Support Debug builds for mac.
Allow codesigning frameworks to fail.

Use ninja to build project in the builder instead of make.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-10-31 17:10:22 -07:00
Rafael Kitover 414cacbf28
Suffix zip files with arch + minor cmake fixes.
Instead of suffixing release zip files with 32bit or 64bit, add an
architecture suffix, which would be one of:

x86_32
x86_64
arm32
arm64

Allow codesign to fail on mac without aborting.

Disable the interactive pause for gpg signing because there is no
passphrase anymore.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-10-31 08:55:48 -07:00
Rafael Kitover a45d8214c1
Update builder for mac build.
m4: 1.4.18 -> 1.4.19, remove patches.
libxml2: 2.9.12
wxwidgets: master (3.0.5.1 on mac for 10.7)

Run script with brew bash.

Unlink brew wxwidgets before build and relink after because it conflicts
with the built version, this needs to be fixed.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-10-30 22:24:40 -07:00
Rafael Kitover 173512f65a
Revert DMA:Linger last DMA on bus ...
Pulled in from merge of libretro fork, causes a regression in Croket 2.

This reverts commit a9f35645b7.
2021-10-23 22:34:35 +00:00
Rafael Kitover c37c472996
Fix merge in b3153dcf breaking build.
The merge conflict was resolved incorrectly, replace with source file
from the libretro fork.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-10-20 13:08:38 +00:00
Rafael Kitover 3f571fb930
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-10-20 05:49:36 +00:00
Rafael Kitover b3153dcf35
Merge remote-tracking branch 'libretro/master'
Includes some GB and GBA fixes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-10-20 05:42:27 +00:00
Rafael Kitover 2ecfe09c6a
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-10-05 20:16:53 +00:00
Zach Bacon 4223c39c4c
disable online updates for github workflow 2021-10-03 16:38:43 -04:00
Zach Bacon 459de4ba78
aaaand I forgot to append the -D to enable the sdl static stuff 2021-10-03 16:24:54 -04:00
Zach Bacon 9a5406f824
enable several configuration options, the static I'm sure won't work though 2021-10-03 16:18:46 -04:00
Zach Bacon 859359e5ef
Add ffmpeg to the build 2021-10-03 16:05:26 -04:00
Zach Bacon ab1ff4191d
add zip to the build process 2021-10-03 16:02:59 -04:00
Zach Bacon e8383447a8
This should fix the basic build, I'll add proper configure options later 2021-10-03 15:56:31 -04:00
Zach Bacon bdc79bbe20
I'm still learning github actions it seems 2021-10-03 17:08:07 -04:00
Zach Bacon 227c1d69b3
add git 2021-10-03 17:01:51 -04:00
Zach Bacon 2011a5cc9c
Let's run the git submodule command 2021-10-03 16:57:32 -04:00
Zach Bacon 24ecb82fb1
let's try this bit for the workflow 2021-10-03 16:52:35 -04:00
Zach Bacon dd2e837310
let's set the build environment for github actions 2021-10-03 16:45:22 -04:00
Zach Bacon 0db7eab66c
add github actions workflow 2021-10-03 16:37:11 -04:00
Zach Bacon dc24eac896
Merge pull request #877 from Squall-Leonhart/master
Fix autosaveloadcheats and rename pref to autosaveloadcheats
2021-09-23 22:21:57 -04:00
Squall Leonhart 1741fa32db Fix autosaveloadcheat and rename pref 2021-09-23 18:56:32 +10:00
Rafael Kitover c503c9adb8
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-09-07 23:10:12 +00:00
Rafael Kitover 7a550f4348
Update default.nix.
Add indirect dependencies that cmake complains about and remove ccache
because it currently fails to build on NixOS unstable.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-09-07 23:05:31 +00:00
Zach Bacon 3529826bcc
begin the support of arm64 support in the m1 mac variants,
not sure if this will work however, but I'll keep tweaking
until it is ready
2021-09-05 13:25:11 -04:00
Zach Bacon 0ea8ce8dd9
Merge pull request #855 from laqieer/fix/flash_erase
Fix Flash chip's erase operation
2021-08-30 23:51:53 -04:00
Zach Bacon 59fd820e7a
homebrew moved from /usr/local to /opt/homebrew, adjust accordingly 2021-08-23 23:47:40 -04:00
Zach Bacon 1426358da4
Merge pull request #866 from Squall-Leonhart/master
in Wx, the Option is Enable MMX, make the variable also enableMMX and…
2021-08-19 09:44:30 -04:00
Squall Leonhart 41d8ab5d26 remove unnecessary dictionary preference change 2021-08-14 02:35:54 +10:00
Squall Leonhart a31a7a3086 in Wx, the Option is Enable MMX, make the variable also enableMMX and set its default to on.
The present ini variable is from vbam 1.x and is behaviourally backwards where setting disablemmx to true actually enables mmx, 2.x builds should not be using the ini from 1.x for various reasons.
2021-08-13 13:28:56 +10:00
Zach Bacon 157277e028
Merge pull request #838 from Steelskin/fix-ret-value-filter-event
Use constant aliases in MainFrame::FilterEvent()
2021-08-10 23:41:52 -04:00
Zach Bacon 93e15f5b34
Merge pull request #862 from leontepe/patch-1
Fix Arch installdeps
2021-08-10 23:35:43 -04:00
Leon Tepe 276689edda
Fix Arch installdeps
I don't know if this is right or not, but I am running an Arch system and tried running `./installdeps` and nothing happened. So I went into the script and figured that it got stuck in the `elif [ -f /etc/os-release ];` block. This file exists on Arch as well, so the block is executed, but arch is not listed in the `case`, so the script exited without doing anything. And it's only checking for pacman after that, so it never ran `arch_installdeps`.

Don't know if this is the 100% correct fix, but it's working for me now and should also catch cases like that in the future.
2021-08-08 12:33:19 +02:00
Rafael Kitover 96ce316bcd
Update openssh instructions for windows env.
Add commands to delete the ssh-agent service, otherwise the installer
throws an error.

Add instructions for setting permissions on authorized_keys and private
key.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-07-22 16:14:48 +00:00
Rafael Kitover f23fae6559
Add nuget package source for Windows build.
This fixes the "Unable to find package ..." error.

Thanks to:

https://stackoverflow.com/a/65012088/262458

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-07-21 12:55:15 +00:00
Autechre 254f6effeb
Merge pull request #105 from negativeExponent/flash_erase_ff
Flash : Erased memory is FFh-filled
2021-07-04 19:36:43 +02:00
negativeExponent 983ea451d0 Flash : Erased memory is FFh-filled
https://akkit.org/info/gbatek.htm#gbacartbackupflashrom
2021-07-05 00:02:02 +08:00
laqieer 18e387d165 Fix Flash chip's erase operation: erased memory is FFh-filled, not zero-filled. 2021-07-03 21:38:46 +08:00
Rafael Kitover c08bb6bdb0
Minor updates to win dev manual.
Add instructions for setting up sshd and gpg plus minor edits.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-07-03 01:08:53 +00:00
Rafael Kitover 9b6740c0e5
Minor updates to Windows section of dev manual.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-06-30 14:04:25 +00:00
Rafael Kitover 26cfbee696
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-06-29 11:06:23 +00:00
Autechre eb6c434e29
Merge pull request #104 from negativeExponent/libretro
update
2021-05-28 01:56:31 +02:00
negativeExponent c05056ab91 HuC3: Update
- Minor refactoring, some variable name and type changes
- Remove unnecessary checks in clock latch
- Fix stuck in whitescreen after Hudson startup logo
- Fix Gamepak error message at initial load of game without prior rtc
  data available to load
- Save the bare-minimum variable needed for rtc (saves only
  Basetime/lastTime)
2021-05-27 13:56:21 +08:00
Autechre 6dca6fe8df
Merge pull request #103 from negativeExponent/huc3
HuC3: Refactoring to avoid breaking savestates
2021-05-25 06:36:40 +02:00
negativeExponent 93084990b2 HuC3: Refactoring to avoid breaking savestates
Savestates are broken due to the change in savestate struct size for
HuC3. Since save/load function also includes save data for other
non-active mappers, the change in size breaks every savesfiles being
made.

This PR refactors the HuC3 clock data struct to be separate from the
main struct, and then only added to save/load functions when HuC3 mapper
is used. This still breaks previous HuC3 states but other mappers should
now not get affected

Solution:
Savestate/LoadState should only include mapper data of current active
running rom, not all mappers even if they are inactive. This will break
every savefile but it would be better for the long run when changes are
neede to be done.
2021-05-25 12:14:33 +08:00
Autechre 5187d70e30
Merge pull request #102 from negativeExponent/huc3
HuC3 Enable save support and update RTC
2021-05-25 05:30:51 +02:00
negativeExponent ab7f7baab0 Libretro: Only enable RTC save if gbRTCPresent=1 2021-05-25 09:52:44 +08:00
negativeExponent 05a046e7ed HuC3: Enable battery save, update RTC support
- SRAM support is already available, but the battery-enabled flag was
  not enable for 0xFE (HuC3) rom types.
- Hookup rtc support based on local time. This would allow time to sync
  when starting the game. You need to initially set the time first
though on first bootup (RTC support was based on gambatte sources)

Fix https://github.com/libretro/vbam-libretro/issues/95
2021-05-25 09:46:31 +08:00
Autechre 685a495d5c
Merge pull request #101 from negativeExponent/patch-1
android: Fix build
2021-05-23 03:16:04 +02:00
negativeExponent fcc8b273c3
android: Fix build 2021-05-23 08:58:43 +08:00
Autechre 501909c57b
Merge pull request #99 from negativeExponent/libretro_updates
update
2021-05-22 05:15:30 +02:00
negativeExponent bdb65596ce Libretro: Remove serial emulation workaround
These are not needed anymore due to previous 2 commits.
2021-05-22 08:29:16 +08:00
negativeExponent 70477dcd9b GBA:Fix serial emulation if compiled with NO_LINK 2021-05-22 08:26:19 +08:00
negativeExponent 15bcad1351 GB:Fix serial emulation when compiled with NO_LINK
Fix https://github.com/libretro/vbam-libretro/issues/83
2021-05-22 08:17:11 +08:00
Autechre e38b4c40c9
Merge pull request #98 from negativeExponent/libretro_updates
Libretro updates
2021-05-21 18:39:52 +02:00
negativeExponent a9f35645b7 DMA:Linger last DMA on bus (Backport 511e58c849) 2021-05-21 17:37:58 +08:00
negativeExponent 025f3079b1 GBA:Fix a few memory read/write issues
- Affects both aligned and unaligned in unsigned 8/16/32 and signed 16
  reads/writes
- Rom out-of-bounds reads
- SRAM r/w access
- etc
2021-05-21 14:54:54 +08:00
negativeExponent 4e5b61f220 Backport fix e560db692f 2021-05-21 12:49:47 +08:00
negativeExponent 19aae231c0 Wrap these with #ifdef BKPT_SUPPORT 2021-05-20 15:06:50 +08:00
negativeExponent 21c08e9d9f Cleanup unused variables 2021-05-20 15:01:40 +08:00
negativeExponent 11bd3e0eee Silence warning [-Wsign-compare] 2021-05-20 14:46:26 +08:00
negativeExponent 6afbc9a09c Remove unused files and folders 2021-05-20 14:46:26 +08:00
negativeExponent 25fefc1b3d Implement libretro input bitmask 2021-05-20 14:12:08 +08:00
Fabrice de Gans-Riberi e91b5e1eac Use constant aliases in MainFrame::FilterEvent()
Previously, this function returned -1 or "true" but wxWidgets
defines constants for the returned values for FilterEvent()
overrides so use these instead.
2021-04-28 16:06:38 -07:00
Autechre 109573dea6
Merge pull request #97 from ds22x/master
Add descriptions for the 'Interframe Blending' and 'LCD Color Filter' options
2021-03-16 02:09:53 +01:00
ds22x 210e79bb74 Add descriptions for the 'Interframe Blending' and 'LCD Color Filter' options 2021-03-16 00:17:19 +01:00
twinaphex f355646fb8 Add ios-arm64/tvos-arm64 2021-03-14 11:50:23 +01:00
Rafael Kitover e55ed5c0f4
installdeps: Support NixOS.
Add a `default.nix` with the list of dependencies.

Detect NixOS in installdeps and display the `nix-shell` command to
build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-02-27 05:10:55 +00:00
Rafael Kitover 544715ddaa
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-02-11 03:08:30 +00:00
Rafael Kitover 31789aafba
Merge remote-tracking branch 'libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-02-11 02:13:55 +00:00
Rafael Kitover 8a3456f823
Default to not change battery on state load.
This is a more reasonable and less destructive default.

Fix #781.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-02-09 15:01:22 +00:00
Rafael Kitover 1b6d9557a2
docs: Specify that nightlies are Windows and Mac.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-02-02 01:55:22 -08:00
Rafael Kitover ab68794361
cmake: Fix mac app zip + misc..
Remove keychain unlock for codesigning, that doesn't work anymore, the
key has to be in the system keychain.

Use `zip -9yr` instead of `zip -9r` to make the .zip file of the .app so
that symlinks are preserved, this was creating a corrupted .app.

Don't build zip in the mac builder, use the system zip instead.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-02-02 01:49:16 -08:00
Rafael Kitover eaf4785915
builder: Update for mac builds on Big Sur 11.1.
Update to latest versions of cmake, libxml2 (and libxml2-python),
graphviz, python3, libgpg-error, libx265 and ffmpeg.

Downgrade wxWidgets to 3.0.5 because newer versions require a 10.10
target but we are still targeting 10.7.

python3 has fixed linking to static openssl and libiconv/libintl
upstream, the only thing necessary now is adding -liconv -lintl to
EXTRA_LIBS.

It was necessary to override -std=gnu++17 with -std=gnu++11 for some
sources because of issues like register variables not being allowed in
C++17. This was done in EXTRA_CXXFLAGS.

c2man and graphviz were removed from the mac build for now, there are
issues with them with the newest build tools and they are only
documentation tools.

Make some other minor adjustments to get everything to build. A trivial
patch for ffmpeg also needs to be sent upstream.

The next step is automated mac nightly builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-02-01 09:39:48 -08:00
twinaphex c13de4518c (macOS) Add 64bit ARM MacOS support 2021-01-29 19:25:53 +01:00
Squall Leonhart b50ff8584c add a missing break in half word reads
Fixes illegal halfword and byte reads (Croket! 2 slowdown)
2021-01-27 05:35:48 +00:00
Clownacy b0c029a389 SDL: Fix more indentation mistakes 2021-01-24 06:09:13 +00:00
Clownacy 524c594a73 SDL: Use sizeof to determine buffer sizes
I think the use of 2048 was a typo, so this prevents one like that
from happening again.
2021-01-24 06:09:13 +00:00
Clownacy d464bc4dfe SDL: Fix Windows build never searching PATH
Some local variable was blocking the global variable.
2021-01-24 06:09:13 +00:00
Clownacy 2a237aea6b SDL: Mark some parameters as const 2021-01-24 06:09:13 +00:00
Clownacy d412711465 SDL: Silence a warning and optimise some logic 2021-01-24 06:09:13 +00:00
Clownacy fd445481a0 Minor cleanup to SDL.cpp
Just a typo and some inconsistent indentation
2021-01-24 06:09:13 +00:00
Rafael Kitover 1fb37d3370
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-01-12 02:50:18 +00:00
Autechre 1f99ed712d
Update .gitlab-ci.yml 2021-01-09 19:13:49 +01:00
Rafael Kitover e1a728b7ac
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2021-01-04 10:11:33 +00:00
Autechre ab9f756bf8
Update .gitlab-ci.yml 2021-01-02 01:28:36 +01:00
Rémi Verschelde 619a5cce68 SDL: Fix build with SDL 2.0.14 after KMOD_GUI change to enum
Since SDL 2.0.14, KMOD_GUI is no longer a macro but an enum value:
https://hg.libsdl.org/SDL/rev/15a0bc9612e9

So this code broke as the enum value doesn't satisfy `defined()`.
2020-12-31 00:59:50 +00:00
Rafael Kitover ea2c9363f1
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-12-29 12:19:38 +00:00
twinaphex 331ba35aeb Update 2020-12-20 19:35:08 +01:00
Clownacy 064fa7b067 Fix SDL audio delay
Fixes #647

300ms is just too big, and produces an audible delay. 100ms sounds
much better.
2020-12-18 14:29:21 +00:00
Clownacy 7db3c817eb Fixed SDL audio using the wrong audio specification
This bug was responsible for audio on Windows not working without
forcefully setting the audio driver to DirectSound.

The problem was that WASAPI (or whatever API SDL2 was choosing)
defaults to an incompatible audio specification (possibly F32 sample
format - I didn't check).

Despite the `audio` struct requesting the S16 sample format, SDL2 was
granted permission to use whatever format it preferred because it was
given the `SDL_AUDIO_ALLOW_ANY_CHANGE` flag.

To fix this, I've removed that flag, effectively forcing SDL2 to use
the audio specification VBA-M requires.
2020-12-18 14:29:21 +00:00
Rafael Kitover bb903e5e08
Transifex push/pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-12-17 05:14:46 +00:00
Rafael Kitover 81d3b71cd7
Ask for factory reset in README, issue template.
Add to the loud notes at the top of the issue template and README.md
added in dfa97d8a to test the nightly to also do a factory reset.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-12-14 12:58:44 +00:00
Clownacy 8455e7add0 Remove unintended semicolon from CPACK_PACKAGE_VERSION_PATCH
I noticed this while trying to install a CPack-generated Debian package, since `dpkg` complains about the semicolon being an invalid character.
2020-12-14 12:41:28 +00:00
twinaphex 2cdd1fafb6 Update osx target 2020-12-09 08:20:42 +01:00
Autechre e6da5ee86c
Update .gitlab-ci.yml 2020-12-09 04:42:55 +01:00
Rafael Kitover c9595c3668
Fix checking for `wx-config` first on Gentoo.
Followup on 98b2fb6e.

To make a one element of empty string list in cmake, you have to set the
variable to `";"`.

If it is set to `""`, a subsequent `list(APPEND ...)` will consider the
variable unset.

With this fix, `/usr/bin/wx-config` is tried first on Gentoo, as was
intended in 98b2fb6e.

The rationale for this is that on Gentoo, app-eselect/eselect-wxwidgets
links `/usr/bin/wx-config` to the user's preferred version of wxWidgets,
while on other distributions such as Arch, we want to check for the 3.x
gtk3 variant explicitly first.

Also add a modeline to `VbamFunctions.cmake`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-12-05 11:37:40 +00:00
Rafael Kitover c18653d27e
Merge remote-tracking branch 'libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-12-05 10:42:49 +00:00
Autechre 960e8d4bc0
Merge pull request #93 from webgeek1234/master
libretro: Update gitlab ci extends ordering
2020-12-04 18:35:18 +01:00
Aaron Kling aaa61676f4 libretro: Update gitlab ci extends ordering 2020-12-01 23:50:32 -06:00
Rafael Kitover 7aa0509e0e
Update copyright year in about dialog to 2020.
- Fix #783.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-11-29 18:40:51 +00:00
Rafael Kitover dfa97d8a91
Ask to test nightly in README and issue template.
Add a note at the top of the issue template asking users to test the
nightly or master before reporting an issue.

Add a note to the top of the README.md as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-11-27 06:15:10 +00:00
Rafael Kitover ecdaf6df23
MSVC+vcpkg build update.
Remove the `find_package(unofficial-gettext ...)` invocation for vcpkg
as it is no longer required, the normal `find_package(Gettext ...)`
mechanism works.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-11-25 15:44:10 +00:00
Koakuma 4fc3b4297d Handle allocation quirk on non-null-returning allocators
Some allocators return a non-null pointer when calling *alloc with
zero size, that will segfault upon access. Check for the size parameter
before allocating anything to ensure that the breakpoint and trace
fields will stay null when size >> 3 or size >> 1 is zero.
2020-11-21 06:41:02 -08:00
Fabrice de Gans-Riberi edc34942a8 Refactor wxSDLJoy
This is a major refactor of the wxSDLJoy class.
* Move handling of SDL objects creation and destruction to its own
  class. This simplifies the lifespan of SDL-related objects.
* Re-add handling of HATs. This is necessary for DirectInput
  controllers.
* Rename the public API for wxSDLJoy to be clearer.
* Add documentation for every class related to wxSDLJoy.
2020-10-19 08:11:38 +00:00
Rafael Kitover a00f258588
Rewrite Windows dev env guide in dev manual.
Update and rewrite the Windows Native Development Environment section of
the developer manual.

Update list of Chocolatey packages and give Chocolatey usage notes.

Update terminal setup instructions.

Add sample PowerShell `$profile` and `.vimrc`.

Rewrite and streamline the short PowerShell tutorial.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-10-15 21:43:18 +00:00
Rafael Kitover e1fd75629f
Link Windows Media Foundation libs with ffmpeg.
Link some Media Foundation libs required by newer versions of FFmpeg on
Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-10-13 12:51:26 +00:00
Rafael Kitover a078dd2487
Add -D__STDC_LIMIT_MACROS for Visual Studio 2017.
Fixes a problem with `INT64_MAX` etc. being undeclared.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-10-12 21:23:47 +00:00
Rafael Kitover 3a6e4b3c27
Merge remote-tracking branch 'libretro/master' into master
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-10-12 16:40:19 +00:00
twinaphex 26e9a6e3d9 (iOS/tvOS) fix building for iOS; add tvOS support 2020-10-10 03:23:59 +02:00
twinaphex dc9422c479 if not defined, define it 2020-10-08 05:41:56 +02:00
twinaphex 7b3c721f64 Add .gitlab-ci.yml 2020-10-08 05:35:51 +02:00
Rafael Kitover 0ddd50273c
Fix mxe apt repo selection.
Default to latest, which is bionic, for earlier repositories, match all
intermediate release code names.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-29 21:51:32 +00:00
Rafael Kitover 13854135a9
Write CFBundleShortVersionString to Info.plist.
CFBundleVersion is already being written since denisfa's Sparkle
changes.

- Fix #750.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-29 14:13:26 -07:00
Joseph Griego 65a67f219a Don't set wx-config prefix from CMAKE_PREFIX_PATH
I'm not sure what purpose this currently serves but I know that it
breaks the build when CMAKE_PREFIX_PATH is set to something nontrivial.
Stop doing that.
2020-09-28 23:25:19 +00:00
Rafael Kitover 890f560553
Switch to C++17 for GUI.
Adjust compiler flags to use `-std=gnu++17` for gcc/clang instead of
`-std=gnu++11` and `/std:c++17` for msvc.

Remove Ubuntu trusty job from travis (it's too old.)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-28 12:09:54 +00:00
Rafael Kitover cb0933bf44
Stop changing plane ptrs in rec. audio frames.
Stop setting the 4 plane data pointers in recording audio frames to the
sample stream. This confuses the converter and makes it write the right
channel to both channels.

- Fix #723.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-28 01:33:58 +00:00
Rafael Kitover 98b2fb6ebb
Fix finding wxWidgets on Gentoo.
Prefer the `wx-config` from PATH on Gentoo, because that points to the
eselected wxWidgets build.

This is already done for Win32 builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-24 01:33:45 +00:00
Brian Searls 80634683b1 Force a panel update when configuring bilinear.
- Fix #727
2020-09-05 21:45:17 +00:00
Rafael Kitover 87fac44fdb
Transifex push/pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-05 19:39:52 +00:00
Rafael Kitover 6a7142813d Differentiate between SDL joy index/instance_id.
Hopefully fix various bugs caused by not differentiating between SDL
joystick_index and SDL_JoystickID (the joystick instance id.)

On controller disconnect, disconnect and reconnect all configured
devices because the SDL joystick index may change, and this will update
the mapping.

Also fix creating a state entry for the configured joystick even when
it's not connected, add the controller/joystick name to the connected
message and increase the poll time from 10ms to 25ms.

- Fix #718.
- Fix #726.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-05 19:06:48 +00:00
Rafael Kitover 11693d8381
Clean up GB MBC30 check.
Based on feedback from @negativeExponent.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-04 17:33:25 +00:00
Rafael Kitover 2727f683f1
Support archlinux derivatives in installdeps.
Assume an archlinux-like distribution based on the existence of
`/usr/bin/pacman` as the last test.

- Fix #710.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-03 16:31:25 +00:00
Rafael Kitover 020daad85f
Fix joy accels when emulation is paused.
Start the joystick polling timer on pause and stop it on resume, so that
accelerators bound to joystick events are still processed.

Followup on def5d3e4.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-09-02 00:50:45 +00:00
Rafael Kitover def5d3e486
Stop timer when game is loaded again.
Followup on 7031c1d1, which for some reason removed the calls to stop
the timer when a game is loaded and restart it when it is unloaded.

Add the calls back.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-31 07:25:38 +00:00
Rafael Kitover 9dd2932436
Disable nostl build on travis as well for now.
It is failing in the same way as the utf8 build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-29 23:25:21 +00:00
Rafael Kitover 12193dcbae
Disable utf8 build on travis for now.
To be fixed later.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-29 22:23:21 +00:00
Rafael Kitover e59cedaed6
Transifex push/pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-29 21:42:57 +00:00
Rafael Kitover 546c9d3a11 Minor joystick event handler finding refactor.
Remove the `evthandler` member and `Attach()` method from `wxSDLJoy`.

Add the `GetJoyEventHandler()` method to `MainFrame`, which returns the
window in focus, or the panel if the option for joystick background
input is enabled.

Remove the handler parameter in `wxSDLJoy::CreateAndSendEvent()` and
call `wxGetApp().frame->GetJoyEventHandler()` to get the handler.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-29 20:53:49 +00:00
Rafael Kitover 891b1c35e4 Update gettext source.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-29 20:53:49 +00:00
Edênis Freindorfer Azevedo e0816b0e10 Fix weird input/buttons memory leak.
Deleting the vector was not enough, although it was not clear what else
was causing the leak.
2020-08-29 20:53:49 +00:00
Edênis Freindorfer Azevedo cc5ddd1bb7 Isolate x11 keymap to its own header. 2020-08-29 20:53:49 +00:00
Edênis Freindorfer Azevedo 790628961d Include X11 libs and header without screensaver.
We need to always include these files and libs now due to using them
on our keyboard background input solution.
2020-08-29 20:53:49 +00:00
Edênis Freindorfer Azevedo 7031c1d155 [LINUX,WINDOWS] Key/Joy background input.
- Joystick background input.

Set as enabled by default.

- Linux: `X11` and `Wayland` done.

1. `Wayland` does not allow to listen for keypresses for security reasons.

Discussion here: https://github.com/albertlauncher/albert/issues/309

2. For `X11` we can use `XQueryKeymap` to check keyboard state.

- Windows: done.

We use `GetAsyncKeyState` most significant bit to check if the key
is being pressed.
2020-08-29 20:53:49 +00:00
Edênis Freindorfer Azevedo 84f3e8ce67 Allow joystick background input.
Refactor function to send joy events to `GameArea` even if vbam is not
focused.
2020-08-29 20:53:49 +00:00
Rafael Kitover bce91d1722
Run wxrc from the source dir.
Followup on ff03bcc1.

Running wxrc from the build directory turned out to be unnecessary,
because the dlls were not there anyway, and we added them to the PATH.

And using absolute paths for the xrc sources puts them into the gettext
pot comments which is not what we want.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-29 19:44:15 +00:00
Fabrice de Gans-Riberi 4074158061
Add GUI cmd line option for config file. (#724)
This adds the command-line option `-c` or `--config` to specify a custom
configuration file.

Co-authored-by: Fabrice de Gans-Riberi <steelskin+github@gmail.com>
2020-08-28 22:26:07 +00:00
Rafael Kitover a305f550e1
Replace Catch2 with doctest for unit tests.
Pretty much the same usage and functionality.

Add `tests.hpp` to configure doctest.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-28 05:14:22 +00:00
Rafael Kitover 22a3524c66
Fix linking on Msys2.
Do not link `SDL2main` on any WIN32, not just MSVC.

Define `WIN32_CONSOLE_APP` for Debug mode builds on any WIN32, not just
MSVC.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-28 05:09:58 +00:00
Rafael Kitover e2634df5cc
Update .gitignore.
Remove generated files that are now written to the build dir instead.

Match any build directory from root.

Stop listing submodule and vcpkg.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-28 04:57:35 +00:00
Rafael Kitover 5081ae44e5
Vcpkg fixes.
Fix vcpkg upgrades to work with the current vcpkg master.

When upgrading zlib, remove all optional deps first, because everything
depends on zlib and this can overrun the appveyor 1hr time limit.

Make SFML an optional dep too, like ffmpeg.

Reduce the vcpkg install time limit to 20 minutes, otherwise it may try
to build wxWidgets and ffmpeg and overrun the 1hr time limit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-26 10:07:04 +00:00
Rafael Kitover 3ee26c0de6
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-25 01:58:41 +00:00
Rafael Kitover 9c8604c58c
installdeps: Move git mod checkout after git inst.
Make sure git is part of the base package list for Win32 builds.

Move the `git submodule update` out of `check_cross()` and into the
Win32 build sections.

Allow it to fail, in case the user is not using a git clone, the cmake
checks will produce an error if the subtree does not exist.

This fixes the problem with the git submodule update failing because git
is not installed yet.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-23 06:13:46 +00:00
Rafael Kitover ff03bcc1e0
Better fix for wxrc with vcpkg.
When doing a dynamic build, the wxWidgets dlls are needed by the wxrc
executable.

Invoke wxrc with the target triplet debug and release bin directory
prepended to the PATH, this is where the dlls are.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-23 05:56:32 +00:00
Rafael Kitover f07a838883
Another hack to work-around broken vcpkg upgrades.
Add a function to check if libogg is installed but libvorbis isn't, this
means it failed to upgrade libvorbis because libogg wasn't upgraded to
the newest port revision supporting pkg-config, see:

https://github.com/microsoft/vcpkg/issues/13037

In this case, remove libogg recursively and allow the install action to
reinstall SFML and all deps.

This will also fix building link support on appveyor for the time being.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-22 21:31:12 +00:00
Rafael Kitover c169420fbc Turbo/throttle config and DirectSound fixes.
Make `speedup_frame_skip` and `speedup_throttle` independent settings,
with `speedup_frame_skip == 0` when `speedup_throttle` is not in effect,
and `speedup_throttle == 100` when `speedup_frame_skip` is in effect.

This fixes a previously introduced bug where `speedup == true &&
speedup_frame_skip = X` was never enabled.

This also allows `speedup_throttle == 0` for no throttle and no frame
skip during speedup.

Also set the upper bound on `throttle` and `speedup_throttle` to `450`
instead of `600`, as the DirectSound driver does not support values
higher than that.

In the DirectSound implementation of `setThrottle`, for `throttle == 0`
use a `throttle == 450` frequency multiplier, because a zero frequency
does nothing.

- Fix #719.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-22 20:25:05 +00:00
Rafael Kitover 5114c1dc87
Remove el_GR translation, leaving el translation.
The el_GR, Greek (Greece) translation is empty, while the el, Greek,
translation is 92% done.

Remove el_GR from git and from transifex.

- Fix #721.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-22 20:11:09 +00:00
Rafael Kitover 8603c879a9
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-22 19:41:39 +00:00
Rafael Kitover 4148080eb5
Always update Win32 dependencies git submodule.
Instead of just checking if the submodule has been cloned, always update
it when cmake runs if git is available.

This fixes the problem of users' dependencies submodule clone never
getting updated with new changes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-21 07:03:35 +00:00
Rafael Kitover 84d406ac0e
Temporary fix for wxrc on MSVC/vcpkg builds.
When the wxrc installed by vcpkg into tools was made with the non-static
wxWidgets, and the build is static, it will not find the wxWidgets dlls
and fail.

Use our own wxrc.exe from the dependencies submodule for the time being.

This is a temporary fix, a proper fix would be adding the dlls, if they
are installed, to the PATH.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-20 23:28:42 +00:00
Rafael Kitover 378c9493e9
Fix joystick config when game is loaded.
Rename the joystick polling timer accessors and add a predicate.

Check it and make sure the timer is running in the input and accelerator
config dialogs.

- Fix #711.
- Fix #716.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-19 11:32:38 +00:00
Rafael Kitover 61a726a828
Merge remote-tracking branch 'libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-19 10:57:35 +00:00
Rafael Kitover dcaa18aae4
Fix optional deps in vcpkg script.
Before installing optional deps, check that the associated variable is
either unset or true.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-19 09:59:29 +00:00
Rafael Kitover 3052eb33a5
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-19 09:42:02 +00:00
Autechre 36b011c72e
Merge pull request #92 from negativeExponent/gb_update
Gb update
2020-08-18 16:28:06 +02:00
negativeExponent 95213a6d55 GB: Only use mapperLastTime to see if RTC data was loaded
- Removing mapperSeconds and mapperLSeconds since both of these can be
  zero at any time since they are seconds timer, not seconds since
epoch.
- This leaves only mapperLastTime as this is the number of seconds since
  last epoch. If this value is zero, then initialize rtc.
2020-08-18 21:14:21 +08:00
Rafael Kitover fb9e7e2059
Fix expat lib name for vcpkg.
It is now installed as `libexpatMD.lib` for release and
`libexpatdMD.lib` for debug and not `expat.lib`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-17 22:05:01 +00:00
Rafael Kitover 375daf99cb
Only build ffmpeg with vcpkg if installs < 30m.
Fix the problem with vcpkg installs including both wxWidgets and ffmpeg
overrunning the one hour time limit, by making ffmpeg optional and only
building it if the other builds are under 30 minutes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-17 18:38:58 +00:00
Rafael Kitover dfec0b3d99
Transifex push/pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-17 18:37:36 +00:00
Rafael Kitover b23d463652
Use vcpkg installed wxrc, support mingw triplet.
Use the vcpkg installed wxrc, from a tools subdirectory, instead of
copying it out of the build tree.

Except when running on appveyor, for some reason the vcpkg wxrc does not
work there, so use our own from the dependencies submodule.

Support vcpkg mingw triplets, they don't work yet however.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-14 13:16:37 +00:00
negativeExponent 86fcffefd0 GB: Add support for 4MB MBC30 2020-08-14 19:21:56 +08:00
Rafael Kitover 08b5685049
Merge remote-tracking branch 'libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-08-14 11:00:06 +00:00
hizzlekizzle 6b70aa5de5
Merge pull request #90 from negativeExponent/input_updates
Move main input polling at the beginning of retro_run()
2020-08-13 08:44:40 -05:00
hizzlekizzle 2f1439c5bd
Merge pull request #89 from negativeExponent/add_color_and_interframe_options
Add color and interframe options
2020-08-13 07:59:14 -05:00
hizzlekizzle 640e93cd97
Merge pull request #91 from negativeExponent/hle_bios_fixes
GBA BIOS: ArcTan/ArcTan2 fixes for HLE bios
2020-08-13 07:55:59 -05:00
negativeExponent 2f9933ae49 GBA BIOS: ArcTan/ArcTan2 fixes for HLE bios
Fix ArcTan and ArcTan2 based on mgba's hle bios fixes
- References:
- 14dc01409c (diff-8f06a143a9fd912c83209f935d3aca25)
- b154457857 (diff-8f06a143a9fd912c83209f935d3aca25)
2020-08-12 22:44:43 +08:00
negativeExponent 5d5dc1b39b Move main input polling at the beginning of retro_run()
- This is done so we can poll inputs from one place all at once for all
  player ports instead of calling the function multiple times for each player port.
2020-08-12 22:30:22 +08:00
negativeExponent e58332c03a Add interframe blending core options
- Adds 'smart' and 'motion blur' interframe methods as core options for
both 16bit and 32bit color depths
2020-08-12 10:25:52 +08:00
negativeExponent 54399dffea Add LCD Color Filter core options 2020-08-12 07:43:21 +08:00
hizzlekizzle 364a182968
Merge pull request #88 from negativeExponent/backport
Backport
2020-08-11 09:35:33 -05:00
negativeExponent 97637f16d6 Buildfix 2020-08-11 21:22:07 +08:00
negativeExponent d9732f68db Fix clock cycle count for MUL, MLA instructions... (b91f39c787)
- backport Fix clock cycle count for some arm/thumb instructions (5243b2d806)
- backport Fix base cycle count for MUL, MLA series (b91f39c787)
2020-08-11 21:17:25 +08:00
negativeExponent c07d5b658b Fix vram 16/32 bit unaligned reads(backport 7f18771165) 2020-08-11 20:29:28 +08:00
negativeExponent f4891b6504 Update .gitignore 2020-08-11 19:34:36 +08:00
Brian Searls 18c2ea61c6 Further fixing Multi Buffer formatting. 2020-08-10 21:44:01 +00:00
Brian Searls 1e5693009c Addressing audio plugin crash
Stereo buffer is not remade in the case of audio plugin
switch (only affects GBA, not GB).  This results in a crash.
We need to remake the stereo buffer and reinit the pointers
in Gba_Pcm.output or they will be dangling, and lead to a
crash.  Also, cleaning up the Multi_Buffer class a bit.
2020-08-10 21:44:01 +00:00
Edênis Freindorfer Azevedo 9c314a155d
Use proper string `"wglGetExtensionsStringEXT"`.
`"wglGetExtensionsString"` is not valid on Windows.
2020-08-09 07:01:34 +00:00
Zach Bacon 7c8ba1e7c5
This should fix building edge packages,
as well as fix building on arm platforms and ppc64 platforms,
quite possibly s390x, but can't guarantee how it will perform.
2020-08-08 09:14:07 -04:00
Rafael Kitover 9495dc84f8
Prefer upgrading zlib before other vcpkg deps.
Just a hack to fix a problem with vcpkg upgrades, in this case the
version of the zlib port being too old breaks another upgrade, so we
will check if zlib is in the list of packages to upgrade and upgrade it
before anything else.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-31 09:32:42 +00:00
Rafael Kitover 299362b3cf
Refactor cmake ccache support and support MSVC.
Don't disable ccache for msys+ninja anymore, since the mingw ccache
works now and there is no reason to use the msys ccache anymore.

Use RULE_LAUNCH_COMPILE only on cmake versions < 3.4.0, because this
currently breaks resource compilation with visual studio and the windows
native ccache from chocolatey, this needs to be fixed in ccache.

On cmake 3.4.0 and greater, set the variables
CMAKE_<LANG>_COMPILER_LAUNCHER instead. This has the effect of using
ccache for C, C++ and nasm, but not for the resource file, avoiding the
problem with visual studio, which has a more recent cmake. This must be
done before the project() call.

TODO: Currently the Visual Studio build with ccache from chocolatey
works correctly, ccache is being invoked from ninja, but no cache files
are being created. This is being followed up with the chocolatey package
maintainer and upstream if necessary. The resource compiler issue also
needs to be fixed upstream.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-31 09:30:23 +00:00
Rafael Kitover 2fe1c5711b
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-17 02:49:32 +00:00
Rafael Kitover 81c88227fa Add Catch2 unit testing framework + some tests.
Add the Catch2 headers to third_party/include/catch2.

Add Catch.cmake and CatchAddTests.cmake to cmake/.

Add unit tests src/wx/tests/strutils.cpp using Catch2 to test
src/wx/strutils.cpp.

Make some code changes to strutils.cpp to make the tests pass.

See src/wx/tests/CMakeLists.txt for how to set up unit test files; they
plug into the normal CTest mechanism in cmake.

The test binaries are written to the tests/ subdirectory of the build
directory.

Building the tests and enabling the CTest support can be turned off by
passing -DBUILD_TESTING=OFF to cmake, the default is ON, this is the
standard mechanism.

Start running ctest on travis and appveyor.

Move stb to third_party/include where Catch2 is now as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-10 13:43:48 +00:00
Edênis Freindorfer Azevedo 3ba0529585 Improve BIOS Math tests score from 425 to 625.
Without using BIOS file.
2020-07-10 00:25:38 -03:00
Edênis Freindorfer Azevedo 6f2e320d59 Improve clock cycle count for THUMB operations. 2020-07-10 00:25:38 -03:00
Edênis Freindorfer Azevedo 9e537a8fe3 Improve cycle count for MUL, MLA.
Improves Timing score from 679 to 905.
2020-07-10 00:25:38 -03:00
Rafael Kitover 7fbb017cd5
Update macOS/Xcode version to latest for travis.
Use "osx_image: xcode12" which is Xcode 12.0 and macOS 10.15.5, the
latest available for travis.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-09 09:52:54 +00:00
Rafael Kitover a5f863f390
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-08 13:28:31 +00:00
Rafael Kitover 36e61d765a
Test with utf8 and nostl variants of wx on Travis.
Build on bionic with downloaded stow packages in /usr/local.

f51e1ee4 is actually a fix for a wx with --enable-utf8 and NOT for a wx
with --disable-stl, as it turns out.

FreeBSD uses --enable-utf8, while Linux distributions generally don't.

Tested by reverting f51e1ee4.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-30 00:52:20 +00:00
Rafael Kitover 306f92f5d7 Check game kbd input with wxGetKeyState() again.
Followup on baa0341b.

Reintroduce checking if a key is actually pressed in the panel OnKeyDown
event with wxGetKeyState(key_code).

Introduced in b0ec846 and removed in baa0341b.

wxGetKeyState() does not work on Wayland and does not work for Unicode
keys, support for which was introduced in baa0341b, which is why the
call was removed.

Add two static functions is_key_pressed(ev) and is_key_released(ev) that
return true under Wayland or if the key is Unicode, and call
wxGetKeyState() otherwise.

The reason this call was introduced in b0ec846 was to work around a bug
in some Linux distributions that caused spurious keyboard events to be
generated. The bug apparently still persists, see #689.

Because the two additional checks were necessarily added, the bug may
persist on Wayland, if it exists there, and for Unicode keys, but will
be fixed in the more common case of Latin keys under Xorg.

Tested on Linux with both Latin and Unicode game input keyboard keys.

- Fix #689.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-29 01:24:40 +00:00
Rafael Kitover 8e88363163
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-28 00:27:41 +00:00
Rafael Kitover f51e1ee4ec Fix for non-stl wx builds.
Followup on baa0341b.

Use ToStdWstring() instead of wc_str() to look up strings in the map,
the key for the map is std::wstring.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-26 06:51:27 +00:00
Rafael Kitover 047cc29787
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-23 06:45:12 +00:00
Rafael Kitover 3a2b97fd08
Transifex pull.
New complete translation by @Ds886 for he_IL.

New locale en_PL.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-21 20:12:55 +00:00
Rafael Kitover 121013c534
Transifex push + fix for a couple of strings.
Fix a couple of strings noted by @Ds886.

Generate new pot and push to transifex.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-21 19:42:52 +00:00
Edênis Freindorfer Azevedo 91a6b53e02
Input followup (#687)
- Allow some control chars to be used as input.

This is actually a regression, since our default config uses some of
these chars.

- Allow default keys bindings to be used elsewhere.

If we try to use keys such as `KP_ADD`, `KP_ENTER` as game input, we
actually execute a `NOOP` command accelerator (nothing done), as we
associate the key with it to disable the accel.
Due to this, we do not allow any further processing of this key, such
as game input.
2020-06-20 19:36:24 -03:00
Edênis Freindorfer Azevedo de93330125
Merge pull request #671 from visualboyadvance-m/turbo-gba
Input refactoring.
2020-06-18 23:01:32 -03:00
Edênis Freindorfer Azevedo baa0341bd5
Input refactor.
- Allow key shortcuts to run with loaded game.

For example, when we set `CTRL+A` for `load most recent save state` and
use `A` for some input command, holding `CTRL` and then pressing `A`
will not execute the shortcut. Instead, the key press `A` will be used
only as the input and nothing else.

With this, we use both the input and shortcut key.

- Isolate function to get keyboard key codes.

As explained on [1]:

"Using `GetUnicodeKey()` is in general the right thing to do if you are
interested in the characters typed by the user, `GetKeyCode()` should
be only used for special keys (for which `GetUnicodeKey()` returns
`WXK_NONE`)."

We also allow special keys to be mapped, hence the requirement of using
both functions.

[1] https://docs.wxwidgets.org/3.1/classwx_key_event.html

- Allow use of unicode keys for input and shortcut.

Use format `KeyCode:Modifier` for saving/loading unicode keys.

`WxWidgets=3.{0,1}` does not create an accelerator from strings with
unicode keys such as `ç` (`FromString` function). It fails with an
assertion error and stops execution. At the same time, we use the keys'
strings that are known for WxWidgets, such as `A`, `CTRL+O`,
`PAGEUP` etc.

Use both `EVT_KEY_DOWN` and `EVT_CHAR`.

`EVT_CHAR` is better than `EVT_KEY_DOWN` here because it is where the
raw key events will have been cooked using whatever recipes are in
effect from the os, locale, international keyboard settings, etc.

- Enable SDL joysticks input as key shortcuts.

Start/Stop polling joysticks on Unload/load game.

Our main loop already polls the joystick, we don't need the timer
while a game is running.

- Create function `str_split_with_sep` and use it.

For when we parse strings that may include the sep string, such as
game input and key shortcuts.
2020-06-18 20:47:47 -03:00
Edênis Freindorfer Azevedo 6b257d52f2
Avoid override of variable `throttle` for turbo.
It is not needed to set `throttle` on neither case. There is actually a
bug when using turbo/speedup and closing the emulator. The test case
is the following:

https://github.com/visualboyadvance-m/visualboyadvance-m/issues/627

On Windows:

1. use opengl;
2. load GBA game;
3. set throttle to `100%`;
4. set turbo throttle to `200%`;
5. enable turbo on menu;
6. save game;
7. close emulator && open emulator;
8. load GBA game;

==>

throttle is `200%`.

This is definitely not expected.
2020-06-17 13:23:14 -03:00
Edênis Freindorfer Azevedo bd2483cae7
Allow changing connection type without restart.
Before, if we tried changing the connection type without closing vbam,
we would get an error about a connection already existing. We needed
to restart vbam to change it.
2020-06-17 13:23:14 -03:00
Rafael Kitover d379a076df Decrease mouse sensitivity for menu hiding.
Ignore mouse movements of less than 11 pixels, to avoid spurious events
from mice in high DPI mode etc..

- Fix #675.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-15 19:32:33 +00:00
Rafael Kitover 0b7f11018d
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-14 19:08:41 +00:00
Edênis Freindorfer Azevedo 0c5ee9941b Fix PNG capture screen.
- Fix #680.
2020-06-07 18:06:04 +00:00
Rafael Kitover 3d83590774
Remove 32 bit mac binary, builder updates.
We are not going to release 32 bit mac builds anymore, because any mac
sold after 2007 will run a 64 bit binary. And since we are building for
10.7, which requires a 64 bit mac, and will run 64 bit binaries even on
a 32 bit kernel, the 32 bit binary was always pointless.

More on this here:

https://apple.stackexchange.com/questions/99640/how-old-are-macs-that-cannot-run-64-bit-applications/99644#99644

https://apple.stackexchange.com/a/261793/206363

Remove references to 32 bit mac binary from the dev manual.

Builder updates:

- Bump cmake 3.13.0-rc1 -> 3.17.3. This is needed for the new
  FetchContent feature in cmake, which we use for Sparkle (online
  updates for mac.)

- Bump sfml to newer master commit.

- Add pre-build hook for libvpx on mac to set
  -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET in CFLAGS.

- Force C locale in all builder scripts, homebrew bash was erroring due
  to some kind of locale bug with a non-English locale.

- Remove .app in build_project() before building, rebuilds were failing
  due to reinstallation of frameworks (Sparkle.)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-07 12:38:48 +00:00
Rafael Kitover d8da93897a
Minor improvements for mac dyld linker.
Minor code improvements.

Do not suppress output of sudo invocation, this may cause it hang on an
invisible password prompt.

- Fix #676.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-05 03:36:59 -07:00
Rafael Kitover 7c0c53a332
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-04 22:38:36 +00:00
Rafael Kitover c294b86635
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-01 18:20:56 +00:00
Rafael Kitover bfab4321cb
Improve gentoo support for installdeps.
- Use gtk3 slot for wxWidgets.

- Fully qualify all ebuilds.

- Only rebuild if necessary.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-01 12:24:41 +00:00
Rafael Kitover 0436797080
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-23 20:09:17 +00:00
Rafael Kitover a5e776eea3
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-16 22:42:18 +00:00
Rafael Kitover 7d15117536
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-16 11:25:04 +00:00
Rafael Kitover 1347026d40 Turbo config refactor followup.
In the Turbo config dialog, remove the selection list for entering the
value and leave only the spin control. Allow values above 600%, up to
4000%.

Reintroduce the speedup_frame_skip config variable, defaulting to 9, use
it for turbo selection values > 600%, with speedup_throttle == 0.

The rationale for this is that on average modern hardware, throttle
values above 500% or 600% will not be effective.

The default is now shown as 1000%, which is:

frame_skip == 9 && speedup == 1,

where:

speedup == 1 is equivalent to throttle == 0,

as was the case before the turbo config changes.

Values above 600% are automatically rounded up or down to the nearest
100%, on entry and on click of the up/down arrows of the spin control.

The frame skip checkbox is cleared and disabled for the "Unlimited"
setting (throttle == 0), and set and disabled for values > 600%, to
reflect the mechanism to the user.

When the value again enters the modifiable range in the spin control,
the previous value of the checkbox is restored.

Misc:

- Turn off translation of percentage values in the xrc.

- Remove the size element for the throttle selection list in the general
  config dialog xrc, it breaks the layout on GTK3.

- Add a note about passing wxWidgets_CONFIG_EXECUTABLE to cmake to
  select wxWidgets version to README.md.

Hopefully this will reduce confusion and present a nicer UI.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-15 02:01:57 +00:00
Rafael Kitover 51b66714c5
Small update to powershell section in dev manual.
- Fix pkill function.

- Give more example of comma separating arguments.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-13 22:38:22 +00:00
Rafael Kitover b4aeab689a
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-13 08:47:46 +00:00
Rafael Kitover 44202abdb5
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-12 08:14:48 +00:00
Rafael Kitover 710d356084
Improve powershell notes in the dev manual.
I now know some things better about powershell.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-11 00:33:30 +00:00
Rafael Kitover 4f0f942e31
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-09 20:51:09 +00:00
Rafael Kitover 1bced474a2
Codesign fix for mac.
Followup on 07064c87.

Use codesign --deep to sign the .app before signing all the frameworks,
otherwise codesign will refuse to sign the app due to unsigned dylibs
when not making a static build.

The error is:

./visualboyadvance-m.app: code object is not signed at all
In subcomponent: ...libtheoraenc.1.dylib

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-08 13:26:20 -07:00
Edênis Freindorfer Azevedo 07064c8714
[Windows,MacOS] Auto-updater refactoring. (#639)
Create and enable auto-updater for MacOS using `Sparkle=1.23`. We need
to sign our app using an `Apple Developer Key` for it to work properly,
since we are not going to sign updates with the Sparkle key.

Add all auto-updater files to `gettext`'s pot.

Use `str_split` to always get related stable version. We do not want
to check for nightly builds.

For Windows, we create the flag `-DHTTPS` to select between using an
HTTPS or HTTP URL for the auto-updater checks. We use this to keep
support for Windows XP (HTTP only) while all others should be HTTPS.

Also, use `::FreeLibrary` to allow us to remove the temporary file
that stores the `WinSparkle.dll`. Previously, we could not get it to
work with `wine`.
2020-05-07 23:06:00 -03:00
Rafael Kitover 8024c87832
Fix vcpkg upgrades.
We upgrade only the first listed package to upgrade for vcpkg to not
overrun the CI time limit.

Sometimes these packages are up-to-date but are listed for rebuild due
to depending on other packages that would be upgraded.

Find the first package in the upgrade list that is not up-to-date and
use that as the package to upgrade.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-07 01:11:18 +00:00
Rafael Kitover 43b749fe0b
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-06 10:20:23 +00:00
Rafael Kitover 6bf107f75d
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-05 14:00:58 +00:00
Rafael Kitover 09e8da43db Joystick refactor pt. Deux: Support Joysticks.
Add support for non-GameController SDL Joysticks.

Add proxy class wxSDLJoyDev to support using either SDL_GameController*
or SDL_Joystick* values in joystate.dev.

Add pretty much identical SDL code to support SDL_Joystick* when the
device cannot be opened as an SDL_GameController*, without changing the
API. SDL_Joystick* devices operate almost identically to SDL_Controller*
devices with their own default mappings, for both events and polling.

Filter axis motion events in the bindings editor widget for subsequent
events within 300ms. This gets rid of the double binding for +1/-1 when
the stick is moved to a direction.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-05 08:47:52 +00:00
Rafael Kitover ad3327d437
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-03 00:08:09 +00:00
Rafael Kitover 504ca08b6b Hide menubar + minor UI refactor.
Add ui/hideMenuBar boolean option, defaulting to on, which hides the
main menubar when the mouse is idle or outside the frame.

This is disabled on mac, because on macs the main menubar is not part of
the application window.

Fix pointer hiding/unhiding by connecting panel events to the gamearea
mouse event handler.

Clean up the pausing when menus are opened code, make it actually work
on Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-02 13:14:46 +00:00
Rafael Kitover 2868c1b753 Fix changing aspect ratio option.
When toggling "retain aspect ratio", destroy the drawing panel so it is
recreated with the desired aspect ratio settings.

Only add the vertical spacers when aspect ratio is on, they are not
needed when it's off.

Set the sizer priority of the DrawingPanel to 1 if aspect ratio is off
so that wxEXPAND always works.

Clear the GameArea sizer when attaching a new DrawingPanel, this is so
that the vertical spacers used when aspect ratio is on are not included
when aspect ratio is off.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-02 13:08:34 +00:00
Rafael Kitover 0f55b5d1c8
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-01 23:58:42 +00:00
Josh Smith 3041e3262b Removing meaningless conditional
reg[0].I is unsigned so checking if it is greater than or equal to zero is always true by definition.

Fixes #578
2020-04-30 02:17:23 +00:00
Rafael Kitover 045e95ab4e GB: Support 4MiB MBC30 ROM bank select.
MBC30 is a variant of MBC3 with a 4MiB ROM size and a larger RAM size.

https://gekkio.fi/files/gb-docs/gbctr.pdf

Allow addressing 4MiB of the ROM in MBC3 ROM bank select if the ROM size
is 4MiB.

Fix provided by roytam1.

- Fix #652.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-27 18:32:12 +00:00
Rafael Kitover a972da8ddb
Update github issue template.
Use html comments for section instructions that shouldn't be visible in
the completed form.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-24 12:53:51 +00:00
Rafael Kitover eecde424ae
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-21 21:56:56 +00:00
Edênis Freindorfer Azevedo 0b14e9f885
[WINDOWS] Add function to open unicode files. (#644)
We have some issues when trying to open files on Windows that contains
characters not included in the current codepage. Using `fopen` fails
when that happens.

One example is using the `pt_BR` codepage and then using a name with
japanese chars for the battery file.

The games and BIOS work since they use `blargg_open`. It converts a
`const char *` to `const wchat_t *` and uses `_wfopen` for windows.
(doing a multibyte to widechar conversion)

Since we want to avoid doing many code changes on our cores, we need
some `util*` functions for the matter.

Replace `mb_fn_str` by UTF-8 strings.

Replace all occurrences of `fopen` for `utilOpenFile` on GBA core.

Replace all occurrences of `fopen` for `utilOpenFile` on GBA e-reader.

Adjust e-readers calls on wx frontend.

Replace all occurrences of `fopen` for `utilOpenFile` on Patcher files.

Always apply UTF-8 when dealing with path strings.

On our wx frontend we should always send UTF-8 `char *` to our cores
functions. This way we can have consistency when dealing with them for
each platform.

On Windows, we will convert all multibyte to wide chars and use proper
functions for I/O operation.

Create function to deal with unicode calls of `gzopen`.

We use `gzopen_w` (`zlib>=1.27`).

Replace all occurrences of `fopen` for `utilOpenFile` on Config Manager.

Replace all occurrences of `fopen` for `utilOpenFile` on Cheat files.

Use proper functions for unicode on GB core.

Use function instead of macro for `UTF8()`.

Use `nullptr` instead of `NULL`.

Print wide char strings on status bar.
2020-04-21 10:24:28 -03:00
Rafael Kitover ed438d6e52
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-15 10:09:27 +00:00
Rafael Kitover b7f5754338 Add to dev manual on translations and char sets.
Document how we interact with transifex and how to pass strings to
non-wxWidgets code.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-13 00:25:11 +00:00
Rafael Kitover a36b147411
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-13 00:12:21 +00:00
Rafael Kitover 9e03af83c4
Transifex push.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-12 00:21:04 +00:00
Rafael Kitover 3869b08c9a
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-12 00:18:00 +00:00
Rafael Kitover 8e3978b314 Speedup/Turbo/Throttle fixes.
Fix throttle=0 (unlimited speed) settings for both the Speedup/Turbo
config panel and the general throttle setting and make 100 the default.

Replace the speedup frame skip option with a "Frame skip" checkbox,
which enables skipping the appropriate number of frames if vsync or very
low system performance is in effect. The systemFrameSkip (under video
config) is added to this value.

With speedup_throttle=100, the old speedup behavior is used with 9
frames skipped.

With speedup_throttle == 0 && speedup_throttle_frame_skip, skip 9
frames at full speed, which is exactly the same as the old behavior,
since throttle == 0 is equivalent to speedup == true.

Hopefully these changes will make the turbo config dialog more useful
for users, by default frame skipping to work around vsync will be
enabled, and users can uncheck the "Frame skip" checkbox for a smoother
experience.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-10 10:19:03 +00:00
Rafael Kitover d6cc14ef10
builder: URL updates.
Update openssl version, getopt URL and roll nasm back to stable, because
the snapshot hangs on Catalina.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-04 15:17:05 -07:00
Rafael Kitover f24e8aae2f
Change board/nightly URLs in README.md to https.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-23 00:27:51 +00:00
Rafael Kitover 83b6efa6cd
Add forums link back to README.md.
Now that the board is back up.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-22 15:04:06 +00:00
Rafael Kitover b21880ea15
cmake: Zip suffix fix for 60f05ced.
Fix problem with the ZIP_SUFFIX option, which causes zip files to have a
suffix of "OFF" if the option is not set.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-18 01:01:19 +00:00
Edênis Freindorfer Azevedo 166cf446f7 Disable menu LCD filter unless playing GB or GBA.
Since they share the filter function, but can change one from another
(setting on the GBA would apply to GB and vice-versa), we allow only
the proper setting to be toggled while a ROM is loaded.

If GB ROM, then `Options` > `Game Boy` > `LCD Filter` is enabled.

Likewise for GBA. If neither, then no option is enabled.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 060010699d Init systemColorMaps after output module init.
It is done only once after the output module is initialized. It is also
adjusted to whatever ROM is being loaded.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo cd029ae696 Fix video recording with frame skip enabled.
When we skip frames, we just don't draw them on our frontend. The
function `systemDrawScreen` also send the video frames to be recorded,
but only when called from the core.

Our solution creates a auxiliary `systemSendScreen` that only adds the
frame to the recording. It is called when the core decides to skip a
frame. This way we can get the video frame for recording, just like
audio ones are always sent.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 008aecde67 [LINUX] Fix display of `RGB` values on viewers.
The flag `wxST_NO_AUTORESIZE` does not behave well on our viewers. They
were being hidden due to not fitting the text box available.

On Windows, they were working as expected. It is unknown on MacOs.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 834d153725 Fix accel shortcuts when using some menu options.
`gbColorOption`, `GBALcdFilter` and `GBLcdFilter` did not respond
to accelerators shortcuts.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 994726dd8d Do not pause while opening configuration windows.
The only configuration that we cannot change while playing is the sound
driver. All the others should be changeable without any major issues.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 54335dc67c [WINDOWS] Fix weird WX errors messages.
XRC error: 131: vertical alignment flag `wxALIGN_BOTTOM` has no effect
inside a vertical box sizer, remove it and consider inserting a spacer
instead.

- Fix #517.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 7bac34eda4 Remove duplicate variable `winFlashSize`.
We already had `optFlashSize` for both SDL and WX ports. We assigned
this variable to replace all ocurrences of `winFlashSize`.

As a side note, this entire scope could/should be replaced by a better
auto-detect system for saving types. At the moment, it is only really
useful for the SDL port, since we have overrides for the WX port.

- Fix #585.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 8d62a790e3 Change default options for GB.
We set to automatically display borders on SGB games, as well as
setting the default emulation system to `automatic`.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo 99b66e1326 Expose LCD filter for GBA and GB color saturation.
We offer a way to control the color saturation for GBA games such as
Fire Emblem Tactics Advance.

It will be enabled by default for GBA games and disabled for GB.
The user will be able to toggle both of them and these options
will be persistent by saving to `vbam.ini`.

- Fix #131.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo c789020e93 Fix `Save` button on OAM Viewer for GB and GBA.
No idea why this was not implemented yet...
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo dcaa1b9abc Fix `Save` button on Tile Viewer for GB and GBA.
For some reason this was not implemented yet.
2020-03-18 00:48:43 +00:00
Edênis Freindorfer Azevedo d05e8fc141 Make AGBPrint output to our Logging.
We also output using `dbgOutput`, hence the behaviour will not change
for users relying on this.
2020-03-18 00:12:27 +00:00
Rafael Kitover 60f05cedc2
cmake: Add ZIP_SUFFIX option, for build configs.
Add a ZIP_SUFFIX option defaulting to "" that is added to the generated
.zip file with UPSTREAM_RELEASE before the .zip extension.

For example, for an experimental feature you could pass
-DZIP_SUFFIX=-timer_loop and the resulting .zip file would be
visualboyadvance-m-Win-64bit-timer_loop.zip or
visualboyadvance-m-Win-64bit-debug-timer_loop.zip for a debug build.

Also add a modeline to this cmake file because vim-sleuth always gets
the settings wrong. Or it could be the cmake filetype plugins.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-17 03:24:43 +00:00
Rafael Kitover abb8234174
Allow binding specific server IP. (#633)
For the netlink dialog, leave the server IP text field enabled when the
server radio button is selected and bind it to the new option
gopts.server_ip which defaults to "*" for binding on all addresses,
which was the previous behavior.

Copy this value to the new GBALink global IP_LINK_BIND_ADDRESS and use
it when creating a listening socket.

SFML supports creating sf:IpAddress values from hostnames, consequently
no additional code is needed to support hostnames in the netlink dialog.

Change GetLinkServerHost to return the primary local address when the
value is "*", which was the previous behavior, and the set value
otherwise.

Remove the min/max macros from GBALink as they are unnecessary and
conflict with std headers.

Require at least SFML 2.4 instead of 2.x for the IP binding
functionality in cmake.

- Fix #632

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-16 13:37:01 -03:00
Rafael Kitover 4f49c89a98
Update README.md for current project status.
- Remove forum link until it's back up.

- Add nightly builds link.

- Use ninja for build instructions instead of make.

- Note that wx 2.8 and non-stl builds are no longer supported.

- Mention fprintf(stderr, ...) in the debug messages section.

- Misc. minor edits.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-16 12:13:25 +00:00
Rafael Kitover a462904c58
Merge remote-tracking branch 'vbam-libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-16 11:48:19 +00:00
Rafael Kitover 7ab7bc3a9d
cmake: Add -debug suffix to windows debug zips.
For the zip file containing the executable (and symbols for debug builds
on msvc) add the -debug suffix to the basename of the zip file for debug
builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-15 20:44:22 +00:00
Rafael Kitover 57bc8f9e40
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-15 02:19:42 +00:00
Rafael Kitover 571025da66
cmake: Do not use gpg if user has no keys.
When UPSTREAM_RELEASE is set, only use gpg to make detached signatures
if the output of gpg -k is not blank. If it is not, the user has likely
installed a private key to sign with.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-14 13:28:36 +00:00
Rafael Kitover 7b04c4ceec
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-14 01:55:08 +00:00
Rafael Kitover 8ede756fb0
Gettext pot regen and transifex push.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-13 14:41:14 +00:00
Rafael Kitover 6c64db0794
cmake: Windows codesigning refactor.
Quote variables containing the HOME or USERPROFILE, as they may have
spaces.

Check for both osslsigncode and signtool regardless of platform, and
prefer osslsigncode.

The reason for this being that osslsigncode is more reliable and does
not depend on system configuration in any way, while signtool can fail
under more conditions.

The other reason being that you can use either program on both windows
and linux. E.g. the mingw version of osslsigncode or the signtool from
mono distributions on linux.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-13 00:30:26 +00:00
Rafael Kitover 7a4a7d148c
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-12 23:45:45 +00:00
Edênis Freindorfer Azevedo 4f1a351d4a Try to configure vsync for multiple options.
When we have a notebook with intel+nvidia, OpenGL sets both
`glXSwapIntervalSGI` (nvidia) and `glXSwapIntervalMESA` (intel) for
usage. That means that if the display is controlled by one, we may
disable vsync for the other card, therefore having no actual effect
on gameplay. With this, we check for all available functions and try
them all.

This may lead to some false warnings, but useful for debugging
purposes.
2020-03-11 14:00:24 +00:00
Edênis Freindorfer Azevedo ed8a9af250 Use proper functions and checks for OpenGL VSYNC.
The vsync has to be {dis,en}abled before a ROM is loaded or we need to
restart the output module to apply it.

We also support MESA based installations (Intel HD Graphics, AMD/ATI and
Nouveau) on Linux.
2020-03-11 14:00:24 +00:00
hizzlekizzle 29dffc0120
Merge pull request #86 from negativeExponent/patch-1
Fix Save Failed error for Super Monkey Ball Jr.
2020-03-10 18:43:54 -05:00
negativeExponent 6092082e04
Fix Save Failed error for Super Monkey Ball Jr. 2020-03-11 06:47:25 +08:00
Rafael Kitover 2ba0d316cd
cmake: Include .pdb in zips of debug builds.
Include the visualboyadvance-m.pdb file alongside the .exe for Visual
Studio debug builds.

Visual Studio generates this file with the debug symbols for debug
builds. The file is not generated for release builds. It is also
generated for RelWithDebInfo builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-09 04:28:52 +00:00
Rafael Kitover 2fe84053e1
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-09 02:36:26 +00:00
Rafael Kitover f1099a213a
Check return value of soundInit().
soundInit() returns a bool to indicate success, and failure inevitably
leads to crashes as the emulator tries to use a NULL soundDriver.

On false, popup an error dialog saying that the sound driver failed to
initialize, this is at least better than crashes, which will also need
to be fixed.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-07 13:30:28 +00:00
Mystro256 410ede543c
Check for null pointer in soundReset().
Check that soundDriver is defined.
2020-03-07 13:08:44 +00:00
negativeExponent 9d1d707c01
Limit ROM size to 32 MiB.
Limit the utilLoad() function in src/Util.cpp to 32 MiB.

This function loads a file from disk and returns a memory image of it.

This is only used to load ROMs currently.
2020-03-07 11:45:19 +00:00
negativeExponent fd319d2184
GB: Check header for a valid ROM file.
Check some magic numbers in the ROM header to detect Game Genie and Game
Shark ROMs, and check for the Nintendo logo in the header in normal
ROMs.
2020-03-07 11:43:00 +00:00
Rafael Kitover 2f23467245
cmake: When replacing old tags, use origin.
Fetch new set of tags from the origin remote explicitly rather than
whatever remote is associated with the current branch.

In this way, old tags on other remotes get overwritten as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-07 11:36:40 +00:00
Rafael Kitover 20f57587e2
cmake: Replace old git tags if found.
Detect old badly formatted git tags we used in the user's git clone, and
if found delete all tags and fetch them from the origin.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-05 15:04:19 +00:00
Rafael Kitover e220c9bc91
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-04 15:29:57 +00:00
Rafael Kitover c258f6c1c8
Remove libpng from dependencies in README.md.
Followup on 05bd2a95 and 513af13d.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-02 19:15:38 +00:00
Rafael Kitover 995c2cb706
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-01 14:03:10 +00:00
Rafael Kitover 05bd2a95cd
Remove libpng direct dependency.
Followup on 513af13d which replaces the use of libpng with the stb_image
headers.

- Remove the use of libpng in cmake.

- Remove libpng from list of vcpkg dependencies.

- Add libpng to list of wxwidgets link libraries when using vcpkg, since
  it is no longer linked directly. This is necessary for static builds.

- Remove libpng from all package lists in installdeps.

- Remove libpng-dev from the debian control file.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-01 13:56:29 +00:00
Rafael Kitover f2e81b8e4b
Clarify direct commit policy in manual.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-01 12:50:52 +00:00
Edênis Freindorfer Azevedo 513af13ddc Replace `libpng` code for `stb_image` one.
It is a very straightforward replacement calls.
2020-03-01 09:54:43 +00:00
Edênis Freindorfer Azevedo 8f48c1f01d Fix weird `wxWidgets>=3.0` error message.
ASSERT INFO:
/usr/include/wx-3.0/wx/object.h(160): assert "wxDynamicCast(ptr, T)"
failed in wxCheckCast(): wxStaticCast() used incorrectly
2020-03-01 09:54:43 +00:00
Edênis Freindorfer Azevedo 7f1a3a932c Add stb_image headers to cmake. 2020-03-01 09:54:43 +00:00
Edênis Freindorfer Azevedo 4da422d02b Update stb_image headers to latest version.
We are going to remove our libpng for stb_image.
2020-03-01 09:54:43 +00:00
Rafael Kitover 3ca35d9ca6
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-29 02:31:11 +00:00
Rafael Kitover 0a451d11d3
Tranisfex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-27 00:12:03 +00:00
Rafael Kitover 229bf815e0
Revert f1abbc5f, vcpkg upgrade is fixed.
vcpkg upgrade is fixed via:

f6d52648ec

Use upgrade --no-dry-run again to install the first package to upgrade.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-25 20:40:22 +00:00
Rafael Kitover 5c0903d651
Add developer manual.
Start a developer manual for the project where we will keep policies,
guides and processes for the project in DEVELOPER-MANUAL.md.

Describe the policies for receiving and resolving github issues.

Describe the policy for git commit messages on pull requests and add git
notes for collaborating on a branch.

Describe the policy for commits from maintainers.

Describe how to set up a native windows powershell development
environment and some powershell tips.

Describe the requirements and steps for the current release process.

Replace the CONTRIBUTING section of the README.md with a link to this
manual.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-25 19:51:53 +00:00
Rafael Kitover 32e7c69726
Gettext pot update improvements.
Extract strings from all wx sources, not just the enabled ones.

Ignore comments in the generated pot when checking if it was updated, we
don't care about just changes in line numbers.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-24 21:06:23 +00:00
Rafael Kitover 2f0653824e
Enable XAudio2 for Windows vcpkg build.
Add necessary headers to the dependencies submodule and default the
cmake option to on.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-24 20:49:01 +00:00
Rafael Kitover ba14cadba1
Fix 0e8e46f0 for gcc.
gcc (mingw) does not allow converting a const char*[] to a char**
without -fpermissive. Make some adjustments to the string handling to
execute the cmd.exe command to delete the temp file.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-24 19:46:50 +00:00
Rafael Kitover 0e8e46f0b7
Windows: Fix deleting tempfile for winsparkle dll.
Trying to delete the temp file for the winsparkle dll after unloading
the dll would still produce an access denied error, presumably because
for whatever reason not all resources used by the dll were freed.

Instead of trying to immediately delete the file, start an asynchronous
cmd.exe process to sleep for 2 seconds and delete the file. This gives
the app time to exit, after which the file can be deleted.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-24 13:17:32 +00:00
Rafael Kitover 89d378eb71
cmake: Fix gettext pot update check.
When the feature was added in d93f6350, I did not adequately test for
the normal case when the pot is not updated.

This does not work because the pot has a timestamp in the
POT-Creation-Date: field.

Fix check-pot-update.cmake to ignore the pot timestamp and not report
the pot as changed when it has not been.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-20 23:46:09 +00:00
Rafael Kitover 2504596140
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-19 23:55:25 +00:00
Rafael Kitover 06b3affeef
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-19 10:49:47 +00:00
Rafael Kitover 4b4b770495
Transifex push/pull.
pot made using new cmake code from d93f6350.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-17 09:13:08 +00:00
Rafael Kitover d93f6350d0
cmake: Generate gettext pot automatically.
Remove po/update_pot.sh and generate the gettext .pot source
automatically in cmake on every build instead.

If the .pot is actually updated, print a loud message at the end of the
build to commit the result and push to transifex.

Fix the gettext tools and package loading block to only run when
ENABLE_NLS is enabled and find the xgettext and msginit binaries in the
Windows case as well. xgettext is used to generate the .pot.

Refactor the SRC_WX/HDR_WX/RES_WX/XRC_SOURCES handling to use only
relative paths and move all generated files into RES_WX. This was
necessary to generate the .pot from cmake.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-17 08:34:32 +00:00
s520 a320377040
Fix: a issue with loading e-Reader dot code (#608)
Fix issues with {sav,load}ing e-Reader `Dot Code`.

If `Dot Code` file is not specified, it tries to continually read it and does not accept input.

In Japanese (very likely other languages as well), the path of `Dot Code` file is garbled
internally due to failing conversion to UTF-8.
2020-02-15 14:02:53 -03:00
Rafael Kitover 951e8e0ebe
cmake: Check UPDATE_APPCAST before TAG_RELEASE.
Check for UPDATE_APPCAST being set before checking for TAG_RELEASE, as
the UPDATE_APPCAST script may be run in the same build directory where
TAG_RELEASE was just run.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 23:22:31 +00:00
Rafael Kitover 9475474ee6
cmake: Add UPDATE_APPCAST script for appcast.xml.
Add the -DUPDATE_APPCAST=TRUE option to invoke the UpdateAppcast.cmake
script, which clones the github pages repo and sets the version in the
appcast.xml to the last tag, presumably made with -DTAG_RELEASE.

The script prints out a final set of instructions to actually push the
change to git.

If the option -DUPDATE_APPCAST=UNDO is used, the clone is removed and no
changes are made.

Also use the correct method of splitting the tag list output into
multiple lines.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 22:53:53 +00:00
Rafael Kitover 19dff6c911
Make win32 dependencies submodule point to master.
Use the new git feature to point dependencies submodule to the tip of
its master.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 21:46:22 +00:00
Rafael Kitover 0b419ee849
Revert snap store badge change.
It seems only the svg version is available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 04:42:12 +00:00
Rafael Kitover 00cd19f640
README.md: remove snap status, small store badge.
Remove snap build status since we are not using that anymore.

Use the png instead of the svg for the snap store badge as it's not as
large.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 04:33:30 +00:00
Rafael Kitover 83614290be
Turn on winsparkle update checking support.
Default to ON on Windows for x64 or x86.

Set new appcast URL, this will be in the github pages repo.

We will need to get everything ready for the next release.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 04:26:50 +00:00
Rafael Kitover f1abbc5f83
cmake: Use vcpkg remove/install instead of upgrade.
vcpkg upgrade is currently broken, see:

https://github.com/microsoft/vcpkg/issues/9916

Use remove followed by install, which does practically the same thing,
as a workaround.

Hopefully fix current appveyor build failures.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-05 17:56:05 +00:00
Rafael Kitover 4aab08c47b Set link timeout default to 500ms, fix prev. dflt.
Default the linkTimeout ConfigManager variable to 500 (milliseconds.)

Detect if the previous default is set, which 1, and set to 500, to
repair existing configurations.

This may reduce the amount of reports about link being broken, as some
people have certainly not checked this setting, and the default should
not be so wrong.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-04 23:01:11 +00:00
Rafael Kitover 136c094f0c Add option to set link network port.
Add field for the network port to the start link dialog, default is 5738
as before.

The port is stored in the user's options config.

Add TextCtrl support to UIntValidator for this.

Related: #594.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-04 23:01:11 +00:00
Rafael Kitover 98f3948ea8
cmake: Add dep on catalogs for translations.zip.
This doesn't work to pick up changes from changed translations files
though, because git does not store file timestamps.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-03 18:10:29 +00:00
Rafael Kitover 1d6342d6cb
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-03 15:38:23 +00:00
Edênis Freindorfer Azevedo 789cd2d0f0
Revert "Enable layers in non-tile modes."
We need to use proper documented behaviour when coding the
core, therefore this should be reverted until a proper
solution is done.

This reverts commit ca3b63d64c.
2020-02-03 07:38:26 -03:00
Rafael Kitover 7bbbf04716
installdeps: fix mxe compiler ccache symlinks.
For some versions of the mxe ubuntu repositories, the compiler/ccache
packages have a bug where the compiler a broken symlink to ccache.

Make sure the expected symlink to ccache exists.

Add pre-build instructions to add /usr/lib/mxe/usr/bin to the PATH.

Amend the PATH for the mxe travis jobs as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-03 01:41:37 +00:00
Rafael Kitover bb23357d47
builder: disable libwebp in libtiff.
Fixes mac build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-02 08:13:13 -08:00
Edênis Freindorfer Azevedo ca3b63d64c
Enable layers in non-tile modes.
The current code is very messy as far as GFX goes. There are more
elegant ways of tackling this issue, but they are very difficult with
our current code.

The idea behind this issue is that the backgrounds are not switching
properly for the lcd. So we enable the layers accordingly to
`layerSettings & DISPCNT` on every `CPUUpdateRenderBuffers`.

The bits of `layerSettings` enconde each layer and objs.
We actually only need 2 of these, but I can't do much more here
unsupervised.

- Fix #376.
2020-02-02 15:49:02 +00:00
Rafael Kitover 213f47ec96
builder: minor fixes for mingw.
Search the lib-prefixed names of intl/iconv/charset libraries first to
avoid dlls being linked.

Update toolchain files to include the common source by full path, fixes
using them as toolchains for other projects broken in 3edd9ba7.

Update URL for nasm, use newer jpeg-turbo, tiff and wx.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-02 03:35:26 +00:00
Rafael Kitover 3ca67b9d5d
builder: disable openal for 32 bit mingw.
XP users may not have openal, and it's not an important feature.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-02 03:32:24 +00:00
Rafael Kitover 3edd9ba756
cmake: Fix fedora mingw build + misc improvements.
Use the 3.x wxwidgets mingw package in installdeps.

Add the win64 alias to installdeps for 64 bit mingw builds, like the
win32 alias for 32 bit mingw builds.

Check CROSS_ARCH in Architecture.cmake, set by our mingw toolchains.

Disable LTO by default for all mingw builds, not just amd64, because it
is unfortunately broken on i686 as well now.

Search for heuristically the most appropriate wx-config and set
wxWidgets_CONFIG_EXECUTABLE accordingly in the mingw toolchains.

Refactor the mingw toolchains somewhat, put common code into a common
file, add static toolchains.

For static toolchains, also search for a static zlib and set ZLIB_ROOT.

Change installdeps instructions to use ninja instead of make. Add ninja
to all target dependencies where it was missing, this may be incorrect
in a couple of the rarely used targets, if this is the case the affected
users are free to open an issue.

Also start using ninja on travis instead of make, except for libretro
which uses a GNU Makefile.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-01 16:43:08 +00:00
Rafael Kitover ba9c10d566
cmake: Make FileIterator more correct, add eg..
Add macro fi_check_done() to set fi_done if leftover contents is empty,
use it in both fi_open_file() and fi_get_next_line().

This fixes the behavior when the opened file is empty and makes the code
cleaner.

Add a usage example to top comment.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-26 23:35:09 +00:00
Edênis Freindorfer Azevedo ed4d1b9827
Merge pull request #595 from visualboyadvance-m/qol
Cleanup and WAV audio recording.
2020-01-25 17:14:24 -03:00
Rafael Kitover 8ce60e1745
cmake: Fix ffmpeg regression on Windows.
Remove LDFLAGS from list of required variables for finding ffmpeg to
succeed. Both main and component LDFLAGS.

Added by f7f424ea.

This is necessary because of platforms lacking pkg-config, like vcpkg +
Visual Studio, no LDFLAGS are found.

Fixes finding ffmpeg in the vcpkg + Visual Studio configuration.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-23 01:49:44 +00:00
Rafael Kitover 5de47935cf
cmake: Followup on release commit automation.
This is a followup on 93f906e2.

Simplify the FileIterator interface by doing the eof check in
fi_get_next_line().

Add rollback instructions to final instructions message.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-22 18:15:21 +00:00
Edênis Freindorfer Azevedo f69febfd71
Add `.wav` support for sound recording.
WAV is also set to be the default extension for audio recording.
2020-01-22 13:50:27 -03:00
Rafael Kitover 93f906e2db
cmake: Automate release commit and tag.
Add a TAG_RELEASE cmake variable which engages a cmake script to
generate a signed release commit with changelog entries from git and
signed tag.

The value can be ON/TRUE/1 or a specific next version number, or UNDO to
rollback changes just made with this script.

The script tries to make sure all the preliminaries are in the right
state to do a release, the source is a git clone, on branch master, with
a clean working tree and gpg is available.

Also add a utility script FileIterator.cmake which is an OO-like line
iterator interface for text files, used by the release commit script.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-22 03:14:26 +00:00
Edênis Freindorfer Azevedo 588e82f03c
Cleanup from PR 586. 2020-01-21 13:57:42 -03:00
Rafael Kitover 4e607da067
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-20 11:48:57 +00:00
Rafael Kitover 5cc1fd28b4
cmake: Wrap vcpkg code in a function.
Wrap the main body of code in Set-Toolchain-vcpkg.cmake in the
vcpkg_set_toolchain() function to not pollute the global variable
namespace with helper variables.

VCPKG_ROOT and toolchain variables are set in the cache.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-17 21:55:26 +00:00
Rafael Kitover 47880ff9c6
cmake: Limit vcpkg upgrades to one port per run.
In order to not overrun the appveyor time limit of one hour, limit vcpkg
port upgrades to only the first port. This way the cache will be rebuilt
gradually instead of all at once, and the job won't fail due to
overrunning the time limit.

Also do a bit of refactoring and code improvements for
Set-Toolchain-vcpkg.cmake.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-17 19:47:09 +00:00
Zack 6a8a9e6244 Fix integer overflow in cheatsImportGSACodeFile length check.
Although a length check is being performed on the imported GSA Codes file, `len` is both a signed int and attacker controlled.

With a specially crafted GSA Codes file, an attacker could specify a value for `len` that overflows the `int` type, rolling over into a negative number. By doing so, the attacker can bypass the conditional mentioned above.

The `fseek` length parameter is of type `size_t` which is an unsigned int, this will result in `len` being interpreted as a large unsigned int, allowing for a stack based buffed overflow in the desc char array.

By making `len` an unsigned integer, it will prevent the overflow. It ensures that the bounds check works as intended.
2020-01-17 16:39:58 -03:00
Rafael Kitover 77c299c13f
cmake: Check for libcharset and use if found.
For Visual Studio, the static builds now require linking libcharset
explicitly, otherwise an `unresolved external symbol locale_charset`
error is thrown during linking.

This library is sometimes required on other platforms for iconv/gettext,
and checking for it and linking it should be harmless.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-17 16:03:07 +00:00
Rafael Kitover 0c0a35fd04
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-16 16:13:35 +00:00
Rafael Kitover 920f5ac704
Merge remote-tracking branch 'vbam-libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-01-16 15:47:53 +00:00
twinaphex 7d88e045a2 (MSVC 2017) Buildfix 2020-01-07 17:57:00 +01:00
Edênis Freindorfer Azevedo b27d853d48
Merge pull request #586 from negativeExponent/bps
BPS support and fix bug when patching rom.

Add support for BPS patch format (by @ArtiiP ).

Fix crash when patched rom new size is larger than original rom. This was bugged due 
to the rom block in memory being less than required after the `realloc` of the patch.

- Fix #549.
2020-01-04 07:26:08 -03:00
negativeExponent b50d48458f GBA: Fix crash when new size is larger than rom size after soft-patching 2020-01-04 04:46:49 +08:00
Ar't 9e1a63af0b support for patches in BPS format 2020-01-04 00:44:55 +08:00
Zach Bacon 7a7c86d315
Fix the git versioning for the snapcraft.yaml 2020-01-03 05:22:52 -05:00
Rafael Kitover ff0dbf8fe6
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-31 02:47:40 +00:00
Zach Bacon ac8ada553c
Stupid that I am
I forgot to add nasm to the build routine, this should resolve the build issues for snapcrafts build service.
2019-12-28 22:24:32 -05:00
Zach Bacon 1fa66c1f32
just a minor change to the readme
have the snap badge on a separate line
2019-12-28 22:18:23 -05:00
Zach Bacon d785cd4e6c
Add build status for snapcraft 2019-12-28 22:12:54 -05:00
Zach Bacon e9dc6dfd64
change to devel for this snapcraft file 2019-12-28 22:08:00 -05:00
Zach Bacon d58d4ee1d2
Move the snapcraft to root for snapcraft edgechannel setup 2019-12-28 22:04:03 -05:00
Zach Bacon 312b541625
Fix up the icon location in the desktop file
For regular desktop users they don't need this work around, it's mainly due to how snaps are mounted.
2019-12-28 22:01:53 -05:00
Rafael Kitover 065e700fc8
Fix icon in about dialog.
Use GetIcons() to get the IconBundle and call GetIcon() on it to get a
32x32 icon with fallback.

For whatever reason this works while just GetIcon() does not.

Source:

https://forums.wxwidgets.org/viewtopic.php?t=44818

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-29 02:03:46 +00:00
Rafael Kitover f3e4b05fa8
Linux: fix icon name in .desktop file.
Followup on f306cc63.

The icon name was changed from "vbam" to "visualboyadvance-m", so also
change the Icon field in the .desktop file.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-29 01:26:15 +00:00
ZachBacon f26480bb07
Move this snapcraft yaml to git releases and fix the icon location 2019-12-28 19:21:49 -05:00
Rafael Kitover d3397e6a1a
cmake: Release automation followup.
Followup on e98d8931.

Set the BITS variable in Architecture.cmake even if
CMAKE_SYSTEM_PROCESSOR is not set, and it often isn't. This allows for
generating the right release zip for 32 bit MinGW builds.

When invoking zip to make the translations.zip, use `.` instead of `*`
as the argument, with the correct WORKING_DIRECTORY, so as not to rely
on shell globbing of any sort. This broke for the 32 bit MinGW cross
build.

Fix the keychain unlock command on mac, the keychain must be unlocked to
use the codesigning certificate.

Fix the translations.zip.asc signature overwrite prompt on Windows.

For the mac builder, automatically use Xcode 9 for 32 bit builds if
installed, this is necessary on 10.14 (Mojave) and later.

Add interactive-pause.cmake script to wait for the user to press enter
before continuing, invoke it before gpg commands so that waiting for the
passphrase does not time out. It will not run if ENV{CI} is set or
ENV{VBAM_NO_PAUSE} is set, this is so that later we can set up automated
builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-25 23:14:45 +00:00
Rafael Kitover f7f424ea1b
cmake: Find FFMPEG_LDFLAGS in FindFFmpeg.cmake.
Add support for setting the <component>_LDFLAGS and FFMPEG_LDFLAGS cmake
variables based on pkg-config in FindFFmpeg.cmake.

The LDFLAGS can be necessary when linking FFmpeg statically, as is the
case for the mac builder script.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-25 07:59:56 -08:00
Rafael Kitover fb068e55c4
Poll joysticks before emumain in OnIdle #582.
Call PollJoysticks() before entering the emulator in OnIdle for the
lowest input latency.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-24 21:53:41 +00:00
Rafael Kitover 7a8aeb9842
Poll joysticks even when emulator is paused.
Call mainframe->PollJoysticks() on every pass through OnIdle, not just
when game is not paused.

Fix #582.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-24 13:54:53 +00:00
Rafael Kitover e98d89310e
cmake: Add some release automation steps.
Use ENV{MSYSTEM_PREFIX} instead of ENV{MSYSTEM} to check for msys2 as
that is more reliable.

Generate the translations.zip when building for Windows from the
generated .gmo files.

Add the UPSTREAM_RELEASE option to perform some additional release
automation steps:

- Codesign for Windows with either the Visual Studio signtool or
  osslsigncode when using MinGW.

- On Windows zip up the .exe into the appropriate zip file for release.

- Generate the gpg signature .asc files for the translations zip and the
  .exe zip on Windows.

- On Mac codesign the app, zip it and sign the zip.

- On all platforms try to strip the binary.

Remove the release automation steps from the builder script as they are
now in cmake.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-24 06:32:01 +00:00
Rafael Kitover bbbe9fe73f
Only poll joysticks with a valid device.
Followup on 0577f8af.

When looping through configured joysticks, ignore ones that do not have
a valid open device pointer.

Also remove the use of std::get for the joystate map tuple and use
.first instead.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-22 17:59:57 +00:00
Rafael Kitover 99cdbb8860
cmake: Remove libcmt from SDL bin in debug mode.
For the SDL binary vbam when built with MSVC add /nodefaultlib:libcmt to
debug link flags, because in debug mode libcmtd is linked and libcmt
should not be.

This is the same as was done for the wx executable in cf9a88df.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-22 17:46:21 +00:00
Rafael Kitover 54072f9711
Update icon xrc.
Followup on f306cc63.

Set the correct reference to icon .xpm file in MainIcon.xrc.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-22 17:34:50 +00:00
Rafael Kitover 0577f8afc2
Better joystick hotplug support.
Combine SDL events with polling the axes and buttons of controllers
every 10 milliseconds, this is necessary because of this bug in SDL:

https://bugzilla.libsdl.org/show_bug.cgi?id=4886

which causes SDL to not generation button and axes events after a
joystick is disconnected and then reconnected to the system.

Change the axes state from a unordered_map to an std::array because the
number of axes is fixed, add analogous buttons array.

Keep controller state synchronized between the event receiving code and
the polling code.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-22 03:17:33 +00:00
Rafael Kitover f306cc63b0 App name cleanup.
Rename all icon basenames and references to them from "vbam" to
"visualboyadvance-m".

Change app name in desktop file from "VBA-M" to "visualboyadvance-m" as
well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-21 18:22:57 +00:00
Rafael Kitover 9e4fd8fb2e
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-20 23:46:19 +00:00
Rafael Kitover 17d2fbc5cc
builder: mingw 32 bit updates.
Fix cross building glib with meson for 32 bit Windows, set cpu_family
correctly in the cross file.

Do not build ffmpeg for 32 bit Windows because it is not compatible with
Windows XP and it's better to have a smaller 32 bit binary.

Turn off LTO for 32 bit Windows because it is now broken too, in a
different way than for 64 bit Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-19 02:57:03 +00:00
ZachBacon b57bd76e3a
Added snapcraft store page.
This allows linux users that use snapd and for distro's like ubuntu that do not have vba-m in their repo's to install it to their system without having to compile their own releases.
2019-12-18 19:00:09 -05:00
Rafael Kitover 939a88ab4a
cmake: No default ffmpeg on 32 bit Windows.
Only check for ffmpeg if it's not explicitly turned off and the target
is not 32 bit Windows.

This is done because Windows XP does not have bcrypt.dll which ffmpeg
requires and the 32 bit builds are more likely to be used on older
systems which would also benefit from the smaller binary size.

Also add the X86 and X64 cmake architecture variable flags.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-18 14:17:20 +00:00
Rafael Kitover 4e00fa605b
cmake: Make wrong vcpkg arch error more clear.
Followup on 49ca52ba.

Improve the code that shows a fatal error if the vcpkg target
architecture does not match the build environment, by showing both the
target architecture and the build environment architecture.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-16 00:56:10 +00:00
Rafael Kitover 49ca52ba03
cmake: Visual Studio misc followup on cf9a88df.
Fix the vcpkg root setting, which was trying to use CMAKE_PROJECT_DIR
before a project is defined by switching back to CMAKE_SOURCE_DIR. Also
check if the user has \vcpkg or c:\vcpkg and use those if found. Use
\vcpkg if ENV{CI} is set, e.g. on Appveyor.

Enable nasm for visual studio builds by using the nuget nasm2 package.

In Architecture.cmake check that the vcpkg arch matches the compiler
arch, and throw a fatal error otherwise.

When using GLOB to find the nuget package directory, use the package
name as the prefix, this is quite necessary when using multiple nuget
packages.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-15 19:34:18 +00:00
Rafael Kitover b3932e4e3d
cmake: Fix localization for Visual Studio.
Default to ENABLE_NLS=ON for vcpkg builds too.

Check for libintl under both the names "intl" and "libintl", likewise
for libiconv. The vcpkg versions have the "lib" prefix.

Use the Gettext.Tools package from NuGet for the tools to build the
translation files. vcpkg does not yet have gettext-tools.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-12 19:01:58 +00:00
Rafael Kitover 3aefcf64c9
cmake: Add ffmpeg to appveyor vcpkg cache.
Now that the initial vcpkg cache has been populated in appveyor, we can
build ffmpeg to add to it without going over the job limit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-12 14:10:36 +00:00
Rafael Kitover d0d087511f
MSVC: Fix SDL binary assertion failure on start.
sdlReadDesktopVideoMode() was apparently being called when the window
pointer is NULL.

Wrap the code in an `if (window) { ... }`.

SDL binary now launches correctly.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-10 23:41:40 +00:00
Rafael Kitover cf9a88dfc3
cmake: Visual Studio support improvements.
Add support for vcpkg ffmpeg, this requires using someone's
FindFFmpeg.cmake instead of relying on pkg-config, since vcpkg does not
have pkg-config.

Do not use the ffmpeg from vcpkg on appveyor however, because that
pushes the build cache generation over the time limit for jobs.

Add secur32 and bcrypt to the list of ffmpeg libs on windows, these are
standard windows libraries.

Change some code in ffmpeg.cpp to remove C-style casts of struct
initializers, which are illegal in MSVC.

Add the INT64_C and UINT64_C macros missing in MSVC's stdint.h (if not
defined) to ffmpeg.h before the ffmpeg headers are included, because
they rely on them.

Rewrite the wxWidgets finding code for the vcpkg wxWidgets to be nicer
and work correctly for debug and static builds.

Remove all /W* and /w* warnings options from cmake compiler flags, and
replace them with /W4 for debug builds, and /w (no warnings) for release
modes.

When building a static binary, remove all /MD* flags from cmake compiler
flags, and use /MT for static release builds and /MTd for static debug
builds.

Improve the vcpkg toolchain wrapper to only rebuild the vcpkg binary if
there were git updates.

Redo the handling of SDL2 and SDL_main. Only link SDL2Main to the SDL
binary and don't use the definitions.

Update CMakeSettings.json to use Ninja and include static
configurations.

Use CMAKE_PROJECT_DIR instead of CMAKE_SOURCE_DIR to determine the vcpkg
root, as CMAKE_SOURCE_DIR is sometimes set incorrectly in the 2017 GUI.

Add /nodefaultlib:libcmt to the debug build link flags, as in debug
builds libcmtd is used and libcmt should not be.

Add /subsystem:console to debug build link flags to produce a windows
console app for debug builds, like we do for mingw builds. To do this,
define a WIN32_CONSOLE_APP macro and if set, define a main() that calls
WinMain().

Call wxMesdsageOutput::Set() in OnInit with an instance of
wxMessageOutputStderr for windows debug builds to make sure the --help
text etc. goes to the console instead of a popup box.

Update the Visual Studio related text in README.md.

Fix dynamic debug builds by linking to the debug version of SDL2 and
copying the debug version of the dll to the build dir.

Fix issue in MainFrame::BindAppIcon with the function we are using not
being found in a Windows DLL in debug builds by using
wxDynamicLibrary::GetSymboolAorW() instead of GetSymbol().

Enable LTO for MSVC in Release modes, if the option is set.

Change appveyor config to use an 8 item build matrix of
x64/x86 / Release/Debug / Static/Dynamic. And test the binary in debug
modes by running --help.

When copying the wxrc.exe out of the build tree, copy both the release
and debug versions, this is so that appveyor caching of vcpkg works,
since the build trees are not cached.

Add some necessary win32 libraries to the SDL binary. And enable
building it on appveyor.

Fix #465.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-10 11:13:58 +00:00
Rafael Kitover d183245bdd
builder: Link setupapi always, update libpng.
On Windows always link setupapi with SDL2, the find_library() call with
SetupAPI was failing on mingw because of case.

Update libpng 1.6.32 -> 1.6.37.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-08 15:28:03 +00:00
Rafael Kitover 2b34983b9f
cmake: Support VS Ninja/jom builds on Windows.
Only set CMAKE_GENERATOR_PLATFORM to "x64" for 64 bit toolchains for any
of the "Visual Studio" generators, which use msbuild.

For other generators such as Ninja or NMake (jom) set
CMAKE_C[XX]_COMPILER to "cl" to let cmake find the compiler in the
user's PATH and set up the toolchain appropriately. On the user's part,
all that is required is running the 64 bit dev tools command prompt, or
setting up the equivalent environment in powershell.

We are no longer restricted to msbuild, and other generators such as
Ninja will work correctly.

Switch the appveyor job to Ninja, this requires some wrangling because
the appveyor environment does not include ninja. I used this:

https://github.com/boostorg/hana/blob/master/.appveyor.yml

Also update the README.md instructions to use Ninja.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-07 17:39:19 +00:00
Rafael Kitover 1ccc377978
Improve joystick connection/disconnection.
Followup on 02520fb6.

Add ConnectController() and DisconnectController() protected methods in
wxSDLJoy, use them to open or close and clear the device pointer
properly.

For controller add/remap events, call DisconnectController() first
before ConnectController() to make sure the right device is associated.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-05 17:00:05 +00:00
Rafael Kitover d395e05d97
builder: Limit ninja jobs on Windows.
On Windows (msys2) ninja may fail to work with -j 64 because it runs out
of open handles.

Limit jobs for ninja to 32 on Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-05 14:09:45 +00:00
Rafael Kitover 6c2850cd59
Merge remote-tracking branch 'vbam-libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-04 01:59:38 +00:00
Rafael Kitover 212e45cc8d
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-03 20:24:46 +00:00
Rafael Kitover 498e4e858d
Windows joystick events fix.
Followup on 02520fb6.

Versions of wxWidgets after 3.0 change the windows event loop in such a
way that using QueueEvent for joystick events no longer works, use
ProcessEvent instead. This has no effect on latency since the joystick
events only cause the emulator controller state to be updated.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-03 20:09:56 +00:00
Rafael Kitover 198e2467dd
cmake: Add vcpkg update and upgrade.
In the vcpkg module, call vcpkg update to update the portfiles and vcpkg
upgrade to upgrade any installed ports to make sure we are using the
latest versions.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-03 18:59:42 +00:00
hizzlekizzle 2622db116c
Merge pull request #82 from negativeExponent/fix_window
Allow game window to resize on-the-fly when enabling/disabling borders
2019-12-02 13:26:45 -06:00
negativeExponent 72d0725bac Allow game window to resize on-the-fly when enabling/disabling borders 2019-12-02 22:23:07 +08:00
Rafael Kitover b917933013
builder: Fix mingw cross build.
Add meson to core deps because glib requires it to build, and python is
much further in the dependency chain to build meson early enough.

Override the meson command to write and use a cross file for mingw cross
builds.

Add -DFFI_STATIC_BUILD to CPPFLAGS for glib.

Fix --env for the linux mingw cross script.

Add dist make args to the make install invocation.

Add --extra-libs=-liconv to ffmpeg ./configure invocation.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-01 22:07:41 +00:00
Rafael Kitover b8310538a3
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-01 00:37:42 +00:00
Rafael Kitover 24f13ef00f
Merge remote-tracking branch 'vbam-libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-01 00:35:05 +00:00
Twinaphex 5d28c5ad39
Merge pull request #78 from webgeek1234/master
libretro: allow mingw cross compile
2019-11-29 18:54:35 +01:00
Rafael Kitover 95b9e413f7
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-29 04:41:21 +00:00
Rafael Kitover e04efa76b3
Release game controller device correctly. #568
A followup on 02520fb6.

In wxSDLJoy::Remove(n), which is the only API that needs to release a
game controller device from the application, actually call
SDL_GameControllerClose(dev) when a device is released.

This is used when the input config dialog is launched. First all sticks
are closed, and then all available sticks are added for the duration of
the dialog. Then they are closed again, and only the configured sticks
are open for the game, which is what happens generally.

The device ordering is determined by the OS.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-29 03:50:24 +00:00
Rafael Kitover 85abf97a21
Transifex pull.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-27 23:14:27 +00:00
Rafael Kitover 02520fb63e Joystick handling refactor.
Use the SDL GameController API with SDL events instead of polling
manually. Run SDL_PollEvent() in the panel OnIdle().

The API to the GUI remains the same, the sending of wxSDLJoyEvent
events. Except there are no more hat events, we just use the
GameController buttons. Also the GUI now has to make arrangements for
wxSDLJoy::Poll() to be called periodically, for the config dialog this
is done with a timer.

All Xbox 360 controller buttons and axes are now in the defaults, and
the SDL GameController API will map them to the appropriate keys on
other controllers.

As a consequence of using SDL events, controller attach/detach from the
system is now also handled correctly. It is no longer necessary to have
the controller attached and turned on when the program launches.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-27 23:09:35 +00:00
Rafael Kitover d458e75ca6
builder: mingw/msys2 updates.
- Update to new version of icu and patches.

- Update to newer meson based glib.

- Support meson-installed dists.

- On msys2 use the distro ninja to build ninja, because there is some
  kind of issue with building on windows now.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-26 14:31:20 +00:00
Rafael Kitover ae7349b06f
cmake: Use list var VBAM_LIBS for link libs.
Accumulate link libraries for wxvbam in the VBAM_LIBS list variable
instead of listing every possible library variable in the
target_link_libraries() call.

This fixes the issue with trying to use OPENAL_LIBRARIES when it's set
to NOTFOUND which generates a cmake error.

Fix #563.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-13 02:56:06 +00:00
Rafael Kitover 1e56cbfcb3
travis: Add minimal build.
Test building on xenial with:

./installdeps --no-openal --no-ffmpeg

Will also need to add --no-sfml to this.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-13 01:46:02 +00:00
Rafael Kitover ed14c7bc76
installdeps: Add --no-openal and --no-ffmpeg #563.
Add support for the --no-openal and --no-ffmpeg command line options to
installdeps.

Implement them fully or partially depending on the code for that
distribution.

This will help with adding this variant of the build to the travis CI.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-13 01:34:46 +00:00
Rafael Kitover f3282ef0a9
installdeps: debian: detect gtk3 version of wxgtk
Detect and prefer the -gtk3 variants of the libwxgtk3.0 packages on
distros like kali-rolling.

Tested to work on newest kali-rolling and trusty.

Fix #564.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-12 18:45:43 +00:00
Rafael Kitover bd7f38ece7
Update win32 dependencies submodule.
Includes the WinSparkle binary release, for the current work integrating
WinSparkle.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-10 14:37:57 +00:00
Rafael Kitover e35d46254b
WinSparkle wrapper improvements.
- Make WinSparkleDllWrapper a real singleton.

Make the constructor private and add a static `GetInstance()` method
that constructs the single instance and/or returns it.

Make it encapsulate the function pointers and the wxDynamicLibrary
instance, with the API as friend functions.

- Make winsparkle API completely self-contained.

Make the instance of the WinSparkleDllWrapper a factory function local
static.

This way the calling program does not have to manage the life-cycle, the
singleton is initialized when the API is first invoked, and destroyed
during global destruction.

The destructor is now also private, because the singleton object is
destroyed during global destruction.

Found the solution here:

https://stackoverflow.com/a/46139631/262458

- Cmake improvements.

Only enable the ENABLE_ONLINEUPDATES option by default if we are going
to use winsparkle on 32 or 64 bit intel windows.

Do not inlclude winsparkle if the option is off.

- Disable for now.

Currently ENABLE_ONLINEUPDATES defaults to OFF even on intel/windows,
until we do more work on this feature.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-09 23:44:23 +00:00
Edênis Freindorfer Azevedo 76803caf5f
[Windows] Enable winsparkle update checker.
Remove traces of previous update checker.

We use version 0.6.0 available here:

https://github.com/vslavik/winsparkle/releases

We only support on Windows at the moment using `winspakrle`. So remove
this item for other platforms or when disabled in compilation.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-09 22:47:34 +00:00
ZachBacon 3f39bcd04f
Finally a working snapcraft yaml file with confinement enabled.
Tasks that need to be done
- Enable ffmpeg
- Fix icon location
- Enter testing phase before going onto the snap store.
2019-11-08 04:36:04 -05:00
Edênis Freindorfer Azevedo 225e4dc954 Remove top border black line when using filters.
We don't want to display the top border when using filters, since it
is a single line with black pixels.

- Fix #561.
2019-11-07 17:52:18 +00:00
Rafael Kitover 4352504385
Windows: load WinSparkle.dll as a resource
Add cmake glue and necessary code to load WinSparkle.dll as a binary
resource that gets written out to a temp file and loaded with
wxDynamicLibrary.

Object lifetime of the dll wrapper is handled by the app.

The API is the same as the winsparkle API, the only change required is
changing:

`#include <winsparkle.h>`

to:

`#include "winsparkle-wrapper.h"`

and handle the lifetime of a WinSparkleDllWrapper object.

On destruction the temp file is removed.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-06 12:04:29 +00:00
Rafael Kitover 74dc86f77e
update win32 dependencies submodule
Backing off the winsparkle-static approach for now because it will
require a substantial amount of work to use winsparkle from a static
binary that also uses wxWidgets.

Will try to pack the dll in as a resource, and write it out to a temp
file at runtime and load it with wxDynamicLibrary. This will require a
wrapper for the API as well, which is fortunately very small.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-06 07:28:25 +00:00
Rafael Kitover 3fe383c2b5
Update win32 dependencies git submodule.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-04 00:59:02 +00:00
Rafael Kitover d999544a3d
update win32 dependencies submodule
To add winsparkle-static.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-03 01:58:15 +00:00
Rafael Kitover e113508593
installdeps: fix git submodule update
Add `--init`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-03 00:24:18 +00:00
Rafael Kitover b757048203
transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-03 00:21:44 +00:00
Rafael Kitover 8c14138782
transifex pull, delete en.po
Update `de.po` from transifex and delete `en.po` as it seems to not be
managed by transifex.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-23 16:46:43 +00:00
Rafael Kitover d0d22b3068
cmake: copy wxrc from vcpkg build if not exists
Do not copy the `wxrc.exe` from the vcpkg build tree if it has already
been copied, as in the case of the appveyor vcpkg installed cache.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-21 14:19:56 +00:00
Rafael Kitover c06e3bf3fc
cmake: update vcpkg mod for appveyor build cache
On appveyor we only cache the `vcpkg/installed` directory, so vcpkg
itself still needs to be pulled from git.

Also update vcpkg from git if it has already been cloned, and always
rebuild vcpkg itself.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-21 13:58:55 +00:00
mudlord 0535d5c797 Optimize CRC32. 2019-10-21 13:25:19 +00:00
Rafael Kitover a90f4663a5
transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-20 08:16:36 +00:00
Rafael Kitover b8f2c8977e
appveyor: use vcpkg installed not whole vcpkg
Try to cache only the `vcpkg/installed` directory instead of the whole
vcpkg directory, which appveyor says is too large to cache.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-18 01:28:09 +00:00
Rafael Kitover 252d3f65ab installdeps: detect correct mxe apt repo
Try to guess the correct mxe apt package repository based on
`lsb_release` codename.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-17 22:25:56 +00:00
orbea 7f6337b1c7 travis: Make xenial the main distribution.
The end of standard support for trusty ended in April 2019 and
the end of life is April 2022. For xenial the end of standard
support is April 2021 and the end of life is April 2024.

Most users should have xenial or newer at this point.

Source: https://wiki.ubuntu.com/Releases
2019-10-17 22:24:45 +00:00
orbea 73a2450247 travis: Test --help on osx. 2019-10-17 22:23:50 +00:00
Rafael Kitover 36790074c3
cmake: fix linking to libssp and linking bin2c
Only add the macro `-D_FORTIFY_SOURCE=2` if we are linking to libssp
with gcc, do not use it at all on clang.

For `HostCompile.cmake` add the macro `-Dmain=main` to redefine the
macro added by SDL2 to compile flags `-Dmain=SDL_main`.

Fix #548.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-17 21:53:15 +00:00
orbea eaa744cc2e cmake: Add generate as a vbamcore dependency.
Fixes https://github.com/visualboyadvance-m/visualboyadvance-m/issues/542.
2019-10-11 07:02:38 -07:00
orbea 2d783f5df8 cmake: Fix ENABLE_ASAN with clang.
Only -fsanitize=address is needed for asan to work with both
gcc and clang.

[170/196] Building CXX object CMakeFiles/vbamcore.dir/src/Util.cpp.o
clang-9: warning: -lasan: 'linker' input unused [-Wunused-command-line-argument]
[171/196] Linking CXX static library libvbamcore.a
[172/196] Generating cmdtab.cpp, cmdhandlers.h, cmd-evtable.h
[173/196] Generating wxvbam.xrs
[174/196] Generating builtin-xrc.h
samu: job failed: cd /tmp/visualboyadvance-m/build/src/wx && /tmp/visualboyadvance-m/build/bin2c wxvbam.xrs builtin-xrc.h builtin_xrs
==4845==Your application is linked against incompatible ASan runtimes.
samu: subcommand failed
2019-10-10 02:49:07 -07:00
orbea 65c908141c wx: Fix conditional jump on uninitialized value with valgrind.
==15788== Conditional jump or move depends on uninitialised value(s)
==15788==    at 0x5143A2: wxvbamApp::~wxvbamApp() (wxvbam.cpp:682)
==15788==    by 0x5144BB: wxvbamApp::~wxvbamApp() (wxvbam.cpp:676)
==15788==    by 0x739CD22: wxEntryCleanup() (in /usr/lib64/libwx_baseu-3.0.so.0.4.0)
==15788==    by 0x739D02B: wxUninitialize() (in /usr/lib64/libwx_baseu-3.0.so.0.4.0)
==15788==    by 0x739CE39: wxEntry(int&, wchar_t**) (in /usr/lib64/libwx_baseu-3.0.so.0.4.0)
==15788==    by 0x50BD42: main (wxvbam.cpp:32)

v2: Initialize overrides as a nullptr.
2019-10-10 02:47:43 -07:00
orbea 6adf5ea487 wx: Silence -Woverloaded-virtual warnings with debug builds.
The Clone function seem unused, the AcceptsFocus and HasFocus
functions are marked as const and Show is renamed to ShowAddr
to not conflict with unrelated functions.

[187/196] Building CXX object src/wx/CMakeFiles/visualboyadvance-m.dir/viewsupt.cpp.o
In file included from ../src/wx/viewsupt.cpp:1:
../src/wx/viewsupt.h:197:10: warning: 'Viewers::MemView::Show' hides overloaded virtual function [-Woverloaded-virtual]
    void Show(uint32_t addr, bool force_update = false);
         ^
/usr/include/wx-3.0/wx/gtk/window.h:64:18: note: hidden overloaded virtual function 'wxWindow::Show' declared here: different number of parameters (1 vs 2)
    virtual bool Show( bool show = true );
                 ^
In file included from ../src/wx/viewsupt.cpp:1:
../src/wx/viewsupt.h:410:10: warning: 'Viewers::DispCheckBox::AcceptsFocus' hides overloaded virtual function [-Woverloaded-virtual]
    bool AcceptsFocus()
         ^
/usr/include/wx-3.0/wx/window.h:724:18: note: hidden overloaded virtual function 'wxWindowBase::AcceptsFocus' declared here: different qualifiers ('const' vs unqualified)
    virtual bool AcceptsFocus() const { return true; }
                 ^
In file included from ../src/wx/viewsupt.cpp:3:
In file included from ../src/wx/wxvbam.h:14:
In file included from ../src/wx/widgets/wx/joyedit.h:9:
../src/wx/widgets/wx/sdljoy.h:115:14: warning: 'wxSDLJoyEvent::Clone' hides overloaded virtual function [-Woverloaded-virtual]
    wxEvent* Clone();
             ^
/usr/include/wx-3.0/wx/event.h:1569:22: note: hidden overloaded virtual function 'wxCommandEvent::Clone' declared here: different qualifiers ('const' vs unqualified)
    virtual wxEvent *Clone() const { return new wxCommandEvent(*this); }
                     ^
In file included from ../src/wx/viewsupt.cpp:3:
../src/wx/wxvbam.h:286:10: warning: 'MainFrame::HasFocus' hides overloaded virtual function [-Woverloaded-virtual]
    bool HasFocus()
         ^
/usr/include/wx-3.0/wx/window.h:715:18: note: hidden overloaded virtual function 'wxWindowBase::HasFocus' declared here: different qualifiers ('const' vs unqualified)
    virtual bool HasFocus() const;
                 ^
4 warnings generated.
2019-10-09 10:32:51 -07:00
orbea 84d24b7d71 cmake: Silence _FORTIFY_SOURCE warnings with debug builds.
[79/196] Building CXX object fex/CMakeFiles/fex.dir/fex/Zlib_Inflater.cpp.o
In file included from ../fex/fex/Zlib_Inflater.cpp:3:
In file included from ../fex/fex/Zlib_Inflater.h:7:
In file included from ../fex/fex/Data_Reader.h:7:
In file included from ../fex/fex/blargg_common.h:8:
In file included from /usr/include/assert.h:35:
/usr/include/features.h:382:4: warning: _FORTIFY_SOURCE requires compiling with optimization (-O) [-W#warnings]
   ^
1 warning generated.
2019-10-09 08:48:20 -07:00
orbea 675072f025 travis: Test xvfb on xenial and bionic. 2019-10-08 13:27:35 -07:00
orbea 4e9882f24d cmake: Don't install visualboyadvance-m twice on WIN32. 2019-10-08 13:23:44 -07:00
orbea 518c147281 cmake: Use an install target for visualboyadvance-m. 2019-10-07 17:36:27 -07:00
orbea 369da07e7f travis: Test make install. 2019-10-07 17:36:27 -07:00
orbea 3111de5205 travis: Test clang builds. 2019-10-07 11:52:40 -07:00
orbea 6cc00a09fe travis: Clean up. 2019-10-07 11:51:07 -07:00
orbea 65fceab75a travis: Refactor script. 2019-10-07 04:47:57 -07:00
orbea abff89e4fb cmake: Use add_executable when not cross-compiling. 2019-10-07 04:46:20 -07:00
Rafael Kitover 61520df789
Add @orbea to About -> Contributors.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-06 23:48:13 +00:00
Rafael Kitover 7ee3cbe120
Joystick rumble followup. #522
Call `rtcEnableRumble(true);` always regardless of the `rtcEnabled`
option, because @negativeExponent points out that they are unrelated.

Check for at least SDL version `2.0.9` before using the
`SDL_JoystickRumble()` API, since it is not present in earlier versions.

Increase rumble duration to twice the poll time to keep the motors
running, subsequent poll events will cancel the rumble as necessary.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-06 17:42:12 +00:00
Rafael Kitover 4bc9bb84b4
Implement joystick rumble. #522
Call `rtcEnableRumble()` in the core if the rtc is enabled during ROM
loading.

On `systemCartridgeRumble(bool)` events from the core, set the state in
`wxSDLJoy` accordingly, to either rumbling or not rumbling based on the
boolean parameter.

On the `50ms` joystick poll events, use `SDL_JoystickRumble()` to enable
rumble on both the low and high frequencies at maximum for the poll time
of `50ms`, to be set or reset again on the next poll event.

Tested in Drill Dozer, rumbling is being activated. Will need testing
from users as well to see if this is implemented correctly.

Fix #522.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-06 11:06:08 +00:00
Rafael Kitover 5b809e3ad1
Drop reference to ubuntu PPA from README.md
The packages in this PPA are completely out of date, even the
dependencies are out of date.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-06 06:06:13 +00:00
orbea 680af6d420 cmake: Silence cmake policy warning CMP0058.
See: cmake --help-policy CMP0058
2019-10-05 18:33:44 -07:00
Rafael Kitover ec7d1b15b1
cmake: fix reading version from changelog
Fix version regex to allow version numbers without text and revision.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-05 20:32:46 +00:00
Rafael Kitover 699d0c3724
Add denisfa to about -> contributors.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-05 19:35:15 +00:00
Edênis Freindorfer Azevedo 384f448757 Fix key accel overriding menus and dialogs.
All keys were being captured before being processed by any window of the
app to check for accelerators. This meant being impossible to use any
keys for input if they were saved for an accel.

- Fix #516.
2019-10-05 12:30:49 -07:00
Rafael Kitover 6468d04114
appveyor: cache vcpkg build deps
Will hopefully make the build much faster.

TODO: make the vcpkg cmake script update vcpkg.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-04 14:01:43 +00:00
Rafael Kitover 3e22d17fb2
fix Visual Studio build
The change to use an extern version variable in 24d83a12 produces a
linker error with Visual Studio due to the `version.c` source file being
compiled as C instead of C++.

Rename:

`version.c`   -> `version.cpp`
`version_c.h` -> `version_cpp.h`

And update all references accordingly.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-04 13:20:10 +00:00
Rafael Kitover 24d83a1262
make recompile for vers/git state change minimal
Make a `version.c` with `const char*` variables to store the version
strings used by other files, to make recompiles slightly faster when the
git state changes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-04 08:14:22 +00:00
Rafael Kitover af0de1c4b3
xbrz: fix inline asm check
Use correct cpp code to detect x86/amd64 architecture to use inline asm.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-04 07:35:49 +00:00
Rafael Kitover e811070d01
transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-04 07:22:44 +00:00
Ar't ced2676926
win: set correct version in rc
xvbam.rc: use version.h to generate version strings,
cmake: adding version in odd format required by rc
2019-10-04 07:13:20 +00:00
Rafael Kitover 09fbcbac07
release v2.1.4
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-02 14:17:30 +00:00
Rafael Kitover c93e017d3a
builder: minor changes to support mac 32 bit
Pass `CC="$CC $CFLAGS"` to `make` for `libgsm`, so that the `-m32` is
passed for 32 bit builds.

For `mac_install_core_deps()` make sure brew is installed and install
brew perl, otherwise perl extensions cannot be built on Mojave for 32
bit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-28 14:29:40 -07:00
Rafael Kitover c1636d1bcf
builder: fixes for ffmpeg + misc.
Use git master for `graphite2` and a better cmake patch, with these
`DIST_ARGS`:

```
-DGRAPHITE2_NFILEFACE=ON -DGRAPHITE2_TESTS=OFF -DGRAPHITE2_DOCS=OFF
```

Use `DIST_CONFIGURE_OVERRIDES` instead of `DIST_ARGS` for `libvpx` and
`ffmpeg` because their configure scripts error on the `--sysconfdir`
arg.

Change all other references to `libvpx` and `ffmpeg` `DIST_ARGS` to use
`DIST_CONFIGURE_OVERRIDES` instead.

Add `-j1` to `xvidcore` `MAKE_ARGS` because it sometimes fails parallel
builds.

Change the `mkdir` commands to `mkdir -p` in `mingw.sh` because
`core.sh` now also makes those directories.

In `mingw.sh` for `libvpx` extra `CFLAGS`, add `-mstackrealign` for 32
bit builds and `-fno-asynchronous-unwind-tables` for 64 bit builds. The
latter is necessary to build, taken from the msys2 `libvpx` mingw
package.

Also add the `stdint.h` `-include` option to `CFLAGS` for libtheora and
ffmpeg because they use the `libogg` headers.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-28 19:07:44 +00:00
ZachBacon aec23e3586 builder: re-enable ffmpeg, update dists
Update the following dists:

bzip2, xz, libiconv, gettext, ninja, meson, libgcrypt, libsecret, sdl2,
flac, libogg, libvorbis, wxwidgets

and the following ffmpeg deps:

graphite2, xvidcore, libgsm, opus, libsoxr, libass, libbluray, libvpx,
libx264, libx265

Enable ffmpeg for vbam again as we now have working recording code
thanks to @denisfa.

Disable graphviz and libzvbi for the time being since we don't really
need them.

For mp3lame use the msys2 patch to remove posix code instead of linking
to catgets.

For libogg and libvorbis on mac, add `-include /path/to/stdint.h` to
`CFLAGS` when building.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-28 01:10:04 -07:00
Edênis Freindorfer Azevedo 806dd7daa6 Fix circular `--config` for SDL port.
When using the command line options, we had a circular issue:
- using `LoadConfig()` before `ReadOpts()` would mean the `--config` is
ignored.
- using `ReadOpts()` before `LoadConfig()` would mean the command line
options were ignored in favor of the default ones.

If we want to use a custom `vbam.ini`, we need to load it with
`--config`. Now we only consider params order on command line.
2019-09-25 20:59:37 -01:00
Edênis Freindorfer Azevedo 1aa8afb4dc Drop dead code entirely.
All this code protected by `#if 0` is implemented already one way or
another. Hence the decision to remove it, instead of commenting.

This also removes the need of the branch `arthur/sdl2`.
2019-09-25 20:59:37 -01:00
Edênis Freindorfer Azevedo 531172c4be Fix displaying of link menu when `ENABLE_LINK=NO`.
We disable the items, but not the menu. So, there was an empty list
on `Options` > `Link` > `Type`.
2019-09-16 21:36:44 -01:00
Edênis Freindorfer Azevedo 07107096b8 [Windows] Fix crash when setting weekly updates.
It happens due to our wxRadioButtons having 3 options (indexed by 0, 1
and 2) but we trying to get the index 7 (due to want to check every 7
days).

We should still implement something like WinSparkle for Windows.

- Fix #499.
2019-09-16 21:36:44 -01:00
Edênis Freindorfer Azevedo efa09bdb07 Add faster sqrt code for xBRZ filters.
We use ASM code for Windows `x86` and Linux desktop. The others remains
the same.
2019-09-16 21:36:44 -01:00
Edênis Freindorfer Azevedo 10f5576ecf Fix config file when removing system accels.
We assign the `NOOP` id for every command disabled by the user, but not
the command name (just `NOOP`). When updating the configuration file,
any command with `NOOP` id is valid, even if the label does not match
`NOOP`. Hence this weird issue.

- Fix #502.
2019-09-16 21:36:44 -01:00
Edênis Freindorfer Azevedo 1c6b016853 [Windows] Fix remaining UTF-8 issues.
We were missing some `wxConvLibc` on the output code. This meant crappy
messages on windows.
2019-09-16 21:36:44 -01:00
Rafael Kitover a2f3126e17
transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-14 22:22:00 +00:00
Rafael Kitover 1e9d167597
builder: pause before codesigning for win targets
Pause before `pass` asks for the `gpg` passphrase to retrieve the
password to unlock the windows codesigning certificate.

This is so that the user does not have `gpg` time out waiting for the
passphrase.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-14 21:46:01 +00:00
Rafael Kitover 0af5965ee1
builder: work on linux static binary
Merging some work I was doing on trying to make a working mostly static
linux binary a year ago, with some additional minor refactoring.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-12 16:42:43 +00:00
Rafael Kitover 33c43e3ad4
add -p:BuildInParallel=true to appveyor.yml
Hopefully this will speed up the appveyor builds at least a little bit.

We really need to switch to ninja at some point though.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-12 16:02:06 +00:00
Rafael Kitover 61141ebd3a
add -p:BuildInParallel=true to VS instructions
Add `-p:BuildInParallel=true` to the Visual Studio instructions for
`msbuild`, to build subprojects in parallel, without which the `-m`
option has no effect, both must be used.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-12 03:12:15 +00:00
Rafael Kitover 9ee6b54a68
cmake: remove invalid opt /std:c++11 for MSVC
Visual Studio 2017 only allows `/std:c++14` and higher, so remove the
`/std:c++11` option, we'll take the default of C++14 standard.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-12 03:04:20 +00:00
Rafael Kitover 0f2c8cab08
win: check APPDATA if LOCALAPPDATA is not found
Check for the APPDATA environment variable if there is no LOCALAPPDATA
environment variable for things like reading the config file.

Fix #407.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-12 03:01:16 +00:00
Rafael Kitover 32fbfec46c
transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-10 23:26:00 +00:00
Edênis Freindorfer Azevedo cc51622928 transifex push/pull
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
2019-09-10 07:59:56 +00:00
Edênis Freindorfer Azevedo 528c37f9e0 Allow "Browse" to be translated.
wxWidgets fails to translate some internal strings due to locale issues.

It is not clear how the current locale is detected, but it fails for
cases when the system is different from the set by the user. Eg: the
system is using `en_US`, but the user sets `LANG=pt_BR.utf8` for an
application. Some internal strings are translated because of `LANG`,
while others remain the same because `en_US`.
2019-09-10 07:59:56 +00:00
Edênis Freindorfer Azevedo d8c981fb42 Fix toggles for video/audio layer options on menu.
We could not use key shortcuts for this, since it was only checking if
the option was activated on menu. This only happens if you open the
menu and click it, so the key shortcut does not work.
2019-09-10 07:59:56 +00:00
Edênis Freindorfer Azevedo c0f96425e6 Show all commands available on menu.
We move from `Other commands` to several places of our main menu. This
way we allow texts to be translated and easier view of them for users.
2019-09-10 07:59:56 +00:00
Edênis Freindorfer Azevedo 51fa150f1c Adjust MMX menu variable and position.
It should only appear on `x86`.
2019-09-10 07:59:56 +00:00
Edênis Freindorfer Azevedo 27b038b378 Show messages about operations of state slot. 2019-09-10 07:59:56 +00:00
Edênis Freindorfer Azevedo 2e24845711 Allow translation of the words `Open` and `Quit`. 2019-09-10 07:59:56 +00:00
Edênis Freindorfer Azevedo 54991c5b14 Add extra keys default input when using GUI.
We also set the extra keys for controller input when using `defaults`
option.
2019-09-10 07:59:56 +00:00
Rafael Kitover b358c051c9 Fix compilation issue when `ENABLE_DEBUGGER=Off`.
We protect all code relevant to disabling this property with either
`BKPT_SUPPORT` or `NO_DEBUGGER`. This is mostly debugging options or
prints scattered around the code.

We also adjust cmake to ignore the specific files surround it, but
allowing the rest of the GUI to work.

- Fix #431.
2019-09-04 14:31:11 +00:00
Rafael Kitover 2a2be95397
builder: msys2 fixes
For cmake, the dependency on `bin2c` when using `HostCompile.cmake` does
not work if it's set to `bin2c.exe`, for whatever reason, so remove the
suffix.

Add `-DCURL_STATICLIB` to `CPPFLAGS` etc. to link to `libcurl`
correctly, needed for `osslsigncode`.

Add `--without-brotli` to curl configure args, because it can try to
link to some existing version and fail.

Add a `gmake` symlink to the system `make` into the `PATH` because some
things like Strawberry Perl install their own copy of `gmake` into the
`PATH`.

Add `pass` to list of msys2 deps, needed to store the windows
codesigning cert password.

Use `$CMAKE_ARGS` instead of `$CMAKE_BASE_ARGS` for building vbam,
adding `-DCMAKE_INSTALL_PREFIX=/usr`, this is necessary for extracting
the locales correctly.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-03 00:14:37 +00:00
Edênis Freindorfer Azevedo f1438e0f0a Check ASAN support when `ENABLE_ASAN=ON`.
We check if the compiler has asan support when the option is enabled.
If it does not, then we stop compiling with the proper message.

To test this, we use `gcc (GCC) 4.4.7` (no asan support) and
`gcc (GCC) 9.1.0` (asan is supported). Call cmake like this:

`cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=On` and
`CXX=g++-4.4 cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=On`

we then check that it fails for the older version and it works for
the newer gcc, like expected.

- Fix #409.
2019-09-02 20:52:08 +00:00
Rafael Kitover ade64db7a6
transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-01 20:42:30 +00:00
Rafael Kitover 8b3470507d
cmake: check for ffmpeg >= 4.0.4
Check for the specific `ffmpeg` lib versions in `ffmpeg` `4.0.4` "Wu",

Do not pass `-DENABLE_FFMPEG=OFF` to the xenial travis job, as this is
detected automatically now.

Add a note about the required ffmpeg version to `README.md`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-01 20:37:39 +00:00
Rafael Kitover 0b9c771027
travis: more ubuntu dists, fix mac cache
Include xenial and bionic in the travis build matrix, alongside trusty.

In `installdeps` check for the existance of `libswresample-dev` before
installing it because trusty does not have it, it uses libav instead of
ffmpeg. For this reason, ffmpeg is not built on trusty.

Turn off the `xvfb-run` test on bionic and xenial because it fails for
some reason.

Use `-DENABLE_FFMPEG=OFF` for xenial because the ffmpeg code currently
fails to compile with that version.

Stop trying to cache `/usr/local` for the mac build, storing the build
archive takes longer than installing the homebrew packages.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-31 23:50:15 +00:00
Rafael Kitover d9e4a0874d
build fixes: ffmpeg, xbrz, travis, C++ version
Fix the cmake ffmpeg detection and make it not print the detection
messages twice.

Add `-D__STDC_FORMAT_MACROS` to compiler flags, some versions of ffmpeg
require this.

Redefine `static_assert(x)` to the `static_assert(x, msg)` form in
`xbrz.cpp`. This is a C++17 feature and some versions of gcc wrongly set
`__cpp_static_assert` even though they do not support it.

Also we want to stick to C++11 for the time being, until there is
consensus to support a newer a version.

For that reason, change the MSVC flag `/std:c++latest` to `/std:c++11`
as well.

Remove `-DENABLE_OPENAL=ON` and `-DENABLE_LINK=ON` from travis config,
as these are now automatic.

In `installdeps` remove the hacks for supporting the `https://` apt url
for mxe and use an `http://` url instead. This works perfectly on Ubuntu
14 (trusty).

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-31 22:58:59 +00:00
Rafael Kitover 23224fbaac
update factory reset instructions in README.md
Replace the Windows instructions for deleting the config file with the
much simpler `Help -> Factory Reset` option, which does the same thing.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-31 16:23:34 +00:00
Rafael Kitover 381a7bfe78
/std:c++latest for MSVC, fix bool flip, warn opts
Use `/std:c++latest` for Visual Studio because the XBRZ 1.7 code
requires at least C++17.

Replace the use of `bool++` in `GBALink.cpp` which is now apparently an
error with `bool = !bool` to flip the value.

Use `/W4` to enable a good amount of warnings in Debug mode, and `/W0`
to disable warnings entirely in release modes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-30 01:57:01 +00:00
Edênis Freindorfer Azevedo 234f1e9b1a Update to xBRZ `1.7`.
Get files from here `https://sourceforge.net/projects/xbrz/files/xBRZ/`.

Then, update the src to handle pitch params. For our case, the pitch
is necessary because we deal with borders (top and right) of our source
image. Normally, we would want to scale without it, and therefore we
need to adjust the pointers to skip the borders.

If we have a `width + 1 pixel border` per line, the we need to scale
a image with `width` line size, but advancing the pointer for each new
line processed including the border on the count.

Also, since our output pointer also allocates for the border, we need
to adjust the output moving pointer for each line in a custom way.
(output border in this case)

- Fix #164.
2019-08-28 22:07:52 +00:00
Rafael Kitover 290012d1a7
transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-21 20:28:47 +00:00
Edênis Freindorfer Azevedo 06a9d786c2 Allow UPS patch for GBA games.
From my very superficial understanding, the `rom[]` resize happens
only when `rom_size` is greater than 0x2000000.

We should probably study this better for an actual explanation.

- Fix #487.
2019-08-21 00:45:46 +00:00
Rafael Kitover 1949cdb37a
transifex push/pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-20 23:24:36 +00:00
Edênis Freindorfer Azevedo 03121c69c0 Add support for autohold buttons.
We implement this in the same way it is being done on `vba-rr`.

- Fix #414.
2019-08-20 23:00:48 +00:00
Edênis Freindorfer Azevedo e87213e369 Fix indentation. 2019-08-20 23:00:48 +00:00
Edênis Freindorfer Azevedo cf47942f09 Fix Autofire {L,R}.
We were using directionals (left and right) instead.
2019-08-20 23:00:48 +00:00
Rafael Kitover 4993cb88dc
remove tea-ci .drone.yml and installer.nsi
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-20 09:24:21 +00:00
Rafael Kitover d9a7e0c964
cmake: auto-detect sfml, ffmpeg and openal
In cmake detect if the dependencies for link (sfml), recording (ffmpeg)
and openal are installed and default the features to `ON` if they are,
otherwise to `OFF`.

This simplifies the cmake usage.

Update the default column in the `README.md` table to `AUTO` as well.

Remove the cmake options from `installdeps` instructions, since they are
auto-detected.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-20 08:21:38 +00:00
Rafael Kitover c64dd259b9
Update README.md
Fix Visual Studio instructions.

Add links for all dependencies.

Fix grammar/omissions etc.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-20 07:31:38 +00:00
Rafael Kitover 8ceef90fc4
fix appveyor visual studio build
See #465

To compile the build tool `bin2c`, add a target with `add_executable()`
on visual studio instead of using `HostCompile.cmake` because running
`cl.exe` fails in the appveyor visual studio environment, see:

https://developercommunity.visualstudio.com/content/problem/325122/c1356-unable-to-find-mspdbcoredll.html

Also update the dependencies module to latest.

appveyor build now tested to work.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-20 06:55:07 +00:00
Rafael Kitover a8b7b72dbd
transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-19 22:16:33 +00:00
Rafael Kitover f5eabb3514
builder: disable LTO on 64 bit mingw
LTO on 64 bit mingw still produces segfaulting binaries.

Turn off LTO for just that platform and leave it enabled for all other
platforms.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-19 17:23:45 -04:00
Edênis Freindorfer Azevedo fc2eb38fcd Fix behaviour of `Tools` > `Memory Viewer` (#486)
We fix the wxWidgets error message when trying to open the dialog
via menu.

The scrollbar behaviour has been enhanced to adjust itself between
200 and 300 rows from GUI (0x6c0 memory to 0xf9ff - GB example).

Clicking on top or bottom line of the memory values now moves 1 row
position backwards and forward, respectively.

Arrow keys also functional for navigation.

* Remove clicking on top/bottom behaviour.
2019-08-19 19:25:47 -01:00
Rafael Kitover 2958af01ca
builder: mingw improvements + misc.
- default ENABLE_NLS to ON except for vcpkg, broken in e2f06210

- update zlib URL

- use openssl 1.1.1c instead of 1.0.2p, parallel build works now!

- add osslsigncode for mingw to codesign windows binaries, and
  automatically sign in `build_project()`

- add curl (for osslsigncode, which needs libcurl)

- use current master for wxwidgets instead of 3.1.2

- make the `translations.zip` in `build_project()` for windows

- on mac, unlock the login keychain before codesigning (this is
necessary if using e.g. ssh.)

- do not fail if the user does not have codesigning or gpg keys

- fix wxwidgets configure options on mac (need to append to
  `DIST_CONFIGURE_OVERRIDES` instead of `DIST_ARGS`.)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-19 13:15:01 -07:00
Rafael Kitover 3923b28fc3
transifex pull/push
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-18 19:01:10 +00:00
Rafael Kitover 51f61a3afb
Merge remote-tracking branch 'vbam-libretro/master' 2019-08-18 18:46:55 +00:00
Aaron Kling a01a2d4dd0 libretro: allow mingw cross compile 2019-08-17 09:17:06 -05:00
Twinaphex 6bdd6d1b22
Merge pull request #77 from negativeExponent/fix_cheat_search
Add missing break; lines for switch statements
2019-08-17 15:01:51 +02:00
Rafael Kitover dc8d36a08c
minor fix for stl wx builds
`XRCID()` expects a `const char *` not a `wxString`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-16 06:08:47 +00:00
Rafael Kitover 51a4f74b94
Merge remote-tracking branch 'vbam-libretro/master' 2019-08-15 18:42:08 +00:00
negativeExponent 9ccdeac3aa Add missing break; lines for switch statements
- As discussed at #cheats on discord, using the search engine will cause RetroArch to crash as
soon as you click on Start or Restart Cheat Search.
- This PR adds the missing break lines for the switch statements that is causing the core to crash
2019-08-15 15:23:58 +08:00
Twinaphex b8afa8c57c
Merge pull request #76 from RobLoach/intl
libretro: Update core options API
2019-08-14 16:18:18 +02:00
Rob Loach a17eb47103
Merge branch 'master' of github.com:fpscan/vbam-libretro into intl 2019-08-14 10:00:20 -04:00
Rob Loach 9b043daadf
libretro: Update core options API 2019-08-14 09:56:39 -04:00
Edênis Freindorfer Azevedo 6b18c1f9b8 Fix warning about frames left in queue.
Example:
- [libmp3lame @ 0x55b9e7248300] 4 frames left in the queue on closing
2019-08-14 08:27:51 -01:00
Edênis Freindorfer Azevedo f5b19475c9 [IDEA] Fix recording when using `speedup/turbo`.
We do not allow to skip frames while recording. The resulting length
will be extended compared to using turbo/speedup modes, because the
recording will be normal time (as in running without turbo/speedup).
2019-08-14 08:27:51 -01:00
Edênis Freindorfer Azevedo 738494a232 Support all sample rate available on GUI.
Before we could only use `44100`. Now we can use all available on GUI
for the supported codecs.
2019-08-14 08:27:51 -01:00
Edênis Freindorfer Azevedo aa3ecaf701 Add new output formats for recording audio/video.
We test each of these additions by trying to record gameplay with them.
Then we play it and check the results. Pretty straightforward.
2019-08-14 08:27:51 -01:00
Edênis Freindorfer Azevedo 5848feaea2 Fix video/audio recording.
We create a namespace to deal with most of our recording solution.

Besides that, we also add some functions to remove the need of
including libavutil headers on other part of the code. This is meant to
isolate most of recording solution components on the proper files.

We will start with a limited number of codecs supported; slowly we
should add them as they are tested (the previous one did not work for
most codecs listed).

This should support `ffmpeg 4.1` and further, including removing
all compilation warnings related to versions discrepancy.
2019-08-14 08:27:51 -01:00
Ömercan Kömür 9e3c26152e Update libretro_core_options.h
option_defs_tr
2019-08-13 11:23:36 +03:00
Ömercan Kömür 6c60ac334b Turkish Language option 2019-08-13 08:50:56 +03:00
hizzlekizzle d92ca688b3
Merge pull request #74 from retro-wertz/update
Fix "index out of bounds" runtime error
2019-08-12 10:23:21 -05:00
retro-wertz ad43b32bdd Fix "index out of bounds" runtime error 2019-08-12 21:56:10 +08:00
hizzlekizzle 36f3a739ed
Merge pull request #73 from retro-wertz/libretro_cleanup
Libretro cleanup and MBC3 RTC update
2019-08-10 08:33:02 -05:00
retro-wertz 82e723a528 MBC3: Update mapper to check if RTC is present before running RTC functions 2019-08-10 19:01:10 +08:00
retro-wertz 03184dd513 libretro: Use GB RTC data when available
- Save GB RTC data using retro_get_memory/size and only init using localtime when its unavailable (check is done in retro_run)
2019-08-10 18:24:32 +08:00
retro-wertz b3744b3bd5 Simplify GB border core option 2019-08-10 01:06:15 +08:00
retro-wertz 9757a880c7 Core options cleanup and a few readability-related updates
changes includes:
- append "options_" to core-related variables
- remove some unnecessary function calls
- change some float data types to double
- set max geometry width/height depending on max values for the system being emulated
- create advanced core options to minimize the number of options shown
- style nits
2019-08-09 22:28:52 +08:00
Edênis Freindorfer Azevedo cfb03d8b3a Set default keybinding when key does not exist.
- Fix #463
2019-08-08 21:31:58 -01:00
Twinaphex 1ef0912691
Merge pull request #72 from retro-wertz/enable_rtc
Allow enabling GBA RTC regardless of rom types
2019-08-07 15:49:16 +02:00
retro-wertz 496b372d3e Allow enabling GBA RTC regardless of rom types
- Add core option to allow RTC to be enabled regardless of rom. This usuable for rom patches that requires the RTC to be enabled yet the RTC flag is not enabled. (aka Pokemon patches)
2019-08-07 20:05:57 +08:00
hizzlekizzle 4dbdf87d0a
Merge pull request #71 from retro-wertz/patch-3
Update Makefile
2019-08-06 18:50:45 -05:00
retro-wertz bb10954466
Update Makefile 2019-08-07 01:55:52 +08:00
hizzlekizzle 3e64044379
Merge pull request #70 from retro-wertz/update_makefiles
Update Makefile
2019-08-06 08:49:25 -05:00
retro-wertz 98313652d6 Update Makefile
- Try to fix osx build
- style nits and cleanup
2019-08-06 19:22:14 +08:00
Twinaphex 34de057969
Merge pull request #67 from retro-wertz/update_makefiles
Update Makefiles
2019-08-06 05:45:32 +02:00
Twinaphex 71e4b7b375
Merge pull request #69 from retro-wertz/master
Cleanup
2019-08-06 05:44:56 +02:00
retro-wertz d9f8396c67 Cleanup 2019-08-06 08:58:04 +08:00
retro-wertz 9a13449782 Update Makefiles
- Updating makefile from vba_next's makefiles, removing any defines that are not available in this core.
- Update Android.mk
2019-08-04 15:37:18 +08:00
ZachBacon 38b7613eb4
Setting up basic appveyor 2019-08-01 23:07:34 -04:00
hizzlekizzle 408cab71e2
Merge pull request #66 from retro-wertz/libretro
Automatically hide some core options depending on rom image type
2019-07-29 13:19:36 -05:00
retro-wertz d898288100 Automatically hide some core options depending on rom image type
- loading gba games will automatically hide gb/gbc only related core options at startup
- loading a gb/gbc game will also hide gba only options...
2019-07-30 00:51:06 +08:00
hizzlekizzle c3edd6d433
Merge pull request #65 from retro-wertz/libretro
retro_get_memory_data/size and memory descriptors update
2019-07-28 17:05:10 -05:00
retro-wertz 2084a63e1f Update GB/GBC memory maps (retro_memory_descriptors) 2019-07-28 21:52:13 +08:00
Twinaphex 90b051eee1
Update libretro_core_options.h 2019-07-28 07:40:43 +02:00
retro-wertz a727e22265 GB: Rename this variable to isolate from a global variable of the same name
- this is a temporary variable and should only affect on this section, and not the global one.
2019-07-27 19:35:58 +08:00
retro-wertz 0d423b98fa Cleanup GB palette struct and update retro_get_memory_data/size
- minor n0n-functional changes
- cleanup gb built-in palette struct
- update retro_get_memory_data/size to directly use related variables for RAM and VRAM
  and fix sizes (GB vs GBC pointers and pointer size) for proper cheat search support.
  You can now access full 32K ram of GBC for example.
2019-07-27 19:15:46 +08:00
retro-wertz bc80ecdb39 UtilRetro.cpp: Cleanup 2019-07-27 11:33:32 +08:00
Edênis Freindorfer Azevedo 855db11d98 Fix wxWidgets assertion error on `Logging...` menu. 2019-07-26 19:38:44 -01:00
Zach Bacon c886b6a16d remove wrong and unnecessary #define
This fixes builds with clang on windows.
2019-07-25 21:45:29 -01:00
Rafael Kitover 38561b5713
Merge remote-tracking branch 'vbam-libretro/master' 2019-07-25 02:16:32 +00:00
Edênis Freindorfer Azevedo 770b9c1cf8 Add left analog bind to D-PAD for joystick. 2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 6de45d4ed2 Set default binding for keyboard.
We set using the QWERT keyboard as a reference. These keys should
be located at fixed positions on most QWERT keyboards.

KEY    | KEYBOARD
-------|----------
UP     | W
DOWN   | S
LEFT   | A
RIGHT  | D
A      | L
B      | K
R      | O
L      | I
SELECT | Backspace
START  | Enter

- Fix #463.
2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 78bbe1487a Add individual clear buttons for input config.
Besides that, we also rename the button for all input to `Clear All`.

- Fix #416.
2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 53002e54db Use hats from joystick as default D-PAD. 2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 57b7ddf592 Fix small memory leak. 2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 060da968eb [LINUX] Add option to disable the online updater.
Add option to remove all configuration related to checking for updates
online. Although it is not implemented at the moment, these options
appeared on our menu `Options` > `General ...`.

- Fix need of patch on #140.
2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo dbb5914fa4 Show which BIOS file is currently selected.
It is not possible to pre-select a file with `wxFilePickerCtrl`. Hence,
we add a label to show the current gopts.{gba_bios,gb_bios,gbc_bios} is
being used, if any.

- Fix remaining of #196.
2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 76756ef916 Fix key shortcuts for toggle menu actions.
Several toggle options from the main menu could not be handled by the
key shortcuts. This was mainly because the code was only checking if
they were ticked or not.

When a key shortcut was pressed, the key itself did not trigger the
tick of the box from the menu, hence nothing was being done.

We are not setting the debug ones because they are not being missed
by the users (yet).

- Fix remaining of #88.
2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 4622f1b833 Whitespace fix. 2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 3dc738b5c5 Set default keys for input on first run.
We use the following key input if the config `vbam.ini` does not exist:

input  | keyboard
A      | A
B      | S
L      | Q
R      | W
SELECT | Z
START  | X

We also set a joystick default, using the XBOX 360 controller as a
base.

- Fix #463.
2019-07-25 00:41:34 +00:00
Edênis Freindorfer Azevedo 9bc8f33c40 Disable using volume {+,-} actions in main menu.
The idea of these was to show them available in `Options` >
`Key shortcuts` and allow the user to rebind them. We want the users to
use the keys rather than trying to change the volume via menu actions.
2019-07-25 00:41:34 +00:00
Twinaphex d1fcffc8c4
Merge pull request #63 from retro-wertz/fix_gba_siocnt
libretro: add SIO Control, normal mode reg
2019-07-23 13:47:12 +02:00
Twinaphex 7df7b19047
Merge pull request #64 from retro-wertz/patch-2
Update README.md
2019-07-23 13:46:36 +02:00
retro-wertz 7f105da3d6
Update README.md 2019-07-23 19:24:59 +08:00
retro-wertz 53ce6fb054 libretro: add SIO Control register (GBA)
- emulate SIOCNT reg, which is still needed for some games to trigger IRQ's even in single, non-link mode
- Fixes Digimon Racing (Europe) stuck in intro as reported in libretro docs page https://docs.libretro.com/library/vba_m/#compatibility
- Related PR: f9efb79a7d (diff-385704891f00846c986e9056b5d7c5a5)
2019-07-23 19:15:45 +08:00
Twinaphex 2e96f59ed0
Merge pull request #62 from retro-wertz/gb_timing_updates
Gb timing updates
2019-07-22 20:19:27 +02:00
retro-wertz e50812dc79 GB: input, audio, video timing updates 2019-07-23 01:18:13 +08:00
retro-wertz 1532f555fe GB: Reduce input lag by 1 frame, video and audio timing updates...
Similar update to GBA which does the following:
- reduces input lag by 1 frame by reading user input at beginning of cpu loop
- audio and video timing update, which sends audio and video at every frame possible
- add missing sound state variable, soundTicks for gb and gba
2019-07-23 00:40:28 +08:00
Rafael Kitover f09a9aa99a
builder: add python3 to msys2 deps
For ninja.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-20 18:35:23 +00:00
Rafael Kitover 2fcad3f813
joysticks: hack to better support 360 triggers
Map initial state of axis to 0. This is sufficient for the time being
for the 360 triggers to work better.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-19 12:43:47 +00:00
Rafael Kitover 352eb149ae
Merge remote-tracking branch 'vbam-libretro/master' 2019-07-19 12:12:49 +00:00
Edênis Freindorfer Azevedo 2e97b27ffa Use --config option to load configuration file. 2019-07-18 19:40:42 +00:00
hizzlekizzle bdd4386805
Merge pull request #61 from retro-wertz/gb
gb palette fix, color correction and cleanup
2019-07-18 08:06:34 -05:00
retro-wertz bd5ba43122 Cleanup: Remove previous core option struct and unused variables etc 2019-07-18 19:34:20 +08:00
retro-wertz aac30c72d3 Add GB Color Correction core option 2019-07-18 18:07:00 +08:00
retro-wertz 02a7a48bf3 GB: Fix selected palette not applied when loading content...
- Prevent GB type hardware change during runtime.
2019-07-18 17:35:54 +08:00
hizzlekizzle 8462ca76ca
Merge pull request #59 from retro-wertz/gb
a few gb updates
2019-07-17 23:24:47 -05:00
retro-wertz 1fa78e69c5 Fix android build 2019-07-18 11:57:42 +08:00
retro-wertz 6dcf016d20 GB: Allow support for colorizer patched games
- a new core option is provided since enabling this support
means allowing invalid access to vram and palette
- works in GBC/GBA hardware mode only
2019-07-18 10:41:59 +08:00
retro-wertz 85bd86cf5f GB: Send LCD interrupt only if there is no INT 48h signal
- Fixes Speedy Gonzales status bar in GB emulated hardware type.
2019-07-18 08:31:33 +08:00
hizzlekizzle b147e9129f
Merge pull request #57 from retro-wertz/sync
update
2019-07-17 14:45:00 -05:00
retro-wertz d808297bc6 Fix crash caused by incorrect variable index for analog sticks 2019-07-18 01:02:17 +08:00
retro-wertz 7e8828986e libretro: Add core option sublabels 2019-07-18 00:56:58 +08:00
Rafael Kitover ce11403b4e
builder: updates for mingw
Bump libgpg-error 1.27 -> 1.36 and add a patch to support gawk 5.0 from
gentoo.

Add meson to list of msys2 OS deps, this is not needed right now.

Remove glib `CreateFile` patch which has been removed from msys2
MINGW-packages master and add a couple of other patches.

Unfortunately using a newer glib release is not yet possible because of
weird linking errors with meson on mingw.

Add ninja to `host_dists` for `mingw.sh`, this is not needed currently.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-17 15:28:36 +00:00
retro-wertz c5e6a3409a Libretro: Update GBC memory map 2019-07-16 22:51:07 +08:00
Rafael Kitover fa45ccdfcd
builder: fix command(), update c2man url
Rewrite the `/bin/sh -c command` construct in `command()` correctly.

Update c2man url to the github mirror because it's dead.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-16 11:29:04 +00:00
Rafael Kitover e64b990415
builder: fix msys2
msys2 does not `/bin/command` or `/usr/bin/command`, check for these and
fall back to `/bin/sh -c "command $*"`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-16 00:48:18 +00:00
Rafael Kitover 5802207829
builder: make zip + sig on win + minor changes
Pass command-line arguments to `build_project()` for use in the cmake
command.

Make `$PROJECT_ARGS` override `$CMAKE_BASE_ARGS` for the project.

Override `command()` to call `/bin/command` to avoid the bash builtin
which has undesirable behavior when overriding commands.

Override `gpg` to invoke either the `gpg` or the `gpg2` binary,
whichever is available, or print a warning that gpg is not available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-11 20:18:21 -04:00
Rafael Kitover 296255d492
handle SDL joystick query errors #451
SDL APIs like `SDL_JoystickNumAxes(dev)` can return a negative error
code. Handle this case better.

This should fix the fatal exception from trying to allocate an array
with an illegal size (negative, due to the error.)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-11 21:25:51 +00:00
Rafael Kitover 95658f57fc
transifex sync
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-04 22:37:16 +00:00
Rafael Kitover 86c4dc7d3c
transifex sync
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-04 15:22:54 +00:00
Rafael Kitover bcc8b54096
transifex sync
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-04 04:50:39 +00:00
Edênis Freindorfer Azevedo 7569242f77 Fix pause behaviour with `Pause when inactive`.
If the user pauses with the keybinding or the menu `Emulation` > `Pause`
while `Pause when inactive` is enabled, the game should not unpause when
the window receives focus again. It should wait for the user to trigger
the manual unpause.

- Fix #460.
2019-07-04 04:42:32 +00:00
Edênis Freindorfer Azevedo 030740ee34 Fix some memory leak. 2019-07-04 04:41:26 +00:00
Edênis Freindorfer Azevedo 8ea607e1c7 remove translation from joystick keys
Avoid issues with translation, at least for now,
by not translating joystick button/axis names.
2019-07-04 04:26:48 +00:00
Rafael Kitover cec32a61cc
travis: mac: disable --help check, it segfaults
Disable the binary `--help` sanity check on mac because it is currently
segfaulting.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-04 04:08:42 +00:00
Rafael Kitover f54dd25bb8
travis: fix gettext on mac + brew
cmake cannot find gettext, force link the gettext brew.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-04 03:51:00 +00:00
Rafael Kitover e2f06210e0
update Visual Studio support
Replace the vcpkg code with a newer and better version. In this version
the `vcpkg` directory is on the same level as the source directory, so
that IntelliSense does not get confused scanning for files.

The cmake variable `VCPKG_TARGET_TRIPLET` is required to activate vcpkg
support, it must be set to e.g. `x64-windows` or `x86-windows`.

Update `CMakeSettings.json` for the new code for the GUI.

Fix a problem copying the `SDL2.dll` file to the binary directory.

Update `README.md` with commandline instructions.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-03 23:28:48 +00:00
Edênis Freindorfer Azevedo 91501becf6 Fix small memory leak. 2019-07-03 19:25:11 +00:00
Edênis Freindorfer Azevedo c366907f64 Temporary fix for #65.
It looks like that when we use the `Simple` output module, we get
weird errors when trying to load state for any game, most likely due to
memory corruption. AFAIK, it seems the frame buffer is not large enough
to render all components.

This issues does not appear when using OpenGL, or using the Simple with
any display filter available.
2019-07-03 19:25:11 +00:00
Rafael Kitover d585a61049
followup on kbd trans issues fix in 30b92724
Use the table to to replace both the translated string and the English
string.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-03 02:17:13 +00:00
Rafael Kitover eaf1ad2429
Merge remote-tracking branch 'vbam-libretro/master' 2019-07-01 08:00:30 +00:00
Rafael Kitover 30b9272412
hopefully fix kbd control translation issues
Add missing gettext calls for the game controls code.

Seems to work correctly in the Russian locale with special keys.

Also add CLion files to `.gitignore`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-01 07:53:23 +00:00
Edênis Freindorfer Azevedo 90b3f35408 Add hotkeys for changing sizes (1x ... 6x).
Use a accelerator to quickly provide a way to change to/from multipliers
of the original size.

- Fix #415.
2019-06-29 14:04:04 +00:00
Edênis Freindorfer Azevedo fa77010f23 Fix pause toggle keybinding when unmuting.
We use the same event for both keybinding and `Emulation` > `Pause`
actions. The issue here is that the menu item is checkable, meaning
that you toggle its value and then run the handler.

The handler checks the value of the menu item `Emulation` > `Pause`,
and toggle the game pause accordingly. Such thing does not happen when
using the keybinding. Hence, it did not toggle the pause as expected.

- Related to #454.
2019-06-29 14:01:21 +00:00
Twinaphex 8cb420030f
Merge pull request #56 from webgeek1234/master
Android updates
2019-06-27 13:15:33 +02:00
Edênis Freindorfer Azevedo 8b8efa1b2d fix key shortcuts for save/load states
* Fix key shortcuts for save/load states.

We show the wrong description for these shortcuts, although it works
correctly for the keybinding.

* Use the proper labels for save/load states.
2019-06-26 02:30:31 +00:00
Rafael Kitover 9fa20b49ca
joystick cleanups #444
Check that SDL reports any available controls for a joystick, otherwise
mark it invalid and close it.

When processing events for joysticks, check that each one is valid.

Set initial value of controls to zero initially not after getting the
initial state, previously we were getting the initial state and
overwriting it with zeroes, defeating the purpose.

Fix memory leak, `curval` array of controls not being cleared.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-06-24 20:36:21 +00:00
Rafael Kitover 684b1bb7aa
fix mem error for config global `homeDir`
Fix `homeDir` `ConfigManager` global pointing to freed memory.

Thanks to @FredericHamel for catching this.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-06-23 20:08:23 +00:00
Edênis Freindorfer Azevedo ccc91fa04b quick fix for unicode filenames on windows 2019-06-23 10:59:13 +00:00
Edênis Freindorfer Azevedo dfa4fec3d5 Fix missing shortcuts from key bindings.
Correct set WXK_NUMPAD_{ADD,SUBTRACT} for default volume controls and
enable users to change it via menu "Options > Key Shortcuts".

Also allow users to use both these buttons for other input.
2019-06-23 10:50:52 +00:00
Edênis Freindorfer Azevedo 69b581f7e5 Handle key{bindings,shortcuts} correctly on frame.
Some keybindings were not handled by the frame. That includes some
wxAcceleratorEntry keys. On Linux, if you set a key shortcut using a key
with no modifier ("U" for "Input > Configure"), pressing the key would
not lead to anything.

This is very likely related to wxGTK, although it is not possible to
confirm this at the moment.
2019-06-23 10:50:52 +00:00
Edênis Freindorfer Azevedo cec1dbfd36 Split configuration for default keys.
Split for keyboard and joystick with two arrays variables for
refactoring purposes.
2019-06-23 10:50:52 +00:00
Edênis Freindorfer Azevedo d655031a8f Fix removing multiple system keys shortcuts.
Whenever users try to remove the system keys shortcuts, the
configuration file is overwritten and only records the last erase.

For example, if we wish to remove all the auto{A,B,L,R} keys at once,
we get the following writes on the configuration file:

NOOP=ALT+1,ALT+2,ALT+3,ALT+4
NOOP=ALT+2,ALT+3,ALT+4
NOOP=ALT+3,ALT+4
NOOP=ALT+4

Only `NOOP=ALT+4` stays for the following execution.
2019-06-23 10:50:52 +00:00
Edênis Freindorfer Azevedo 996d5b9df8 Do not set these options on `MainMenu.xrc`.
We already set the default values on `opts.cpp`, therefore these
values are not needed here.
2019-06-23 10:50:52 +00:00
Edênis Freindorfer Azevedo 019ab5a7e1 Fix "Joybus host invalid; disabling" warning.
Whenever there is a link connection for GBA, we check if "GBA/LinkHost"
is an empty string. If it is, we send this warning. This is unnecessary
because most connections are assumed to be for localhost, otherwise the
user would set a server ip address and not see this warning.
2019-06-23 10:07:24 +00:00
Edênis Freindorfer Azevedo f6bfe67632 Have better support for maximized window.
Currently, if we maximize the window, our windowPosition{X,Y} become 0.
When reopening the app, we have a window with the same size of a
maximized, but without this property toggled on. This is not intuitive
for users, since it is expected to have the last non-maximized size
to be restored.
2019-06-23 10:04:37 +00:00
Edênis Freindorfer Azevedo dcc0afa0d4 Fix window size when {en,dis}abling status bar.
If the status bar option is enabled or disabled, there is a trigger that
resizes the current window geometry to its zoom configuration. What
should happen instead is the size remain the same.
2019-06-23 10:04:37 +00:00
Edênis Freindorfer Azevedo bf6f2d4ac2 Change where the config dir is created.
On Windows, if there is a `vbam.ini` where the exe is, we should not
create the configuration directory `%LOCALAPPDATA%\visualboyadvance-m`.
2019-05-31 00:42:08 -07:00
Rafael Kitover 3490620e0f
travis: use Mac OS 10.14 and Xcode 10.2.1
The default Mac OS environment on travis no longer has brew bottle
support, so jobs time out.

Add the `osx_image` key to specify Mac OS 10.14 and Xcode 10.2.1.

Also try to re-enable link support using SFML.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-05-29 23:26:46 +00:00
Edênis Freindorfer Azevedo b0ec84693e fix stuck keys on ubuntu and on focus loss #142
In the `OnKeyDown` event handler, check if the key is actually pressed
using `wxGetKeyState()`, because for some reason on Ubuntu 18
spurious events are generated when the key is not actually pressed.

Also, if a game is paused by the frontend while a key is being pressed,
the key will remain active for the game when unpaused. This is an
issue because the key will likely be released outside of the game zone;
therefore, we would not process the key release for the game itself.

The same bug happens if clicking outside of the game zone while
holding a key.

For the case of a directional key, this means a continuous movement
in the direction of the key pressed before the pause until the key
is pressed and released.
2019-05-29 12:08:18 -07:00
Edênis Freindorfer Azevedo 3d57750c16
Follow-up work on #142.
Joysticks have their own set of {KEY,MOD,JOY}, what means that setting
everything for MOD=0 is a mistake. We need to deal only with keyboard
mappings here.
2019-05-23 20:04:18 -03:00
Aaron Kling 055b7c4d49 libretro: jni: Switch to clang compiler in preparation for ndk r20 2019-05-23 15:29:16 -05:00
Aaron Kling 2e1333e1bb regparm is an x86 only attribute, only define it there 2019-05-23 15:28:09 -05:00
Rafael Kitover 500506cbd4
travis: disable link/SFML for mac
Currently the SFML brew does not compile in the travis mac environment,
so do not install SFML via `./installdeps` for brew if `$TRAVIS` is set,
and add `-DENABLE_LINK=OFF` to cmake options for the mac travis job.

Also try to cache the `/usr/local` directory, to make the brew installs
faster, if this even works.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-05-22 21:06:42 +00:00
Edênis Freindorfer Azevedo 22307de6c8 Fix continuous sprinting when using a modifier key
as a mapping key (#142).

When holding a key(W,A,S,D) and then pressing a modifier(SHIFT,CTRL,ALT),
we get two sets {MOD,MOD,0} and {KEY,MOD,0} with MOD > 0 after a
{KEY,0,0}. When releasing the initial key while holding the modifier,
we search for {KEY,MOD,0} instead of {KEY,0,0} to be removed.

Finally, when releasing the modifier, we remove {MOD,MOD,0} from our
stack. This means the {KEY,0,0} stays "pressed", although no input
is being taken from the keyboard.

Full example using WASD as movement keys and L_SHIFT as our B button.
1. Press and hold "A" --> add {A,0,0} to stack;
2. Press "L_SHIFT" --> add {L_SHIFT,4,0} and {A,4,0} to stack;
3. Release "A" --> remove {A,4,0} from stack (no effect);
4. Release "L_SHIFT" --> remove {L_SHIFT,4,0} from stack;
5. {A,0,0} still on stack.

No keyboard button is being pressed anymore, but there is a continuous
movement towards the direction mapped by "A" {A,0,0}. It is only fixed
when "A" is pressed two times in succession, because we don't add
duplicate sets to our stack, but try to remove them anyway.
2019-05-22 10:59:16 -07:00
Rafael Kitover 504597120f
wx: only rename config if new file doesn't exist
Before trying to rename `vbam.conf` to `vbam.ini`, as we decided during
the XDG support work, first check if `vbam.ini` does not already exist.

If it already exists, use `vbam.ini` and do nothing with the
`vbam.conf`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-28 12:35:27 +00:00
retro-wertz 0a95486fd8 Sound.cpp: Update
- minor, non-function changing updates like float value changes, some unrolled sections
- break soundEvent into separate 8 / 16 bit data writes.
2019-04-28 04:02:45 -07:00
Rafael Kitover a4eae8025e
cmake: use LEGACY OpenGL on FreeBSD only 2fedaa63
Black screen reported on linux with `LEGACY` OpenGL type, set it back to
`GLVND` and only use `LEGACY` on FreeBSD.

Broken in 2fedaa63.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-27 22:52:42 +00:00
retro-wertz 240257a01b wx: Change max volume from 400 to 200
- global implementation has set max at 200% (2.0 float), its already loud enough at 100%
2019-04-27 15:49:55 -07:00
Rafael Kitover 57ed465ebb
builder: better mac automation
Make the right zip release filename and gpg signature when done
building for mac.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-27 15:45:03 -07:00
Rafael Kitover 15f040f3c4
cmake: missing space in wx util function
Fix typo from 2fedaa6.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-25 23:51:40 +00:00
Rafael Kitover 2fedaa63a6
support FreeBSD
Make some changes to support out-of-the-box builds on FreeBSD:

- set cmake OpenGL type to `LEGACY`, the new `GLVND` type produces
  unusable binaries on FreeBSD

- on FreeBSD add -I/usr/local/include to compiler flags, why this is
  necessary I don't know

- look for llvm tools such as `llvm-ar` in `/usr/local/llvm-devel/bin`,
  LTO works

- improve the `find_wx_util()` cmake function to handle `wx-config`
  scripts named in the form e.g. `wxgtk3u-3.1-config`

- add FreeBSD support to `installdeps`

- make some minor changes to included headers based on macros such as
  `__FreeBSD__` to compile on FreeBSD, including adding a `BSD.h` header
  with some defines for e.g. `fseeko64`

- move the cmake X11 detection to before the wx compile tests, because
  otherwise the extra compile flags for the wx tests make the X11 tests
  fail

- make some minor changes to fix wx 2.8 compatibilty again, we don't
  actually use 2.8 for FreeBSD but I was testing it

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-25 16:22:07 +00:00
Rafael Kitover a0c375b6e4
Merge remote-tracking branch 'vbam-libretro/master'
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-20 08:39:54 +00:00
Twinaphex c013d499d5
Merge pull request #55 from Classicmods/master
Add PSC Makefile changes
2019-04-19 07:31:37 +02:00
Rafael Kitover a8b386816a
remove some old visual studio project files
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-18 10:45:20 +00:00
Wes Smith b6bb24e016
Merge pull request #1 from libretro/master
Rebase
2019-04-15 22:27:52 -04:00
retro-wertz 5012969a59 Bump version to 2.1.1 2019-04-06 20:11:14 +02:00
retro-wertz 755f476799 Fix #52 2019-04-06 20:11:13 +02:00
Wes Smith f87e085079 added a8a35 2019-03-05 15:22:21 -05:00
retro-wertz 286c8ff487 Fix #52 2019-03-03 15:16:11 -05:00
713 changed files with 165081 additions and 256267 deletions

47
.appveyor.yml Normal file
View File

@ -0,0 +1,47 @@
version: '{build}'
image:
- Visual Studio 2017
build:
verbosity: detailed
configuration:
- Debug
- Release
platform:
- x64
- x86
environment:
matrix:
- STATIC: " "
- STATIC: "-static"
matrix:
fast_finish: true
install:
- set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip"
- appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
- 7z x ninja.zip -oc:\projects\ninja > nul
- set PATH=c:\projects\ninja;%PATH%
- ninja --version
before_build:
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
build_script:
- mkdir build
- cd build
- cmake .. -DVCPKG_TARGET_TRIPLET=%PLATFORM%-windows%STATIC% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DENABLE_SDL=TRUE -G Ninja
- ninja
# only debug builds are console mode apps, in them test --help
test_script:
- if not %CONFIGURATION%==Release .\visualboyadvance-m.exe --help
- ctest -V
cache:
- c:\vcpkg\installed

View File

@ -1,38 +0,0 @@
# Build configuration for https://www.tea-ci.org
# Tea CI is a fork of Drone CI with Cygwin/Msys2 support
# Feel free to share Tea CI to more open source developers
# http://docs.tea-ci.org/usage/overview/
# Please add your project to https://github.com/TeaCI/tea-ci/wiki/Msys2-on-Wine#use-msys2-in-tea-ci
build:
image: teaci/msys$$arch
pull: true
shell: mingw$$arch
commands:
- if [ $$arch = 32 ]; then target=i686; fi
- if [ $$arch = 64 ]; then target=x86_64; fi
- pacman -S --needed --noconfirm --noprogressbar mingw-w64-${target}-cmake mingw-w64-${target}-ffmpeg mingw-w64-${target}-SDL2 mingw-w64-${target}-openal mingw-w64-${target}-sfml mingw-w64-${target}-extra-cmake-modules mingw-w64-${target}-cairo mingw-w64-${target}-zlib mingw-w64-${target}-libpng nasm mingw-w64-${target}-wxWidgets mingw-w64-${target}-crt-git mingw-w64-${target}-headers-git zip
- git submodule update --init --recursive
- cmake -DENABLE_FFMPEG=ON -DENABLE_SDL=ON -G "MSYS Makefiles"
- make
notify:
irc:
prefix: build
nick: vbam-ci
channel: #vba-m
server:
host: irc.freenode.net
port: 6667
matrix:
arch:
- 64
- 32
#publish:
# github_release:
# api_key: 4cd466723ff104154a6a206814ddaa159131f2ec
# files:
# - vbam.exe
# - visualboyadvance-m.exe
# checksum:
# - sha256

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
github: rkitover

View File

@ -1,49 +0,0 @@
### Please fill out this form:
### Expected behavior
### Actual behavior
### Steps to reproduce the behavior
### Crash bugs
If this is a crash bug, and you have the time and inclination, please provide a
symblic backtrace.
Instructions for doing so are
[here](https://github.com/visualboyadvance-m/visualboyadvance-m/blob/master/README.md#reporting-crash-bugs).
### ROM details
Which games are affected by the issue (please state if GBA or GB game):
Which games, if any, are NOT affected by the issue (please state if GBA or GB game):
Include screenshots of ROM Information (File > ROM Information):
If you are using a BIOS file, please say which one.
### Option details
Video driver (simple, opengl):
Sound driver (directsound, xaudio, openal, SDL):
### Build details
Operating System (Windows, Mac, Linux (state distribution), etc.):
If using Linux, specify if using xorg or Wayland:
Version of code (pre-built binary version, or commit ref, or just "master"):
### Hardware details:
If your joystick or gamepad isn't working in Linux, please try to troubleshoot
using the information on this page:
https://wiki.archlinux.org/index.php/Gamepad **BEFORE** filing an issue. We use
SDL for joystick support, any problems will generally be an issue with SDL and
**NOT** the emulator.
If relevant, the joystick you are using and the drivers you are using for it:

116
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,116 @@
name: Bug Report
description: If you experience a bug in the Emulator, please open an issue here and fill out the template.
title: "[Bug]: "
labels: ["bug", "triage"]
assignees:
-
body:
- type: markdown
attributes:
value: "## BEFORE REPORTING AN ISSUE"
- type: markdown
attributes:
value: |
Please try the nightly build from: https://nightly.visualboyadvance-m.org and factory resetting the emulator from the Help menu.
On Linux build master from source or use the edge snap.
And last but not least, search for existing reports via the filters bar on the issues page.
- type: markdown
attributes:
value: "## If your joystick or gamepad isn't working in Linux"
- type: markdown
attributes:
value: |
Please try to troubleshoot using the information on this page:h ttps://wiki.archlinux.org/index.php/Gamepad **BEFORE** filing an issue.
We use SDL for joystick support, any problems will generally be an issue with SDL and **NOT** the emulator.
If relevant, the joystick you are using and the drivers you are using for it:
- type: textarea
id: what-should-happen
attributes:
label: Expected behavior?
description: How was the emulator supposed to behave
placeholder: Tell us what you expect to see!; use screenshots if necessary.
value:
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: Actual behavior?
description: Describe the issue you encountered.
placeholder: Tell us what you see!; use screenshots if necessary.
value:
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce the problem
description: "How do you trigger this bug? Please walk us through it step by step."
value: |
1.
2.
3.
4.
5.
...
validations:
required: true
- type: textarea
id: error-messages
attributes:
label: Error messages?
description: Was there an error message?
placeholder: List any exception messages here!; use screenshots if necessary.
value: |
If this is a crash bug, and you have the time and inclination, please provide a symbolic backtrace.
Instructions for doing so are [here](https://github.com/visualboyadvance-m/visualboyadvance-m/blob/master/README.md#reporting-crash-bugs).
validations:
required: false
- type: textarea
id: Rom_Details
attributes:
label: What game were you playing
description: "What is the specific rom that you encountered an issue with"
value: |
<Some of this information can be provided with a screenshot of Rom Information, SAVE TYPE for GBA titles can be obtained from Options > Game Boy Advance > Config>
Title:
GB, GBC or GBA:
ROM CODE:
BIOS Used?: (Share crc hash)
SAVE TYPE: (Attach Battery or Savestate here)
Clean, Intro'd or Hacked?:(Attach Patch here)
validations:
required: false
- type: textarea
id: Settings
attributes:
label: What settings are you using?
description: "Please list them"
value: |
Video driver (simple, opengl):
Sound driver (directsound, xaudio, openal, SDL):
Scale Filter Used?:
validations:
required: true
- type: textarea
id: SysInfo
attributes:
label: Specifications and Build details
description: "List your system information, you can obtain this from MSINFO32 and the emulators Titlebar."
value: |
VBA-M: (include commit version number and whether you are using the 32-bit or 64-bit version)
OS: (include version and OS build number using WinVer if on Windows):
If using Linux, specify if using xorg or Wayland:
CPU:
GPU:
RAM:
validations:
required: true
- type: checkboxes
id: Copyright_Compliance
attributes:
label: Copyright Compliance
description: Please do not attach any files that infringe on the copyright of Nintendo or its partners.
options:
- label: There are no infringing files attached to this bug report.
required: true

9
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,9 @@
blank_issues_enabled: false
contact_links:
- name: VBA-M Forum
url: https://board.visualboyadvance-m.org/
about: For general questions and support please join our forum or our
- name: VBA-M IRC Channel
url: https://web.libera.chat/#vba-m
about: For realtime discussion and support

46
.github/ISSUE_TEMPLATE/feature.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: Feature request
description: >-
If you would like a new feature in Visual Boy Advance - M, please
open an issue here and fill out the template.
title: '[Feature request]: '
labels:
- enhancement
assignees:
- null
body:
- type: markdown
attributes:
value: "## BEFORE CREATING A FEATURE REQUEST"
- type: markdown
attributes:
value: |
Please try a nightly build from: https://nightly.visualboyadvance-m.org to see if your idea has already been implemented.
On Linux build master from source or use the edge snap.
And last but not least, search for existing requests via the filters bar on the issues page.
- type: textarea
id: feature-request
attributes:
label: Request box
description: What feature would you like to see added?
placeholder: Tell us what you would like to see added to Visual Boy Advance - M!
value: null
validations:
required: true
- type: textarea
id: reason-why
attributes:
label: Reason box
description: Provide reasoning for the new feature
placeholder: Tell us why you'd like to see this feature added
value: null
validations:
required: true
- type: textarea
id: Examples
attributes:
label: Examples
description: Provide examples of this feature
placeholder: Provide examples or screenshots of this feature in other software
value: null
validations:
required: true

33
.github/workflows/devkitpro-build.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Libretro Devkitpro
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
target_name: [ngc, wii, wiiu, switch]
build_type: [release, debug]
include:
- libretro_build: 'DEBUG=0'
build_type: release
- libretro_build: 'DEBUG=1'
build_type: debug
- devkit_container: 'devkitpro/devkitppc:latest'
target_name: ngc
- devkit_container: 'devkitpro/devkitppc:latest'
target_name: wii
- devkit_container: 'devkitpro/devkitppc:latest'
target_name: wiiu
- devkit_container: 'devkitpro/devkita64:latest'
target_name: switch
runs-on: ubuntu-latest
container: ${{ matrix.devkit_container }}
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
submodules: recursive
# Libretro build
- name: Build libretro core
run: make -C src/libretro ${{ matrix.libretro_build }} platform=${{ matrix.target_name }}

63
.github/workflows/macos-build.yml vendored Normal file
View File

@ -0,0 +1,63 @@
name: macOS Latest
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
build_type: [release, debug]
build_options: [default, link_off, translations_only, libretro]
include:
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
build_options: translations_only
- libretro_build: 'DEBUG=0'
build_type: release
build_options: libretro
- libretro_build: 'DEBUG=1'
build_type: debug
build_options: libretro
exclude:
# Exclude debug/translations_only build
- build_type: debug
build_options: translations_only
runs-on: macos-latest
env:
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM: 1
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
# Cmake build
- if: matrix.build_options != 'libretro'
name: Configure CMake
run: >-
nix-shell --command 'cmake -B build -G Ninja ${{ matrix.cmake_build }} -DENABLE_LTO=OFF ${{ matrix.cmake_options }}'
- if: matrix.build_options != 'libretro'
name: Build
run: >-
nix-shell --command 'ninja -C build'
# Libretro build
- if: matrix.build_options == 'libretro'
name: Build libretro core
run: >-
nix-shell --command 'make -C src/libretro ${{ matrix.libretro_build }}'
# Run tests
- if: matrix.build_options == 'default'
name: Run tests
run: >-
nix-shell --command 'cd build && ctest -j --output-on-failure'

64
.github/workflows/msys2-build.yml vendored Normal file
View File

@ -0,0 +1,64 @@
name: MSYS2
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
build_type: [release, debug]
build_options: [default, link_off, translations_only, libretro]
include:
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
build_options: translations_only
- libretro_build: 'DEBUG=0'
build_type: release
build_options: libretro
- libretro_build: 'DEBUG=1'
build_type: debug
build_options: libretro
exclude:
# Exclude debug/translations_only build
- build_type: debug
build_options: translations_only
runs-on: windows-latest
env:
MSYSTEM: CLANG64
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
msystem: CLANG64
update: true
- name: Install deps
run: >-
bash installdeps
# CMake build
- if: matrix.build_options != 'libretro'
name: Configure CMake
run: cmake -B build -G Ninja ${{ matrix.cmake_build }} -DENABLE_LTO=OFF ${{ matrix.cmake_options }}
- if: matrix.build_options != 'libretro'
name: Build
run: ninja -C build
- if: matrix.build_options != 'libretro'
name: Install
run: ninja -C build install
# Libretro build
- if: matrix.build_options == 'libretro'
name: Build libretro core
run: make -C src/libretro ${{ matrix.libretro_build }} CC=clang CXX=clang++

71
.github/workflows/ubuntu-build.yml vendored Normal file
View File

@ -0,0 +1,71 @@
name: Ubuntu Latest
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
build_compiler: [gcc, clang]
build_type: [release, debug]
build_options: [default, link_off, translations_only, libretro]
include:
- cmake_compiler: '-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++'
build_compiler: gcc
- cmake_compiler: '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++'
build_compiler: clang
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
build_options: translations_only
- libretro_build: 'DEBUG=0'
build_type: release
build_options: libretro
- libretro_build: 'DEBUG=1'
build_type: debug
build_options: libretro
exclude:
# Exclude debug/translations_only build
- build_type: debug
build_options: translations_only
- build_type: release
build_options: translations_only
build_compiler: clang
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Dependencies
run: >-
bash installdeps; if [ "${{ matrix.build_compiler }}" = clang ]; then sudo apt -y install clang; fi
- name: Install xvfb
run: sudo apt -y install xvfb
# CMake build
- if: matrix.build_options != 'libretro'
name: Configure CMake
run: >-
cmake -B build -G Ninja ${{ matrix.cmake_compiler }} ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
- if: matrix.build_options != 'libretro'
name: Build
run: ninja -C build
- if: matrix.build_options != 'libretro'
name: Install
run: sudo ninja -C build install
# Libretro build
- if: matrix.build_options == 'libretro'
name: Build libretro core
run: make -C src/libretro ${{ matrix.libretro_build }}
# Run tests
- if: matrix.build_options == 'default'
name: Run tests
run: cd build && xvfb-run ctest -j --output-on-failure

View File

@ -0,0 +1,60 @@
name: Visual Studio
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
msvc_arch: ['x64', 'amd64_x86', 'amd64_arm64']
# TODO: Re-add "Visual Studio 17 2022" once it's working.
cmake_generator: ['Ninja']
build_type: [release, debug]
build_options: [default, link_off, translations_only]
include:
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
build_options: translations_only
- cmake_vcpkg_triplet: 'x64-windows-static'
msvc_arch: x64
- cmake_vcpkg_triplet: 'x86-windows-static'
msvc_arch: amd64_x86
- cmake_vcpkg_triplet: 'arm64-windows-static'
msvc_arch: amd64_arm64
exclude:
# Exclude debug/translations_only build
- build_type: debug
build_options: translations_only
- build_type: release
build_options: translations_only
msvc_arch: amd64_x86
- build_type: release
build_options: translations_only
msvc_arch: amd64_arm64
runs-on: windows-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: ${{ matrix.msvc_arch }}
- name: Configure
run: >-
cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=${{ matrix.cmake_vcpkg_triplet }} ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
- name: Build
run: cmake --build build
# Run tests
- if: matrix.build_options == 'default' && matrix.msvc_arch != 'amd64_arm64'
name: Run tests
run: cd build && ctest -j --output-on-failure

18
.gitignore vendored
View File

@ -1,19 +1,15 @@
src/wx/builtin-over.h
src/wx/builtin-xrc.h
src/wx/cmd-evtable.h
src/wx/cmdhandlers.h
src/wx/cmdtab.cpp
src/wx/wxvbam.xrs
build/*
build32/*
vsbuild/*
dependencies/*
vcpkg/*
/*build*/*
.vs/*
.idea
*.o
*.so
*.dll
*.exe
.vscode/
# clangd files
compile_commands.json
.cache/
# vim swap files
*.sw?

201
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,201 @@
# DESCRIPTION: GitLab CI/CD for libRetro (NOT FOR GitLab-proper)
##############################################################################
################################# BOILERPLATE ################################
##############################################################################
# Core definitions
.core-defs:
variables:
GIT_SUBMODULE_STRATEGY: recursive
JNI_PATH: src/libretro
MAKEFILE_PATH: src/libretro
CORENAME: vbam
# Inclusion templates, required for the build to work
include:
################################## DESKTOPS ################################
# Windows 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-x64-mingw.yml'
# Windows 32-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-i686-mingw.yml'
# Linux 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/linux-x64.yml'
# Linux 32-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/linux-i686.yml'
# MacOS 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-x64.yml'
# MacOS ARM 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-arm64.yml'
################################## CELLULAR ################################
# Android
- project: 'libretro-infrastructure/ci-templates'
file: '/android-jni.yml'
# iOS
- project: 'libretro-infrastructure/ci-templates'
file: '/ios-arm64.yml'
# iOS (armv7)
- project: 'libretro-infrastructure/ci-templates'
file: '/ios9.yml'
################################## CONSOLES ################################
# PlayStation Vita
- project: 'libretro-infrastructure/ci-templates'
file: '/vita-static.yml'
# Nintendo GameCube
- project: 'libretro-infrastructure/ci-templates'
file: '/ngc-static.yml'
# Nintendo Wii
- project: 'libretro-infrastructure/ci-templates'
file: '/wii-static.yml'
# Nintendo WiiU
- project: 'libretro-infrastructure/ci-templates'
file: '/wiiu-static.yml'
# Nintendo Switch
- project: 'libretro-infrastructure/ci-templates'
file: '/libnx-static.yml'
# tvOS (AppleTV)
- project: 'libretro-infrastructure/ci-templates'
file: '/tvos-arm64.yml'
#################################### MISC ##################################
# Stages for building
stages:
- build-prepare
- build-shared
- build-static
##############################################################################
#################################### STAGES ##################################
##############################################################################
#
################################### DESKTOPS #################################
# Windows 64-bit
libretro-build-windows-x64:
extends:
- .libretro-windows-x64-mingw-make-default
- .core-defs
# Windows 32-bit
libretro-build-windows-i686:
extends:
- .libretro-windows-i686-mingw-make-default
- .core-defs
# Linux 64-bit
libretro-build-linux-x64:
extends:
- .libretro-linux-x64-make-default
- .core-defs
# Linux 32-bit
libretro-build-linux-i686:
extends:
- .libretro-linux-i686-make-default
- .core-defs
# MacOS 64-bit
libretro-build-osx-x64:
extends:
- .libretro-osx-x64-make-default
- .core-defs
# MacOS ARM 64-bit
libretro-build-osx-arm64:
extends:
- .libretro-osx-arm64-make-default
- .core-defs
################################### CELLULAR #################################
# Android ARMv7a
android-armeabi-v7a:
extends:
- .libretro-android-jni-armeabi-v7a
- .core-defs
# Android ARMv8a
android-arm64-v8a:
extends:
- .libretro-android-jni-arm64-v8a
- .core-defs
# Android 64-bit x86
android-x86_64:
extends:
- .libretro-android-jni-x86_64
- .core-defs
# Android 32-bit x86
android-x86:
extends:
- .libretro-android-jni-x86
- .core-defs
# iOS
libretro-build-ios-arm64:
extends:
- .libretro-ios-arm64-make-default
- .core-defs
# iOS (armv7) [iOS 9 and up]
libretro-build-ios9:
extends:
- .libretro-ios9-make-default
- .core-defs
# tvOS
libretro-build-tvos-arm64:
extends:
- .libretro-tvos-arm64-make-default
- .core-defs
################################### CONSOLES #################################
# PlayStation Vita
libretro-build-vita:
extends:
- .libretro-vita-static-retroarch-master
- .core-defs
# Nintendo GameCube
libretro-build-ngc:
extends:
- .libretro-ngc-static-retroarch-master
- .core-defs
# Nintendo Wii
libretro-build-wii:
extends:
- .libretro-wii-static-retroarch-master
- .core-defs
# Nintendo WiiU
libretro-build-wiiu:
extends:
- .libretro-wiiu-static-retroarch-master
- .core-defs
# Nintendo Switch
libretro-build-libnx-aarch64:
extends:
- .libretro-libnx-static-retroarch-master
- .core-defs

12
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "dependencies"]
path = dependencies
url = https://github.com/visualboyadvance-m/dependencies.git
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/Microsoft/vcpkg.git
[submodule "win32-deps"]
path = win32-deps
url = https://github.com/visualboyadvance-m/win32-deps.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git

View File

@ -1,82 +1,96 @@
---
cache: ccache
dist: xenial
language: cpp
services: xvfb
sudo: required
services:
- xvfb
matrix:
fast_finish: true
include:
- env: BUILD_ENV=ubuntu
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps
script:
- mkdir build
- cd build
- cmake .. -DENABLE_SDL=ON -DENABLE_OPENAL=ON
- make -j2
- xvfb-run ./visualboyadvance-m --help
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=ubuntu-bionic XVFB_RUN=1
dist: bionic
# - env: BUILD_ENV=utf8 XVFB_RUN=1
# dist: bionic
# - env: BUILD_ENV=nostl XVFB_RUN=1
# dist: bionic
- env: BUILD_ENV=ubuntu-xenial XVFB_RUN=1
- env: BUILD_ENV=ubuntu-xenial-minimal INSTALLDEPS_ARGS="--no-openal --no-ffmpeg" XVFB_RUN=1
- env: BUILD_ENV=ubuntu-xenial XVFB_RUN=1 CC=clang CXX=clang++
- env: BUILD_ENV=mingw-w64
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps MinGW-w64-x86_64
script:
- mkdir build
- cd build
- /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake .. -DENABLE_SDL=ON -DENABLE_OPENAL=ON
- make -j2
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=mingw-w32
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps MinGW-w64-i686
script:
- mkdir build
- cd build
- /usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake .. -DENABLE_SDL=ON -DENABLE_OPENAL=ON
- make -j2
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=libretro
language: cpp
os: linux
dist: trusty
before_install:
- sudo apt-get -qqy update
- sudo apt-get -qqy install build-essential ccache
script:
- cd src/libretro
- make -j2 CXX="ccache g++" CC="ccache gcc"
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=libretro CC=clang CXX=clang++
- env: BUILD_ENV=mac
language: cpp
os: osx
before_script:
- ./installdeps
script:
- mkdir build
- cd build
- cmake .. -DENABLE_SDL=ON -DENABLE_OPENAL=ON
- make -j2
- ./visualboyadvance-m.app/Contents/MacOS/visualboyadvance-m --help
cache:
directories:
- "$HOME/.ccache"
osx_image: xcode12
install: export PATH="/usr/local/opt/ccache/libexec:$PATH"
before_install:
- |
case "$BUILD_ENV" in
mingw-w64 )
ARG=MinGW-w64-x86_64
CMAKE=/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake
PATH="$PATH:/usr/lib/mxe/usr/bin"
;;
mingw-w32 )
ARG=MinGW-w64-i686
CMAKE=/usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake
PATH="$PATH:/usr/lib/mxe/usr/bin"
;;
* )
CMAKE=cmake
;;
esac
- |
if [ "$BUILD_ENV" != libretro ]; then
./installdeps $INSTALLDEPS_ARGS $ARG
DIR=build
else
DIR=src/libretro
fi
before_script:
- |
if [ -n "$ENABLE_SDL" ]; then
CMAKE_ARGS="$CMAKE_ARGS -DENABLE_SDL=ON"
fi
case "$BUILD_ENV" in
utf8|nostl)
sudo apt-get -y install stow libwxgtk3.0-gtk3-dev
(
cd /
sudo curl -LO 'http://cachemiss.com/files/wxWidgets-gtk3-'"$BUILD_ENV"'-3.0.5.tar.gz'
sudo tar zxvf wxWidgets-gtk3-"$BUILD_ENV"-3.0.5.tar.gz
cd /usr/local/stow
sudo stow wxWidgets-gtk3-"$BUILD_ENV"-3.0.5
)
export LD_LIBRARY_PATH=/usr/local/lib
CMAKE_ARGS="$CMAKE_ARGS -DwxWidgets_CONFIG_EXECUTABLE=/usr/local/bin/wx-config -DWXRC=/usr/local/bin/wxrc"
;;
esac
script:
- mkdir -p -- "$DIR"
- cd -- "$DIR"
- if [ "$BUILD_ENV" != libretro ]; then $CMAKE $CMAKE_ARGS ..; fi
- if [ "$BUILD_ENV" != libretro ]; then ninja; else make; fi
- if [ "$BUILD_ENV" != libretro ]; then DESTDIR=/tmp/VBAM ninja install; fi
- |
if [ "$BUILD_ENV" = mac ]; then
./$PRGNAM.app/Contents/MacOS/$PRGNAM --help
elif [ -n "$XVFB_RUN" ]; then
xvfb-run -a ./$PRGNAM --help
fi
ctest -V
env:
global:
- CMAKE_ARGS="-G Ninja"
- ENABLE_SDL=1
- MAKEFLAGS="-j2"
- PRGNAM=visualboyadvance-m
notifications:
webhooks:

11
.tx/config Normal file → Executable file
View File

@ -1,9 +1,10 @@
[main]
host = https://www.transifex.com
[vba-m.wxvbam]
file_filter = po/wxvbam/<lang>.po
source_file = po/wxvbam/wxvbam.pot
source_lang = en
type = PO
[o:bgk:p:vba-m:r:wxvbam]
file_filter = po/wxvbam/<lang>.po
source_file = po/wxvbam/wxvbam.pot
type = PO
source_lang = en
minimum_perc = 0

View File

@ -4,6 +4,437 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [2.1.11] - 2024-09-15
==========================
* 3eea90af - build: set BUILD_TESTING=OFF when not git checkout [rkitover]
* b3952d74 - build: fix ENABLE_LIRC=ON [rkitover]
* f264e7f8 - Fix Help -> Translations URL [rkitover]
* 61f427de - Write shortcuts in the proper section (#1335) [Steelskin]
* d619ee2b - build: fix installing GoogleTest [rkitover]
* 26207038 - Update WinSparkle to 0.8.1 and add ARM64 [rkitover]
## [2.1.10] - 2024-09-08
==========================
* 7f06428d - Disable dialog position save/restore on wxGTK (#1331) [Steelskin]
* e4ef4aa6 - Propagate key events (#1323) [Steelskin]
* e2cf6ecb - Add option to mute sound during speedup [rkitover]
* d516683a - build: fix for wx using GTK2 [rkitover]
* 834c7de8 - build: update macOS builder dists [rkitover]
* fc82e062 - build: do not build SDL bin on Windows or macOS [rkitover]
* d543784a - [UserInput] Filter key events globally [steelskin]
* 902c6c8e - [UserInput] Only process shortcut commands once [steelskin]
* b7765092 - [bindings] Set default shortcut for recent file 3 [steelskin]
* cc65ef28 - doc: add system requirements to README.md [danialhorton]
* 32627f6b - [Dialogs] Save and restore dialog positions [steelskin]
* 41952d06 - build: update macOS linker tool to 1.5 [rkitover]
* 0c39a5ba - build: override FindGettext to not update po files [rkitover]
* 1b77d659 - build: update macOS build to ffmpeg 7.0 [rkitover]
* 8d08223d - build: fix compatibility with older ffmpeg [rkitover]
* af6028a9 - build: fix build for nix on macOS [rkitover]
* b52edf52 - build: fix building on macOS with Homebrew [rkitover]
* 6766b9ca - build: fix ffmpeg 7.x compat [rkitover]
* 795f25bb - build: fix nix deps for OpenGL [rkitover]
* 647be137 - gba: set cpsr=spsr when switching to FIQ mode [40356555+Aikku93]
* 8abe3e79 - build: remove -lgcc from static link flags [rkitover]
* f4835674 - [Audio] Rework audio devices enumeration [steelskin]
* 775a571f - build: fix detecting Visual Studio default vcpkg [rkitover]
* 64abd3e8 - [Audio] Remove manual memory allocations [steelskin]
* 047ad277 - [Dialogs] Prevent viewers from causing a crash [steelskin]
* 045c98d8 - build: only use -Werror=lto-type-mismatch on gcc [rkitover]
* 3518dc6a - build: fix LTO on Linux [rkitover]
* cc9a03ce - Add toggle: SDL GameController mode for joysticks [rkitover]
* 8576733c - [Build] Remove lingering references to OpenAl [steelskin]
* 05561922 - build: fix MSYS2 check [rkitover]
* d9432ebb - build: fix build on MINGW{64,32}/UCRT64 on MSYS2 [rkitover]
* f57cad67 - build: fix static linking on MSYS2 CLANG64 [rkitover]
* 23e15734 - build: set wxWidgets_DIR with vcpkg [rkitover]
* 98b51910 - [Build] Remove ENABLE_NLS, fix TRANSLATIONS_ONLY [steelskin]
* a565cea8 - [Build] Remove the OpenGL check [steelskin]
* f96e42fe - build: cmake refactor and improvements [Steelskin]
* 07e49025 - Fix most remaining release warnings (#1243) [Steelskin]
* 18b97b43 - Fix various build warnings (#1242) [Steelskin]
* 13a16eb7 - Fix various warnings in filters and headers (#1241) [Steelskin]
* f46da1c5 - build: remove our version of FindSDL2.cmake [rkitover]
* 404e9a1a - build: add clang to ./installdeps for MSYS2 [rkitover]
* 613bd403 - Make menu more reasonably organized (#1230) [wwrustc]
* 215e3c5a - build: use find_program() to find powershell [rkitover]
* e5aa685f - build: don't use wx utils as UNIX cmds on Windows [rkitover]
* 9e4c8e17 - build: fix gentoo dependency namespaces [68k]
* 5f853b99 - Update metainfo.xml to new standards [jhonny.oliveira]
* e7d135db - Update links to new domain visualboyadvance-m.org [rkitover]
* 60fc096f - build: add libglu-devel for solus in installdeps [rkitover]
## [2.1.9] - 2024-02-03
=======================
* 84b0a3e3 - Remove SDL sound driver [rkitover]
* 2ad7dd1a - Fix wav audio recording [40356555+Aikku93]
* 23ef8ef0 - Dialog appearance improvements + link warning [zachbacon]
* a0452701 - build: don't fseeko64()/ftello64() on musl libc [rkitover]
* 9e9fe812 - visualboyadvance-m.metainfo.xml: add screenshots to the metainfo [zachbacon]
## [2.1.8] - 2023-12-13
========================
* beab0881 - Store the PC register at the appropriate offset [steelskin]
* bf2452aa - Resize GameArea after MainFrame initialization [steelskin]
* 71ca0fb2 - Properly hide the status bar at startup [steelskin]
* 7e1afcd3 - Fix reading joystick hat config values [rkitover]
* 32581966 - Link: Fix menu not refreshing correctly [74248064+nuive]
## [2.1.7] - 11.09.2023
=========================
* aca206a7 - Launch on xwayland under Wayland if no EGL [rkitover]
* 93a24bee - Disable mirroring for ROMs > 32MB [rkitover]
* 0f4ec575 - [Build] Fix the NO_LINK build [steelskin]
* 803ab352 - [GB] Save MBC7 EEPROM data to `gbRam` [steelskin]
* 24b6ac5a - [GBA] Implement missing Thumb instruction [steelskin]
* 14a4b6f8 - [dialogs] Move JoypadConfig to its own class. [steelskin]
## [2.1.6] - 09.07.2023
=========================
* 7561ca97 - Fix Discord streaming for OpenGL [danialhorton]
* e26f8073 - [bios] Fix lz77 and add BIOS_SndDriverVsyncOn [steelskin]
* d1f65000 - Refactor accelerator / global shortcuts handling [steelskin]
* fda429fc - [GBA] Do not draw BG tiles from outside of BG VRAM [steelskin]
* 5aa3ea92 - Properly initialize wxAcceleratorTable [steelskin]
* 0e29be87 - Support multiple RAM sizes for MBC7 [steelskin]
* 75b79d91 - Change MBC7 reported RAM size to 512 bytes [steelskin]
* 36e88faf - Fix dsound looping when moving/resizing window [rkitover]
* 019fcda9 - Sanitize and improve the GB header parsing (#1109) [Steelskin]
* 7005b928 - Sanitize allocations in the Game Boy emulator (#1105) [Steelskin]
* 3cef52b7 - Fix pause/next-frame [rkitover]
* d3f8cc17 - Option to suspend the X11 screensaver when running [2306079+multiSnow]
* df819598 - builder: update macOS build to 10.10, Wx 3.2.2.1 [rkitover]
* 1ab46f70 - Update SIOCNT when the link driver is disconnected [steelskin]
* 1d7e8ae4 - build: fix build with new OpenAL [rkitover]
* a9284b3d - workaround for Stuart Little 2 crashing when set to none [danialhorton]
* 166299cd - Implements Read/Writes for HUC3 [danialhorton]
* 640ce453 - Change SOUND_CLOCK_TICKS to 280896 cycles - ~1074 samples per frame [reallibretroretroarch]
* f1d3f631 - Fix automatic dynamic frame skipping [steelskin]
* d756f671 - translations: fix some source strings [stanley.udr.kid]
* 91873254 - Add INI file versioning [steelskin]
* 7d9cb2b5 - Default GBA LCD filter to off. [rkitover]
* be1e5ca1 - Check for wx < 3.2.2 for EGL move fix backport [rkitover]
* 1fb18b32 - Rename appdata to metainfo [polynomial-c]
* ca7ae336 - Fix regression in bios, port DMA fix from libretro [danialhorton]
* b34448c9 - Fix record/play dialogs for native recordings [danialhorton]
* 6307348c - build: support MSVC arm64 cross build on x86 [rkitover]
* 87bdc93e - Revert "translations: use %% instead of percent" [rkitover]
* ab4ae96e - Clarify/set condition: wayland && !wayland_egl [rkitover]
* 8e4acfc9 - Fix build w/wxUSE_GLCANVAS_EGL=0, on Fedora [rkitover]
* 3c41b68d - Fix the Windows ARM64 build [steelskin]
* 22578d02 - Increase MAX_CART_SIZE from 32MiB to 128MiB [rkitover]
## [2.1.5] - 2022-12-15
=======================
* ea2a929f - Backport 800d6ed69b from wx to fix Wayland EGL pos [rkitover]
* c40a1417 - Write vsync toggle msg to debug log not OSD [rkitover]
* 5d2dd01e - Call Layout() after DrawingPanel OnSize event [rkitover]
* da686a48 - Reinit panel on vsync toggle. [rkitover]
* ec27885c - Support EGL VSync on Wayland. [rkitover]
* c27d384a - Enable GL on Wayland for wx 3.2+, no vsync. [rkitover]
* c249115b - build: set -mtune=generic [rkitover]
* 297d7c06 - [hidpi] Use wxWidgets 3.2 on Windows [steelskin]
* 0d86432a - [hidpi] Implement full HiDPI support [steelskin]
* 69d24fb5 - [build][msvc] Fix debug information and set hidpi support [steelskin]
* 90fc3e12 - Default CTRL+I to change interframe blender [rkitover]
* a57d81e1 - Show name of interframe blender not num in OSD [rkitover]
* 13c558ac - Disable wireless link type [rkitover]
* 639003a8 - Show pixel filter name not number on cycle [rkitover]
* 236cffb4 - Make another adjustment to glXQueryExtensions [rkitover]
* 643ec0f7 - Pass DefaultScreen(display) to glXQueryExtensions [rkitover]
* 60d7ead5 - Fix menu state after playing a movie [laqieer]
* d2fee771 - Add VBA Movie Version 2 [laqieer]
* 3f2d3c13 - Remove manual joystick polling [steelskin]
* 7726d26f - Enable full optimizations and fix x86 builds [danialhorton]
* 73223445 - MSVC opt /fp:fast /Oi, intrinsic sqrt() w/ XBRZ. [rkitover]
* 972f1513 - Enable GB colorization hack support in GUI. [danialhorton]
* 1741fa32 - Fix autosaveloadcheat and rename pref [danialhorton]
* a31a7a30 - in Wx, the Option is Enable MMX, make the variable also enableMMX and set its default to on. [danialhorton]
* 983ea451 - Flash : Erased memory is FFh-filled [negativeExponent]
* 18e387d1 - Fix Flash chip's erase operation: erased memory is FFh-filled, not zero-filled. [laqieer]
* c05056ab - HuC3: Update [negativeExponent]
* 93084990 - HuC3: Refactoring to avoid breaking savestates [negativeExponent]
* 05a046e7 - HuC3: Enable battery save, update RTC support [negativeExponent]
* 70477dcd - GBA:Fix serial emulation if compiled with NO_LINK [negativeExponent]
* 15bcad13 - GB:Fix serial emulation when compiled with NO_LINK [negativeExponent]
* 025f3079 - GBA:Fix a few memory read/write issues [negativeExponent]
* 210e79bb - Add descriptions for the 'Interframe Blending' and 'LCD Color Filter' options [jrb22x]
* 8a3456f8 - Default to not change battery on state load. [rkitover]
* b50ff858 - add a missing break in half word reads [danialhorton]
* 064fa7b0 - Fix SDL audio delay [Clownacy]
* 7db3c817 - Fixed SDL audio using the wrong audio specification [Clownacy]
* cb0933bf - Stop changing plane ptrs in rec. audio frames. [rkitover]
* 80634683 - Force a panel update when configuring bilinear. [briansrls]
* 6a714281 - Differentiate between SDL joy index/instance_id. [rkitover]
* 11693d83 - Clean up GB MBC30 check. [rkitover]
* 020daad8 - Fix joy accels when emulation is paused. [rkitover]
* def5d3e4 - Stop timer when game is loaded again. [rkitover]
* e0816b0e - Fix weird input/buttons memory leak. [edenisfa]
* 7031c1d1 - [LINUX,WINDOWS] Key/Joy background input. [edenisfa]
* 84f3e8ce - Allow joystick background input. [edenisfa]
* 40741580 - Add GUI cmd line option for config file. (#724) [Steelskin]
* c169420f - Turbo/throttle config and DirectSound fixes. [rkitover]
* 378c9493 - Fix joystick config when game is loaded. [rkitover]
* 95213a6d - GB: Only use mapperLastTime to see if RTC data was loaded [negativeExponent]
* 86fcffef - GB: Add support for 4MB MBC30 [negativeExponent]
* 2f9933ae - GBA BIOS: ArcTan/ArcTan2 fixes for HLE bios [negativeExponent]
* d9732f68 - Fix clock cycle count for MUL, MLA instructions... (https://github.com/libretro/vba-next/commit/b91f39c787cc99ace97546cb94985f3b658c8b57) - backport Fix clock cycle count for some arm/thumb instructions (https://github.com/libretro/vba-next/commit/5243b2d8064dd2145888ced7cbfe127594ecf6db) - backport Fix base cycle count for MUL, MLA series (https://github.com/libretro/vba-next/commit/b91f39c787cc99ace97546cb94985f3b658c8b57) [negativeExponent]
* c07d5b65 - Fix vram 16/32 bit unaligned reads(backport https://github.com/libretro/vba-next/commit/7f18771165dd4a6d71a598c51d91668920572eaa) [negativeExponent]
* 18c2ea61 - Further fixing Multi Buffer formatting. [briansrls]
* 1e569300 - Addressing audio plugin crash [briansrls]
* 9c314a15 - Use proper string `"wglGetExtensionsStringEXT"`. [edenisfa]
* 3ba05295 - Improve BIOS Math tests score from 425 to 625. [edenisfa]
* 6f2e320d - Improve clock cycle count for THUMB operations. [edenisfa]
* 9e537a8f - Improve cycle count for MUL, MLA. [edenisfa]
* 306f92f5 - Check game kbd input with wxGetKeyState() again. [rkitover]
* 6b257d52 - Avoid override of variable `throttle` for turbo. [edenisfa]
* bd2483ca - Allow changing connection type without restart. [edenisfa]
* d379a076 - Decrease mouse sensitivity for menu hiding. [rkitover]
* 0c5ee994 - Fix PNG capture screen. [edenisfa]
* 1347026d - Turbo config refactor followup. [rkitover]
* 1bced474 - Codesign fix for mac. [rkitover]
* 07064c87 - [Windows,MacOS] Auto-updater refactoring. (#639) [denisfa]
* 09e8da43 - Joystick refactor pt. Deux: Support Joysticks. [rkitover]
* 504ca08b - Hide menubar + minor UI refactor. [rkitover]
* 2868c1b7 - Fix changing aspect ratio option. [rkitover]
* 045e95ab - GB: Support 4MiB MBC30 ROM bank select. [rkitover]
* 0b14e9f8 - [WINDOWS] Add function to open unicode files. (#644) [denisfa]
* 8e3978b3 - Speedup/Turbo/Throttle fixes. [rkitover]
* 166cf446 - Disable menu LCD filter unless playing GB or GBA. [edenisfa]
* 06001069 - Init systemColorMaps after output module init. [edenisfa]
* cd029ae6 - Fix video recording with frame skip enabled. [edenisfa]
* 008aecde - [LINUX] Fix display of `RGB` values on viewers. [edenisfa]
* 834d1537 - Fix accel shortcuts when using some menu options. [edenisfa]
* 994726dd - Do not pause while opening configuration windows. [edenisfa]
* 54335dc6 - [WINDOWS] Fix weird WX errors messages. [edenisfa]
* 7bac34ed - Remove duplicate variable `winFlashSize`. [edenisfa]
* 8d62a790 - Change default options for GB. [edenisfa]
* 99b66e13 - Expose LCD filter for GBA and GB color saturation. [edenisfa]
* c789020e - Fix `Save` button on OAM Viewer for GB and GBA. [edenisfa]
* dcaa1b9a - Fix `Save` button on Tile Viewer for GB and GBA. [edenisfa]
* d05e8fc1 - Make AGBPrint output to our Logging. [edenisfa]
* abb82341 - Allow binding specific server IP. (#633) [rkitover]
* 6c64db07 - cmake: Windows codesigning refactor. [rkitover]
* 4f1a351d - Try to configure vsync for multiple options. [edenisfa]
* ed8a9af2 - Use proper functions and checks for OpenGL VSYNC. [edenisfa]
* 6092082e - Fix Save Failed error for Super Monkey Ball Jr. [54053706+negativeExponent]
* f1099a21 - Check return value of soundInit(). [rkitover]
* 410ede54 - Check for null pointer in soundReset(). [alexjnewt]
* 9d1d707c - Limit ROM size to 32 MiB. [negativeExponent]
* fd319d21 - GB: Check header for a valid ROM file. [negativeExponent]
* 513af13d - Replace `libpng` code for `stb_image` one. [edenisfa]
* 8f48c1f0 - Fix weird `wxWidgets>=3.0` error message. [edenisfa]
* 2f065382 - Enable XAudio2 for Windows vcpkg build. [rkitover]
* a3203770 - Fix: a issue with loading e-Reader dot code (#608) [sony.pcv.s520]
* 83614290 - Turn on winsparkle update checking support. [rkitover]
* 4aab08c4 - Set link timeout default to 500ms, fix prev. dflt. [rkitover]
* 136c094f - Add option to set link network port. [rkitover]
* f69febfd - Add `.wav` support for sound recording. [edenisfa]
* 6a8a9e62 - Fix integer overflow in cheatsImportGSACodeFile length check. [zack.ref]
* b50d4845 - GBA: Fix crash when new size is larger than rom size after soft-patching [negativeExponent]
* 9e1a63af - support for patches in BPS format [ArtiiP]
* 72d0725b - Allow game window to resize on-the-fly when enabling/disabling borders [negativeExponent]
* 225e4dc9 - Remove top border black line when using filters. [edenisfa]
* 0535d5c7 - Optimize CRC32. [mudlord]
* 4bc9bb84 - Implement joystick rumble. #522 [rkitover]
* 384f4487 - Fix key accel overriding menus and dialogs. [edenisfa]
* af0de1c4 - xbrz: fix inline asm check [rkitover]
## [2.1.4]
=======================
* c93e017d - builder: minor changes to support mac 32 bit (4 days ago)
* c1636d1b - builder: fixes for ffmpeg + misc. (4 days ago)
* aec23e35 - builder: re-enable ffmpeg, update dists (2 weeks ago)
* 806dd7da - Fix circular `--config` for SDL port. (7 days ago)
* 1aa8afb4 - Drop dead code entirely. (7 days ago)
* 531172c4 - Fix displaying of link menu when `ENABLE_LINK=NO`. (2 weeks ago)
* 07107096 - [Windows] Fix crash when setting weekly updates. (2 weeks ago)
* efa09bdb - Add faster sqrt code for xBRZ filters. (2 weeks ago)
* 10f5576e - Fix config file when removing system accels. (3 weeks ago)
* 1c6b0168 - [Windows] Fix remaining UTF-8 issues. (3 weeks ago)
* a2f3126e - transifex pull (3 weeks ago)
* 1e9d1675 - builder: pause before codesigning for win targets (3 weeks ago)
* 0af5965e - builder: work on linux static binary (3 weeks ago)
* 33c43e3a - add -p:BuildInParallel=true to appveyor.yml (3 weeks ago)
* 61141ebd - add -p:BuildInParallel=true to VS instructions (3 weeks ago)
* 9ee6b54a - cmake: remove invalid opt /std:c++11 for MSVC (3 weeks ago)
* 0f2c8cab - win: check APPDATA if LOCALAPPDATA is not found (3 weeks ago)
* 32fbfec4 - transifex pull (3 weeks ago)
* cc516229 - transifex push/pull (4 weeks ago)
* 528c37f9 - Allow "Browse" to be translated. (4 weeks ago)
* d8c981fb - Fix toggles for video/audio layer options on menu. (4 weeks ago)
* c0f96425 - Show all commands available on menu. (4 weeks ago)
* 51fa150f - Adjust MMX menu variable and position. (4 weeks ago)
* 27b038b3 - Show messages about operations of state slot. (4 weeks ago)
* 2e248457 - Allow translation of the words `Open` and `Quit`. (4 weeks ago)
* 54991c5b - Add extra keys default input when using GUI. (4 weeks ago)
* b358c051 - Fix compilation issue when `ENABLE_DEBUGGER=Off`. (4 months ago)
* 2a2be953 - builder: msys2 fixes (4 weeks ago)
* f1438e0f - Check ASAN support when `ENABLE_ASAN=ON`. (4 weeks ago)
* ade64db7 - transifex pull (4 weeks ago)
* 8b347050 - cmake: check for ffmpeg >= 4.0.4 (4 weeks ago)
* 0b9c7710 - travis: more ubuntu dists, fix mac cache (5 weeks ago)
* d9e4a087 - build fixes: ffmpeg, xbrz, travis, C++ version (5 weeks ago)
* 23224fba - update factory reset instructions in README.md (5 weeks ago)
* 381a7bfe - /std:c++latest for MSVC, fix bool flip, warn opts (5 weeks ago)
* 234f1e9b - Update to xBRZ `1.7`. (6 weeks ago)
* 290012d1 - transifex pull (6 weeks ago)
* 06a9d786 - Allow UPS patch for GBA games. (6 weeks ago)
* 1949cdb3 - transifex push/pull (6 weeks ago)
* 03121c69 - Add support for autohold buttons. (6 weeks ago)
* e87213e3 - Fix indentation. (6 weeks ago)
* cf47942f - Fix Autofire {L,R}. (6 weeks ago)
* 4993cb88 - remove tea-ci .drone.yml and installer.nsi (6 weeks ago)
* d9a7e0c9 - cmake: auto-detect sfml, ffmpeg and openal (6 weeks ago)
* c64dd259 - Update README.md (6 weeks ago)
* 8ceef90f - fix appveyor visual studio build (6 weeks ago)
* a8b7b72d - transifex pull (6 weeks ago)
* f5eabb35 - builder: disable LTO on 64 bit mingw (6 weeks ago)
* fc2eb38f - Fix behaviour of `Tools` > `Memory Viewer` (#486) (6 weeks ago)
* 2958af01 - builder: mingw improvements + misc. (6 weeks ago)
* 3923b28f - transifex pull/push (6 weeks ago)
* 51f61a3a - Merge remote-tracking branch 'vbam-libretro/master' (6 weeks ago)
* 6bdd6d1b - Merge pull request #77 from negativeExponent/fix_cheat_search (7 weeks ago)
* dc8d36a0 - minor fix for stl wx builds (7 weeks ago)
* 51a4f74b - Merge remote-tracking branch 'vbam-libretro/master' (7 weeks ago)
* 9ccdeac3 - Add missing break; lines for switch statements (7 weeks ago)
* b8afa8c5 - Merge pull request #76 from RobLoach/intl (7 weeks ago)
* a17eb471 - Merge branch 'master' of github.com:fpscan/vbam-libretro into intl (7 weeks ago)
* 9b043daa - libretro: Update core options API (7 weeks ago)
* 6b18c1f9 - Fix warning about frames left in queue. (8 weeks ago)
* f5b19475 - [IDEA] Fix recording when using `speedup/turbo`. (8 weeks ago)
* 738494a2 - Support all sample rate available on GUI. (8 weeks ago)
* aa3ecaf7 - Add new output formats for recording audio/video. (9 weeks ago)
* 5848feae - Fix video/audio recording. (2 months ago)
* 9e3c2615 - Update libretro_core_options.h (7 weeks ago)
* 6c60ac33 - Turkish Language option (7 weeks ago)
* d92ca688 - Merge pull request #74 from retro-wertz/update (7 weeks ago)
* ad43b32b - Fix "index out of bounds" runtime error (7 weeks ago)
* 36f3a739 - Merge pull request #73 from retro-wertz/libretro_cleanup (8 weeks ago)
* 82e723a5 - MBC3: Update mapper to check if RTC is present before running RTC functions (8 weeks ago)
* 03184dd5 - libretro: Use GB RTC data when available (8 weeks ago)
* b3744b3b - Simplify GB border core option (8 weeks ago)
* 9757a880 - Core options cleanup and a few readability-related updates (8 weeks ago)
* cfb03d8b - Set default keybinding when key does not exist. (9 weeks ago)
* 1ef09126 - Merge pull request #72 from retro-wertz/enable_rtc (8 weeks ago)
* 496b372d - Allow enabling GBA RTC regardless of rom types (8 weeks ago)
* 4dbdf87d - Merge pull request #71 from retro-wertz/patch-3 (8 weeks ago)
* bb109544 - Update Makefile (8 weeks ago)
* 3e640443 - Merge pull request #70 from retro-wertz/update_makefiles (8 weeks ago)
* 98313652 - Update Makefile (8 weeks ago)
* 34de0579 - Merge pull request #67 from retro-wertz/update_makefiles (8 weeks ago)
* 71e4b7b3 - Merge pull request #69 from retro-wertz/master (8 weeks ago)
* d9f8396c - Cleanup (8 weeks ago)
* 9a134497 - Update Makefiles (8 weeks ago)
* 38b7613e - Setting up basic appveyor (9 weeks ago)
* 408cab71 - Merge pull request #66 from retro-wertz/libretro (9 weeks ago)
* d8982881 - Automatically hide some core options depending on rom image type (9 weeks ago)
* c3edd6d4 - Merge pull request #65 from retro-wertz/libretro (9 weeks ago)
* 2084a63e - Update GB/GBC memory maps (retro_memory_descriptors) (9 weeks ago)
* 90b051ee - Update libretro_core_options.h (9 weeks ago)
* a727e222 - GB: Rename this variable to isolate from a global variable of the same name (10 weeks ago)
* 0d423b98 - Cleanup GB palette struct and update retro_get_memory_data/size (10 weeks ago)
* bc80ecdb - UtilRetro.cpp: Cleanup (10 weeks ago)
* 855db11d - Fix wxWidgets assertion error on `Logging...` menu. (10 weeks ago)
* c886b6a1 - remove wrong and unnecessary #define (10 weeks ago)
* 38561b57 - Merge remote-tracking branch 'vbam-libretro/master' (2 months ago)
* 770b9c1c - Add left analog bind to D-PAD for joystick. (2 months ago)
* 6de45d4e - Set default binding for keyboard. (3 months ago)
* 78bbe148 - Add individual clear buttons for input config. (3 months ago)
* 53002e54 - Use hats from joystick as default D-PAD. (3 months ago)
* 57b7ddf5 - Fix small memory leak. (3 months ago)
* 060da968 - [LINUX] Add option to disable the online updater. (3 months ago)
* dbb5914f - Show which BIOS file is currently selected. (3 months ago)
* 76756ef9 - Fix key shortcuts for toggle menu actions. (3 months ago)
* 4622f1b8 - Whitespace fix. (3 months ago)
* 3dc738b5 - Set default keys for input on first run. (3 months ago)
* 9bc8f33c - Disable using volume {+,-} actions in main menu. (3 months ago)
* d1fcffc8 - Merge pull request #63 from retro-wertz/fix_gba_siocnt (2 months ago)
* 7df7b190 - Merge pull request #64 from retro-wertz/patch-2 (2 months ago)
* 7f105da3 - Update README.md (2 months ago)
* 53ce6fb0 - libretro: add SIO Control register (GBA) (2 months ago)
* 2e96f59e - Merge pull request #62 from retro-wertz/gb_timing_updates (2 months ago)
* e50812dc - GB: input, audio, video timing updates (2 months ago)
* 1532f555 - GB: Reduce input lag by 1 frame, video and audio timing updates... (2 months ago)
* f09a9aa9 - builder: add python3 to msys2 deps (2 months ago)
* 2fcad3f8 - joysticks: hack to better support 360 triggers (3 months ago)
* 352eb149 - Merge remote-tracking branch 'vbam-libretro/master' (3 months ago)
* 2e97b27f - Use --config option to load configuration file. (3 months ago)
* bdd43868 - Merge pull request #61 from retro-wertz/gb (3 months ago)
* bd5ba431 - Cleanup: Remove previous core option struct and unused variables etc (3 months ago)
* aac30c72 - Add GB Color Correction core option (3 months ago)
* 02a7a48b - GB: Fix selected palette not applied when loading content... (3 months ago)
* 8462ca76 - Merge pull request #59 from retro-wertz/gb (3 months ago)
* 1fa78e69 - Fix android build (3 months ago)
* 6dcf016d - GB: Allow support for colorizer patched games - a new core option is provided since enabling this support means allowing invalid access to vram and palette - works in GBC/GBA hardware mode only (3 months ago)
* 85bd86cf - GB: Send LCD interrupt only if there is no INT 48h signal (3 months ago)
* b147e912 - Merge pull request #57 from retro-wertz/sync (3 months ago)
* d808297b - Fix crash caused by incorrect variable index for analog sticks (3 months ago)
* 7e882898 - libretro: Add core option sublabels (3 months ago)
* ce11403b - builder: updates for mingw (3 months ago)
* c5e6a340 - Libretro: Update GBC memory map (3 months ago)
* fa45ccdf - builder: fix command(), update c2man url (3 months ago)
* e64b9904 - builder: fix msys2 (3 months ago)
* 58022078 - builder: make zip + sig on win + minor changes (3 months ago)
* 296255d4 - handle SDL joystick query errors #451 (3 months ago)
* 95658f57 - transifex sync (3 months ago)
* 86c4dc7d - transifex sync (3 months ago)
* bcc8b540 - transifex sync (3 months ago)
* 7569242f - Fix pause behaviour with `Pause when inactive`. (3 months ago)
* 030740ee - Fix some memory leak. (3 months ago)
* 8ea607e1 - remove translation from joystick keys (3 months ago)
* cec32a61 - travis: mac: disable --help check, it segfaults (3 months ago)
* f54dd25b - travis: fix gettext on mac + brew (3 months ago)
* e2f06210 - update Visual Studio support (3 months ago)
* 91501bec - Fix small memory leak. (3 months ago)
* c366907f - Temporary fix for #65. (3 months ago)
* d585a610 - followup on kbd trans issues fix in 30b92724 (3 months ago)
* eaf1ad24 - Merge remote-tracking branch 'vbam-libretro/master' (3 months ago)
* 30b92724 - hopefully fix kbd control translation issues (3 months ago)
* 90b3f354 - Add hotkeys for changing sizes (1x ... 6x). (3 months ago)
* fa77010f - Fix pause toggle keybinding when unmuting. (3 months ago)
* 8cb42003 - Merge pull request #56 from webgeek1234/master (3 months ago)
* 8b8efa1b - fix key shortcuts for save/load states (3 months ago)
* 9fa20b49 - joystick cleanups #444 (3 months ago)
* 684b1bb7 - fix mem error for config global `homeDir` (3 months ago)
* ccc91fa0 - quick fix for unicode filenames on windows (3 months ago)
* dfa4fec3 - Fix missing shortcuts from key bindings. (4 months ago)
* 69b581f7 - Handle key{bindings,shortcuts} correctly on frame. (4 months ago)
* cec1dbfd - Split configuration for default keys. (4 months ago)
* d655031a - Fix removing multiple system keys shortcuts. (4 months ago)
* 996d5b9d - Do not set these options on `MainMenu.xrc`. (4 months ago)
* 019ab5a7 - Fix "Joybus host invalid; disabling" warning. (3 months ago)
* f6bfe676 - Have better support for maximized window. (4 months ago)
* dcc0afa0 - Fix window size when {en,dis}abling status bar. (4 months ago)
* bf6f2d4a - Change where the config dir is created. (4 months ago)
* 3490620e - travis: use Mac OS 10.14 and Xcode 10.2.1 (4 months ago)
* b0ec8469 - fix stuck keys on ubuntu and on focus loss #142 (4 months ago)
* 3d57750c - Follow-up work on #142. (4 months ago)
* 055b7c4d - libretro: jni: Switch to clang compiler in preparation for ndk r20 (4 months ago)
* 2e1333e1 - regparm is an x86 only attribute, only define it there (4 months ago)
* 500506cb - travis: disable link/SFML for mac (4 months ago)
* 22307de6 - Fix continuous sprinting when using a modifier key as a mapping key (#142). (4 months ago)
* 50459712 - wx: only rename config if new file doesn't exist (5 months ago)
* 0a95486f - Sound.cpp: Update (5 months ago)
* a4eae802 - cmake: use LEGACY OpenGL on FreeBSD only 2fedaa63 (5 months ago)
* 240257a0 - wx: Change max volume from 400 to 200 (5 months ago)
* 57ed465e - builder: better mac automation (5 months ago)
* 15f040f3 - cmake: missing space in wx util function (5 months ago)
* 2fedaa63 - support FreeBSD (5 months ago)
* a0c375b6 - Merge remote-tracking branch 'vbam-libretro/master' (6 months ago)
* c013d499 - Merge pull request #55 from Classicmods/master (6 months ago)
* a8b38681 - remove some old visual studio project files (6 months ago)
* b6bb24e0 - Merge pull request #1 from libretro/master (6 months ago)
* 5012969a - Bump version to 2.1.1 (7 months ago)
* 755f4767 - Fix #52 (8 months ago)
* f87e0850 - added a8a35 (7 months ago)
* 286c8ff4 - Fix #52 (8 months ago)
## [2.1.3] Windows Geometry Fix
=======================
* ac35e37c - fix game geometry on windows (4 hours ago)

File diff suppressed because it is too large Load Diff

View File

@ -1,53 +1,95 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}, {
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}, {
"name": "x86-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}, {
"name": "x86-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}
]
}
{
"configurations": [
{
"name": "x64-static-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_SDL=TRUE"
}, {
"name": "x64-static-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_SDL=TRUE"
}, {
"name": "x64-static-RelWithDebInfo",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"msvc_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_SDL=TRUE"
}, {
"name": "x86-static-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows-static -DENABLE_SDL=TRUE"
}, {
"name": "x86-static-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows-static -DENABLE_SDL=TRUE"
}, {
"name": "x86-static-RelWithDebInfo",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x86-windows-static -DENABLE_SDL=TRUE"
}, {
"name": "arm64-static-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_arm64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=arm64-windows-static -DENABLE_SDL=TRUE"
}, {
"name": "arm64-static-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_arm64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=arm64-windows-static -DENABLE_SDL=TRUE"
}, {
"name": "arm64-static-RelWithDebInfo",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"msvc_arm64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=arm64-windows-static -DENABLE_SDL=TRUE"
}
]
}

396
DEVELOPER-MANUAL.md Normal file
View File

@ -0,0 +1,396 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [visualboyadvance-m Developer Manual](#visualboyadvance-m-developer-manual)
- [Issues Policies](#issues-policies)
- [Processing New Issues](#processing-new-issues)
- [Resolving Issues](#resolving-issues)
- [Pull Request and Commit Policies](#pull-request-and-commit-policies)
- [Commit Message](#commit-message)
- [Collaboration on a Branch](#collaboration-on-a-branch)
- [Commits from Maintainers](#commits-from-maintainers)
- [Miscellaneous](#miscellaneous)
- [Debug Messages](#debug-messages)
- [Release Process](#release-process)
- [Certificates](#certificates)
- [Release Commit and Tag](#release-commit-and-tag)
- [64-bit Windows Binary](#64-bit-windows-binary)
- [32-bit Windows Binary](#32-bit-windows-binary)
- [ARM64 Windows Binary](#arm64-windows-binary)
- [macOS Binary](#macos-binary)
- [Final steps](#final-steps)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## visualboyadvance-m Developer Manual
Here we will keep notes about our development process, policies and environment
setup guides.
### Issues Policies
#### Processing New Issues
Follow the following steps to process newly submitted issues:
- Edit the user's post to remove unused template sections etc.. Rephrase the
issue title if it needs to be clarified.
- Label the issue as a question, bug or enhancement. This label can be changed
later upon clarification if necessary.
- Add any other relevant labels, for example for the code subsystem.
- If it is strongly related to a work by a developer that you know of, assign
them to the issue. If this is not the case, they can be unassigned.
- Ask the user for clarification of any details if needed.
#### Resolving Issues
- An issue is resolved by closing it in github. A commit that fixes the issue
should have the following line near the end of the body of the commit message:
```
Fix #999.
```
This will automatically close the issue and assign the closing commit in the
github metadata when it is merged to master. The issue can be reopened if
needed.
- A commit that is work towards resolving an issue, should have the issue number
preceded by a pound sign either at the end of a commit message title, if it is
of primary relevance to the issue, or the body otherwise.
### Pull Request and Commit Policies
#### Commit Message
Follow these guidelines always:
https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
, the description of your work should be in the **commit message NOT the pull
request description**.
The title line must be no more than 50 characters and the description must be
wrapped at 72 characters. Most commit message editor interfaces will help you
with this. The title line must not end with a period.
Write everything in the imperative mood, e.g. change, fix, **NOT** changes,
changed, fixed, fixes etc..
A commit message must always have a title and a description, the description
must be independent of the title line, if necessary repeat the information in
the title line in the description.
Make sure the git history in your branch is clean and logical, edit when
necessary with `rebase -i`.
Use one commit per logical change if necessary, most work can be squashed into
one commit when you are done. It is not necessary to have separate commits
per-file if they are one logical change. We are less strict about this than
other projects, fewer is better.
The commit title line should be prefixed with an area, unless it involves the
wxWidgets GUI app, in which case it should **NOT** have a prefix.
If the commit is a user-facing functionality change or enhancement, the title
line of the commit must be a non-technical description of this change. For
example "Mute on speedup" because this will go into the changelog.
The text after the area prefix should not be capitalized.
Please use one of these area prefixes for non-main-GUI-app commits:
- doc: documentation, README.md etc.
- build: cmake, installdeps, preprocessor compatibility defines, compatibility
headers, etc.
- gb: the GameBoy emulator core
- gba: the GameBoy Advance emulator core
- libretro: the libretro core glue and build
- sdl: anything for the SDL port
- translations: anything related to translations
. Add other areas here if needed.
If a commit fixes a regression, use a title line such as:
```console
Fix regression <PROBLEM> in <SHORT-SHA>
```
, you can get the short sha from `git log --oneline -100` or similar.
The commit description for a regression must refer to the breaking change in
reference format, which you can get from e.g. `git log --format=reference -20`.
You can refer to github issues using `#<ISSUE-NUMBER>` freely in the description
text.
If a commit fixes an issue, add a line at the end of the description such as:
```console
Fix #<ISSUE-NUMBER>.
```
.
#### Collaboration on a Branch
To update when multiple people are working on a git branch, keep a couple of
things in mind:
- Always `push -f` unless you're adding a commit on top. And it's almost always
better to edit the history than to add more commits. Never add commits fixing
previous commits, only improving or adding to them.
- To update when someone else updated the branch with a `push -f`
```bash
git status # should be clean, with your work having been already pushed
git fetch --all --prune
git reset --hard origin/<branch-name>
```
.
- While actively working on a branch, keep it rebased on top of master.
#### Commits from Maintainers
Maintainers and project members have the power to commit directly to master.
This power must be used responsibly.
Make your best attempt to follow these general guidelines to keep our
history clean:
- Things that are a minor fix or improvement that does not require discussion
can be committed directly, keeping the following guidelines in mind.
- Bigger new features, code refactors and changes in architecture should go
through the PR process.
- Push code changes to a branch first, so they can run through the CI. When you
open the commit in GitHub there is a little icon in the upper left corner that
shows the CI status for this commit. Differences in what different compilers
allow is a problem that comes up **VERY** frequently. As well as
incompatibilities between different configurations for both the C++ code and
any supporting code.
### Miscellaneous
#### Debug Messages
We have an override for `wxLogDebug()` to make it work even in non-debug builds
of wx and on windows, even in mintty.
It works like `printf()`, e.g.:
```cpp
int foo = 42;
wxLogDebug(wxT("the value of foo = %d"), foo);
```
From the core etc. the usual:
```cpp
fprintf(stderr, "...", ...);
```
, will work fine.
You need a debug build for this to work or to even have a console on Windows.
Pass `-DCMAKE_BUILD_TYPE=Debug` to cmake.
### Release Process
#### GnuPG Key
You will need to create a GnuPG key for signing your commits and release tags,
and upload it to a keyserver.
Make sure to install GnuPG on all environments where you will be making commits
and tags.
#### Certificates
Make sure you have set up a Windows code signing certificate with the right
password and a Mac 'Developer ID Application' certificate.
Put the Windows certificate into `~/.codesign/windows_comodo.pkcs12` as a PKCS12
file that is password protected, and put the password for it into
`~/.codesign/windows_comodo.pkcs12.password`.
#### Release Commit and Tag
Once you are sure you're ready to release, and you are in a git clone on master
with a clean working tree, use the cmake script to make the release commit and
tag:
```bash
mkdir build && cd build
cmake .. -DTAG_RELEASE=TRUE
```
, follow the instructions to edit the `CHANGELOG.md` and then push the release:
To reiterate, **make sure you edit the `CHANGELOG.md`** to remove any
non-user-facing changes before you make the release commit.
```bash
git push
git push --tags
```
If you don't want to push the release, to back out the change do:
```bash
cmake .. -DTAG_RELEASE=UNDO
```
#### 64-bit Windows Binary
For this you will preferably need the PowerShell environment setup described
[here](https://github.com/rkitover/windows-dev-guide), or by starting the `x64
Native Tools Command Prompt` from your Start Menu.
```powershell
mkdir build-msvc64
cd build-msvc64
cmake .. -DCMAKE_BUILD_TYPE=Release -DUPSTREAM_RELEASE=TRUE -G Ninja
ninja
```
Collect the following files for the release:
- `visualboyadvance-m-Win-x86_64.zip`
- `translations.zip`
Repeat the process for the debug build, with `-DCMAKE_BUILD_TYPE=Debug` and
collect this file:
- `visualboyadvance-m-Win-x86_64-debug.zip`
.
#### 32-bit Windows Binary
The 32-bit build is a legacy build for Windows XP compatibility. You will need
the MinGW toolchain to build it. The easiest method is to use the MINGW32 MSYS2
environment.
Make sure the Visual Studio `signtool.exe` is in your path, you can start MSYS2
with an inherited `PATH` from a Visual Studio enabled environment or add it to
your shell configuration.
First install dependencies with:
```bash
./installdeps
```
. Then build the 32-bit binary as follows:
```bash
mkdir build-mingw32
cd build-mingw32
cmake .. -DCMAKE_BUILD_TYPE=Release -DUPSTREAM_RELEASE=TRUE -G Ninja
ninja
```
. Collect this file for the release:
- `visualboyadvance-m-Win-x86_32.zip`
. Then repeat the process for the debug build with `-DCMAKE_BUILD_TYPE=Debug`,
and collect this file:
- `visualboyadvance-m-Win-x86_32-debug.zip`
.
#### ARM64 Windows Binary
You will need the MSVC ARM64 cross toolchain to build this binary, if you used
the install script from [here](https://github.com/rkitover/windows-dev-guide)
you will have it installed, otherwise run Visual Studio Installer and install
the component.
To enter the ARM64 cross environment, edit the PowerShell profile described
[here](https://github.com/rkitover/windows-dev-guide) or use the `vcvarsall.bat`
script with the `amd64_arm64` argument as described
[here](https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170).
From there the process is the same as for the 64-bit build, collect the
following files for the release:
- `visualboyadvance-m-Win-arm64.zip`
- 'visualboyadvance-m-Win-arm64-debug.zip'
.
#### macOS Binary
Install the latest Xcode for your OS.
You will need bash from Homebrew/nix/MacPorts/whatever to run the build script.
You will need a codesigning certificate from Apple, which you will be able to
generate once you join their developer program from XCode. This is the
certificate of the type 'Developer ID Application' stored in your login
keychain.
If you are not using a GUI session, you will need to use a method to unlock your
login keychain before building so that your codesigning certificate can be used.
Adding the certificate and key to the System keychain is also a method that some
people use.
To unlock your keychain on login, you can add something like this to your
`~/.zshrc`:
```bash
security unlock-keychain -p "$(cat ~/.login-keychain-password)" login.keychain
```
, with your login password in that file.
For notarization to work, you will need to create an app-specific password on
https://appleid.apple.com , get your Team ID from your Apple Developer account,
and store them with this command:
```bash
xcrun notarytool store-credentials AC_PASSWORD \
--apple-id you@domain.com \
--team-id <DeveloperTeamID> \
--password <secret_app_specific_2FA_password>
```
. Once all of this is set up, run:
```bash
tools/osx/builder
```
, this will take a while because it builds all of the dependencies.
Collect the following files from `~/vbam-build-mac-64bit/project`:
- `visualboyadvance-m-Mac-x86_64.zip`
- `visualboyadvance-m-Mac-x86_64-debug.zip`
.
#### Final steps
Go to the github releases tab, and make a release for the tag you pushed
earlier.
Put any notes to users and distro maintainers into the description as well as
the generated entries from `CHANGELOG.md` you edited earlier.
Upload all files collected during the earlier builds, the complete list is:
- `translations.zip`
- `visualboyadvance-m-Win-x86_64.zip`
- `visualboyadvance-m-Win-x86_64-debug.zip`
- `visualboyadvance-m-Win-x86_32.zip`
- `visualboyadvance-m-Win-x86_32-debug.zip`
- `visualboyadvance-m-Win-arm64.zip`
- 'visualboyadvance-m-Win-arm64-debug.zip'
- `visualboyadvance-m-Mac-x86_64.zip`
- `visualboyadvance-m-Mac-x86_64-debug.zip`
Update the winsparkle `appcast.xml` by running this cmake command:
```bash
cmake .. -DUPDATE_APPCAST=TRUE
```
, follow the instructions to push the change to the web data repo.
Announce the release on reddit r/emulation and the forum.

287
README.md
View File

@ -3,7 +3,12 @@
- [Visual Boy Advance - M](#visual-boy-advance---m)
- [System Requirements](#system-requirements)
- [Building](#building)
- [Building a Libretro core](#building-a-libretro-core)
- [Visual Studio Support](#visual-studio-support)
- [Visual Studio Code Support](#visual-studio-code-support)
- [Dependencies](#dependencies)
- [Cross compiling for 32 bit on a 64 bit host](#cross-compiling-for-32-bit-on-a-64-bit-host)
- [Cross Compiling for Win32](#cross-compiling-for-win32)
- [CMake Options](#cmake-options)
@ -14,69 +19,137 @@
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
[![Join the chat at https://gitter.im/visualboyadvance-m/Lobby](https://badges.gitter.im/visualboyadvance-m/Lobby.svg)](https://gitter.im/visualboyadvance-m/Lobby)
[![Build Status](https://travis-ci.org/visualboyadvance-m/visualboyadvance-m.svg?branch=master)](https://travis-ci.org/visualboyadvance-m/visualboyadvance-m)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/16096/badge.svg)](https://scan.coverity.com/projects/visualboyadvance-m-visualboyadvance-m)
Our bridged Discord server is [Here](https://discord.gg/EpfxEuGMKH).
We are also on *`#vba-m`* on [Libera IRC](https://libera.chat/) which has a [Web
Chat](https://web.libera.chat/).
[![Get it from flathub](https://dl.flathub.org/assets/badges/flathub-badge-en.svg)](https://flathub.org/apps/com.vba_m.visualboyadvance-m)
[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/visualboyadvance-m)
***Want to know where you can install visualboyadvance-m in your linux distribution?***
[![Packaging status](https://repology.org/badge/vertical-allrepos/visualboyadvance-m.svg)](https://repology.org/project/visualboyadvance-m/versions)
# Visual Boy Advance - M
Game Boy Advance Emulator
Game Boy and Game Boy Advance Emulator
Homepage and Forum: http://vba-m.com
The forums are [here](https://board.visualboyadvance-m.org/).
Windows and Mac builds are in the [releases tab](https://github.com/visualboyadvance-m/visualboyadvance-m/releases).
Daily Ubuntu packages here: https://code.launchpad.net/~sergio-br2/+archive/ubuntu/vbam-trunk
Nightly builds for Windows and macOS are at [https://nightly.visualboyadvance-m.org/](https://nightly.visualboyadvance-m.org/).
Your distribution may have packages available as well, search for "vbam" or "visualboyadvance-m".
**PLEASE TEST THE NIGHTLY OR MASTER WITH A FACTORY RESET BEFORE REPORTING
ISSUES**
Your distribution may have packages available as well, search for
`visualboyadvance-m` or `vbam`.
It is also generally very easy to build from source, see below.
If you are using the windows binary release and you need localization, unzip
the `translations.zip` to the same directory as the executable.
## Note for Windows Users
If you are having issues, try resetting the config file first, go to `Help ->
Factory Reset`.
If you are having issues, try resetting your config file first.
## System Requirements
- open file explorer
- in the location bar, type `%USERPROFILE%\AppData\Local` and press enter
- delete the directory called `visualboyadvance-m`
Windows XP, Vista, 7, 8.1 or 10/11, Linux distros or macOS.
2Ghz x86 (or x86-64) Intel Core 2 or AMD Athlon processor with SSE, Snapdragon 835
or newer CPU compatible with Arm for Windows.
- Just a guideline, lower clock speeds and Celeron processors may be able to run at full
speed on lower settings, and Linux based ARM Operating systems have wider CPU support.
DirectX June 2010 Redist
[Full](https://www.microsoft.com/en-au/download/details.aspx?id=8109) /
[Websetup](https://www.microsoft.com/en-au/download/details.aspx?id=35) for
Xaudio (Remember to uncheck Bing on the websetup.)
## Building
The basic formula to build vba-m is:
```shell
```bash
cd ~ && mkdir src && cd src
git clone https://github.com/visualboyadvance-m/visualboyadvance-m.git
cd visualboyadvance-m
./installdeps
# ./installdeps will give you build instructions, which will be similar to:
./installdeps # On Linux or macOS
mkdir build && cd build
cmake ..
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja
ninja
```
`./installdeps` is supported on MSYS2, Linux (Debian/Ubuntu, Fedora, Arch,
Solus, OpenSUSE, Gentoo and RHEL/CentOS) and Mac OS X (homebrew, MacPorts or
Fink.)
## Building a Libretro core
Clone this repo and then,
```bash
cd src/libretro
make -j`nproc`
```
`./installdeps` is supported on MSys2, Linux (Debian/Ubuntu, Fedora, Arch,
Solus and RHEL/CentOS) and Mac OS X (homebrew, macports or fink.)
Copy `vbam_libretro.so` to your RetroArch cores directory.
The Ninja cmake generator is also now supported, including on msys2 and Visual Studio.
### Visual Studio Support
## Visual Studio Support
For visual studio, dependency management is handled automatically with vcpkg,
just clone the repository with git and build with cmake. You can do this from
the developer command line as well. 2019 will not work yet for building
dependencies, but you can build the dependencies in 2017 and then use the
project from 2019.
From the Visual Studio GUI, just clone the repository with git and build with
the cmake configurations provided.
If the GUI does not detect cmake, go to `File -> Open -> CMake` and open the
`CMakeLists.txt`.
If you are using 2017, make sure you have all the latest updates, some issues
with cmake projects in the GUI have been fixed.
You can also build from the developer command prompt or powershell with the
environment loaded.
Using your own user-wide installation of vcpkg is supported, just make sure the
environment variable `VCPKG_ROOT` is set.
### Dependencies
To build in the Visual Studio `x64 Native Tools Command Prompt`, use something
like this:
```
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja
ninja
```
.
## Visual Studio Code Support
Make sure the
[C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
and [CMake
Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
extensions are installed.
Add the following to your `settings.json`:
```json
{
"cmake.configureOnOpen": true,
"cmake.preferredGenerators": [ "Ninja" ]
}
```
.
## Dependencies
If your OS is not supported, you will need the following:
@ -84,22 +157,21 @@ If your OS is not supported, you will need the following:
- [make](https://en.wikipedia.org/wiki/Make_(software))
- [CMake](https://cmake.org/)
- [git](https://git-scm.com/)
- nasm (optional, for 32 bit builds)
- [nasm](https://www.nasm.us/) (optional, for 32 bit builds)
And the following development libraries:
- [zlib](https://zlib.net/) (required)
- [mesa](https://mesa3d.org/) (if using X11 or any OpenGL otherwise)
- ffmpeg (optional, for game recording)
- gettext and gettext tools (optional, with ENABLE_NLS)
- png (required)
- [SDL](https://www.libsdl.org/)2 (required)
- [ffmpeg](https://ffmpeg.org/) (optional, at least version `4.0.4`, for game recording)
- [gettext](https://www.gnu.org/software/gettext/) and gettext-tools
- [SDL2](https://www.libsdl.org/) (required)
- [SFML](https://www.sfml-dev.org/) (optional, for link)
- OpenAL (optional, a sound interface)
- [wxWidgets](https://wxwidgets.org/) (required, 2.8 is still supported, --enable-stl is supported)
- [openal-soft](https://kcat.strangesoft.net/openal.html) (required, a sound interface)
- [wxWidgets](https://wxwidgets.org/) (required for GUI, 2.8 and non-stl builds are no longer supported)
On Linux and similar, you also need the version of GTK your wxWidgets is linked
to (usually 2 or 3).
to (usually 2 or 3) and the xorg development libraries.
Support for more OSes/distributions for `./installdeps` is planned.
@ -113,104 +185,57 @@ This is supported on Fedora, Arch, Solus and MSYS2.
`./installdeps` takes one optional parameter for cross-compiling target, which
may be `win32` which is an alias for `mingw-w64-i686` to target 32 bit Windows,
or `mingw-gw64-x86_64` for 64 bit Windows targets.
or `mingw-w64-x86_64` for 64 bit Windows targets.
The target is implicit on MSys2 depending on which MINGW shell you started (the
value of `$MSYSTEM`.) It will not run in the MSys shell.
The target is implicit on MSYS2 depending on which MINGW shell you started (the
value of `$MSYSTEM`.)
On Debian/Ubuntu this uses the MXE apt repository and works really well.
On Fedora it can build using the Fedora MinGW packages, albeit with wx 2.8, no
OpenGL support, and no Link support for lack of SFML.
On Arch it currently doesn't work at all because the AUR stuff is completely
broken, I will at some point redo the arch stuff to use MXE as well.
On Debian/Ubuntu this uses the MXE apt repository and works quite well.
## CMake Options
The CMake code tries to guess reasonable defaults for options, but you can
override them on the cmake command with e.g.:
override them, for example:
```shell
cmake .. -DENABLE_LINK=NO
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_LINK=NO -G Ninja
```
Of particular interest is making **RELEASE** or **DEBUG** builds, the default
mode is **RELEASE**, to make a **DEBUG** build use something like:
```shell
cmake .. -DCMAKE_BUILD_TYPE=Debug
```
Here is the complete list:
. Here is the complete list:
| **CMake Option** | **What it Does** | **Defaults** |
|-----------------------|----------------------------------------------------------------------|-----------------------|
| ENABLE_SDL | Build the SDL port | OFF |
| ENABLE_WX | Build the wxWidgets port | ON |
| ENABLE_DEBUGGER | Enable the debugger | ON |
| ENABLE_NLS | Enable translations | ON |
| ENABLE_ASM_CORE | Enable x86 ASM CPU cores (**BUGGY AND DANGEROUS**) | OFF |
| ENABLE_ASM | Enable the following two ASM options | ON for 32 bit builds |
| ENABLE_ASM_SCALERS | Enable x86 ASM graphic filters | ON for 32 bit builds |
| ENABLE_MMX | Enable MMX | ON for 32 bit builds |
| ENABLE_LINK | Enable GBA linking functionality (requires SFML) | ON |
| ENABLE_LIRC | Enable LIRC support | OFF |
| ENABLE_FFMPEG | Enable ffmpeg A/V recording | OFF |
| ENABLE_LTO | Compile with Link Time Optimization (gcc and clang only) | ON for release build |
| ENABLE_GBA_LOGGING | Enable extended GBA logging | ON |
| ENABLE_DIRECT3D | Direct3D rendering for wxWidgets (Windows, **NOT IMPLEMENTED!!!**) | ON |
| ENABLE_XAUDIO2 | Enable xaudio2 sound output for wxWidgets (Windows only) | ON |
| ENABLE_OPENAL | Enable OpenAL for the wxWidgets port | OFF |
| ENABLE_SSP | Enable gcc stack protector support (gcc only) | OFF |
| ENABLE_ASAN | Enable libasan sanitizers (by default address, only in debug mode) | OFF |
| VBAM_STATIC | Try link all libs statically (the following are set to ON if ON) | OFF |
| SDL2_STATIC | Try to link static SDL2 libraries | OFF |
| SFML_STATIC_LIBRARIES | Try to link static SFML libraries | OFF |
| FFMPEG_STATIC | Try to link static ffmpeg libraries | OFF |
| SSP_STATIC | Try to link static gcc stack protector library (gcc only) | OFF except Win32 |
| OPENAL_STATIC | Try to link static OpenAL libraries | OFF |
| SSP_STATIC | Link gcc stack protecter libssp statically (gcc, with ENABLE_SSP) | OFF |
| `ENABLE_SDL` | Build the SDL port | OFF |
| `ENABLE_WX` | Build the wxWidgets port | ON |
| `ENABLE_DEBUGGER` | Enable the debugger | ON |
| `ENABLE_ASM_CORE` | Enable x86 ASM CPU cores (**BUGGY AND DANGEROUS**) | OFF |
| `ENABLE_ASM` | Enable the following two ASM options | ON for 32 bit builds |
| `ENABLE_ASM_SCALERS` | Enable x86 ASM graphic filters | ON for 32 bit builds |
| `ENABLE_MMX` | Enable MMX | ON for 32 bit builds |
| `ENABLE_LINK` | Enable GBA linking functionality (requires SFML) | AUTO |
| `ENABLE_LIRC` | Enable LIRC support | OFF |
| `ENABLE_FFMPEG` | Enable ffmpeg A/V recording | AUTO |
| `ENABLE_ONLINEUPDATES` | Enable online update checks | ON |
| `ENABLE_LTO` | Compile with Link Time Optimization (gcc and clang only) | ON for release build |
| `ENABLE_GBA_LOGGING` | Enable extended GBA logging | ON |
| `ENABLE_XAUDIO2` | Enable xaudio2 sound output for wxWidgets (Windows only) | ON |
| `ENABLE_FAUDIO` | Enable faudio sound output for wxWidgets, | ON, not 32 bit Win |
| `ENABLE_ASAN` | Enable libasan sanitizers (by default address, only in debug mode) | OFF |
| `UPSTREAM_RELEASE` | Do some release tasks, like codesigning, making zip and gpg sigs. | OFF |
| `BUILD_TESTING` | Build the tests and enable ctest support. | ON |
| `VBAM_STATIC` | Try link all libs statically (the following are set to ON if ON) | OFF |
| `SDL2_STATIC` | Try to link static SDL2 libraries | OFF |
| `SFML_STATIC_LIBRARIES` | Try to link static SFML libraries | OFF |
| `FFMPEG_STATIC` | Try to link static ffmpeg libraries | OFF |
| `OPENAL_STATIC` | Try to link static OpenAL libraries | OFF |
| `TRANSLATIONS_ONLY` | Build only the translations.zip and nothing else | OFF |
Note for distro packagers, we use the CMake module
[GNUInstallDirs](https://cmake.org/cmake/help/v2.8.12/cmake.html#module:GNUInstallDirs)
to configure installation directories.
## MSys2 Notes
To run the resulting binary, you can simply type:
```shell
./visualboyadvance-m
```
in the shell where you built it.
If you built with `-DCMAKE_BUILD_TYPE=Debug`, you will get a console app and
will see debug messages, even in mintty.
If you want to start the binary from e.g. a shortcut or Explorer, you will need
to put `c:\msys64\mingw32\bin` for 32 bit builds and `c:\msys64\mingw64\bin`
for 64 bit builds in your PATH (to edit system PATH, go to Control Panel ->
System -> Advanced system settings -> Environment Variables.)
If you want to package the binary, you will need to include the MinGW DLLs it
depends on, they can install to the same directory as the binary.
For our own builds, we use MXE to make static builds.
## Debug Messages
We have an override for `wxLogDebug()` to make it work even in non-debug builds
of wx and on windows, even in mintty. Using this function for console debug
messages is recommended.
It works like `printf()`, e.g.:
```cpp
int foo = 42;
wxLogDebug(wxT("the value of foo = %d"), foo);
```
On Unix to use a different version of wxWidgets, set
`wxWidgets_CONFIG_EXECUTABLE` to the path to the `wx-config` script you want to
use.
## Reporting Crash Bugs
@ -230,40 +255,26 @@ do something such as:
```shell
ulimit -c unlimited
```
in your shell to enable coredump files.
, in your shell to enable core files.
[This
post](https://ask.fedoraproject.org/en/question/98776/where-is-core-dump-located/?answer=98779#post-id-98779)
explains how to retrieve core dump on Fedora Linux (and possibly other
distributions.)
explains how to retrieve core dump on some distributions, when they are managed
by systemd.
Once you have the core dump file, open it with `gdb`, for example:
Once you have the core file, open it with `gdb`, for example:
```shell
gdb -c core ./visualboyadvance-m
```
In the `gdb` shell, to print the backtrace, type:
. In the `gdb` shell, to start the process and print the backtrace, type:
```
run
bt
```
This may be a bit of a hassle, but it helps us out immensely.
. This may be a bit of a hassle, but it helps us out immensely.
## Contributing
Please keep in mind that this app needs to run on Windows, Linux and macOS at
the very least, so code should be portable and/or use the appropriate `#ifdef`s
and the like when needed.
Please try to craft a good commit message, this post by the great tpope explains
how to do so:
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
If you have multiple small commits for a change, please try to use `git rebase
-i` (interactive rebase) to squash them into one or a few logical commits (with
good commit messages!) See:
https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History if you are new to
this.
See the [Developer Manual](/DEVELOPER-MANUAL.md).

52
cmake-variants.yaml Normal file
View File

@ -0,0 +1,52 @@
buildType:
default: debug
choices:
debug:
short: Debug
long: Emit debug information
buildType: Debug
release:
short: Release
long: Optimize generated code
buildType: Release
linkage:
default: static
choices:
static:
short: Static
long: Create static libraries
linkage: static
shared:
short: Shared
long: Create shared libraries/DLLs
linkage: shared
useLink:
default: withlink
choices:
withlink:
short: WithLink
long: Enable the Link feature
settings:
ENABLE_LINK: ON
nolink:
short: NoLink
long: Disable the Link feature
settings:
ENABLE_LINK: OFF
useDebugger:
default: withdebugger
choices:
withdebugger:
short: WithDebugger
long: Enable the Debugger feature
settings:
ENABLE_DEBUGGER: ON
nodebugger:
short: NoDebugger
long: Disable the Debugger feature
settings:
ENABLE_DEBUGGER: OFF
ENABLE_SDL: OFF

View File

@ -1,3 +1,7 @@
if(TRANSLATIONS_ONLY)
return()
endif()
if(NOT CMAKE_SYSTEM_PROCESSOR)
if(NOT CMAKE_TOOLCHAIN_FILE AND CMAKE_HOST_SYSTEM_PROCESSOR)
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
@ -7,18 +11,66 @@ if(NOT CMAKE_SYSTEM_PROCESSOR)
else()
set(CMAKE_SYSTEM_PROCESSOR x86_64)
endif()
elseif(CROSS_ARCH STREQUAL x86_64)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
elseif(CROSS_ARCH STREQUAL i686)
set(CMAKE_SYSTEM_PROCESSOR i686)
endif()
endif()
# turn asm on by default on 32bit x86
# and set WINARCH for windows stuff
# The processor may not be set, but set BITS regardless.
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4)
set(BITS 32)
elseif(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
set(BITS 64)
endif()
if(VCPKG_TARGET_TRIPLET MATCHES "^[aA][rR][mM]64")
set(CMAKE_SYSTEM_PROCESSOR ARM64)
elseif(VCPKG_TARGET_TRIPLET MATCHES "^[aA][rR][mM]-")
set(CMAKE_SYSTEM_PROCESSOR ARM)
endif()
# Turn asm on by default on 32bit x86 and set WINARCH for windows stuff.
if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
if(NOT (MSVC AND CMAKE_TOOLCHAIN_FILE MATCHES vcpkg))
set(ASM_DEFAULT ON)
endif()
set(ASM_DEFAULT ON)
set(X86_32 ON)
else()
set(X86 ON)
set(WINARCH x86)
set(ARCH_NAME x86_32)
elseif(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
set(AMD64 ON)
set(X64 ON)
set(X86_64 ON)
set(WINARCH x64)
set(ARCH_NAME x86_64)
endif()
if(DEFINED VCPKG_TARGET_TRIPLET)
string(REGEX MATCH "^x[86][64]" target_arch ${VCPKG_TARGET_TRIPLET})
if(NOT WINARCH STREQUAL target_arch)
message(FATAL_ERROR "Wrong build environment architecture for VCPKG_TARGET_TRIPLET, you specified ${target_arch} but your compiler is for ${WINARCH}")
endif()
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "[aA][aA][rR][cC][hH]|[aA][rR][mM]")
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
set(ARM32 ON)
set(ARCH_NAME arm32)
set(WINARCH arm)
elseif(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
set(ARM64 ON)
set(ARCH_NAME arm64)
set(WINARCH arm64)
endif()
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "[aA][aA][rR][cC][hH]|[aA][rR][mM]")
set(CMAKE_CROSSCOMPILING TRUE)
endif()
endif()
# We do not support amd64 asm yet
if(X86_64 AND (ENABLE_ASM_CORE OR ENABLE_ASM_SCALERS OR ENABLE_MMX))
message(FATAL_ERROR "The options ASM_CORE, ASM_SCALERS and MMX are not supported on X86_64 yet.")
endif()

View File

@ -1,54 +0,0 @@
#=============================================================================
# Copyright 2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# support for the nasm assembler
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
if(WIN32)
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
else()
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
endif()
elseif(APPLE)
EXECUTE_PROCESS(COMMAND ${CMAKE_ASM_NASM_COMPILER} -v COMMAND awk "{print \$3}" OUTPUT_VARIABLE NASM_VERSION)
IF(NASM_VERSION VERSION_LESS 2.0)
IF(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
MESSAGE(FATAL_ERROR "Your nasm is too old to support AMD64, please install nasm from Homebrew or MacPorts.")
ENDIF()
SET(CMAKE_ASM_NAMS_OBJECT_FORMAT macho)
ELSE()
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
else()
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho32)
endif()
ENDIF()
else()
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
else()
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf32)
endif()
endif()
endif()
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <DEFINES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
# Load the generic ASMInformation file:
set(ASM_DIALECT "_NASM")
include(CMakeASMInformation)
set(ASM_DIALECT)

View File

@ -1,27 +0,0 @@
#=============================================================================
# Copyright 2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
SET(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
IF(NOT CMAKE_ASM_NASM_COMPILER)
FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm
"$ENV{ProgramFiles}/NASM")
ENDIF(NOT CMAKE_ASM_NASM_COMPILER)
# Load the generic DetermineASM compiler file with the DIALECT set properly:
SET(ASM_DIALECT "_NASM")
INCLUDE(CMakeDetermineASMCompiler)
SET(ASM_DIALECT)

View File

@ -1,23 +0,0 @@
#=============================================================================
# Copyright 2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that the selected ASM_NASM "compiler" works.
# For assembler this can only check whether the compiler has been found,
# because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture.
SET(ASM_DIALECT "_NASM")
INCLUDE(CMakeTestASMCompiler)
SET(ASM_DIALECT)

View File

@ -9,7 +9,7 @@ function(changelog_version version revision version_release)
return()
endif()
string(REGEX MATCH "\n## +\\[([0-9.]+)(-([^] ]+))?\\] +.* +[0-9][0-9]?/" match_out "${changelog_file}")
string(REGEX MATCH "\n## +\\[([0-9.]+)(-([^] ]+))?\\] *.* *[0-9][0-9]?/" match_out "${changelog_file}")
set(changelog_version "${CMAKE_MATCH_1}")

122
cmake/Dependencies.cmake Normal file
View File

@ -0,0 +1,122 @@
if(TRANSLATIONS_ONLY)
return()
endif()
# Look for some dependencies using CMake scripts
find_package(ZLIB REQUIRED)
set(OpenGL_GL_PREFERENCE GLVND)
if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
set(OpenGL_GL_PREFERENCE LEGACY)
endif()
find_package(OpenGL REQUIRED)
find_package(SDL2 REQUIRED)
# Add libsamplerate to SDL2 with vcpkg
unset(SDL2_LIBRARY_TEMP)
if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg")
if(WIN32)
unset(arch_suffix)
unset(path_prefix)
if(VCPKG_TARGET_TRIPLET MATCHES -static)
set(arch_suffix -static)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(path_prefix debug)
endif()
set(installed_prefix ${_VCPKG_INSTALLED_DIR}/${WINARCH}-windows${arch_suffix}/${path_prefix})
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${installed_prefix}/lib/samplerate.lib)
else()
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} -lsamplerate)
endif()
endif()
if(VBAM_STATIC)
set(VBAM_SDL2_LIBS SDL2::SDL2-static ${SDL2_LIBRARY_TEMP})
else()
set(VBAM_SDL2_LIBS SDL2::SDL2 ${SDL2_LIBRARY_TEMP})
endif()
if(ENABLE_FFMPEG)
if(NOT FFMPEG_LIBRARIES)
message(FATAL_ERROR "ENABLE_FFMPEG was specified, but required versions of ffmpeg libraries cannot be found!")
endif()
if(APPLE)
list(APPEND FFMPEG_LDFLAGS "SHELL:-framework CoreText" "SHELL:-framework ApplicationServices")
if(UPSTREAM_RELEASE)
list(APPEND FFMPEG_LDFLAGS -lbz2 -ltiff "SHELL:-framework DiskArbitration" -lfreetype -lfontconfig -llzma -lxml2 -lharfbuzz)
endif()
elseif(WIN32)
set(WIN32_MEDIA_FOUNDATION_LIBS dxva2 evr mf mfplat mfplay mfreadwrite mfuuid amstrmid)
list(APPEND FFMPEG_LIBRARIES secur32 bcrypt ${WIN32_MEDIA_FOUNDATION_LIBS})
if(MSYS AND VBAM_STATIC)
foreach(lib tiff jbig lzma)
cygpath(lib "$ENV{MSYSTEM_PREFIX}/lib/lib${lib}.a")
list(APPEND FFMPEG_LIBRARIES "${lib}")
endforeach()
endif()
endif()
else()
add_compile_definitions(NO_FFMPEG)
endif()
if(ENABLE_LINK)
# IPC linking code needs sem_timedwait which can be either in librt or pthreads
if(NOT WIN32)
find_library(RT_LIB rt)
if(RT_LIB)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${RT_LIB})
set(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${RT_LIB})
endif()
endif()
include(CheckFunctionExists)
check_function_exists(sem_timedwait SEM_TIMEDWAIT)
if(SEM_TIMEDWAIT)
add_compile_definitions(HAVE_SEM_TIMEDWAIT)
endif()
else()
add_compile_definitions(NO_LINK)
endif()
# for now, only GBALink.cpp uses gettext() directly
if(APPLE)
# use Homebrew gettext if available
if(EXISTS "/usr/local/opt/gettext")
set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH};/usr/local/opt/gettext/include")
set(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH};/usr/local/opt/gettext/lib")
set(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};/usr/local/opt/gettext/bin")
endif()
endif()
if(ENABLE_LINK OR ENABLE_WX)
find_path(LIBINTL_INC libintl.h)
find_library(LIBINTL_LIB NAMES libintl intl)
find_library(LIBICONV_LIB NAMES libiconv iconv)
find_library(LIBCHARSET_LIB NAMES libcharset charset)
if(LIBINTL_LIB)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBINTL_LIB})
list(APPEND NLS_LIBS ${LIBINTL_LIB})
endif()
if(LIBICONV_LIB)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBICONV_LIB})
list(APPEND NLS_LIBS ${LIBICONV_LIB})
endif()
if(LIBCHARSET_LIB)
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBCHARSET_LIB})
list(APPEND NLS_LIBS ${LIBCHARSET_LIB})
endif()
include(CheckFunctionExists)
check_function_exists(gettext GETTEXT_FN)
if(NOT (LIBINTL_INC OR GETTEXT_FN))
message(FATAL_ERROR "NLS requires libintl/gettext")
endif()
endif()

44
cmake/FileIterator.cmake Normal file
View File

@ -0,0 +1,44 @@
# Interface for iterating over a text file by line.
#
# Example usage:
#
# fi_open_file(${some_file})
#
# while(NOT fi_done)
# fi_get_next_line()
#
# message(STATUS "read line: ${fi_line}")
# endwhile()
macro(fi_check_done)
string(LENGTH "${fi_file_contents}" len)
set(fi_done FALSE PARENT_SCOPE)
if(len EQUAL 0)
set(fi_done TRUE PARENT_SCOPE)
endif()
endmacro()
function(fi_open_file file)
file(READ "${file}" fi_file_contents)
set(fi_file_contents "${fi_file_contents}" PARENT_SCOPE)
fi_check_done()
endfunction()
function(fi_get_next_line)
string(FIND "${fi_file_contents}" "\n" pos)
string(SUBSTRING "${fi_file_contents}" 0 ${pos} fi_line)
math(EXPR pos "${pos} + 1")
string(SUBSTRING "${fi_file_contents}" ${pos} -1 fi_file_contents)
fi_check_done()
set(fi_line "${fi_line}" PARENT_SCOPE)
set(fi_file_contents "${fi_file_contents}" PARENT_SCOPE)
endfunction()

151
cmake/FindFFmpeg.cmake Normal file
View File

@ -0,0 +1,151 @@
# vim: ts=2 sw=2
# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
#
# Once done this will define
# FFMPEG_FOUND - System has the all required components.
# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
#
# For each of the components it will additionally set.
# - AVCODEC
# - AVDEVICE
# - AVFORMAT
# - AVFILTER
# - AVUTIL
# - POSTPROC
# - SWSCALE
# the following variables will be defined
# <component>_FOUND - System has <component>
# <component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
# <component>_LIBRARIES - Link these to use <component>
# <component>_DEFINITIONS - Compiler switches required for using <component>
# <component>_VERSION - The components version
#
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2011, Michael Jansen, <kde@michael-jansen.biz>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(FindPackageHandleStandardArgs)
# The default components were taken from a survey over other FindFFMPEG.cmake files
if (NOT FFmpeg_FIND_COMPONENTS)
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
endif ()
#
### Macro: set_component_found
#
# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
#
macro(set_component_found _component )
if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
# message(STATUS " - ${_component} found.")
set(${_component}_FOUND TRUE)
else ()
# message(STATUS " - ${_component} not found.")
endif ()
endmacro()
#
### Macro: find_component
#
# Checks for the given component by invoking pkgconfig and then looking up the libraries and
# include directories.
#
macro(find_component _component _pkgconfig _library _header)
if (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_${_component} ${_pkgconfig})
endif ()
endif (NOT WIN32)
find_path(${_component}_INCLUDE_DIRS ${_header}
HINTS
${PC_${_component}_INCLUDEDIR}
${PC_${_component}_INCLUDE_DIRS}
PATH_SUFFIXES
ffmpeg
)
find_library(${_component}_LIBRARIES NAMES ${_library}
HINTS
${PC_${_component}_LIBDIR}
${PC_${_component}_LIBRARY_DIRS}
)
set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
set_component_found(${_component})
mark_as_advanced(
${_component}_INCLUDE_DIRS
${_component}_LIBRARIES
${_component}_DEFINITIONS
${_component}_VERSION)
endmacro()
# Check for cached results. If there are skip the costly part.
if (NOT FFMPEG_LIBRARIES)
# Check for all possible component.
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
find_component(AVUTIL libavutil avutil libavutil/avutil.h)
find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
find_component(SWSCALE libswscale swscale libswscale/swscale.h)
find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h)
# Check if the required components were found and add their stuff to the FFMPEG_* vars.
foreach (_component ${FFmpeg_FIND_COMPONENTS})
if (${_component}_FOUND)
# message(STATUS "Required component ${_component} present.")
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
else ()
# message(STATUS "Required component ${_component} missing.")
endif ()
endforeach ()
# Build the include path with duplicates removed.
if (FFMPEG_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
endif ()
# cache the vars.
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
mark_as_advanced(FFMPEG_INCLUDE_DIRS
FFMPEG_LIBRARIES
FFMPEG_DEFINITIONS)
endif ()
# Now set the noncached _FOUND vars for the components.
foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
set_component_found(${_component})
endforeach ()
# Compile the list of required vars
set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
foreach (_component ${FFmpeg_FIND_COMPONENTS})
list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
endforeach ()
# Give a nice error message if some of the required vars are missing.
find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})

View File

@ -1,231 +1,232 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindGettext
# -----------
#
# Find GNU gettext tools
#
# This module looks for the GNU gettext tools. This module defines the
# following values:
#
# ::
#
# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
# GETTEXT_FOUND: True if gettext has been found.
# GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
#
#
#
# Additionally it provides the following macros:
#
# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
#
# ::
#
# This will create a target "translations" which will convert the
# given input po files into the binary output mo file. If the
# ALL option is used, the translations will also be created when
# building the default target.
#
# GETTEXT_PROCESS_POT_FILE( <potfile> [ALL] [INSTALL_DESTINATION <destdir>]
# LANGUAGES <lang1> <lang2> ... )
#
# ::
#
# Process the given pot file to mo files.
# If INSTALL_DESTINATION is given then automatically install rules will
# be created, the language subdirectory will be taken into account
# (by default use share/locale/).
# If ALL is specified, the pot file is processed when building the all traget.
# It creates a custom target "potfile".
#
# GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>]
# PO_FILES <po1> <po2> ... )
#
# ::
#
# Process the given po files to mo files for the given language.
# If INSTALL_DESTINATION is given then automatically install rules will
# be created, the language subdirectory will be taken into account
# (by default use share/locale/).
# If ALL is specified, the po files are processed when building the all traget.
# It creates a custom target "pofiles".
#
# .. note::
# If you wish to use the Gettext library (libintl), use :module:`FindIntl`.
#[=======================================================================[.rst:
FindGettext
-----------
Find GNU gettext tools
This module looks for the GNU gettext tools. This module defines the
following values:
::
GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
GETTEXT_FOUND: True if gettext has been found.
GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
Additionally it provides the following macros:
GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
::
This will create a target "translations" which will convert the
given input po files into the binary output mo file. If the
ALL option is used, the translations will also be created when
building the default target.
GETTEXT_PROCESS_POT_FILE( <potfile> [ALL] [INSTALL_DESTINATION <destdir>]
LANGUAGES <lang1> <lang2> ... )
::
Process the given pot file to mo files.
If INSTALL_DESTINATION is given then automatically install rules will
be created, the language subdirectory will be taken into account
(by default use share/locale/).
If ALL is specified, the pot file is processed when building the all target.
It creates a custom target "potfile".
GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>]
PO_FILES <po1> <po2> ... )
::
Process the given po files to mo files for the given language.
If INSTALL_DESTINATION is given then automatically install rules will
be created, the language subdirectory will be taken into account
(by default use share/locale/).
If ALL is specified, the po files are processed when building the all target.
It creates a custom target "pofiles".
.. versionadded:: 3.2
If you wish to use the Gettext library (libintl), use :module:`FindIntl`.
#]=======================================================================]
find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
if(GETTEXT_MSGMERGE_EXECUTABLE)
execute_process(COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --version
execute_process(COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --version
OUTPUT_VARIABLE gettext_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(msgmerge_name ${GETTEXT_MSGMERGE_EXECUTABLE} NAME)
get_filename_component(msgmerge_namewe ${GETTEXT_MSGMERGE_EXECUTABLE} NAME_WE)
if (gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_2}")
endif()
unset(gettext_version)
unset(msgmerge_name)
unset(msgmerge_namewe)
get_filename_component(msgmerge_name ${GETTEXT_MSGMERGE_EXECUTABLE} NAME)
get_filename_component(msgmerge_namewe ${GETTEXT_MSGMERGE_EXECUTABLE} NAME_WE)
if (gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_2}")
endif()
unset(gettext_version)
unset(msgmerge_name)
unset(msgmerge_namewe)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext
REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE
VERSION_VAR GETTEXT_VERSION_STRING)
function(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name)
set(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}")
get_property(currentCounter GLOBAL PROPERTY "${propertyName}")
if(NOT currentCounter)
set(currentCounter 1)
endif()
set(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
math(EXPR currentCounter "${currentCounter} + 1")
set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
set(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}")
get_property(currentCounter GLOBAL PROPERTY "${propertyName}")
if(NOT currentCounter)
set(currentCounter 1)
endif()
set(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
math(EXPR currentCounter "${currentCounter} + 1")
set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
endfunction()
macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
# make it a real variable, so we can modify it here
set(_firstPoFile "${_firstPoFileArg}")
# make it a real variable, so we can modify it here
set(_firstPoFile "${_firstPoFileArg}")
set(_gmoFiles)
get_filename_component(_potName ${_potFile} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
set(_gmoFiles)
get_filename_component(_potName ${_potFile} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
set(_addToAll)
if(${_firstPoFile} STREQUAL "ALL")
set(_addToAll "ALL")
set(_firstPoFile)
endif()
set(_addToAll)
if(${_firstPoFile} STREQUAL "ALL")
set(_addToAll "ALL")
set(_firstPoFile)
endif()
foreach (_currentPoFile ${_firstPoFile} ${ARGN})
get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
get_filename_component(_abs_PATH ${_absFile} PATH)
string(REGEX REPLACE "^.*/([^/]+)(\\.[^.]+)$" "\\1" _lang ${_absFile})
set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
foreach (_currentPoFile ${_firstPoFile} ${ARGN})
get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
get_filename_component(_abs_PATH ${_absFile} PATH)
get_filename_component(_lang ${_absFile} NAME_WE)
set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
add_custom_command(
OUTPUT ${_gmoFile}
#COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
DEPENDS ${_absPotFile} ${_absFile}
)
add_custom_command(
OUTPUT ${_gmoFile}
# COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
DEPENDS ${_absPotFile} ${_absFile}
)
install(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
set(_gmoFiles ${_gmoFiles} ${_gmoFile})
install(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
set(_gmoFiles ${_gmoFiles} ${_gmoFile})
endforeach ()
endforeach ()
if(NOT TARGET translations)
add_custom_target(translations)
endif()
if(NOT TARGET translations)
add_custom_target(translations)
endif()
_GETTEXT_GET_UNIQUE_TARGET_NAME(translations uniqueTargetName)
add_custom_target(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
add_custom_target(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
add_dependencies(translations ${uniqueTargetName})
add_dependencies(translations ${uniqueTargetName})
endmacro()
function(GETTEXT_PROCESS_POT_FILE _potFile)
set(_gmoFiles)
set(_options ALL)
set(_oneValueArgs INSTALL_DESTINATION)
set(_multiValueArgs LANGUAGES)
set(_gmoFiles)
set(_options ALL)
set(_oneValueArgs INSTALL_DESTINATION)
set(_multiValueArgs LANGUAGES)
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
get_filename_component(_potName ${_potFile} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
get_filename_component(_potName ${_potFile} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
foreach (_lang ${_parsedArguments_LANGUAGES})
set(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
set(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
foreach (_lang ${_parsedArguments_LANGUAGES})
set(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
set(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
add_custom_command(
OUTPUT "${_poFile}"
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile}
DEPENDS ${_absPotFile}
)
add_custom_command(
OUTPUT "${_poFile}"
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile}
DEPENDS ${_absPotFile}
)
add_custom_command(
OUTPUT "${_gmoFile}"
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile}
DEPENDS ${_absPotFile} ${_poFile}
)
add_custom_command(
OUTPUT "${_gmoFile}"
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile}
DEPENDS ${_absPotFile} ${_poFile}
)
if(_parsedArguments_INSTALL_DESTINATION)
install(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
endif()
list(APPEND _gmoFiles ${_gmoFile})
endforeach ()
if(_parsedArguments_INSTALL_DESTINATION)
install(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
endif()
list(APPEND _gmoFiles ${_gmoFile})
endforeach ()
if(NOT TARGET potfiles)
add_custom_target(potfiles)
add_custom_target(potfiles)
endif()
_GETTEXT_GET_UNIQUE_TARGET_NAME( potfiles uniqueTargetName)
if(_parsedArguments_ALL)
add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
else()
add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
endif()
if(_parsedArguments_ALL)
add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
else()
add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
endif()
add_dependencies(potfiles ${uniqueTargetName})
add_dependencies(potfiles ${uniqueTargetName})
endfunction()
function(GETTEXT_PROCESS_PO_FILES _lang)
set(_options ALL)
set(_oneValueArgs INSTALL_DESTINATION)
set(_multiValueArgs PO_FILES)
set(_gmoFiles)
set(_options ALL)
set(_oneValueArgs INSTALL_DESTINATION)
set(_multiValueArgs PO_FILES)
set(_gmoFiles)
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
foreach(_current_PO_FILE ${_parsedArguments_PO_FILES})
get_filename_component(_name ${_current_PO_FILE} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
add_custom_command(OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS ${_current_PO_FILE}
)
foreach(_current_PO_FILE ${_parsedArguments_PO_FILES})
get_filename_component(_name ${_current_PO_FILE} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
add_custom_command(OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS ${_current_PO_FILE}
)
if(_parsedArguments_INSTALL_DESTINATION)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
endif()
list(APPEND _gmoFiles ${_gmoFile})
endforeach()
if(_parsedArguments_INSTALL_DESTINATION)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
endif()
list(APPEND _gmoFiles ${_gmoFile})
endforeach()
if(NOT TARGET pofiles)
add_custom_target(pofiles)
add_custom_target(pofiles)
endif()
_GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName)
if(_parsedArguments_ALL)
add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
else()
add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
endif()
if(_parsedArguments_ALL)
add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
else()
add_custom_target(${uniqueTargetName} DEPENDS ${_gmoFiles})
endif()
add_dependencies(pofiles ${uniqueTargetName})
add_dependencies(pofiles ${uniqueTargetName})
endfunction()

View File

@ -1,110 +0,0 @@
#.rst:
# FindOpenAL
# ----------
#
#
#
# Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if
# false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find
# the headers
#
# $OPENALDIR is an environment variable that would correspond to the
# ./configure --prefix=$OPENALDIR used in building OpenAL.
#
# Created by Eric Wing. This was influenced by the FindSDL.cmake
# module.
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This makes the presumption that you are include al.h like
# #include "al.h"
# and not
# #include <AL/al.h>
# The reason for this is that the latter is not entirely portable.
# Windows/Creative Labs does not by default put their headers in AL/ and
# OS X uses the convention <OpenAL/al.h>.
#
# For Windows, Creative Labs seems to have added a registry key for their
# OpenAL 1.1 installer. I have added that key to the list of search paths,
# however, the key looks like it could be a little fragile depending on
# if they decide to change the 1.00.0000 number for bug fix releases.
# Also, they seem to have laid down groundwork for multiple library platforms
# which puts the library in an extra subdirectory. Currently there is only
# Win32 and I have hardcoded that here. This may need to be adjusted as
# platforms are introduced.
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
# I do not know if the Nvidia OpenAL SDK has a registry key.
#
# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
# To support the framework, I originally wrote special framework detection
# code in this module which I have now removed with CMake's introduction
# of native support for frameworks.
# In addition, OpenAL is open source, and it is possible to compile on Panther.
# Furthermore, due to bugs in the initial OpenAL release, and the
# transition to OpenAL 1.1, it is common to need to override the built-in
# framework.
# Per my request, CMake should search for frameworks first in
# the following order:
# ~/Library/Frameworks/OpenAL.framework/Headers
# /Library/Frameworks/OpenAL.framework/Headers
# /System/Library/Frameworks/OpenAL.framework/Headers
#
# On OS X, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# OPENAL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
find_path(OPENAL_INCLUDE_DIR al.h
HINTS
ENV OPENALDIR
PATH_SUFFIXES AL OpenAL
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_OpenAL_ARCH_DIR libs/Win64)
else()
set(_OpenAL_ARCH_DIR libs/Win32)
endif()
find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
unset(_OpenAL_ARCH_DIR)
# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)

View File

@ -1,226 +0,0 @@
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL2
# SDL2_INCLUDE_DIR, where to find SDL.h
#
# If you have pkg-config, these extra variables are also defined:
# SDL2_DEFINITIONS, extra CFLAGS
# SDL2_EXTRA_LIBS, extra link libs
# SDL2_LINKER_FLAGS, extra link flags
#
# The latter two are automatically added to SDL2_LIBRARY
#
# To use them, add code such as:
#
# # SET(SDL2_STATIC ON) # if you want to link SDL2 statically
# FIND_PACKAGE(SDL2 REQUIRED)
# ADD_DEFINITIONS(${SDL2_DEFINITIONS})
# TARGET_LINK_LIBRARIES(your-executable-target ${SDL2_LIBRARY} ...)
#
# This module responds to the the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# If you want to link SDL2 statically, set SDL2_STATIC to ON.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDL2main which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL guidelines.
# Added a search for SDL2main which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL3/SDL.h to just SDL.h
# This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
SET(SDL2_SEARCH_PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local # Mac Homebrew and local installs
/usr
/sw # Fink
/opt/local # MacPorts
/opt/csw # OpenCSW (Solaris)
/opt
${SDL2_PATH}/include
${SDL2_PATH}/lib
)
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS $ENV{SDL2DIR}
PATH_SUFFIXES SDL2
PATHS ${SDL2_SEARCH_PATHS}
)
SET(CURRENT_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
IF(SDL2_STATIC)
IF(WIN32)
SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
ELSE(WIN32)
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
ENDIF(WIN32)
ENDIF(SDL2_STATIC)
FIND_LIBRARY(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS $ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib lib/x64 lib/x86
PATHS ${SDL2_SEARCH_PATHS}
)
IF(NOT SDL2_BUILDING_LIBRARY)
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDL2main for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib lib/x64 lib/x86
PATHS ${SDL2_SEARCH_PATHS}
)
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL2_BUILDING_LIBRARY)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CURRENT_FIND_LIBRARY_SUFFIXES})
UNSET(CURRENT_FIND_LIBRARY_SUFFIXES)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional link flag, -mwindows (to make a GUI app)
# but we only add it when not making a Debug build.
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows
IF(MINGW)
SET(MINGW32_LIBRARY -lmingw32 CACHE STRING "MinGW library")
IF(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
SET(MINGW32_LIBRARY ${MINGW32_LIBRARY} -mwindows)
ENDIF()
ENDIF(MINGW)
IF(SDL2_LIBRARY_TEMP)
# For SDL2main
IF(NOT SDL2_BUILDING_LIBRARY)
IF(SDL2MAIN_LIBRARY)
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(SDL2MAIN_LIBRARY)
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
IF(APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP} -lversion -limm32)
ENDIF(MINGW)
# Add some stuff from pkg-config, if available
IF(NOT PKG_CONFIG_EXECUTABLE)
FIND_PACKAGE(PkgConfig QUIET)
ENDIF(NOT PKG_CONFIG_EXECUTABLE)
IF(PKG_CONFIG_EXECUTABLE)
# get any definitions
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --cflags-only-other sdl2 OUTPUT_VARIABLE SDL2_DEFINITIONS ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
SET(SDL2_DEFINITIONS ${SDL2_DEFINITIONS} CACHE STRING "Extra CFLAGS for SDL2 from pkg-config")
# get any extra stuff needed for linking
IF(NOT SDL2_STATIC)
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --libs-only-other sdl2 OUTPUT_VARIABLE SDL2_LINKER_FLAGS_RAW ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --libs-only-l sdl2 OUTPUT_VARIABLE SDL2_EXTRA_LIBS_RAW ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSE(NOT SDL2_STATIC)
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --static --libs-only-other sdl2 OUTPUT_VARIABLE SDL2_LINKER_FLAGS_RAW ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --static --libs-only-l sdl2 OUTPUT_VARIABLE SDL2_EXTRA_LIBS_RAW ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDIF(NOT SDL2_STATIC)
STRING(REGEX REPLACE "[^ ]+SDL2[^ ]*" "" SDL2_EXTRA_LIBS_RAW2 "${SDL2_EXTRA_LIBS_RAW}")
STRING(REGEX REPLACE " +" ";" SDL2_EXTRA_LIBS "${SDL2_EXTRA_LIBS_RAW2}")
STRING(REGEX REPLACE " +" ";" SDL2_LINKER_FLAGS "${SDL2_LINKER_FLAGS_RAW}")
SET(SDL2_LINKER_FLAGS ${SDL2_LINKER_FLAGS} CACHE STRING "Linker flags for linking SDL2")
SET(SDL2_EXTRA_LIBS ${SDL2_EXTRA_LIBS} CACHE STRING "Extra libraries for linking SDL2")
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${SDL2_EXTRA_LIBS} ${SDL2_LINKER_FLAGS})
ENDIF(PKG_CONFIG_EXECUTABLE)
# Set the final string here so the GUI reflects the final state.
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
ENDIF(SDL2_LIBRARY_TEMP)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)

View File

@ -57,7 +57,7 @@
# define the SFML_STATIC macro if static build was chosen
if(SFML_STATIC_LIBRARIES)
add_definitions(-DSFML_STATIC)
add_compile_definitions(SFML_STATIC)
endif()
# define the list of search paths for headers and libraries
@ -89,9 +89,9 @@ if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
endif()
FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_PATCH ([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define *SFML_VERSION_MAJOR *([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define *SFML_VERSION_MINOR *([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define *SFML_VERSION_PATCH *([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}")
if (NOT "${SFML_VERSION_PATCH}" MATCHES "^[0-9]+$")
set(SFML_VERSION_PATCH 0)
endif()

View File

@ -1,76 +0,0 @@
# FindSSP.cmake
#
# Find libssp necessary when using gcc with e.g. -fstack-protector=strong
#
# See: http://wiki.osdev.org/Stack_Smashing_Protector
#
# To use:
#
# put a copy into your <project_root>/cmake/
#
# In your main CMakeLists.txt do something like this:
#
# if(WIN32)
# set(SSP_STATIC ON)
# endif()
#
# find_package(SSP)
#
# if(SSP_LIBRARY)
# set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${SSP_LIBRARY}")
# set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} ${SSP_LIBRARY}")
# endif()
# only do this when compiling with gcc/g++
if(NOT CMAKE_COMPILER_IS_GNUCXX)
return()
endif()
function(FindSSP)
if(NOT CMAKE_CXX_COMPILER AND CMAKE_C_COMPILER)
set(CMAKE_CXX_COMPILER ${CMAKE_C_COMPILER})
endif()
foreach(arg ${CMAKE_CXX_COMPILER_ARG1} ${CMAKE_CXX_COMPILER_ARG2} ${CMAKE_CXX_COMPILER_ARG3} ${CMAKE_CXX_COMPILER_ARG4} ${CMAKE_CXX_COMPILER_ARG5} ${CMAKE_CXX_COMPILER_ARG6} ${CMAKE_CXX_COMPILER_ARG7} ${CMAKE_CXX_COMPILER_ARG8} ${CMAKE_CXX_COMPILER_ARG9})
string(STRIP ${arg} arg)
set(gcc_args "${gcc_args};${arg}")
endforeach()
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${gcc_args} --print-prog-name=gcc OUTPUT_VARIABLE GCC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE)
if(WIN32 AND NOT MSYS)
execute_process(COMMAND where.exe ${GCC_EXECUTABLE} OUTPUT_VARIABLE GCC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
execute_process(COMMAND sh -c "command -v ${GCC_EXECUTABLE}" OUTPUT_VARIABLE GCC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
get_filename_component(GCC_DIRNAME "${GCC_EXECUTABLE}" DIRECTORY)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${gcc_args} --print-libgcc-file-name OUTPUT_VARIABLE LIBGCC_FILE OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(LIBGCC_DIRNAME "${LIBGCC_FILE}" DIRECTORY)
set(SSP_SEARCH_PATHS ${GCC_DIRNAME} ${LIBGCC_DIRNAME})
if(SSP_STATIC)
if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif()
endif()
find_library(SSP_LIBRARY
NAMES ssp libssp
HINTS ${SSP_SEARCH_PATHS}
PATH_SUFFIXES lib64 lib lib/x64 lib/x86
)
set(SSP_LIBRARY PARENT_SCOPE)
endfunction()
FindSSP()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SSP REQUIRED_VARS SSP_LIBRARY)

View File

@ -7,23 +7,6 @@
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# git_local_changes(<var>)
#
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
# Uses the return code of "git diff-index --quiet HEAD --".
# Does not regard untracked files.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
@ -85,84 +68,3 @@ function(get_git_head_revision _refspecvar _hashvar)
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()
function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
# TODO sanitize
#if((${ARGN}" MATCHES "&&") OR
# (ARGN MATCHES "||") OR
# (ARGN MATCHES "\\;"))
# message("Please report the following error to the project!")
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(COMMAND
"${GIT_EXECUTABLE}"
describe
${hash}
${ARGN}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "${out}-${res}-NOTFOUND")
endif()
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
function(git_local_changes _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
get_git_head_revision(refspec hash)
if(NOT GIT_FOUND)
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
if(NOT hash)
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
return()
endif()
execute_process(COMMAND
"${GIT_EXECUTABLE}"
diff-index --quiet HEAD --
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE
res
OUTPUT_VARIABLE
out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(res EQUAL 0)
set(${_var} "CLEAN" PARENT_SCOPE)
else()
set(${_var} "DIRTY" PARENT_SCOPE)
endif()
endfunction()

View File

@ -3,10 +3,9 @@ function(git_version version revision version_release)
set(${revision} "" CACHE STRING "Latest Git Tag Revision" FORCE)
set(${version_release} 0 CACHE STRING "Is this a versioned release without revision" FORCE)
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
# get latest version from tag history
execute_process(COMMAND "${GIT_EXECUTABLE}" tag "--format=%(align:width=20)%(refname:short)%(end)%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end)" --sort=-creatordate OUTPUT_VARIABLE tags OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND "${GIT_EXECUTABLE}" tag "--format=%(align:width=20)%(refname:short)%(end)%(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end)" --sort=-v:refname OUTPUT_VARIABLE tags OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
# if no tags (e.g. shallow clone) do nothing
if(tags STREQUAL "")

View File

@ -1,29 +1,40 @@
function(host_compile src dst_cmd)
unset(link_flags)
if(CMAKE_HOST_WIN32)
if(NOT dst MATCHES "\\.[Ee][Xx][Ee]\$")
set(dst "${dst_cmd}.exe")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
set(link_flags -Wl,--subsystem,console)
endif()
else()
if(CMAKE_CROSSCOMPILING)
unset(link_flags)
set(dst "${dst_cmd}")
endif()
if(NOT MSVC)
# assume cc foo.c -o foo # will work on most hosts
set(compile_command cc ${src} -o ${dst} ${link_flags})
if(CMAKE_HOST_WIN32)
if(CMAKE_COMPILER_IS_GNUCXX)
set(link_flags -Wl,--subsystem,console)
endif()
endif()
if(MSVC)
set(msvc_compile_script ${CMAKE_SOURCE_DIR}/cmake/MSVC_x86_Host_Compile.cmake)
add_custom_command(
OUTPUT ${dst}
DEPENDS ${src} ${msvc_compile_script}
COMMAND ${CMAKE_COMMAND} -D "src=${src}" -D "dst=${dst}" -P ${msvc_compile_script}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
else()
set(dst ${dst_cmd})
# Assume: cc foo.c -o foo # will work on most hosts
add_custom_command(
OUTPUT ${dst}
DEPENDS ${src}
COMMAND cc ${src} -o ${dst} ${link_flags}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif()
else()
# special case for Visual Studio
set(compile_command cl ${src} /link "/out:${dst}")
endif()
get_filename_component(dst ${dst_cmd} NAME)
execute_process(COMMAND ${compile_command} OUTPUT_VARIABLE compile_out ERROR_VARIABLE compile_out RESULT_VARIABLE compile_result)
add_executable(${dst} ${src})
if(NOT compile_result EQUAL 0)
message(FATAL_ERROR "Failed compiling ${src} for the host: ${compile_out}")
# this is necessary because we override main with SDL_main
target_compile_definitions(${dst} PRIVATE -Dmain=main)
endif()
endfunction()

View File

@ -1,32 +0,0 @@
function(use_llvm_toolchain)
if(CMAKE_C_COMPILER_ID STREQUAL Clang)
set(compiler "${CMAKE_C_COMPILER}")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(compiler "${CMAKE_CXX_COMPILER}")
else()
return()
endif()
foreach(tool ar ranlib ld nm objdump as)
execute_process(
COMMAND "${compiler}" -print-prog-name=llvm-${tool}
OUTPUT_VARIABLE prog_path
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(prog_path MATCHES "^/")
if(tool STREQUAL ld)
set(tool linker)
elseif(tool STREQUAL as)
set(tool asm_compiler)
endif()
string(TOUPPER ${tool} utool)
set(CMAKE_${utool} "${prog_path}" PARENT_SCOPE)
set(CMAKE_${utool} "${prog_path}" CACHE FILEPATH "${tool}" FORCE)
endif()
endforeach()
endfunction()
use_llvm_toolchain()

View File

@ -0,0 +1,24 @@
# This is a hack to be run with cmake -P to compile a source C program passed
# in `src` to the `dst` executable using the host MSVC x86 toolchain.
find_program(cl_path NAME cl.exe HINTS ENV PATH)
string(REGEX REPLACE "[^/]+/cl\\.exe$" "x86/cl.exe" cl_path "${cl_path}")
set(orig_lib "$ENV{LIB}")
set(new_lib)
foreach(lib $ENV{LIB})
string(REGEX REPLACE "[^\\]+$" "x86" lib "${lib}")
list(APPEND new_lib "${lib}")
endforeach()
set(ENV{LIB} "${new_lib}")
execute_process(
COMMAND ${cl_path} /nologo ${src} /Fe:${dst}
OUTPUT_QUIET
)
set(ENV{LIB} "${orig_lib}")

View File

@ -11,8 +11,8 @@
# In addition, the following commands are called with the package manager's
# paths:
#
# INCLUDE_DIRECTORIES()
# LINK_DIRECTORIES()
# include_directories()
# link_directories()
#
# The paths of package managers not currently in $ENV{PATH} are added to
# CMAKE_IGNORE_PATH .
@ -41,66 +41,75 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IF(NOT APPLE)
RETURN()
ENDIF()
if(NOT APPLE)
return()
endif()
IF(EXISTS /usr/local/bin/brew AND $ENV{PATH} MATCHES "(^|:)/usr/local/bin/?(:|$)")
MESSAGE("-- Configuring for Mac Homebrew")
if(NOT "$ENV{IN_NIX_SHELL}" STREQUAL "")
message(STATUS "Configuring for Nix")
SET(MAC_HOMEBREW ON)
set(NIX ON)
SET(CMAKE_IGNORE_PATH /opt/local /opt/local/bin /opt/local/include /opt/local/Library/Frameworks /opt/local/lib ${CMAKE_IGNORE_PATH})
SET(CMAKE_IGNORE_PATH /sw /sw/bin /sw/include /sw/Library/Frameworks /sw/lib ${CMAKE_IGNORE_PATH})
set(CMAKE_IGNORE_PATH /opt/local /opt/local/bin /opt/local/include /opt/local/Library/Frameworks /opt/local/lib ${CMAKE_IGNORE_PATH})
set(CMAKE_IGNORE_PATH /sw /sw/bin /sw/include /sw/Library/Frameworks /sw/lib ${CMAKE_IGNORE_PATH})
elseif(EXISTS /usr/local/bin/brew AND $ENV{PATH} MATCHES "(^|:)/usr/local/bin/?(:|$)")
message(STATUS "Configuring for Mac Homebrew")
SET(CMAKE_FRAMEWORK_PATH /usr/local/Frameworks ${CMAKE_FRAMEWORK_PATH})
set(MAC_HOMEBREW ON)
SET(CMAKE_INCLUDE_PATH /usr/local/include ${CMAKE_INCLUDE_PATH})
INCLUDE_DIRECTORIES("/usr/local/include")
set(CMAKE_IGNORE_PATH /opt/local /opt/local/bin /opt/local/include /opt/local/Library/Frameworks /opt/local/lib ${CMAKE_IGNORE_PATH})
set(CMAKE_IGNORE_PATH /sw /sw/bin /sw/include /sw/Library/Frameworks /sw/lib ${CMAKE_IGNORE_PATH})
SET(CMAKE_LIBRARY_PATH /usr/local/lib ${CMAKE_LIBRARY_PATH})
LINK_DIRECTORIES("/usr/local/lib")
set(CMAKE_FRAMEWORK_PATH /usr/local/Frameworks ${CMAKE_FRAMEWORK_PATH})
SET(CMAKE_PROGRAM_PATH /usr/local/bin ${CMAKE_PROGRAM_PATH})
ELSEIF(EXISTS /opt/local/bin/port AND $ENV{PATH} MATCHES "(^|:)/opt/local/bin/?(:|$)")
MESSAGE("-- Configuring for MacPorts")
set(CMAKE_INCLUDE_PATH /usr/local/include ${CMAKE_INCLUDE_PATH})
include_directories("/usr/local/include")
SET(MACPORTS ON)
set(CMAKE_LIBRARY_PATH /usr/local/lib ${CMAKE_LIBRARY_PATH})
link_directories("/usr/local/lib")
SET(CMAKE_IGNORE_PATH /sw /sw/bin /sw/include /sw/Library/Frameworks /sw/lib ${CMAKE_IGNORE_PATH})
set(CMAKE_PROGRAM_PATH /usr/local/bin ${CMAKE_PROGRAM_PATH})
SET(CMAKE_FRAMEWORK_PATH /opt/local/Library/Frameworks ${CMAKE_FRAMEWORK_PATH})
set(ZLIB_ROOT /usr/local/opt/zlib)
elseif(EXISTS /opt/local/bin/port AND $ENV{PATH} MATCHES "(^|:)/opt/local/bin/?(:|$)")
message(STATUS "Configuring for MacPorts")
SET(CMAKE_INCLUDE_PATH /opt/local/include ${CMAKE_INCLUDE_PATH})
INCLUDE_DIRECTORIES("/opt/local/include")
set(MACPORTS ON)
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
LINK_DIRECTORIES("/opt/local/lib")
set(CMAKE_IGNORE_PATH /sw /sw/bin /sw/include /sw/Library/Frameworks /sw/lib ${CMAKE_IGNORE_PATH})
SET(CMAKE_PROGRAM_PATH /opt/local/bin ${CMAKE_PROGRAM_PATH})
ELSEIF(EXISTS /sw/bin/fink AND $ENV{PATH} MATCHES "(^|:)/sw/bin/?(:|$)")
MESSAGE("-- Configuring for Fink")
set(CMAKE_FRAMEWORK_PATH /opt/local/Library/Frameworks ${CMAKE_FRAMEWORK_PATH})
SET(FINK ON)
set(CMAKE_INCLUDE_PATH /opt/local/include ${CMAKE_INCLUDE_PATH})
include_directories("/opt/local/include")
SET(CMAKE_IGNORE_PATH /opt/local /opt/local/bin /opt/local/include /opt/local/Library/Frameworks /opt/local/lib ${CMAKE_IGNORE_PATH})
set(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
link_directories("/opt/local/lib")
SET(CMAKE_FRAMEWORK_PATH /sw/Library/Frameworks ${CMAKE_FRAMEWORK_PATH})
set(CMAKE_PROGRAM_PATH /opt/local/bin ${CMAKE_PROGRAM_PATH})
elseif(EXISTS /sw/bin/fink AND $ENV{PATH} MATCHES "(^|:)/sw/bin/?(:|$)")
message(STATUS "Configuring for Fink")
SET(CMAKE_INCLUDE_PATH /sw/include ${CMAKE_INCLUDE_PATH})
INCLUDE_DIRECTORIES("/sw/include")
set(FINK ON)
SET(CMAKE_LIBRARY_PATH /sw/lib ${CMAKE_LIBRARY_PATH})
LINK_DIRECTORIES("/sw/lib")
set(CMAKE_IGNORE_PATH /opt/local /opt/local/bin /opt/local/include /opt/local/Library/Frameworks /opt/local/lib ${CMAKE_IGNORE_PATH})
SET(CMAKE_PROGRAM_PATH /sw/bin ${CMAKE_PROGRAM_PATH})
ELSE()
set(CMAKE_FRAMEWORK_PATH /sw/Library/Frameworks ${CMAKE_FRAMEWORK_PATH})
set(CMAKE_INCLUDE_PATH /sw/include ${CMAKE_INCLUDE_PATH})
include_directories("/sw/include")
set(CMAKE_LIBRARY_PATH /sw/lib ${CMAKE_LIBRARY_PATH})
link_directories("/sw/lib")
set(CMAKE_PROGRAM_PATH /sw/bin ${CMAKE_PROGRAM_PATH})
else()
# no package manager found or active, do nothing
RETURN()
ENDIF()
return()
endif()
# only ignore /usr/local if brew is installed and not in the PATH
# in other cases, it is the user's personal installations
IF(NOT MAC_HOMEBREW AND EXISTS /usr/local/bin/brew)
SET(CMAKE_IGNORE_PATH /usr/local /usr/local/bin /usr/local/include /usr/local/Library/Frameworks /usr/local/lib ${CMAKE_IGNORE_PATH})
ENDIF()
if(NOT MAC_HOMEBREW AND EXISTS /usr/local/bin/brew)
set(CMAKE_IGNORE_PATH /usr/local /usr/local/bin /usr/local/include /usr/local/Library/Frameworks /usr/local/lib /usr/local/opt/gettext/bin /usr/local/opt/gettext/lib ${CMAKE_IGNORE_PATH})
endif()

View File

@ -0,0 +1,244 @@
# Set TAG_RELEASE to ON/TRUE/1 to increment minor, or to new version, or to
# UNDO to undo release.
# Increment version.
# Update CHANGELOG.md with git log.
# Make release commit.
# Tag release commit.
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/.git")
message(FATAL_ERROR "releases can only be done from a git clone")
endif()
find_program(GPG_EXECUTABLE gpg)
if(NOT GPG_EXECUTABLE)
message(FATAL_ERROR "gpg must be installed and set up with your key to make a release")
endif()
# From: https://gist.github.com/alorence/59d18896aaad5188b7b4.
macro(CURRENT_DATE RESULT)
if(CMAKE_HOST_SYSTEM MATCHES Windows OR ((NOT DEFINED CMAKE_HOST_SYSTEM) AND WIN32))
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE ".*(..)/(..)/(....).*" "\\3-\\1-\\2" ${RESULT} ${${RESULT}})
else()
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
endif()
endmacro()
function(make_release_commit_and_tag)
# First make sure we are on master.
execute_process(
COMMAND git rev-parse --short --abbrev-ref=strict HEAD
OUTPUT_VARIABLE git_branch
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
if(NOT git_branch STREQUAL master)
message(FATAL_ERROR "you must be on the git master branch to release")
endif()
execute_process(
COMMAND git status --porcelain=2
OUTPUT_VARIABLE git_status
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
string(LENGTH "${git_status}" git_status_length)
if(NOT git_status_length EQUAL 0)
message(FATAL_ERROR "working tree must be clean to do a release")
endif()
execute_process(
COMMAND git tag --sort=-v:refname
OUTPUT_VARIABLE git_tags
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
string(REGEX REPLACE ";" "\\\\;" git_tags_lines "${git_tags}")
string(REGEX REPLACE "\r?\n" ";" git_tags_lines "${git_tags_lines}")
foreach(line ${git_tags_lines})
if(line MATCHES "^v[0-9]")
set(git_last_tag ${line})
break()
endif()
endforeach()
if(NOT DEFINED git_last_tag)
message(FATAL_ERROR "cannot find last release tag")
endif()
execute_process(
COMMAND git log ${git_last_tag}.. "--pretty=format:* %h - %s [%aL]"
OUTPUT_VARIABLE release_log
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
# Calculate new release version, unless it was passed in.
if(TAG_RELEASE STREQUAL UNDO)
execute_process(
COMMAND git tag -d ${git_last_tag}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
execute_process(
COMMAND git reset HEAD~1
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
execute_process(
COMMAND git checkout HEAD CHANGELOG.md
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
message(FATAL_ERROR [=[
**** RELEASE COMMIT AND TAG HAVE BEEN REMOVED ****"
The git and working tree state have been restored to their state before the
TAG_RELEASE operation.
Ignore the following cmake error.
]=])
elseif(NOT (TAG_RELEASE STREQUAL TRUE OR TAG_RELEASE STREQUAL ON OR TAG_RELEASE STREQUAL 1))
set(new_tag ${TAG_RELEASE})
else()
string(REGEX MATCH "\\.[0-9]+$" last_tag_minor_part ${git_last_tag})
string(REGEX REPLACE "\\.[0-9]+$" "" last_tag_minor_stripped ${git_last_tag})
string(SUBSTRING ${last_tag_minor_part} 1 -1 last_tag_minor)
math(EXPR last_minor_incremented "${last_tag_minor} + 1")
string(CONCAT new_tag ${last_tag_minor_stripped} . ${last_minor_incremented})
endif()
# Make sure tag begins with "v".
if(NOT new_tag MATCHES "^v")
set(new_tag "v${new_tag}")
endif()
# But remove the "v" for the version string.
string(REGEX REPLACE "^v" "" new_version ${new_tag})
current_date(current_date)
# Rewrite CHANGELOG.md
# First make a copy for backing out.
configure_file(
${CMAKE_SOURCE_DIR}/CHANGELOG.md
${CMAKE_BINARY_DIR}/CHANGELOG.md.orig
COPYONLY
)
# Now read it and add the new release.
include(FileIterator)
fi_open_file(${CMAKE_SOURCE_DIR}/CHANGELOG.md)
set(work_file ${CMAKE_BINARY_DIR}/CHANGELOG.md.work)
file(REMOVE ${work_file})
set(last_release_found FALSE)
while(NOT fi_done)
fi_get_next_line()
if(NOT last_release_found AND fi_line MATCHES "^## \\[[0-9]")
set(last_release_found TRUE)
set(tag_line "## [${new_version}] - ${current_date}")
string(LENGTH "${tag_line}" tag_line_length)
unset(tag_line_under_bar)
foreach(i RANGE 1 ${tag_line_length})
set(tag_line_under_bar "=${tag_line_under_bar}")
endforeach()
file(APPEND ${work_file} ${tag_line} "\n")
file(APPEND ${work_file} ${tag_line_under_bar} "\n")
file(APPEND ${work_file} "${release_log}" "\n")
file(APPEND ${work_file} "\n")
endif()
file(APPEND ${work_file} "${fi_line}" "\n")
endwhile()
# Convert to UNIX line endings on Windows, just copy the file otherwise.
if(CMAKE_HOST_SYSTEM MATCHES Windows OR ((NOT DEFINED CMAKE_HOST_SYSTEM) AND WIN32))
if(NOT DEFINED POWERSHELL)
message(FATAL_ERROR "Powershell is required to convert line endings on Windows.")
endif()
execute_process(
COMMAND ${POWERSHELL} -NoLogo -NoProfile -ExecutionPolicy Bypass -Command [=[
$text = [IO.File]::ReadAllText("CHANGELOG.md.work") -replace "`r`n", "`n"
[IO.File]::WriteAllText("CHANGELOG.md", $text)
]=]
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
else()
configure_file(
${CMAKE_BINARY_DIR}/CHANGELOG.md.work
${CMAKE_BINARY_DIR}/CHANGELOG.md
COPYONLY
)
endif()
# Copy the new file and add it to the commit.
configure_file(
${CMAKE_BINARY_DIR}/CHANGELOG.md
${CMAKE_SOURCE_DIR}/CHANGELOG.md
COPYONLY
)
execute_process(
COMMAND git add CHANGELOG.md
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
message(FATAL_ERROR "
Release prepared.
Edit CHANGELOG.md to remove any non-user-facing commits, and optionally add any
release notes.
Run the following commands to commit the change:
git commit -m'release ${new_tag}' --signoff -S
git tag -s -m'${new_tag}' ${new_tag}
To rollback these changes, run this command:
cmake .. -DTAG_RELEASE=UNDO
==== IF YOU ARE SURE YOU WANT TO RELEASE, THIS **CANNOT** BE REVERSED ====
Run the following to push the release commit and tag:
git push
git push --tags
Ignore the 'configuration incomplete' message following, this mode does not
build anything.
")
endfunction()
make_release_commit_and_tag()

164
cmake/Options.cmake Normal file
View File

@ -0,0 +1,164 @@
option(BUILD_TESTING "Build testing" ON)
option(BUILD_SHARED_LIBS "Build dynamic libraries" OFF)
option(TRANSLATIONS_ONLY "Build only the translations.zip" OFF)
if(TRANSLATIONS_ONLY)
set(BUILD_DEFAULT OFF)
else()
set(BUILD_DEFAULT ON)
endif()
set(ENABLE_SDL_DEFAULT ${BUILD_DEFAULT})
if(WIN32 OR APPLE)
set(ENABLE_SDL_DEFAULT OFF)
endif()
option(ENABLE_SDL "Build the SDL port" ${ENABLE_SDL_DEFAULT})
option(ENABLE_WX "Build the wxWidgets port" ${BUILD_DEFAULT})
option(ENABLE_DEBUGGER "Enable the debugger" ON)
option(ENABLE_ASAN "Enable -fsanitize=address by default. Requires debug build with GCC/Clang" OFF)
# Static linking
set(VBAM_STATIC_DEFAULT OFF)
if(VCPKG_TARGET_TRIPLET MATCHES -static OR CMAKE_TOOLCHAIN_FILE MATCHES "mxe|-static")
set(VBAM_STATIC_DEFAULT ON)
elseif(MINGW OR MSYS)
# Default to static builds on MinGW and all MSYS2 envs.
set(VBAM_STATIC_DEFAULT ON)
endif()
option(VBAM_STATIC "Try to link all libraries statically" ${VBAM_STATIC_DEFAULT})
if(VBAM_STATIC)
set(SDL2_STATIC ON)
set(SFML_STATIC_LIBRARIES ON)
set(FFMPEG_STATIC ON)
set(OPENAL_STATIC ON)
set_property(GLOBAL PROPERTY LINK_SEARCH_START_STATIC ON)
set_property(GLOBAL PROPERTY LINK_SEARCH_END_STATIC ON)
if(MSVC)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib)
else()
list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .a)
endif()
endif()
option(ENABLE_ASM "Enable x86 ASM related options" OFF)
# The ARM ASM core seems to be very buggy, see #98 and #54. Default to it being
# OFF for the time being, until it is either fixed or replaced.
option(ENABLE_ASM_CORE "Enable x86 ASM CPU cores (EXPERIMENTAL)" OFF)
set(ASM_SCALERS_DEFAULT ${ENABLE_ASM})
set(MMX_DEFAULT ${ENABLE_ASM})
option(ENABLE_ASM_SCALERS "Enable x86 ASM graphic filters" ${ASM_SCALERS_DEFAULT})
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_MMX "Enable MMX" ${MMX_DEFAULT} "ENABLE_ASM_SCALERS" OFF)
option(ENABLE_LIRC "Enable LIRC support" OFF)
# Add support for Homebrew, MacPorts and Fink on macOS
option(DISABLE_MACOS_PACKAGE_MANAGERS "Set to TRUE to disable support for macOS Homebrew, MacPorts and Fink." FALSE)
if(APPLE AND NOT DISABLE_MACOS_PACKAGE_MANAGERS)
include(MacPackageManagers)
endif()
find_package(PkgConfig)
# Link / SFML
if(TRANSLATIONS_ONLY)
set(ENABLE_LINK_DEFAULT OFF)
else()
find_package(SFML 3.0 COMPONENTS network system)
set(ENABLE_LINK_DEFAULT OFF)
if(SFML_FOUND)
set(ENABLE_LINK_DEFAULT ON)
endif()
endif()
option(ENABLE_LINK "Enable GBA linking functionality" ${ENABLE_LINK_DEFAULT})
# FFMpeg
set(FFMPEG_DEFAULT OFF)
set(FFMPEG_COMPONENTS AVCODEC AVFORMAT SWSCALE AVUTIL SWRESAMPLE)
set(FFMPEG_COMPONENT_VERSIONS AVCODEC>=58.18.100 AVFORMAT>=58.12.100 SWSCALE>=5.1.100 AVUTIL>=56.14.100 SWRESAMPLE>=3.1.100)
if(NOT TRANSLATIONS_ONLY AND (NOT DEFINED ENABLE_FFMPEG OR ENABLE_FFMPEG) AND (NOT (X86 AND MINGW)))
set(FFMPEG_DEFAULT ON)
find_package(FFmpeg COMPONENTS ${FFMPEG_COMPONENTS})
# check versions, but only if pkgconfig is available
if(FFMPEG_FOUND AND PKG_CONFIG_FOUND AND NOT CMAKE_TOOLCHAIN_FILE MATCHES vcpkg)
foreach(component ${FFMPEG_COMPONENT_VERSIONS})
string(REPLACE ">=" ";" parts ${component})
list(GET parts 0 name)
list(GET parts 1 version)
if((NOT DEFINED ${name}_VERSION) OR ${name}_VERSION VERSION_LESS ${version})
set(FFMPEG_FOUND OFF)
endif()
endforeach()
endif()
if(NOT FFMPEG_FOUND)
set(FFMPEG_DEFAULT OFF)
endif()
endif()
option(ENABLE_FFMPEG "Enable ffmpeg A/V recording" ${FFMPEG_DEFAULT})
# Online Updates
set(ONLINEUPDATES_DEFAULT OFF)
if(DEFINED(UPSTREAM_RELEASE) AND UPSTREAM_RELEASE)
set(ONLINEUPDATES_DEFAULT ON)
endif()
option(ENABLE_ONLINEUPDATES "Enable online update checks" ${ONLINEUPDATES_DEFAULT})
option(HTTPS "Use https URL for winsparkle" ON)
# We generally don't want LTO when debugging because it makes linking slow
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(LTO_DEFAULT OFF)
else()
set(LTO_DEFAULT ON)
endif()
option(ENABLE_LTO "Compile with Link Time Optimization" ${LTO_DEFAULT})
option(ENABLE_GBA_LOGGING "Enable extended GBA logging" ON)
option(UPSTREAM_RELEASE "do some optimizations and release automation tasks" OFF)
if(WIN32)
# not yet implemented
option(ENABLE_DIRECT3D "Enable Direct3D rendering for the wxWidgets port" OFF)
set(XAUDIO2_DEFAULT ON)
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
# TODO: We should update the XAudio headers to build with clang-cl. See
# https://github.com/visualboyadvance-m/visualboyadvance-m/issues/1021
set(XAUDIO2_DEFAULT OFF)
endif()
option(ENABLE_XAUDIO2 "Enable xaudio2 sound output for the wxWidgets port" ${XAUDIO2_DEFAULT})
endif()
set(ENABLE_FAUDIO_DEFAULT OFF)
find_package(FAudio QUIET)
if(FAudio_FOUND AND NOT (MINGW AND X86))
set(ENABLE_FAUDIO_DEFAULT ON)
endif()
option(ENABLE_FAUDIO "Enable FAudio sound output for the wxWidgets port" ${ENABLE_FAUDIO_DEFAULT})
option(ZIP_SUFFIX [=[suffix for release zip files, e.g. "-somebranch".zip]=] OFF)
# The SDL port can't be built without debugging support
if(NOT ENABLE_DEBUGGER AND ENABLE_SDL)
message(FATAL_ERROR "The SDL port can't be built without debugging support")
endif()
if(TRANSLATIONS_ONLY AND (ENABLE_SDL OR ENABLE_WX))
message(FATAL_ERROR "The SDL and wxWidgets ports can't be built when TRANSLATIONS_ONLY is enabled")
endif()
option(GPG_SIGNATURES "Create GPG signatures for release files" OFF)

View File

@ -1,71 +0,0 @@
function(make_path_run_wrapper cmd target)
get_filename_component(cmd_resolved "${cmd}" REALPATH)
get_filename_component(base_name "${cmd_resolved}" NAME)
get_filename_component(dir_name "${cmd_resolved}" DIRECTORY)
set(source "${target}.c")
file(WRITE "${source}"
"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define BUF_SZ 4096
#ifdef _WIN32
#include <process.h>
#define PATH_SEP ';'
#define setenv(var, val, dummy) _putenv_s(var, val)
#define execvp my_execvp
#else
#include <unistd.h>
#define PATH_SEP ':'
#endif
char* dir_name = \"${dir_name}\";
char* base_name = \"${base_name}\";
int main(int argc, char** argv) {
size_t dir_len = strlen(dir_name);
char* path = getenv(\"PATH\");
size_t path_len = strlen(path);
char* new_path = malloc(dir_len + path_len + 2);
char** new_argv = malloc(sizeof(char*) * argc);
char** p;
char buf[BUF_SZ];
strcpy(new_path, dir_name);
new_path[dir_len] = PATH_SEP;
strcpy(new_path + dir_len + 1, path);
setenv(\"PATH\", new_path, 1);
free(new_path);
p = new_argv;
*(p++) = base_name;
while (*(++argv)) *(p++) = *argv;
*p = NULL;
execvp(base_name, new_argv);
// this is only reached if exec failed
snprintf(buf, BUF_SZ, \"%s: exec failed\", argv[0]);
perror(buf);
return EXIT_FAILURE;
}
#ifdef _WIN32
int my_execvp(char* cmd, char** argv) {
int ret = _spawnvp(_P_WAIT, cmd, argv);
if (ret == -1) return ret;
exit(ret);
}
#endif
")
include(HostCompile)
host_compile("${source}" "${target}")
endfunction()

View File

@ -0,0 +1,13 @@
# Remove StrawberryPerl from the PATH environment variable due to various build
# pollution.
unset(new_path)
foreach(p $ENV{PATH})
if(NOT p MATCHES "(^|\\\\)[Ss]trawberry\\\\([Pp]erl|[Cc])\\\\(.*\\\\)?[Bb]in$")
list(APPEND new_path ${p})
endif()
endforeach()
set(ENV{PATH} "${new_path}")
# vim:sw=4 et sts=4 ts=8:

View File

@ -0,0 +1,579 @@
if(TRANSLATIONS_ONLY)
return()
endif()
if(NOT DEFINED VCPKG_TARGET_TRIPLET)
if(NOT WIN32)
return()
endif()
# Check if we are in an MSVC environment.
find_program(cl_exe_path NAME cl.exe HINTS ENV PATH)
if(ENV{CXX} MATCHES "cl.exe$" OR cl_exe_path)
# Infer the architecture from the LIB folders.
foreach(lib $ENV{LIB})
if(lib MATCHES "x64$")
set(VBAM_VCPKG_PLATFORM "x64-windows-static")
break()
endif()
if(lib MATCHES "x86$")
set(VBAM_VCPKG_PLATFORM "x86-windows-static")
break()
endif()
if(lib MATCHES "ARM64$")
set(VBAM_VCPKG_PLATFORM "arm64-windows-static")
foreach(path $ENV{PATH})
if(path MATCHES "[Hh]ost[Xx]64")
set(VCPKG_HOST_TRIPLET "x64-windows-static" CACHE STRING "Vcpkg host triplet" FORCE)
set(VCPKG_USE_HOST_TOOLS ON CACHE BOOL "Use vcpkg host tools" FORCE)
break()
endif()
endforeach()
break()
endif()
endforeach()
# If all else fails, try to use a sensible default.
if(NOT DEFINED VBAM_VCPKG_PLATFORM)
set(VBAM_VCPKG_PLATFORM "x64-windows-static")
endif()
unset(cl_exe_path)
elseif (NOT DEFINED CMAKE_CXX_COMPILER)
# No way to infer the compiler.
return()
elseif(${CMAKE_CXX_COMPILER} MATCHES "clang-cl.exe$" OR ${CMAKE_CXX_COMPILER} MATCHES "clang-cl$")
# For stand-alone clang-cl, assume x64.
set(VBAM_VCPKG_PLATFORM "x64-windows-static")
endif()
if (NOT DEFINED VBAM_VCPKG_PLATFORM)
# Probably not an MSVC environment.
return()
endif()
set(VCPKG_TARGET_TRIPLET ${VBAM_VCPKG_PLATFORM} CACHE STRING "Vcpkg target triplet (ex. x64-windows-static)" FORCE)
message(STATUS "Inferred VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}")
endif()
function(vcpkg_seconds)
if(CMAKE_HOST_SYSTEM MATCHES Windows OR ((NOT DEFINED CMAKE_HOST_SYSTEM) AND WIN32))
execute_process(
COMMAND cmd /c echo %TIME:~0,8%
OUTPUT_VARIABLE time
)
else()
execute_process(
COMMAND date +%H:%M:%S
OUTPUT_VARIABLE time
)
endif()
string(SUBSTRING "${time}" 0 2 hours)
string(SUBSTRING "${time}" 3 2 minutes)
string(SUBSTRING "${time}" 6 2 secs)
math(EXPR seconds "(${hours} * 60 * 60) + (${minutes} * 60) + ${secs}")
set(seconds ${seconds} PARENT_SCOPE)
endfunction()
function(vcpkg_check_git_status git_status)
# The VS vcpkg component cannot be written to without elevation.
if(NOT git_status EQUAL 0 AND NOT VCPKG_ROOT MATCHES "Visual Studio")
message(FATAL_ERROR "Error updating vcpkg from git, please make sure git for windows is installed correctly, it can be installed from Visual Studio components")
endif()
endfunction()
function(vcpkg_get_first_upgrade vcpkg_exe)
# First get the list of upgraded ports.
execute_process(
COMMAND ${vcpkg_exe} upgrade
OUTPUT_VARIABLE upgradable
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
WORKING_DIRECTORY ${VCPKG_ROOT}
)
string(REGEX REPLACE "\r?\n" ";" upgrade_lines "${upgradable}")
unset(first_upgrade)
foreach(line ${upgrade_lines})
if(line MATCHES "^ [* ] [^ ]*:")
string(REGEX REPLACE "^ [* ] ([^[]+).*" "\\1" pkg ${line})
string(REGEX REPLACE "^[^:]+:(.+)$" "\\1" triplet ${line})
if(triplet STREQUAL "${VCPKG_TARGET_TRIPLET}")
# Prefer upgrading zlib before anything else.
if(NOT first_upgrade OR pkg MATCHES zlib)
set(first_upgrade ${pkg})
endif()
endif()
endif()
endforeach()
if(DEFINED first_upgrade)
set(first_upgrade ${first_upgrade} PARENT_SCOPE)
endif()
endfunction()
function(vcpkg_deps_fixup vcpkg_exe)
# Get installed list.
execute_process(
COMMAND ${vcpkg_exe} list
OUTPUT_VARIABLE pkg_list
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
WORKING_DIRECTORY ${VCPKG_ROOT}
)
# If libvorbis is NOT installed but libogg is, remove libvorbis recursively.
if(pkg_list MATCHES libogg AND (NOT pkg_list MATCHES libvorbis))
execute_process(
COMMAND ${vcpkg_exe} remove --recurse libogg:${VCPKG_TARGET_TRIPLET}
WORKING_DIRECTORY ${VCPKG_ROOT}
)
endif()
endfunction()
function(vcpkg_is_installed vcpkg_exe pkg_name pkg_ver pkg_triplet powershell outvar)
set(${outvar} FALSE PARENT_SCOPE)
unset(CMAKE_MATCH_1)
string(REGEX REPLACE "-r([0-9]+)\$" "" pkg_ver ${pkg_ver})
set(pkg_rev ${CMAKE_MATCH_1})
string(REPLACE "-" "." pkg_ver ${pkg_ver})
if(NOT DEFINED VCPKG_INSTALLED_COUNT)
if(VCPKG_ROOT MATCHES "Visual Studio")
execute_process(
COMMAND ${powershell}
-executionpolicy bypass -noprofile
-command "import-module '${CMAKE_BINARY_DIR}/vcpkg-binpkg/vcpkg-binpkg.psm1'; vcpkg-list"
OUTPUT_VARIABLE vcpkg_list_text
)
else()
execute_process(
COMMAND ${vcpkg_exe} list
OUTPUT_VARIABLE vcpkg_list_text
ERROR_QUIET
)
endif()
string(REGEX REPLACE "\r?\n" ";" vcpkg_list_raw "${vcpkg_list_text}")
set(VCPKG_INSTALLED_COUNT 0 PARENT_SCOPE)
foreach(pkg ${vcpkg_list_raw})
if(NOT pkg MATCHES "^([^:[]+)[^:]*:([^ ]+) +([0-9][^ ]*) +.*\$")
continue()
endif()
set(inst_pkg_name ${CMAKE_MATCH_1})
set(inst_pkg_ver ${CMAKE_MATCH_3})
set(inst_pkg_triplet ${CMAKE_MATCH_2})
unset(CMAKE_MATCH_1)
string(REGEX REPLACE "#([0-9]+)\$" "" inst_pkg_ver ${inst_pkg_ver})
if(CMAKE_MATCH_1)
set(inst_pkg_rev ${CMAKE_MATCH_1})
else()
set(inst_pkg_rev FALSE)
endif()
string(REPLACE "-" "." inst_pkg_ver ${inst_pkg_ver})
list(APPEND VCPKG_INSTALLED ${inst_pkg_name} ${inst_pkg_ver} ${inst_pkg_rev} ${inst_pkg_triplet})
math(EXPR VCPKG_INSTALLED_COUNT "${VCPKG_INSTALLED_COUNT} + 1")
endforeach()
set(VCPKG_INSTALLED ${VCPKG_INSTALLED} PARENT_SCOPE)
set(VCPKG_INSTALLED_COUNT ${VCPKG_INSTALLED_COUNT} PARENT_SCOPE)
endif()
if(NOT VCPKG_INSTALLED_COUNT GREATER 0)
return()
endif()
math(EXPR idx_max "(${VCPKG_INSTALLED_COUNT} - 1) * 4")
foreach(idx RANGE 0 ${idx_max} 4)
math(EXPR idx_ver "${idx} + 1")
math(EXPR idx_rev "${idx} + 2")
math(EXPR idx_triplet "${idx} + 3")
list(GET VCPKG_INSTALLED ${idx} inst_pkg_name)
list(GET VCPKG_INSTALLED ${idx_ver} inst_pkg_ver)
list(GET VCPKG_INSTALLED ${idx_rev} inst_pkg_rev)
list(GET VCPKG_INSTALLED ${idx_triplet} inst_pkg_triplet)
if(NOT inst_pkg_triplet STREQUAL pkg_triplet)
continue()
endif()
if(inst_pkg_name STREQUAL pkg_name
AND pkg_ver VERSION_LESS inst_pkg_ver
OR (pkg_ver VERSION_EQUAL inst_pkg_ver
AND ((NOT pkg_rev AND NOT inst_pkg_rev)
OR (pkg_rev AND inst_pkg_rev AND (NOT pkg_rev GREATER inst_pkg_rev)))))
set(${outvar} TRUE PARENT_SCOPE)
return()
endif()
endforeach()
endfunction()
function(get_binary_packages vcpkg_exe)
set(binary_packages_installed FALSE PARENT_SCOPE)
unset(triplets)
unset(host_triplet)
# Determine host triplet for vcpkg build dependencies
if(WIN32)
if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[Aa][Rr][Mm]64")
set(host_triplet "arm64-windows")
elseif($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[Aa][Mm][Dd]64|[Xx]64")
set(host_triplet "x64-windows")
else()
set(host_triplet "x86-windows")
endif()
endif()
if(DEFINED host_triplet)
list(APPEND triplets ${host_triplet})
endif()
list(APPEND triplets ${VCPKG_TARGET_TRIPLET})
foreach(triplet ${triplets})
file(
DOWNLOAD "https://nightly.visualboyadvance-m.org/vcpkg/${triplet}/" "${CMAKE_BINARY_DIR}/binary_package_list_${triplet}.html"
STATUS pkg_list_status
)
list(GET pkg_list_status 1 pkg_list_error)
list(GET pkg_list_status 0 pkg_list_status)
if(NOT pkg_list_status EQUAL 0)
message(STATUS "Failed to download vcpkg binary package list: ${pkg_list_status} - ${pkg_list_error}")
return()
endif()
endforeach()
unset(binary_packages)
foreach(triplet ${triplets})
file(READ "${CMAKE_BINARY_DIR}/binary_package_list_${triplet}.html" raw_html)
string(REGEX MATCHALL "<a href=\"[^\"]+[.]zip\"" links ${raw_html})
foreach(link ${links})
string(REGEX REPLACE "<a href=\"([^\"]+[.]zip)\"" "\\1" pkg ${link})
list(APPEND binary_packages ${pkg})
endforeach()
endforeach()
set(vcpkg_binpkg_dir ${CMAKE_BINARY_DIR}/vcpkg-binpkg)
include(FetchContent)
FetchContent_Declare(
vcpkg_binpkg
URL "https://github.com/rkitover/vcpkg-binpkg-prototype/archive/refs/heads/master.zip"
SOURCE_DIR ${vcpkg_binpkg_dir}
)
FetchContent_GetProperties(vcpkg_binpkg)
if(NOT vcpkg_binpkg_POPULATED)
FetchContent_Populate(vcpkg_binpkg)
endif()
unset(to_install)
foreach(pkg ${binary_packages})
if(NOT pkg MATCHES "([^_]+)_([^_]+)_([^.]+)[.]zip")
continue()
endif()
set(pkg_name ${CMAKE_MATCH_1})
set(pkg_version ${CMAKE_MATCH_2})
set(pkg_triplet ${CMAKE_MATCH_3})
vcpkg_is_installed(${vcpkg_exe} ${pkg_name} ${pkg_version} ${pkg_triplet} ${POWERSHELL} pkg_installed)
if(NOT pkg_installed)
list(APPEND to_install ${pkg})
endif()
endforeach()
if(to_install)
set(bin_pkgs_dir ${CMAKE_BINARY_DIR}/vcpkg-binary-packages)
file(MAKE_DIRECTORY ${bin_pkgs_dir})
foreach(pkg ${to_install})
string(REGEX REPLACE "^[^_]+_[^_]+_([^.]+)[.]zip\$" "\\1" pkg_triplet ${pkg})
message(STATUS "Downloading https://nightly.visualboyadvance-m.org/vcpkg/${pkg_triplet}/${pkg} ...")
file(
DOWNLOAD "https://nightly.visualboyadvance-m.org/vcpkg/${pkg_triplet}/${pkg}" "${bin_pkgs_dir}/${pkg}"
STATUS pkg_download_status
)
list(GET pkg_download_status 1 pkg_download_error)
list(GET pkg_download_status 0 pkg_download_status)
if(NOT pkg_download_status EQUAL 0)
message(STATUS "Failed to download vcpkg binary package '${pkg}': ${pkg_download_status} - ${pkg_download_error}")
return()
endif()
message(STATUS "done.")
endforeach()
# -command "import-module ($env:USERPROFILE + '/source/repos/vcpkg-binpkg-prototype/vcpkg-binpkg.psm1'); vcpkg-instpkg ."
execute_process(
COMMAND ${POWERSHELL}
-executionpolicy bypass -noprofile
-command "import-module '${CMAKE_BINARY_DIR}/vcpkg-binpkg/vcpkg-binpkg.psm1'; vcpkg-instpkg ."
WORKING_DIRECTORY ${bin_pkgs_dir}
)
file(REMOVE_RECURSE ${bin_pkgs_dir})
endif()
set(binary_packages_installed TRUE PARENT_SCOPE)
endfunction()
function(vcpkg_remove_optional_deps vcpkg_exe)
list(LENGTH VCPKG_DEPS_OPTIONAL optionals_list_len)
math(EXPR optionals_list_last "${optionals_list_len} - 1")
unset(deps)
foreach(i RANGE 0 ${optionals_list_last} 2)
list(GET VCPKG_DEPS_OPTIONAL ${i} dep)
list(APPEND deps ${dep}:${VCPKG_TARGET_TRIPLET})
endforeach()
execute_process(
COMMAND ${vcpkg_exe} remove --recurse ${deps}
WORKING_DIRECTORY ${VCPKG_ROOT}
)
endfunction()
function(vcpkg_set_toolchain)
if(NOT DEFINED POWERSHELL)
message(FATAL_ERROR "Powershell is required to use vcpkg binaries.")
endif()
if(NOT DEFINED ENV{VCPKG_ROOT})
get_filename_component(preferred_root ${CMAKE_SOURCE_DIR}/../vcpkg ABSOLUTE)
if(WIN32)
if(DEFINED ENV{CI} OR EXISTS /vcpkg)
set(VCPKG_ROOT /vcpkg)
elseif(EXISTS c:/vcpkg)
set(VCPKG_ROOT c:/vcpkg)
# Prefer the preferred root to the VS default which is more difficult to deal with, if it exists.
elseif(EXISTS ${preferred_root})
set(VCPKG_ROOT ${preferred_root})
else()
find_program(vcpkg_exe_path NAME vcpkg.exe HINTS ENV PATH)
if(vcpkg_exe_path)
get_filename_component(VCPKG_ROOT ${vcpkg_exe_path} DIRECTORY)
get_filename_component(VCPKG_ROOT ${VCPKG_ROOT} ABSOLUTE)
endif()
unset(vcpkg_exe_path)
endif()
endif()
if(NOT DEFINED VCPKG_ROOT)
set(VCPKG_ROOT ${preferred_root})
endif()
set(ENV{VCPKG_ROOT} ${VCPKG_ROOT})
else()
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
endif()
set(VCPKG_ROOT ${VCPKG_ROOT} CACHE FILEPATH "vcpkg installation root path" FORCE)
if(NOT EXISTS ${VCPKG_ROOT})
get_filename_component(root_parent ${VCPKG_ROOT}/.. ABSOLUTE)
execute_process(
COMMAND git clone https://github.com/microsoft/vcpkg.git
RESULT_VARIABLE git_status
WORKING_DIRECTORY ${root_parent}
)
vcpkg_check_git_status(${git_status})
else()
# this is the case when we cache vcpkg/installed with the appveyor build cache
if(NOT EXISTS ${VCPKG_ROOT}/.git)
set(git_commands
"git init"
"git remote add origin https://github.com/microsoft/vcpkg.git"
"git fetch --all --prune"
"git reset --hard origin/master"
"git branch --set-upstream-to=origin/master master"
)
foreach(git_command ${git_commands})
separate_arguments(git_command)
execute_process(
COMMAND ${git_command}
RESULT_VARIABLE git_status
WORKING_DIRECTORY ${VCPKG_ROOT}
)
vcpkg_check_git_status(${git_status})
endforeach()
else()
execute_process(
COMMAND git fetch origin
RESULT_VARIABLE git_status
WORKING_DIRECTORY ${VCPKG_ROOT}
)
vcpkg_check_git_status(${git_status})
execute_process(
COMMAND git status
RESULT_VARIABLE git_status
OUTPUT_VARIABLE git_status_text
WORKING_DIRECTORY ${VCPKG_ROOT}
)
vcpkg_check_git_status(${git_status})
set(git_up_to_date FALSE)
if(git_status_text MATCHES "Your branch is up to date with")
set(git_up_to_date TRUE)
endif()
if(NOT git_up_to_date)
execute_process(
COMMAND git pull --rebase
RESULT_VARIABLE git_status
WORKING_DIRECTORY ${VCPKG_ROOT}
)
vcpkg_check_git_status(${git_status})
endif()
endif()
endif()
# build latest vcpkg, if needed
if(NOT git_up_to_date)
if(WIN32)
execute_process(
COMMAND bootstrap-vcpkg.bat
WORKING_DIRECTORY ${VCPKG_ROOT}
)
else()
execute_process(
COMMAND ./bootstrap-vcpkg.sh
WORKING_DIRECTORY ${VCPKG_ROOT}
)
endif()
endif()
foreach(pkg ${VCPKG_DEPS})
list(APPEND VCPKG_DEPS_QUALIFIED ${pkg}:${VCPKG_TARGET_TRIPLET})
endforeach()
if(WIN32)
set(vcpkg_exe "${VCPKG_ROOT}/vcpkg.exe")
else()
set(vcpkg_exe "${VCPKG_ROOT}/vcpkg")
endif()
# update portfiles
execute_process(
COMMAND ${vcpkg_exe} update
WORKING_DIRECTORY ${VCPKG_ROOT}
)
get_binary_packages(${vcpkg_exe})
if(NOT binary_packages_installed)
# Get number of seconds since midnight (might be wrong if am/pm is in effect on Windows.)
vcpkg_seconds()
set(began ${seconds})
# Limit total installation time to 20 minutes to not overrun CI time limit.
math(EXPR time_limit "${began} + (20 * 60)")
vcpkg_deps_fixup("${vcpkg_exe}")
# Install core deps.
execute_process(
COMMAND ${vcpkg_exe} install ${VCPKG_DEPS_QUALIFIED}
WORKING_DIRECTORY ${VCPKG_ROOT}
)
# If ports have been updated, and there is time, rebuild cache one at a time to not overrun the CI time limit.
vcpkg_seconds()
if(seconds LESS time_limit)
vcpkg_get_first_upgrade(${vcpkg_exe})
if(DEFINED first_upgrade)
# If we have to upgrade zlib, remove optional deps first so that
# the build doesn't overrun the CI time limit.
if(first_upgrade STREQUAL "zlib")
vcpkg_remove_optional_deps(${vcpkg_exe})
endif()
execute_process(
COMMAND ${vcpkg_exe} upgrade --no-dry-run "${first_upgrade}:${VCPKG_TARGET_TRIPLET}"
WORKING_DIRECTORY ${VCPKG_ROOT}
)
endif()
endif()
# Install optional deps, within time limit.
list(LENGTH VCPKG_DEPS_OPTIONAL optionals_list_len)
math(EXPR optionals_list_last "${optionals_list_len} - 1")
foreach(i RANGE 0 ${optionals_list_last} 2)
list(GET VCPKG_DEPS_OPTIONAL ${i} dep)
math(EXPR var_idx "${i} + 1")
list(GET VCPKG_DEPS_OPTIONAL ${var_idx} var)
set(val "${${var}}")
vcpkg_seconds()
if("${val}" OR (seconds LESS time_limit AND ("${val}" OR "${val}" STREQUAL "")))
set(dep_qualified "${dep}:${VCPKG_TARGET_TRIPLET}")
execute_process(
COMMAND ${vcpkg_exe} install ${dep_qualified}
WORKING_DIRECTORY ${VCPKG_ROOT}
)
set(${var} ON)
else()
set(${var} OFF)
endif()
endforeach()
endif()
if(WIN32 AND VCPKG_TARGET_TRIPLET MATCHES x64 AND CMAKE_GENERATOR MATCHES "Visual Studio")
set(CMAKE_GENERATOR_PLATFORM x64 CACHE STRING "visual studio build architecture" FORCE)
endif()
if(WIN32 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT DEFINED CMAKE_CXX_COMPILER)
if(VCPKG_TARGET_TRIPLET MATCHES "^x[68][46]-windows-")
# set toolchain to VS for e.g. Ninja or jom
set(CMAKE_C_COMPILER cl CACHE STRING "Microsoft C/C++ Compiler" FORCE)
set(CMAKE_CXX_COMPILER cl CACHE STRING "Microsoft C/C++ Compiler" FORCE)
elseif(VCPKG_TARGET_TRIPLET MATCHES "^x[68][46]-mingw-")
# set toolchain to MinGW for e.g. Ninja or jom
set(CMAKE_C_COMPILER gcc CACHE STRING "MinGW GCC C Compiler" FORCE)
set(CMAKE_CXX_COMPILER g++ CACHE STRING "MinGW G++ C++ Compiler" FORCE)
endif()
endif()
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake CACHE FILEPATH "vcpkg toolchain" FORCE)
endfunction()
vcpkg_set_toolchain()
include(${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)

View File

@ -0,0 +1,37 @@
if(NOT ENABLE_ASAN)
return()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
check_cxx_compiler_flag(/fsanitize=address MSVC_ASAN_SUPPORTED)
if(MSVC_ASAN_SUPPORTED)
add_compile_options(/fsanitize=address)
add_compile_definitions(_DISABLE_VECTOR_ANNOTATION _DISABLE_STRING_ANNOTATION)
else()
message(WARNING "ASAN not available for the compiler, disabling.")
set(ENABLE_ASAN OFF)
return()
endif()
else()
# ASAN does not work on non-debug builds for GCC and Clang.
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
message(WARNING "ASAN requires debug build, set -DCMAKE_BUILD_TYPE=Debug, disabling.")
set(ENABLE_ASAN OFF)
return()
endif()
# It is necessary to modify the linker flagas for the compiler check to work.
set(BACKUP_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
set(CMAKE_EXE_LINKER_FLAGS "-fsanitize=address")
check_cxx_compiler_flag(-fsanitize=address ASAN_SUPPORTED)
set(CMAKE_EXE_LINKER_FLAGS ${BACKUP_LINKER_FLAGS})
if(ASAN_SUPPORTED)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
else()
message(WARNING "ASAN not available for the compiler, disabling.")
set(ENABLE_ASAN OFF)
return()
endif()
endif()

View File

@ -0,0 +1,78 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR ${CROSS_ARCH})
set(COMPILER_PREFIX "${CROSS_ARCH}-w64-mingw32")
unset(CMAKE_RC_COMPILER CACHE)
unset(CMAKE_C_COMPILER CACHE)
unset(CMAKE_CXX_COMPILER CACHE)
unset(PKG_CONFIG_EXECUTABLE CACHE)
# Which compilers to use for C and C++.
find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
SET(CMAKE_FIND_ROOT_PATH
/usr/${COMPILER_PREFIX}
/usr/${COMPILER_PREFIX}/usr
/usr/${COMPILER_PREFIX}/sys-root/mingw
/usr/local/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX}
/home/linuxbrew/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX}
$ENV{HOME}/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX}
)
# find wx-config
foreach(p ${CMAKE_FIND_ROOT_PATH})
file(GLOB paths ${p}/lib/wx/config/${COMPILER_PREFIX}-msw-*)
list(APPEND wx_confs ${paths})
endforeach()
foreach(p ${wx_confs})
if(CMAKE_TOOLCHAIN_FILE MATCHES -static)
string(REGEX MATCH "(static-)?([0-9]+\\.?)+$" wx_conf_ver ${p})
else()
string(REGEX MATCH "([0-9]+\\.?)+$" wx_conf_ver ${p})
endif()
list(APPEND wx_conf_vers ${wx_conf_ver})
endforeach()
list(SORT wx_conf_vers)
list(REVERSE wx_conf_vers)
list(GET wx_conf_vers 0 wx_conf_ver)
foreach(p ${wx_confs})
if(p MATCHES "${wx_conf_ver}$")
set(wx_conf ${p})
break()
endif()
endforeach()
set(wxWidgets_CONFIG_EXECUTABLE ${wx_conf} CACHE FILEPATH "path to wx-config script for the desired wxWidgets configuration" FORCE)
if(CMAKE_TOOLCHAIN_FILE MATCHES -static)
# find the right static zlib
foreach(p ${CMAKE_FIND_ROOT_PATH})
if(EXISTS ${p}/lib/libz.a)
set(ZLIB_ROOT ${p} CACHE FILEPATH "where to find zlib" FORCE)
break()
endif()
endforeach()
endif()
if(CMAKE_PREFIX_PATH)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH})
endif()
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment too
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# pkg-config may be under the prefix
find_program(PKG_CONFIG_EXECUTABLE NAMES ${COMPILER_PREFIX}-pkg-config)

View File

@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/Toolchain-cross-MinGW-w64-i686.cmake)

View File

@ -1,30 +1,3 @@
SET(CMAKE_SYSTEM_NAME Windows)
set(CROSS_ARCH i686)
set(COMPILER_PREFIX "${CROSS_ARCH}-w64-mingw32")
unset(CMAKE_RC_COMPILER CACHE)
unset(CMAKE_C_COMPILER CACHE)
unset(CMAKE_CXX_COMPILER CACHE)
unset(PKG_CONFIG_EXECUTABLE CACHE)
# which compilers to use for C and C++
find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX} /usr/${COMPILER_PREFIX}/usr /usr/${COMPILER_PREFIX}/sys-root/mingw /usr/local/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX} /home/linuxbrew/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX} $ENV{HOME}/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX})
if(CMAKE_PREFIX_PATH)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH})
endif()
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment too
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# pkg-config may be under the prefix
find_program(PKG_CONFIG_EXECUTABLE NAMES ${COMPILER_PREFIX}-pkg-config)
set(CMAKE_SIZEOF_VOID_P 4)
include(${CMAKE_CURRENT_LIST_DIR}/Toolchain-cross-MinGW-w64-common.cmake)

View File

@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/Toolchain-cross-MinGW-w64-x86_64.cmake)

View File

@ -1,30 +1,3 @@
SET(CMAKE_SYSTEM_NAME Windows)
set(CROSS_ARCH x86_64)
set(COMPILER_PREFIX "${CROSS_ARCH}-w64-mingw32")
unset(CMAKE_RC_COMPILER CACHE)
unset(CMAKE_C_COMPILER CACHE)
unset(CMAKE_CXX_COMPILER CACHE)
unset(PKG_CONFIG_EXECUTABLE CACHE)
# which compilers to use for C and C++
find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX} /usr/${COMPILER_PREFIX}/usr /usr/${COMPILER_PREFIX}/sys-root/mingw /usr/local/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX} /home/linuxbrew/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX} $ENV{HOME}/.linuxbrew/opt/mingw-w64/toolchain-${CROSS_ARCH}/${COMPILER_PREFIX})
if(CMAKE_PREFIX_PATH)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH})
endif()
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment too
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# pkg-config may be under the prefix
find_program(PKG_CONFIG_EXECUTABLE NAMES ${COMPILER_PREFIX}-pkg-config)
set(CMAKE_SIZEOF_VOID_P 8)
include(${CMAKE_CURRENT_LIST_DIR}/Toolchain-cross-MinGW-w64-common.cmake)

View File

@ -0,0 +1,76 @@
if(X86_32 OR X86_64)
add_compile_options(-mfpmath=sse -msse2)
endif()
if(UPSTREAM_RELEASE)
if(X86_64)
# Require and optimize for Core2 level support, tune for generic.
add_compile_options(-march=core2 -mtune=generic)
elseif(X86_32)
# Optimize for pentiumi3 and tune for generic for Windows XP builds.
set(WINXP TRUE)
add_compile_options(-march=pentium3 -mtune=generic)
add_compile_definitions(-DWINXP)
endif()
endif()
# Common flags.
add_compile_options(
-pipe
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-copy>
-Wformat
-Wformat-security
-fdiagnostics-color=always
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wno-unused-command-line-argument)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-feliminate-unused-debug-types)
endif()
# check if ssp flags are supported.
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
check_cxx_compiler_flag(-fstack-protector-strong STACK_PROTECTOR_SUPPORTED)
if(STACK_PROTECTOR_SUPPORTED)
add_compile_options(-fstack-protector-strong)
check_cxx_compiler_flag("--param ssp-buffer-size=4" SSP_BUFFER_SIZE_SUPPORTED)
if(SSP_BUFFER_SIZE_SUPPORTED)
add_compile_options(--param ssp-buffer-size=4)
endif()
endif()
endif()
if(NOT ENABLE_ASM) # inline asm is not allowed with -fPIC
add_compile_options(-fPIC)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-ggdb3 -fno-omit-frame-pointer -Wall -Wextra)
else()
add_compile_options(-Ofast -fomit-frame-pointer)
endif()
# for some reason this is necessary
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
include_directories(/usr/local/include)
endif()
if(VBAM_STATIC)
if(APPLE)
add_link_options(-static-libstdc++)
else()
add_link_options(-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread)
endif()
endif()
# To support LTO, this must always fail.
add_compile_options(-Werror=odr -Werror=strict-aliasing)
add_link_options( -Werror=odr -Werror=strict-aliasing)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Werror=lto-type-mismatch)
add_link_options( -Werror=lto-type-mismatch)
endif()

View File

@ -0,0 +1,10 @@
if (NOT MINGW)
return()
endif()
# this has to run after the toolchain is initialized.
include_directories("${CMAKE_SOURCE_DIR}/win32-deps/mingw-include")
include_directories("${CMAKE_SOURCE_DIR}/win32-deps/mingw-xaudio/include")
# Add Winsock as the last library linked because of broken link precedence.
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -lws2_32")

View File

@ -0,0 +1,83 @@
# Set the runtime library properly.
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:DEBUG>:Debug>" CACHE INTERNAL "")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# MSVC-specific flags (not supported by clang-cl).
add_compile_options(/nologo)
if (NOT CMAKE_GENERATOR MATCHES "Ninja")
# Multi-processor compilation does not work well with Ninja.
add_compile_options(/MP)
endif()
endif()
include_directories("${CMAKE_SOURCE_DIR}/win32-deps/msvc")
add_compile_definitions(
_FORCENAMELESSUNION
WIN32_LEAN_AND_MEAN
WIN32
_WINDOWS
__STDC_LIMIT_MACROS
__STDC_CONSTANT_MACROS
_CRT_SECURE_NO_WARNINGS
_UNICODE
UNICODE
WINVER=0x0A00
NTDDI_VERSION=0x0A000007
NOMINMAX
)
add_compile_options(
/W4
/GR
/EHsc
)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(_DEBUG)
add_compile_options(/Ob0 /Od /RTC1)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT ENABLE_ASAN)
# Use Edit and Continue with MSVC.
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue" CACHE STRING "" FORCE)
else()
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "" FORCE)
endif()
else()
add_compile_options(/MT /Oi /Gy)
add_link_options(/OPT:REF /OPT:ICF)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "" FORCE)
if (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
add_compile_options(/O1 /Ob1)
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
add_compile_options(/O2 /Ob1)
else()
add_compile_options(/O2)
endif()
endif()
if(CMAKE_VERSION VERSION_LESS "3.25")
# Backwards-compatible way of setting the /Z option.
if(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue")
add_compile_options(/ZI)
elseif(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "ProgramDatabase")
add_compile_options(/Zi)
elseif(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "Embedded")
add_compile_options(/Z7)
else()
message(FATAL_ERROR "Unknown value for CMAKE_MSVC_DEBUG_INFORMATION_FORMAT: ${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}")
endif()
endif()
set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "" FORCE)
# We need to explicitly set all of these to override the CMake defaults.
set(CMAKE_CXX_FLAGS "" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS "" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELEASE "" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_MINSIZEREL "" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_MINSIZEREL "" CACHE STRING "" FORCE)

126
cmake/Toolchain.cmake Normal file
View File

@ -0,0 +1,126 @@
if(TRANSLATIONS_ONLY)
return()
endif()
# Compiler stuff
include(CheckCXXCompilerFlag)
include(ProcessorCount)
ProcessorCount(num_cpus)
if(ENABLE_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT LTO_SUPPORTED)
# MINGW64 does not support LTO
if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(LTO_SUPPORTED FALSE)
endif()
if(LTO_SUPPORTED)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "LTO is not supported by the compiler, diasabling LTO")
set(ENABLE_LTO OFF)
endif()
endif()
# Output all binaries at top level
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
if(NOT HTTPS)
add_compile_definitions(NO_HTTPS)
endif()
if(ENABLE_GBA_LOGGING)
add_compile_definitions(GBA_LOGGING )
endif()
if(ENABLE_MMX)
add_compile_definitions(MMX)
endif()
if(NOT ENABLE_ONLINEUPDATES)
add_compile_definitions(NO_ONLINEUPDATES)
endif()
# The debugger is enabled by default
if(ENABLE_DEBUGGER)
add_compile_definitions(VBAM_ENABLE_DEBUGGER)
endif()
# The ASM core is disabled by default because we don't know on which platform we are
if(NOT ENABLE_ASM_CORE)
add_compile_definitions(C_CORE)
endif()
# Set up "src" and generated directory as a global include directory.
set(VBAM_GENERATED_DIR ${CMAKE_BINARY_DIR}/generated)
include_directories(
${CMAKE_SOURCE_DIR}/src
${VBAM_GENERATED_DIR}
)
# C defines
add_compile_definitions(HAVE_NETINET_IN_H HAVE_ARPA_INET_H HAVE_ZLIB_H FINAL_VERSION SDL USE_OPENGL SYSCONF_INSTALL_DIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
add_compile_definitions(PKGDATADIR="${CMAKE_INSTALL_FULL_DATADIR}/vbam")
add_compile_definitions(__STDC_FORMAT_MACROS)
add_compile_definitions(LOCALEDIR="${LOCALEDIR}")
# Common compiler settings.
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(DEBUG)
else()
add_compile_definitions(NDEBUG)
endif()
if(APPLE)
add_compile_definitions(MACHO)
elseif("${CMAKE_SYSTEM}" MATCHES "Linux")
add_compile_definitions(ELF)
endif()
if(X86_64)
add_compile_definitions(__AMD64__ __X86_64__)
endif()
# Enable ASAN if requested and supported.
include(Toolchain-asan)
# MINGW/MSYS-specific settings.
include(Toolchain-mingw)
# Toolchain-specific settings.
if(MSVC)
# This also includes clang-cl.
include(Toolchain-msvc)
else()
include(Toolchain-gcc-clang)
endif()
# Assembler flags.
if(ENABLE_ASM_CORE OR ENABLE_ASM_SCALERS)
if(MSVC)
if(NOT EXISTS ${CMAKE_BINARY_DIR}/nuget.exe)
file(DOWNLOAD "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" ${CMAKE_BINARY_DIR}/nuget.exe)
endif()
execute_process(
COMMAND nuget.exe install nasm2 -OutputDirectory ${CMAKE_BINARY_DIR}/nuget
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
file(GLOB pkg ${CMAKE_BINARY_DIR}/nuget/nasm2*)
list(APPEND CMAKE_PROGRAM_PATH ${pkg}/tools)
endif()
enable_language(ASM_NASM)
set(ASM_ENABLED ON)
endif()
if(ASM_ENABLED)
string(REGEX REPLACE "<FLAGS>" "-I${CMAKE_SOURCE_DIR}/src/filters/hq/asm/ -O1 -w-orphan-labels" CMAKE_ASM_NASM_COMPILE_OBJECT ${CMAKE_ASM_NASM_COMPILE_OBJECT})
endif()

148
cmake/UpdateAppcast.cmake Normal file
View File

@ -0,0 +1,148 @@
# Clone web-data.
# Update version in appcast.xml to latest tag.
# Commit web-data.
function(update_appcast)
if(UPDATE_APPCAST STREQUAL UNDO)
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/web-data)
message(FATAL_ERROR [=[
**** APPCAST.XML UPDATE HAS BEEN UNDONE ****"
Ignore the following cmake error.
]=])
endif()
# Get last tag.
execute_process(
COMMAND git tag --sort=-v:refname
OUTPUT_VARIABLE git_tags
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
string(REGEX REPLACE ";" "\\\\;" git_tags_lines "${git_tags}")
string(REGEX REPLACE "\r?\n" ";" git_tags_lines "${git_tags_lines}")
foreach(line ${git_tags_lines})
if(line MATCHES "^v[0-9]")
set(new_tag ${line})
break()
endif()
endforeach()
if(NOT DEFINED new_tag)
message(FATAL_ERROR "cannot find last release tag")
endif()
# Remove the "v" for the version string.
string(REGEX REPLACE "^v" "" new_version ${new_tag})
# Clone repo.
execute_process(
COMMAND git clone git@github.com:visualboyadvance-m/visualboyadvance-m.github.io web-data
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
# Rewrite appcast.xml.
# First make a copy for backing out.
configure_file(
${CMAKE_BINARY_DIR}/web-data/appcast.xml
${CMAKE_BINARY_DIR}/appcast.xml.orig
COPYONLY
)
# Now read it and replace the versions.
include(FileIterator)
fi_open_file(${CMAKE_BINARY_DIR}/web-data/appcast.xml)
set(work_file ${CMAKE_BINARY_DIR}/appcast.xml.work)
file(REMOVE ${work_file})
while(NOT fi_done)
fi_get_next_line()
string(REGEX REPLACE [=[(:version="|v)([0-9.]+)([/"])]=] "\\1${new_version}\\3" fi_line "${fi_line}")
file(APPEND ${work_file} "${fi_line}" "\n")
endwhile()
# Convert to UNIX line endings on Windows, just copy the file otherwise.
if(CMAKE_HOST_SYSTEM MATCHES Windows OR ((NOT DEFINED CMAKE_HOST_SYSTEM) AND WIN32))
if(NOT DEFINED POWERSHELL)
message(FATAL_ERROR "Powershell is required to convert line endings on Windows.")
endif()
execute_process(
COMMAND ${POWERSHELL} -NoLogo -NoProfile -ExecutionPolicy Bypass -Command [=[
$text = [IO.File]::ReadAllText("appcast.xml.work") -replace "`r`n", "`n"
[IO.File]::WriteAllText("appcast.xml", $text)
]=]
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
else()
configure_file(
${CMAKE_BINARY_DIR}/appcast.xml.work
${CMAKE_BINARY_DIR}/appcast.xml
COPYONLY
)
endif()
# Copy the new file and add it to the commit.
configure_file(
${CMAKE_BINARY_DIR}/appcast.xml
${CMAKE_BINARY_DIR}/web-data/appcast.xml
COPYONLY
)
execute_process(
COMMAND git add appcast.xml
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/web-data
)
# Commit the change.
execute_process(
COMMAND git commit -m "release ${new_tag}" --signoff -S
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/web-data
)
# Make release tag.
execute_process(
COMMAND git tag -s -m${new_tag} ${new_tag}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/web-data
)
message(FATAL_ERROR [=[
appcast.xml updated.
**** IF YOU ARE SURE YOU WANT TO RELEASE ****
Run the following commands to push the release commit and tag:
cd web-data
git push
git push --tags
**** TO UNDO THE RELEASE ****
To rollback these changes, run this command:
cmake .. -DUPDATE_APPCAST=UNDO
Ignore the "configuration incomplete" message following, this mode does not
build anything.
]=])
endfunction()
update_appcast()

View File

@ -1,103 +0,0 @@
# UseGCCBinUtilsWrappers.cmake
#
# Use gcc binutils wrappers such as gcc-ar, this may be necessary for LTO.
#
# To use:
#
# put a copy into your <project_root>/CMakeScripts/
#
# In your main CMakeLists.txt add the command:
#
# INCLUDE(UseGCCBinUtilsWrappers)
#
# BSD 2-Clause License
#
# Copyright (c) 2016, Rafael Kitover
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# only do this when compiling with gcc/g++
IF(NOT (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC))
RETURN()
ENDIF()
# first try appending -util to basename of compiler
STRING(REGEX MATCH "\\.(exe|EXE)$" GCC_EXE_SUFFIX ${CMAKE_C_COMPILER})
STRING(REGEX REPLACE "\\.(exe|EXE)$" "" GCC_BASENAME ${CMAKE_C_COMPILER})
SET(GCC_AR "${GCC_BASENAME}-ar${GCC_EXE_SUFFIX}")
SET(GCC_NM "${GCC_BASENAME}-nm${GCC_EXE_SUFFIX}")
SET(GCC_RANLIB "${GCC_BASENAME}-ranlib${GCC_EXE_SUFFIX}")
# if that does not work, try looking for gcc-util in the compiler directory,
# and failing that in the PATH
GET_FILENAME_COMPONENT(GCC_DIRNAME ${CMAKE_C_COMPILER} DIRECTORY)
IF(NOT EXISTS ${GCC_AR})
UNSET(GCC_AR)
FIND_PROGRAM(GCC_AR NAMES gcc-ar gcc-ar.exe GCC-AR.EXE HINTS ${GCC_DIRNAME})
ENDIF()
IF(NOT EXISTS ${GCC_NM})
UNSET(GCC_NM)
FIND_PROGRAM(GCC_NM NAMES gcc-nm gcc-nm.exe GCC-NM.EXE HINTS ${GCC_DIRNAME})
ENDIF()
IF(NOT EXISTS ${GCC_RANLIB})
UNSET(GCC_RANLIB)
FIND_PROGRAM(GCC_RANLIB NAMES gcc-ranlib gcc-ranlib.exe GCC-RANLIB.EXE HINTS ${GCC_DIRNAME})
ENDIF()
INCLUDE(PathRun)
IF(EXISTS ${GCC_AR})
MESSAGE("-- Found gcc-ar: ${GCC_AR}")
SET(target "${CMAKE_BINARY_DIR}/gcc-ar-wrap")
MAKE_PATH_RUN_WRAPPER("${GCC_AR}" "${target}")
SET(CMAKE_AR "${target}")
ENDIF()
IF(EXISTS ${GCC_NM})
MESSAGE("-- Found gcc-nm: ${GCC_NM}")
SET(target "${CMAKE_BINARY_DIR}/gcc-nm-wrap")
MAKE_PATH_RUN_WRAPPER("${GCC_NM}" "${target}")
SET(CMAKE_NM "${target}")
ENDIF()
IF(EXISTS ${GCC_RANLIB})
MESSAGE("-- Found gcc-ranlib: ${GCC_RANLIB}")
SET(target "${CMAKE_BINARY_DIR}/gcc-ranlib-wrap")
MAKE_PATH_RUN_WRAPPER("${GCC_RANLIB}" "${target}")
SET(CMAKE_RANLIB "${target}")
ENDIF()
FOREACH(VAR "GCC_AR" "GCC_NM" "GCC_RANLIB" "GCC_DIRNAME" "GCC_BASENAME" "GCC_EXE_SUFFIX" "target")
UNSET(${VAR})
ENDFOREACH()

View File

@ -1,33 +1,3 @@
# From: https://stackoverflow.com/a/7216542
function(JOIN VALUES GLUE OUTPUT)
string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()
# convert msys paths like /c/foo to windows paths like c:/foo
# for variables set by FindWxWidgets
function(normalize_wx_paths)
if(MSYS)
unset(new_paths)
foreach(p ${wxWidgets_LIBRARY_DIRS})
execute_process(COMMAND cygpath -m "${p}" OUTPUT_VARIABLE p_win OUTPUT_STRIP_TRAILING_WHITESPACE)
list(APPEND new_paths "${p_win}")
endforeach()
set(wxWidgets_LIBRARY_DIRS ${new_paths} PARENT_SCOPE)
string(REGEX REPLACE "((^| )[^/]*)/([a-zA-Z])/" "\\1\\3:/" new_libs "${wxWidgets_LIBRARIES}")
set(wxWidgets_LIBRARIES ${new_libs} PARENT_SCOPE)
endif()
endfunction()
macro(cleanup_wx_vars)
if(wxWidgets_CXX_FLAGS)
list(REMOVE_ITEM wxWidgets_CXX_FLAGS -fpermissive)
endif()
endmacro()
function(cygpath var path)
execute_process(
@ -68,18 +38,31 @@ function(check_clean_exit var)
endfunction()
function(find_wx_util var util)
# on win32, including cross builds we prefer the plain utility name first from PATH
if(WIN32)
set(conf_suffixes "" gtk4 gtk3)
set(major_versions "" 4 3 2)
else()
set(conf_suffixes gtk4 gtk3 "")
set(major_versions 4 3 2 "")
if(WIN32 OR EXISTS /etc/gentoo-release)
# On win32, including cross builds we prefer the plain utility
# name first from PATH, with the exception of -static for static
# builds.
#
# On Gentoo /usr/bin/wx-config loads the eselected build, so we
# want to try that first.
#
# This makes a one element of empty string list.
if(VBAM_STATIC)
set(conf_suffixes "static;")
else()
set(conf_suffixes ";")
endif()
set(major_versions ";")
endif()
list(APPEND conf_suffixes gtk4u gtk4 gtk3u gtk3 gtk2u gtk2 "")
list(APPEND major_versions 4 3 2 "")
foreach(conf_suffix IN LISTS conf_suffixes)
foreach(major_version IN LISTS major_versions)
foreach(minor_version RANGE 100 0 -1)
foreach(minor_version RANGE 100 -1 -1)
unset(suffix)
if(conf_suffix)
set(suffix "-${conf_suffix}")
@ -87,7 +70,7 @@ function(find_wx_util var util)
if(major_version)
set(suffix "${suffix}-${major_version}")
if(NOT minor_version EQUAL 0)
if(NOT minor_version EQUAL -1)
set(suffix "${suffix}.${minor_version}")
endif()
endif()
@ -96,6 +79,16 @@ function(find_wx_util var util)
set(exe NOTFOUND CACHE INTERNAL "" FORCE)
find_program(exe NAMES "${util}${suffix}")
# try infix variant, as on FreeBSD
if(NOT EXISTS ${exe})
string(REGEX REPLACE "^-" "" suffix "${suffix}")
string(REGEX REPLACE "-" "${suffix}-" try ${util})
set(exe NOTFOUND CACHE INTERNAL "" FORCE)
find_program(exe NAMES ${try})
endif()
if(EXISTS ${exe})
# check that the utility can be executed cleanly
# in case we find e.g. the wrong architecture binary

View File

@ -1,65 +0,0 @@
if(WIN32 OR CMAKE_TOOLCHAIN_FILE MATCHES "[Mm][Ii][Nn][Gg][Ww]")
# compiler has not been detected yet maybe
if(CMAKE_C_COMPILER MATCHES "cl\\.exe" OR CMAKE_CXX_COMPILER MATCHES "cl\\.exe" OR MSVC OR DEFINED ENV{VisualStudioVersion})
set(VS TRUE)
endif()
set(WINARCH x86)
if(CMAKE_C_COMPILER MATCHES x64 OR CMAKE_CXX_COMPILER MATCHES x64 OR "$ENV{VSCMD_ARG_TGT_ARCH}" MATCHES x64)
set(WINARCH x64)
endif()
# Win32 deps submodules (dependencies and vcpkg)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include" OR NOT EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
set(git_checkout FALSE)
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(git_checkout TRUE)
execute_process(
COMMAND git submodule update --init --remote --recursive
RESULT_VARIABLE git_status
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)
endif()
if(NOT (git_checkout AND git_status EQUAL 0))
message(FATAL_ERROR "Please pull in git submodules, e.g.\nrun: git submodule update --init --remote --recursive")
endif()
endif()
if(VS)
set(DEPS_MSVC "${CMAKE_SOURCE_DIR}/dependencies/msvc")
include_directories("${DEPS_MSVC}") # for GL/glext.h and getopt.h
endif()
if(VS AND ENABLE_VCPKG)
if(NOT DEFINED ENV{VCPKG_ROOT})
set(ENV{VCPKG_ROOT} "${CMAKE_SOURCE_DIR}/vcpkg")
endif()
# build vcpkg if not built
if(NOT EXISTS $ENV{VCPKG_ROOT}/vcpkg.exe)
execute_process(
COMMAND bootstrap-vcpkg.bat
WORKING_DIRECTORY $ENV{VCPKG_ROOT}
)
endif()
foreach(pkg ${VCPKG_DEPS})
#list(APPEND VCPKG_DEPS_QUALIFIED ${pkg}:${WINARCH}-windows-static)
list(APPEND VCPKG_DEPS_QUALIFIED ${pkg}:${WINARCH}-windows)
endforeach()
# build our deps
execute_process(
COMMAND vcpkg install ${VCPKG_DEPS_QUALIFIED}
WORKING_DIRECTORY $ENV{VCPKG_ROOT}
)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH '' FORCE)
include("$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
set(NLS_DEFAULT OFF)
set(ENABLE_NLS OFF) # not sure why this is necessary
endif()
endif()

33
data/appcast.xml Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<item>
<link>https://github.com/visualboyadvance-m/visualboyadvance-m/releases/download/v2.1.4/visualboyadvance-m-Win-64bit.zip</link>
<enclosure
sparkle:os="windows-x64"
sparkle:version="2.1.4"
length="0"
type="application/octet-stream"
/>
</item>
<item>
<link>https://github.com/visualboyadvance-m/visualboyadvance-m/releases/download/v2.1.4/visualboyadvance-m-Win-32bit.zip</link>
<enclosure
sparkle:os="windows-x86"
sparkle:version="2.1.4"
length="0"
type="application/octet-stream"
/>
</item>
<item>
<link>https://github.com/visualboyadvance-m/visualboyadvance-m/releases/download/v2.1.4/visualboyadvance-m-Mac-64bit.zip</link>
<enclosure
sparkle:os="macos"
sparkle:version="2.1.4"
length="0"
type="application/octet-stream"
/>
</item>
</channel>
</rss>

8
default.nix Normal file
View File

@ -0,0 +1,8 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "visualboyadvance-m";
buildInputs = if stdenv.isDarwin then
[ ninja cmake nasm faudio gettext libintl pkg-config zip zlib openal ffmpeg wxGTK32 SDL2 pcre pcre2 darwin.apple_sdk.frameworks.System darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa darwin.apple_sdk.frameworks.QuartzCore darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.OpenGL darwin.apple_sdk.frameworks.OpenAL llvmPackages_latest.clang llvmPackages_latest.bintools ]
else
[ ninja cmake gcc clang llvm llvmPackages.libcxx nasm faudio gettext libintl pkg-config zip zlib openal ffmpeg wxGTK32 libGL libGLU glfw SDL2 gtk3-x11 pcre pcre2 util-linuxMinimal libselinux libsepol libthai libdatrie xorg.libXdmcp xorg.libXtst libxkbcommon libepoxy dbus at-spi2-core ];
}

@ -1 +0,0 @@
Subproject commit 3e018956d57cf32278a3f3cdd67763b304732482

View File

@ -2,59 +2,27 @@
Developer Information File
==========================
Known preprocessor switches:
- SDL: Defined for the SDL version
- GBA_LOGGING: Enables logging for the GBA core
- FINAL_VERSION: Defined for release versions, disables additional GBA logging and completely disables GB logging. Increases the amount of CPU cycles being emulated in one go.
- BKPT_SUPPORT
- VBAM_ENABLE_DEBUGGER: Enable remote debugging support
- MMX: Enable MMX instruction set
- NO_ASM: Use C++ version of hq3x/4x filters
- RGB555: Use 16bit colors with 5bit green instead of 6bit green in hq3x/4x filters (C++ version)
- NO_OGL: Exclude OpenGL code
- NO_D3D: Exclude Direct3D code
- NO_OAL: Exclude OpenAL code
- NO_XAUDIO2: Exclude XAudio2 code (the XAudio2 interface is DirectSound's successor)
- VBAM_ENABLE_XAUDIO2: Enable XAudio2 code (the XAudio2 interface is DirectSound's successor)
- VBAM_ENABLE_FAUDIO: Enable FAudio code (the FAudio interface is an open source multiplatform re-implementation of XAudio2)
- NO_LINK: Exclude linking code (joybus, multilink, ...)
- WIN64: This macro is only defined for 64 bit builds
Download locations:
NASM: http://nasm.us/
DirectX SDK: http://msdn.microsoft.com/en-us/xna/aa937788.aspx
OpenAL SDK: http://connect.creativelabs.com/openal/default.aspx
OpenGL files: http://www.opengl.org/registry/
zlib: http://zlib.net/
libpng: http://libpng.org/pub/png/libpng.html
You can find pre-built versions of zlib & libpng at:
http://spacy51.sp.funpic.de/VBA-M/libs/
Just extract them somewhere and point Visual C++ 2008 to the include & lib folders.
They are built with the static C runtime (this is what the release builds use).
###########################
# --- Build Systems --- #
###########################
===Win32/MFC===
This is the full-featured Windows build using the MFC GUI.
The project files are located in /project/vc2008_mfc (VBA2008.sln) and /project/vs2010_mfc (VBA2010.sln).
Anyone distributing builds should be using MSVC 2010 SP1, the unpatched release has a bug where it applies SSE2 updates to mov and other instructions resulting in illegal instruction errors on cpu's only supporting SSE.
You also have to install Microsoft's DirectX SDK for Direct3D, DirectInput & XAudio2.
If you want to enable OpenAL sound output, install the OpenAL SDK. If you do not want it, add NO_OAL to the VBA-M project's preprocessor definitions.
SubWCRev.exe is used to append the svn versioning to the output executable, this as of TortoiseSVN 1.7, is only available by installing TortoiseSVN.
All other dependencies for MSVC builds may be found in the ../dependencies directory (above /trunk).
Normally, Windows users will want to checkout the root of the repository instead of just the trunk directory. Afterwards, simply opening the .sln of choice, setting preprocessor definitions, and hitting build is all that's required.
===*nix/GTK===
===src/sdl===
This is the standard build configuration on non-Windows.
Running cmake will inform you of any packages you need to install.
===*/wxw===
The wxWidgets interface is an in-development frontend meant to be more cross-platform friendly than MFC and GTK.
===src/wx===
The wxWidgets interface is an in-development frontend meant to be more cross-platform friendly than MFC and SDL.
Running cmake will inform you of any packages you need to install.
NOTE: In addition to what cmake currently checks for, you will also need the wxrc tool and libgdiplus.

View File

@ -9,7 +9,7 @@
VisualBoyAdvance-M
Nintendo Game Boy & Game Boy Advance Emulator
Project Homepage: http://vba-m.com
Project Homepage: http://visualboyadvance-m.org
This program is distributed under the GNU General Public License
http://www.gnu.org/licenses/gpl.html

View File

@ -1,44 +0,0 @@
#Do not use this file directly. Always use the top level CMakeLists.txt file
#File extractors so the user doesn't have to extract the rom before playing it
# Source files definition
SET(SRC_FEX
7z_C/7zAlloc.c
7z_C/7zBuf.c
7z_C/7zCrc.c
7z_C/7zCrcOpt.c
7z_C/7zDec.c
7z_C/7zIn.c
7z_C/7zStream.c
7z_C/Bcj2.c
7z_C/Bra86.c
7z_C/Bra.c
7z_C/CpuArch.c
7z_C/Lzma2Dec.c
7z_C/LzmaDec.c
7z_C/Ppmd7.c
7z_C/Ppmd7Dec.c
fex/Binary_Extractor.cpp
fex/blargg_common.cpp
fex/blargg_errors.cpp
fex/Data_Reader.cpp
fex/fex.cpp
fex/File_Extractor.cpp
fex/Gzip_Extractor.cpp
fex/Gzip_Reader.cpp
fex/Rar_Extractor.cpp
fex/Zip7_Extractor.cpp
fex/Zip_Extractor.cpp
fex/Zlib_Inflater.cpp
)
INCLUDE_DIRECTORIES(
.
${ZLIB_INCLUDE_DIRS}
)
ADD_LIBRARY(
fex
STATIC
${SRC_FEX}
)

View File

@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "File_Extractor", "File_Extractor2010.vcxproj", "{7AEC599C-7C82-4F00-AA60-411E0A359CB0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7AEC599C-7C82-4F00-AA60-411E0A359CB0}.Debug|Win32.ActiveCfg = Debug|Win32
{7AEC599C-7C82-4F00-AA60-411E0A359CB0}.Debug|Win32.Build.0 = Debug|Win32
{7AEC599C-7C82-4F00-AA60-411E0A359CB0}.Release|Win32.ActiveCfg = Release|Win32
{7AEC599C-7C82-4F00-AA60-411E0A359CB0}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,159 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>File_Extractor</ProjectName>
<ProjectGuid>{7AEC599C-7C82-4F00-AA60-411E0A359CB0}</ProjectGuid>
<RootNamespace>File_Extractor</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Build\</OutDir>
<IntDir>$(ProjectDir)$(Platform)\$(Configuration)\$(ProjectFileName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Build\</OutDir>
<IntDir>$(ProjectDir)$(Platform)\$(Configuration)\$(ProjectFileName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<BuildLog />
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalIncludeDirectories>$(ProjectDir)..\dependencies\zlib;$(ProjectDir);$(ProjectDir)7z_C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<BuildLog />
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\dependencies\zlib;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
<BufferSecurityCheck>false</BufferSecurityCheck>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="7z_C\7zAlloc.c" />
<ClCompile Include="7z_C\7zBuf.c" />
<ClCompile Include="7z_C\7zCrc.c" />
<ClCompile Include="7z_C\7zCrcOpt.c" />
<ClCompile Include="7z_C\7zDec.c" />
<ClCompile Include="7z_C\7zIn.c" />
<ClCompile Include="7z_C\7zStream.c" />
<ClCompile Include="7z_C\Bcj2.c" />
<ClCompile Include="7z_C\Bra.c" />
<ClCompile Include="7z_C\Bra86.c" />
<ClCompile Include="7z_C\CpuArch.c" />
<ClCompile Include="7z_C\Lzma2Dec.c" />
<ClCompile Include="7z_C\LzmaDec.c" />
<ClCompile Include="7z_C\Ppmd7.c" />
<ClCompile Include="7z_C\Ppmd7Dec.c" />
<ClCompile Include="fex\Binary_Extractor.cpp" />
<ClCompile Include="fex\blargg_common.cpp" />
<ClCompile Include="fex\blargg_errors.cpp" />
<ClCompile Include="fex\Data_Reader.cpp" />
<ClCompile Include="fex\fex.cpp" />
<ClCompile Include="fex\File_Extractor.cpp" />
<ClCompile Include="fex\Gzip_Extractor.cpp" />
<ClCompile Include="fex\Gzip_Reader.cpp" />
<ClCompile Include="fex\Rar_Extractor.cpp" />
<ClCompile Include="fex\Zip7_Extractor.cpp" />
<ClCompile Include="fex\Zip_Extractor.cpp" />
<ClCompile Include="fex\Zlib_Inflater.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="7z_C\7z.h" />
<ClInclude Include="7z_C\7zAlloc.h" />
<ClInclude Include="7z_C\7zBuf.h" />
<ClInclude Include="7z_C\7zCrc.h" />
<ClInclude Include="7z_C\Bcj2.h" />
<ClInclude Include="7z_C\Bra.h" />
<ClInclude Include="7z_C\CpuArch.h" />
<ClInclude Include="7z_C\Lzma2Dec.h" />
<ClInclude Include="7z_C\LzmaDec.h" />
<ClInclude Include="7z_C\Ppmd.h" />
<ClInclude Include="7z_C\Ppmd7.h" />
<ClInclude Include="7z_C\Types.h" />
<ClInclude Include="fex\Binary_Extractor.h" />
<ClInclude Include="fex\blargg_common.h" />
<ClInclude Include="fex\blargg_config.h" />
<ClInclude Include="fex\blargg_endian.h" />
<ClInclude Include="fex\blargg_errors.h" />
<ClInclude Include="fex\blargg_source.h" />
<ClInclude Include="fex\Data_Reader.h" />
<ClInclude Include="fex\fex.h" />
<ClInclude Include="fex\File_Extractor.h" />
<ClInclude Include="fex\Gzip_Extractor.h" />
<ClInclude Include="fex\Gzip_Reader.h" />
<ClInclude Include="fex\Rar_Extractor.h" />
<ClInclude Include="fex\Zip7_Extractor.h" />
<ClInclude Include="fex\Zip_Extractor.h" />
<ClInclude Include="fex\Zlib_Inflater.h" />
</ItemGroup>
<ItemGroup>
<None Include="7z_C\7zC.txt" />
<None Include="7z_C\lzma.txt" />
<None Include="changes.txt" />
<None Include="fex.txt" />
<None Include="internals.txt" />
<None Include="license.txt" />
<None Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\dependencies\zlib\project\vs2010\zlib.vcxproj">
<Project>{3e03c179-8251-46e4-81f4-466f114bac63}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,190 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="fex">
<UniqueIdentifier>{40ba751f-4ce2-4162-85a2-0c2ae2f33ae2}</UniqueIdentifier>
</Filter>
<Filter Include="7z_C">
<UniqueIdentifier>{4f3646e4-ddc5-4030-9ba1-7629a947e5db}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="fex\Binary_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\blargg_common.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\blargg_errors.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Data_Reader.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\fex.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\File_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Gzip_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Gzip_Reader.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Rar_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Zip_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Zip7_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Zlib_Inflater.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zAlloc.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zBuf.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zCrc.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zCrcOpt.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zDec.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zIn.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zStream.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Bcj2.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Bra.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Bra86.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\CpuArch.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Lzma2Dec.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\LzmaDec.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Ppmd7.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Ppmd7Dec.c">
<Filter>7z_C</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="fex\Binary_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_common.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_config.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_endian.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_errors.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_source.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Data_Reader.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\fex.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\File_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Gzip_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Gzip_Reader.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Rar_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Zip_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Zip7_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Zlib_Inflater.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="7z_C\7z.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\7zAlloc.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\7zBuf.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\7zCrc.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Bcj2.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Bra.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\CpuArch.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Lzma2Dec.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\LzmaDec.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Ppmd7.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Ppmd.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Types.h">
<Filter>7z_C</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="changes.txt" />
<None Include="fex.txt" />
<None Include="internals.txt" />
<None Include="license.txt" />
<None Include="readme.txt" />
<None Include="7z_C\7zC.txt">
<Filter>7z_C</Filter>
</None>
<None Include="7z_C\lzma.txt">
<Filter>7z_C</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@ -1,161 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>File_Extractor</ProjectName>
<ProjectGuid>{7AEC599C-7C82-4F00-AA60-411E0A359CB0}</ProjectGuid>
<RootNamespace>File_Extractor</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Build\</OutDir>
<IntDir>$(ProjectDir)$(Platform)\$(Configuration)\$(ProjectFileName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Build\</OutDir>
<IntDir>$(ProjectDir)$(Platform)\$(Configuration)\$(ProjectFileName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<BuildLog />
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalIncludeDirectories>$(ProjectDir)..\dependencies\zlib;$(ProjectDir);$(ProjectDir)7z_C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<BuildLog />
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\dependencies\zlib;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
<BufferSecurityCheck>false</BufferSecurityCheck>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="7z_C\7zAlloc.c" />
<ClCompile Include="7z_C\7zBuf.c" />
<ClCompile Include="7z_C\7zCrc.c" />
<ClCompile Include="7z_C\7zCrcOpt.c" />
<ClCompile Include="7z_C\7zDec.c" />
<ClCompile Include="7z_C\7zIn.c" />
<ClCompile Include="7z_C\7zStream.c" />
<ClCompile Include="7z_C\Bcj2.c" />
<ClCompile Include="7z_C\Bra.c" />
<ClCompile Include="7z_C\Bra86.c" />
<ClCompile Include="7z_C\CpuArch.c" />
<ClCompile Include="7z_C\Lzma2Dec.c" />
<ClCompile Include="7z_C\LzmaDec.c" />
<ClCompile Include="7z_C\Ppmd7.c" />
<ClCompile Include="7z_C\Ppmd7Dec.c" />
<ClCompile Include="fex\Binary_Extractor.cpp" />
<ClCompile Include="fex\blargg_common.cpp" />
<ClCompile Include="fex\blargg_errors.cpp" />
<ClCompile Include="fex\Data_Reader.cpp" />
<ClCompile Include="fex\fex.cpp" />
<ClCompile Include="fex\File_Extractor.cpp" />
<ClCompile Include="fex\Gzip_Extractor.cpp" />
<ClCompile Include="fex\Gzip_Reader.cpp" />
<ClCompile Include="fex\Rar_Extractor.cpp" />
<ClCompile Include="fex\Zip7_Extractor.cpp" />
<ClCompile Include="fex\Zip_Extractor.cpp" />
<ClCompile Include="fex\Zlib_Inflater.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="7z_C\7z.h" />
<ClInclude Include="7z_C\7zAlloc.h" />
<ClInclude Include="7z_C\7zBuf.h" />
<ClInclude Include="7z_C\7zCrc.h" />
<ClInclude Include="7z_C\Bcj2.h" />
<ClInclude Include="7z_C\Bra.h" />
<ClInclude Include="7z_C\CpuArch.h" />
<ClInclude Include="7z_C\Lzma2Dec.h" />
<ClInclude Include="7z_C\LzmaDec.h" />
<ClInclude Include="7z_C\Ppmd.h" />
<ClInclude Include="7z_C\Ppmd7.h" />
<ClInclude Include="7z_C\Types.h" />
<ClInclude Include="fex\Binary_Extractor.h" />
<ClInclude Include="fex\blargg_common.h" />
<ClInclude Include="fex\blargg_config.h" />
<ClInclude Include="fex\blargg_endian.h" />
<ClInclude Include="fex\blargg_errors.h" />
<ClInclude Include="fex\blargg_source.h" />
<ClInclude Include="fex\Data_Reader.h" />
<ClInclude Include="fex\fex.h" />
<ClInclude Include="fex\File_Extractor.h" />
<ClInclude Include="fex\Gzip_Extractor.h" />
<ClInclude Include="fex\Gzip_Reader.h" />
<ClInclude Include="fex\Rar_Extractor.h" />
<ClInclude Include="fex\Zip7_Extractor.h" />
<ClInclude Include="fex\Zip_Extractor.h" />
<ClInclude Include="fex\Zlib_Inflater.h" />
</ItemGroup>
<ItemGroup>
<None Include="7z_C\7zC.txt" />
<None Include="7z_C\lzma.txt" />
<None Include="changes.txt" />
<None Include="fex.txt" />
<None Include="internals.txt" />
<None Include="license.txt" />
<None Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\dependencies\zlib\project\vs2013\zlib.vcxproj">
<Project>{3e03c179-8251-46e4-81f4-466f114bac63}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,190 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="fex">
<UniqueIdentifier>{40ba751f-4ce2-4162-85a2-0c2ae2f33ae2}</UniqueIdentifier>
</Filter>
<Filter Include="7z_C">
<UniqueIdentifier>{4f3646e4-ddc5-4030-9ba1-7629a947e5db}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="fex\Binary_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\blargg_common.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\blargg_errors.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Data_Reader.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\fex.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\File_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Gzip_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Gzip_Reader.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Rar_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Zip_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Zip7_Extractor.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="fex\Zlib_Inflater.cpp">
<Filter>fex</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zAlloc.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zBuf.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zCrc.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zCrcOpt.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zDec.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zIn.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\7zStream.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Bcj2.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Bra.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Bra86.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\CpuArch.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Lzma2Dec.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\LzmaDec.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Ppmd7.c">
<Filter>7z_C</Filter>
</ClCompile>
<ClCompile Include="7z_C\Ppmd7Dec.c">
<Filter>7z_C</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="fex\Binary_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_common.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_config.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_endian.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_errors.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\blargg_source.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Data_Reader.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\fex.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\File_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Gzip_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Gzip_Reader.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Rar_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Zip_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Zip7_Extractor.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="fex\Zlib_Inflater.h">
<Filter>fex</Filter>
</ClInclude>
<ClInclude Include="7z_C\7z.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\7zAlloc.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\7zBuf.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\7zCrc.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Bcj2.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Bra.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\CpuArch.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Lzma2Dec.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\LzmaDec.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Ppmd7.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Ppmd.h">
<Filter>7z_C</Filter>
</ClInclude>
<ClInclude Include="7z_C\Types.h">
<Filter>7z_C</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="changes.txt" />
<None Include="fex.txt" />
<None Include="internals.txt" />
<None Include="license.txt" />
<None Include="readme.txt" />
<None Include="7z_C\7zC.txt">
<Filter>7z_C</Filter>
</None>
<None Include="7z_C\lzma.txt">
<Filter>7z_C</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -1,14 +1,13 @@
#!/bin/sh
CMAKE=cmake
ENABLE_FFMPEG=1
main() {
cd "$(dirname $0)"
check_command_line_args "$@"
target=$1
mktmp
check_os
@ -25,7 +24,12 @@ check_command_line_args() {
usage
quit 0
;;
--no-ffmpeg)
ENABLE_FFMPEG=
shift
;;
*)
target=$1
break
;;
esac
@ -45,6 +49,9 @@ check_os() {
Darwin)
os=mac
;;
FreeBSD)
os=freebsd
;;
MINGW*|MSYS*)
os=windows
;;
@ -69,32 +76,28 @@ quit() {
usage() {
cat <<'EOF'
Usage: ./installdeps [TARGET]
Try to install the dependencies needed for this project appropriately on the
host OS.
Try to install the dependencies needed for this project appropriately on the host OS.
This program may require sudo.
A cross-compile target may be specified as the only parameter, of either
m32 which targets the host in 32 bit mode (e.g. x86 on an amd64
host) or win32, MinGW-w64-i686 or
MinGW-w64-x86_64. win32 is an alias for
MinGW-w64-i686 to target Windows via MinGW. Cross compiling for
Windows is only supported on Debian/Ubuntu, Fedora, Arch Linux and MSYS2.
A cross-compile target may be specified as the only parameter, of either m32 which targets the host in 32 bit mode (e.g. x86 on an amd64 host) or win32, MinGW-w64-i686 or MinGW-w64-x86_64. win32 is an alias for MinGW-w64-i686 to target Windows via MinGW. Cross compiling for Windows is only supported on Debian/Ubuntu, Fedora, Arch Linux and MSYS2.
On MSYS2 dependencies are installed for 32 or 64 bit native Windows targets
based on which shell you started (the value of $MSYSTEM) unless you specify one
or the other. You can specify a cross target of m32 or
m64 as aliases for the 32 bit or 64 bit targets respectively.
MSYS2 POSIX layer builds are not supported.
On MSYS2 the MinGW-w64-clang-x86_64 target for CLANG64 and the MinGW-w64-clang-i686 target for CLANG32 are also supported, as well as MinGW-w64-ucrt-x86_64 for UCRT64.
On MSYS2 dependencies are installed for 32 or 64 bit native Windows targets based on which shell you started (the value of $MSYSTEM) unless you specify one or the other. You can specify a cross target of m32 or m64 as aliases for the 32 bit or 64 bit MinGW gcc targets respectively. MSYS2 POSIX layer builds are not supported.
-h, --help, --usage Show this help screen and exit.
--no-openal Do not install OpenAL dependencies.
--no-ffmpeg Do not install ffmpeg dependencies.
Examples:
./installdeps # install dependencies for a host build
./installdeps m32 # make a 32 bit binary for the host OS
./installdeps win32 # cross-compile for 32 bit windows (Debian/Ubuntu, Arch Linux or MSYS2)
./installdeps MinGW-w64-i686 # likewise
./installdeps MinGW-w64-x86_64 # cross-compile for 64 bit windows (Debian/Ubuntu, Arch Linux or MSYS2)
./installdeps win64 # cross-compile for 64 bit windows (Debian/Ubuntu, Arch Linux or MSYS2)
./installdeps MinGW-w64-x86_64 # likewise
EOF
}
@ -157,23 +160,47 @@ linux_installdeps() {
fedora_installdeps
elif [ -f /etc/redhat-release ] || [ -f /etc/centos-release ]; then
rhel_installdeps
elif [ -f /etc/arch-release ]; then
archlinux_installdeps
elif [ -f /etc/solus-release ]; then
solus_installdeps
elif [ -f /etc/gentoo-release ]; then
gentoo_installdeps
elif [ -x /usr/bin/pacman ]; then
archlinux_installdeps
elif [ -f /etc/os-release ]; then
case "$(. /etc/os-release; echo "$ID_LIKE")" in
case "$(. /etc/os-release; echo "${ID_LIKE:-$ID}")" in
*suse*)
suse_installdeps
;;
nixos)
nixos_installdeps
;;
alpine)
alpine_installdeps
;;
*)
error "Don't know how to install deps on your version of Linux"
;;
esac
else
error "Don't know how to install deps on your version of Linux"
fi
}
freebsd_installdeps() {
installing
check sudo pkg update
pkgs="llvm-devel cmake ccache nasm ffmpeg gettext-tools gettext pkgconf sdl2 sfml wx31-gtk3 iconv zip ninja"
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs ffmpeg"
# currently the wx30 and wx31 packages produce GTK errors on CURRENT (as of 04/2019)
check sudo pkg install -y $pkgs
build_instructions
}
# the -j flag for make parameter, empty if 1
jobs_flag() {
if [ $(num_cpus) -gt 1 ]; then
@ -197,7 +224,7 @@ num_cpus() {
_num_cpus=$(nproc)
elif [ $os = linux -o $os = windows ]; then
_num_cpus=$(grep '^processor *:' /proc/cpuinfo | wc -l)
elif [ $os = mac ]; then
elif [ $os = mac ] || [ $os = freebsd ]; then
_num_cpus=$(sysctl -n hw.ncpu)
fi
@ -218,6 +245,15 @@ check_cross() {
MINGW64)
target='mingw-w64-x86_64'
;;
CLANG32)
target='mingw-w64-clang-i686'
;;
CLANG64)
target='mingw-w64-clang-x86_64'
;;
UCRT64)
target='mingw-w64-ucrt-x86_64'
;;
MSYS)
error 'host builds in MSYS mode are not supported, supply a target or start a MINGW shell'
;;
@ -231,7 +267,7 @@ check_cross() {
fi
case "$target" in
win32|mingw*)
win32|win64|mingw*)
if [ -z "$arch_linux" -a -z "$msys2" -a -z "$debian" -a -z "$fedora" ]; then
error 'win32 cross compiling targets are only supported on Debian/Ubuntu, Fedora, Arch and MSYS2 at the moment'
fi
@ -240,17 +276,15 @@ check_cross() {
win32)
target='mingw-w64-i686'
;;
mingw-w64-i686)
win64)
target='mingw-w64-x86_64'
;;
mingw-w64-x86_64)
mingw-w64-x86_64|mingw-w64-i686|mingw-w64-clang-x86_64|mingw-w64-ucrt-x86_64|mingw-w64-clang-i686)
;;
*)
error "target must be one of 'm32', 'win32', 'MinGW-w64-i686' or 'MinGW-w64-x86_64'"
error "target must be one of 'm32', 'win32', 'win64', or one of the MinGW/clang/ucrt targets supported by MSYS2: mingw-w64-[clang|ucrt]-(x86_64|i686)."
;;
esac
# get the necessary win32 headers
check git submodule update --remote --recursive
;;
m32|-m32)
target=m32
@ -284,11 +318,43 @@ debian_installdeps() {
if [ -z "$target" ]; then
sudo apt-get -qq -y update
sfml_libs=$(apt-cache search libsfml | grep -E 'graphics|window|network' | sed 's/ - .*//')
sfml_libs=
glew_lib=$(apt-cache search libglew | grep '^libglew[0-9]' | sed 's/ - .*//')
for lib in graphics window network; do
sfml_libs="$sfml_libs $(apt-cache search "libsfml-$lib" | sed 's/ - .*//' | sort -r | head -1)"
done
check sudo apt-get -qy install build-essential g++ nasm cmake ccache gettext zlib1g-dev libgl1-mesa-dev libavcodec-dev libavformat-dev libswscale-dev libavutil-dev libgettextpo-dev libpng-dev libsdl2-dev libsdl2-2.0 libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev libsfml-dev $sfml_libs $glew_lib libopenal-dev libwxgtk3.0-dev libwxgtk3.0 libgtk2.0-dev libgtk-3-dev ccache zip
glew_lib=$(apt-cache search libglew | grep '^libglew[0-9]' | sed 's/ - .*//' | sort -r | head -1)
sdl_lib=$(apt-cache search '^libsdl2-2.0' | sed 's/ - .*//' | sort -r | head -1)
# not present in trusty
if [ -n "$ENABLE_FFMPEG" ]; then
libswresample_dev=$(apt-cache search libswresample-dev | awk '{print $1}')
fi
wx_libs=$(apt-cache search 'libwxgtk[0-9]' | sed 's/ - .*//')
# Use -gtk3 variant on older distros.
case "$wx_libs" in
*-gtk3*)
new_wx_libs=
for pkg in $wx_libs; do
case "$pkg" in
*-gtk3*)
new_wx_libs="$new_wx_libs $pkg"
;;
esac
done
wx_libs=$new_wx_libs
;;
esac
pkgs="build-essential g++ nasm cmake ccache gettext zlib1g-dev libgl1-mesa-dev libgettextpo-dev libsdl2-dev $sdl_lib libglu1-mesa-dev libglu1-mesa libgles2-mesa-dev libsfml-dev $sfml_libs $glew_lib $wx_libs libgtk2.0-dev libgtk-3-dev ccache zip ninja-build libopenal-dev"
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs libavcodec-dev libavformat-dev libswscale-dev libavutil-dev $libswresample_dev"
check sudo apt-get -qy install $pkgs
else
case "$target" in
mingw-w64-i686)
@ -304,35 +370,23 @@ debian_installdeps() {
;;
esac
# if on the travis ubuntu trusty, add xenial sources for newer gnutls
# otherwise the mxe pkg server does not work
if [ -n "$TRAVIS" ]; then
if grep -q trusty /etc/apt/sources.list 2>/dev/null; then
sudo sh -c "sed 's/trusty/xenial/g' /etc/apt/sources.list > /etc/apt/sources.list.d/xenial.list"
fi
fi
pre_build='export PATH="$PATH:/usr/lib/mxe/usr/bin"'
sudo apt-get -qq -y update
debian_rel=$(lsb_release -a 2>/dev/null | sed -En 's/^Codename:[[:space:]]*//p')
curl_gnutls_lib=$(apt-cache search libcurl | grep -E '^libcurl[0-9]+-gnutls - ' | sed 's/ - .*//' | sort | tail -1)
sudo apt-get -qy install apt apt-transport-https ca-certificates $curl_gnutls_lib curl
# this is necessary to upgrade libcurl from trusty to xenial on travis
sudo apt-get -qy -f install
debian_rel=trusty
apt_ssl_exceptions=/etc/apt/apt.conf.d/80ssl-exceptions
if ! grep -Eq '(pkg|mirror)\.mxe\.cc' $apt_ssl_exceptions 2>/dev/null; then
sudo sh -c "cat >> $apt_ssl_exceptions" <<EOF
Acquire::https::pkg.mxe.cc::Verify-Peer "false";
Acquire::https::pkg.mxe.cc::Verify-Host "false";
Acquire::https::mirror.mxe.cc::Verify-Peer "false";
Acquire::https::mirror.mxe.cc::Verify-Host "false";
EOF
fi
case "$debian_rel" in
bionic|stretch|trusty|xenial)
;;
yakkety|zesty|artful)
debian_rel=xenial
;;
utopic|vivid|wily)
debian_rel=trusty
;;
*)
debian_rel=bionic
;;
esac
mxe_apt_sources=/etc/apt/sources.list.d/mxeapt.list
@ -340,20 +394,35 @@ EOF
if [ -z "$(apt-cache search '^mxe-source$')" ]; then
if [ ! -f "$mxe_apt_sources" ]; then
echo "deb https://pkg.mxe.cc/repos/apt $debian_rel main" | sudo -- sh -c "cat > $mxe_apt_sources"
echo "deb http://pkg.mxe.cc/repos/apt $debian_rel main" | sudo -- sh -c "cat > $mxe_apt_sources"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C6BF758A33A3A276 || :
else
error "$mxe_apt_sources exists but mxe packages are not found in apt, either delete it or fix it"
fi
fi
deps="gcc zlib ffmpeg gettext sdl2 sfml openal wxwidgets openal"
[ -n "$ENABLE_FFMPEG" ] && deps="$deps ffmpeg"
set --
for dep in gcc zlib ffmpeg gettext sdl2 sfml openal wxwidgets; do
for dep in $deps; do
set -- "$@" "mxe-${target}-$dep"
done
check sudo apt-get --allow-unauthenticated -qq -y update
# native wx-common needed for wxrc executable
check sudo apt-get --allow-unauthenticated -qy install build-essential cmake ccache wx-common "$@"
# Native wx-common needed for wxrc executable.
check sudo apt-get --allow-unauthenticated -qy install build-essential cmake ninja-build ccache wx-common git "$@"
# The ccache symlink is broken in some versions of these mxe packages.
ccache_link=/usr/lib/mxe/.ccache/bin/ccache
if [ ! -e "$ccache_link" ]; then
sudo mkdir -p ${ccache_link%/*}
sudo ln -sf /usr/bin/ccache "$ccache_link"
fi
# get the necessary win32 headers
git submodule update --init --remote --recursive
fi
build_instructions
@ -362,7 +431,6 @@ EOF
fedora_installdeps() {
fedora=1
ffmpeg=ffmpeg-devel
no_ffmpeg=
rpms_installed=
check_cross
@ -370,42 +438,43 @@ fedora_installdeps() {
warning=
# using --nogpgcheck with dnf because keys can be a problem on rawhide
if [ -n "$ENABLE_FFMPEG" ]; then
# using --nogpgcheck with dnf because keys can be a problem on rawhide
fedora_release=$(rpm -E %fedora)
tries=3
curdir=$(pwd)
fedora_release=$(rpm -E %fedora)
tries=3
curdir=$(pwd)
# make sure rpmfusion is installed for ffmpeg
while [ $tries -gt 0 ]; do
mkdir -p "${tmp}/fusion"
cd "${tmp}/fusion"
if ! curl -fLO https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${fedora_release}.noarch.rpm; then
fedora_release=$((fedora_release - 1))
tries=$((tries - 1))
continue
fi
if ! curl -fLO https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${fedora_release}.noarch.rpm; then
tries=0
# make sure rpmfusion is installed for ffmpeg
while [ $tries -gt 0 ]; do
mkdir -p "${tmp}/fusion"
cd "${tmp}/fusion"
if ! curl -fLO https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${fedora_release}.noarch.rpm; then
fedora_release=$((fedora_release - 1))
tries=$((tries - 1))
continue
fi
if ! curl -fLO https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${fedora_release}.noarch.rpm; then
tries=0
break
fi
# check if already installed
if rpm -q rpmfusion-free-release-${fedora_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${fedora_release} >/dev/null 2>&1; then
info_msg 'rpmfusion already installed, good'
break
fi
# otherwise try to install
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
tries=0
break
fi
break
done
cd "$curdir"
if [ $tries -eq 0 ]; then
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
no_ffmpeg=1
fi
# check if already installed
if rpm -q rpmfusion-free-release-${fedora_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${fedora_release} >/dev/null 2>&1; then
info_msg 'rpmfusion already installed, good'
break
fi
# otherwise try to install
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
tries=0
break
fi
break
done
cd "$curdir"
if [ $tries -eq 0 ]; then
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
no_ffmpeg=1
cmake_flags="$cmake_flags -DENABLE_FFMPEG=NO"
fi
# non-multiarch packages first
@ -429,22 +498,30 @@ fedora_installdeps() {
# this is sometimes necessary for rawhide
set -- --exclude='glibc32*'
fi
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libpng-devel SDL2-devel SFML-devel openal-soft-devel wxGTK3-devel gtk3-devel; do
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel SDL2-devel SFML-devel openal-soft-devel wxGTK-devel gtk3-devel; do
case $pkg in
*ffmpeg*)
[ -n "$no_ffmpeg" ] && continue
[ -z "$ENABLE_FFMPEG" ] && continue
;;
esac
pkg_arch=
if [ -n "$amd64" ]; then
pkg_arch=.x86_64
if [ "$target" = m32 ]; then
set -- "$@" "${pkg}.i686"
else
set -- "$@" "${pkg}.x86_64"
pkg_arch=.i686
fi
else
set -- "$@" "$pkg"
fi
# Check which is newer, wxGTK or wxGTK3.
if [ "$pkg" = wxGTK-devel ]; then
pkg=$(dnf -q --releasever=$(rpm -E %fedora) --showduplicates list wxGTK-devel wxGTK3-devel 2>/dev/null | awk '{ print $1 "\t" $2 }' | grep -Ev '^(Installed|Available)' | sort -rVu -k 2,2 | head -1 | awk '{ print $1 }' | sed -E 's/\.[^.]+//')
[ -z "$pkg" ] && pkg=wxGTK3-devel
fi
set -- "$@" "${pkg}${pkg_arch}"
done
# fedora has a bug where all necessary -devel packages are not pulled in for 32 bit direct -devel deps
@ -503,33 +580,31 @@ fedora_installdeps() {
case "$target" in
mingw-w64-i686)
target=mingw32
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686.cmake -DENABLE_LINK=NO"
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686-static.cmake"
;;
mingw-w64-x86_64)
target=mingw64
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64.cmake -DENABLE_LINK=NO"
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64-static.cmake"
;;
*)
error 'unknown cross target (this should not happen)'
;;
esac
# install static deps
for pkg in zlib gettext libpng SDL2 wxWidgets; do
for pkg in zlib gettext SDL2 wxWidgets3 openal-soft; do
set -- "$@" "${target}-${pkg}-static"
done
# install deps that are not available as static
for pkg in openal-soft; do
set -- "$@" "${target}-${pkg}"
done
# get the necessary win32 headers
git submodule update --init --remote --recursive
warning='SFML is required for LINK support, Fedora does not currently have a MinGW SFML package, if you want LINK support you will need to install it manually'
fi
[ -z "$rpms_installed" ] && check sudo dnf -y --nogpgcheck --best --allowerasing install "$@"
if ! rpm -q $ffmpeg >/dev/null 2>&1; then
if [ -n "$ENABLE_FFMPEG" ] && ! rpm -q $ffmpeg >/dev/null 2>&1; then
warning 'ffmpeg failed to install (probably due to conflicts)'
cmake_flags="$cmake_flags -DENABLE_FFMPEG=NO"
fi
[ -n "$warning" ] && warning "$warning"
@ -540,7 +615,6 @@ fedora_installdeps() {
rhel_installdeps() {
rhel=1
ffmpeg=ffmpeg-devel
no_ffmpeg=
rpms_installed=
check_cross
@ -556,35 +630,35 @@ rhel_installdeps() {
check sudo yum -y install epel-release
# make sure rpmfusion is installed for ffmpeg
while [ $tries -gt 0 ]; do
mkdir -p "${tmp}/fusion"
cd "${tmp}/fusion"
if ! curl -fLO https://download1.rpmfusion.org/free/el/rpmfusion-free-release-${rhel_release}.noarch.rpm; then
rhel_release=$((rhel_release - 1))
tries=$((tries - 1))
continue
fi
if ! curl -fLO https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-${rhel_release}.noarch.rpm; then
tries=0
if [ -n "$ENABLE_FFMPEG" ]; then
while [ $tries -gt 0 ]; do
mkdir -p "${tmp}/fusion"
cd "${tmp}/fusion"
if ! curl -fLO https://download1.rpmfusion.org/free/el/rpmfusion-free-release-${rhel_release}.noarch.rpm; then
rhel_release=$((rhel_release - 1))
tries=$((tries - 1))
continue
fi
if ! curl -fLO https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-${rhel_release}.noarch.rpm; then
tries=0
break
fi
# check if already installed
if rpm -q rpmfusion-free-release-${rhel_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${rhel_release} >/dev/null 2>&1; then
info_msg 'rpmfusion already installed, good'
break
fi
# otherwise try to install
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
tries=0
break
fi
break
done
cd "$curdir"
if [ $tries -eq 0 ]; then
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
fi
# check if already installed
if rpm -q rpmfusion-free-release-${rhel_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${rhel_release} >/dev/null 2>&1; then
info_msg 'rpmfusion already installed, good'
break
fi
# otherwise try to install
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
tries=0
break
fi
break
done
cd "$curdir"
if [ $tries -eq 0 ]; then
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
no_ffmpeg=1
cmake_flags="$cmake_flags -DENABLE_FFMPEG=NO"
fi
# non-multiarch packages first
@ -611,12 +685,11 @@ rhel_installdeps() {
fi
warning='RHEL does not currently have SFML packages, LINK support will be disabled'
cmake_flags="$cmake_flags -DENABLE_LINK=NO"
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libpng-devel SDL2-devel openal-soft-devel wxGTK3-devel gtk3-devel; do
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel SDL2-devel openal-soft-devel wxGTK3-devel gtk3-devel; do
case $pkg in
*ffmpeg*)
[ -n "$no_ffmpeg" ] && continue
[ -z "$ENABLE_FFMPEG" ] && continue
;;
esac
@ -687,33 +760,31 @@ rhel_installdeps() {
case "$target" in
mingw-w64-i686)
target=mingw32
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686.cmake -DENABLE_LINK=NO"
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686.cmake"
;;
mingw-w64-x86_64)
target=mingw64
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64.cmake -DENABLE_LINK=NO"
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64.cmake"
;;
*)
error 'unknown cross target (this should not happen)'
;;
esac
# install static deps
for pkg in zlib gettext libpng SDL2 wxWidgets; do
for pkg in zlib gettext SDL2 wxWidgets openal-soft; do
set -- "$@" "${target}-${pkg}-static"
done
# install deps that are not available as static
for pkg in openal-soft; do
set -- "$@" "${target}-${pkg}"
done
# get the necessary win32 headers
git submodule update --init --remote --recursive
warning='SFML is required for LINK support, RHEL/EPEL does not currently have a MinGW SFML package, if you want LINK support you will need to install it manually'
fi
[ -z "$rpms_installed" ] && check sudo yum -y install "$@"
if ! rpm -q $ffmpeg >/dev/null 2>&1; then
if [ -n "$ENABLE_FFMPEG" ] && ! rpm -q $ffmpeg >/dev/null 2>&1; then
warning 'ffmpeg failed to install (probably due to conflicts)'
cmake_flags="$cmake_flags -DENABLE_FFMPEG=NO"
fi
[ -n "$warning" ] && warning "$warning"
@ -726,18 +797,12 @@ suse_installdeps() {
check_cross
installing
tools="\
make cmake ccache nasm gettext-tools pkg-config ccache zip sfml2-devel\
" # ffmpeg-devel
tools="make cmake ccache nasm gettext-tools pkg-config ccache zip sfml2-devel ninja"
libs="\
gcc gcc-c++ libpng16-devel libSDL2-devel openal-soft-devel wxWidgets-3_0-devel\
" # ffmpeg-devel
# ffmpeg requires packman repos
libs="gcc gcc-c++ libSDL2-devel wxGTK3-3_2-devel openal-soft-devel ffmpeg-7-libavcodec-devel ffmpeg-7-libavdevice-devel ffmpeg-7-libavfilter-devel ffmpeg-7-libavformat-devel ffmpeg-7-libavutil-devel ffmpeg-7-libpostproc-devel ffmpeg-7-libswresample-devel ffmpeg-7-libswscale-devel"
if [ "$target" = m32 ]; then
libs=$(echo "$libs" | sed -E 's/([^ ]) ([^ ])/\1-32bit \2/g; s/$/-32bit/;')
cmake_flags="$cmake_flags -DENABLE_LINK=NO"
error '32 bit cross builds are no longer supported on OpenSUSE'
fi
check sudo zypper in -y $tools $libs
@ -745,6 +810,18 @@ gcc gcc-c++ libpng16-devel libSDL2-devel openal-soft-devel wxWidgets-3_0-devel\
build_instructions
}
nixos_installdeps() {
nixos=1
cat <<EOF
To build run:
nix-shell --command 'mkdir build; cd build; $CMAKE .. $cmake_flags -G Ninja; ninja'
EOF
}
archlinux_require_yaourt() {
if ! command -v yaourt >/dev/null; then
(
@ -783,18 +860,25 @@ archlinux_installdeps() {
# common needed dev packages
# not using the base-devel group because it can break gcc-multilib
check $pacman --noconfirm --needed -S binutils file grep gawk gzip libtool make patch sed util-linux nasm cmake ccache pkg-config git ccache zip
check $pacman --noconfirm --needed -S binutils file grep gawk gzip libtool make patch sed util-linux nasm cmake ccache pkg-config git ccache zip ninja
gtk=gtk3
$pacman -Q gtk3-classic >/dev/null 2>&1 && gtk=gtk3-classic
libs="zlib mesa gettext libpng sdl2 openal wxgtk3 $gtk sfml ffmpeg"
libs="zlib mesa gettext sdl2 wxgtk3 $gtk sfml openal"
[ -n "$ENABLE_FFMPEG" ] && libs="$libs ffmpeg"
if [ -z "$target" -o "$target" = m32 ]; then
if [ -z "$target" -o -z "$amd64" ]; then
# native build
check $pacman --noconfirm --needed -S "$gcc_pkg" $libs
# Native build.
#
# On newer versions wxgtk2 may have to be manually removed.
if ! $pacman --noconfirm --needed -S "$gcc_pkg" $libs; then
$pacman --noconfirm -R wxgtk2
fi
$pacman --noconfirm --needed -S "$gcc_pkg" $libs
else
# try to build 32 bit binaries
@ -827,10 +911,10 @@ EOF
# windows cross build
case "$target" in
*i686*)
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686.cmake -DENABLE_LINK=NO"
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686.cmake"
;;
*x86_64*)
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64.cmake -DENABLE_LINK=NO"
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64.cmake"
;;
*)
# this will never be reached, it's checked in check_cross()
@ -878,8 +962,10 @@ EOF
fi
done
deps="zlib gettext pkg-config sdl2 wxmsw openal"
# and the actual deps
for p in zlib gettext libpng pkg-config sdl2 openal wxmsw; do
for p in $deps; do
pkg="${pkg_prefix}${p}"
# check if already installed
if ! $pacman -Q "$pkg" >/dev/null 2>&1; then
@ -888,6 +974,9 @@ EOF
done
[ $# -gt 0 ] && check $pacman --noconfirm --needed -S "$@"
# get the necessary win32 headers
git submodule update --init --remote --recursive
warning 'SFML is required for LINK support, the SFML package in AUR is currently broken, if you want LINK support you will need to install it manually'
fi
@ -902,9 +991,10 @@ solus_installdeps() {
check sudo eopkg -y update-repo
check sudo eopkg -y install -c system.devel
check sudo eopkg -y install git ccache
check sudo eopkg -y install git ccache ninja
set -- sdl2-devel wxwidgets-devel libgtk-2-devel libgtk-3-devel libglu-devel openal-soft-devel
set -- sdl2-devel openal-soft-devel wxwidgets-devel libgtk-2-devel libgtk-3-devel
if [ -n "$amd64" -a "$target" = m32 ]; then
info_msg 'Calculating dependencies, this will take a while..'
@ -958,8 +1048,6 @@ solus_installdeps() {
if [ -n "$amd64" -a "$target" = m32 ]; then
warning 'SFML is required for LINK support, there is no 32 bit SFML package in Solus currently, if you want LINK support you will need to install it manually'
warning 'ffmpeg is required for game recording, there is no 32 bit ffmpeg package in Solus currently, you may wish to install it manually'
cmake_flags="$cmake_flags -DENABLE_LINK=NO -DENABLE_FFMPEG=NO"
fi
build_instructions
@ -969,11 +1057,41 @@ gentoo_installdeps() {
installing
check sudo emerge-webrsync
check sudo emerge -vuDUa gcc make cmake ccache binutils libsdl2 libsfml wxGTK zlib dev-util/pkgconfig nasm
# We want the gtk3 slot for wxWidgets.
wx_slot=$(equery -qC list -p -F '$slot' x11-libs/wxGTK | grep gtk3 | sort -rV | head -1)
ebuilds="\
sys-devel/gcc \
dev-build/make \
dev-build/cmake \
dev-util/ccache \
sys-devel/binutils \
media-libs/libsdl2 \
media-libs/libsfml \
media-libs/openal \
x11-libs/wxGTK:$wx_slot \
sys-libs/zlib \
dev-util/pkgconf \
dev-lang/nasm \
dev-build/ninja"
[ -n "$ENABLE_FFMPEG" ] && ebuilds="$ebuilds media-video/ffmpeg"
check sudo emerge -vna $ebuilds
build_instructions
}
alpine_installdeps() {
installing
check sudo apk add cmake ninja g++ ccache nasm gettext-dev zlib-dev mesa-dev sdl2-dev glu-dev sfml-dev wxwidgets-dev gtk+3.0-dev zip
build_instructions
}
windows_installdeps() {
msys2=1
@ -983,15 +1101,53 @@ windows_installdeps() {
# update catalogs
check pacman -Sy
pkgs=
case "$target" in
*clang*)
pkgs="lldb clang"
;;
*)
pkgs="gcc gcc-libs gcc-libgfortran"
;;
esac
case "$target" in
*i686*)
pkgs="$pkgs nasm"
;;
*)
pkgs="$pkgs FAudio"
;;
esac
pkgs="$pkgs SDL2 sfml wxWidgets3.2 zlib binutils cmake crt-git headers-git make pkgconf tools-git windows-default-manifest libmangle-git ninja gdb ccache openal"
case "$target" in
*x86_64)
pkgs="$pkgs extra-cmake-modules"
;;
esac
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs ffmpeg"
set --
for p in SDL2 ffmpeg openal sfml wxWidgets zlib binutils cmake crt-git extra-cmake-modules gcc gcc-libs gcc-libgfortran gdb headers-git make pkg-config tools-git windows-default-manifest libmangle-git nasm; do
for p in $pkgs; do
set -- "$@" "${target}-${p}"
done
# install
check pacman --noconfirm --needed -S git make zip ccache "$@"
case "$target" in
*clang*)
# We use gcc windres for now, llvm-rc is sometimes broken.
set -- "$@" mingw-w64-x86_64-binutils
;;
esac
cmake_flags="$cmake_flags -G 'MSYS Makefiles'"
# install
check pacman --noconfirm --needed -S git make zip "$@"
# get the necessary win32 headers
check git submodule update --init --remote --recursive
if [ "$MSYSTEM" = MSYS ]; then
case "$target" in
@ -1037,13 +1193,25 @@ brew_installdeps() {
check brew -v update
set --
for f in nasm cmake ccache ffmpeg gettext libpng pkg-config sdl2 sfml wxmac ccache; do
if brew info "$f" | grep -Eq '^Not installed$'; then
set -- "$@" "$f"
fi
brews="nasm cmake ccache gettext pkg-config sdl2 wxwidgets faudio ccache ninja zlib"
[ -n "$ENABLE_FFMPEG" ] && brews="$brews ffmpeg"
# sfml brew currently broken in the travis mac environment
# if [ -z "$TRAVIS" ]; then
brews="$brews sfml"
# fi
# This is necessary for the GitHub Actions CI:
brew -v install python
brew link --overwrite python
check brew -v install -f $brews
for brew in gettext wxwidgets; do
brew unlink $brew
brew link $brew --force
done
[ $# -gt 0 ] && check brew -v install "$@"
brew -v cleanup
@ -1055,7 +1223,12 @@ macports_installdeps() {
installing
check sudo port -v selfupdate
check sudo port -v install cmake ccache nasm ffmpeg gettext libpng pkgconfig libsdl2 sfml wxWidgets-3.0 libiconv ccache
ports="cmake ccache nasm gettext pkgconfig libsdl2 sfml wxWidgets-3.0 libiconv ninja"
[ -n "$ENABLE_FFMPEG" ] && ports="$ports ffmpeg"
check sudo port -v install $ports
check sudo port select wxWidgets wxWidgets-3.0
build_instructions
@ -1066,7 +1239,12 @@ fink_installdeps() {
installing
check sudo fink -vy selfupdate
check sudo fink -vy install cmake ccache nasm ffmpeg libgettext8-dev gettext-tools libpng16 pkgconfig sdl2 wxwidgets300-osxcocoa libiconv-dev sfml24-dev ccache
pkgs="cmake ccache nasm libgettext8-dev gettext-tools pkgconfig sdl2 wxwidgets300-osxcocoa libiconv-dev sfml24-dev ccache ninja"
[ -n "$ENABLE_FFMPEG" ] && pkgs="$pkgs ffmpeg"
check sudo fink -vy install $pkgs
build_instructions
}
@ -1077,12 +1255,14 @@ build_instructions() {
Done! To build do:
$pre_build
mkdir -p build && cd build
$CMAKE .. $cmake_flags
make $(jobs_flag)
mkdir build && cd build
$CMAKE .. -DCMAKE_BUILD_TYPE=Release $cmake_flags -G Ninja
ninja
$post_build
EOF
}
main "$@"
# vim:et sw=4:

View File

@ -1,251 +0,0 @@
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "VisualBoyAdvance-M"
!define PRODUCT_VERSION "2.1.0"
!define PRODUCT_PUBLISHER "visualboyadvance"
!define PRODUCT_WEB_SITE "https://vba-m.com"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\visualboyadvance-m.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
#If you're building this, point it to your mingw installation folder
!define MINGW32_ROOT "D:\Development\msys64\mingw32\bin"
!define MINGW64_ROOT "D:\Development\msys64\mingw64\bin"
#This is where you installed vba-m with make install.
!define VBAM_INSTALL_ROOT "D:\Development\msys64\opt\vbam"
#comment this out if not building with msys2
!define MSYS2
!ifdef MSYS2
OutFile "vba-m-${PRODUCT_VERSION}-msys2.exe"
!else
OutFile "vba-m-${PRODUCT_VERSION}.exe
!endif
SetCompressor /SOLID lzma
ShowInstDetails show
ShowUninstDetails show
XPStyle on
!packhdr tmpexe.tmp "upx --lzma -9 --compress-icons=0 tmpexe.tmp"
BrandingText "VisualBoyAdvance-M Version ${PRODUCT_VERSION}"
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "Sections.nsh"
!include "x64.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
;--------------------------------
;Version resource
VIProductVersion "${PRODUCT_VERSION}.0"
VIAddVersionKey "ProductName" "visualboyadvance-m"
VIAddVersionKey "FileVersion" "${PRODUCT_VERSION}"
VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}"
VIAddVersionKey "LegalCopyright" ""
!ifdef MSYS2
VIAddVersionKey "FileDescription" "visualboyadvance-m GBA Emulator (built with msys2)"
!else
VIAddVersionKey "FileDescription" "visualboyadvance-m GBA Emulator"
!endif
;--------------------------------
;Reserve files used in .onInit
;for faster start-up
ReserveFile "${NSISDIR}\Plugins\unicode\System.dll"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
!insertmacro MUI_RESERVEFILE_LANGDLL
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE ".\doc\gpl.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\visualboyadvance-m.exe"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "vba-m_${PRODUCT_VERSION}_setup.exe"
InstallDir "$PROGRAMFILES64\VisualBoyAdvance-M"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Function .onInit
Aero::Apply
FunctionEnd
Section "MainSection" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
!ifdef MSYS2
File "${VBAM_INSTALL_ROOT}\bin\visualboyadvance-m.exe"
File "${MINGW64_ROOT}\libwinpthread-1.dll"
File "${MINGW64_ROOT}\libpng16-16.dll"
File "${MINGW64_ROOT}\libintl-8.dll"
File "${MINGW64_ROOT}\SDL2.dll"
File "${MINGW64_ROOT}\libsfml-network-2.dll"
File "${MINGW64_ROOT}\libsfml-system-2.dll"
File "${MINGW64_ROOT}\wxbase30u_gcc_custom.dll"
File "${MINGW64_ROOT}\wxbase30u_net_gcc_custom.dll"
File "${MINGW64_ROOT}\wxbase30u_xml_gcc_custom.dll"
File "${MINGW64_ROOT}\wxmsw30u_adv_gcc_custom.dll"
File "${MINGW64_ROOT}\wxmsw30u_core_gcc_custom.dll"
File "${MINGW64_ROOT}\wxmsw30u_html_gcc_custom.dll"
File "${MINGW64_ROOT}\wxmsw30u_gl_gcc_custom.dll"
File "${MINGW64_ROOT}\wxmsw30u_xrc_gcc_custom.dll"
File "${MINGW64_ROOT}\zlib1.dll"
File "${MINGW64_ROOT}\libiconv-2.dll"
File "${MINGW64_ROOT}\libgcc_s_seh-1.dll"
File "${MINGW64_ROOT}\libstdc++-6.dll"
File "${MINGW64_ROOT}\libjpeg-8.dll"
File "${MINGW64_ROOT}\libtiff-5.dll"
File "${MINGW64_ROOT}\libexpat-1.dll"
File "${MINGW64_ROOT}\liblzma-5.dll"
!else
File "${VBAM_INSTALL_ROOT}\bin\visualboyadvance-m.exe"
!endif
CreateDirectory "$SMPROGRAMS\VisualBoyAdvance-M"
CreateShortCut "$SMPROGRAMS\VisualBoyAdvance-M\VisualBoyAdvance.lnk" "$INSTDIR\visualboyadvance-m.exe"
CreateShortCut "$DESKTOP\VisualBoyAdvance.lnk" "$INSTDIR\visualboyadvance-m.exe"
SectionEnd
Section "Localization"
SetOutPath "$INSTDIR\locale"
File "${VBAM_INSTALL_ROOT}\share\locale\ar\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\br\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\bs\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ca\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ca_ES\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\cs\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\da\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\da_DK\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\de\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\de_DE\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\el\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\el_GR\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\en\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\en_GB\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\en_US\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es_419\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es_AR\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es_CL\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es_CO\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es_ES\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es_MX\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es_PR\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\es_US\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\fil\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\fr\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\fr_CA\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\fr_FR\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\gl\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\haw\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\he\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\he_IL\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\hr\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\hu\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\hu_HU\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\id\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\id_ID\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\it\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\it_IT\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ja\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ja_JP\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\jv\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ko\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ko_KR\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ms_MY\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\nb\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\nl\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\nl_NL\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\no\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\pl\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\pl_PL\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\pt\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\pt_PT\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\pt_BR\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ru\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\ru_RU\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\sk\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\sk_SK\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\sr\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\su\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\sv\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\tk\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\tr\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\zh\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\zh_CN\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\zh_CN.GB2312\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\zh_HK\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\zh_TW\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\zh_TW.Big5\LC_MESSAGES\wxvbam.mo"
File "${VBAM_INSTALL_ROOT}\share\locale\zh-Hans\LC_MESSAGES\wxvbam.mo"
SectionEnd
Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\VisualBoyAdvance-M\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\VisualBoyAdvance-M\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\visualboyadvance-m.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\visualboyadvance-m.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\vbam.exe"
Delete "$INSTDIR\visualboyadvance-m.exe"
Delete "$SMPROGRAMS\VisualBoyAdvance-M\Uninstall.lnk"
Delete "$SMPROGRAMS\VisualBoyAdvance-M\Website.lnk"
Delete "$DESKTOP\VisualBoyAdvance.lnk"
Delete "$SMPROGRAMS\VisualBoyAdvance-M\VisualBoyAdvance.lnk"
RMDir "$SMPROGRAMS\VisualBoyAdvance-M"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd

View File

@ -1,4 +0,0 @@
IF(ENABLE_WX)
add_subdirectory(wxvbam)
ENDIF(ENABLE_WX)

View File

@ -1,7 +0,0 @@
#!/bin/sh
# Generate translation template file for the wxWidgets port
wxrc -g ../src/wx/xrc/*.xrc -o wx-xrc-strings.h
xgettext -k_ -kN_ -o wxvbam/wxvbam.pot ../src/wx/*.cpp ../src/wx/*.h ../src/wx/widgets/*.cpp wx-xrc-strings.h
rm -r wx-xrc-strings.h

View File

@ -1,8 +1,7 @@
if(NOT TRANSLATIONS_ONLY AND NOT ENABLE_WX)
return()
endif()
file(GLOB po_files "${CMAKE_CURRENT_SOURCE_DIR}/*.po")
GETTEXT_CREATE_TRANSLATIONS(
wxvbam.pot
${po_files}
)
ADD_DEPENDENCIES(visualboyadvance-m translations)
gettext_create_translations(wxvbam.pot ${po_files})

File diff suppressed because it is too large Load Diff

3885
po/wxvbam/bg.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More