Commit Graph

2383 Commits

Author SHA1 Message Date
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
Rafael Kitover 1401573f52
release v2.1.3
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-17 17:23:23 +00:00
Rafael Kitover ac35e37ca0
fix game geometry on windows
Previously when working on Visual Studio support I noticed an XRC error
dialog when adding the game area to the BoxSizer.

I tried removing the wxEXPAND flag with insufficient testing, the flag
is actually necessary.

The error is actually an incorrect debug assertion that is present in
3.1.2 and later fixed in master. The assertion is not triggered when
the project is built in release mode.

Remove the windows conditional code that removes the wxEXPAND flag.

TODO: silence assertion in debug mode or patch the wxWidgets vcpkg port.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-17 13:38:29 +00:00
Rafael Kitover 9fa544d1bb
cmake: wxWidgets Release config for visual studio
Fix the cmake code that sets up wxWidgets when using vcpkg with Visual
Studio so that the Release configuration also works. Use variables
instead of an if statement.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-17 13:15:13 +00:00
Rafael Kitover 3cacb363a6
libretro: put " " between version and git sha
To make the version string consistent with other cores, make it of the
form "<VER> <SHORT-SHA>" with a space in-between.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 15:51:30 +00:00
Rafael Kitover c2656f1375
libretro: remove "-" between version and git sha
To make the libretro core consistent with other cores, remove the "-"
between the version and the git short sha for git builds.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 15:46:32 +00:00
Rafael Kitover 4203bb53f2
libretro: set version with git sha
Read version from `CHANGELOG.md` and append the short git sha if not on
the released commit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 14:13:22 +00:00
Rafael Kitover 8abbb070e8
cmake: use Win32Deps when mingw cross compiling
So that dependencies submodule is cloned.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 13:07:51 +00:00
Rafael Kitover ffc9309253
builder: freetype 2.9.1 -> 2.10.0, verbose make
make project with `VERBOSE=1`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 13:05:43 +00:00
Wes Smith b6bb24e016
Merge pull request #1 from libretro/master
Rebase
2019-04-15 22:27:52 -04:00
Rafael Kitover d08dd6cd18
builder: opensuse update 2
Install python3 in cross deps and call glib configure with the path to
it.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 00:08:45 +00:00
Rafael Kitover 9b38a38428
builder: updates for opensuse, refactor cross deps
Move linux distribution detection into `detect_os()` in the core.

The appropriate routine is then called with eval.

Move linux deps installation (for fedora previously) from
`linux-cross-builder` to `mingw-cross.sh` using the `linux_distribution`
variable set by `detect_os()`.

Add a routine to install suse cross dependencies as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-15 23:38:26 +00:00
Rafael Kitover d28fd302aa
cmake: only link SetupAPI on win32 if it's found
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-15 13:11:00 +00:00
Rafael Kitover af63a1194f
cmake: add -lSetupAPI to SDL2 libs for win32
Fix for undefined reference errors linking for msys2 mingw build using
the scripts.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-15 03:28:18 +00:00
Rafael Kitover 04c77a267f
update win32 dependencies submodule
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-14 01:18:37 +00:00
Rafael Kitover 5dfb36ad84
remove .clang-format, update .travis.yml
Remove .clang-format as it causes some people's editors to do
unnecessary reformatting automatically.

Add binary `--help` check to travis build steps.

Add `-DENABLE_SDL=ON -DENABLE_OPENAL=ON` to cmake options for all travis
jobs.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-13 23:18:57 +00:00
Rafael Kitover ed16d625e3
add unistd.h compat header for visual studio
Using:

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

Revert 5019a201.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-13 22:50:05 +00:00