Commit Graph

1770 Commits

Author SHA1 Message Date
retro-wertz a2d5c260ec libretro: Add turbo buttons 2018-12-01 07:13:14 +08:00
Scott Knight 3484ecc419
Add support for LLDB qHostInfo packet
https://github.com/llvm-mirror/lldb/blob/master/docs/lldb-gdb-remote.txt

The qHostInfo command is listed as a high priority to implement for gdb
stubs that lldb can connect to. Adding support for this command allows
lldb to properly connect with it's `gdb-remote 55555` command and
correctly determine the target and allow debugging.
2018-11-28 08:50:50 -05:00
Scott Knight dd2a1d9b51
Fix stack overflow in remoteMemoryRead
When doing a remote memory read the debugger can ask for any size.
The buffer being allocated however was only 1024 bytes long and the
code in remoteMemoryRead also attempts to write a zero byte at the
end of the array. This code will now take the count of bytes the debugger
is trying to read and allocates a buffer that is count * 2 + 1 large. This is large
enough to hold the $02x formatted hex byte for each byte as well as the zero
byte written at the end.
2018-11-28 08:50:49 -05:00
Scott Knight 4f28e84632
Fix stack overflow in remotePutPacket
If the packet passed into remotePutPacket was 1024 bytes or
larger then the buffer array would not be large enough to hold
the $, checksum and zero byte written. This now allocates a buffer
of size count + 5 to accommodate these extra characters.
2018-11-28 08:50:48 -05:00
Zach Bacon 5e58e4c3e6 when it comes to cross compiling, Most unices like linux are case sensitive 2018-10-23 22:06:18 -04:00
Rafael Kitover 9cb9ce86bd fix Windows XP Compatibility #315
Use the IsWindowsVistaOrGreater() function from VersionHelpers.h, which
fortunately is part of mingw, to check for the availability of the
comctl32 LoadIconWithScaleDown API, which we use to fix issues with the
app icon, like the icon being too big in the volume mixer.
2018-10-23 06:19:34 -07:00
ZachBacon 58083d9d4a Gonna use universaldxsdk for xaudio 2018-09-16 15:20:06 -04:00
retro-wertz 916c091a49 Libretro: Add GB/GBC cheat support...
- Add wram and vram to retro_get_memory* and minor cleanup
2018-08-19 23:34:38 +08:00
retro-wertz 14086d0007 Libretro: Fix crash on some linux systems 2018-08-19 22:19:06 +08:00
Rafael Kitover e67b513e94 rename mac-localizations to mac-translations.cmake
Rename cmake script to copy .gmo files into the .app introduced in
bf4606fc from mac-localizations.cmake to mac-translations.cmake since
these are really translations and not localizations.
2018-08-11 15:05:12 -07:00
Rafael Kitover bf4606fc18 install translations into mac .app
Add a POST_BUILD hook to run a cmake script to install translations into
the .app.

Tested to work correctly, when system language is different a
translation is loaded.
2018-08-11 14:52:18 -07:00
Rafael Kitover 6cbad61f36 fix cmake regression introduced in bfe21aee
Before calling list(REMOVE_ITEM ...) check if the variable exists, if it
doesn't cmake throws an error.
2018-08-10 09:37:55 -07:00
Rafael Kitover bfe21aee3e remove -fpermissive compiler flag
Remove -fpermissive from the list of flags passed to gcc and clang.

Remove -fpermissive from the cxxflags from wxWidgets config as well.

When checking wxWidgets ABI compatibility version, temporarily add
-fpermissive to compiler flags on Win32 because minhook requires it.
2018-08-10 06:46:51 -07:00
Rafael Kitover 571ecbe3e8 support mac-hosted mingw builds, misc. fixes
- Add the cross root from the mingw-w64 mac brew to the cmake toolchain
  files.

- Remove strerror_r/strerror_s from ConfigManager.cpp because the
  mingw-w64 brew does not support strerror_s for some reason.

- Strip the vbam executable from the builder script in the build_project
  phase.

- Change the bzip2 URL to the github mirror because the bzip.org domain
  expired.

- Add libuuid as it's required by the new fontconfig, use the mingw
  version for mingw builds, for mingw also set UUID_LIBS to
  '-luuid_mingw -luuid' in mingw.sh for fontconfig, the mingw version
  is called uuid_mingw because uuid is a core win32 library.

- Lower glib version to 2.57.2 stable.

- Update wxwidgets version to current master sha.

- Fix a bug in flex-2.5.3 post_build where it tries to build flex
  current but flex has been removed, and it was just rebuilding 2.5.3.

- Fix "aggressive" relocation and the relocation of .l[ao] and .pc files
  in install_dist to ignore /usr/local, and only match /usr.

- Add a "project" pre_build and post_build hooks.

- Add getopt to host-only dists in mingw-cross.sh.

- Use perl instead of readlink -f to get the absolute path of the cmake
  toolchain files in mingw-cross.sh, as readlink -f is linux-only.

- In mingw-cross.sh, replace the glib post_build to rebuild
  gettext-target instead of gettext --without-included-glib.

- Add overridable functions set_host_env_hook and unset_host_env_hook in
  mingw.sh to override in other scripts, in this case mac-cross-builder.

- Update mingw glib patches to current fedora versions.

- Add tools/win/mac-cross-builder script to build mingw windows binaries
  on mac, it borrows some necessary parts from the mac native builder
  for host dists, and inherits from mingw-cross.sh.

TODO: currently the resulting mac-built binary segfaults due to gcc
8.2.0, just as the msys2-built binary does, this is a separate issue.
2018-08-10 04:31:05 -07:00
retro-wertz f45935af98
Add vbam_libretro.info
to be copied into <retroarch_folder>/<core_info_folder
2018-08-06 13:46:48 +08:00
Rafael Kitover be508eb2fd simplify check for renamed wx-config, fix gentoo
Use find_program() to check for the existance of wx-config-gtk4, then
wx-config-gtk3 and finally wx-config, instead of calling find_package()
for each separately, FindwxWidgets module does not like being called
multiple times, it screws up some cache variables.
2018-08-05 21:16:33 -07:00
Rafael Kitover 3b44a29948 cmake: fix wrong unset syntax #295 from f78d45c0
unset(VAR PARENT_SCOPE CACHE FORCE)

seemed to work on my version of cmake on gentoo, but does not work on
other versions.

Rewrite the function as a macro and use the syntax:

unset(VAR CACHE)

instead.
2018-08-04 13:13:37 -07:00
Rafael Kitover f78d45c038 cmake: fix regression in finding wx from 2efcb620
Clear FindwxWidgets module variables from the cache after each
unsuccessful try with WX_CONFIG_EXECUTABLE set, otherwise the succeeding
find_package(wxWidgets) call with WX_CONFIG_EXECUTABLE unset will fail,
as it does with cmake on gentoo.
2018-08-04 04:34:24 -07:00
retro-wertz ddea50d3c8 GB: Cleanup sound registers
Seems to be left-overs from switching to blargg
2018-07-26 14:39:06 +08:00
retro-wertz faf01db2cf GB: Backport STAT register behavior
http://www.devrs.com/gb/files/faqs.html#GBBugs
2018-07-26 13:45:06 +08:00
retrowertz d9e0d0f88d GB: Remove references to gbReadOpcode
Merged with gbReadMemory since this basically is just a duplicate
2018-07-26 00:24:06 +08:00
Zach Bacon eb20bb4aad
We don't have a forum anymore
Please kindly use github issues
2018-07-24 17:42:55 -04:00
retro-wertz fca7e175d8 Libretro: Prevent crash when loading an incompatible state file 2018-07-24 14:23:52 -07:00
retro-wertz 1289e08cb4 Libretro: Enable battery save ram support for MBC2 and MBC7 2018-07-24 14:23:52 -07:00
retro-wertz a9ab09f749 Libretro: Fix realtime clock not updating in GB/GBC...
Remove usage of RETRO_MEMORY_RTC - not required since real-time clock is always updated and is using current time and not ingame time.

Add some more rom info to logs during loading
2018-07-24 14:23:52 -07:00
retro-wertz 6cda6c0c24 Libretro: Show basic details in log window during rom loading 2018-07-24 14:23:52 -07:00
retro-wertz 6ef938fc52 Libretro: Add memory descriptors for GB/GBC 2018-07-20 22:21:07 +08:00
retro-wertz bb64e8d8d6 Libretro: Use retro_get_memory_data/size for battery-enabled roms
Supports battery saving for MBC1, MM01, MBC3, MBC3+RTC, MBC5

WIP: TAMA5, MBC2, MBC7

Minor style nits
2018-07-19 03:06:06 +08:00
retro-wertz 119e1f5c99 Libretro: Add core options for GB border and hardware overrides 2018-07-17 21:34:14 +08:00
retro-wertz 76ad84fd28 Opps, accidentally broke borders in standalone 2018-07-17 02:29:03 +08:00
retro-wertz bf447bf89a Libretro: Add GB/GBC core
Gb,gbc and sgb enhanced version of roms and savestates working. Bios loading for gb/gbc works too. No save ram / battery handling yet.

Fix offset and pitch issues with vba rendering and when borders are enabled.
2018-07-17 01:55:19 +08:00
retro-wertz f05a05e622 Libretro: Refactoring for adding GB/GBC core 2018-07-15 17:53:44 +08:00
retro-wertz 0e60c34ab9
Fix this 2018-07-12 16:23:59 +08:00
retro-wertz 02e5f0bdce
Libretro: Bump version number 2018-07-06 22:47:41 +08:00
retro-wertz fc42f88bd7 GB: Fix SIO related issue 2018-07-06 04:23:58 -07:00
Rafael Kitover a8d0508cf2 use GetWindow()->Refresh() in Wayland only
Some people are reporting stuttering, and @retro-wertz tested both
DrawArea() and Refresh() on wxgtk3 under xorg and found that the
Refresh() method produces more stuttering.

Change the compile check for wxgtk2 to a runtime check for wayland, and
use Refresh() under Wayland only.
2018-07-02 18:32:18 -07:00
retro-wertz 9146f878d5 Cleanup 2018-06-30 12:15:08 -07:00
retro-wertz 88a19f7c07 Libretro: Add entries for games using 8KB eeprom 2018-06-30 12:15:08 -07:00
retro-wertz daf50fcdbe Libretro: Remove workaround for save file handling
For the most part, save types should now be identified during rom loading and then allow libretro to correctly use flash or eeprom save types and save size.
2018-06-30 12:15:08 -07:00
retro-wertz c1f281b7ba Libretro: Better auto detection of save types when not found in gbaover 2018-06-30 12:15:08 -07:00
retro-wertz 7337341166 Libretro: Set input descriptors to each retropad mapping options 2018-06-30 12:15:08 -07:00
Rafael Kitover 498019a39b support older 32 bit macs running 10.7, fix build
Make mac builder use -m32 in CFLAGS etc. to produce a 32 bit binary
targetting 10.7 (Lion.) This provides the greatest backward
compatibility for older macs, and also allows for asm filters.

Fix an issue with m4 on 10.13 using a patch from macports.

Support `-pX` patch level args in DIST_PATCHES in builder.

Fix an issue with bison on 10.13 by bumping the version to 3.0.5.

Build libxslt `--without-crypto` so that it doesn't try to link the brew
libgcrypt.

Invoke cmake for dists with -DCMAKE_C_COMPILER_LAUNCHER=ccache and
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache to use ccache, and set
CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the actual compilers not
prefixed by ccache.

When checking for ccache in vbam cmake code, check that
CMAKE_CXX_COMPILER_LAUNCHER and CMAKE_C_COMPILER_LAUNCHER were not
already defined (generally on the command line.)

Remove align attributes from sections in 2xSaImmx.asm, macho format on
mac does not support this and the filter works fine without them.

In the Quartz2D renderer, pass the NSRect view.bounds through
NSRectToCGRect when calling CGContextDrawImage(), this is necessary for
the 32 bit API.

Bump openssl to 1.0.2o.

Bump libxml2 to 2.9.8.

Update URL for urw fonts, and improve the dist downloading/unpacking
code to handle URLs that do not contain the filename (for .tar.gz and
.zip as identified by `file`.)

Change post-build for harfbuzz from `rebuild_dist freetype;` to
`rebuild_dist freetype --with-harfbuzz=yes;` as it was supposed to have
been.

Build cmake itself with --parallel and --enable-ccache.

Silence errors from killed jobs due to tmp directory being gone.

Write a couple of string functions, rtrim() and gsub().

Make path_exists() handle globs with spaces in them, by escaping the
space.

Use --host and --build args to autoconf configure to "cross-compile" for
32 bits, this is necessary for some dists, and does not work for others,
remove it for dists where it does not work.

Add COMMAND_MODE=unix2003 to the build environment, this is necessary to
fix some build errors, why I have no clue, found it on stackoverflow.

Pass -Wl,-no_compact_unwind in LDFLAGS to openssl, this is necessary for
32 bits.

Force sfml to compile as 32 bit, it normally does not allow this.

Remove shared-mime-info from this build, it's not necessary for anything
and there are issues XML::Parser linked to our expat and brew perl that
need to be resolved.
2018-06-30 03:40:47 -07:00
Rafael Kitover 6b4862581e fix some ELF parsing vulnerabilities #255
Implement the recommendations described in issue #255 by @zzazzdzz:

- Check bounds when reading ELF program header sections.

- Skip reading ELF section headers if the string table pointer is NULL.

- Increase the buffer size for dissassembled instructions in the
  dissassembly view and pass the buffer size to the disArm() and
  disThumb() functions so that rudimentary bounds checking can be done.

Also add the constants WORK_RAM_SIZE and ROM_SIZE to reduce incidence of
magic numbers and make the code a bit cleaner.
2018-06-29 08:17:13 -07:00
retro-wertz ef8c89fce0 Libretro: Do not compile arm disassembly module
fix compile issue in windows
2018-06-28 15:15:18 -07:00
Rafael Kitover e4923e7267 fix save dialogs on Mac #268
In MainFrame::ShowModal, which is used as a wrapper for
wxDialog::ShowModal to also pause emulation, add the current window
style flags to the additional CAPTION and RESIZE_BORDER flags being set
with SetWindowStyle(), otherwise the other style flags of the window are
reset causing erroneous behavior such as save dialogs appearing as open
dialogs on Mac.
2018-06-26 04:38:38 -07:00
Rafael Kitover ed00dc77a9 use GetWindow()->Refresh() on non-GTK too #260
Default to GetWindow()->Refresh() to draw the game area on non-GTK
platforms as well, and only use the DrawArea(dc) method in GTK2 and
lower.
2018-06-18 10:20:29 -07:00
Rafael Kitover 89228b0697 fix high CPU usage under wxgtk2 #260
When using GTK2, call DrawArea(dc) instead of GetWindow()->Refresh(),
this prevents glib from using huge amounts of CPU (as discovered by
@retro-wertz .)

Switching video drivers sometimes crashes the app, the DrawArea() call
is as safe as possible, the problem is elsewhere.
2018-06-18 10:11:14 -07:00
Rafael Kitover d160321811 fix $ENV{WX_CONFIG} check yet again
The expansion must be quoted as "$ENV{WX_CONFIG}" when passed as a
parameter e.g. to if() otherwise it expands to no parameter when empty.
2018-06-18 08:29:14 -07:00
Rafael Kitover 0489756d4c fix $ENV{WX_CONFIG} check in 46f52941
Apparently in cmake empty env vars do not evaluate to false, use
explicit STREQUAL "".
2018-06-18 04:11:35 -07:00
Rafael Kitover 46f5294129 do not prefer wxgtk3 if $ENV{WX_CONFIG} is set
Skip the check for wx-config-gtk3 if the WX_CONFIG environment variable
is set, indicating that the user wants to override the version of wx to
build against.
2018-06-18 04:04:47 -07:00
Rafael Kitover 437b366e39 clean up wxgtk3 finding cmake code
Use a loop to check for wx-config-gtk4 then wx-config-gtk3 and unset the
config executable variable otherwise.

Also remove gl from the initial wx libraries list.
2018-06-18 03:46:30 -07:00
Rafael Kitover 2efcb620bd support and default to wxgtk3 not gtk2 on arch
Change installdeps to install wxgtk3 on arch instead of the wxgtk
package which uses gtk2.

Update the cmake code to check for the renamed wx-config executable
wx-config-gtk3 on arch, first checking for wx-config-gtk4 for the
future.
2018-06-18 02:44:19 -07:00
Rafael Kitover 430b5d638d fix Mac OS 10.13 build issues
Compile out the min/max functions in GBALink.cpp when compiling with
clang, clang does not like them because of some sort of changes in the
preprocessor.

Run the mac builder script with homebrew bash, system bash does not work
and dash no longer works.

TODO: fix dash compat
2018-06-17 16:01:40 -07:00
retro-wertz 9c85991773 Opps 2018-06-16 16:47:44 +08:00
retro-wertz 009c09ef4a GBA: Show log when rom uses SRAM of FLASH save types
Log should only show once during the first write to SRAM or FLASH address using flashSaveDecide()
2018-06-16 15:59:53 +08:00
retro-wertz 90bc79f299 Libretro: implement vbam logging using libretro logging api 2018-06-16 15:55:26 +08:00
retro-wertz f4b88ba63a Libretro: Remove GBA LCD filter
Libretro use shaders for filters etc.
2018-06-16 15:53:20 +08:00
retro-wertz 76389d8e94 RTC: Change this #ifdef to GBA_LOGGING 2018-06-16 15:17:12 +08:00
retro-wertz 710d2f3ebf UtilRetro: Remove LCD filter 2018-06-16 15:08:04 +08:00
retro-wertz e0fe836516 Makefile: Add option for sanitizer, add -DNO_DEBUGGER 2018-06-16 15:02:27 +08:00
retro-wertz 94d076760d Makefile: Remove sources we dont need 2018-06-16 15:00:47 +08:00
retro-wertz 50e91f7973 Remove unrelated function during rom load 2018-06-15 13:07:22 -04:00
retro-wertz 3c0e88bcdf Remove wrong #ifdef decleration
#ifdef __libretro__ is incorrect and function has worked fine without it.
2018-06-15 13:07:22 -04:00
retro-wertz 3791b0a07f Libretro: Fix samplerate not passed correctly to gba core 2018-06-14 12:16:37 -04:00
retro-wertz 3385be2578 Silence some warnings 2018-06-14 11:48:35 -04:00
retro-wertz 4d4819f055 Libretro: Add core options for Sound Interpolation and Filtering 2018-06-14 11:48:35 -04:00
retro-wertz 94f1102395 Libretro: Add core option to mute sound channels 2018-06-14 11:48:35 -04:00
retro-wertz bdb164bd1c
Set mirroringEnable to false
Set mirroring to false when rom loaded is not found in database. Making this true all the time causes some issue, for one with soft-patching some games.

Fix this https://github.com/visualboyadvance-m/visualboyadvance-m/issues/182
2018-06-14 20:04:20 +08:00
retro-wertz 17b681b864 ereader.cpp: Silence warning 2018-06-13 22:54:07 +08:00
retro-wertz 27fa30b43c Libretro: Disable cheats by default, update to bios loading
Minor rework on how bios is loaded when CPUInit is called, removes a few conditions.

Disable cheats by default. This is automatically re-enabled when enabling and applying cheats. Should save a few cycles during runtime if cheats are not needed.
2018-06-13 22:49:26 +08:00
retro-wertz 01c5f465fe Libretro: Cleanup controller layout binds 2018-06-13 22:39:25 +08:00
retro-wertz 319a4869c7 Libretro: Do not allow opposing directions 2018-06-13 21:19:59 +08:00
U-DESKTOP-UVBJEGH\Cloud 2c46522e59 Libretro: Add Solar Sensor 2018-06-11 16:46:17 +08:00
ZachBacon 037e3771b1
let's place these in the correct spot shall we? 2018-06-10 12:37:28 -04:00
ZachBacon 90d2f5c808 Added retro-wertz for his contributions in bringing in libretro back to speed and other things
Signed-off-by: ZachBacon <zachbacon@budgiemedia.rocks>
2018-06-09 12:04:42 -04:00
retro-wertz 991fc74922 Do this for GBA sound enhancements too 2018-06-09 21:42:04 +08:00
retro-wertz 4e4424e806 GB: Fix sound options not working
Fix crash when adjusting echo/stereo sliders.

Fix enhancements not working when selected

Fix settings not loaded at startup

Reviews and/or modifications are welcome. Obviously, im trying out if I understand how options are linked in WX so I am not quite sure if this is the right thing to do this.
2018-06-09 21:08:20 +08:00
Rafael Kitover abb62df6f3 pause on menu pulldown on windows only (FIXED)
Previous commit had an #ifndef when what was needed was an #ifdef.
2018-06-08 17:24:23 -04:00
Rafael Kitover cb3e9e3252 pause on menu pulldown on windows only
On Windows we still need to pause on menu pulldown until we figure out
how to keep the game running, with the code disabled it still pauses and
the audio loops.
2018-06-08 13:58:19 -04:00
U-DESKTOP-UVBJEGH\Cloud bc0e169d23 Add missing file 2018-06-08 23:05:23 +08:00
retro-wertz edf939e96b Gfx: Add #ifdef _MSC_VER, fix tiled rendering on windows
This only affects when using TILED_RENDERING
2018-06-08 21:21:57 +08:00
retro-wertz 57dc0c25ff Move gfxDrawTextScreen() into GBAGfx.cpp 2018-06-08 20:56:39 +08:00
retro-wertz 27aeb6dc67 Re-add Types.h, remove some more #ifdef 2018-06-08 20:14:45 +08:00
U-DESKTOP-UVBJEGH\Cloud 9ec142daa8 Add header guard 2018-06-08 17:45:10 +08:00
Rafael Kitover 7a194fb224 do not pause games when menus are pulled down
Previously I disabled this for mac because of bugs in keyboard handling,
but it turns out most people don't like the game pausing on menu
pulldown anyway, so now I disable it for all platforms.

TODO: the game still pauses for modal dialogs.
2018-06-08 04:14:34 -04:00
ZachBacon 6e18c3c2d4 exclude headers for now 2018-06-06 07:05:18 -04:00
Rafael Kitover 947cd10e2f minor OSD code cleanup
Use strdup instead of a stack variable + strncpy to convert the osd
wxString message to a C string, hopefully fixes an MSVC incompatiblity.
2018-06-06 06:57:34 -04:00
ZachBacon cafe905b6d Fix a cast for msvc compilers 2018-06-06 04:44:05 -04:00
retro-wertz 1606ea7482 libretro: Cleanup some #ifdefs 2018-06-06 16:20:32 +08:00
Zach Bacon 1d4dacc6f9
Merge pull request #244 from retro-wertz/fix_gba_cheats
Fix cheats not working in GBA
2018-06-05 21:50:22 -04:00
retro-wertz e2dff89dec Fix cheats not working in GBA 2018-06-06 09:35:23 +08:00
Zach Bacon a3510c906e
Merge pull request #243 from retro-wertz/fix_opcode
Fix some opcodes in arm
2018-06-05 21:34:54 -04:00
retro-wertz 9ab2ee6730 Fix some opcodes in arm 2018-06-06 07:48:18 +08:00
Zach Bacon a5e717a284
add brace so it doesn't break compilation
Phone editing is a no, but I didn't want to break compilation.
2018-06-05 11:14:47 -04:00
ZachBacon 4a615ab395 Gonna take my time and actually work on a D3D9 panel. Documentation here I come. 2018-06-05 10:13:41 -04:00
Zach Bacon fdb39a1c8f
Merge pull request #242 from retro-wertz/fix_alignments
Fix some formatting alignments in arm/thumb opcodes
2018-06-05 07:00:18 -04:00
retro-wertz 26c8c61b88 Fix some formatting alignments in arm/thumb opcodes 2018-06-05 18:43:32 +08:00
retro-wertz 8edd4ce5de libretro: Fix save types not properly set using overrides 2018-06-05 08:23:19 +08:00
retro-wertz 3411aa33a4 libretro: Use stdint.h instead in most cases 2018-06-05 00:14:06 +08:00
retro-wertz 1f20ba81ad libretro: Update 2018-06-04 23:55:08 +08:00
retro-wertz b0982ac8e1 Always apply map masks
fixes libretro issue where loading rom will only show white screen
2018-06-04 18:12:02 +08:00
retro-wertz ff4f1235aa libretro: Fix wrong file pointer 2018-06-04 18:03:33 +08:00
retro-wertz 8f6e5de50a libretro: Fix error : narrowing conversion 2018-06-04 18:01:58 +08:00
retro-wertz 8a1fd58783 libretro: Add header guard to UtilRetro.h 2018-06-04 17:59:29 +08:00
Rafael Kitover 85dea8a57b add cygwin cross build support
Put shared code for linux cross builds and cygwin cross builds into
builder/mingw-cross.sh .

Call wxrc when the build platform is cygwin with files resolved via
`cygpath -m` in case the wxrc is a native binary.

Add -fpermissive to CXX/OBJCXX flags.

Reenable libzvbi support for ffmpeg.

Stop building ffmpeg and related dists by default until we fix game
recording.

Set CMAKE_PREFIX_PATH in cmake args as a FILEPATH type variable.

Support xml catalog made with native libxml2 using cygpath in related
commands, make cygpath a noop on non-cygwin platforms.

Remove gdb and zip from msys2 deps.

Add a cygwin installdeps routine using a copy of cyg-apt that it
fetches.

When creating symlinks in install_dist() fully resolve all symlinks in
path parts for the source file, so that host and target binaries are
correctly linked.

When cp -af fails to preserve permission related data, fall back to cp
-rf.

When installing libs with a cross suffix, make a symlink for the lib
without the cross suffix.

Make sure cygwin runs with CYGWIN=winsymlinks:native .

Add paths to host gettext executables to cmake args, otherwise it tries
to use the target executables and fails on paths.

For the pkgconfig bundled glib, turn off win32 platform for the cygwin
host build.

For gettext, remove --disable-auto-import from link flags.

Compile target freetype on cygwin with cmake and manually install the
pkgconfig .pc file using sed.

Add a relocation type 'aggressive', when a dist is marked with this
type, rewrite all '/usr' prefixes to the build root. By default only
files that exist in the dist are matched and rewritten.

Fix regression in linux build by adding some iconv related flags to the
cmake invocation for doxygen and disabling -Werror for xorg dists.

When relocating scripts, use the actual resolved root path for host or
target.

Build libxslt --without-python so that it doesn't try to pick up the
msys2 python.

Other misc. minor tweaks and cleanups.
2018-05-01 04:11:57 -04:00
Rafael Kitover 8638c76923 require pkg-config in cmake for gtk checks #227
cmake reconfigure was failing for the gtk2 case because the pkg-config
cmake code was not being loaded.

Load pkg-config cmake code before any gtk checks.
2018-04-26 17:09:21 -04:00
Rafael Kitover d5f90f0a05 fix SDL sound on windows
In SoundSDL, when building on windows add this init code:

```
SDL_setenv("SDL_AUDIODRIVER", "directsound", true);
```

Otherwise there is no sound on windows.

Also update SDL to 2.0.8 from 2.0.7 in build scripts.
2018-04-16 13:10:12 -04:00
Rafael Kitover 70c8dee8bf cmake: default ENABLE_OPENAL to OFF
Since the SDL sound driver is now the default on all platforms, change
the ENABLE_OPENAL default in cmake to OFF.
2018-04-13 12:31:07 -04:00
Eleuin d992cfa214 Finalize vertical draw fixes and code cleanup
Fix shenanigans
2018-04-04 14:33:20 -04:00
Lucas 62e8098f5b Fix forbidden conversion in remote.cpp
Conversion from std::string to char* is forbidden in ISO C++.
2018-04-03 16:00:45 -04:00
Eleuin 80bcdab924 Fix draw height across rendering modes 2018-03-22 21:00:11 -04:00
Rafael Kitover f3f6ee7b1c fix compile errors with ffmpeg git
The FF_MIN_BUFFER_SIZE macro was renamed to AV_INPUT_BUFFER_MIN_SIZE at
some point, so check for the newer variant first.

The AVFMT_RAWPICTURE macro seems to be gone, but affected code was an
edge-case so compile it out if the macro is not present.
2018-03-19 19:36:00 -04:00
Eleuin d7a4eddb3c Fixed filter draw bounds 2018-03-15 10:00:26 -04:00
Rafael Kitover d5c9c6bac7 change default audio driver to SDL
A Linux user (Eleuin) has reported menu lockups with the default OpenAL
(probably thread related) and no lockups with SDL.

A Windows user has reported popping noises with all audio drivers except
SDL (#178).

Change the audio driver default to SDL for the time being until these
issues can be looked into.
2018-02-28 17:53:55 -05:00
Eleuin 480541a205 Modify max_threads sanity check to better handle erroneous values 2018-02-28 17:18:52 -05:00
ZachBacon c7c6ad6a87
implemented the fix from nhdailey, should resolve #153. Will put up a
test build soon.
2018-02-25 13:38:25 -05:00
Rafael Kitover 66980934b2 add multi-platform build system
under `tools/` add some scripts to invoke the build system to build all
deps for vbam and vbam itself:

- `tools/linux/builder`

This builds a mostly static linux binary with a few dynamic deps for
xorg and wayland. Using gtk3. This will run on just about any dist.

- `tools/osx/builder`

Builds a static mac app targetting 10.7.

- `tools/win/linux-cross-builder`

Builds a static windows binary using the mingw-w64 toolchain.

- `tools/win/msys2-builder`

Builds a static windows binary in the MSYS2 environment, this may be
suffering from a few regressions.

Change some cmake code to support the build system, refactor a few
things in it.
2018-02-24 14:39:29 -05:00
orbea 3e052c943d cmake: Fix -DENABLE_FFMPEG=OFF 2018-01-18 13:18:35 -08:00
Rafael Kitover 420450255c mac build/builder improvements
Improve, refactor and clean up `tools/osx/builder` to build a relatively
full-featured ffmpeg as well. This requires lots of other dists. It's
kind of like a mini port system now. Will generalize it shortly to a
sourced library for using with both the mac and the mingw builds. Will
hopefully become a separate repo on github at some point.

Add perl dist support to the builder.

Add an `--env` flag to the builder to print the build environment
variables so that they can be read in with `eval` for debugging
purposes.

Also add the `FFMPEG_STATIC` cmake option to link static ffmpeg
libraries correctly.

Move the codesigning and zipping of the `.app` bundle to the builder
script and out of cmake, as this is something most users don't need.
2017-10-22 15:35:56 -07:00
Rafael Kitover afb1cd3dfc automate codesign/zip for mac build, add xz dep
Add POST_BUILD commands on Mac to codesign the `.app` and make a zip
file from it.

Also add xz/liblzma dist to `tools/osx/builder` because something
apparently wants liblzma.
2017-10-12 14:56:21 -07:00
Rafael Kitover d7ff2afb80 add mac release builder script
Add `tools/osx/builder`, a POSIX sh script to build all dependant
libraries as static, targetted to OS X 10.7, and build the project with
them (also targetted to OS X 10.7.)

ffmpeg currently does not link, as recording functionality is currently
non-functional anyway, this will be fixed later.

MISC:

- set WORKING_DIRECTORY and ERROR_QUIET for all git commands, for the
  cases when the build directory is not under the git checkout

- #include <cerrno> in ConfigManager.cpp as it uses errno

- change `build*` in `.gitignore` to `build/*` so that files starting
  with "build" are not affected
2017-10-12 01:32:18 -07:00
Rafael Kitover f5379ab806 read version and subversion info from Git
To get the version, find the last tag in git tag of the form "v2.0.0" or
"2.0.0". If this is the last tag and the current commit matches the ref
of this tag, the revision will be empty.

In the case that the current commit is not tagged with a version, to get
the revision, use the short sha unless the current commit is tagged with
something that is not a version string, e.g.  "feature-foo", in which
case the revision will be "feature-foo".

If the current commit is tagged as e.g. "v2.0.1-foo" or "2.0.1-foo" then
the version will be "2.0.1" and the revision will be "foo". Tags of this
form are also checked when finding the current version.

This is all done in cmake. If there is no git detected, the version will
be "2.0.0" and the revision will be "unknown".
2017-10-07 14:00:47 -07:00
Rafael Kitover 1fc0966384 minor code cleanup
Change one instance of a dummy local variable to a C++11 temporary via
CLASS{param}.
2017-09-23 15:29:35 -07:00
Rafael Kitover e9a86c541d fix deadlock in SoundSDL::deinit() #139 #130
On SoundSDL destructor and `reset()`, there was a deadlock with Linux
pthreads, it happened sometimes that the reader thread would call
`SDL_SemWait(data_available)` while `deinit()` would destroy the
semaphore and the `SDL_SemWait()` would end up waiting forever on a null
semaphore.

Change the sequencing of deinit() to prevent this from happening, set
`initialized = false` at the beginning of the sequence to prevent
subsequent entries into the reader callback, and add an SDL_Delay(100)
between the final `SDL_SemPost()` and `SDL_UnlockMutex()`s and the
`SDL_DestroySemaphore()` and `SDL_DestroyMutex()`s to allow a running
reader to complete with a valid mutex and semaphores before they are
destroyed and the thread is joined.

Resetting the sound system also sometimes triggers a memory corruption
bug, but that's a separate issue.
2017-09-21 15:39:30 -07:00
Rafael Kitover 3d792457b2 fix huge app icon in Win volume settings #149 #121
We were setting the app icon based on the 256x256 xpm icon in the xrc,
and this triggered a bug where the app-specific icon in Windows volume
settings was huge:

https://stackoverflow.com/questions/17949693/windows-volume-mixer-icon-size-is-too-large/46310786#46310786

Adapt the code from that SO question to use Windows-specific code to
load and scale the icon appropriately using a Vista+ API, and fall back
to the normal Wx icon loading mechanism on XP.

Also generate a nice new `vbam.ico` Windows icon file based on the
`.svg` using the app from:

https://iconverticons.com
2017-09-19 16:28:23 -07:00
Rafael Kitover 268c638456 improve win32 dependencies git submodule handling
Use `git submodule update --remote --recursive` instead of `git
submodule update --init --recursive` so that the latest version of the
repo is always installed.

Run the command from cmake instead of throwing an error if the submodule
is not checked out. Only throw an error if the checkout failed or the
source tree is not a git checkout.

Don't add the `mingw-xaudio` include directory if using MSVC.

Remove the submodule check from src/wx/CMakeLists.txt, having it in the
main CMakeLists.txt is enough.
2017-09-19 06:11:41 -07:00
Rafael Kitover 7f1fec88af work around gcc lto wrappers bug with gcc 7.x
gcc lto wrapper commands such as `gcc-ar` will segfault with some
versions of gcc 7.x when called via an absolute path, see:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80717

Generalize the mechanism for compiling a small C program on the host
(currently used for bin2c for Wx resources) and use it to wrap the gcc
wrappers in a little executable that prepends their dirname to PATH and
runs them with `execvp()`.

Make LTO default to ON again, except on win32 with gcc < 7, because
those toolchains produce broken binaries with LTO enabled.

Also add `-ffat-lto-objects` to compiler flags for gcc when LTO is
enabled, this will increase the chances that the LTO build will succeed
even if there are issues with the binutils wrappers. Clang does not
support this.
2017-09-16 19:47:39 -07:00
Rafael Kitover 02b3defcd0 restore wx 2.8 compat, improve string processing
Fix building with wx 2.8 by rewriting some more string related code.

Replace all calls to .c_str() with .mb_str().

Remove some of the .c_str()/.mb_str() calls where the target is already
wxString.

Move the split()/enum_idx() functions from opts.cpp into
str_split()/vec_find() in strutils.h/strutils.cpp for use in other
files.

Replace the C-style string parsing code in a couple of places in
wxvbam.cpp for processing possible command line options by splitting on
'='.

Also replace a couple of places that use pointer arithmetic in
widgets/joyedit.cpp and widgets/keyedit.cpp with wxString methods.
2017-09-13 05:32:44 -07:00
Rafael Kitover fa9afa4e18 cmake: wx and cross compiling fixes
When calling find_package(wxWidgets ...) allow the first call to fail
because the OpenGL library may not be found. A subsequent call without
listing the OpenGL library is done with REQUIRED.

And if the OpenGL library is not found, skip the OpenGL compile test.

When cross-compiling (e.g. with mxe or other mingw packages) skip the wx
ABI compatibility run tests.

When choosing which minhook lib to link to the wx ABI compat run test
program, check for 64 bit but fallback to 32 bit just in case.
2017-09-12 15:31:49 -07:00
Rafael Kitover f5cb7b2b40 support Wx built with --enable-stl #134
When Wx is built with --enable-stl, wxString to wxChar*/char* implicit
conversions and vice-versa no longer work.

Change all wxChar* data members to wxString and change all pointer
arithmetic code (mostly in opts.cpp, cmdevents.cpp and
widgets/joyedit.cpp) to use wxString methods instead.

Also make mostly minor changes in various other files for all of this to
work.
2017-09-10 15:44:18 -07:00
Rafael Kitover 142dbc0aca cmake: use arch specific minhook trampoline libs
Use either the 32 bit or 64 bit MinHook trampoline static lib for the Wx
ABI tests, depending on the detected arch of the host/target.
2017-09-10 12:24:36 -07:00
Rafael Kitover de95c70547 fix Wx ABI check for Win32/MinGW
Fix error dialog boxes popping up when the Wx ABI compat tests are run
from cmake.

Wx 3.x is hardcoded to use MessageBox for wxLogFatalError(), even in a
console app, so use the minhook trampoline lib (added to dependencies)
to hook the Win32 API MessageBoxW and MessageBoxA (the second just in
case) so that no error dialogs pop up.

Details here:

https://www.codeproject.com/Articles/44326/MinHook-The-Minimalistic-x-x-API-Hooking-Libra
2017-09-10 11:00:24 -07:00
Rafael Kitover 42f6c446ea minor improvements for Wx compile tests
Include `wx/wxprec.h` (precompiled header first in test programs to
possibly make the tests slightly faster.

For the ABI compat check, set a variable for the test program instead of
listing it twice.
2017-09-08 08:59:19 -07:00
Rafael Kitover ceef480e70 improve wx GCC ABI check #142
Following some suggestions from @ArtiiP, first check if there are no
issues without an -fabi-version flag, and then instead of incrementing
from 0, decrement from 15 to find the highest working ABI version.

This is very slow if the needed ABI version is 2 for example, but not
much to do about that for the time being.
2017-09-04 12:28:24 -07:00
Rafael Kitover b1937fe9cb improve Wx GCC ABI check #142
Start checking the ABI version at -fabi-version=0, which is the default,
and if that succeeds don't set the flag at all.

This will allow the code to work properly if and when Wx removes the ABI
check alltogether.
2017-09-02 18:52:01 -07:00
Rafael Kitover 2ad204619b compile/run test to detect Wx ABI version #142
In 4e665ae I hardcoded -fabi-version=2 for g++ flags, and @ArtiiP
pointed out that this is wrong, because Wx may be compiled with other
ABI versions.

Add cmake check_cxx_source_runs() tests to determine the correct ABI
version flag to use with Wx.
2017-09-01 21:51:24 -07:00
Zach Bacon 350619be93 Merge branch 'master' of https://github.com/visualboyadvance-m/visualboyadvance-m 2017-08-27 22:02:03 -04:00
Zach Bacon c6d8939304 Made a tiny, itty bitty, little accident. Forgot to remove cairo option
from the xrc.
2017-08-27 22:01:19 -04:00
Rafael Kitover e0f79f32a5 remove version.h in ConfigManager and AutoBuild.h
ConfigManager does not use any version info, but is part of libvbamcore,
so removing the `#include` makes rebuilds after git changes much much
faster.

Remove the AutoBuild.h includes from ConfigManager.cpp and SDL.cpp (the
SDL port) because the information in that file does not seem to be used
and it also includes version.h, forcing those files to rebuild
unnecessarily.
2017-08-27 13:32:13 -07:00
Rafael Kitover 2179215a8b fix rebuilds on git changes
Use cmake to generate the version.h from version.h.in which is a cleaned
up version of the old version.h with the git short sha into the build
directory, and include the version.h from there.

Continue to use the GetGitRevisionDescription plugin to make the cmake
configuration state depend on the current sha of HEAD, but throw away
the results (for the time being.)

This makes rebuilds after git changes such as a commit only recompile a
couple of files instead of the whole tree.
2017-08-27 13:20:17 -07: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 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
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
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 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
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
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 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
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
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 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 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
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 105bbba888 Almost there, just a few more blocks to go. 2017-03-21 21:52:28 -04: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
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
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 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
Zach Bacon f145d6ab0e Still working on libretro stuff, working on cheatsenabled compile issue now. 2017-02-25 00:55:29 -05:00
Zach Bacon a8a48919db Fixes build on the libretro side by wrapping an ifndef statement around rederedframes 2017-02-25 00:38:06 -05:00
Rafael Kitover 4d12fcda10 fix Mac linker script for @rpath libs (like SFML)
Homebrew SFML links itself with @rpath/ instead of the dylib path,
update the mac linking and bundling script to handle that case, also
move it from src/wx/tools/osx to tools/osx now that wx is the primary
port.

This fix is temporary and I will write a better one that takes
DYLD_LIBRARY_PATH and such into account, but will suffice for linking
Homebrew libs for now. The script needs more work in general.
2017-02-24 12:24:20 -08:00
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 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 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
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
edorax fee89f1967 Fix build for MSVC. 2017-02-11 23:11:32 +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 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 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 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
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 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
Mystro256 a08d944867 Fix format-extra-args warning 2016-12-30 10:49:22 -05:00
Mystro256 e451ce09dd Missing include, fixes gcc warning 2016-12-30 10:48:05 -05:00
Rafael Kitover e2e4105dcd remove src/wx/VBA.ico, dup for src/wx/icons/VBA.ico 2016-12-21 17:10:03 -08:00
Rafael Kitover d06e7afceb full support for cross-compiling to win32 with mxe
Fix all cmake issues related to building for win32 with mxe.

Add support for ./installdeps win32 on Debian/Ubuntu using the mxe apt
repository.

Details:

* default to ENABLE_LTO=OFF on mxe

* set SFML_STATIC_LIBRARIES=TRUE on mxe

* fix the libintl/gettext checking logic

* fix the git dependencies submodule checking logic, and check that it
  triggers for mxe

* revert FindSFML.cmake to upstream version, works fine with mxe

* make 'win32' an alias for the 'MinGW-w64-i686' target for
  ./installdeps, add support for mxe apt repository for Debian/Ubuntu

* change bin2c related cmake code to compile the tool on the host always
  even when cross-compiling

* copy src/win32/res/VBA.ico to src/wx/icons since src/win32 has been
  removed

TODO: generic mxe installer for other unix-likes
2016-12-21 13:02:55 -08:00
Mystro256 774719ddf6 Appdata fixes
Note that metadata_license is the license of this specific file, apparently
it's not allowed to be GPL, CC-BY-SA-3.0 is close enough.
2016-12-21 09:14:10 -05:00
DoctorWho11 33febfb4ba add old resources that were in the win32 folder that the wxwidgets interface uses on windows 2016-12-20 17:56:05 -05:00
DoctorWho11 a1bf0f3f82 Drop gtk and mfc interfaces. Things are changing and for the better. 2016-12-20 17:34:34 -05:00
Rafael Kitover dea31e52e9 fix SDL2 include in 534c4da
For SDL2 includes are specified as:

```cpp
```

rather than as:

```cpp
```

without the `SDL/` prefix, this was causing a compile error.
2016-12-19 02:15:44 -08:00
drysyle 534c4da649 Rewrote joystick hat code to fix diagonal issues 2016-12-18 15:25:18 -08:00
Zach Bacon f7f67ff6f9 Fixed compiling without sfml. 2016-12-14 16:52:45 -05:00
Rafael Kitover c2a23a9ffe check for RAW_CONTROL only on macs in switch stmts
On e.g. Windows WXK_RAW_CONTROL == WXK_CONTROL so having both in a
switch statement is compile-time error, so wrap the checks for
WXK_RAW_CONTROL in an #ifdef __WXMAC__ .
2016-12-14 06:23:02 -08:00
Rafael Kitover 8c309eaaf4 fix modifier-only game keys
Fix using modifier keys such as SHIFT or CONTROL by themselves as game
keys.

Modifier keys are sent as a special keycode e.g. WXK_CTRL along with the
modifier flag, however on key release the keycode is sent but the
modifier flag is not. So check for modifier keys in process_key_press()
and always set the modifier flag so that release events are recognized
correctly.

Fix support for RAW_CTRL on Mac (which is the real control, while the
Command key is mapped to CTRL.)

Also disable the debug message emitted by wX when our modifier-only key
parsing code runs.

TODO: map modifier key names on Mac to the actual keys rather than the
wX names such as RAWCTRL.
2016-12-14 00:26:54 -08:00
Rafael Kitover a60d24e91a workaround wX 3.1+ key accel string parsing bug
In wX 3.1+ the behavior of wxAcceleratorEntry::ToString() and
wxAcceleratorEntry::FromString() has changed and the resulting string
can no longer round-trip through these methods.

Use a lookup table based on an internal data structure from the wX
source code to translate the "display name" of some keys to the regular
"name" as a workaround for now.

This allows at least the default keybindings to work and not throw an
error on startup.

TODO: standalone modifiers as game keys are still broken.
2016-12-13 15:08:55 -08:00
Rafael Kitover d5020b905c fix wX XRC for wX 3.2
Some sizeritems in horizontal box sizers had the wxALIGN_RIGHT flag,
which makes no sense in horizontal sizers, since they allow only
aligning things vertically. This was throwing XRC errors on startup.

Remove the erroneous wxALIGN_RIGHT flags from the XRC.
2016-12-13 10:03:38 -08:00
Zach Bacon 0e9fb98393 Merge pull request #52 from Mystro256/master
Various fixes
2016-12-10 19:50:19 -05:00
Mystro256 1af42f486c Use full name for wx appdata 2016-12-10 19:34:16 -05:00
Mystro256 8f694f054b Fix FSF address information 2016-12-10 19:19:34 -05:00
Mystro256 8baa415848 Add linux appdata and fixes
Desktop files aren't installed for linux by default
2016-12-10 19:05:30 -05:00
Mystro256 24d2521914 Manpage fixes 2016-12-10 17:56:04 -05:00
Mystro256 4a3618ef26 Forgot two instances of SYSCONF_INSTALL_DIR 2016-12-10 04:12:36 -05:00
Zach Bacon ea220b4822 one file was missed from the last PR, looking at you Mystro256 :P 2016-12-10 04:08:03 -05:00
Mystro256 87ee8c700a Forgot two instances of SYSCONF_INSTALL_DIR 2016-12-09 23:33:19 -05:00
Rafael Kitover 0e6c1b66e3 Quartz2D display rendering driver for Mac
Implement a Quartz 2D (aka Core Graphics) output renderer for the Wx
interface as a subclass of BasicDrawingPanel called
Quartz2DDrawingPanel.

Split BasicDrawingPanel's DrawArea() into DrawArea() and DrawImage(),
with DrawImage() receiving both the wxPaintDC and the wxImage, the
wxImage is created with a direct pointer to the frame buffer when
possible (24bpp).

Implement Quartz2DDrawingPanel in macsupport.mm based on the code here:

http://www.cocoabuilder.com/archive/cocoa/309165-how-to-quickly-paint-to-cocoa-view-from-bitmap-in-memory.html

and here:

http://stackoverflow.com/questions/2261177/cgimage-from-byte-array

the GetData() method of wxImage is used to avoid copying the frame
buffer.

Add RND_QUARTZ2D to the renderers enum and update all config stuff and
the XRC to support it. As well as the DrawingPanel instantiation code in
GameArea::OnIdle().
2016-12-09 13:06:59 -08:00
Zach Bacon d35d00f650 Added Caelum to the list 2016-12-03 09:01:36 -05:00
Rafael Kitover 7f6374356d rename 'Fullscreen filter' to 'Display filter'
Since filters apply to both window and fullscreen mode, rename the
config option 'Fullscreen filter' to 'Display filter'.
2016-11-23 03:56:30 -08:00
Rafael Kitover 3af0c7ff51 reorganize display config panel
Rename "Advanced" page to "Basic" and move to the first page instead of
last.
2016-11-23 03:49:07 -08:00
Rafael Kitover 790c9e13bd update mac link script to 1.0
This version is roughly twice as fast.
2016-11-23 03:07:44 -08:00
Rafael Kitover 55f6e17f0d compile/link flags improvements
* Bump minimum cmake required to 3.3.2, to make sure generator
  expressions work.

* Force CMAKE_BUILD_TYPE to "Release" if unset, not sure if this
  actually works.

* Merge the older compile flags block with the new one and use generator
  expressions to make sure the relevant flags apply only to C, C++ or
  nasm.

* Add -lssp to the end of the link commands for the -fstack-protector*
  options, this is only needed/done for gcc.

* Add -lversion and -limm32 to SDL2_LIBRARY (Zach asked for this.)

* Builds on msys2 again!
2016-11-20 11:11:52 -08:00
Zach Bacon 0ba8166467 Moved all filters into interframe.cpp file, original code by EmporerArthur 2016-11-19 20:43:07 -05:00
Rafael Kitover 13196c0748 update to latest version of bin2c.c
I maintain it here:

https://github.com/rkitover/bin2c

In terms of functionality, this version is pretty much the same as the
original, just nicer argument handling, a usage screen, etc.
2016-11-18 09:08:09 -08:00
Rafael Kitover 902a7a7e0d fix 32bit build support
Make ASM_CORE, ASM_SCALERS and ENABLE_MMX the defaults for 32bit builds
on intel hosts (the host can be AMD64, as long as the target is 32bits.)

Move mac nasm search into the mac section of the cmake code and stop
defaulting to /usr/bin/nasm, this was screwing up the build on msys2.

Fix src/filters/2xSaImmx.asm to compile and link correctly.

Add nasm to list of mingw deps for ./installdeps-msys2 .

Tested that msys2-built Wx binary runs, including with 2xSaI.

Keyboard doesn't work yet on msys2 builds, but that's a completely
different issue.
2016-11-18 09:04:55 -08:00
Zach Bacon c0f8a8a335 Resolves undefined issues, just doesn't fix using libretro... yet. 2016-11-17 19:29:10 -05:00
Rafael Kitover 3c30d59aba msys2 build improvements
* Enable ffmpeg by default only on linux and msys2, it will be disabled
for normal windows builds and on mac.

* Set SFML_STATIC_LIBRARIES only for normal non-msys2 windows builds,
because msys2 does not currently have static versions of the SFML
sub-libraries, e.g. system, network, etc.. Dynamic linking works fine
for now.

* Fix quoting for -DLOCALEDIR, on windows spaces were causing errors in
make on msys2.

* Update to upstream FindSFML.cmake .

* Add an ./installdeps-msys2 script to install all necessary tools and
libraries on msys2 for building both 64 and 32 bit windows Wx binaries.

* Add the dependencies/mingw-xaudio/include directory to
INCLUDE_DIRECTORIES so that XAudio compiles on msys2, as mingw-w64 does
not currently have XAudio headers. Also check that the user pulled the
git submodule in the process (the ./installdeps-msys2 script does this
for you.)

TODO:

* Generalize ./installdeps to work on more platforms.

* Make console Wx app in debug mode so that debug prints will work.

* Fix game keyboard input for msys2 builds.

* Add HiDPI support for Windows.

* Fix the -D*DIR defines to have the correct paths on windows.
2016-11-14 10:56:50 -08:00
Rafael Kitover 10fd7f926e enormous speedup for compiling Wx resources
Replace bin2c.cmake script with one written in C and compiled as an
intermediate target.

The C version is roughly 12000 times faster.

On msys2, the cmake version takes 7.5 minutes on this system, while the
C version takes 0.037 seconds.
2016-11-13 14:31:34 -08:00
Zach Bacon 0d6b94afb7 Slow fix of libretro interface 2016-11-10 00:40:22 -05:00
Zach Bacon 9e0c8cec8b Fix compiling d3d 2016-11-08 09:15:52 -05:00
Rafael Kitover 30f80ab22b fix wx GL viewport + build improvements
Add GetRealPixelClientSize() method to HiDPIAware and implement using
wx GetClientSize() in panel.cpp for the generic version, and using
convertSizeToBacking: in macsupport.mm .

Add an AdjustViewport() method to GLDrawingPanel that sets glViewport()
using GetRealPixelClientSize(), and call it for the SIZE event. Debug
print the viewport size here instead of in DrawingPanelInit().

Build improvements:

* default to Cairo off for all platforms, currently libcairo2-dev does
  not install on Ubuntu

* default to ON for ENABLE_LINK and ENABLE_FFMPEG (for game recording),
  this will allow for more fully-featured default builds

* do not set SFML_STATIC_LIBRARIES on Mac because this is currently
  broken

* fix the Mac bundling/linking script to deal with links in dependent
  libs that already use @rpath (very minor change.)
2016-11-08 04:51:26 -08:00
Christopher Snowhill 63b086af20 Merge pull request #37 from rkitover/wx_accels_with_modifiers_fix
fix wx kbd accels that are game key + modifier
2016-11-06 15:42:29 -08:00
Rafael Kitover 491cef4872 fix wx kbd accels that are game key + modifier
Pass the keyboard modifiers to process_key_press so that it only
registers a game key if the modifiers match. That is, if e.g. ENTER is a
game key, then ALT+ENTER gets passed to other Wx controls and does not
register as a game key.
2016-11-06 14:48:05 -08:00
Rafael Kitover 981026dc80 fix Xcode project generation via cmake
Move Objective-C++ Mac code for Wx into macsupport.mm with stub methods
in panel.cpp, and stop compiling all C++ as Objective-C++.

cmake -G Xcode # now works fine
2016-11-06 14:09:50 -08:00
Christopher Snowhill 6cc2db09ab Update Cheats.cpp
Bounds checking again.
2016-11-04 11:59:03 -07:00
Zach Bacon ecc6f7c3c6 Default to OpenAL and OpenGL on linux 2016-11-03 19:47:00 -04:00
Rafael Kitover 01200fadbd Mac OS X 10.7 (Lion) build and runtime support
Make a custom cstdint.h header file that includes <tr1/cstdint> if
<cstdint> is not available, because the clang 3.x used on Lion does not
have it. Change all references to <cstdint> to use it instead.

Add missing OpenGL header for older OS X in sdl/SDL.cpp .

When calling HiDPI methods, use respondsToSelector: to check if the
methods are available first.

Fix the bundling/linking script to support multiple copies of the same
dylib with different versions. Necessary to include both the Lion system
libpng and the brew libpng. Including the system libpng is necessary
because it is removed in later versions of OS X.
2016-11-03 10:49:13 -07:00
Christopher Snowhill 36d84cfa2b Update gbCheats.cpp
Bounds checking is important.
2016-11-02 21:28:58 -07:00
Rafael Kitover ba043f4f97 fix Mac post-build bundle/link broken in a775cc4
Instead of checking if CMAKE_BUILD_TYPE is "Release", check that it is
**NOT** "Debug", because by default CMAKE_BUILD_TYPE is empty.
2016-11-02 19:05:18 -07:00
Rafael Kitover a775cc409f fix kbd controls on Mac + misc.
After creating the drawing panel, call SetFocus() on it and use
Connect() to bind keyboard events from it. Add the wxWANTS_CHARS flag to
all DrawingArea subclasses so that wxEVT_CHAR_HOOK can be used instead
of wxEVT_KEY_DOWN, because it is more general and catches more keys.

Change the process_key_press function to return a bool indicating
whether a game control is currently pressed or not, this is used in the
key events to determine whether the event should be propagated or not.
If in a game key, do not propagate the event, otherwise it hits one of
the other controls and generates a beep sound.

The menu open/closed/highlighted events had to be turned off for Mac,
because the menubar is catching all keyboard events for some reason even
before they reach the drawing panel event handler. So on Mac the game
will not be paused when the menu is being used, this is not really a big
deal and can be fixed later.

Other improvements:

* do not bundle and link dylibs when CMAKE_BUILD_TYPE is not "Release",
  this makes for quicker debug builds

* finally make a generic PaintEv for the DrawingPanel abstract base
  class using dynamic_cast<> and Bind(), unfortunately this is not wx
  2.8 compatible

* set the default audio_buffers to 10 instead of 5, this completely or
  almost completely fixes sound stuttering during normal game play on
  Mac with OpenAL

* spew path info on startup only once
2016-11-02 18:14:58 -07:00
Rafael Kitover d18afb982f support for fully independent .app build on Mac
The resulting Mac wX .app build is now completely independent and
redistributable, only needs to be codesigned.

Necessary dylibs are bundled and linked in a POST_BUILD step using
third_party_libs_tool (included) for which I created a separate repo
here as well:

http://github.com/rkitover/mac-third-party-libs-tool

Turn off Cairo on Mac because it does not work for now.

Set RPATH on the executable to @loader_path/../Frameworks, the bundling
tool also does this.

Update .gitignore for Finder .DS_Store files.

TOOD:

* write a ./quickbuild for Mac and other platforms such as msys2 and
  linux
2016-10-27 22:06:06 -07:00
Rafael Kitover 2d9ec99c11 Mac build improvements
Move closer to allowing an "out of the box" distributable build for Mac:

* fix the icon for the .app

* link SDL2 statically, a PR has been sent to the original repo here:
  https://github.com/tcbrindle/sdl2-cmake-scripts/pull/9

* link SFML statically

TODO:

For a releasable build on OS X, system libs must be linked
dynamically while third party libs are linked statically or bundled. The
goal is to link them statically.

The two remaining libs that need static linking are PNG and wX.

For PNG a similar approach to the one used for SDL2 using pkg-config
should work fine and be simple to implement.

For wX things are more complicated. The default build of wX does not
include static libs, I will need to submit a PR for Homebrew to change
the default build to include both dynamic and static versions.
2016-10-26 16:58:21 -07:00
Renato "Lond" Cerqueira 91a9b75d40 Fix namespace issue, missing parens, missing func 2016-10-24 12:40:43 -07:00
Rafael Kitover d075bacf94 fix DisplayConfig panel brkn in 7a7a72f
Change the Scale control in the DisplayConfig dialog from a SpinCtrl to
a TextCtrl (for a simple text field) because GenericValidator does not
support using a double* with a SpinCtrl.

Also force adjustment on minimum size and resize the window when
necessary on panel creation, so that when the user sets the value
higher, the window size automatically adjusts.
2016-10-24 10:02:44 -07:00
Rafael Kitover 0192d9a362 simplify DrawingPanel classes w. dynamic_cast<>
Use dynamic_cast<wxWindow*>(this) in the DrawingPanel abstract class to
implement GetWindow() and Delete() so that all concrete classes do not
have to duplicate the code.
2016-10-23 11:38:54 -07:00
Rafael Kitover d543217f6a fix backcompat on unix for config brkn in 7a7a72f
Only load config files with the app name set to "visualboyadvance-m" on
Windows and Mac, on unix keep the default of "vbam" for now so that
users' ~/.vbam directories are found correctly.

TODO:

* migrate all of this properly to XDG paths on unix, giving users the
  option to move their config
2016-10-22 17:26:05 -07:00
Rafael Kitover 7a7a72f2bd Mac OS X HiDPI fixes + other misc
Use a high-res surface on HiDPI (e.g. retina) Macs for the OpenGL
renderer, and scale window accordingly. Also fix fullscreen toggle not
working in HiDPI mode. And some other stuff.

Aside from the .app not being linked statically, the app is now fully
functional on Mac and ready to ship.

Full change details:

* add -DDEBUG or -DNDEBUG based on CMAKE_BUILD_TYPE (-DNDEBUG for
  Release and -DDEBUG for Debug)

* properly search for homebrew/macports/fink directories, and only add
  them if they exist

* fix building with wx debug support, when available

* use explicit OpenGL context on Mac too for new versions of wx

* add main_frame pointer in GameArea back to MainFrame, and a
  SetMainFrame(MainFrame* parent) public method to set it in guinit

* add full support for reading and writing double value config options
  (the GUI still needs to be updated for options that can take doubles,
  such as video_scale)

* change video_scale option (Display/Scale) to a double, putting a
  double value such as 3.6 in the config file works correctly

* add a HiDPIAware mixin class for GameArea and DrawingPanel, with the
  method HiDPIScaleFactor which returns the current window's
  backingScaleFactor

* change the GameArea sizing methods (DelBorder(), AdjustMinSize() and
  AdjustSize()) to divide the window size by the
  HiDPIAware::HiDPIScaleFactor so that the window is scaled properly

* change GameArea::ShowFullScreen to ignore fullscreen events for a
  maximized window on Mac, because maximized windows on OS X are
  actually native fullscreen windows

* change scale variables to double from int, and use std::ceil() to
  round scaled pixel or memory size values

* make a default base class DrawingPane::DrawingPanelInit() virtual
  method, call by all concrete class constructors based on the did_init
  flag

* call setWantsBestResolutionOpenGLSurface:YES on the view backing the
  wxGLCanvas for the OpenGL renderer (GLDrawingPanel) to get a high res
  OpenGL surface in HiDPI mode

* remove GLDrawingPanel::OnSize event, the OpenGL viewport resizes
  automatically without the need to call glViewport()

* do not hide the mouse pointer if the main frame has menus or dialogs
  open

* add variadic vbamDebug(const char* format, ...) function, active only
  #ifdef DEBUG, which sets the wx log target to STDERR and logs a
  message to it

* use full name of app "visualboyadvance-m" instead of "vbam" when
  getting configuration paths, this way the config is saved to
  ~/Library/Application Support/visualboyadvance-m rather than
  ~/Library/Application Support/vbam

* listen to the MENU_HIGHLIGHT_ALL event as well, as an extra way to
  check when the menus are open

* add public MainFrame::SetMenusOpened(bool state) method to force the
  main frame to change the internal menus_opened state, this is
  necessary because in HiDPI mode on Mac the keyboard accelerator for
  toggle fullscreen sends a menu open event, but not a menu close event,
  so on switch to fullscreen the state is changed to menus closed and
  the emu is unpaused

TODO:

* GUI option to change toggle fullscreen behavior between native and
  non-native fullscreen on Mac

* GUI support for double config values like Display/Scale

* add HiDPI support to simple renderer

* fix SDL sound, or disable the option

* fix Cairo suport on Mac, or disable the option

* use dynamic_cast<> to implement GetWindow() for DrawingPanel instead
  of pure virtual method, likewise for Delete()

* link .app statically by default so it can be shipped

* add Homebrew formula
2016-10-22 05:47:27 -07:00
Rafael Kitover 61b1af9e16 rebind toggle fullscreen on mac
On OS X, the F11 key is by default bound to "show desktop", so is a poor
choice for the "ToggleFullscreen" accelerator.

The default key combo to take apps fullscreen should be Ctrl+Cmd+F
according to:

https://support.apple.com/kb/PH18744?locale=en_US

Fortunately, this was very easy to fix by using the "platform" attribute
in MainMenu.xrc .

NOTE: this does not give us "real" OS X fullscreen yet, where the app is
on its own space, like native fullscreen apps. In the future it would be
nice to add an option to do this.
2016-10-18 07:02:47 -07:00
Rafael Kitover 98e82247fc make OpenGL default render method on OS X
Currently the "simple" render method is way too slow on OS X, while
Cairo is completely broken. The OpenGL renderer, on the other hand, runs
with almost no stuttering.

Also fix dangling icon file after OS X build.
2016-09-22 11:00:47 -07:00
Rafael Kitover cc7394f730 improve OpenAL support on Mac and make it default
Fix the dynamic library path for OpenAL to the framework included with
OS X.

Make option initialization set the AudioAPI to OpenAL on mac by default,
since SDL sound is currently completely broken.

There is a lot of stuttering, will have to look at that next.
2016-09-20 05:24:25 -07:00
Zach Bacon 9b65a9cf29 Merge pull request #22 from kookerus/PR
Added cast to uint8
2016-09-09 06:59:28 -04:00
Taylor Rose 294296b226 Added cast to uint8 2016-09-08 18:08:23 -04:00
Martin Sundhaug 6176a57d81 Merge https://github.com/visualboyadvance-m/visualboyadvance-m 2016-09-07 18:49:54 -04:00
Martin Sundhaug 9ad1506ed7 GDB: Range check register in remoteReadRegister and remoteWriteRegister 2016-09-07 18:29:57 -04:00
Zach Bacon f295f726b0 Merge pull request #20 from sundhaug92/patch-1
Fix: Typo in GDB implementation
2016-09-03 17:23:48 -04:00
Zach Bacon 03655a465f
Fix some compile issues and desktop launcher issues 2016-09-03 17:07:30 -04:00
Martin Sundhaug a80209e9b9 Fix: Typo in GDB implementation 2016-09-03 22:39:55 +02:00
Jonathan Sifuentes e4354eedd2 Fix for T2
see: http://dev.vba-m.com/T2

> Every time I launch a server it defaults to the locahost IP instead of my
> actual IP. This is preventing me from linking with friends over Hamachi. When
> they enter my IP it errors on their end and they cannot connect. [report taken
> from <https://sourceforge.net/p/vbam/bugs/219/>]

Also, by chance, added the build folder to `.gitignore` so as to not pollute the
git repo.  I meant to do them as separate commits, but I forgot to do so.

Signed-off-by: Jonathan Sifuentes <jayands2k11@ymail.com>
2016-08-08 19:23:08 -07:00
Zach Bacon be25a2155b
This should fix the update issue, I'll release a test binary soon. 2016-07-31 09:30:16 -04:00
Zach Bacon bba13d30a6
Minor compile issue, should be pretty much the last of it, next is the update check. 2016-07-31 09:13:14 -04:00
EoD 6612d34ddf Fix SDL.h includes
See comment in FindSDL2.cmake:
 Note that the header path has changed from SDL2/SDL.h to just SDL.h
 This needed to change because "proper" SDL convention
 is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
 reasons because not all systems place things in SDL2/ (see FreeBSD).
2016-07-31 00:11:21 +02:00
EoD 3b520ee202 Add missing OpenGL header
Fixes an issue with GLuint not defined
2016-07-30 23:56:33 +02:00
EoD 645be4522c Add missing wxWidget includes 2016-07-30 23:56:17 +02:00
EoD 6ce43f90b9 Fixes build issue if VERSION has not been defined 2016-07-30 23:55:57 +02:00
EoD 3cf6c2ca7b Fixes memgzio with zlib > 1.2.3.8 2016-07-30 23:55:00 +02:00
Dorian Wouters 31391e090c
Kill common/Types.h, replace its old typedefs w/ standard types
Fix includes in files using standard int types
Fix wxWidgets UI includes
Silence some unused variable warnings in GBA-arm.cpp macros
2016-07-29 11:07:11 +02:00
Dorian Wouters 37f0e75c45
Fix standard int types, prefix gb {C,H,N,Z}_FLAG with GB_ 2016-07-29 09:45:38 +02:00
Zach Bacon 4d3d2b7951
Gba inline fixed up, will try and get things done during the weekend 2016-07-23 09:32:49 -04:00
Zach Bacon ba57da76cb
You must be getting tired of this. I know I am. 2016-07-23 08:10:45 -04:00
Zach Bacon 8106b77056
Added a todo list 2016-07-23 07:59:34 -04:00
MrJman006 9dd9fd5d26 Fixing U16 and U8 Parameter Types
It seems like most of the types are moving to fixed width integer types and this file wasn't fully converted.
2016-07-21 22:01:49 -04:00
Zach Bacon ba3083b538
Expect more of these type of messages till all is done 2016-07-09 22:08:20 -04:00
Zach Bacon 79820311d3
I could go on, but really this is just more typedef removal 2016-07-09 21:38:43 -04:00
Zach Bacon 5f73631f84
Eeprom is done 2016-07-09 17:34:55 -04:00
Zach Bacon 590dd281dd
finished the cheat files 2016-07-09 17:24:11 -04:00
Zach Bacon 44e45acfe7
holy shit these shortcuts, there's no end to this is there? 2016-07-09 15:42:30 -04:00
Zach Bacon f0a4b5e533
bios.cpp done, still a bit to go for the cores 2016-07-09 14:39:27 -04:00
Zach Bacon 1944613131
gb folder is done, next up gba, once this is all up I'm going to look at enhancing the cores 2016-07-09 11:41:31 -04:00
Zach Bacon 1f37311a4a
more and more formating issues, I keep doing it in parts for my own reasons 2016-07-09 10:13:54 -04:00
Zach Bacon 48086ba62f
some more formating things etc 2016-07-09 09:53:13 -04:00
Zach Bacon a49edee427
More changes being made, you'll know when it's over. 2016-07-09 09:24:19 -04:00
Zach Bacon 59577d666f
Finished updating common, next up gb folder 2016-07-08 21:39:29 -04:00
Zach Bacon fa33b8eea4
More changes, things may break until it's done so be advised, git is a moving target 2016-07-08 20:57:21 -04:00
Zach Bacon 32a6d7b494
we are 2016, let's get with the times 2016-07-08 20:46:04 -04:00
Zach Bacon 5bf44d19be
updated standards to webkit standard 2016-07-08 19:59:29 -04:00
Andy Chase dfaf44eed9 Edit sdlStateName, fixing SDL states on a Mac
Previously this function returned true for `if(saveDir)` when `saveDir` was simply a zero length string following a branch that returned `/<savepath>` which doesn't work when the user isn't a root user.
2016-06-25 01:30:34 -07:00
Markus Kitsinger (SwooshyCueb) 57c619ca13 Add some header and resource files to CMakeLists.txts (Core+WX)
This makes these files show up in generated CodeBlocks projects, which
makes life easier for folks who import into QtCreator.
2016-06-07 15:26:53 -05:00
Markus Kitsinger (SwooshyCueb) 502de18456 Nonfunctional (but compiler-friendly) kludge for video recording with ffmpeg 3.0 2016-04-26 21:50:57 -05:00
Markus Kitsinger (SwooshyCueb) a3a07d2f56 Some encoders don't like s16 2016-04-26 21:45:52 -05:00
Markus Kitsinger (SwooshyCueb) 029a5fc14b Kludge for audio recording with ffmpeg 3.0 2016-04-26 21:41:30 -05:00
Markus Kitsinger (SwooshyCueb) 3f3c3859c1 Add some defines for ffmpeg 3.0 compatibility 2016-04-26 21:32:38 -05:00
Zach Bacon 48770219fa Minor build fixes cxx11 related 2016-02-20 18:44:49 -05:00
Zach Bacon 7ed85a8c6f Finish committing the remaining gtk3 patch (wip) 2015-12-12 23:23:34 -05:00
Zach Bacon c8343267fc <wip> Migration to SDL2 made possible by galtgendo, gtk changes to follow. 2015-11-18 21:34:38 -05:00
Rafael Kitover 3d679c1469 more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.

Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.

Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.

If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.

For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.

For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .

Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.

Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.

Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.

Fix copying Info.plist and vbam.icns to the .app bundle.

Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support

Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.

Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.

Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-16 21:56:23 -05:00
Rafael Kitover 8b8f2f7a14 fix configuration directory on OSX
Write vbam.ini to ~/Library/Application Support/vbam on OSX.

Do not create ~/.vbam on OSX in common/ConfigManager.cpp .

Make get_config_path and wxvbamApp::GetConfigurationPath return
directories with a writable parent in reverse search order when no
writable directories in the current search order are available since the
directory is created in OnInit.

This prefers to create the user-local directory and write the vbam.ini
there.
2015-11-09 02:11:18 -05:00
DoctorWho11 3fac31acb5 Actually display the commit version. However may shorten it since it displays the full string. 2015-10-23 22:21:39 -04:00
skidau a9aa25a56f This patch adds those missing HLE BIOS functions for sound driver: https://sourceforge.net/p/vbam/bugs/24/
It is utilized by Phantasy Star Collection at intro. I don't know any other games using this BIOS driver, so I just implemented the parts that Phantasy Star Collection uses.

This patch is far away from perfect yet. Sound quality is not the same as with original BIOS. Also code is horrible to read, since I just kept translating arm instructions to C without thinking too much. Got it done quickly so if anyone has keen interest on continuing from here.

Patch by Juha Laukkanen
2015-10-17 10:39:09 +11:00
DoctorWho11 1e1b1cc35c This should fix the issue of when users on linux run the install command and make not finding the proper binary. 2015-09-29 23:49:15 -04:00
DoctorWho11 68e67b7269 added xbrz 6x support to the wxwidgets interface, will take care of the gtk end shortly. 2015-09-19 04:08:13 -04:00
intact 75696f29c6 xBRZ 1.4 filter update 2015-08-04 01:37:14 +02:00
skidau 023d28a9cc OSX build fix by Juha Laukkanen. This one works with wxWidgets 3.0 and Cairo 1.14.2. 2015-07-11 10:34:27 +10:00
skidau 9f463f3850 Fixed the GBA sound filter options which were not getting applied. 2015-06-23 22:10:07 +10:00
n-a-c-h 3b850ac295 Rewrote our array class. 2015-06-16 01:59:41 +03:00
DoctorWho11 2baea1b8cf hopefully this fixes things for cpack 2015-06-15 09:42:40 -04:00
DoctorWho11 65f7546798 rename exe and added more cpack stuff. 2015-06-15 09:00:47 -04:00
DoctorWho11 f5600cef71 setting the exe name and git hash 2015-06-15 08:21:44 -04:00
skidau e6231e9ef5 Switch to fullscreen after the game starts so that the GUI does not fall over. 2015-06-15 21:36:11 +10:00
skidau 17270b5181 MFC and SDL build fix 2015-06-13 10:03:58 +10:00
DoctorWho11 6ad134c501 Enable Xaudio2 support by default 2015-06-12 08:56:20 -04:00
DoctorWho11 e67315c7f8 more build fixes 2015-06-12 08:45:19 -04:00
DoctorWho11 7ea54ecbf0 yet more changes to git (incomplete) 2015-06-12 08:39:47 -04:00
DoctorWho11 c0785f3812 Begone svnrev.h! 2015-06-12 08:30:54 -04:00
skidau 4d1310032e Clean up and dependency path fixes 2015-06-11 11:26:35 +10:00
skidau 0d4cfaf056 Readjust the window size if the status bar is hidden.
Show the OSD if the status bar is hidden.
2015-06-10 06:48:21 +00:00
skidau 8e57e850a4 Added an option to show/hide the status bar. 2015-06-10 03:11:34 +00:00
skidau 14c2a16aab Read from svnrev.h on Windows only 2015-06-10 02:06:06 +00:00
skidau d0ced9d2c8 Gentoo Linux build fix 2015-06-10 00:12:19 +00:00
skidau e973e59666 Added an auto-update option (Windows only) 2015-06-08 06:25:19 +00:00
skidau 1dc399839c Added a "Check for updates" option to the Help menu. 2015-06-05 13:48:37 +00:00
skidau 811fc9a872 Fixed the crash that would occur if "Use BIOS file" was selected without a BIOS file specified. 2015-06-04 02:44:07 +00:00
skidau b410bc0314 Added portable mode. The emulator will attempt to use portable mode initially. If that fails, it will use the local user directories. The Directories settings now accept relative and absolute paths. Leave the directory blank to use the ROM directory.
Changed the logging to print to the status bar as well as the log file.
2015-06-03 13:36:54 +00:00
skidau 18d429c2c0 Fixed the joystick mapping getting converted to unicode in the conf file when they should not have been. 2015-05-30 06:02:23 +00:00
skidau 56a42ec50f Fix some lintian warnings. Patch by sergio-br2. 2015-05-29 22:11:38 +00:00
wowzaman12 5a6ed061a4 removed the cmake toolchain file, modified the cmakelists files to include an additional library to properly link with sfml and for linking statically with libgcc and stdc++ libs via mingw 2015-05-28 15:12:31 +00:00
wowzaman12 6a5cfd1073 merp, I goofed up somewhere... 2015-05-28 14:58:11 +00:00
wowzaman12 12a9c921c0 svn string shouldn't be translatable 2015-05-28 14:56:45 +00:00
wowzaman12 01d776b9e8 updates to version string for final builds 2015-05-28 14:36:05 +00:00
wowzaman12 d234e277ef Because cross compiling from linux complains about case 2015-05-28 14:23:08 +00:00
wowzaman12 df3e3b5e22 should fix compiling on debian based distros by forcing them to use wxwidgets 3.0 2015-05-27 23:04:20 +00:00
skidau 811893c250 Made the dialogs resizeable. 2015-05-26 02:09:28 +00:00
skidau 3f325573f5 Fixed the Game Boy system type selection not matching what was emulated. 2015-05-25 00:41:50 +00:00
skidau 066f2e80d6 Fixed the save type changing to SRAM on reset, if the game had been overridden to use EEPROM. 2015-05-24 14:49:28 +00:00
skidau 2ec24487c3 Fixed the "Solar Sensor is broken" message that appeared in "Boktai - The Sun Is in Your Hand". Cleaned and formatted the code. Fixed a mistake where the RTC was not getting updated. 2015-05-24 13:30:31 +00:00
skidau fc197be2f0 Automatically disabled the OSD if there is a status bar visible. 2015-05-23 11:58:29 +00:00
skidau 23cdd50acb Added the option of using host (PC) time or guest (GBA) time for the RTC. Checking the "Real time clock" option in the menu uses host time otherwise it uses guest time. Using guest time will mean that the clock speeds up or slows down with the speed of emulation. 2015-05-23 09:03:11 +00:00
skidau 3ae673b85d Fixed the battery file not saving after a save state was loaded. 2015-05-23 04:43:42 +00:00
skidau bca162d761 Fixed the child windows appearing under the parent window with "Keep window on top" enabled. 2015-05-23 01:56:33 +00:00
skidau d9e705d39a Relabelled the full screen menu items to be clearer in what they do. 2015-05-23 01:20:48 +00:00
skidau f2e6d4544f Added separate "Open GB" and "Open GBC" menu items. 2015-05-23 01:01:43 +00:00
skidau 8508f7aab6 Used the battery file size as an indicator of the save type unless overridden. 2015-05-22 15:11:28 +00:00
skidau 152533061c Save SRAM battery files as 8KB files. 2015-05-22 11:05:45 +00:00
skidau 4a5ae01e19 Removed the padding from the cheat file when it is saved in CLT format. 2015-05-22 07:05:06 +00:00
skidau 2d5ecd88db Fixed another cheat limit check in the GB code. 2015-05-22 05:52:50 +00:00
skidau fec1c7b770 Fixed the cheat list size check for GB games. 2015-05-22 05:34:05 +00:00
skidau 6d964a523f FreeBSD build fix 2015-05-22 01:04:13 +00:00
skidau e202a3994f Added mime types to wxvbam.desktop. Thanks to alucryd and sergio-br2. 2015-05-21 13:49:46 +00:00
skidau 759cf30a19 Moved the trace.log to the local config directory. 2015-05-21 13:31:34 +00:00
skidau 3f9d927103 Create the default config path on start-up and renamed the app "vbam" to be consistent with the sdl build. 2015-05-21 13:06:15 +00:00
skidau 5c6ef13d8c Changed the app name from wxvbam to VBA-M 2015-05-21 12:20:19 +00:00
skidau 5e562ca4b6 Fixed the "scrolled" assertion. 2015-05-21 12:16:20 +00:00
skidau 9340762719 Fixed the crash on boot that would occur with FFMPEG enabled. 2015-05-21 11:29:31 +00:00
skidau d83062e64e GTK build fix 2015-05-21 09:56:55 +00:00
skidau 45c8b6a3d6 Fixed the cheat list size check. 2015-05-21 07:42:14 +00:00
skidau 1b60856e8d Updated debian folder to current standard. Thanks to sergio-br2. 2015-05-21 00:19:51 +00:00
bgk ead03a559a WX: Some strings were mistakenly marked as translatable 2015-05-20 18:46:54 +00:00
skidau 17282fd988 Fixed the crash that would occur if the audio backend is switched before a game is loaded. 2015-05-20 14:57:58 +00:00
wowzaman12 e4959e111f missed the aboutbox 2015-05-20 14:34:51 +00:00
wowzaman12 37d5e9e91c just changed a define to an existing one, when FINAL_VERSION is not defined it'll show svn string and when defined it will not show. 2015-05-20 14:29:53 +00:00
skidau 90249184a3 Resized some of the dialogs. Fixed the Cancel button on the GDB configuration dialog. 2015-05-20 14:11:53 +00:00
skidau cd6a2bd014 Updated the OSX icon and removed the extraneous .app suffix 2015-05-20 03:56:27 +00:00
skidau b02d948dc1 Made running the game at normal speed the default set-up. Patch by sergio-br2. 2015-05-19 23:17:57 +00:00
skidau a79f006cf4 Reset the sound subsystem if the audio backend is changed. Fixed an array out of bounds error in the sound device selection. 2015-05-19 11:50:56 +00:00
skidau c39716f183 Used Sergio Benjamim's icon for the wx build. 2015-05-19 11:01:45 +00:00
skidau e287fb43c8 Removed the CR's from wxvbam.desktop. Thanks to Sergio Benjamim. 2015-05-19 10:07:22 +00:00
skidau cd47885083 Made the configuration dialogs stay on top so that they would not be covered by the main window. 2015-05-18 13:52:29 +00:00
skidau e8dddc9147 Added a "Keep window on top" option. 2015-05-18 13:11:58 +00:00
skidau 6020b6728c Added version to the About box. 2015-05-18 12:10:07 +00:00
skidau 77de248b71 Raised the maximum number of cheats allowed from 100 to 16384. 2015-05-18 05:37:37 +00:00