Commit Graph

3298 Commits

Author SHA1 Message Date
Rafael Kitover ea5cbba016
build: update default.nix for macOS and new wx
Update the default.nix, which is used on nixOS and other nix
installations for loading the build dependencies into a shell for
building.

Update the wxWidgets package to wxGTK32, the current version.

Add an if statement to check for macOS and load the right package set
for it.

Building with nix on macOS does not currently work, but the build
dependencies do work now.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-05 16:49:21 +00:00
Rafael Kitover f6e3daf9d8
ci: use matrix, disable macos for now
Change CI actions to a matrix with cmake options, for both release and
debug builds, with ENABLE_LINK=OFF and ENABLE_SDL=ON configurations, for
all 3 runners.

Also add both g++ and clang++ to the matrix for the Ubuntu runner to
test on clang.

Disable the macOS workflow for now because brew is failing to install
dependencies.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-04 22:55:51 +00:00
Fabrice de Gans 0f4ec57557 [Build] Fix the NO_LINK build
The NO_LINK build had bitrot and was no longer building. This fixes the
issue by properly disabling Link-related code, including unreachable
functions when the project is built with ENABLE_LINK=FALSE
2023-09-04 13:46:29 -07:00
Rafael Kitover 7a7778c644
build: fix installdeps for new Debian wx packages
Update installdeps for Debian to find the new version wx packages, but
still use the -gtk3 variants on very old versions of Debian.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-09-04 20:41:17 +00:00
Fabrice de Gans 803ab35269 [GB] Save MBC7 EEPROM data to `gbRam`
Previously, MBC7 EEPROM was saved at address 0xa000 in memory, rather
than inside the `gbRam` data buffer. This was inconsistent with other
mappers, resulting in issues like the EEPROM data being cleared on
`gbReset`.

Fixes #1173
2023-08-27 17:08:09 -07:00
Fabrice de Gans 24b6ac5a28 [GBA] Implement missing Thumb instruction
The CMP Thumb instruction was missing one variant. This is used in the
Chinese fan translation of Mega Man Battle Network 2.

Fixes #889
2023-08-27 16:52:36 -07:00
Rafael Kitover 0e5d63cd9a
build: update to Mac third_party_libs_tool 1.3
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-27 17:19:08 +00:00
Rafael Kitover cd8d65bddd
build: set cmake C++ version to 17, fix Mac build
Fix Mac build regression caused by 2407923f (build: fix cmake version
warnings, 2023-08-26) due to vbamcore and vbam targets using C++11 but
no longer being compatible with it.

When cmake_minimum_required() was set to a much older version, the
CXX_STANDARD property for vbamcore and vbam were ignored.

With the change mentioned above setting a higher
cmake_minimum_required(), the -std=gnu++11 flag started being passed when
compiling these two targets, making them fail due to recent changes no
longer being C++11 compatible.

Set cmake_minimum_required() to 3.8.2, the first version of cmake
supporting C++17, remove the CXX_STANDARD and CXX_STANDARD_REQUIRED
properties from these two targets, and set CMAKE_CXX_STANDARD to 17 to
set this property to C++17 for all targets in the project.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-27 08:04:57 +00:00
Rafael Kitover 2407923fc0
build: fix cmake version warnings
To fix some cmake dev warnings in recent cmake versions, move
cmake_minimum_required() to before project() and set the minimum
required cmake version to 3.5.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-26 02:32:50 +00:00
Rafael Kitover 37f4affe55
Merge remote-tracking branch 'libretro/master' 2023-08-26 02:26:44 +00:00
saulfabreg Wii VC Project 76cb71464d Fix GameCube builds for VBA-M Libretro too
The GameCube, like the Wii and Wii U, is also big-endian, so let's fix VBA-M for GCN too.
2023-08-19 15:26:08 +00:00
saulfabreg Wii VC Project 0cd79a96f5 Add VBA-M to Wii/Wii U nightly buildbot. 2023-08-19 15:26:08 +00:00
saulfabreg Wii VC Project 3745eea419 Fix Wii & Wii U builds of VBA-M for Libretro (Ploggy)
Since Wii and Wii U are both big-endian systems, we need to call in the Makefile for Libretro cores that these must use big endian code for be able to work, otherwise the emulation will just give a white screen.
Fix by Ploggy, many thanks to him.
2023-08-19 15:26:08 +00:00
LibretroAdmin a2378f05f6
Merge pull request #116 from saulfabregwiivc/wii-wiiu-fix
Fix VBA-M Libretro builds on Wii/Wii U. (Ploggy)
2023-08-18 12:39:10 -07:00
saulfabreg Wii VC Project f7d4370789
Add VBA-M to Wii/Wii U nightly buildbot. 2023-08-18 14:17:16 -05:00
saulfabreg Wii VC Project 46de99a0da Fix Wii & Wii U builds (Ploggy)
Since Wii and Wii U are both big-endian systems, we need to call in the Makefile for Libretro cores that these must use big endian code for be able to work, otherwise the emulation will just give a white screen.
Fix by Ploggy, many thanks to him.
2023-08-18 14:12:25 -05:00
Rafael Kitover 5583175559
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-15 02:00:58 +00:00
Fabrice de Gans 14a4b6f820 [dialogs] Move JoypadConfig to its own class. 2023-08-13 16:07:31 -07:00
Rafael Kitover 5f421b53c0
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-08-08 02:00:57 +00:00
Rafael Kitover 32d273ad78
build: notarize mac release binary
Notarize the mac release binary from cmake as described here:

https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow?language=objc

. This involves adding `--options runtime` when codesigning to enable
the hardened build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-22 20:51:48 +00:00
Rafael Kitover 774fbab7cc
build: write version to macOS plist
Separate writing the version into the Info.plist on macOS into a
separate action from the online updates Sparkle framework into a
separate POST_BUILD action because we are not using Sparkle for macOS
builds right now due to codesigning issues.

Also sort tags by reverse tag name in the cmake git version extractor
because a tag was rewritten.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-12 06:24:20 +00:00
Rafael Kitover 00645906a5
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-11 02:01:00 +00:00
Rafael Kitover bde372bc72
build: fix codesigning arm64 release binaries
CMAKE_CROSSCOMPILING is true when building arm64 on an x64 host, so
ignore this on MSVC.

Eventually we want to run osslsigncode through wine when cross compiling
for win32 on other platforms, or use the native signtool.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-10 01:37:55 +00:00
Rafael Kitover d0194d9a75
release v2.1.6
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-09 15:44:48 +00:00
Squall-Leonhart 7561ca97c1
Fix Discord streaming for OpenGL
Check if the OpenGL context is valid on every operation, and if not
re-initialize it. Also rebind the textures every time the frame is
drawn.

Also rename the SetCurrent method to SetContext, which is clearer.

Fix #643
Fix #767
Fix #840
Fix #843

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-06 20:40:54 +00:00
Rafael Kitover 24b92462f9
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-07-03 02:02:24 +00:00
Rafael Kitover ffec5aba5e
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-30 02:01:01 +00:00
Rafael Kitover 882957a2d3
Override SetCurrent() in GLDrawingPanel
Make a bool SetCurrent() wrapper over checking the wxGL_IMPLICIT_CONTEXT
define and executing the appropriate behavior to set the OpenGL context.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-28 21:12:01 +00:00
Rafael Kitover 5b65066bf8
build: on mac install trans into debug builds too
Change the cmake code to install the translations gettext .mo files into
the .app bundle for non-release builds too.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-27 22:14:37 +00:00
Rafael Kitover 790618102d
builder: bump SDL2 2.24.0 -> 2.28.0
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-23 00:56:37 +00:00
Rafael Kitover 9331dbf9c8
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-06-04 02:01:00 +00:00
Fabrice de Gans 6f68bfcf71 Create the config directory at first launch
First launch would fail because wx does not create the configuration
directory by itself if it does not exist.
This also fixes an incorrect menu option.
2023-06-01 18:28:14 +00:00
Rafael Kitover 7b8c4242fb
builder: macOS build updates
Update glib/gvdb to fix a compile error with newer clang compilers.

Add link flags for ffmpeg to link the static libraries and frameworks it
needs.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-31 13:38:44 +00:00
Rafael Kitover df84f2b005
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-31 02:01:00 +00:00
Rafael Kitover d08c9137c1
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-29 02:01:01 +00:00
Rafael Kitover 7aafce0665
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-28 02:01:01 +00:00
Fabrice de Gans e26f807355 [bios] Fix lz77 and add BIOS_SndDriverVsyncOn
The lz77 uncompresssion software BIOS implementation was exiting early
when uncompressing data, if the overall length was larger than
advertised in the function parameter. However, real GBA BIOS does read
further than the advertised length, so we do here too. This fixes
Advance Wars title screen.

This also adds a SoundDriverVSyncOn implementation, silencing an error
for some Shrek games, though they still cannot properly boot with an
emulated BIOS.

Fixes #789
2023-05-27 22:51:39 +00:00
Rafael Kitover 4c8b54de89
translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-26 03:28:10 +00:00
Fabrice de Gans bad388e0aa Move the GB ROM Info dialog to its own class
* Move the Game Maker information to a separate helper method.
* Make the dialog strings more localizable.
2023-05-23 15:19:39 -07:00
Fabrice de Gans d1f6500098 Refactor accelerator / global shortcuts handling
* Removes wxAcceleratorEntryUnicode and assorted arrays in favor of a
  new class, `config::Shortcuts`, which handles UserInput assignment to
  commands and resolution at runtime. `config::Shortcuts` also handles the
  INI user configuration in a backwards-compatible way. Runtime
  resolution of UserInput to command is also now logarithmic rather than
  linear.
* The same shortcut can no longer be assigned to 2 different commands,
  which fixes #158.
* Moves the `AccelConfig` dialog to its own dedicated class.
2023-05-23 11:56:32 -07:00
Fabrice de Gans fda429fc64 [GBA] Do not draw BG tiles from outside of BG VRAM
This was fixed by endrift in mGBA in commit
4ce9b83362
2023-05-09 17:12:30 -07:00
Fabrice de Gans b139572424 Convert wxJoyKeyCtrl to UserInputControl
This replaces all uses of wxJoyKeyCtrl with a new custom widget,
UserInputControl. Internally, this class keeps track of UserInputs
associated with the current control, allowing direct access to the
UserInputs, rather than going through string conversions.

Acceleration handling is simplified by going through UserInput -
converted to the key, mod, joy triplet for now - rather than handling
string comparisons.
2023-05-08 01:42:39 +00:00
Rafael Kitover b9694e1900
build: fixes for mac Homebrew
Add some fixes for building on macOS Homebrew.

- Set ZLIB_ROOT because zlib is now keg-only. Unfortunately the cmake
  warning about policy CMP0074 cannot be suppressed because of some kind
  of cmake bug.

- Update FindFFmpeg.cmake from:
  https://github.com/snikulov/cmake-modules/blob/master/FindFFmpeg.cmake
  , this fixes a problem with FFmpeg not being found.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2023-05-07 23:41:51 +00:00
Fabrice de Gans 5aa3ea92b9 Properly initialize wxAcceleratorTable
The `wxAcceleratorTable` for the `GameArea` panel was initialized with an
array of `wxAcceleratorEntryUnicode`, while the API calls for an array
of `wxAcceleratorEntry`. This resulted in the array not being properly
interpreted by the `wxAcceleratorEntry`. This fixes the issue by using
`wxAcceleratorEntry` to instantiate the array.
2023-04-24 18:04:43 -07:00
Fabrice de Gans 7b5d4a82d7 Remove unused code and use explicit type coercions 2023-04-24 18:04:32 -07:00
Fabrice de Gans 1f57d5f797 Remove global variables for ROM data
These can be accessed via the global gbCartData object. In addition,
this cleans up gbMemory to remove dead code that was used as a
workaround for ROM hacks.
2023-04-24 13:52:12 -07:00
Fabrice de Gans 0e29be8735 Support multiple RAM sizes for MBC7
We rely on the rom size in the cartridge header as a proxy for the RAM
size. Only 3 cartridges exist that use MBC7, Korokoro Kirby / Kirby
Tilt'n'Rumble and Command Master. Both versions of Kirby use a 256 bytes
EEPROM while Command Master uses a 512 bytes EEPROM. There does not seem
to be any other way to reliably get the EEPROM size for MBC7 cartridges.
2023-04-17 17:07:18 -07:00
Fabrice de Gans 75b79d91f1 Change MBC7 reported RAM size to 512 bytes
Some MBC7 cartridges use 512 bytes EEPROM rather than 256 bytes. For
compatibility with older versions, we keep saving and loading 256 bytes
of EEPROM for every MBC7 cartridge. TODOs have been left to figure out
how to identify the EEPROM capacity properly.
2023-04-17 17:07:18 -07:00
Fabrice de Gans 52c05c7147 Simplify battery save / load
* Removes all of the per-mapper helper functions in favor of an
  iovec-like structure that is set on ROM load and ROM patch.
* Changes the MBC7 RAM size to 256 bytes, which is what the cart
  actually uses.
* Works around issues with homebrews by overriding some of the header
  data. For instance, battery is disabled if a cart specifies a battery
  but no RAM and no RTC.

Test: This was tested with every known RTC/RAM/Battery variations by
creating a battery file before these changes and checking that the
battery file is still loaded properly with these changes applied. The
reverse was also tested to ensure compatibility.
2023-04-17 17:07:18 -07:00
Fabrice de Gans d8d6991c4b Refactor the save/load state and battery code
* Simplifies most of the GB save/load state code and changes many
  of the global variable uses to go through gbCartData instead.
* Changes all battery reads to use gzFiles. This seems to have been an
  oversight in an earlier refactor of the code.
* Removes some unused variables and stops exporting internal-only
  functions in GB.cpp/gb.h.

Breaking change: Cartridges with no mapper, but a save battery should
now properly save and load changes. However, this type of cartridge has
not been used in any commercially released software for Game Boy so the
exact intended behavior is speculative.
2023-04-17 17:07:18 -07:00