4082 Commits

Author SHA1 Message Date
Lior Halphon
1b50856dcf More of the same 2023-06-21 21:49:23 +03:00
Lior Halphon
207851bc56 Merge branch 'master' of github.com:LIJI32/SameBoy 2023-06-21 21:47:45 +03:00
Lior Halphon
57b50cab63 Work around bad Clang and GCC optimizations of inline compile-time consts (They can't be static before C23, which isn't supported by Clang) 2023-06-21 21:47:30 +03:00
Lior Halphon
16294baa05 Merge pull request #549 from nununoisy/master
Library access to raw APU channel volumes
2023-06-20 20:58:35 +03:00
Noah Sweilem
074d152a4e Formatting fixes 2023-06-20 10:28:18 -07:00
Noah Sweilem
dad9e4b704 Formatting fixes 2023-06-20 10:28:01 -07:00
Noah Sweilem
9148b26bd8 Move edge_triggered variables into gb->apu_output 2023-06-20 10:25:25 -07:00
Noah Sweilem
4213524286 Fix swapped wave channel volume 2023-06-16 19:04:12 -07:00
Noah Sweilem
ae855d470d Use different sample index for square channel edge trigger depending on duty cycle 2023-06-11 16:23:26 -07:00
Noah Sweilem
ec9536eede Try a modified edge trigger detection for pulse and wave channels 2023-06-11 15:44:28 -07:00
Noah Sweilem
7bdf8dbe47 Add initial edge trigger detection method
- GB_get_channel_edge_triggered()
2023-06-11 15:27:31 -07:00
Noah Sweilem
5c7b1f01a3 Add som APU query methods for libsameboy
- GB_get_channel_volume()
- GB_get_channel_amplitude()
- GB_get_channel_period()
- GB_get_apu_wave_table()
2023-06-10 14:23:15 -07:00
Lior Halphon
951d0b07f0 Give sliders the same treatment 2023-06-10 13:35:21 +03: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
Lior Halphon
de9fc76a2c Make most preferences controls codeless 2023-06-10 01:10:06 +03:00
Lior Halphon
d61e5f248d Drop the direct use of NSNotificationCenter for most preferences 2023-06-09 17:42:31 +03:00
Lior Halphon
daf713132b ivar naming in Document.m 2023-06-09 16:28:58 +03:00
Lior Halphon
fef175dcc6 Use #pragma once for include guards, use #import exclusively on Obj-C files 2023-06-09 14:44:57 +03: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
Lior Halphon
bed26daf73 Allow disabling SameBoy features when compiling as a library. Probably introduces some speed improvements to the Libretro core, as well as bsnes and BizHawk 2023-06-03 22:37:42 +03:00
Lior Halphon
d62132be38 These should be in defs.h 2023-06-03 21:54:01 +03:00
Lior Halphon
ee9b6c1444 Maybe this will fix it 2023-06-03 14:58:19 +03:00
Lior Halphon
406189b79e I don't know yaml 2023-06-03 14:54:24 +03:00
Lior Halphon
6eb42ab283 Also upload lib/ and include/ 2023-06-03 14:49:32 +03:00
Lior Halphon
be171cfe66 Add a library target, complete with headers that strip implementation details out. 2023-06-03 14:39:21 +03: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
Lior Halphon
4254dcdb2c Fix incorrect initial value of register IE when playing GBS files. Fixes #544 2023-05-12 17:57:20 +03:00
Lior Halphon
b8d6bb7fd2 Automatic detection of -Oz support 2023-05-11 01:42:46 +03:00
Lior Halphon
c234111024 GCC doesn't support Oz, only Os 2023-05-11 00:31:59 +03:00
Lior Halphon
996ebaafa3 Use Oz for the frontend files, reduce some aggressive loop unrolling 2023-05-11 00:08:54 +03:00
Lior Halphon
96e337edac Automatic key mappings for wired Switch controllers 2023-05-10 20:55:13 +03:00
Lior Halphon
40b7e25126 Accurate emulation of SVBK, fixes audio in Flyeyes (unlicensed game) 2023-05-10 00:55:04 +03:00
Lior Halphon
06621d1dfe Fix GB_debugger_break on builds without the debugger 2023-05-10 00:54:34 +03:00
Lior Halphon
3e3ac23432 More likely/unlikely fun 2023-04-25 13:35:25 +03:00
Lior Halphon
c6e187a80b Enable fast math 2023-04-25 13:08:34 +03:00
Lior Halphon
32a419ad2e Do not inline the slow path of frequently called functions 2023-04-25 13:08:19 +03:00
Lior Halphon
237e127b36 Add a comment 2023-04-11 12:37:13 +03:00
Lior Halphon
4421dedbb9 One last attempt 2023-04-11 12:33:10 +03:00
Lior Halphon
479c16e698 Try a better hint 2023-04-11 12:30:05 +03:00
Lior Halphon
aaba172c02 This might hint GCC 9 and make it suck less 2023-04-11 12:23:50 +03:00
Lior Halphon
5b37d3c402 Add a debugger reset command, with a frontend-handled reload option. Closes #537 2023-04-11 12:02:32 +03:00
Lior Halphon
9a5aa6b5c8 Replace Ubuntu 18.04 with 20.04 (while keeping ubuntu-latest) 2023-04-11 11:14:53 +03:00
Lior Halphon
a6de76eb2b Specify the deployment target when compiling NIB files, fixes #531 2023-04-09 21:23:07 +03:00
Lior Halphon
47ce95afb5 Fixed typo that caused the libretro core to crash during link mode. Fixes #534 2023-04-06 10:30:04 +03:00
Lior Halphon
147341a1d4 Add model/revision selection CLI option to the SDL frontend, closes #533 2023-04-05 18:22:28 +03: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
Lior Halphon
7ac920d2be Double speed STAT conflicts 2023-03-05 00:32:24 +02:00
Lior Halphon
502f64e6d7 Remove some old TODOs 2023-03-04 20:34:41 +02:00
Lior Halphon
e48eb3515d More double speed write conflict updates 2023-02-28 01:00:57 +02:00