Commit Graph

3015 Commits

Author SHA1 Message Date
invertego 9fbbea23d3 nall: always pass by reference to make_string()
Many specializations of stringify store a reference to the wrapped
value. Therefore, passing arguments to make_string() by value can be
disastrous if the compiler does not perform copy elision and stringify
stores a reference to a variable that goes out of scope when
make_string() returns.

Cherry-picked from ares commit 3d826f5b266027529f0c12211c744a23bbe25a56.
2024-09-05 15:21:21 +10:00
Tim Allen df4981787c Use a non-deprecated version of upload-artifact. 2024-09-04 21:11:17 +10:00
dependabot[bot] 4adbcdc017 Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-04 18:17:36 +10:00
Tim Allen 0fd8f56a6e Fix a crash in heuristic memory mapping.
Commit 712ed9b6b0 changed the way that the Sufami
Turbo base cartridge was detected, but it caused crashes. Apparently the way we
were converting the binary ROM data to a string for comparison, was actually
calling the wrong `string` constructor. Let's more explicitly create a
string_view instead of hoping for the compiler to pick a suitable constructor
chain.
2024-09-01 18:12:38 +10:00
Tim Allen 712ed9b6b0 Fix detection of the Sufami Turbo base cartridge.
The Sufami Turbo base cartridge is listed in the Super Famicom verified dump
database, so it did not use the heuristics. It turns out the heuristic detection
wouldn't have worked anyway - although the game's header does contain the serial
A9PJ, the heuristic revision() method does not report that serial at all.

Meanwhile, the serial A9PJ is *also* used by the game Bishoujo Senshi Sailor
Moon SuperS - Fuwafuwa Panic, so loading this game would prompt for Sufami Turbo
mini-cartridges even though the game could not make use of them.

Fixes #323
2024-08-30 13:25:22 +10:00
Morilli 79770f6207 implementation of SA-1 BW-RAM protection
Manually cherry-picked ares commit 70f361094b.

Co-Authored-By: absindx <59403574+absindx@users.noreply.github.com>
2024-03-02 00:26:03 +11:00
Morilli ccbe394e7d wdc65816: emulate (direct,X) wraparound bug in emulation mode
Manually cherry-picked ares commit be8fa76e7d

Co-Authored-By: Adrian Siekierka <kontakt@asie.pl>
2024-03-02 00:24:20 +11:00
Screwtapello 4faca659c1
Remove link to near.sh
The domain expired, and got taken over by spammers.
2024-02-17 14:17:11 +11:00
John Chadwick 40486d61c2 Simplify + update GHA workflow 2023-11-18 22:23:29 +11:00
Tim Allen 9560959fef Don't bother with Cirrus for anything but FreeBSD builds.
Since we have different hosts for different builds, let's try linking to them
directly. I vaguely recall this stopped working at some point, but we'll try
again.
2023-11-13 21:12:18 +11:00
Tim Allen 2b7bc3b08e Build bsnes with GTK+3 on Ubuntu and FreeBSD.
The latest version of Ubuntu no longer provides the GTK+2 libs that bsnes
requires.
2023-11-13 21:12:18 +11:00
Rasim Labibov 3f93cd4393 hiro: Force Gtk3 to use X11 backend 2023-11-13 21:12:18 +11:00
Adrian Siekierka dab534b658 wdc65816: fix PLB wrapping in emulation mode (#1277)
>Regarding PLB, it looks like it reads from $200 and snes9x, mesen,
bsnes, and the official CPU manual all got it wrong.

Reproduced and verified on real hardware via
https://github.com/gilyon/snes-tests
2023-10-31 17:48:07 +11:00
deadmeu 55925d9149 Update desktop entry comment field 2023-09-16 18:51:38 +10:00
Rupert Carmichael e3fcc35922 libretro: Correctly apply filters for subsystems 2023-08-07 11:35:28 +10:00
Rupert Carmichael 18afbc3770 libretro: Support blargg's NTSC filter 2023-08-06 17:10:35 +10:00
Tim Allen ea05fa0c3e CI: Update the 'nightly' tag along with the release. 2023-06-28 20:41:55 +10:00
Tim Allen 7ec3077079 Revert "nall: Add needed #include <stdexcept>"
This reverts commit e658f50da2.

bsnes' compatibility with GCC 13 was already fixed in a different way in
5cefce5c08.
2023-06-10 19:22:40 +10:00
Tim Allen e658f50da2 nall: Add needed #include <stdexcept>
Taken from ares commit 6a7898396a14eef257e63cd002fb26ffbf6e2581

Apparently this is needed by GCC 13.
2023-06-08 22:01:59 +10:00
Tim Allen 3ca0504e67 Extend the Super Famicom LOROM-RAM#A memory map.
Although Nintendo made many different cartridge circuit boards with different
memory mappings, ROMs do not indicate which specific board they are intended
to work with. Super Famicom emulators traditionally group mutually-compatible
mappings together and use heuristics to guess which family of mappings the
game expects.

There's one family of mappings that maps ROM data to the top half ($8000-$FFFF)
of memory banks in the Super Famicom address space. For historical reasons,
this family is called "LoROM" and has three main variants:

1. ROM only, mapped to the top half of every possible bank.
   The boards database calls this "LOROM".
2. ROM mapped to the top half of every possible bank,
   RAM mapped to the bottom half of banks 70-7d,f0-ff.
   The boards database calls this "LOROM-RAM"
3. ROM mapped to the top half of low-numbered banks,
   RAM mapped to both halves of banks 70-7d,f0-ff.
   The boards database calls this "LOROM-RAM#A"

The largest official game that used variant 3 was 1MiB, so a common heuristic
is "if the ROM is 2MiB or less, use variant 3, otherwise use variant 2".
2MiB is used as the threshold instead of 1MiB, perhaps so somebody can expand a
commercial ROM that uses variant 3 without having to rework it to suit a
different mapping.

Since v107 or so, higan (and by extension, bsnes) has implemented variant 3 by
mapping ROM to banks 00-3f,80-bf, which exactly fits a 2MiB ROM. However,
other emulators like Mesen, snes9x and higan v106 implement it by mapping ROM
to banks 00-6f,80-ef, all the space that is left after the RAM is mapped.

This doesn't affect any verified games in the `Super Famicom.bml` database,
since those have specific, accurate memory maps. It also won't affect
well-written games that only read from memory addresses they have populated.
However, homebrew games and ROM hacks that have never existed on a real circuit
board depend on these heuristics across all devices that read Super Famicom
ROMs, including software emulators, flash-carts, and FPGA implementations, so
bsnes should match what other emulators do.

Fixes #278.
2023-05-23 23:26:49 +10:00
orbea 5cefce5c08 nall: Fix the build for gcc13 2023-03-08 17:35:32 +11:00
Tim Allen a22c5c3eeb Cirrus CI: Build macOS binaries on AArch64. 2023-03-08 17:34:58 +11:00
Rupert Carmichael c0c60c83a8 Fix the Justifier 2022-12-11 19:18:39 +11:00
Alcaro 43e42b2dca Simplify sa1 division
Removes the branch and the double modulo

I have verified that it gives the same results for all 2^32 pairs of inputs
2022-11-25 17:26:53 +11:00
Kawa 717606dda9
Update README.md 2022-11-03 13:15:52 +01:00
Benjamin FRANCOIS 6fc6bf14a3 Allow Haiku build of libretro target 2021-10-31 20:39:10 +11:00
Sintendo 74f6ffe89b ruby/input: Add macOS mouse support
While keyboard and joypad input had already been present for some time,
mouse input for macOS remained unimplemented in ruby.

Until now, that is.
2021-10-31 19:36:15 +11:00
Tim Allen 6df1807068 Update SameBoy to v0.14.7. 2021-10-31 09:37:51 +11:00
Lior Halphon 43831d0bc1 Update version to 0.14.7 2021-10-30 16:10:26 +03:00
Lior Halphon 0f6a0186cd Cherry picking conflicts 2021-10-30 16:09:13 +03:00
Lior Halphon deb037d87d Detect missing ANSI support on Windows 2021-10-30 16:08:35 +03:00
Lior Halphon 4498d16bed Improved sanitation for save states for better security and stability 2021-10-30 16:08:35 +03:00
Lior Halphon 8d319c65c2 Use a monospaced font in the palette viewer 2021-10-30 16:08:35 +03:00
Snowy 0d7cc66ffd Change y to a signed value 2021-10-30 16:08:35 +03:00
Lior Halphon 0dcd233cbb Writes to SVBK should work before the boot ROM is disabled 2021-10-30 16:08:35 +03:00
Lior Halphon 5808d4485f Drop BOOLs 2021-10-23 13:36:58 +03:00
Lior Halphon fc10a90dec Screenshots in the Cocoa frontend 2021-10-23 13:26:44 +03:00
Lior Halphon 3f954f1d0c Update version 2021-10-20 23:37:16 +03:00
Lior Halphon 0e6b9da42d Merge branch 'master' of https://github.com/LIJI32/SameBoy 2021-10-20 23:36:48 +03:00
Lior Halphon 1376c386a2 Slightly altered merge of #408 2021-10-20 21:49:02 +03:00
Lior Halphon 2f2e469790
Merge pull request #407 from SnowyMouse/master
Handle missing background.bmp
2021-10-20 20:34:13 +03:00
Lior Halphon e04dcd90d6 Fix APU command 2021-10-19 01:56:10 +03:00
Lior Halphon 94776fcf8c Better (But imperfect) emulation of the wave RAM address bug glitch 2021-10-19 01:53:24 +03:00
Lior Halphon de16ab5d08 Why was this under APU 2021-10-17 20:05:49 +03:00
Lior Halphon 886363b398 Now this glitch makes more sense 2021-10-17 12:52:08 +03:00
Lior Halphon 7ef198ec50 More accurate channel 3 restarts 2021-10-17 02:06:33 +03:00
Lior Halphon f1b8164613 Force the user selected model on reset (which can change by a save state) 2021-10-17 02:06:13 +03:00
Lior Halphon 40fc477b56 Fix an oopsie 2021-10-10 20:05:57 +03:00
Lior Halphon 4ce643d5eb Fix timer bug; fixes #409 2021-10-10 16:53:07 +03:00
Lior Halphon 01f80a3f3e Adjust border fade delay to match SGB2 2021-10-10 14:24:14 +03:00