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>
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>
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.
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>
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>
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>
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>
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>
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.
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`.
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.
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.
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>
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>
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>
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>
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>
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>
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`.
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.
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.
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>
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.
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>