Commit Graph

1733 Commits

Author SHA1 Message Date
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
Rafael Kitover 5d4ce82d54 make bins built with asm disable exec stack #98
Add the `section .note.GNU-stack` markers to .asm files built with nasm
to make sure the final executables do not have an executable stack.

This is described here:

https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
2017-03-25 03:58:30 -07:00
Rafael Kitover f56794e8a3 fix ./installdeps m32 for Solus
When calculating 32 bit dependencies, look only for -devel packages, and
match only -devel packages when checking for corresponding -32bit-devel
packages.
2017-03-24 01:38:34 -07:00
Zach Bacon 9324318373 Working on getting libretro updated 2017-03-24 07:59:10 -04:00
Zach Bacon fec17c7900 libretro: this should solve the configmanager stuff and libretro 2017-03-23 22:14:38 -04:00
Zach Bacon 93bb1d3417 Merge branch 'master' of https://github.com/visualboyadvance-m/visualboyadvance-m 2017-03-23 22:05:07 -04:00
Rafael Kitover 41ead88dcb 32 bit cross compiling support on Linux
Add the `m32` parameter to ./installdeps to fetch 32 bit multilib
dependencies on Fedora, Arch and Solus linuxes and add a cmake toolchain
file to build with them.

For MSYS2 support both an `m32` and an `m64` to choose deps for 32 bit
or 64 bit mingw targets.

Adjust build instructions from ./installdeps to support both usages.

Other changes:

- use --nogpgcheck --best --allowerasing for dnf invocations for Fedora,
  the --nogpgcheck is necessary when Rawhide is confused about which
  keys it has, and the latter two are needed for upgrades that remove
  unneeded deps etc

- when finding GTK2, first try using pkg-config, and only fall back to
  the cmake script when that fails, pkg-config works better for cross
  builds

- add cairo to dep lists in ./installdeps for the time being

- for arch, list individual packages from base-devel instead of
  base-devel that do not require gcc-libs because of potential conflicts
  between gcc and gcc-multilib
2017-03-23 14:09:17 -07:00
Zach Bacon 352527254b Merge pull request #102 from JoshStrobl/patch-1
Simplified Solus installdeps
2017-03-22 20:50:57 -04:00
Joshua Strobl 8013d226a0 Simplified Solus installdeps
Multiple previously specified packages are either already in system.devel or are dependencies of items such as libgtk-2-devel or libgtk-3-devel, dependencies of those dependencies, etc.
2017-03-23 02:49:08 +02:00
Zach Bacon 105bbba888 Almost there, just a few more blocks to go. 2017-03-21 21:52:28 -04:00
Rafael Kitover 3a7c18da11 add gitter.im badge to top of README.md 2017-03-21 16:05:28 -07:00
Rafael Kitover 0dc175cdb4 basic ./installdeps support for Solus Linux
Add basic support for installing deps for a Solus host build and update
README.md .

Support for mingw and 32 bit cross-builds may be added later.
2017-03-19 19:09:33 -07:00
Rafael Kitover 6af5525ac1 cmake: default to ENABLE_ASM_CORE=OFF #98 #54
The inline assembly in src/gba/GBA-thumb.cpp which is turned on with the
cmake ENABLE_ASM_CORES option, sometimes causes weird behavior on
windows (see: #54) and a crash on startup in linux (see: #98, confirmed
on both Fedora and Arch Linux.)

Previously the default for this option was ON for 32 bit builds, set the
default to OFF always for the time being, until it is either fixed or
replaced.
2017-03-18 19:04:39 -07:00
Rafael Kitover e1c1a5c95f fix src/filters/2xSaImmx.asm linking issues #98
Because of how asm subroutines are linked to C/C++ programs,
src/filters/2xSaImmx.asm had an %ifdef __DJGPP__ (the DOS port of gcc)
with the subroutine names prepended with an extra underscore.

In 902a7a7e I removed the %ifdef and just kept the extra underscore for
all symbols, and this worked fine until #98 where some version of Fedora
did not like that and would not link the code.

So adopt the behavior of the other asm filters, which have a NEWSYM
macro that defines the symbol name both with and without the extra
underscore, by listing the symbol twice, both with and without the extra
underscore, this is confirmed to fix the linking issue on that Fedora
build host.
2017-03-18 18:44:39 -07:00
Zach Bacon a575cc9295 Small tweaks to the installer 2017-03-16 19:23:12 -04:00
Zach Bacon 3a141be6c1 Added initial installer script to install either the 64bit or 32bit versions depending on platform. 2017-03-15 22:58:02 -04:00
Rafael Kitover 2e8bee117d cmake: use add_compile_options for ssp-buffer-size
In 82c8a1e3 I made "--param ssp-buffer-size=4" one argument instead of
two because when added to CMAKE_REQUIRED_LIBRARIES the ssp-buffer-size=4
part was being recognized as a library, breaking the compile tests.

This broke the build on mac, which I fixed in 915e2d1e by using ssp
flags for gcc only and not clang.

Now apparently it is breaking mxe, so instead of adding this particular
parameter to the MY_C_FLAGS variable which is then added to
CMAKE_REQUIRED_* variables for compile tests, add it directly via
ADD_COMPILE_OPTIONS().

This should hopefully resolve any remaining issues with this compiler
flag.
2017-03-14 10:33:24 -07:00
Rafael Kitover 915e2d1ec2 activate libssp compiler flags for gcc only
In 82c8a1e3 I made "--param ssp-buffer-size=4" one argument instead of
two to fix another problem when passing compiler flags to
CMAKE_REQUIRED_LIBRARIES, clang cannot deal with this and this breaks
the build on mac.

Enable libssp related flags for gcc only, because clang does not support
them anyway. This fixes the build issue on mac.
2017-03-11 19:19:47 -08:00
Rafael Kitover 82c8a1e3fa fix linux build broken in 687c08a
Stop saving and restoring the CMAKE_REQUIRED_* variables for the compile
test, because the subsequent Wx header symbol tests need them set up for
Wx support as well.

Also --param foo=bar needs to be a single string in the list of compiler
flags, or cmake can misinterpret the second part as a library when it is
passed to libraries/link-options.
2017-03-10 06:38:50 -08:00
Zach Bacon 145f6d433c Some debian stuff, I honestly don't like debian packaging... but it's important for some people 2017-03-09 04:06:25 -05:00
Zach Bacon 015e0af857 Start removing ancient history of gvbam, may it rest in peace 2017-03-09 03:58:00 -05:00
Rafael Kitover 7b0baadbaa fix 32bit intel detection for 32bit mxe target
mxe leaves CMAKE_SYSTEM_PROCESSOR empty, so detect if mxe is being used
and set the variable based on CMAKE_TOOLCHAIN_FILE, this allows the
32bit asm to compile under mxe.

Also if no toolchain file is being used and CMAKE_SYSTEM_PROCESSOR is
empty, fall back to CMAKE_HOST_SYSTEM_PROCESSOR.
2017-03-08 15:49:00 -08:00
Rafael Kitover 687c08a051 pass all compiler/linker flags for compile test
When determining gcc/clang flags, save resulting C flags as MY_C_FLAGS,
C++ flags as MY_CXX_FLAGS, and linker flags as MY_C_LINKER_FLAGS, then
use them in the Wx OpenGL compile test.

This fixes the test erroneously failing on git mxe on mac.

Also, don't use -fPIC on Win32, set Wx defines separately from the test,
and save all CMAKE_REQUIRED_* variables before the test and restore them
afterwards.
2017-03-07 16:15:02 -08:00
Zach Bacon 78cd223827 changed the throttle for sdl config example 2017-03-07 06:48:41 -05:00
Rafael Kitover d1b4abc85a fix sound in SDL port/ConfigManager
Since we are using sound frequency to control game speed, not quality,
change ConfigManager to default to a frequency of 44100 instead of
22050.

This also fixes trace.log files showing up with "unknown sound quality"
warnings.
2017-03-06 04:26:33 -08:00
Rafael Kitover f2bfc549ea fix Ubuntu PPA link
Also add a note that it's easy to build from source.
2017-03-06 02:10:06 -08:00
Rafael Kitover 9dc740156b minor doc tweaks
- Add Ubuntu daily PPA link.

- Add link to releases tab for win/mac builds.

- Advise `make -j8` instead of `make -j10`.

- Clarify which dependencies are optional and which are required.

- Add ENABLE_ASM cmake option to the table.

- Replace wxLogDebug with wxString example to use .utf8_str() instead of
  concatenation, this is more correct.
2017-03-06 02:03:15 -08:00
Rafael Kitover fef71439fc add ENABLE_ASM cmake option
Add the ENABLE_ASM flag for cmake which turns ON or OFF the
ENABLE_ASM_CORE, ENABLE_ASM_SCALERS and the ENABLE_MMX options at once.
2017-03-06 01:40:55 -08:00
Zach Bacon eb7dab6272 ws2_32 is needed for the SDL binary on windows 2017-03-05 20:06:22 -05:00
Rafael Kitover 05610d84f6 fix linking OpenAL statically on Win32/MXE
Add the necessary AL_LIBTYPE_STATIC define for MXE and non-msys2 win32
builds so that OpenAL can be linked statically without errors.
2017-03-05 11:47:32 -08:00
Rafael Kitover 7b85964eb6 full throttle support + snd driver improvements
Support throttle in all sound drivers: SDL, openal, dsound and xaudio.

Link OpenAL at compile time instead of runtime.

Minor improvement on 891f17d6, which added throttle support to SoundSDL
and made it actually work more often and crash less: check that throttle
is non-zero before scaling the frequency.

For dsound, add the CTRLFREQUENCY capability to buffers and call
SetFrequency on the secondary buffer in setThrottle().

For OpenAL, set AL_PITCH on the source to throttle / 100.0 in
setThrottle() and remove all dynamic library loading stuff.

For xaudio, 441e6c9e allows throttle to work, and is also necessary for
these changes to dsound and openal.
2017-03-05 08:43:25 -08:00
Mystro256 891f17d62f Fixes for SDL throttle
- Throttle should be set on init
- SDL auido device was not being correctly closed on throttle change
2017-03-05 05:32:34 -08:00
Zach Bacon 8fcc32eeeb Merge pull request #93 from Mystro256/master
Fix incorrect bug tracker link
2017-03-05 03:16:53 -05:00
Mystro256 093bc40074 Fix incorrect bug tracker link
Clicking "Report Bugs" goes to SF instead of github
2017-03-05 01:56:31 -05:00
Rafael Kitover 441e6c9e0e fix setting throttle on LoadGame()
Move the soundSetThrottle() calls after the soundSetSampleRate() calls
in LoadGame(), because the core calls soundInit() again after
soundSetSampleRate() wiping out the throttle value. This allows the
throttle setting to work with xaudio on startup and game loads.

TODO: the throttle config setting only works correctly for the xaudio
driver at the moment, it needs to be implemented for other sound drivers
and eventually moved out of the sound drivers altogether.
2017-03-04 21:53:35 -08:00
Rafael Kitover 88d15c6ec8 partial fix for disabling pausing when linked #83
Check if link mode is active in GameArea::Pause() and refuse to pause if
it is.

Remove the check for the app not having focus with pauseWhenInactive
enabled in GameArea::OnIdle() as this is now handled in
MainFrame::OnActivate() (which receives focus events) since f10e2e99.

Revert 13f5afa9 which tried to check for link status in
MainFrame::MenuPopped() because it was completely wrong and the link
check is better done in GameArea::Pause().
2017-03-04 21:16:14 -08:00
Rafael Kitover d1918c12f4 fix clipped game area in GL fullscreen #89
Trigger OnSize in the drawing panel after setting the geometry and
calling Layout(). I'm not sure what exactly broke but this seems to fix
the issue for the time being.

Also do a bit of very minor refactoring, change some calls to GetSize()
to GetClientSize() and simplify GLDrawingPanel::OnSize(ev&), tested to
work fine in wx 2.8.
2017-02-28 17:16:46 -08:00
Mystro256 fa1e13e606 Use prefix add operator for non-prim types
Typically yields better or equal performance. Sometimes compilers don't
optimizer out keeping the previous values (not needed for only adding 1)
2017-02-28 15:04:56 -08:00
Mystro256 7c06968557 Typo, only 10 recent accels 2017-02-28 15:04:56 -08:00