Commit Graph

1671 Commits

Author SHA1 Message Date
Zach Bacon 23ed930de1 Say good bye to cairo 2017-08-27 13:32:32 -04:00
Zach Bacon 1583a226f4 *Removal of the cairo renderer, it never performed well to begin with. 2017-08-27 13:11:34 -04:00
Rafael Kitover 1a8f2f9886 "no throttle" fixes/cleanups
`throttle == 0` is supposed to emulate at full speed and drop audio
data, this is different from `throttle == 100` which is emulation
throttled at normal speed, the default setting.

Fix the recently rewritten SoundSDL sound driver to make `throttle == 0`
work, and make some minor changes to clean up the relevant code in the
XAudio2 sound driver.
2017-08-27 07:21:27 -07:00
Rafael Kitover 9bca4f7292 document how to provide symbolic backtraces
Add a "REPORTING CRASH BUGS" section to the README.md with instructions
for how to provide a symbolic backtrace on Linux and MSYS2.

Add a "Crash bugs" section the the issue template with a link to said
README.md section.
2017-08-17 14:25:27 -07:00
Rafael Kitover 1e3a85a34b cleanup SoundSDL #139 #130 #97 #67 #65 #46 #47
Rewrite SoundSDL (the SDL sound driver).

Clean up the code and eliminate all deadlocks/hangs/crashes (hopefully.)

Many of the deadlocks were caused by initialize() not de-initializing
properly and causing the audio callback thread to deadlock, fix this.

Also use better logic for the semaphore controls, which will also
hopefully increase audio quality.

Use better logic for the throttle control, with throttle == 0 being the
same as throttle == 100 and implement setThrottle().

Also increase the buffer size to 300ms and the number of samples to
2048, for hopefully less choppiness in audio overall.
2017-08-17 02:44:40 -07:00
Rafael Kitover f88faef1b2 SoundSDL: write silence when paused #139
The SDL API documentation for the audio callback specifies that the
callback *MUST* write to the buffer and not just return:

https://wiki.libsdl.org/SDL_AudioSpec#Remarks

write silence to the buffer (value taken from the AudioSpec returned
from OpenAudioDevice) when the emulator is paused.
2017-08-16 15:20:05 -07:00
Rafael Kitover 4d7e102e26 hopefully fix resize artifacts on game panel #138
Paint the whole GameArea (containing the emulator graphics panel) black
on size events for both the GameArea and the panel.

This will hopefully fix reports of garbage around the panel when going
full screen with the OpenGL driver on Linux.
2017-08-16 04:02:12 -07:00
Rafael Kitover 346d97a760 remove default F11 keybinding for save state #137
Remove F11 as the default key for save state (GS=) in the defkeys array
in opts.cpp and leave it unmapped by default, because it conflicts with
the menu XRC mapping for full screen which is also F11 on non-macOS
platforms.
2017-08-16 03:36:18 -07:00
Rafael Kitover 5e9c9093c0 SoundSDL: lock conditional code cleanup
Move the `bool lock` condition used to wait for sound data to be
exhausted from two places in the code into the `bool should_wait()`
member function.
2017-08-16 03:20:10 -07:00
Rafael Kitover 03a20820cb temp fix for deadlocks in SoundSDL on pause #139
SDL_PauseAudioDevice seems to be causing thread deadlocks in combination
with Wx threads (e.g. on menu activation or modal dialogs.)

Remove these calls from SoundSDL::pause() and SoundSDL::resume() for the
time being so that deadlocks do not happen.

This effectively allows pausing, but on resume there is no sound for 2-3
seconds until the buffer is filled again.

This will need a proper fix at a later time.
2017-08-15 15:30:27 -07:00
Nicola Spanti (RyDroid) 2da2d9c41d Improving README 2017-08-14 15:28:52 -07:00
Rafael Kitover fb15aed223 fix memory viewer xrc on wx 3.1+ #127
Remove the wxALIGN_CENTRE_VERTICAL flag from items that have the
wxEXPAND flag in the MemViewer.xrc because wx 3.1+ warns about the flags
being incompatible.
2017-08-09 03:03:56 -07:00
Rafael Kitover 1d0eece046 let cmake escape -D preproc. definitions
As cmake now warns when policies are set to OLD, change the CMP0005
policy to NEW.

What this does is have cmake escape -D preprocessor definitions passed
to e.g. add_definitions() starting in cmake 2.6 . This is fine since the
minimum cmake version we support is 2.8.12 . It also makes the code
cleaner since we don't have to escape quotes anymore ourselves. This
will also work better on different platforms, where different escapes
may be needed.

Remove all quote escapes from string params to add_definitions() for
this policy change to work.
2017-08-09 02:34:40 -07:00
Avindra Goolcharan 0bdbcf3188 SUSE Lint: fix a few classes of warnings #136
- drop unused variables

- unused-but-set-variable

- stray trailing comments

- in viewsupt.cpp replace redundant expression with variable that holds the same value
2017-08-08 20:05:38 -07:00
Avindra Goolcharan dd91abf72e fix errors reported by SUSE's post-build linter
In StartRFUSocket() in gba/GBALink.cpp move a postincrement out of an
expression to a following statement, because the evaluation order is
undefined.

In GetDevices() in wx/openal.cpp replace an #else with an #endif so that
the function has a default return statement visible to the linter.

In FilterThread::Entry() add a `return 0;` (ExitCode) statement at the
end even though it is probably never reached.

In the TransferToWindow() for the positive double validator widget in
wx/widgets/wxmisc.cpp add a default `return true;`, for the rare case
there is no double value, in which case the string representation would
be displayed (since it is a subclass of wxGenericValidator(wxString&) .)
2017-08-07 20:31:08 -07:00
Rafael Kitover d118c457b1 regenerate translation files
Run po/update_pot.sh and rebuild all .po files.
2017-08-03 23:33:30 -07:00
Rafael Kitover c99a58faee fix a memory leak due to wrong syntax
In C++ arrays are deleted with `delete[]` and not `delete`.
2017-08-03 16:29:37 -07:00
Zach Bacon 997b97573f
Added updated and new translations 2017-06-03 12:19:28 -04:00
Zach Bacon ebfc8fdb12
Updated translation pot file 2017-06-03 12:11:53 -04:00
Rafael Kitover 783475bf39 switch to cmake module GNUInstallDirs #116
See:

https://cmake.org/cmake/help/v2.8.12/cmake.html#module:GNUInstallDirs

Use these variables to set all installation paths.

Add link and note about module to README.md .
2017-05-24 04:25:45 -07:00
Zach Bacon 535a2d5a32 Merge pull request #118 from kwkam/patch-1
wx/wxvbam: fix GetAbsolutePath
2017-05-12 09:02:37 -04:00
kwkam 7405efef5f wx/wxvbam: fix GetAbsolutePath
Makes battery/state directory setting work when set as relative path
2017-05-12 20:40:37 +08:00
Zach Bacon 9a5833b8c1 Forgot the zip program for the build 2017-05-11 22:18:10 -04:00
Zach Bacon e95c083466 this should fix the windows build 2017-05-11 22:13:11 -04:00
Zach Bacon dd34951d2f Windows doesn't have sterror_r 2017-05-11 21:34:18 -04:00
Zach Bacon 8840b62b27 I swear, I need to double check these things. 2017-05-11 21:15:00 -04:00
Zach Bacon 095e4f2849 added instructions for git submodule because we need some headers that mingw doesn't have yet. 2017-05-11 21:11:05 -04:00
Zach Bacon 8f12629d30 Seems no matter what I did last time, the generator wasn't properly set. 2017-05-11 21:05:49 -04:00
Zach Bacon 0d70c227f3 added github integration. 2017-05-11 21:02:12 -04:00
Zach Bacon ce39651984 forgot msys makefile generator 2017-05-11 15:03:16 -05:00
Zach Bacon 587d162490 Helps if I added build stuff to it. 2017-05-11 15:53:24 -04:00
Zach Bacon dfb22709ce added drone.yml file for tea-ci integration 2017-05-11 15:49:14 -04:00
Zach Bacon 10e1b7a6dd added tea-ci badge 2017-05-11 15:38:17 -04:00
Zach Bacon 27034bf2ca Merge pull request #116 from orbea/cmake
Add BIN_INSTALL_DIR and MAN_INSTALL_DIR
2017-05-11 09:44:32 -04:00
orbea 7ea1616afc Add BIN_INSTALL_DIR and MAN_INSTALL_DIR 2017-05-11 06:39:37 -07:00
Rafael Kitover fed6f2389e Add #include <cmath> for std::ceil() #113
A couple files that use the std::ceil() math ceiling function were not
including the required header <cmath> and this seemed to have been
causing build errors on some Linux distributions.

Add the necessary #include <cmath> statement to both files.
2017-05-05 10:21:03 -07:00
Rafael Kitover 01dd7cef45 fix portability issue with strerror_r()
If _GNU_SOURCE is defined on linux, then strerror_r() is an alternate,
non-POSIX version.

Undefine _GNU_SOURCE when including <string.h> in ConfigManager.cpp to
get the POSIX version of strerror_r(), and initialize the error string
buffer to "unknown error" so that the code does not crash whichever
version of the library function is being used, or strerror_r() fails for
some reason.
2017-04-27 13:16:16 -07:00
Rafael Kitover 05555a23a8 SDL: fix deflt bat saving, improve dir checking
By default the SDL port tried to save the battery to a nonexistant
directory in saveDir, because if (saveDir) {...} evaluted to true since
saveDir was a non-NULL pointer but empty.

Change sdlCheckDirectory to return a bool indicating if the directory is
good or not, and if not set screenShotDir, saveDir and batteryDir to
NULL so that code that checks for their existance works correctly.
2017-04-27 08:52:14 -07:00
Rafael Kitover 02a1e38e6c SDL: improve error msg for unwritable config #105
Following up on 1ba2eef which fixed a crash caused by trying to write to
a NULL FILE* due to fopen() failure: write the error message to stderr
instead of trace.log and show the OS error using strerror_r().
2017-04-27 08:46:03 -07:00
Rafael Kitover cab6f0f026 delete memory in common/array.h on destruction
Hopefully fix a memory leak in common/array.h by adding a destructor
that does a delete on the underlying array if it was previously
allocated.
2017-04-27 08:35:25 -07:00
Christopher Snowhill a5ebd8d2b4 Merge pull request #109 from condret/elf-parser-security
fix some potential buffer-overflows
2017-04-23 13:45:48 -07:00
condret a9b1251b88 fix some potential buffer-overflows 2017-04-23 22:28:17 +00:00
Christopher Snowhill 48f7437612 Merge pull request #108 from condret/master
fix gameboy header-detection in libretro interface
2017-04-23 13:45:25 -07:00
condret 63b0760329 hotfix for potential buffer-overflow 2017-04-23 22:07:28 +00:00
condret d3b459ba0d fix gameboy header-detection in libretro interface 2017-04-23 21:54:56 +00:00
Jeremy Newton 1ba2eefebe Fix glibc crash: add log message on fopen failure
glibc's fclose implementation does not do a NULL check and will crash on "fclose(NULL)". A bunch of Fedora users have been sending in traces for this issue. I've added a log on failure case, likely if the user does not have permission to write to the file.
2017-04-17 12:04:07 -07:00
Rafael Kitover b59b7b394c add Linux joystick reference to issue template
Add a link to the Joystick page in the Arch Wiki so that users hopefully
use it to troubleshoot their joystick issues before filing an issue.

Also note that any joystick issues would be SDL related.
2017-04-10 04:13:02 -07:00
Rafael Kitover 247e584fe0 better fix for clipped video in GL fullscreen #89
In d1918c12 I manually sent a SIZE event to the DrawingPanel after
calling Layout() in the setup code in OnIdle().

But the obvious problem is that the ->Connect() calls to set up the
event handlers, including SIZE, are after all the setup code including
the Layout().

Move the ->Connect() calls to the top of the setup code and remove the
manual SIZE event sending. This is a much better solution that for some
reason I didn't notice at the time.

Tested to also fix the problem.
2017-04-04 13:30:56 -07:00
Zach Bacon b217f8b40b Oops, forgot Unices etc are case sensitive. 2017-03-25 07:23:30 -05:00
Rafael Kitover 7b0078d2c1 ./installdeps tweaks for fedora/rawhide
When installing rpmfusion repos, try going back up to 3 releases in case
the latest rawhide release does not have an rpmfusion repo, and install
the repo packages with --nodeps so that they don't conflict with
system-release(XX).

If installing rpmfusion repos fails, continue without ffmpeg (and adjust
build instructions accordingly.)

If ffmpeg fails to install for any reason, show a warning and adjust
build instructions.
2017-03-25 04:02:52 -07:00