Commit Graph

62 Commits

Author SHA1 Message Date
Rafael Kitover 81c88227fa Add Catch2 unit testing framework + some tests.
Add the Catch2 headers to third_party/include/catch2.

Add Catch.cmake and CatchAddTests.cmake to cmake/.

Add unit tests src/wx/tests/strutils.cpp using Catch2 to test
src/wx/strutils.cpp.

Make some code changes to strutils.cpp to make the tests pass.

See src/wx/tests/CMakeLists.txt for how to set up unit test files; they
plug into the normal CTest mechanism in cmake.

The test binaries are written to the tests/ subdirectory of the build
directory.

Building the tests and enabling the CTest support can be turned off by
passing -DBUILD_TESTING=OFF to cmake, the default is ON, this is the
standard mechanism.

Start running ctest on travis and appveyor.

Move stb to third_party/include where Catch2 is now as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-07-10 13:43:48 +00:00
Rafael Kitover 1347026d40 Turbo config refactor followup.
In the Turbo config dialog, remove the selection list for entering the
value and leave only the spin control. Allow values above 600%, up to
4000%.

Reintroduce the speedup_frame_skip config variable, defaulting to 9, use
it for turbo selection values > 600%, with speedup_throttle == 0.

The rationale for this is that on average modern hardware, throttle
values above 500% or 600% will not be effective.

The default is now shown as 1000%, which is:

frame_skip == 9 && speedup == 1,

where:

speedup == 1 is equivalent to throttle == 0,

as was the case before the turbo config changes.

Values above 600% are automatically rounded up or down to the nearest
100%, on entry and on click of the up/down arrows of the spin control.

The frame skip checkbox is cleared and disabled for the "Unlimited"
setting (throttle == 0), and set and disabled for values > 600%, to
reflect the mechanism to the user.

When the value again enters the modifiable range in the spin control,
the previous value of the checkbox is restored.

Misc:

- Turn off translation of percentage values in the xrc.

- Remove the size element for the throttle selection list in the general
  config dialog xrc, it breaks the layout on GTK3.

- Add a note about passing wxWidgets_CONFIG_EXECUTABLE to cmake to
  select wxWidgets version to README.md.

Hopefully this will reduce confusion and present a nicer UI.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-05-15 02:01:57 +00:00
Rafael Kitover f24e8aae2f
Change board/nightly URLs in README.md to https.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-23 00:27:51 +00:00
Rafael Kitover 83b6efa6cd
Add forums link back to README.md.
Now that the board is back up.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-22 15:04:06 +00:00
Rafael Kitover 4f49c89a98
Update README.md for current project status.
- Remove forum link until it's back up.

- Add nightly builds link.

- Use ninja for build instructions instead of make.

- Note that wx 2.8 and non-stl builds are no longer supported.

- Mention fprintf(stderr, ...) in the debug messages section.

- Misc. minor edits.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-16 12:13:25 +00:00
Rafael Kitover c258f6c1c8
Remove libpng from dependencies in README.md.
Followup on 05bd2a95 and 513af13d.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-03-02 19:15:38 +00:00
Rafael Kitover 5c0903d651
Add developer manual.
Start a developer manual for the project where we will keep policies,
guides and processes for the project in DEVELOPER-MANUAL.md.

Describe the policies for receiving and resolving github issues.

Describe the policy for git commit messages on pull requests and add git
notes for collaborating on a branch.

Describe the policy for commits from maintainers.

Describe how to set up a native windows powershell development
environment and some powershell tips.

Describe the requirements and steps for the current release process.

Replace the CONTRIBUTING section of the README.md with a link to this
manual.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-25 19:51:53 +00:00
Rafael Kitover 0b419ee849
Revert snap store badge change.
It seems only the svg version is available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 04:42:12 +00:00
Rafael Kitover 00cd19f640
README.md: remove snap status, small store badge.
Remove snap build status since we are not using that anymore.

Use the png instead of the svg for the snap store badge as it's not as
large.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-08 04:33:30 +00:00
Zach Bacon 1fa66c1f32
just a minor change to the readme
have the snap badge on a separate line
2019-12-28 22:18:23 -05:00
Zach Bacon d785cd4e6c
Add build status for snapcraft 2019-12-28 22:12:54 -05:00
Rafael Kitover e98d89310e
cmake: Add some release automation steps.
Use ENV{MSYSTEM_PREFIX} instead of ENV{MSYSTEM} to check for msys2 as
that is more reliable.

Generate the translations.zip when building for Windows from the
generated .gmo files.

Add the UPSTREAM_RELEASE option to perform some additional release
automation steps:

- Codesign for Windows with either the Visual Studio signtool or
  osslsigncode when using MinGW.

- On Windows zip up the .exe into the appropriate zip file for release.

- Generate the gpg signature .asc files for the translations zip and the
  .exe zip on Windows.

- On Mac codesign the app, zip it and sign the zip.

- On all platforms try to strip the binary.

Remove the release automation steps from the builder script as they are
now in cmake.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-24 06:32:01 +00:00
ZachBacon b57bd76e3a
Added snapcraft store page.
This allows linux users that use snapd and for distro's like ubuntu that do not have vba-m in their repo's to install it to their system without having to compile their own releases.
2019-12-18 19:00:09 -05:00
Rafael Kitover cf9a88dfc3
cmake: Visual Studio support improvements.
Add support for vcpkg ffmpeg, this requires using someone's
FindFFmpeg.cmake instead of relying on pkg-config, since vcpkg does not
have pkg-config.

Do not use the ffmpeg from vcpkg on appveyor however, because that
pushes the build cache generation over the time limit for jobs.

Add secur32 and bcrypt to the list of ffmpeg libs on windows, these are
standard windows libraries.

Change some code in ffmpeg.cpp to remove C-style casts of struct
initializers, which are illegal in MSVC.

Add the INT64_C and UINT64_C macros missing in MSVC's stdint.h (if not
defined) to ffmpeg.h before the ffmpeg headers are included, because
they rely on them.

Rewrite the wxWidgets finding code for the vcpkg wxWidgets to be nicer
and work correctly for debug and static builds.

Remove all /W* and /w* warnings options from cmake compiler flags, and
replace them with /W4 for debug builds, and /w (no warnings) for release
modes.

When building a static binary, remove all /MD* flags from cmake compiler
flags, and use /MT for static release builds and /MTd for static debug
builds.

Improve the vcpkg toolchain wrapper to only rebuild the vcpkg binary if
there were git updates.

Redo the handling of SDL2 and SDL_main. Only link SDL2Main to the SDL
binary and don't use the definitions.

Update CMakeSettings.json to use Ninja and include static
configurations.

Use CMAKE_PROJECT_DIR instead of CMAKE_SOURCE_DIR to determine the vcpkg
root, as CMAKE_SOURCE_DIR is sometimes set incorrectly in the 2017 GUI.

Add /nodefaultlib:libcmt to the debug build link flags, as in debug
builds libcmtd is used and libcmt should not be.

Add /subsystem:console to debug build link flags to produce a windows
console app for debug builds, like we do for mingw builds. To do this,
define a WIN32_CONSOLE_APP macro and if set, define a main() that calls
WinMain().

Call wxMesdsageOutput::Set() in OnInit with an instance of
wxMessageOutputStderr for windows debug builds to make sure the --help
text etc. goes to the console instead of a popup box.

Update the Visual Studio related text in README.md.

Fix dynamic debug builds by linking to the debug version of SDL2 and
copying the debug version of the dll to the build dir.

Fix issue in MainFrame::BindAppIcon with the function we are using not
being found in a Windows DLL in debug builds by using
wxDynamicLibrary::GetSymboolAorW() instead of GetSymbol().

Enable LTO for MSVC in Release modes, if the option is set.

Change appveyor config to use an 8 item build matrix of
x64/x86 / Release/Debug / Static/Dynamic. And test the binary in debug
modes by running --help.

When copying the wxrc.exe out of the build tree, copy both the release
and debug versions, this is so that appveyor caching of vcpkg works,
since the build trees are not cached.

Add some necessary win32 libraries to the SDL binary. And enable
building it on appveyor.

Fix #465.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-10 11:13:58 +00:00
Rafael Kitover 2b34983b9f
cmake: Support VS Ninja/jom builds on Windows.
Only set CMAKE_GENERATOR_PLATFORM to "x64" for 64 bit toolchains for any
of the "Visual Studio" generators, which use msbuild.

For other generators such as Ninja or NMake (jom) set
CMAKE_C[XX]_COMPILER to "cl" to let cmake find the compiler in the
user's PATH and set up the toolchain appropriately. On the user's part,
all that is required is running the 64 bit dev tools command prompt, or
setting up the equivalent environment in powershell.

We are no longer restricted to msbuild, and other generators such as
Ninja will work correctly.

Switch the appveyor job to Ninja, this requires some wrangling because
the appveyor environment does not include ninja. I used this:

https://github.com/boostorg/hana/blob/master/.appveyor.yml

Also update the README.md instructions to use Ninja.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-07 17:39:19 +00:00
Rafael Kitover 5b809e3ad1
Drop reference to ubuntu PPA from README.md
The packages in this PPA are completely out of date, even the
dependencies are out of date.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-10-06 06:06:13 +00:00
Rafael Kitover 61141ebd3a
add -p:BuildInParallel=true to VS instructions
Add `-p:BuildInParallel=true` to the Visual Studio instructions for
`msbuild`, to build subprojects in parallel, without which the `-m`
option has no effect, both must be used.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-12 03:12:15 +00:00
Rafael Kitover 8b3470507d
cmake: check for ffmpeg >= 4.0.4
Check for the specific `ffmpeg` lib versions in `ffmpeg` `4.0.4` "Wu",

Do not pass `-DENABLE_FFMPEG=OFF` to the xenial travis job, as this is
detected automatically now.

Add a note about the required ffmpeg version to `README.md`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-01 20:37:39 +00:00
Rafael Kitover 23224fbaac
update factory reset instructions in README.md
Replace the Windows instructions for deleting the config file with the
much simpler `Help -> Factory Reset` option, which does the same thing.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-31 16:23:34 +00:00
Rafael Kitover d9a7e0c964
cmake: auto-detect sfml, ffmpeg and openal
In cmake detect if the dependencies for link (sfml), recording (ffmpeg)
and openal are installed and default the features to `ON` if they are,
otherwise to `OFF`.

This simplifies the cmake usage.

Update the default column in the `README.md` table to `AUTO` as well.

Remove the cmake options from `installdeps` instructions, since they are
auto-detected.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-20 08:21:38 +00:00
Rafael Kitover c64dd259b9
Update README.md
Fix Visual Studio instructions.

Add links for all dependencies.

Fix grammar/omissions etc.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-20 07:31:38 +00:00
Rafael Kitover 8ceef90fc4
fix appveyor visual studio build
See #465

To compile the build tool `bin2c`, add a target with `add_executable()`
on visual studio instead of using `HostCompile.cmake` because running
`cl.exe` fails in the appveyor visual studio environment, see:

https://developercommunity.visualstudio.com/content/problem/325122/c1356-unable-to-find-mspdbcoredll.html

Also update the dependencies module to latest.

appveyor build now tested to work.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-20 06:55:07 +00:00
Rafael Kitover 38561b5713
Merge remote-tracking branch 'vbam-libretro/master' 2019-07-25 02:16:32 +00:00
Edênis Freindorfer Azevedo 060da968eb [LINUX] Add option to disable the online updater.
Add option to remove all configuration related to checking for updates
online. Although it is not implemented at the moment, these options
appeared on our menu `Options` > `General ...`.

- Fix need of patch on #140.
2019-07-25 00:41:34 +00:00
retro-wertz 7f105da3d6
Update README.md 2019-07-23 19:24:59 +08:00
Rafael Kitover e2f06210e0
update Visual Studio support
Replace the vcpkg code with a newer and better version. In this version
the `vcpkg` directory is on the same level as the source directory, so
that IntelliSense does not get confused scanning for files.

The cmake variable `VCPKG_TARGET_TRIPLET` is required to activate vcpkg
support, it must be set to e.g. `x64-windows` or `x86-windows`.

Update `CMakeSettings.json` for the new code for the GUI.

Fix a problem copying the `SDL2.dll` file to the binary directory.

Update `README.md` with commandline instructions.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-03 23:28:48 +00:00
Rafael Kitover 2097b5aaa5
wx 2.8 compat fixes, centos support, cmake fixes
Add support for RHEL/centos to installdeps. There is no SFML package.

Add some string compatibility stuff so that everything builds on wx 2.8
unicode builds.

TODO: add travis slaves for 2.8, with and without unicode

Disable the game frame spacer code on 2.8 because it does not work (the
frame does not expand.)

cmake improvements:

- set ENABLE_LTO=OFF for Debug builds by default

- set ENABLE_LINK=OFF if SFML cannot be found and continue

- use better logic for finding wx utilities wx-config and wxrc

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Closes #395
Closes #297
2019-03-28 21:45:06 +00:00
Rafael Kitover f1ecd7c322
auto deps for visual studio, take 1
Use vcpkg to build deps when Visual Studio on Windows is detected, this
only happens on first build, but does take a while because things like
wxWidgets need to be built. Building from the developer command line is
also supported.

I considered making a pre-built tarball available, but the resulting
files are just too big for this to be practical.

Make the necessary cmake code changes for this to work and to use the
vcpkg packages, which work just like on linux or have other cmake glue
code available.

To do this, we make vcpkg a submodule, use git to checkout all
submodules, then just build and use the `vcpkg.exe`. Then we set the
CMAKE_TOOLCHAIN_FILE to the vcpkg toolchain and also include it
directly, why this is necessary I don't know, without it it doesn't work
in the IDE but does on the command line.

All of this requires no vcpkg integration with either the user or the
project. A user-wide `ENV{VCPKG_ROOT}` is also supported.

Fix the dynamic arrays in the GBA core, MSVC follows the C++ standard on
this and gcc does not.

TODO: add the necessary gcc flags to make this an error in cmake.

Use `wxArrayString` instead of `std::vector<wxString>` in
`src/wx/strutils.cpp` which is used in options parsing. This was
necessary because of a bizarre linker error with wxWidgets when using
Visual Studio:

https://trac.wxwidgets.org/ticket/10884#comment:46

In `src/wx/panel.cpp` make sure the unimplemented D3D renderer code does
not get compiled if it's actually `OFF`.

Also fix the new spacer code for the drawing panel to not combine
`wxEXPAND` with `wxALIGN_CENTER`, which is an error on wxWidgets 3.1.2,
which is what vcpkg uses. The drawing panel seems to be automatically
stretched to the max size automatically anyway.

TODO: if all of this works, we'll need an Appveyor set up for visual
studio.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-03-21 16:01:46 -07:00
Rafael Kitover 39fd3f6580
add note to README.md about translations
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-03-02 17:34:36 -08:00
Rafael Kitover de0e8d6ba3 cmake: support libasan/-fsanitize
Add the ENABLE_ASAN cmake option, defaulting to `-fsanitize=address` if
ON, or the value specified for the option.
2019-01-02 08:23:26 -08:00
Rafael Kitover 65e1ab041d disable gcc stack protector, segfault on 8.2.0
Make gcc -fstack-protector-strong and associated options controlled by
the cmake option ENABLE_SSP which defaults to OFF.

This option causes a segfault on startup with gcc 8.2.0.
2018-08-10 16:35:49 -07:00
ZachBacon 21b718b837 Add Coverity Badge 2018-06-26 22:26:50 -04:00
Rafael Kitover 8778837c83 add Travis CI support
Use a matrix of 4 jobs, linux (ubuntu trusty), mingw i686, mingw x86-64
and mac.

Automatically detect ccache in the cmake config and cache the
`~/.ccache` directory for faster rebuilds.

Instructions for ccache in cmake are here:
https://stackoverflow.com/a/24305849

Change build status badge in README.md to Travis.
2018-06-26 19:15:22 -07:00
Rafael Kitover 66a50e35da note how to reset config in windows in README.md
Add a note at the top of README.md for windows users on how to find the
config directory and delete it.
2018-06-23 13:45:35 -07: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
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
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 d3351a7575 remove doctoc title from README.md TOC
Remove the "generated with doctoc" title from the README.md table of
contents.

Need to run `doctoc --notitle`.
2017-09-18 01:02:33 -07:00
Rafael Kitover 42fb76bfcf update README.md
Note that LTO now defaults to ON, and ENABLE_ASM does not turn on
ENABLE_ASM_CORE.

Trim the wxLogDebug() section.

Titlecase headings.

Generate a TOC with `doctoc`.
2017-09-18 00:58:47 -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 4e665ae088 use -fabi-version=2 for GCC, turn off LTO #142
Use the g++ `-fabi-version=2` compiler option, as suggested by @ArtiiP
to fix problems similar to:

```
Fatal Error: Mismatch between the program and library build versions
detected.
The library used 3.0 (wchar_t,compiler with C++ ABI 1002,wx
containers,compatible with 2.8),
and your program used 3.0 (wchar_t,compiler with C++ ABI 1009,wx
containers,compatible with 2.8).
Aborted
```

Turn LTO off by default until I fix it for newer gcc/binutils, currently
with gcc7 ar segfaults linking vbamcore.
2017-09-01 05:06:26 -07:00
Rafael Kitover 82d0b04a01 remove cairo references from README.md
Since Cairo was dropped in 1583a226, remove all references to it in
README.md .
2017-08-27 13:22:41 -07:00
Rafael Kitover 9bca4f7292 document how to provide symbolic backtraces
Add a "REPORTING CRASH BUGS" section to the README.md with instructions
for how to provide a symbolic backtrace on Linux and MSYS2.

Add a "Crash bugs" section the the issue template with a link to said
README.md section.
2017-08-17 14:25:27 -07:00
Nicola Spanti (RyDroid) 2da2d9c41d Improving README 2017-08-14 15:28:52 -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
Zach Bacon 10e1b7a6dd added tea-ci badge 2017-05-11 15:38:17 -04:00
orbea 7ea1616afc Add BIN_INSTALL_DIR and MAN_INSTALL_DIR 2017-05-11 06:39:37 -07: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
Rafael Kitover 3a7c18da11 add gitter.im badge to top of README.md 2017-03-21 16:05:28 -07:00
Rafael Kitover 0dc175cdb4 basic ./installdeps support for Solus Linux
Add basic support for installing deps for a Solus host build and update
README.md .

Support for mingw and 32 bit cross-builds may be added later.
2017-03-19 19:09:33 -07:00