Commit Graph

1578 Commits

Author SHA1 Message Date
n-a-c-h 931fda459a Fix case where buffer is filled to capacity and becoming empty. There always needs to be an extra entry as a separator between the write and the read. 2017-02-22 03:39:57 +02:00
Rafael Kitover 095b48aabf minor fix for Ubuntu 14 (cmake)
Check that the CMAKE_VERSION is 3.0 or greater when setting the CMP0043
policy to NEW. The Ubuntu 14 cmake which is 2.8.12 throws an unknown
policy error otherwise.
2017-02-21 16:47:31 -08:00
n-a-c-h 3e0f5d89ba Rewrite of ringbuffer, and updated copyright file for Debian. 2017-02-22 02:03:21 +02:00
n-a-c-h e923015d45 Remove copyright header from ZSNES since it annoys some people. The original version in ZSNES including the entire 1.4x version was GPL2+. The changes since then are mine, and I licensed it as GPL2 only for ZSNES 1.5x. I have no issue with VBA-M distributing this as GPL2+. 2017-02-22 01:05:35 +02:00
Rafael Kitover ea4056e025 remove intermediate dependencies jpeg and tiff
jpeg and tiff are not direct dependencies and should be pulled in by
direct dependencies such as wx, remove them from README.md and
./installdeps.
2017-02-20 13:43:39 -08:00
Rafael Kitover 6a7d49419c initial Wayland support #72 #76
Disable OpenGL support under Wayland because wxGLCanvas segfaults, and
fix an issue with drawn frames not appearing.

If the user has opengl as the render method in their config, it will not
be changed, but at runtime will be set to simple under Wayland.

To fix the issue with frames not being drawn, Call Refresh() to queue a
PaintEv from DrawArea(data) instead of calling DrawArea(device_context)
directly.

Also remove the DrawOSD() call from PaintEv, this was causing the OSD to
sometimes show up twice in one frame, because DrawArea(data) draws the
OSD directly on the frame data.

Add new files wayland.cpp and wayland.h with a bool IsItWayland() global
function. This uses a GDK (part of GTK) call to detect Wayland.  This
unfortunately requires linking GTK libs separately.

Add cmake code to detect the version of GTK used by the wx being linked
and link it as well. Add gtk2 and gtk3 dev packages to the code for the
supported linux dists in ./installdeps.
2017-02-20 13:20:09 -08:00
Rafael Kitover 13f5afa9c5 don't pause on menu open when link active #83
In the MenuPopped method (which received MENU_OPEN, MENU_CLOSE and
MENU_HIGHLIGHT) check that gba_joybus_active is not true before pausing
the emulator, so that if Link mode is on it will not pause.
2017-02-19 10:39:46 -08:00
Rafael Kitover b0b0ad08ca add --exclude='glibc32*' for Fedora ./installdeps
This should fix possible problems with the glibc32 package being
sometimes erroneously pulled in in rawhide when installing 32 bit devel
libs.
2017-02-16 05:21:40 -08:00
Rafael Kitover 92e3a826a4 update ./installdeps for Fedora rawhide
Try to install both pkgconfig.i686 and pkgconfig.x86_64 silently because
fc26+ does not have a separate 32 bit package.

If installing 32 bit packages fails on amd64, fall back to installing 64
bit packages only.
2017-02-16 03:39:51 -08:00
Rafael Kitover 99c6c4f938 Merge pull request #74 from Mystro256/gccwarnings
- fix C++ only flags being used for C

- check if cheats/patches files load correctly
2017-02-13 01:26:22 -08:00
Mystro256 611bbd6707 Re-add missing installed icons (for linux) 2017-02-12 06:50:54 -08:00
Rafael Kitover 27d4f09fb4 add Mystro256 to developer list in About box 2017-02-12 04:49:06 -08:00
Rafael Kitover 289abcd7a2 use -fpermissive and -fexceptions with C++ only
Add -fpermissive and -fexceptions to CMAKE_CXX_COMPILE_OBJECT so that
they only affect C++. -std=gnu++11 was already there from b4ba9d9d, but
this is a cleaner method (which is also used for NASM) where we use
STRING(REGEX REPLACE ...) to append options after the <FLAGS>
placeholder in CMAKE_CXX_COMPILE_OBJECT.
2017-02-12 04:41:57 -08:00
Mystro256 28624ac01b fpermissive is only a C++ flag 2017-02-12 04:26:21 -08:00
Mystro256 e9e2100f6d Error case in gbCheatReadGSCodeFile
Silence GCC warning
2017-02-12 04:26:21 -08:00
Mystro256 b38cb9b522 Error case if game num can't be read in cheatsImportGSACodeFile
Silence GCC warning
2017-02-12 04:26:21 -08:00
Mystro256 7e8efe963f Incorrect return value in cheatsImportGSACodeFile 2017-02-12 04:26:21 -08:00
Mystro256 cc2fabbf0a Use fread return values for apply patch error checking
Silences gcc warnings
2017-02-12 04:26:21 -08:00
Rafael Kitover a493e0f85a remove updater code #71
Remove the "check for updates" and "Update ROM database" menu entries,
as well as the automatic update checking and all supporting code.

This fixes the issue with the emulator hanging without access to the
internet.

Updating code will be reimplemented in the future using something like
Sparkle. wxHTTP does not support redirects or https so is pretty much
useless now.

Also update the About box to bump copyright year to 2017 and change my
name to "rkitover", which is what I use on github, and mention other
contributors.
2017-02-12 03:47:29 -08:00
Rafael Kitover 65dae0d0a1 support Ninja cmake generator on msys2
Add a hack to the root CMakeLists.txt to SET(MSYS ON) for the Ninja
generator when running under msys2, otherwise it cannot find libs.

The quoting fixes from #70 allow all of this to work.
2017-02-11 14:18:38 -08:00
Rafael Kitover 98718f2094 Merge pull request #70 from edorax/master
Some fixes for MSVC.
2017-02-11 08:02:02 -08:00
edorax 0791236a8f Improve the method to find SDL2. 2017-02-11 23:48:11 +08:00
edorax fee89f1967 Fix build for MSVC. 2017-02-11 23:11:32 +08:00
Rafael Kitover c02c448f47 clean up dependencies/msvc inclusion cmake code
Move the check for dependencies/msvc into the previous IF(WIN32) block
adding an IF(MSVC) level.

Remove duplicate call to INCLUDE_DIRECTORIES(dependencies/msvc) from
later on in the main CMakeLists.txt.
2017-02-11 06:33:08 -08:00
Rafael Kitover d6c1b53653 add one missed cmake windows quoting fix
Also quote LOCALEDIR with as \\\""${LOCALEDIR}"\\\", just like the other
defs are quoted.

This fixes the build on msys2.
2017-02-11 05:52:42 -08:00
Rafael Kitover b4ba9d9d65 set -std=gnu++11 globally for C++ only
Add -std=gnu+11 to CMAKE_CXX_COMPILE_OBJECT in the main CMakeLists.txt
to force the option for all C++ sources.

The right way to do this is to use a generator expression with
ADD_COMPILE_OPTIONS, but this is only available in cmake 3.3 and we must
maintain 2.8.12 compatibility to support Ubuntu 14.

This fixes the mac build (clang.)
2017-02-11 05:33:10 -08:00
edorax 2dc673c753 Fix the options of cl. 2017-02-11 15:48:19 +08:00
edorax 95e1a35d4c Use cl(the MS C/C++ compiler) instead of cc for MSVC build. 2017-02-11 14:55:45 +08:00
edorax f7186a6493 Move 'dependencies/msvc' inclusion to the CMakeLists.txt in top level. 2017-02-11 13:39:50 +08:00
Su Yong 4e096c127c Some fixes for MSVC. 2017-02-11 10:57:35 +08:00
Rafael Kitover 8754a8f6d8 fix cmake -G Ninja support
Use an explicit list of Wx XRC sources instead of a GLOB so that cmake
generators for other build systems such as Ninja work.
2017-02-10 08:22:58 -08:00
Rafael Kitover f10e2e9904 fix directsound loop on unfocus #45
Call GameArea::Pause and ::Resume in MainFrame::OnActivate based on
focus state if the pauseWhenInactive config option is set.

Also stop/play the primary dsound buffer in pause()/resume() in
dsound.cpp, not onlyu the secondary, this may not be necessary but it
doesn't hurt.
2017-02-09 07:30:54 -08:00
Rafael Kitover fcc34394c1 fix build failure on OS X Lion with XCode 4.2
XCode 4.2 generates a broken binary if -fomit-frame-pointer and/or -flto
is used for compile and link flags.

Check for Clang version less than 4.3 on APPLE and remove these flags in
the compile options setting cmake code.
2017-02-03 12:39:10 -08:00
Rafael Kitover 6ecab805e0 fix game freezing on kbd input #54
Apparently in some configurations, holding a key on the keyboard makes
Wx stop processing Idle events, so the emulator does not run until the
key is released, freezing the game and ignoring the key.

Hopefully fix this by calling wxWakeUpIdle() from OnKeyDown() and
OnKeyUp().

Other Misc. Improvements:

- refactor process_key_press() to only return true if the system is in a
  pressed key state on key presses or a game key was released on
  releases and always true on double releases.

- call ev.StopPropagation() from OnKey* events for game keys, this may
  not actually do anything, but just in case.

- remove static OnKeyUp and OnKeyDown events from GameArea, these are
  connected to the DrawingPanel dynamically now.

- remove the dynamic_cast<>s from PaintEv/EraseBackground/OnSize event
  forwarders, since there is already a panel member to use.

TODO:

The state returned by process_key_press() is still not entirely correct,
if a joystick button is pressed, it will return true for a non-game
keyboard press, and it needs to return the correct state for double
releases.
2017-02-02 07:13:39 -08:00
Rafael Kitover 44382a71c5 fix openal.so loading issues on some dists #69
As suggested by @Mystro256, try:

wxDynamicLibrary::CanonicalizeName(wxT("openal"))+wxT(".1")

before just the canonical name for "openal" when trying to load the
library.

Also add a utility method to quietly try loading the library, because on
wx 2.8 wxDL_QUIET does not work.
2017-01-30 20:11:07 -08:00
Rafael Kitover cb0bcfae6b fix msys2 build failure in 34e408cc
cmake automatically passes -std=gnu++11 in some cases, while we were
passing -std=c++11, and this was causing incompatibilites in name
mangling between different objects.

Fix this by using -std=gnu++11 for gcc.
2017-01-30 19:12:04 -08:00
Rafael Kitover f21178f6f7 fix nasm support broken in 34e408cc
The last commit removed generator expressions from ADD_COMPILE_OPTIONS()
which made C/C++ flags apply to nasm as well.

Fix this by removing <FLAGS> from CMAKE_ASM_NASM_COMPILE_OBJECT and
replacing it with the flags we want.
2017-01-30 18:14:33 -08:00
Rafael Kitover 34e408ccb7 fix Debian 8 Jessie and Ubuntu 14 Trusty compat
Fix some porting issues to make everything work on Debian 8 "Jessie"
and Ubuntu 14 "Trusty":

- set cmake minimum version to 2.8.12, this is the Ubuntu 14 version

- combine C and C++ flags and add all of them using
  ADD_COMPILE_OPTIONS() without using generator expressions, which is a
  cmake 3.2 or so feature

- add -fpermissive to force some non-const type casts to compile on
  older versions of gcc

- add -std=c++11 for gcc to enable support on older versions of gcc

- check that the compiler supports -fstack-protector-strong before
  adding it, older versions of gcc do not

- fix the debian section of ./installdeps to include libpng-dev instead
  of libpng16-dev and add gettext for msginit etc.

- fix compat checks in src/common/ffmpeg.cpp and src/wx/cmdevents.cpp to
  check for libavcodec >= 56 instead of > 56, the Debian Jessie version
  is exactly version 56 . With the one exception of
  AV_CODEC_FLAG_GLOBAL_HEADER which is defined in later versions.
2017-01-29 10:14:34 -08:00
Rafael Kitover fdc389c280 fix wx 2.8 compat, debug logging works everywhere
Fix backcompat with wx 2.8. This involved writing
wxPositiveDoubleValidator and rewiring the DrawingPanel inheritance tree
and event handling mechanisms (because 2.8 does not have ->Bind, only
->Connect which is less flexible.) As a result all the event handling
has been gathered into GameArea and the affected code is somewhat
cleaner. 2.8 support is untested on Mac because it requires 32 bit libs
and Carbon.

Add support for cross-compiling for windows using the Fedora MinGW
packages in ./installdeps.

Check for OpenGL support in the wx library being linked, this was
necessary because the Fedora MinGW wx library does not have OpenGL
support.

Remove vbamDebug() in favor of wxLogDebug(), and add an override for it
so that it works in non-debug builds of wx as well as on Windows. Turn
off buffering on stdout and stderr on startup so that debug logging
works in msys2/cygwin mintty as well.

On Windows, build a console binary for debug builds.

Update README.md to reflect Fedora MinGW support and debug logging
support.

Add -Wextra to cflags for debug builds.
2017-01-25 10:53:05 -08:00
Rafael Kitover 82d694df3a disable LTO on Win32 for now
Due to reports of segfaults etc. disabling LTO on Win32 for now.
2016-12-31 04:48:51 -08:00
Rafael Kitover 281e73eee0 correct fix for ddef88f0
Check that codec is not a NULL pointer right after it's first set, this
is done later after configuring the ctx anyway.
2016-12-31 04:07:12 -08:00
DoctorWho11 57adfaf24e Add missing libiconv for enabling nls 2016-12-30 22:48:23 -05:00
Zach Bacon fd693b385e Merge pull request #60 from Mystro256/master
Various fixes
2016-12-30 21:17:00 -05:00
Mystro256 2ef0074f72 Duplicate CMake Option in README.md 2016-12-30 12:14:35 -05:00
Mystro256 24f06848df DeSerialize should pass packet by ref too 2016-12-30 11:43:36 -05:00
Mystro256 ddef88f0c5 Possible null dereference 2016-12-30 11:42:56 -05:00
Mystro256 7bc7ff57f4 Redundant code? 2016-12-30 11:41:33 -05:00
Mystro256 7788e6fc89 Spelling mistake ;) 2016-12-30 11:19:48 -05:00
Mystro256 c3e4969498 Fix gcc parentheses warning 2016-12-30 11:17:18 -05:00
Mystro256 0bcf4a5223 Clean up various used variables 2016-12-30 11:16:00 -05:00