Commit Graph

1859 Commits

Author SHA1 Message Date
Squall Leonhart 1741fa32db Fix autosaveloadcheat and rename pref 2021-09-23 18:56:32 +10: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
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
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
laqieer 18e387d165 Fix Flash chip's erase operation: erased memory is FFh-filled, not zero-filled. 2021-07-03 21:38:46 +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
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 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
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
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
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
twinaphex 2cdd1fafb6 Update osx target 2020-12-09 08:20:42 +01: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 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 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 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
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 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
Brian Searls 80634683b1 Force a panel update when configuring bilinear.
- Fix #727
2020-09-05 21:45:17 +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 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 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
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