Commit Graph

2565 Commits

Author SHA1 Message Date
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