Compare commits

...

2997 Commits
v110 ... master

Author SHA1 Message Date
Tim Allen
385b34933d Remove GTK+2 support.
Although it had HIRO_GTK==3 sections, hiro/gtk/monitor.cpp was actually using
deprecated GTK+2 APIs on GTK3, and the GTK3 code was broken and wouldn't
compile.
2025-09-03 19:31:42 +10:00
John Chadwick
22a2e0a165 Add FreeBSD build to GitHub Actions 2025-09-02 18:13:34 +10:00
John Chadwick
9716212d70 hiro/qt: HexEdit: Match scroll logic with ares
I didn't realize that some of the Qt deprecations were already fixed in
ares. In this case, the change was handled a bit differently, always
considering the y component of scrolling even when the scroll operation
is mostly horizontal. This should work just fine, so we may as well just
adopt that behavior, especially since bsnes doesn't even currently use a
HexEdit.

Backported from ares from:
ffe97222a1

Co-authored-by: Stefan Schlosser <bsdcode@disroot.org>
2025-09-02 18:09:42 +10:00
John Chadwick
27fdd39e5c hiro/qt: Fix missing overrides
There are a handful of spots in hiro/qt where methods override Qt
virtual methods, but they are not declared as such.

These are backported from ares from:
960d8a8dcb

Co-authored-by: Near <77224854+near-san@users.noreply.github.com>
2025-09-02 18:09:42 +10:00
John Chadwick
b3ce74253e hiro/qt: Explicitly use nall string in call to Font::size
This is back-ported from ares:
0d131bf4d8

Co-authored-by: invertego <invertego@users.noreply.github.com>
2025-09-02 18:09:42 +10:00
John Chadwick
64a433a644 hiro/qt: Fix incorrect argument to nall::image::scale
The `linear` parameter to `image::scale` is a boolean, not an
enumeration.

This is a back port from ares:
960d8a8dcb

Also, remove the blob of commented code. This was removed in ares v117.

Co-authored-by: Near <77224854+near-san@users.noreply.github.com>
2025-09-02 18:09:42 +10:00
John Chadwick
d3a3280f90 hiro/qt: Silence missing override warning in Clang for moc code
With Qt 6 maybe it is possible to finally start cleaning that issue up
in the first place, but for now it's probably better for bsnes and ares
to align closer.

This is backported from the following ares commits:
0d131bf4d8
960d8a8dcb

Co-authored-by: Near <77224854+near-san@users.noreply.github.com>
Co-authored-by: invertego <invertego@users.noreply.github.com>
2025-09-02 18:09:42 +10:00
John Chadwick
924fa315dc hiro/qt: Unify Monitor implementation with ares
Some of the work I'd done was duplicating existing work. Let's unify to
get the best of both works.

This mostly comes from:
ffe97222a1

Co-authored-by: Stefan Schlosser <bsdcode@disroot.org>
2025-09-02 18:09:42 +10:00
John Chadwick
50ac621430 hiro/qt: Better fix for QFontMetrics::width deprecation
The desired size was probably the boundingRect width and not the advance
width, so the fix from bsdcode is better than mine.

This is backported from ares:
ffe97222a1

Co-authored-by: Stefan Schlosser <bsdcode@disroot.org>
2025-09-02 18:09:42 +10:00
John Chadwick
b424c4b2f7 hiro/qt: Fixes in Application::initialize
- Call XInitThreads at initialization
- Remove spaces from screensaver window name
- Restore LC_NUMERIC after Qt clobbers it

This is sourced from ares v116r07, and:
6cd4470562

Co-authored-by: Near <77224854+near-san@users.noreply.github.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2025-09-02 18:09:42 +10:00
John Chadwick
ad259a55c0 hiro/qt: Silence xdg-screensaver output
Co-authored-by: Near <77224854+near-san@users.noreply.github.com>
2025-09-02 18:09:42 +10:00
John Chadwick
f83bc75270 hiro/qt: Add #if guards to X11 code
This is a backport from ares:
b85395fe7b

Co-authored-by: invertego <invertego@users.noreply.github.com>
2025-09-02 18:09:42 +10:00
John Chadwick
ec8aed3f3b hiro/qt: Add support for compiling with Qt 6 2025-09-02 18:02:58 +10:00
Tim Allen
b7678f5261 hiro/gtk: Remove pendingEvents here too.
Now that pApplication::pendingEvents() has been removed from hiro/core, it
should be removed from the GTK+ backend too.
2025-09-02 01:13:17 +10:00
John Chadwick
08e6de3186 hiro/qt: Remove pendingEvents, add timeout to processEvents
Qt 6 no longer allows us to poll for the status of the event loop.
However, Qt 6 does still have a processEvents function, and the version
with the timeout actually spins the event loop and returns as early as
there are no more events in it. That's basically what we want to do. We
could run this with a really huge timeout, but that would just make it
more likely that hiro freezes up, so instead let's mirror hiro/gtk3 and
use a 50ms timeout.
2025-09-02 01:13:17 +10:00
John Chadwick
aec384b4b0 hiro/core: Remove Application::pendingEvents
This does not seem to be used anywhere in bsnes, higan or ares. It's not
really possible to implement with Qt 6, which has stop exposing this
detail of the event loop. It turns out this is actually OK, since we
don't *really* need it anyway, and in the case of hiro/qt, the
replacement should be more robust anyways.
2025-09-02 01:13:17 +10:00
John Chadwick
253075bfd8 hiro/qt: Use QScreen for Monitor
Qt 5 introduces QScreen, which can be used to implement most of the
functionality needed by Monitor, although some of it probably won't make
sense when using Wayland.
2025-09-02 01:01:04 +10:00
John Chadwick
88de1f11f1 hiro/qt: Fix deprecated QWheelEvent->{delta,orientation}() usage
The orientation() and delta() methods of QWheelEvent were deprecated in
Qt 5.0 in favor of angleDelta(), which expresses higher-fidelity data
for devices like trackpads. In order to keep the behavior 100%
identical, the code used to calculate the orientation() and delta()
values in Qt 5.15 is inlined instead. That logic can be seen here:

https://github.com/qt/qtbase/blob/v5.15.17-lts-lgpl/src/gui/kernel/qevent.cpp#L876-L884

Following this logic, we also break the tie for orientation in favor of
vertical scrolling.

Since there is no actual HexEdit usage in bsnes, I tested it by putting
a dummy HexEdit widget inside the bsnes Presentation window. Scrolling
seemed to work as expected.
2025-09-02 00:52:37 +10:00
John Chadwick
a4f0b478ea hiro/qt: QPalette::Background -> QPalette::Window 2025-09-02 00:36:36 +10:00
John Chadwick
a6db3d6013 hiro/qt: QLayout::setMargin -> QLayout::setContentsMargins
setMargin has been obsolete since Qt 4.3!
2025-09-02 00:36:36 +10:00
John Chadwick
fb09f52093 hiro/qt: QFontMetrics::width -> QFontMetrics::horizontalAdvance
QFontMetrics::width was deprecated in Qt 5.11 in favor of Qt
QFontMetrics::horizontalAdvance. Because QFontMetrics::horizontalAdvance
was introduced in Qt 5.11, it poses the most risk of breaking an
existing user of almost any of the deprecation changes, but Qt 5.11 is
fairly old by now (2018) and has been EOL for a while, so I still opted
to just move to the new function rather than use a version guard.
2025-09-02 00:36:36 +10:00
John Chadwick
58694a2935 hiro/qt: Update deprecated MidButton enumeration
This enum was deprecated in Qt 4.8 and removed in Qt 6.0.
2025-09-02 00:36:36 +10:00
John Chadwick
f05dd784fd Use QScreen for Desktop::{size,workspace}
Qt 5.0 adds the QScreen API, which exposes enough information that
Desktop::{size,workspace} no longer needs to fall back to Win32/Xlib. I
manually tested that this seems to give the same exact answers as the
Xlib path (though it technically goes a different route for
Desktop::size.)
2025-08-31 01:48:26 +10:00
John Chadwick
8011051eea Remove Qt 4 support.
Qt 4.8 LTS was released on December 15th, 2011. It hit its official
end-of-life on December 31st, 2015. It has been dead for nearly 10
years. Qt 4 is now so old, that it has been removed from Debian long
enough that "qt4" doesn't show up in *any* of the indexed package suites
in Debian's online package search service.

With that in mind, I think we can safely say nobody is using this,
nobody will miss this, and it is beyond time to get rid of it (and
probably add Qt 6 support some day.)
2025-08-31 01:31:10 +10:00
Tim Allen
2e2440fe74 Update bsnes' SameBoy integration for the new version.
Hat tip to @alice-mkh for figuring out how to update bsnes' integration.
2025-08-31 00:58:11 +10:00
Tim Allen
85ca044ba5 Bump SameBoy version in the About dialog. 2025-08-31 00:31:27 +10:00
Tim Allen
052980f63f Update SameBoy subtree to v1.0.2. 2025-08-31 00:29:18 +10:00
Alice Mikhaylenko
b8dcfcd59d system: Use strict serialization method for ICD
Backport of 7d8dbd723c

Otherwise SGB savestates sometimes corrupted, see https://gitlab.com/jgemu/bsnes/-/issues/7
2025-08-31 00:20:26 +10:00
Lior Halphon
5b88346537 Work around an MSVCRT limitation, fixes cheat import on SDL Windows, fixes #716 2025-08-03 16:54:04 +03:00
Lior Halphon
20e5e18122 Update version to v1.0.2 2025-08-01 00:49:49 +03:00
Lior Halphon
b948a1f3fd Fix Solarium beta 4 regressions 2025-08-01 00:49:41 +03:00
Lior Halphon
8215c03d62 Update assets.car, screw this format 2025-07-29 22:49:27 +03:00
Lior Halphon
8b2af8adf1 Replace non-car iOS icons with the correct versions 2025-07-27 19:09:35 +03:00
Lior Halphon
00f772b29d Merge branch 'master' of github.com:LIJI32/SameBoy 2025-07-27 13:23:58 +03:00
Lior Halphon
4107198548 Merge pull request #715 from MaddTheSane/patch-2
Update GBViewController.m
2025-07-27 12:26:34 +03:00
C.W. Betts
e997ce0ce7 Update GBViewController.m
-[GBViewController didRotateFromInterfaceOrientation:] seems to want [super ...] called to it.
2025-07-26 23:14:45 -06:00
Lior Halphon
58c946f249 Fix accelerometer auto-rotating on iOS 16 and newer 2025-07-27 03:10:17 +03:00
Lior Halphon
0b57886491 Add an icon to hotswap 2025-07-23 23:42:34 +03:00
Lior Halphon
2db60c2b3f Add the missing camera entitlement even on unnotarized releases that don't use the hardened runtime 2025-07-23 23:42:19 +03:00
Lior Halphon
f54bfae01f Make headers a target 2025-07-23 00:18:51 +03:00
Lior Halphon
c40221abb6 Allow using the DISABLE_* flags when building specific subsets of the lib target 2025-07-22 23:32:00 +03:00
Lior Halphon
eb38034b76 Ask for confirmation before reset 2025-07-22 00:10:19 +03:00
Lior Halphon
c6a968ed74 Make sure to display an alert if saving a state failed 2025-07-22 00:03:37 +03:00
Lior Halphon
e69f6b8579 Bug fix: GB_save_state always returned success 2025-07-21 23:53:54 +03:00
Lior Halphon
cfbc7b481a An attempt to mitigate #703, don't reload the ROM or save states if not required; don't assume a new ROM if state failed to load 2025-07-21 23:45:06 +03:00
Lior Halphon
1dfcdffa71 Properly handled Inbox and Boot ROMs in GBROMManager 2025-07-20 22:44:09 +03:00
Lior Halphon
5b983bc7ad Minor optimization 2025-07-20 21:58:36 +03:00
Lior Halphon
634b90e4fc Fix rounding errors in calls to band_limited_update, tweak BL synth parameters. Should greatly improve audio quality, fixes #713 2025-07-18 13:53:02 +03:00
Lior Halphon
b31cca77be Use a sinc filter 2025-07-18 13:32:25 +03:00
Tim Allen
ddc3dc2d47 Make the About dialog link to a website that exists.
The registration for bsnes.dev has lapsed a long time ago, the GitHub repo is
effectively the website now.

Fixes #354
2025-07-13 16:48:43 +10:00
Lior Halphon
5b17b41e07 Escape translocation on launch so we can update ourselves. 2025-07-12 04:16:31 +03:00
Lior Halphon
239e0462c3 Use proper hooks 2025-07-12 01:25:40 +03:00
Lior Halphon
8505f00cdf Fix BL-synth master wave generation, that wasn't a square step... affects #713 2025-07-12 01:17:47 +03:00
Lior Halphon
08d58aa992 Fix a bug where controller-triggered rewind doesn't resume after reaching the buffer end 2025-07-11 23:14:03 +03:00
Lior Halphon
8cce6f7b13 Another macOS Regressionville™ bugfix 2025-07-11 18:19:19 +03:00
Lior Halphon
ec8baa6329 Allow specifying a custom ibtool path 2025-07-11 18:03:36 +03:00
Lior Halphon
9bd84978cf Work around more Solarium bugs 2025-07-11 17:59:32 +03:00
Lior Halphon
aa0fe30d5c Don't update the icon after an update on macOS 26, it's broken 2025-07-11 17:59:13 +03:00
Lior Halphon
6d6aafe887 Fix scrolling view in newer macOS versions 2025-07-11 14:46:16 +03:00
Lior Halphon
003e8914b1 Merge pull request #711 from MaddTheSane/patch-2
Update GBViewController.m
2025-07-08 00:06:08 +03:00
Lior Halphon
d7e1672ae7 Always define typeof to __typeof__, unless targeting C23. Fixes #710 2025-07-08 00:04:07 +03:00
C.W. Betts
1157ff0f36 Update GBViewController.m
Use CGDataProviderCreateWithCFData instead of CGDataProviderCreateWithData.
2025-07-07 13:52:02 -06:00
Lior Halphon
bdd4522ca9 Migrate the Windows build from GNUWin to Git Bash and ezwinports's Make 2025-07-07 22:34:45 +03:00
Lior Halphon
4abb5f3539 Fix AGB mixing – the bias should only be applied if the channel is connected to a terminal 2025-07-05 16:37:48 +03:00
Morilli
764b5e2d16 rename variables for consistency with existing code 2025-07-05 20:20:28 +10:00
Morilli
9b85864259 bump SerializerVersion 2025-07-05 20:20:28 +10:00
Morilli
ed21294992 implement additional latch logic
fixes tests 06, 07, 08, 09, 13... mostly at least
2025-07-05 20:20:28 +10:00
Morilli
420146929c re-fix test 14
"clear-autojoy-after-autojoy-active" failed on the previous commit but worked before. Implementing this is clearly required to be accurate
2025-07-05 20:20:28 +10:00
Morilli
c84914ac83 fix spellcraft
broke in previous commit probably by random chance; this is probably more correct anyways
2025-07-05 20:20:28 +10:00
Morilli
b53bf3d178 improve autojoypad timing
auto-joypad test changes:
fixes 01, 05, 10, 12, 14

still bad: 06, 08, 09

improved: 07, 13
2025-07-05 20:20:28 +10:00
Lior Halphon
aff7f1706c Add turbo cap options to the core and frontends, improve frame skipping, replace iOS' turbo speed option with the new turbo cap. Addresses #708. 2025-07-04 14:41:34 +03:00
Morilli
20ddad606f fix bg mode 4 in accurate ppu 2025-07-04 18:54:23 +10:00
Lior Halphon
33d237706e Merge pull request #709 from joshrad-dev/master
Add ability to save to photos on iOS
2025-06-29 23:05:20 +03:00
Lior Halphon
a39efd31cf Change the default macOS palette to be the same as the other frontends 2025-06-29 22:42:45 +03:00
Lior Halphon
69bb4c3e95 Fix various iPadOS bugs 2025-06-29 20:17:05 +03:00
Lior Halphon
ae2d68aaf3 iPad menu support 2025-06-29 18:48:47 +03:00
Lior Halphon
e381ebd1ea Refine the tip animation 2025-06-28 21:29:26 +03:00
Lior Halphon
34c29b052e UI fixes in the cheats screen 2025-06-28 20:55:30 +03:00
Lior Halphon
4ebb108ae1 Fix it harder, remove UIGlassEffect as it's still very buggy 2025-06-28 15:58:39 +03:00
Lior Halphon
d1da91da7c Fix tip rotation 2025-06-28 15:46:02 +03:00
Lior Halphon
490d63b26f Fix build break 2025-06-28 15:44:16 +03:00
Lior Halphon
be63d7eaa3 Revert this hack, broken on iPhones. Maybe Apple will fix this regression eventually (lulz no) 2025-06-28 15:13:05 +03:00
Lior Halphon
15588a065f Fixed a bug where ROMs were moved instead of copied and vice versa, fixes #701 2025-06-28 15:04:14 +03:00
Lior Halphon
d52a50353d Update the tips visuals 2025-06-28 14:40:42 +03:00
Lior Halphon
5d70f93920 Very basic iPad menu support 2025-06-28 13:58:43 +03:00
Lior Halphon
f3cbc1990e Allow building on older SDKs 2025-06-28 13:06:38 +03:00
Lior Halphon
583c234953 Various iOS Ui improvements, especially on iOS 26 2025-06-28 00:11:46 +03:00
Lior Halphon
3f744254fd Update iOS settings icons, add liquid glass overlay 2025-06-27 17:02:55 +03:00
Lior Halphon
7abedaed4c Fix a bug where cheat search remains open after closing a ROM 2025-06-26 21:36:26 +03:00
Lior Halphon
42ffbd18d0 Fix a bug where a GBS file will not correctly play the first track unless explicitly switching to it. Reloading a GBS file is disabled because it's not supported. 2025-06-26 20:57:47 +03:00
Lior Halphon
8508eb7b7c Fix Mavericks regressions 2025-06-24 22:44:39 +03:00
Lior Halphon
00000971d7 Describe addresses correctly in unbanked portions of RAM and ROM 2025-06-24 21:53:18 +03:00
Lior Halphon
58bd40b833 Work around gazillion Solarium bugs 2025-06-24 21:29:58 +03:00
Lior Halphon
cbaf5c4c4a Avoid non-main-thread calls 2025-06-24 21:29:05 +03:00
Lior Halphon
67d338164b Make text field insets work on macOS 26 2025-06-22 23:34:41 +03:00
Jawshoeadan
7bf8145a91 Add save to photos key in info.plist for GB camera pictures 2025-06-21 13:22:31 -07:00
Lior Halphon
e043279500 Update the Cocoa UI to support Solarium (Memory viewer still not updated due to AppKit regression, let's see what the next beta has to say) 2025-06-21 14:50:12 +03:00
Lior Halphon
9d6f378d21 Add Icon Composer based icon for macOS 26 2025-06-13 22:54:10 +03:00
Lior Halphon
bfb1092cbb Fix cheat search crashing on carts without RAM 2025-06-10 01:19:29 +03:00
Lior Halphon
282140822e Fix compatibility issues with macOS 26 NIB loading 2025-06-10 00:22:14 +03:00
Lior Halphon
19a1e3ec1a Add a vsync as an option to SDL, fixes #335 2025-06-08 20:19:09 +03:00
Lior Halphon
1ad8bad18c Add iOS rapid buttons, closes #702 2025-06-08 19:28:42 +03:00
Lior Halphon
9577cbce85 Added the option to force integer scaling to the Cocoa port (SDL had it for ages), closes #699 2025-06-08 11:51:34 +03:00
Lior Halphon
6dd2f609f2 Make the debugger console larger by default, fix misaligned line 2025-06-08 01:43:17 +03:00
Lior Halphon
976fe7a337 The sideview shouldn't automatically scroll 2025-06-08 01:30:17 +03:00
Lior Halphon
1400bd40e8 Slightly alter the behavior of the print command so values don't get zero-padding by default, fixes #687 2025-06-08 01:25:30 +03:00
Lior Halphon
6a97192e8c Slightly refine the last fix 2025-06-07 18:58:31 +03:00
Lior Halphon
42732b20eb Restore Alt+Zoom behavior 2025-06-07 18:49:45 +03:00
Lior Halphon
f0a672c39e Make sure the CPU graph advanced correctly even in turbo mode 2025-06-07 14:24:35 +03:00
Lior Halphon
d211120312 Make 100% CPU frames appear red 2025-06-07 14:11:10 +03:00
Lior Halphon
6ab1be654b Add CPU load graph to Cocoa, closes #654 2025-06-06 23:10:57 +03:00
Lior Halphon
f706988171 Add CPU usage command (#654) 2025-06-06 19:26:25 +03:00
Lior Halphon
bed9f8220c Merge pull request #706 from Estus-Dev/Specify-size-of-block-header's-length-field
Specify size of block header's length field
2025-06-04 20:33:23 +03:00
Estus
750112f6dd docs: specify size of block header's length field 2025-06-04 11:21:48 -06:00
Lior Halphon
63a02d90bc Merge pull request #568 from hitomi-nakayama/warn-sdl-init-error
Warn user about SDL initialization failure
2025-06-02 23:40:54 +03:00
Lior Halphon
795fba1320 Merge branch 'master' into warn-sdl-init-error 2025-06-02 23:40:40 +03:00
Lior Halphon
1923c324d9 Slightly alter iOS behavior 2025-06-02 21:21:39 +03:00
Lior Halphon
6a24b9206f Remove the navigation string since it doesn't fit 2025-06-02 21:21:23 +03:00
Marcus Ziadé
30a8c4bf42 Add Vim menu navigation 2025-05-26 21:46:31 +03:00
Lior Halphon
152e242485 Fixed incorrect processing of GameShark codes 2025-05-26 00:51:16 +03:00
Lior Halphon
c4e6161959 Merge pull request #681 from Jan200101/PR/mime-location
correct mimetype location to follow the shared mime info specification
2025-05-25 12:33:20 +03:00
Jan200101
1951df3476 correct mimetype location to follow the shared mime info specification 2025-04-27 16:16:13 +02:00
Lior Halphon
1cf84a5436 Ubuntu 20.04 is dead soon, replace with 22.04 2025-04-08 20:43:21 +03:00
Lior Halphon
81c29fa371 Make gb.h compatible with ANSI C++, fixes #698 2025-04-08 20:39:12 +03:00
Lior Halphon
8b27952680 Merge pull request #697 from bentley/libdl
Don’t look for libdl on OpenBSD
2025-04-05 13:26:43 +03:00
Anthony J. Bentley
3c58deb46f Don’t look for libdl on OpenBSD 2025-04-05 03:18:25 -06:00
Lior Halphon
0fc08d93be Update copyright to 2025 and version to 1.0.1 2025-04-04 23:58:28 +03:00
Lior Halphon
cd82311c54 Apply auto-resizing also to border mode change 2025-04-04 14:16:54 +03:00
Lior Halphon
bf9212bcff Increase the number of band-limited phases to reduce overtones in high-pitched sounds 2025-04-04 13:27:20 +03:00
Lior Halphon
dfd3b42929 Merge pull request #695 from nik012003/master
Add missing break statements in mbc7 writes
2025-04-04 13:03:35 +03:00
nik012003
18edb65680 Add break statements in mbc7 writes 2025-04-04 02:09:18 +02:00
Lior Halphon
3468d5de7e Probably a better fix 2025-04-04 01:11:27 +03:00
Lior Halphon
d146b3a309 Why do I end up writing these 2025-04-03 23:52:04 +03:00
Lior Halphon
71d4e60c57 Fix several iOS crashes 2025-04-03 23:37:11 +03:00
Lior Halphon
8f21c8ed66 Fixed a bug that caused ROMs to run without a window upon changing an emulated revision 2025-04-02 23:43:27 +03:00
Lior Halphon
3ad28b7a8d Fix old compilers 2025-04-02 00:31:53 +03:00
Lior Halphon
edce971d8c Optimize SGB FM synthesis, downgrade the sample rate of synthesis when rendering at high rates. 2025-04-02 00:27:07 +03:00
Lior Halphon
6d9ab972d0 Allow libretro to output audio for both Game Boys 2025-03-31 00:14:15 +03:00
Lior Halphon
ed7d0546a3 Drop the Unicode character, RA can't display it with some fonts 2025-03-31 00:01:23 +03:00
Lior Halphon
474caaccd5 The relevant RA issue is long fixed by now 2025-03-30 22:12:04 +03:00
Lior Halphon
1d7ecb7f1b ^C before loading a ROM quits again 2025-03-30 19:41:07 +03:00
Lior Halphon
8c30a7c90c Fixed a bug where changing a model does not immediately restart upon exiting the emulation menu 2025-03-30 19:34:24 +03:00
Lior Halphon
2b89923a6f SDL now automatically resizes the window upon loading a ROM if it was not manually resized by the user 2025-03-30 00:52:56 +03:00
Lior Halphon
8a0ff891bd Fix build on Clang 20 2025-03-29 23:04:44 +03:00
Lior Halphon
9359f7a2d9 Fix SGB attribute and tile transfers on BE platforms, fixes #693 2025-03-29 19:12:35 +03:00
Lior Halphon
f1d52c53d3 Allow using joysticks as faux analog controllers 2025-03-29 14:52:01 +03:00
Lior Halphon
9096f629c9 Fix double ^C quit on non-Windows SDL builds 2025-03-28 13:11:26 +03:00
Lior Halphon
d50f9df974 Reset while being paused in SDL now unpauses 2025-03-28 13:11:04 +03:00
Lior Halphon
15215000f9 Major improvements to the SDL debugging interface, especially on Windows
1. No more separate EXE for the debugger version, the console can be freely opened at any time with ^C, and closed freely without terminating the emulator
2. On all platforms, the SDL emulator window is no longer unresponsive while the debugger is waiting for an input
3. Pressing keys in the emulator window while the debugger is waiting for inputs will trigger a terminal bell
4. Async debugging now supports Windows 7, 8.x, and earlier builds of Windows 10
2025-03-27 23:45:51 +02:00
Lior Halphon
4e35048f46 Make it possible to build SameBoy for Windows while linking against Windows' msvct.dll 2025-03-23 23:18:17 +02:00
Lior Halphon
e2b22a0df6 Make it possible to disable rounded corners on Windows 11 2025-03-23 21:34:05 +02:00
Lior Halphon
9c958a1cb4 More accurate OAM randomization 2025-03-21 22:52:55 +02:00
Lior Halphon
3cb04e88d1 Remove HH integration 2025-03-15 13:22:55 +02:00
Lior Halphon
917b62785c The watchpoint command now outputs the watchpoint type upon adding one 2025-03-15 12:56:51 +02:00
Lior Halphon
7b511dd76b Document rPGB 2025-03-15 12:56:51 +02:00
Lior Halphon
04cd94de3f Delegate audio downsampling to the libretro frontend, except on the Wii U. Fixes #677. 2025-03-15 12:56:51 +02:00
Lior Halphon
da0380c32d Fix libretro boot ROM building 2025-03-15 12:56:51 +02:00
Lior Halphon
e76088cde2 I need somebody to love me as much as GitHub loves deprecating upload-artifacts majors 2025-03-15 12:56:51 +02:00
Jan200101
abf108f6b8 add missing include for toupper and isxdigit 2025-03-15 12:56:51 +02:00
Jan200101
fab91444dd strip thumbnailer on release builds, don't strip on install 2025-03-15 12:56:51 +02:00
Lior Halphon
9442a2a8e8 Fix CI, fix library building 2025-03-15 12:56:51 +02:00
Lior Halphon
9793e15f4d Fix the vertical layout being broken on certain iPad resolutions. Minor improvements to other iPad layouts. Fixes #678 2025-03-15 12:56:51 +02:00
Rangi42
670540116a Use ldh [c], not ld [c] 2025-03-15 12:56:51 +02:00
Lior Halphon
1354b77373 Oops 2025-03-15 12:56:51 +02:00
Lior Halphon
63e081e9c2 Fix the Pink Pop theme, it had mismatching colors and settings 2025-03-15 12:56:51 +02:00
Lior Halphon
4d28af4fcf Make palettes upgradable in the Cocoa frontend, fixes #672. Slightly improve palette editor UI. 2025-03-15 12:56:51 +02:00
Lior Halphon
a659de9960 Update Makefile to support BSD's install, fixes #671 2025-03-15 12:56:51 +02:00
Lior Halphon
d6b7157a0c Update version to 1.0 2025-03-15 12:56:51 +02:00
Lior Halphon
48cc359f0c Fix Windows build 2025-03-15 12:56:51 +02:00
Lior Halphon
6549684e1f Make libsameboy installable, including pkg-config support. Closes #662 2025-03-15 12:56:51 +02:00
Lior Halphon
150855f2e9 Sync with the App Store branch 2025-03-15 12:56:51 +02:00
Lior Halphon
215a690e92 Don't display this warning on MBC2/7 games 2025-03-15 12:56:51 +02:00
Lior Halphon
1d5cb77464 Fix bugs that degraded Quick Look quality 2025-03-15 12:56:51 +02:00
Lior Halphon
b5761c29d5 Fix missing resolutions 2025-03-15 12:56:51 +02:00
Lior Halphon
7994869b1f Minor fixes and oopsies 2025-03-15 12:56:51 +02:00
Lior Halphon
ac54d5b7ec Update Quick Look to support macOS 15 2025-03-15 12:56:51 +02:00
Lior Halphon
9df4f22873 Fix Quick Look 2025-03-15 12:56:51 +02:00
Lior Halphon
d049dfe983 Allow changing the debugger input field's font and size 2025-03-15 12:56:51 +02:00
Lior Halphon
4c904d11ff Handle single-color OBP values better in the object viewer 2025-03-15 12:56:51 +02:00
Lior Halphon
aa5fc484d1 Fix m3_lcdc_obj_en_change_variant.gb 2025-03-15 12:56:51 +02:00
Lior Halphon
849ae42b99 Fix m3_scx_high_5_bits on DMG 2025-03-15 12:56:51 +02:00
Lior Halphon
fe72561a8f Oops, 1.0 isn't ready for release yet 2025-03-15 12:56:31 +02:00
Lior Halphon
e5950aa4ef Fix it harder 2024-12-01 19:17:36 +02:00
Lior Halphon
5180e8e03b Fix Linux so builds 2024-12-01 19:06:35 +02:00
Lior Halphon
67dee21804 Fix typos, remove broken and unused macro 2024-12-01 18:58:23 +02:00
Lior Halphon
007d3b2555 Allow building libsameboy as a dynamic lib 2024-12-01 18:57:47 +02:00
Lior Halphon
9ff3bffddd Fix thread assertion in GB_set_sample_rate, should make GB_set_clock_multiplier thread-safe. Fix missing memset. 2024-11-30 00:10:46 +02:00
Lior Halphon
12859683b7 Missing super calls 2024-11-30 00:10:01 +02:00
Lior Halphon
27a064caff Make GB_serial_set_data_bit a bit more thread safe 2024-11-24 20:58:12 +02:00
Lior Halphon
b4fc2ff7ba Move things around some more 2024-11-24 14:36:12 +02:00
Lior Halphon
fe2c868d6c Fix iOS 11/12 builds 2024-11-23 21:03:34 +02:00
Lior Halphon
150f0fcad4 Add a fourth, virtual zoom factor for triple camera iPhones that have a large difference between their zoom factors. Closes #663 2024-11-23 20:55:44 +02:00
Lior Halphon
a39b1913b8 Much thread, very safety 2024-11-23 16:23:08 +02:00
Lior Halphon
1ab690ba18 Dead code 2024-11-23 15:47:06 +02:00
Lior Halphon
c3d83eae22 Missing assertion in GB_safe_read_memory 2024-11-23 15:45:54 +02:00
Lior Halphon
117da602ca Prevent the rewind buffer from being reset unexpectedly on iOS 2024-11-23 13:54:50 +02:00
Lior Halphon
a0c5b6f97a Various optimizations 2024-11-23 00:16:42 +02:00
Lior Halphon
7e071e463d Improve band-limited synth 2024-11-21 21:12:30 +02:00
Lior Halphon
ad2360b5c3 Fix tester and Xdg thumbnailer build 2024-11-21 20:24:20 +02:00
Lior Halphon
ee3f37b39c Fix button colors in some themes 2024-11-21 19:54:45 +02:00
Lior Halphon
ebfc877c1c Fixed a bug that resulted in crashes if the ROM list changed while the library was open. 2024-11-21 17:52:31 +02:00
Lior Halphon
8f9e1e9ea5 Prevent certain APIs from returning 0 despite failing 2024-11-21 17:51:27 +02:00
Lior Halphon
1bf57ece70 Fix iOS builds 2024-11-21 17:51:08 +02:00
Lior Halphon
29d8cca511 Keep moving and renaming things 2024-11-16 22:53:06 +02:00
Lior Halphon
14cf76776a Fix an exception when closing a window with open panels 2024-11-16 17:32:13 +02:00
Lior Halphon
f1f97f0692 Make STRUCT_VERSION internal 2024-11-16 17:16:58 +02:00
Lior Halphon
0b5be876b3 Missing _t from types 2024-11-16 17:15:51 +02:00
Lior Halphon
fdc39f9bd6 Rename GB_log_attributes to GB_log_attributes_t 2024-11-16 16:53:06 +02:00
Lior Halphon
14e486017a Move things around 2024-11-16 15:19:47 +02:00
Lior Halphon
3bee0deda5 Warn when loading ROMs with RAM sizes less than a bank 2024-11-16 14:33:13 +02:00
Lior Halphon
101e894314 Fixed a rounding error when applying the high-pass filter on high sample rate 2024-11-16 13:59:38 +02:00
Lior Halphon
2e6ff5fd9f Disable filtering on raw audio output 2024-11-16 12:31:45 +02:00
Lior Halphon
2b3ec9d991 Missing nounroll 2024-11-16 02:23:11 +02:00
Lior Halphon
375fb4388c Swap the box filter with band-limited synthesis, fixed a regression that prevented filtering of square waves in some scenarios. Fixes #669 2024-11-16 01:03:14 +02:00
Lior Halphon
fc76063ec0 File associations & icons on Windows, use a manifest for themed dialogs 2024-11-15 16:17:42 +02:00
Lior Halphon
6568cca6bb Forgot to update the FreeDesktop icons 2024-11-10 20:21:09 +02:00
Lior Halphon
d386ca8726 Retouch the cartridge icons 2024-11-10 20:05:32 +02:00
Lior Halphon
f21761338c Allow the Cocoa frontend to pick a monospace font 2024-11-09 17:04:10 +02:00
Lior Halphon
41af62d793 Fix volume being too low in "Always On" audio mode. Fixes #667, fixes #664 2024-11-08 23:54:12 +02:00
Lior Halphon
2dfde867a9 Syncing with the App Store branch 2024-11-08 14:53:16 +02:00
Lior Halphon
6efefab526 Merge pull request #668 from lxgr/lxgr/fix-camera-aspect
Fix macOS camera aspect ratio
2024-11-03 22:30:14 +02:00
Lukas Ribisch
207dc993d4 Fix macOS camera aspect ratio 2024-11-03 11:55:25 -05:00
Fernap
b815744b4c change target address to 24 bits instead of 16 for DMAs to BWRAM to reflect size of DDA register 2024-11-03 00:26:22 +11:00
Lior Halphon
52d5169cc8 Fix A+B combo regression 2024-10-13 14:36:11 +03:00
Lior Halphon
73a6d35f73 Support building SameBoy on Haiku 2024-10-05 14:00:33 +03:00
Lior Halphon
2498456bcc Fix release iOS builds 2024-10-04 15:40:13 +03:00
Lior Halphon
ec65cfd942 Fix SDL build on macOS 2024-10-04 15:33:19 +03:00
Lior Halphon
122549d3cd Merge branch 'master' of github.com:LIJI32/SameBoy 2024-10-03 16:21:18 +03:00
Lior Halphon
e13048d07b Improve ISX compatibility 2024-10-03 16:21:10 +03:00
Lior Halphon
6eeba2f6f6 Share code between the main Cocoa binary and QuickLook 2024-09-27 16:19:58 +03:00
Morilli
cdef244f38 Implement SA1 I-RAM write protection 2024-09-23 18:38:31 +10:00
Lior Halphon
1fac8870d4 Merge pull request #658 from RSilicon/ARC
Remove xpc_release for ARC
2024-09-22 23:09:38 +03:00
Rose
741637e625 Remove xpc_release for ARC
xpc objects are handled by ARC.
2024-09-22 16:07:09 -04:00
Lior Halphon
73168aa7f2 Merge pull request #657 from RSilicon/More
Fix some clang-tidy warnings
2024-09-22 23:00:21 +03:00
Rose
7e5996df82 Fix some clang-tidy warnings
- Use nil, not NULL for objects
- Call Objective-C release instead of CFRelease (unless like we are hacking around ARC, which we are not)
- xpc_release to release xpc objects.
2024-09-22 15:54:26 -04:00
Lior Halphon
52de44049c Better horizontal layouts on notched iPhones 2024-09-22 14:58:51 +03:00
Lior Halphon
f5c7c4443d Merge pull request #656 from RSilicon/Drawing
Modifier masks are NSUInteger
2024-09-22 14:01:04 +03:00
Lior Halphon
db5fa8df4c Change the button style in the palette editor 2024-09-22 12:25:25 +03:00
Lior Halphon
177859bec6 New palettes 2024-09-22 12:21:32 +03:00
Lior Halphon
bd3799d431 Fix glitchy palette import on macOS 2024-09-22 11:57:50 +03:00
Rose
e533b59759 Modifier masks are NSUInteger 2024-09-21 20:30:11 -04:00
Lior Halphon
38e2760531 Add the ability to create no palettes 2024-09-22 01:23:30 +03:00
Lior Halphon
447cdf2672 Allow editing existing palettes 2024-09-21 21:59:21 +03:00
Lior Halphon
062d44e065 Allow import and export of palettes 2024-09-20 17:50:15 +03:00
Lior Halphon
f33f3f6951 Basic palette management 2024-09-19 23:25:26 +03:00
Lior Halphon
291887cd10 Fix model swapping and reset 2024-09-19 22:45:54 +03:00
Lior Halphon
8ded1ca3b3 Move the palette picker to its own class 2024-09-19 21:02:59 +03:00
Tim Allen
710d92cbdd Force-enable coprocessor delayed-sync while creating a save-state.
When making a save state, all the system components are "fast forwarded" to a
safe state that can be serialised. If delayedSync (called "Coprocessor Fast
Sync" in the UI) is enabled, this works perfectly. If it is disabled, the
accurate coprocessor synching interferes with the save-state creation, leading
to the game crashing or (worse) the emulator freezing.

Star Fox is a good test case - repeatedly saving state and loading it will very
quickly cause the game to run super-slowly, hang, or crash.

Ideally, somebody should dig into exactly what coprocessor syncing is doing
that breaks the assumptions of the state-saving code, but given how complex
the whole thing is, and given that it doesn't affect hardware emulation
accuracy (real hardware can't save states at all), it's easiest to just force-
enable delayedSync while a save-state is in progress.

Fix from the jgemu bsnes fork:
8b4d1b8ae5
2024-09-18 23:17:39 +10:00
Lior Halphon
2aa4726e01 Add missing Info.plist item 2024-09-15 22:21:32 +03:00
Lior Halphon
3a7e5ecac5 Fix iOS build 2024-09-15 21:46:33 +03:00
Lior Halphon
5d952565c9 Switch to a pre-built Assets.car file iOS icons, add dark and tinted (iOS 18) icons 2024-09-15 21:46:29 +03:00
Lior Halphon
42be4ef827 Add flat CRT shader 2024-09-15 20:49:49 +03:00
Lior Halphon
1931c2830f Syncing with the App Store branch (iCloud support) 2024-09-15 00:08:54 +03:00
Lior Halphon
8cb94e7a8b Merge pull request #655 from MaddTheSane/patch-2
Fix a memory leak in GBLoadROMTableViewController.m
2024-09-13 03:56:04 +03:00
C.W. Betts
8c8e59cd81 Update GBLoadROMTableViewController.m
Fix a memory leak with UTTypeCopyAllTagsWithClass.
2024-09-12 17:49:06 -06:00
Lior Halphon
ece40bcf0e Fix multi touch 2024-09-12 21:06:11 +03:00
Lior Halphon
392bc8c0d9 Move HomeBrew Hub to a tab bar 2024-09-07 17:39:38 +03:00
Lior Halphon
8e3d8c4a18 Fix zip selection 2024-09-07 01:27:26 +03:00
Lior Halphon
92f425655d iOS cheats support 2024-09-07 01:25:11 +03:00
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
Lior Halphon
50a56a4b68 UI fixes 2024-09-01 01:38:00 +03:00
Lior Halphon
11f70c09af Use spaces rather than tabs for the iOS plist 2024-08-31 21:09:05 +03:00
Lior Halphon
a372b2ec0f Printer emulation in iOS 2024-08-31 21:06:31 +03:00
Lior Halphon
7127e3e068 Remove IDE shit 2024-08-31 15:43:27 +03:00
Lior Halphon
f1b187d512 Use … instead of ... 2024-08-31 15:34:19 +03:00
Lior Halphon
11b9c4fab7 Minor text alignment issues 2024-08-31 15:05:50 +03:00
Lior Halphon
b88a3a02a9 Fix the cheat window's appearance in Mavericks 2024-08-31 14:59:05 +03:00
Lior Halphon
619792db7f Fix link cable support is macOS 10.13 and older 2024-08-31 13:54:22 +03:00
Lior Halphon
bd5d01c0a4 Game Genie has a space 2024-08-31 13:42:18 +03:00
Lior Halphon
4647c55949 Add new iOS tip 2024-08-30 17:06:26 +03:00
Lior Halphon
d97c2fb701 Add Rapid A/B to Cocoa and SDL, closes #589 2024-08-30 16:12:31 +03: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
Lior Halphon
d4c715b5f0 Associate panels with their document windows 2024-08-29 21:52:55 +03:00
Lior Halphon
8dda5ee098 Always center windows in Cocoa 2024-08-29 20:59:32 +03:00
Lior Halphon
5b33cebca9 Fix iOS and lib builds 2024-08-29 01:26:13 +03:00
Lior Halphon
6178ff2a78 Cheat Search API, Cheat Search in Cocoa, and new cheats window layout 2024-08-29 01:11:47 +03:00
Lior Halphon
fc508427b8 More workarounds for the UTI bugs 2024-08-26 20:45:49 +03:00
Lior Halphon
430e42fa72 Prevent the "Mute" menu item from being incorrectly displayed as marked while paused 2024-08-25 18:03:01 +03:00
Lior Halphon
c7c54abb6b Remove auto-generated IDE crap 2024-08-25 17:55:48 +03:00
Lior Halphon
b6c6b9ed54 Automatic model selection in the Cocoa and SDL frontends, closes #648 2024-08-25 14:36:48 +03:00
Lior Halphon
f0bab07f26 Allow controllers to switch the iOS frontend to full screen mode 2024-08-24 20:02:16 +03:00
Lior Halphon
645ef429bc Oops 2024-08-23 14:25:18 +03:00
Lior Halphon
a7d977a5c5 Improved AirPlay mirroring 2024-08-23 14:20:53 +03:00
Lior Halphon
795d772c83 Allow deleting ROMs from the context menu in the iOS version 2024-08-18 19:28:27 +03:00
Lior Halphon
2b2bb3569b Add ZIP import support to the iOS version 2024-08-18 19:19:01 +03:00
Lior Halphon
fb8508ea20 Fix an issue that could make the logo incorrectly positioned on a potential new iPhone model 2024-08-17 19:35:41 +03:00
Lior Halphon
461083523a Correctly emulate LYC edge cases when emulating CGB-0 to CGB-C in double speed mode 2024-08-16 20:51:40 +03:00
Lior Halphon
b8e32e6d53 More accurate window emulation, especially in double speed mode 2024-08-13 21:11:38 +03:00
Lior Halphon
d5c6ed9510 Correctly list removed breakpoints/watchpoints 2024-08-10 19:38:54 +03:00
Lior Halphon
47cdefd3d0 Minor adjustments to the CGB WX glitch 2024-08-02 20:45:17 +03:00
Lior Halphon
53fc5a74ed CoreHaptics is trash. 2024-07-31 00:58:30 +03:00
Lior Halphon
035291b955 Fix the comparison operators having the wrong priority 2024-07-27 22:39:56 +03:00
Lior Halphon
5f71ec4974 Slightly more accurate 2024-07-26 14:04:41 +03:00
Lior Halphon
5eb0e5d605 Minor regression fix 2024-07-26 02:43:31 +03:00
Lior Halphon
b1ea179513 Improve various edge cases of window emulation, improve the emulation of the last quirk 2024-07-25 22:32:28 +03:00
Lior Halphon
d34579e3bb Window accuracy improvements, implement a new CGB window glitch 2024-07-21 23:38:40 +03:00
Lior Halphon
64cf389edf Simplify wx=166 code 2024-07-14 13:00:39 +03:00
Lior Halphon
0c9cf8d594 Build fix 2024-07-13 17:11:39 +03:00
Lior Halphon
44b70bf275 Improve WX=166 accuracy on pre-CGB models 2024-07-13 17:06:29 +03:00
Lior Halphon
06c6ce7d65 More accurate fetcher timings. More accurate visual glitches in Mr. Chin's Gourmet Paradise; Turrican. 2024-07-11 00:21:04 +03:00
Lior Halphon
9d4d535758 Merge remote-tracking branch 'xdg-thumbnailer/xdg-thumbnailer' 2024-07-08 19:49:41 +03:00
ISSOtm
136e11cc13 Avoid using GNU-isms in make install
For macOS compat
2024-07-08 01:19:01 +02:00
Lior Halphon
18206718e3 Adjustment to SCX's write conflict implementation 2024-07-08 00:18:27 +03:00
Lior Halphon
c3e3fb91cc Improve PPU timings in CGB revision 0 to C. These revisions are no longer marked as experimental. 2024-07-08 00:00:27 +03:00
Lior Halphon
a4525c3336 Slightly improve OAM read blocking timing 2024-07-07 16:09:53 +03:00
Lior Halphon
5dbddb344d Size expects an integer 2024-07-06 15:44:01 +03:00
Lior Halphon
a66d4ea64c Minor adjustments 2024-07-06 15:29:04 +03:00
Lior Halphon
3dad68618e Fix build on macOS 2024-07-06 15:03:41 +03:00
ISSOtm
366c374461 Switch to "west const" instead of "east const" 2024-07-05 22:27:30 +02:00
ISSOtm
6e1112157c Address review comments 2024-07-05 22:16:06 +02:00
ISSOtm
488f17941f Add forgotten theme name when installing FreeDesktop icons
*facepalm*
2024-07-04 23:51:49 +02:00
ISSOtm
1dde5c1ce1 Have make install install the thumbnailer file as well 2024-07-04 23:39:32 +02:00
ISSOtm
17f1b91b8c Fix and simplify make install
`install` does not operate recursively on directories.

Exclude the `sameboy` executable from that copy,
and use a single `install` command to perform all of it.

The icon names are in the `NxN` format, including the target dirs.
2024-07-04 23:34:48 +02:00
ISSOtm
4f25521cba Improve MIME type description a little 2024-07-04 23:18:00 +02:00
ISSOtm
64ad67d5a5 Avoid overriding globs used to detect MIME types 2024-07-04 22:36:32 +02:00
ISSOtm
a26c57d582 Use icons directory for icons instead of legacy pixmaps 2024-07-04 22:34:34 +02:00
ISSOtm
64d45dd23a Only strip the correct file on install 2024-07-04 22:14:59 +02:00
ISSOtm
8e2769b946 Clean up make install 2024-07-04 22:00:27 +02:00
ISSOtm
4cc34f97ec Scrap all of that, and use the undocumented spec that everyone actually uses 2024-07-04 20:02:51 +02:00
ISSOtm
323f3e89b7 Generate thumbnails under the appropriate path 2024-07-04 11:14:13 +02:00
Lior Halphon
482b9a1562 Cherrypick libretro/SameBoy#91 2024-07-03 23:38:34 +03:00
ISSOtm
c6103d23fa Address review comments 2024-06-29 22:26:49 +02:00
ISSOtm
0b6a73f380 Implement image compositing and rendering
Not saving to the correct place yet, but almost there!
2024-06-28 16:14:58 +02:00
ISSOtm
d873abfadf Switch to embedding cartridge templates and boot ROM as GResources
Also set up gdk-pixbuf in the Makefile, which will be used for image ops
2024-06-27 02:27:07 +02:00
ISSOtm
446fc15521 Emulate the ROM to be thumbnailed
Now all that's left is actually rendering that!
2024-06-27 00:00:32 +02:00
ISSOtm
b3cecf2413 Implement the "plumbing" around thumbnail generation
Only the actual thumbnail generation is left!
2024-06-26 22:59:03 +02:00
ISSOtm
e4ceb3d93b Begin implementing thumbnailer for Linux 2024-06-26 09:59:47 +02:00
Lior Halphon
cee486ab11 Merge pull request #433 2024-06-21 16:52:41 +03:00
Lior Halphon
407e540638 Fix conflicts between controller-triggered run modes and swipe-triggered run-mode. Fixes #640 2024-06-28 17:42:53 +03:00
Lior Halphon
8db2490077 Merge pull request #642 from logicalmoody/master 2024-06-28 16:55:16 +03:00
Lior Halphon
d42aad2b84 Minor stylistic changes 2024-06-28 16:54:20 +03:00
Cal Moody
3bf94d281a fix issues with change camera button 2024-06-26 19:06:05 -04:00
Cal Moody
66da5fd530 move camera change button into @available check; fix change camera button position 2024-06-26 15:02:24 -04:00
Cal Moody
5c21c5e985 fix spacing 2024-06-25 22:31:47 -04:00
Cal Moody
25576899d8 add support for changing which back camera is being used 2024-06-25 22:27:16 -04:00
Lior Halphon
d07b199668 Improve audio anti-aliasing, allow 2MHz output 2024-06-23 20:10:22 +03:00
Lior Halphon
ad5ca0dcf0 Switch to 2MHz units in apu_cycles 2024-06-23 15:23:29 +03:00
Lior Halphon
9991c3b0b4 Permanent workaround for an SDK/Clang/ld bug – fixes compatibility with 10.9 and 10.10 when linking against 14.x SDKs 2024-06-22 19:37:04 +03:00
Lior Halphon
c9dfc86291 Style fixes 2024-06-21 16:51:51 +03:00
Lior Halphon
2bf5819c36 Merge branch 'master' into console_flash 2024-06-22 16:28:13 +03:00
Lior Halphon
08178c9f3a Merge pull request #638 from Rangi42/bootroms
Update bootrom code with the latest hardware.inc
2024-06-21 01:20:35 +03:00
Lior Halphon
3581945d85 Use a variable rather than a macro 2024-06-21 01:19:31 +03:00
Rangi42
77b7f861f3 Make review changes 2024-06-20 18:15:07 -04:00
Rangi42
9588cf44aa Update bootrom code with the latest hardware.inc 2024-06-20 13:15:03 -04:00
Lior Halphon
3116f63e37 Merge pull request #631 from laamaa/bugfix/wayland_crash_on_exit
call SDL_Quit() on exit to prevent a crash on app exit with linux/wayland
2024-06-19 20:02:41 +03:00
Lior Halphon
496baafbf9 Explicit void casts is kind of unnecessary for a function that generally never fails. 2024-06-19 20:02:24 +03:00
Jonne Kokkonen
7f110c4415 Add notes to SDL_Quit atexit call
Co-authored-by: Eldred Habert <eldredhabert0@gmail.com>
2024-06-15 20:33:26 +03:00
Lior Halphon
b5cd06a41e Update version to 0.16.6 2024-06-13 22:47:39 +03:00
Lior Halphon
d55426afa0 Fix a bug where haptics randomly stop working 2024-06-13 22:46:56 +03:00
Lior Halphon
d1b4af5e76 Catch exceptions when parsing HH JSONs, just in case 2024-06-12 13:48:09 +03:00
Lior Halphon
eebdbbfd5b Properly fix the camera threading bugs 2024-06-12 13:35:35 +03:00
Lior Halphon
60ff8577bb Allow user-provided boot ROMs in iOS 2024-06-11 17:48:59 +03:00
Lior Halphon
a3128d89c0 Support for a distinct CGB-E boot ROM, internal support for an distinct AGB-0 boot ROM 2024-06-09 22:49:49 +03:00
Lior Halphon
2018f0ee01 Improved dpad controls 2024-06-09 18:28:10 +03:00
Lior Halphon
76c93254ed Disable screen dimming while emulation is running 2024-06-09 18:10:01 +03:00
Lior Halphon
e578843745 Merge branch 'master' of github.com:LIJI32/SameBoy 2024-06-09 17:58:34 +03:00
Lior Halphon
8600f96fa2 Fix a race condition with camera emulation 2024-06-09 17:58:28 +03:00
Lior Halphon
cb7cc44b7b Merge pull request #635 from ISSOtm/rgblink-x
Use `rgblink -x` instead of `dd`
2024-06-09 17:47:12 +03:00
ISSOtm
2c5455e35d Use rgblink -x instead of dd
This saves a few build steps and intermediate files
2024-06-09 16:36:13 +02:00
Lior Halphon
0b77662504 Fix compatibility issues when linking against Sonoma's SDK. Fixes #633 2024-06-09 15:27:28 +03:00
Lior Halphon
b2d1086e2e Make the console window not always on top 2024-06-08 20:34:26 +03:00
Lior Halphon
93cc19b3b9 Homebrew Hub integration in iOS 2024-06-08 18:55:33 +03:00
Lior Halphon
0bc0618a6a Add an option to view the Library in Files 2024-06-04 00:30:34 +03:00
Lior Halphon
322f3c7013 More accurate emulation of the previous quirk 2024-06-03 22:04:17 +03:00
Lior Halphon
5be5bc4709 Emulate a new APU glitch, tweak another. Fixes #617 (Telefang sample audio being broken on CGB-D and CGB-E) 2024-06-03 00:19:26 +03:00
Jonne Kokkonen
ee3878e43a call SDL_Quit() on exit to prevent a crash on wayland 2024-06-02 20:57:46 +03:00
Lior Halphon
b1fec62564 Fix a potential crash upon pausing in iOS and macOS 2024-05-31 20:41:00 +03:00
Lior Halphon
2bf8feb299 Fix a bug causing newly imported ROMs to sometime incorrectly prefer SGB over CGB 2024-05-27 23:06:16 +03:00
Lior Halphon
e5e9cf145a Fix temporary audio distortions affecting some Macs and iOS devices 2024-05-27 23:02:54 +03:00
Lior Halphon
5408fe8dd2 Update version to 0.16.5 2024-05-25 21:28:38 +03:00
Lior Halphon
eba7e2dde9 Typo fix 2024-05-25 21:23:59 +03:00
Lior Halphon
1d613adac2 Windows being Windows 2024-05-25 21:18:24 +03:00
Lior Halphon
ebf4d1d0ee Do not autohide debugger windows, give them all the ROM filename in the title. Closes #620 2024-05-25 20:56:20 +03:00
Lior Halphon
6c613d3b0c Update info.plist from the App Store version 2024-05-25 18:20:16 +03:00
Lior Halphon
302eaf6eca Migrate changes from the App Store version 2024-05-25 18:15:14 +03:00
Lior Halphon
7758713f86 Fix filtered screenshots being saved as 32-bit per channel 2024-04-29 15:51:30 +03:00
Lior Halphon
19cf8d26b1 Force absolute boot ROM paths in libretro's build bot 2024-04-18 22:26:47 +03:00
Lior Halphon
c9700dfb29 Relicense the iOS frontend, following the recent events 2024-04-16 21:35:51 +03:00
Lior Halphon
44a35e57f6 Avoid GCC false positives 2024-04-14 00:22:14 +03:00
Lior Halphon
038a2c5892 Merge pull request #608 from roydmerkel/windows-build-fix
Fixed windows cmd build (LIB overrides msvc-clang/clang-cl libpath.)
2024-04-13 21:29:14 +03:00
Roy Merkel
2ea0932726 Fixed windows cmd build (LIB overrides msvc-clang/clang-cl libpath.) 2024-04-13 09:24:19 -07:00
Lior Halphon
5d06f45c0f Merge pull request #607 from Morilli/fix-compiler-warning
Fix potential compiler warning on questionable code path
2024-04-13 13:52:10 +03:00
Morilli
c5b3e47925 Fix potential compiler warning on questionable code path 2024-04-13 02:53:52 +02:00
Lior Halphon
bd31258725 Fix building SameBoot with the lastest RGBDS master, fixes #606 2024-04-13 00:23:18 +03:00
Lior Halphon
b40ba73533 Update version to 0.16.3 2024-04-12 19:57:27 +03:00
Lior Halphon
fe917efad5 Add an installer for the iOS Deb release to allow compatibility with rootless jailbreaks 2024-04-12 19:25:58 +03:00
Lior Halphon
3fe9de88a2 Sign reregister at build time 2024-04-12 13:57:21 +03:00
Lior Halphon
86cf0c4d84 Sign the sideloaded iOS app to make sure TrollStore uses the correct entitlements 2024-04-12 13:47:01 +03:00
Lior Halphon
b63ddc6e3d Add audio activation settings to iOS 2024-04-12 13:46:29 +03:00
Lior Halphon
4a42dc073b Fix turbo mode not working on iOS if dynamic speed is not enabled 2024-04-12 13:41:59 +03:00
Lior Halphon
a791f7e621 Add an option to enable single-touch A+B combo in iOS, closes #587 2024-04-06 15:16:41 +03:00
Lior Halphon
3f799f21ff Make the SGB boot ROMs closer in timing to the original ones, fixed #602 2024-04-05 18:44:49 +03:00
Lior Halphon
a80a19b418 Fix warning 2024-04-05 14:54:05 +03:00
Lior Halphon
2b37404447 It did trigger GCC 2024-04-05 14:46:12 +03:00
Lior Halphon
514e27d975 Enable a few warnings, hopefully they won't trigger GCC 2024-04-05 14:39:23 +03:00
Lior Halphon
a39445e63b Merge pull request #600 from CasualPokePlayer/new_folder_dialog
Add support for the newer Vista style select folder dialog
2024-04-05 13:47:17 +03:00
CasualPokePlayer
3caf6183bc Add support for the newer Vista style select folder dialog 2024-04-04 15:15:27 -07:00
Lior Halphon
0f6299edfc Merge pull request #592 from orbea/tester
sanity_tests.sh: avoid bash brace expansion
2024-03-31 20:11:31 +03:00
Lior Halphon
0b0abce956 Merge pull request #598 from max-m/GBViewController-patch-1
Remove duplicate observer for the `GBInterferenceVolume` setting
2024-03-31 14:18:34 +03:00
Lior Halphon
60d77a6931 Merge pull request #599 from max-m/Shader-WebGL-compat
Make shaders compatible with GLES 3.0
2024-03-31 14:17:49 +03:00
Lior Halphon
7ed8fb1de9 Merge pull request #603 from YayIguess/master
Fix message always being logged when running ticks command
2024-03-31 14:04:28 +03:00
Braiden Gent
66ec48e0eb Don't tell user tick count has been reset if they've kept the value
"Tick count reset." is currently logged even if the user supplied the 'keep' argument.
2024-03-22 03:47:33 -07:00
Maximilian Mader
00dce71eab Make shaders compatible with GLES 3.0
GLES, at least as used in WebGL 2, does not like mixing integers and floats,
for example:
> ERROR: 1:8: '*' : wrong operand types - no operation '*' exists that takes a left-hand operand of type 'mediump 2-component vector of float' and a right operand of type 'const int' (or there is no acceptable conversion)

This patch converts those integer constants into floats.
With this patch the shaders (apart from the master shader) can be used in WebGL contexts too.
2024-03-11 16:40:23 +01:00
Maximilian Mader
d7523d27e8 Remove duplicate observer for the GBInterferenceVolume setting 2024-03-11 16:05:00 +01:00
Lior Halphon
e7792c16b2 Prevent filtered screenshots from using 64-bit color depth, as it causes some apps to misinterpret color space information 2024-03-09 21:04:54 +02:00
Lior Halphon
5e2b6e7e9e Fix rounding errors in the LCD and CRT shaders, closes #595 2024-03-09 18:07:04 +02:00
Lior Halphon
a125da6a98 Fix ISX support, oops 2024-03-09 16:37:17 +02:00
Lior Halphon
8739da61c0 Avoid strict aliasing violations. Closes #593 2024-03-09 15:41:07 +02:00
Lior Halphon
efc93d0422 Avoid realpath, no available on macOS 12.x 2024-03-09 13:37:50 +02:00
Lior Halphon
17c962e500 Update libretro build 2024-03-09 13:19:31 +02:00
Lior Halphon
2d29ece3b8 Various libretro buildbot fixes 2024-03-09 03:22:40 +02:00
Lior Halphon
6eedee78db Better path handling in libretro's Makefile 2024-03-09 02:20:53 +02:00
Lior Halphon
8aa19fe092 Update libretro's Makefile to support more targets
(cherry picked from commit 17f0ff2cf7)
2024-03-08 23:53:44 +02:00
Lior Halphon
17f0ff2cf7 Update libretro's Makefile to support more targets 2024-03-08 23:52:30 +02:00
c382f7ea5a Update libretro branch to v0.16.2 2024-03-08 21:44:06 +00:00
Lior Halphon
df59294c38 Fix Android libretro buildbot builds 2024-03-08 23:39:30 +02:00
Lior Halphon
6d6982abee The path should be relative to the libretro folder 2024-03-08 19:43:51 +02:00
Lior Halphon
cd2275c129 Build the version-correct boot ROMs rather than the latest, add libretro GitLab CI 2024-03-08 19:07:18 +02:00
Lior Halphon
7113c5484b I still don't understand git 2024-03-08 18:54:05 +02:00
Lior Halphon
633ea9df90 I don't understand git 2024-03-08 18:51:27 +02:00
Lior Halphon
ba45911734 Push the branch as well 2024-03-08 18:39:20 +02:00
Lior Halphon
de0046d7d6 Fetch tags 2024-03-08 18:27:34 +02:00
Lior Halphon
b583f62e7b It works on my machine :( 2024-03-08 18:24:32 +02:00
Lior Halphon
950c0d5524 Chmod the script 2024-03-08 18:20:02 +02:00
Lior Halphon
06bc4cd0bf Make the libretro branch only use stable releases, tag libretro releases 2024-03-08 18:17:29 +02:00
Lior Halphon
3ef8fab7c4 Fix typo 2024-03-08 18:17:29 +02:00
Lior Halphon
153cdb2e11 Fix the States view header in iOS 16 and newer 2024-03-08 18:17:29 +02:00
Lior Halphon
5e4a1f6db7 Adjust the handling of >4MB ISX files 2024-03-08 18:17:29 +02:00
Lior Halphon
8c9c97b74f ISX does not support symbols with a bank >FF 2024-03-08 18:17:29 +02:00
Lior Halphon
42474a0859 Slightly simplify boot ROM stripping 2024-03-08 18:17:29 +02:00
Lior Halphon
a3a751b1b6 Remove empty Obj-C extensions 2024-03-08 18:17:29 +02:00
Lior Halphon
6d7dad9ce5 Correct the license in the Cocoa and iOS frontends 2024-03-08 18:17:29 +02:00
orbea
e3b240147a sanity_tests.sh: avoid bash brace expansion 2024-03-03 07:30:26 -08: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
Lior Halphon
6edc35804c Merge pull request #591 from orbea/missing-prototypes
pb12: silence -Wmissing-prototypes warnings
2024-02-29 11:02:24 +02:00
orbea
8017a4a044 pb12: silence -Wmissing-prototypes warnings 2024-02-28 19:12:00 -08: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
Lior Halphon
e79f2c1764 Add a menu item to reload the ROM without resetting 2024-01-21 13:46:51 +02:00
Lior Halphon
9c13590f30 Allow hot-swapping a ROM into itself, fixes #512 2024-01-21 13:45:52 +02:00
Lior Halphon
0c81f36269 Disable function outlining 2024-01-16 23:23:53 +02:00
Lior Halphon
27b5935b8d Update version to 0.16.2 2024-01-13 22:18:15 +02:00
Lior Halphon
8d063391a4 Support for certain bootlag games with malformed headers, fixes #585 2024-01-13 18:06:22 +02:00
Lior Halphon
9f53fcc30b Proper fix to Metal flickering 2024-01-13 18:05:27 +02:00
Lior Halphon
4cf3b3c948 Accurate emulation of frame parity 2024-01-13 15:50:07 +02:00
Lior Halphon
a9c01d35fc Fix a bug where the Metal renderer would sometimes flicker in the Cocoa/iOS frontends 2024-01-13 15:49:37 +02:00
Lior Halphon
686a506e17 Fix the Quick Look generator for macOS Sonoma, fixes #581 2024-01-11 23:55:01 +02:00
Lior Halphon
5fb6d55c67 Fix the update dialog font, which was broken on both older and newer versions of macOS 2024-01-06 21:49:48 +02:00
Lior Halphon
226825bda4 Fix menu layout in bordered/SGB mode, in the SDL port 2024-01-06 18:45:18 +02:00
Lior Halphon
927b7493e5 Fix menu redrawing mode in the SDL frontend in bordered/SGB mode, fixes #576 2024-01-06 17:46:12 +02:00
Lior Halphon
e9c2c866eb Replace XAudio 2.7 and 2.9 with the redistrib version of XAudio 2.9 2024-01-06 17:41:24 +02:00
Lior Halphon
97e8df29c5 Don't prompt for an xcode-select reset every build 2024-01-05 22:50:23 +02:00
Lior Halphon
f725e70e84 Merge pull request #579 from Nyanport/master
Fix bugs in Makefile for newer operating systems
2024-01-03 20:08:48 +02:00
Max Parry
4569114cab Update Makefile (as per LIJI32) 2024-01-03 14:19:23 +11:00
Max Parry
d51dcaca19 Update Makefile 2023-12-31 20:04:40 +11:00
Max Parry
10eb15bb90 Add files via upload 2023-12-31 19:55:28 +11:00
Lior Halphon
91f2a82f19 Merge pull request #577 from orbea/c++
gb.h: add include guards for C++ projects
2023-12-29 17:09:05 +01:00
orbea
8cf319e941 gb.h: add include guards for C++ projects
This is helpful for C++ projects like bsnes that wish to include gb.h
without needing to set extern "C" themselves.
2023-12-28 09:59:37 -08:00
Lior Halphon
e666ec09db Update version to 0.16.1 2023-12-23 20:42:47 +02:00
Lior Halphon
c9fb3b3ec6 Fix XAudio2.7 hanging on device disconnection 2023-12-23 20:42:21 +02:00
Lior Halphon
e89df2df43 Automatically disable VSync on displays lower than 60Hz 2023-12-23 16:34:40 +02:00
Lior Halphon
b516f9a3ee Drop ownership information from DEB TARs 2023-12-22 15:13:45 +02:00
Lior Halphon
2e38cec98b Verify the entitlements match the plist, fixes #551 2023-12-21 23:45:07 +02:00
Lior Halphon
8ed46a6a58 Allow SameBoy Cocoa to coexist with VBA 2023-12-20 23:54:49 +02:00
Lior Halphon
27d42146ba Fix compatibility with Catalina and older versions of macOS, improve printer UI 2023-12-18 22:41:15 +02:00
Lior Halphon
00e1c925a4 Prevent GB_workboy_is_enabled incorrectly returning true, prevent GB_workboy_set_key from affecting other accessories if Workboy isn't connected 2023-12-18 21:48:09 +02:00
Lior Halphon
9619500445 Use a more compatible TAR format for iOS debs 2023-12-16 23:22:34 +02:00
Lior Halphon
9cc70c085f Update version to 0.16 2023-12-16 20:26:57 +02:00
Lior Halphon
746204e57c Silence zip 2023-12-16 20:03:04 +02:00
Lior Halphon
3fd09ffcde Update README for Windows builds 2023-12-16 19:55:41 +02:00
Lior Halphon
6e923645d3 The previous change should only affect channel 3 2023-12-15 20:52:24 +02:00
Lior Halphon
c7c2d08dc5 More accurate audio mixing in AGB mode, fixes #555 2023-12-15 20:38:19 +02:00
Lior Halphon
fcf31be735 Fix SDL controllers not automatically reconnecting. Fixes #563 2023-12-15 15:24:09 +02:00
Lior Halphon
d8905f57bf iOS alarm support 2023-12-15 14:28:19 +02:00
Lior Halphon
8b2f683c20 Todo confirmed 2023-12-14 22:08:55 +02:00
Lior Halphon
404e153744 Use Expat rather than X11, as X11 has one extra clause. Fixes #574 2023-12-14 21:54:46 +02:00
Lior Halphon
9f56f5fee0 Switch the Windows build to x86-64 2023-12-12 00:26:13 +02:00
Lior Halphon
977d941f48 Using Base.lproj prevents the VRAM toolbar from appearing in Sonoma for some reason. Fixes #567. 2023-12-10 23:52:51 +02:00
Lior Halphon
34c9d4c791 Correctly emulate the vram_rd_eol test ROMs (except in odd mode) 2023-12-10 22:40:47 +02:00
Lior Halphon
40ded1114f Correct timing TODO 2023-12-10 14:56:41 +02:00
Lior Halphon
fbd1d06f1c Confirmed SCX on double speed mode 2023-12-10 14:48:15 +02:00
Lior Halphon
1c0f65177f Fix HDMA5 not being correctly updated in memory when disabling hblank HDMA 2023-12-09 15:54:57 +02:00
Lior Halphon
b51aac4bf5 Modernize some RGBASM syntax to silence most deprecation warnings in the upcoming 0.7 RGBDS release 2023-12-09 15:04:27 +02:00
Lior Halphon
68ba89cf43 Fix unquoted realpath, fixes #572 2023-12-07 01:02:01 +02:00
Lior Halphon
8642715a6d Merge pull request #573 from Rangi42/rgbds
Allow rgbds to build SameBoy's BootROMs for testing
2023-12-06 23:09:52 +02:00
Rangi42
6d3a65759e Allow rgbds to build SameBoy's BootROMs for testing
rgbds needs to use a local copy of its executables for testing,
passed as an `RGBDS=../../` prefix for the path to them all.

This commit enables that, so rgbds can do
    test_downstream LIJI32/SameBoy bootroms
in its run-tests.sh script.
2023-12-06 12:12:15 -05:00
Lior Halphon
eba273d89c Menu items and shortcut to resize the window in the Cocoa frontend 2023-12-04 00:34:48 +02:00
Lior Halphon
bce413821d Merge pull request #569 from SnowyMouse/gbenum-fix
Fix GB_ENUM on C++
2023-11-26 19:39:23 +02:00
Lior Halphon
1c8a14ff1c Improved controller assignment in the Cocoa port, affects #532 2023-11-26 17:32:33 +02:00
Lior Halphon
5823bf9d70 Merge branch 'master' of github.com:LIJI32/SameBoy 2023-11-25 21:24:56 +02:00
Lior Halphon
ecbdb9e95e Emulate several more pre-CGB-D channel 1 glitches 2023-11-25 21:24:46 +02:00
Lior Halphon
35a91768b4 iPad support was missing from the iOS plist file 2023-11-25 21:22:01 +02:00
Lior Halphon
a795514bc4 Refer to SameBoy's license as the X11 License 2023-11-25 21:21:34 +02: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
Snowy
8657d3e4b6 Fix GB_ENUM on C++
The else branch results in an error from defining a type in a cast.
2023-10-28 14:20:31 +02:00
Lior Halphon
aff42affc0 Merge pull request #570 from max-m/fix-cheats
Fix memory corruption on removal / update of cheats with the same address hash
2023-10-22 21:01:54 +03:00
Maximilian Mader
0ece951173 Fix memory corruption on removal of multiple cheats with the same address hash 2023-10-22 18:39:14 +02:00
Hitomi Nakayama
d267d83cec Added warning for SDL init failure 2023-10-12 17:57:33 -07:00
Lior Halphon
e59bc436bd CGB-C NR10 conflict improvements 2023-09-25 23:35:26 +03:00
deadmeu
55925d9149 Update desktop entry comment field 2023-09-16 18:51:38 +10:00
Lior Halphon
340d4e0630 WIP: Fix APU regressions (CGB-D/E only so far) 2023-09-09 23:54:01 +03:00
Lior Halphon
3ab6150508 Fixed weird printer related crashes on open, seems like an Apple regression? 2023-09-03 16:46:00 +03:00
Lior Halphon
5192e3a07b Merge branch 'master' of github.com:LIJI32/SameBoy 2023-09-03 15:54:42 +03:00
Lior Halphon
d662407df0 Accurate emulation of NR10 write glitches 2023-09-03 15:54:37 +03:00
Lior Halphon
4f69e4e86c Merge pull request #561 from vailkyte/tes
Force parsing order
2023-09-02 13:38:08 +03:00
vailkyte
816cdf2c62 Force parsing order 2023-09-01 22:19:06 -05:00
Lior Halphon
7542de74e7 Merge pull request #560 from rizinorg/oob-read
Fix oob reads in debugger command parsing
2023-08-19 17:05:02 +03:00
Florian Märkl
6b6800445f Fix oob reads in debugger command parsing
The length of only one of the operand strings was checked before the
memcmp in these cases, causing out-of-bounds reads when the other was
shorter.
This could be seen by compiling with ASAN and for example executing any
command longer than 2 characters.
2023-08-19 15:03:27 +02:00
Lior Halphon
240d8d1ffa Silence warning 2023-08-12 13:40:16 +03:00
Lior Halphon
3bad68f2ab Add backstep to the Cocoa button bar 2023-08-12 13:35:32 +03:00
Lior Halphon
3168e0e1fa Fixed potential deadlocks 2023-08-12 13:34:57 +03:00
Rupert Carmichael
e3fcc35922 libretro: Correctly apply filters for subsystems 2023-08-07 11:35:28 +10:00
Lior Halphon
7e6f1f866e Merge pull request #558 from arthurgiroux/bugfix/hexfiend-compilation-mac
Removed unused local variable "lineIndex" that was generating a warning.
2023-08-06 17:52:17 +03:00
Arthur Giroux
10955abe6c Removed unused local variable "lineIndex" that was generating a warning. 2023-08-06 16:47:07 +02:00
Rupert Carmichael
18afbc3770 libretro: Support blargg's NTSC filter 2023-08-06 17:10:35 +10:00
Lior Halphon
3389f50884 Merge pull request #557 from arkie/master
Add SIGUSR1 to reload to the SDL frontend
2023-08-04 23:27:53 +03:00
Jon
c709ea0d98 SIGHUP -> SIGUSR1 2023-08-04 13:53:58 -04:00
Lior Halphon
12ad85355c Build the iOS frontend without the debugger 2023-08-04 20:02:42 +03:00
Lior Halphon
a9ce9f538f Experimental backstepping support 2023-08-04 19:54:14 +03:00
Lior Halphon
0b54eea084 Change the internal macro to use hidden, which guarantees a standard ABI 2023-08-04 19:53:52 +03:00
Jon
e40e254add Add SIGHUP to reload to the SDL frontend 2023-08-02 11:35:01 -04:00
Lior Halphon
fb3db82d42 The Cocoa memory viewer new symbolicates the selection 2023-07-30 20:11:35 +03:00
Lior Halphon
ac45888a37 The memory viewer's "Go to" field can now switch banks and address spaces 2023-07-30 14:25:41 +03:00
Lior Halphon
aedb3e2332 Fix GB_debugger_evaluate not correctly returning the bank 2023-07-30 14:21:41 +03:00
Lior Halphon
048da6e6d1 Fixed a bug where accurate RTC emulation halted while SameBoy wasn't running 2023-07-29 22:27:50 +03:00
Lior Halphon
4ab256d896 Correct read emulation of the BANK register while still in the boot ROM 2023-07-29 16:08:26 +03:00
Lior Halphon
10d996330c Inclusive ranges 2023-07-29 16:05:28 +03:00
Lior Halphon
29becc2870 Treat local and non-local symbols differently 2023-07-29 14:51:31 +03:00
Lior Halphon
d209628369 Fixed a bug where breakpoint and watchpoints would sometime stop working 2023-07-29 13:45:26 +03:00
Lior Halphon
323b6fafa8 Ranged breakpoints and watchpoints 2023-07-29 01:00:36 +03:00
Lior Halphon
f2466fd770 Deprecated the IO_ symbols, rename rWAV_START and rWAV_END 2023-07-29 01:00:23 +03:00
Lior Halphon
dd1330d707 Breakpoints and watchpoints are now identified by a unique id rather than an address 2023-07-28 19:07:56 +03:00
Lior Halphon
61f3c8d7f3 Fixed an edge case where jump-to breakpoints did not work as expected/took the slow path 2023-07-28 00:49:31 +03:00
Lior Halphon
54f45f2fd3 Fix a bug where jump-to breakpoint disassembled the wrong address under certain scenarios 2023-07-28 00:47:15 +03:00
Lior Halphon
636349d5f2 Not going to use Constraints, Apple. Getting toolbar items to behave is hard enough as is 2023-07-23 22:03:42 +03:00
Lior Halphon
a5903ca5bc Do the same for the CRT shader 2023-07-23 14:20:09 +03:00
Lior Halphon
df1b89bf61 Update constants in the LCD shader that weren't updated after shaders switched to using linear RGB 2023-07-23 14:14:30 +03:00
Lior Halphon
d93c1e501c Remove outdated comments, PPU timings and and the STAT interrupt are no longer based on these sources 2023-07-08 00:55:59 +03:00
Lior Halphon
8cb4085218 Fix Xbox Wireless Controller support, closes #527 2023-07-08 00:55:16 +03:00
Lior Halphon
803abd9925 Halt and Stop trigger the OAM bug 2023-07-04 23:25:53 +03:00
Lior Halphon
49ec02b3b3 Replace cycle_oam_bug_pc with a generic call to cycle_oam_bug 2023-07-04 01:07:01 +03:00
Lior Halphon
e9be438d91 Turns out jr triggers the OAM bug, thanks Sono! 2023-07-04 00:21:57 +03:00
Tim Allen
ea05fa0c3e CI: Update the 'nightly' tag along with the release. 2023-06-28 20:41:55 +10:00
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
Lior Halphon
cc4baa1d28 LCDC write conflict emulation in double speed mode 2023-02-25 17:28:48 +02:00
Lior Halphon
1c8397e8f3 Prevent the console window from remaining open and orphaned in rare edge conditions 2023-02-24 19:13:11 +02:00
Lior Halphon
f145f05f15 Timing adjustments to object line address calculation 2023-02-19 00:32:16 +02:00
Lior Halphon
29e920697a Object aborts are DMG only, commit 34cf0f5 accidentally made them happen on CGB 2023-02-18 22:31:29 +02:00
Lior Halphon
22afa576c2 Fix incorrect timing adjustment on LCDC object abort 2023-02-18 20:42:23 +02:00
Lior Halphon
42ce9c410b Dynamic rewind/forward speed in iOS 2023-02-12 18:25:33 +02:00
Lior Halphon
ef8f3aff66 A bit more correct 2023-02-11 21:56:03 +02:00
Lior Halphon
8dd5e6d9b8 Improved emulation of joypad switching delay 2023-02-11 20:21:24 +02:00
Lior Halphon
59ecd4b9bc Explicitly set register A to 0 in the DMG, SGB, MGB, and SGB2 bootroms 2023-02-11 19:31:19 +02:00
Lior Halphon
947687ac0d Use standard function 2023-02-09 20:56:08 +02:00
Lior Halphon
3f033e1e53 Merge branch 'master' of github.com:LIJI32/SameBoy 2023-02-09 20:50:07 +02:00
Lior Halphon
175af178bd Fix imported cheats not appearing on Cocoa 2023-02-09 20:50:02 +02:00
Lior Halphon
4f8b081f82 SDL cheats 2023-02-09 20:49:01 +02:00
Lior Halphon
f79f18704d Improved cheats API, fixed incorrect GameShark imports 2023-02-09 19:49:40 +02:00
Lior Halphon
38a130714f Make the SDL menus left aligned 2023-02-09 19:49:07 +02:00
Lior Halphon
801e61a4e7 Merge pull request #525 from deltabeard/master
Fix MGB bootrom padding larger than 256 bytes
2023-02-07 14:49:21 +02:00
Mahyar Koshkouei
91c75141a8 Fix MGB bootrom padding larger than 256 bytes
mgb_boot.bin was incorrectly being padded to a CGB-size bootrom.

Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
2023-02-07 12:40:55 +00:00
Lior Halphon
e1be593a65 Expose and use the built-in accessory type enum 2023-02-05 22:59:26 +02:00
Lior Halphon
c0d6c3d6bb Merge branch 'thread_safety' 2023-02-05 21:36:03 +02:00
Lior Halphon
ed01c569d4 Correct layout on iPhone 12 and 13 Mini 2023-02-05 21:35:52 +02:00
Lior Halphon
30e2a7b7e4 Add thread safety assertions in debug 2023-02-05 19:51:11 +02:00
Lior Halphon
a040b1b395 Fixing a wrong default 2023-02-05 12:58:50 +02:00
Lior Halphon
c8b3b080a8 Remove debugging code 2023-02-04 12:49:46 +02:00
Lior Halphon
830f2ddc38 Break save state compatibility. Windows save states should now work with non-Windows save states again. 2023-02-04 02:13:01 +02:00
Lior Halphon
2b6cf0c8f1 Correctly set the B register on Nintendo-licensed games running with the built-in CGB and AGB boot ROMs 2023-02-02 23:46:23 +02:00
Lior Halphon
93aa93e42c I forgot ISX support 2023-02-02 00:21:47 +02:00
Lior Halphon
65a646f050 Expose an API to reset the rewind buffer, explicitly reset on ROM changes 2023-02-02 00:18:01 +02:00
Lior Halphon
4c8f364ad7 Force the rewind buffer to reset after the save state size changes 2023-02-02 00:06:22 +02:00
Lior Halphon
c36c7126f8 Hack to not break save state compatibility 2023-02-01 23:47:25 +02:00
Lior Halphon
7f3b3879a0 Fix ROM size rounding when loading from buffer, make size rounding a function 2023-02-01 22:07:16 +02:00
Lior Halphon
1757e1b128 Allow rewinding a state load on iOS 2023-02-01 21:59:26 +02:00
Lior Halphon
d5ff93af3b Emulate GB printer timer, letting one emulate the mini game in Hello Kitty Pocket Camera. Closes #290 2023-01-30 22:42:03 +02:00
Lior Halphon
c06e320b95 Fix the camera using the wrong aspect ratio on some Macs. Fix a bug that caused artifacts on the right and bottom edges of the camera image. 2023-01-29 23:19:26 +02:00
Lior Halphon
b032b89457 Banked breakpoints should not affect the boot ROM 2023-01-29 12:41:32 +02:00
Lior Halphon
9972ce999d Don't apply the about screen inset on button-less iPads 2023-01-29 01:45:17 +02:00
Lior Halphon
8755e505d5 y u so picky about spaces markdown 2023-01-29 00:22:56 +02:00
Lior Halphon
2e1f4445e9 Ehh how did that happen 2023-01-29 00:10:25 +02:00
Lior Halphon
8edbbbdf49 No need to run the sanity test on the auto-generated libretro branch commits 2023-01-29 00:06:41 +02:00
Lior Halphon
0cf095dd21 AudioUnits is required to link against some macOS SDKs? 2023-01-29 00:03:46 +02:00
Lior Halphon
0cf3aec939 Allow building against iOS ≥15 SDKs 2023-01-28 23:34:11 +02:00
Lior Halphon
bbf6b66251 Update readme and the GitHub action 2023-01-28 23:23:39 +02:00
Lior Halphon
5ec10d3c9a Fix the about screen 2023-01-28 23:15:05 +02:00
Lior Halphon
ed39e6258d Allow packaging both as an IPA and as a DEB package for jailbreak 2023-01-28 22:21:24 +02:00
Lior Halphon
fabc3901b8 Fix iOS dep generation 2023-01-27 19:04:54 +02:00
Lior Halphon
ff12bd2bec iPad icons 2023-01-27 19:01:37 +02:00
Lior Halphon
df248736c8 Better rewind speed (use a different amount of rewind pops rather than clock multiplier) 2023-01-27 18:00:21 +02:00
Lior Halphon
6829ebf44a File icons 2023-01-27 16:42:31 +02:00
Lior Halphon
e1075b1bdc Turbo and rewind speed controls 2023-01-27 14:55:51 +02:00
Lior Halphon
b2bbd9cfdc Camera emulation 2023-01-27 14:41:12 +02:00
Lior Halphon
8b1b5b9348 Motion controls 2023-01-26 00:00:10 +02:00
Lior Halphon
8557a2c1ec Swipe controls for rewind, turbo and quick save/load 2023-01-25 22:57:03 +02:00
Lior Halphon
e7cce8fdde Fix the theme resetting to Twilight 2023-01-24 22:56:37 +02:00
Lior Halphon
defd8d4f69 Swipe controls option, improve dpad angle thresholds 2023-01-24 22:45:51 +02:00
Lior Halphon
413212f993 Stylistic changes 2023-01-23 00:36:41 +02:00
Lior Halphon
f7ad805559 Save states 2023-01-22 22:10:55 +02:00
Lior Halphon
8ea5e8d74d More ROM management features 2023-01-21 22:51:30 +02:00
Lior Halphon
6ddc3b0f0a Settings screen 2023-01-21 19:41:38 +02:00
Lior Halphon
e582e38abc This shouldn't have been the default 2023-01-21 15:11:22 +02:00
Lior Halphon
1cc131227c Fix mathematical error in temperature_tint 2023-01-21 01:25:51 +02:00
Lior Halphon
31c53e8e05 Show unloaded ROM hint 2023-01-20 12:47:37 +02:00
Lior Halphon
e0b77d3821 Can't permanently disable the Home Bar, so the Safe Area must be followed :( 2023-01-20 12:47:29 +02:00
Lior Halphon
2530370f90 Fix opening in place 2023-01-19 21:07:28 +02:00
Lior Halphon
1fde385cd7 Visual improvements 2023-01-19 01:19:30 +02:00
Lior Halphon
d32bff58a4 Basic ROM management functionality 2023-01-19 00:47:35 +02:00
Lior Halphon
21f21f6bc7 Allow importing ROMs and Files app interaction 2023-01-18 23:08:17 +02:00
Lior Halphon
322ead9b93 Use the non-recursive methods 2023-01-18 20:31:39 +02:00
Lior Halphon
3b1fc41064 Add about screen 2023-01-17 00:07:10 +02:00
Lior Halphon
00367a79b4 Add screenshots to the ROM library (A similar functionality will be given to the state manager) 2023-01-15 23:00:06 +02:00
Lior Halphon
181a236fce Fix rumble 2023-01-15 22:07:28 +02:00
Lior Halphon
6673427c54 Add model selection 2023-01-15 21:51:27 +02:00
Lior Halphon
0549dc702c Add an API to get the model from the state file 2023-01-15 19:15:45 +02:00
Lior Halphon
a838c31d02 Add a menu 2023-01-15 18:37:25 +02:00
Lior Halphon
7f0ad795ec Recrush all graphics 2023-01-15 17:53:18 +02:00
Lior Halphon
e04aeebc0a Automatic save/restore 2023-01-15 01:43:34 +02:00
Lior Halphon
1c1d6bec78 Buttons now appear pressed when interacted with 2023-01-14 23:57:58 +02:00
Lior Halphon
d0f17cfaed Fix portrait support 2023-01-14 23:46:51 +02:00
Lior Halphon
76500ebf15 Vibration support on legacy devices 2023-01-14 21:15:25 +02:00
Lior Halphon
ffc80b2c0d Adjustments to support the 2016 iPhone SE and iPod Touch 2023-01-14 20:09:47 +02:00
Lior Halphon
e0af961ad3 CoreHaptics support for rumble and button feedback 2023-01-14 18:28:08 +02:00
Lior Halphon
3e75016fe0 Implement controls 2023-01-14 15:02:34 +02:00
Lior Halphon
7624688e3b Bare bones ROM loading functionality (requires modification of the app container to add ROMs) 2023-01-14 01:25:36 +02:00
Lior Halphon
be765a3e7e Initial emulation support 2023-01-13 23:30:28 +02:00
Lior Halphon
4c5d896630 Porting GBViewMetal 2023-01-13 21:57:57 +02:00
Lior Halphon
093998389c "Port" GBAudioClient 2023-01-13 17:24:28 +02:00
Lior Halphon
0441967332 Automatic layout generation 2023-01-13 16:48:44 +02:00
Lior Halphon
d9bf739f52 Remove auto-generated comments 2023-01-12 23:19:24 +02:00
Lior Halphon
7ed8169d30 Basic buildability 2023-01-11 17:49:10 +02:00
Lior Halphon
aa8b7b0c03 Improved emulation of envelope locking, fixes #522 2023-01-10 01:19:07 +02:00
Lior Halphon
d90ecec085 Oops 2023-01-07 15:30:29 +02:00
Lior Halphon
f5092c00de Reopening a modified ROM (via Open, Open Recent, command-line or Finder) will reload the ROM. Closes #497 2023-01-07 13:31:51 +02:00
Lior Halphon
88e64fadda More accurate and customizable timings 2023-01-06 19:06:22 +02:00
Lior Halphon
c92a2c2131 Writes affect the data bus too 2023-01-06 18:46:58 +02:00
Lior Halphon
7a390414ff Improved accuracy of open bus behavior, merged with the HDMA open bus logic (it's the same bus) 2023-01-06 12:51:36 +02:00
Lior Halphon
0e6803aaa9 Add comment 2023-01-02 00:53:51 +02:00
Lior Halphon
bd6843444f Emulate cart open bus behavior. Fixes #516 2023-01-01 22:59:16 +02:00
Lior Halphon
29d6960075 Merge pull request #521 from max-m/actions-checkout-v3
[CI] Update to actions/checkout@v3
2022-12-31 22:13:28 +02:00
Maximilian Mader
37785f779f [CI] Update to actions/checkout@v3
See https://github.com/actions/checkout/issues/1047
2022-12-30 23:04:41 +01:00
Lior Halphon
0989ee2763 Automatic libretro boot ROM rebuild 2022-12-30 19:45:33 +02:00
Lior Halphon
288bd84d19 Make libretro's build respect BOOTROMS_DIR 2022-12-30 18:04:57 +02:00
Lior Halphon
1247d00cbb Minor cosmetic change 2022-12-30 17:32:36 +02: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
Lior Halphon
9e5d3e449b Fix the Step icon on non-Retina displays 2022-11-23 19:47:53 +02:00
Lior Halphon
bbe425e695 Update version to 0.15.8 2022-11-06 13:53:18 +02:00
Lior Halphon
f1e912b64f Map the B button to back on SDL menus 2022-11-06 13:52:30 +02:00
Lior Halphon
31340d2a90 Fix debugger buttons appearing glitched on newer versions of macOS, fixes #509 2022-11-06 13:52:02 +02:00
Kawa
717606dda9 Update README.md 2022-11-03 13:15:52 +01:00
Lior Halphon
1a85abfd2a Update version to 0.15.7 2022-10-31 23:09:36 +02:00
Lior Halphon
b6e38bfa5f Microsoft and their underscore bullshit again 2022-10-31 23:04:35 +02:00
Lior Halphon
e1fa28bd54 Adjust Joy-Con terminology 2022-10-31 22:49:17 +02:00
Lior Halphon
052e2429e0 Minor optimization 2022-10-31 21:17:32 +02:00
Lior Halphon
cfee59918e Add Joy-Con orientation change support, motion controls 2022-10-31 21:11:00 +02:00
Lior Halphon
2776c8ad36 Add Joy-Con pairing interface 2022-10-30 14:42:54 +02:00
Lior Halphon
5ef668251c Rearrange the controls settings 2022-10-29 14:46:01 +03:00
Lior Halphon
a43c293629 UI cleanup 2022-10-29 00:13:54 +03:00
Lior Halphon
354f68a861 Fix uniqueIDs not being unique in combined controllers 2022-10-28 20:15:24 +03:00
Lior Halphon
6547137389 Add an API to combine controllers 2022-10-28 14:49:54 +03:00
Lior Halphon
36f084f474 Explicitly enable vibration for Switch controllers, fixes rumble for Joy-Cons 2022-10-28 13:32:06 +03:00
Lior Halphon
a450ab2a8e Basic JoyCon support, no rumble, no grouping 2022-10-28 01:02:54 +03:00
Lior Halphon
eeb15c74f9 Fix visual glitches with the debugger split divider 2022-10-24 01:07:16 +03:00
Lior Halphon
0d1f686d68 Farewell, manual line breaks 2022-10-22 18:20:05 +03:00
Lior Halphon
87a2b0c842 Give ticks an optional "keep" argument 2022-10-22 17:37:25 +03:00
Lior Halphon
6536754944 Rename method to prevent overriding an Apple internal method on newer macOS versions. Be less strict about the inclusion of $. 2022-10-21 23:53:53 +03:00
Lior Halphon
36149dfa9f Don't crash on invalid GameShark/Genie codes 2022-10-19 22:54:54 +03:00
Lior Halphon
4649cdd290 Fix a bug that made the cheats window send debugger commands 2022-10-19 22:48:54 +03:00
Lior Halphon
5d5ff1702e Add quick reset API (Closes #506) 2022-10-17 18:52:02 +03:00
Lior Halphon
9b202c670e Was technically implementation defined 2022-10-17 14:34:55 +03:00
Lior Halphon
4180348567 Fix issues where finish and next did not behave as expected 2022-10-17 14:27:11 +03:00
Lior Halphon
eef8b8448c That wasn't dead code, just another glitch. Fixes m3_wx_4_change_sprites 2022-10-16 23:57:19 +03:00
Lior Halphon
ac9e36bc1a Fix assertion regression, fix window pixel insertion glitch regression, remove dead code. Closes #504 2022-10-16 18:19:43 +03:00
Lior Halphon
e49527eff8 Shifter and fetcher information in the debugger 2022-10-16 16:04:30 +03:00
Lior Halphon
1720638017 Add margins to buttons 2022-10-15 21:31:38 +03:00
Lior Halphon
ec6612d445 Fix DMA restart regression 2022-10-15 21:31:13 +03:00
Lior Halphon
90b3e1ff38 Add launchservices category to Cocoa. Closes #505 2022-10-15 14:36:36 +03:00
Lior Halphon
b3d9404055 Merge pull request #502 from orbea/strict-prototypes
Fix -Werror=strict-prototypes
2022-10-10 23:43:24 +03:00
orbea
cbb7e018b8 Fix -Werror=strict-prototypes
This will be required for upcoming gcc and clang versions.

Reference: https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
2022-10-10 13:36:16 -07:00
Lior Halphon
832c7463bc Add comment to pb12 2022-10-04 15:06:39 +03:00
Lior Halphon
51510b53fd Update GitHub Actions to use RGBDS 0.6.0 2022-10-04 14:59:01 +03:00
Lior Halphon
c0966ceeba Update SameBoot to support RGBDS 0.6.x, RGBDS 0.4.x support dropped. Closes #500, #501 2022-10-04 14:21:54 +03:00
Lior Halphon
55507274d6 Fix build 2022-10-01 16:14:36 +03:00
Lior Halphon
36cf778232 Update the Cocoa debugger interface with buttons, add an interrupt command 2022-10-01 16:07:06 +03:00
Lior Halphon
ecaa92f853 Switch SameBoy from paused to debugger-paused on console input 2022-09-28 20:11:17 +03:00
Lior Halphon
cb33119114 Update version to 0.15.6 2022-09-18 13:30:45 +03:00
Lior Halphon
98e986b48b Oopsie 2022-09-18 13:30:36 +03:00
Lior Halphon
e545413a42 Save before swapping 2022-09-17 13:58:45 +03:00
Lior Halphon
51aa09517d SDL cart swap 2022-09-17 13:57:38 +03:00
Lior Halphon
93eb32c40f Group all options into a menu 2022-09-17 13:33:17 +03:00
Lior Halphon
abaf471350 Cart hot-swapping (Cocoa) 2022-09-17 13:17:03 +03:00
Lior Halphon
ea40a7be05 Fix DMA regression, fixes #495 2022-09-16 12:20:59 +03:00
Lior Halphon
0ebfdb840a Channel toggling in SDL 2022-09-16 12:20:23 +03:00
Lior Halphon
14c4548325 Allow muting audio channels (Missing: SDL) 2022-09-11 15:53:07 +03:00
Lior Halphon
c9a22ddfd1 Missing colon 2022-09-11 15:43:30 +03:00
Lior Halphon
7917984376 Comments 2022-09-11 15:31:05 +03:00
Lior Halphon
c580c44ad3 Constant replacements 2022-09-10 14:55:19 +03:00
Lior Halphon
4f78e4b109 Guide users to use the 'help' command in the debugger, fix apu command line breaks 2022-09-09 15:59:03 +03:00
Lior Halphon
8d2e01c4b6 Fix memory viewer Go To being broken 2022-09-09 15:52:19 +03:00
Lior Halphon
9208f82d09 Add new models and revisions to libretro 2022-09-09 14:21:14 +03:00
Lior Halphon
2f00211321 Force the timing info to update on model switch. Fixes #493 2022-09-09 00:15:49 +03:00
Lior Halphon
b380f71886 Fix broken graphics 2022-09-03 14:42:48 +03:00
Lior Halphon
c368c77d28 Use names for LCDC bits 2022-08-28 20:31:50 +03:00
Lior Halphon
5194a41d99 Slight improvements to symbol hash performance 2022-08-28 16:48:20 +03:00
Lior Halphon
7efd26c548 Allow building with older SDL versions 2022-08-24 23:59:38 +03:00
Lior Halphon
70332621cb Update version to 0.15.5 2022-08-24 23:17:20 +03:00
Lior Halphon
e7de1fccab Support for MBC RAM was broken 2022-08-23 23:35:00 +03:00
Lior Halphon
9fcac76a03 New memory management APIs 2022-08-20 21:45:14 +03:00
Lior Halphon
58750424c7 Fully reset the MBC, for correct ROM switching. Fixes #489 2022-08-20 13:09:08 +03:00
Lior Halphon
2c7343a6ad Automatically update the copyright year 2022-08-14 19:10:00 +03:00
Lior Halphon
6ecc2f15b5 Link to debugger help and sponsor pages 2022-08-14 18:44:40 +03:00
Lior Halphon
9bf7e0b4df More accurate sample repeat glitch, fixes #483 2022-08-14 17:43:28 +03:00
Lior Halphon
95773b9538 Make things const 2022-08-14 01:54:28 +03:00
Lior Halphon
52ab200544 Accurately emulate CGB first frame behavior. Fixes #432, fixes #482 2022-08-09 00:54:31 +03:00
Lior Halphon
f0959d4e70 Fix threading issue causing crashes and deadlocks 2022-08-04 01:15:25 +03:00
Lior Halphon
779ffe3e1b Fix desaturation 2022-08-03 01:06:34 +03:00
Lior Halphon
ab07f955e4 Update version to 0.15.4 2022-07-31 13:30:28 +03:00
Lior Halphon
ae1d3ddf6c Work around a Wayland bug – wait for mouse up before creating a new window #470 2022-07-31 13:30:21 +03:00
Lior Halphon
a005ebe417 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2022-07-31 13:29:26 +03:00
Lior Halphon
1bdd58d051 Auto-skip D-Pad configuration if hats are used, closes #480 2022-07-31 01:17:04 +03:00
Lior Halphon
7b5846fbaf Build break 2022-07-31 01:16:03 +03:00
Lior Halphon
d6adbe0c7f No clue why force redrawing the parent wasn't enough 2022-07-31 00:53:38 +03:00
Lior Halphon
9383acda34 Optimize performAtomicBlock 2022-07-31 00:41:27 +03:00
Lior Halphon
44618f75c4 Optimize the memory viewer, GB_INTERNAL no longer required 2022-07-31 00:32:40 +03:00
Lior Halphon
352f8d54f8 Add popover descriptions to the color correction and high-pass filter options 2022-07-30 14:31:21 +03:00
Lior Halphon
3f7bcb9af2 Rename several color correction modes, add a new accurate mode 2022-07-30 13:32:40 +03:00
Lior Halphon
0894c1dcda Avoid rounding errors in color correction, minor optimization 2022-07-29 20:31:27 +03:00
Lior Halphon
86a05e2591 Fix updater crash, closes #469 2022-07-29 20:00:05 +03:00
Lior Halphon
84a193a918 Fix shader artifacts, revise AAScale4x 2022-07-29 17:08:51 +03:00
Lior Halphon
f3915a6494 Create FUNDING.yml 2022-07-29 15:31:53 +03:00
Lior Halphon
859ff79527 Fix sanity test 2022-07-25 23:10:30 +03:00
Lior Halphon
1414e68a76 Update version to 0.15.3 2022-07-25 22:56:34 +03:00
Lior Halphon
99ac632d3a Fix creat on Windows 2022-07-25 22:56:26 +03:00
Lior Halphon
f6de7b3fbd This is wrong 2022-07-25 22:43:56 +03:00
Lior Halphon
12655cb50c Fix Windows build 2022-07-25 22:21:44 +03:00
Lior Halphon
f47e143e75 Update the boot ROM color to match SameBoy's logo slightly better 2022-07-25 19:56:44 +03:00
Lior Halphon
e0436e33d4 Use gamma correct (and nearly gamma correct) color mixing 2022-07-25 19:55:31 +03:00
Lior Halphon
43e1e85179 Style 2022-07-25 19:11:41 +03:00
Lior Halphon
ae14fcfbd7 Fix allow background controllers not working correctly on start up 2022-07-25 19:08:55 +03:00
Lior Halphon
c5362023c8 Fix false positives when detecting unwritable save paths 2022-07-25 00:26:42 +03:00
Lior Halphon
bcfe36897c Color correction improvements 2022-07-24 23:57:29 +03:00
Lior Halphon
dd435ae5f0 Fixed potential race condition in the Cocoa memory viewer 2022-07-24 17:41:34 +03:00
Lior Halphon
53dd19ec35 Update version to 0.15.2 2022-07-24 14:54:31 +03:00
Lior Halphon
10df4d7a13 Missing static 2022-07-24 14:54:14 +03:00
Lior Halphon
45bd5342e7 GBP support in SDL 2022-07-24 14:51:22 +03:00
Lior Halphon
0c2772942e Oops 2022-07-24 14:49:58 +03:00
Lior Halphon
dbd33684e8 Missed some switches 2022-07-24 14:34:32 +03:00
Lior Halphon
4db047c7d1 Make GBP selectable in Cocoa 2022-07-24 14:28:31 +03:00
Lior Halphon
6f9da353bd Add GBP model to the core (disables bouncing) 2022-07-24 14:22:49 +03:00
Lior Halphon
03f4f03661 Rename function 2022-07-24 13:56:33 +03:00
Lior Halphon
5cd65f845d Warn when progress can't be saved 2022-07-24 13:23:50 +03:00
Lior Halphon
4b03cc05c1 Optimization to joypad code 2022-07-24 13:16:19 +03:00
Lior Halphon
0f31c7a1ba Lag minimization bounce optimization 2022-07-24 02:35:46 +03:00
Lior Halphon
a524cc3105 Emulate key bouncing 2022-07-23 23:49:11 +03:00
Lior Halphon
33ba353c3a Emulate the JOYP mode switching delay on the DMG 2022-07-23 19:29:23 +03:00
Lior Halphon
0e1d6545e9 Various improvements and fixes 2022-07-23 14:38:55 +03:00
Lior Halphon
04afa64597 Can't be NULL 2022-07-23 14:24:28 +03:00
Lior Halphon
8e125b31f6 macOS compatibility, stability 2022-07-23 14:21:31 +03:00
Lior Halphon
2a29570f17 Merge remote-tracking branch 'origin/master' into openal 2022-07-23 13:41:35 +03:00
Lior Halphon
dd24801507 Merge pull request #476 from CasualPokePlayer/camera_improvements
Various GB Camera improvements
2022-07-23 13:24:50 +03:00
Lior Halphon
6a8743e13a Fix Cocoa being broken outside of a debug environment 2022-07-23 13:24:10 +03:00
Lior Halphon
93c611e9bc Values must be added to the end of a GB_SECTION for save state compatibility 2022-07-23 13:12:48 +03:00
CasualPokePlayer
bb8f973fb4 Implement GB Camera timing (when no webcam is connected), misc camera accuracy improvements, use GB_random instead of rand for noise_seed 2022-07-22 20:15:00 -07:00
Lior Halphon
f5f79f88ab Insert the pixel at the correct position 2022-07-23 01:52:33 +03:00
Lior Halphon
f75f170448 Proper fix for WX=0 in the window pixel insertion glitch 2022-07-22 19:51:38 +03:00
Lior Halphon
029b7492b6 Fix WX=0 regression 2022-07-22 19:51:20 +03:00
Lior Halphon
537d0e1b25 Fix for WX=1-6 2022-07-22 18:55:48 +03:00
Lior Halphon
ee407f07f3 Better describe softbreak 2022-07-22 13:51:56 +03:00
Lior Halphon
1fedb81ab7 Emulate window pixel insertion glitch, fixes Star Trek - 25th Anniversary, closes #278 2022-07-22 00:27:21 +03:00
Lior Halphon
3a86b868fe Add the same feature to Cocoa. Closes #474 2022-07-21 21:27:10 +03:00
Lior Halphon
349114097b Add joypad hotkeys to SDL 2022-07-19 23:55:34 +03:00
Lior Halphon
08549c1395 Typo 2022-07-19 02:19:31 +03:00
Lior Halphon
541dbc5db3 One last try 2022-07-19 01:52:38 +03:00
Maximilian Mader
de10338962 Change _audio_get_queue_length() accoring to a856566b
This also reduces the internal audio buffer size down to 5 ms,
similar to the SDL backend at 96 kHz.
2022-07-18 22:24:00 +02:00
Lior Halphon
110deee6f8 Oops 2022-07-18 23:22:23 +03:00
Maximilian Mader
43210876be Use pkg-config to check if OpenAL is available
If `pkg-config` is available, the OpenAL driver will be compiled
unless OpenAL dev headers cannot be found or `ENABLE_OPENAL=0` is set.

If `pkg-config` is unavailable `ENABLE_OPENAL=1` can be set to force
the use of OpenAL. In this case users must make sure that they have
OpenAL dev headers installed to compile successfully.
2022-07-18 22:16:34 +02:00
Maximilian Mader
8760cc5517 Mark check_al_error() as static 2022-07-18 22:16:34 +02:00
Maximilian Mader
91a2b459f9 Initialize the SDL audio system in the driver 2022-07-18 22:16:32 +02:00
Maximilian Mader
d48037beec Remove __FILE__ usage in the OpenAL driver 2022-07-18 22:15:35 +02:00
Maximilian Mader
8fa02e0ea2 Make sure that audio resumes playing after clearing the queue 2022-07-18 22:15:35 +02:00
Maximilian Mader
7a24073f6d Make sure that AL_BUFFERS_PROCESSED returns a valid value in _audio_deinit() 2022-07-18 22:15:35 +02:00
Maximilian Mader
64db300f24 Add an optional OpenAL audio driver for the SDL frontend
To compile the OpenAL driver specify `ENABLE_OPENAL=1` when
invoking `make`.
2022-07-18 22:15:35 +02:00
Lior Halphon
09cbf6a13f Fix GCC C++ warning? #464 2022-07-18 22:19:10 +03:00
Lior Halphon
a856566b54 Fixed GB_audio_get_queue_length to actually be the length rather than size, fixed XAudio2.7 audio overflow crash, changed the maximum lag limit to 1/8s rather than 1/4s. Closes #473 2022-07-18 21:56:47 +03:00
Lior Halphon
d31f34cab4 Allow the user-configured keys to be used in the SDL menu 2022-07-17 20:30:09 +03:00
Lior Halphon
96b5306ff3 Make the scrollbar draggable in SDL 2022-07-17 19:57:29 +03:00
Lior Halphon
cbf1a5481f Allow the SDL port to use custom palettes imported from Cocoa 2022-07-17 15:48:41 +03:00
Lior Halphon
9a966a5581 SDL GUI follows the DMG palette 2022-07-17 01:19:43 +03:00
Lior Halphon
500e767247 And the same feature in Cocoa as well. Closes #472 2022-07-16 18:54:16 +03:00
Lior Halphon
f9401300b5 SDL – Add setting to allow background joypad control 2022-07-16 18:23:08 +03:00
Lior Halphon
56deb4b92e Update version to 0.15.1 2022-07-08 20:10:11 +03:00
Lior Halphon
eceb2e4830 Fix SDL/tester release builds on ARM64 Macs, strip and codesign Quick Look 2022-07-08 20:08:28 +03:00
Lior Halphon
0dbfaef4cf Query the system sample rate on Windows and use it, rather than hardcode 96KHz 2022-07-08 19:51:10 +03:00
Lior Halphon
88f5b22bf6 Allow setting a non-default audio driver, fixes #466 2022-07-08 17:51:42 +03:00
Lior Halphon
d9b8e829a5 Fix crash on Windows 8.x 2022-07-08 14:17:28 +03:00
Lior Halphon
856a2b0ebe Makefile fixes, explicitly codesign the app bundle for releases 2022-07-04 00:13:05 +03:00
Lior Halphon
004c20d8e2 Handle GateKeeper and write permissions in the auto updater 2022-07-03 22:23:35 +03:00
Lior Halphon
3c4bfd2a1b Update version to 0.15 2022-07-02 22:41:17 +03:00
Lior Halphon
faccdd3e9b Correct the Windows audio dialog rate, add a default file name 2022-07-02 22:41:07 +03:00
Lior Halphon
e466c3c5b1 Ehh oops 2022-07-02 22:40:37 +03:00
Lior Halphon
7071032288 Improved MMM01 emulation, fixes #447 2022-07-02 21:03:26 +03:00
Lior Halphon
887a8104f5 Refresh icon if launched via a software update 2022-07-02 21:00:40 +03:00
Lior Halphon
a773297b3a Add CGB revision selection to the SDL frontend 2022-07-02 18:11:55 +03:00
Lior Halphon
63a858d767 Fix GBS player's appearance on Big Sur and newer 2022-07-01 22:46:03 +03:00
Lior Halphon
1065a40d8f Add rX as symbol aliases to IO_X 2022-07-01 17:40:47 +03:00
Lior Halphon
f2429e1c25 Fix IB oopsies 2022-07-01 16:24:54 +03:00
Lior Halphon
96d127e160 Remove the SLD command, reorder debugger commands 2022-07-01 16:14:52 +03:00
Lior Halphon
1b38e8c932 Prevent audio chuckling when an instance is debug-stopped 2022-06-25 20:09:23 +03:00
Lior Halphon
52a4c09855 More accurate PPU/OAM-DMA conflicts, artifacts in "It Came from Planet Zilog" should match hardware now 2022-06-25 20:08:59 +03:00
Lior Halphon
6a24598266 Grammar 2022-06-25 15:55:42 +03:00
Lior Halphon
aaf9a76b67 The vblank callback now reports the vblank type 2022-06-25 01:59:51 +03:00
Lior Halphon
58df8144ec Fix audio artifacts in the SGB jingle 2022-06-25 01:44:50 +03:00
Lior Halphon
16913f925b Oops 2022-06-24 14:24:24 +03:00
Lior Halphon
9a765820cc Runtime audio driver fallback 2022-06-24 14:18:53 +03:00
Lior Halphon
fd6b734fd0 Add XAudio2.7 as an compile-time audio driver for vanilla Windows 7 2022-06-24 14:18:30 +03:00
Lior Halphon
9ae2c9fd54 Replace SDL2 audio with XAudio2 on Windows 2022-06-23 01:13:59 +03:00
Lior Halphon
8f8b7f6b33 Minor adjustment to 32x32@2x 2022-06-18 23:10:48 +03:00
Lior Halphon
ec4c1948f5 New macOS icon (again) 2022-06-18 22:36:08 +03:00
Lior Halphon
22f8ab6509 Last fix was wrong, this is correct 2022-06-17 18:17:29 +03:00
Lior Halphon
517f455486 Theorized HDMA behavior proven wrong 2022-06-17 15:58:37 +03:00
Lior Halphon
9b5dc9eca7 Refine TILE_SEL glitch, fixes #445 2022-06-12 21:43:04 +03:00
Lior Halphon
b932f6699e Fix libretro build 2022-06-12 21:42:26 +03:00
Lior Halphon
20e9b1c655 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2022-06-12 21:29:03 +03:00
Lior Halphon
3fbeb61c09 Fix MMM01 RAM size detection (Closes #446) 2022-06-12 21:28:58 +03:00
Lior Halphon
ab4fa3a478 Merge pull request #457 from radimerry/libretro-core-options
[Libretro] Sync core options
2022-06-12 21:07:56 +03:00
Lior Halphon
4d90504688 HuC-1 mode is not a thing, fixes Robopon Japanese prototype 2022-06-11 20:57:02 +03:00
Lior Halphon
d41c188cfd More accurate Camera MBC emulation 2022-06-11 14:44:06 +03:00
Lior Halphon
24796acccf MBC7 mouse control in SDL 2022-06-10 23:51:06 +03:00
Lior Halphon
979d32faed Group keyboard and joypad controls into a submenu 2022-06-10 14:55:13 +03:00
Lior Halphon
197a475fab SDL Joypad controls for MBC7 games 2022-06-10 14:37:28 +03:00
radimerry
426d3d3a37 [Libretro] Sync core options 2022-06-10 04:12:15 +00:00
Lior Halphon
4f91b19a94 Added MBC7 BESS support, documented BESS TPP1 2022-06-05 14:09:33 +03:00
Lior Halphon
abf6e5632c Disable pkg-config on macOS 2022-05-23 22:16:06 +03:00
Lior Halphon
eb60dbce0d There you go, kouhai. Closes #455 2022-05-23 22:13:59 +03:00
Lior Halphon
12891c641b Merge pull request #453 from remind-me-later/master
fix rlc_r zero flag
2022-05-21 22:15:32 +03:00
Lior Halphon
6bd7b96ed5 Include some default editable color themes 2022-05-21 21:27:02 +03:00
Lior Halphon
95f5eeb40b Add audio recording to SDL 2022-05-21 18:18:34 +03:00
Ricardo Maurizio Paul
c79e67b8cc fix rlc_r zero flag 2022-05-21 14:45:16 +02:00
Lior Halphon
cdfcc4ca2d Audio recording in the Cocoa frontend 2022-05-21 14:33:03 +03:00
Lior Halphon
6055092249 Add audio recording APIs 2022-05-21 02:06:10 +03:00
Lior Halphon
5cc845d715 Fix scrolling not updating in the VRAM viewer 2022-05-19 23:43:31 +03:00
Lior Halphon
706135113c Fix AGB APU regression 2022-05-19 20:59:48 +03:00
Lior Halphon
8c86cff486 Fix MBC5's initial state 2022-05-14 01:33:45 +03:00
Lior Halphon
bb836662dd More accurate emulation of Hblank skip, emulation of Mode 2 skip 2022-05-14 01:14:41 +03:00
Lior Halphon
87fdf91e0c Better debugger output for scrolling adjustment 2022-05-13 00:58:21 +03:00
Lior Halphon
f866284b49 Fix the 16x16 cartridge icon 2022-05-11 03:35:17 +03:00
Lior Halphon
4521bb4767 Fixed and accurate emulation of object at x=0 timings 2022-05-11 02:15:56 +03:00
Lior Halphon
a68f749c3a Initial emulation of "SCX banging" to prolong mode 3 2022-05-09 17:15:54 +03:00
Lior Halphon
cb73e0b91a Oops, I broke the window 2022-05-09 00:43:49 +03:00
Lior Halphon
6337e3e43a Remove unused 2022-05-07 20:24:28 +03:00
Lior Halphon
ac29b4391e Refactor FIFOs 2022-05-07 19:27:25 +03:00
Lior Halphon
69a5ed3396 Fix several potential regressions 2022-05-04 19:30:29 +03:00
Lior Halphon
36e2896ec7 Fix a regression while emulating object size change during fetch 2022-05-04 00:23:55 +03:00
Lior Halphon
bef1529bb2 Merge pull request #443 from OFFTKP/issue-442
Fix random segmentation fault (fixes #442 fixes #425)
2022-04-29 01:11:30 +03:00
Lior Halphon
851d44869f No reason for this to be a do...while 2022-04-29 01:11:11 +03:00
Lior Halphon
18126994ff Downgrade hardware.inc (rgbds is old in Ubuntu's repos, used by GitHub Actions), move definitions to hardware.inc's bottom 2022-04-18 20:03:51 +03:00
Lior Halphon
51cf4c638c Merge pull request #450 from remind-me-later/bootrom_reg_names
use friendly names for HW registers instead of magic numbers
2022-04-18 19:47:09 +03:00
Ricardo Maurizio Paul
de21e8d628 use friendly names for HW registers instead of magic numbers 2022-04-18 18:09:16 +02:00
Lior Halphon
bfdab8f246 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2022-04-18 01:36:32 +03:00
Lior Halphon
b2edcc9543 Improve serial accuracy 2022-04-17 23:41:05 +03:00
Lior Halphon
2a034d4ebe Merge pull request #444 from realnc/fix-audio-perf
Libretro: Batch upload audio to frontend after video upload
2022-04-15 00:57:12 +03:00
Lior Halphon
339de0db96 Merge pull request #449 from sredna/comdlg_optim
Improve Windows open dialog handling
2022-04-15 00:55:28 +03:00
Anders
9c271a637d Improve Windows open dialog handling
- Correctly handle OleUninitialize
- Don't leak LPITEMIDLIST if SHGetPathFromIDListW fails
- Use correct nMaxFile size
- Use string alloc helper function
- Hide read-only checkbox
2022-04-14 19:43:45 +02:00
Lior Halphon
019f262531 Fix RetroAchievements support (Closes #448) 2022-04-10 11:24:42 +03:00
Nikos Chantziaras
9e8f918b27 Libretro: Batch upload audio to frontend after video upload
Uploading audio at the end of retro_run() with
retro_audio_sample_batch_t instead of using retro_audio_sample_t to
submit samples as they are generated has peformance benefits when using
low audio latency settings. Frontends that implement audio sync and DRC
(like RetroArch) will block for a long time when submitting audio. This
can cause video frame presentation to be delayed too long. Low audio
latency settings make it worse, as DRC and audio sync is performed more
often, creating a bottleneck.

Simply accumulating all generated audio samples and uploading them at
the end with retro_audio_sample_batch_t improves things condiderably.
2022-04-02 08:51:39 +03:00
Lior Halphon
b31bd58642 Consistent wording 2022-04-02 00:57:22 +03:00
offtkp
dc16104cfd fixes #442 2022-03-25 02:19:46 +02:00
Lior Halphon
79945c8c18 XIB fixes for Mavericks 2022-03-19 01:25:08 +02:00
Lior Halphon
9c7bed97d5 I hope this actually works 2022-03-15 00:37:05 +02:00
Lior Halphon
86a1977034 Visual updates for Big Sur and newer 2022-03-13 01:14:29 +02:00
Lior Halphon
9fe965bcc2 Fix skipped square tick when writing to NR13/23, fixes Telefang start screen audio on CGB-D and E 2022-03-12 15:38:05 +02:00
Lior Halphon
b5e271386a Add an optional argument to the APU command 2022-03-12 15:08:15 +02:00
Lior Halphon
ef15c9b160 More square zombie step quirks 2022-03-12 14:32:16 +02:00
Lior Halphon
d713ba85c7 Fix selected GBA model 2022-03-12 00:50:19 +02:00
Lior Halphon
ab109da683 Fix several square channel zombie stepping quirks 2022-03-12 00:49:43 +02:00
Lior Halphon
5e119548e9 GDMA during mode 3 writes to both banks, list AGB_E as a future model 2022-03-09 00:32:50 +02:00
Lior Halphon
0925b06555 Add support for Mani carts 2022-03-06 15:54:29 +02:00
Lior Halphon
965e623637 Fix several BESS compatibility issues 2022-03-06 15:53:33 +02:00
Lior Halphon
7350843cca Fix incorrect INFO block on MMM01 BESS states 2022-03-05 23:05:00 +02:00
Lior Halphon
c78a003712 MMM01 support 2022-03-05 21:20:42 +02:00
Lior Halphon
a621803e82 More compact memory usage for symbol maps, removes the 0x200 bank limit 2022-02-28 23:30:31 +02:00
Lior Halphon
777013e998 Fix the 16x16 icon 2022-02-26 13:07:09 +02:00
Lior Halphon
2c635c7a87 Add Cartridge Instances – allow multiple saves without multiple ROM copies 2022-02-26 01:47:47 +02:00
Lior Halphon
641f26e13e Fix serial close behavior 2022-02-25 14:29:21 +02:00
Lior Halphon
8073e3d39e Visual refresh, update copyright year, crush PNGs 2022-02-24 00:38:27 +02:00
Lior Halphon
4d74719d56 One day I'll just report that bug to Clang 2022-02-23 20:40:10 +02:00
Lior Halphon
f52152b2c9 Fix the Preserve Waveforms setting 2022-02-23 20:34:50 +02:00
Lior Halphon
586459bb74 Make it hex editing more reasonable while the core is running 2022-02-20 19:05:49 +02:00
Lior Halphon
7c8b9cf05a Less hacky, less buggy 2022-02-20 18:59:38 +02:00
Lior Halphon
a48f251039 New and faster palette viewer 2022-02-20 14:23:49 +02:00
Lior Halphon
9a2e8e1acf Speed things even more by cachine 2022-02-20 03:18:29 +02:00
Lior Halphon
f02bb2f0e6 New and faster OAM viewer 2022-02-20 01:59:42 +02:00
Lior Halphon
3c6a46830d Make GBImageView not slow 2022-02-19 22:13:07 +02:00
Lior Halphon
4c6bc91ded Add missing register 2022-02-14 22:59:05 +02:00
Lior Halphon
a4209b47d0 Be consistent with hex casing 2022-02-13 16:58:44 +02:00
Lior Halphon
efe31cefc9 More accurate DMA write conflicts 2022-02-13 12:56:16 +02:00
Lior Halphon
c730ba767b Not sure where I've got that 0 from 2022-02-07 00:21:45 +02:00
Lior Halphon
f8a105e8d0 Stop whining GCC 2022-02-06 14:42:53 +02:00
Lior Halphon
97c758ba75 More accurate internal bus behavior 2022-02-06 13:02:15 +02:00
Lior Halphon
4e27558ac2 Mode 2 OAM open bus behavior 2022-02-05 18:50:33 +02:00
Lior Halphon
850e7bb78c Fixed obscured object indication in the OAM viewer API 2022-02-05 17:44:10 +02:00
Lior Halphon
b5eea012cc STAT reads 0 during mode 2 if DMA is active 2022-02-05 17:43:48 +02:00
Lior Halphon
6a8db89ae5 Emulate PPU OAM reads while both DMA and GDMA are active 2022-02-05 14:52:09 +02:00
Lior Halphon
1c6ecc2e14 GDMA/DMA Timing fix 2022-02-05 14:08:56 +02:00
Lior Halphon
e7236deb11 Fixes to OAM viewer 2022-02-05 13:54:30 +02:00
Lior Halphon
ba5416ee5b Correct comment 2022-02-04 19:07:47 +02:00
Lior Halphon
320aff1d1e DMA doesn't block GDMA 2022-02-04 13:58:44 +02:00
Lior Halphon
864f0927be Timing confirmed and improved 2022-02-04 13:55:06 +02:00
Lior Halphon
7c5704621a Don't batch during stop mode 2022-02-03 22:34:14 +02:00
Lior Halphon
37ca174f37 OAM DMA/GDMA conflicts 2022-02-03 21:00:37 +02:00
Anders
cead58471d Don't determine if there is a real console with AllocConsole 2022-02-02 22:22:31 +01:00
Lior Halphon
76b881c2e1 More accurate HDMA during halt 2022-02-02 23:01:38 +02:00
Lior Halphon
967fdadd7c More accurate IR modeling, fixes Gen 2 Pokémon mystery gifts 2022-02-01 23:23:24 +02:00
Lior Halphon
1a41957b3c LCDOff behavior, basic halt/stop behavior 2022-01-31 01:02:31 +02:00
Lior Halphon
ad1f019893 Actually fix overflow behavior 2022-01-30 23:11:29 +02:00
Lior Halphon
941afee3ba Fix overflow behavior 2022-01-30 21:33:33 +02:00
Lior Halphon
dbb14d7040 Minor edge case for HDMA instant start 2022-01-30 20:52:34 +02:00
Lior Halphon
44ee6dc73f HDMA timing 2022-01-30 20:09:58 +02:00
Lior Halphon
a7f7530eed Preparation for future AGB-0 and B support 2022-01-30 18:11:35 +02:00
Lior Halphon
4bebd2bc33 Correct comment 2022-01-30 17:33:33 +02:00
Lior Halphon
3a2d028efa GDMA/PPU conflicts 2022-01-30 14:38:58 +02:00
Lior Halphon
9e3ad31df1 Fix HDMA usage in SameBoot 2022-01-29 02:12:27 +02:00
Lior Halphon
26656de44f Improvements to GDMA 2022-01-28 23:56:26 +02:00
Lior Halphon
81e2ec08e0 Oops 2022-01-23 22:07:15 +02:00
Lior Halphon
aa5a279116 Halt during DMA with objects 2022-01-23 21:05:29 +02:00
Lior Halphon
0ab7bf7749 VRAM conflicts during halt/stop on a CGB 2022-01-22 22:52:34 +02:00
Lior Halphon
196aaaa7ed Conflicts don't happen in the first 6 T-cycles 2022-01-22 16:56:32 +02:00
Lior Halphon
8676a7c7bc Typo 2022-01-22 16:36:22 +02:00
Lior Halphon
f810a2cd60 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2022-01-22 01:11:53 +02:00
Lior Halphon
582a5588ba Undo is stopped only 2022-01-22 01:11:50 +02:00
Lior Halphon
56b14c67aa Fixed AGB audio regression 2022-01-22 01:11:23 +02:00
Lior Halphon
95153af1d6 Merge pull request #431 from max-m/sdl-fix-palette-load
[SDL] Fix loading of the configured DMG palette
2022-01-20 20:43:40 +02:00
Maximilian Mader
13e0b90b47 [SDL] Fix loading of the configured DMG palette
There are four options for the DMG color palette:
- Greyscale
- Lime (Game Boy)
- Olive (Pocket)
- Teal (Light)

When loading the configuration from the `prefs.bin`
the configured `dmg_palette` gets normalized by applying
`mod 3` to it, limiting the possible values to [ 0, 1, 2 ],
thus selecting the “Teal” color palette will be saved as such,
but the next time the config gets loaded it gets reset to Greyscale.
2022-01-20 19:15:08 +01:00
Lior Halphon
ee03b1e433 Initial halt/stop during DMA support 2022-01-19 01:24:40 +02:00
Lior Halphon
cce36f1754 DMA debugger command 2022-01-18 23:42:22 +02:00
Lior Halphon
e903333c7e Add TODO 2022-01-17 22:56:13 +02:00
Lior Halphon
ab75858c86 DMA/PPU VRAM conflicts on the CGB/AGB 2022-01-17 22:07:24 +02:00
Lior Halphon
b45761146f VRAM DMA during mode 3 2022-01-16 13:50:59 +02:00
Lior Halphon
3133687e68 Potential logic bug fixes 2022-01-16 00:50:08 +02:00
Lior Halphon
dbe9035c55 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2022-01-16 00:16:12 +02:00
Lior Halphon
5088bd0959 Redundant OR 2022-01-16 00:16:06 +02:00
Lior Halphon
e922b3fc4a Merge pull request #430 from orbea/pedantic
sgb.h: Silence -Wgnu-anonymous-struct and -Wnested-anon-type warnings
2022-01-15 01:29:49 +02:00
orbea
7c9ab0fd46 sgb.h: Use GB_INTERNAL to hide internal struct data
Silences warnings in downstream projects that use a different language standard
when including gb.h.

sgb.h:14:9: warning: anonymous structs are a GNU extension [-Wgnu-anonymous-struct]
        struct {
        ^
sgb.h:14:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
        struct {
        ^
2022-01-14 15:26:15 -08:00
Lior Halphon
eaeeb49612 Minor stylistic changes 2022-01-14 22:26:23 +02:00
Lior Halphon
b92dd51101 Merge pull request #429 from orbea/pedantic
Silence more -pedantic warnings
2022-01-14 22:23:30 +02:00
orbea
adfc329cdf gb.h: Silence -Wembedded-directive warning with -pedantic
gb.h:731:2: warning: embedding a directive within macro arguments has undefined behavior [-Wembedded-directive]
\#define GB_REWIND_FRAMES_PER_KEY 255
 ^
2022-01-14 11:40:55 -08:00
orbea
5cf71b406e gb.h: Silence -Wembedded-directive warnings with -pedantic
gb.h:400:2: warning: embedding a directive within macro arguments has undefined behavior [-Wembedded-directive]
\#ifdef GB_BIG_ENDIAN
 ^
gb.h:410:2: warning: embedding a directive within macro arguments has undefined behavior [-Wembedded-directive]
\#endif
 ^
2022-01-14 11:40:55 -08:00
Lior Halphon
d92148b461 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2022-01-14 17:09:49 +02:00
Lior Halphon
ffa53eda20 DMA during mode 3 emulation 2022-01-14 17:09:39 +02:00
Lior Halphon
4ce8e77796 More accurate OAM access timings 2022-01-14 15:07:50 +02:00
Lior Halphon
20cbc896a1 Merge pull request #428 from orbea/pedantic
gb.h: Silence -pedantic warnings
2022-01-14 13:39:48 +02:00
orbea
fefb81ab65 gb.h: Silence -pedantic warnings
Silences warnings such as the following when including gb.h as a dependency.

gb.h:385:6: warning: extra ';' inside a struct [-Wextra-semi]
    );
     ^
2022-01-13 20:12:58 -08:00
Lior Halphon
ec012cf9f8 is_dma_restarting hack no longer needed 2022-01-12 14:12:55 +02:00
Lior Halphon
c4a14ac4db Simplify DMA code, fix DMA read timing 2022-01-12 00:26:18 +02:00
Lior Halphon
b1187919d3 Fixed a bug with the joy_accessed API 2022-01-09 16:43:32 +02:00
Lior Halphon
2c71ca789f Fixed a regression caused by a recent optimization 2022-01-09 15:36:01 +02:00
Lior Halphon
8df572f92e Comment fix 2022-01-09 15:30:33 +02:00
Lior Halphon
b7f03dea8d Add CGB-A support 2022-01-05 21:55:46 +02:00
Lior Halphon
ab1d4cd26e More DMA write conflicts 2022-01-05 21:40:10 +02:00
Lior Halphon
5e7bb0f891 DMA write conflict revision differences 2022-01-04 19:59:46 +02:00
Lior Halphon
79ec22b28e Clang hates this 2022-01-03 17:55:00 +02:00
Lior Halphon
5c17c0ec3b unreachable fun 2022-01-03 17:17:35 +02:00
Lior Halphon
cd16431699 OMA DMA improvements (WIP) 2022-01-03 16:51:45 +02:00
Lior Halphon
81e45b00b9 Minor Cocoa bug fixes 2022-01-03 16:51:24 +02:00
Lior Halphon
c7298ae5a6 Fix a silly underflow 2022-01-03 16:51:05 +02:00
Lior Halphon
8e675295a8 Enable LTO in Windows builds, fix missing MGB boot in SDL 2021-12-31 00:40:34 +02:00
Lior Halphon
bc073e3d09 Expose PC 2021-12-30 23:53:24 +02:00
Lior Halphon
52c5610528 Cocoa audio driver goes brrrr 2021-12-29 17:21:06 +02:00
Lior Halphon
38eafeb0cf Never deadlock ever again thanks 2021-12-29 17:03:44 +02:00
Lior Halphon
97652b7460 Cocoa audio bugfix 2021-12-29 16:53:28 +02:00
Lior Halphon
59c315a5dd Minor free optimization 2021-12-29 16:33:04 +02:00
Lior Halphon
b72c2ea225 DMG palette getter 2021-12-29 13:08:46 +02:00
Lior Halphon
769aac93c0 Lazy APU, extra ~17% speed up 2021-12-29 00:48:44 +02:00
Lior Halphon
db50462710 More accurate fix 2021-12-26 23:24:08 +02:00
Lior Halphon
59dfb1a85a It's not verified because it's wrong 2021-12-26 21:57:40 +02:00
Lior Halphon
6ffe924637 This is probably better but still wrong 2021-12-26 21:43:54 +02:00
Lior Halphon
d178ece909 Disabled an incorrectly emulated portion of the TILE_SET glitch 2021-12-26 19:57:18 +02:00
Lior Halphon
6e7ba7589c Fixed blurred unfiltered screenshots 2021-12-26 18:38:08 +02:00
Lior Halphon
66f7babe86 Cache the clock rate 2021-12-26 15:50:24 +02:00
Lior Halphon
c53d99dbc4 Abolished slow double use 2021-12-26 15:20:46 +02:00
Lior Halphon
c5f6be1e64 Several likely/unlikely optimization, saving on a memset 2021-12-26 02:38:54 +02:00
Lior Halphon
69de3f0fae Implement a PPU fast path, up to 34% performance boost 2021-12-26 01:47:59 +02:00
Lior Halphon
f3277ab8d3 Sorry C++ users 2021-12-20 18:59:51 +02:00
Lior Halphon
e9906e44cd Sure, why not 2021-12-19 21:46:22 +02:00
Lior Halphon
f866441481 Improved emulation of channel 3 wave RAM read glitch 2021-12-19 19:27:40 +02:00
Lior Halphon
e9629407a5 Fix potential alignment issues 2021-12-19 00:54:29 +02:00
Lior Halphon
cdc3321c36 Add an API to allow illegal inputs 2021-12-19 00:28:24 +02:00
Lior Halphon
eaccd792ed Fixes to safe reads, closes #422 2021-12-18 14:56:33 +02:00
Lior Halphon
5127cb0022 Direct access to registers (#422) 2021-12-18 14:51:14 +02:00
Lior Halphon
c63ddbe771 Lag frame detection API (#422) 2021-12-18 01:25:06 +02:00
Lior Halphon
c3d9141b7c Replace the term sprite with object for consistency 2021-12-17 21:16:23 +02:00
Lior Halphon
c1ae129ed4 Allow hiding background/object "layers" (#422) 2021-12-17 21:12:26 +02:00
Lior Halphon
f78fac12c2 Fixed several issues involving LY change timing, as well as an LYC issue in models prior to CGB-D 2021-12-14 20:27:38 +02:00
Lior Halphon
7e5e672988 RTC speed multiplier, for TAS syncing (#422) 2021-12-11 02:51:21 +02:00
Lior Halphon
a30247cf16 LCD line callback (for #422) 2021-12-10 19:49:52 +02:00
Lior Halphon
7508ddb0cf Execute callback (for #422) 2021-12-10 19:42:47 +02:00
Lior Halphon
e087bd5218 The GBS visualizer should use custom color palettes 2021-12-10 02:06:12 +02:00
Lior Halphon
9e57201b08 Accurate IF clear timing 2021-12-05 16:18:54 +02:00
Lior Halphon
25e3414974 Redesigned vblank callback scheduling scheme, should be more regular and less prune to various sorts of frontend DOS 2021-12-04 15:04:46 +02:00
Lior Halphon
4b3c77bfa5 oops 2021-12-02 11:54:26 +02:00
Lior Halphon
8660e20eeb New inputs API 2021-12-02 11:23:44 +02:00
Lior Halphon
b770bbea2e Fix save state issue that caused vblank callbacks timings to differ 2021-12-02 11:21:12 +02:00
Lior Halphon
486f8a2c10 Merge pull request #420 from SnowyMouse/cgb_mode
Add GB_is_cgb_in_cgb_mode
2021-11-26 14:10:35 +02:00
Lior Halphon
06b744259b Add memory write callback, optimize memory access with likely/unlikely 2021-11-26 14:09:41 +02:00
Lior Halphon
bdbe02b043 Add a safe memory read API 2021-11-26 13:54:28 +02:00
Lior Halphon
33090a5cc0 Fix an oops from the last commit 2021-11-26 13:38:52 +02:00
Snowy
d0a9d2f72a Add GB_is_cgb_in_cgb_mode 2021-11-25 17:16:11 -06:00
Lior Halphon
f1e5e04198 ...even when timekeeping is disabled 2021-11-25 21:46:51 +02:00
Lior Halphon
d0d39015ee Let update_input_hint_callback get called during turbo 2021-11-25 21:17:49 +02:00
Lior Halphon
f08f16346e Fix #293 2021-11-24 23:13:52 +02:00
Lior Halphon
d94c8b9125 Switch Pro Controller motion controls 2021-11-22 23:29:10 +02:00
Lior Halphon
d15eaf4134 Mouse controls for MBC7 2021-11-14 21:43:31 +02:00
Lior Halphon
ae930472f0 Units info 2021-11-14 13:18:58 +02:00
Lior Halphon
7a78649e21 Implement motion controls in JoyKit, implement accel/gyro in DualSense and DualShock 4, implement motion controls in Cocoa 2021-11-13 19:23:45 +02:00
Lior Halphon
06ce30d3a8 Map joysticks to motion controls 2021-11-12 18:10:03 +02:00
Lior Halphon
c6f39bc60b Initial MBC7 support 2021-11-12 17:44:51 +02:00
Lior Halphon
02f55d12d3 Maybe one day GCC will stop being shit at handling __attribute__s 2021-11-07 14:13:52 +02:00
Lior Halphon
1650820edb Clean up endian-related code 2021-11-07 13:57:43 +02:00
Lior Halphon
18e7a3f4fa Cleanup, better symbol handling, improves LTO 2021-11-07 13:39:18 +02:00
Lior Halphon
fbf1bb7f98 Save state compatibility breaking cleanup 2021-11-07 12:56:46 +02:00
Lior Halphon
5565c2540b Register name and info update 2021-11-06 13:34:34 +02:00
Lior Halphon
4a7afb246d Fix some oopsies 2021-11-05 21:45:54 +02:00
Lior Halphon
178860e715 Custom palette and editor 2021-11-05 19:07:27 +02:00
Lior Halphon
f237b1e9b9 CGB-0 support 2021-11-04 00:35:44 +02: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
6cd13be624 Add CGB-B support 2021-10-30 20:58:57 +03:00
Lior Halphon
b54365fc40 Merge branch 'v0.14.x' 2021-10-30 18:40:27 +03:00
Lior Halphon
72b6d6c532 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2021-10-30 18:31:47 +03: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
fd8c9bba5d Detect missing ANSI support on Windows 2021-10-30 16:03:33 +03:00
Lior Halphon
1f7b20251b Improved sanitation for save states for better security and stability 2021-10-30 16:03:13 +03:00
Lior Halphon
93ef8d7db8 Merge pull request #411 from SnowyMouse/sprite_h
Fix partially offscreen sprites not being returned in GB_get_oam_info
2021-10-27 01:44:26 +03:00
Lior Halphon
739a9eb2bf Use a monospaced font in the palette viewer 2021-10-27 01:43:36 +03:00
Lior Halphon
e6c4ceaf5a Add CGB-D support 2021-10-27 01:40:28 +03:00
Snowy
2ec573c84a Change y to a signed value 2021-10-24 11:15:28 -05:00
Lior Halphon
5b9746084d Writes to SVBK should work before the boot ROM is disabled 2021-10-23 23:51:48 +03:00
Lior Halphon
18007f0e53 MGB support 2021-10-23 23:28:54 +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
Lior Halphon
8f9365251d Timing adjustments 2021-10-10 13:30:30 +03:00
Lior Halphon
b580e63c37 Fix 7-part SGB commands 2021-10-10 02:55:12 +03:00
Lior Halphon
d263a8f6f8 Fix sanity 2021-10-09 23:12:49 +03:00
Lior Halphon
46e1b79b63 Madden 96 needs even more time 2021-10-09 23:07:15 +03:00
Lior Halphon
6b947c46bc Correct blank image detection on SGB 2021-10-09 22:41:43 +03:00
Lior Halphon
893d7d162a Don't try to render tiles 100-3FF 2021-10-09 22:34:43 +03:00
Lior Halphon
85da5b64d3 Some games like racing the SGB 2021-10-09 22:02:40 +03:00
Lior Halphon
a7c8b702da Some games like to race with the SGB border fade 2021-10-09 21:08:17 +03:00
Lior Halphon
f1761340fc Fix ATTR_SET command 2021-10-09 18:45:08 +03:00
Lior Halphon
3b1094058b Add SGB and CGB flags to the tester 2021-10-09 15:57:15 +03:00
Lior Halphon
004b004f98 Fix inverted key buttons in the SDL menu, fixes #401 2021-10-09 15:27:18 +03:00
Lior Halphon
191f7cee02 Improved emulation of SGB multiplayer, fixes #405 2021-10-09 14:52:28 +03:00
Lior Halphon
164a870189 Cleanup uses of gb->registers 2021-10-09 14:09:51 +03:00
Lior Halphon
24af1c5a31 Newly discovered OAM corruption trigger 2021-10-09 14:05:29 +03:00
Lior Halphon
c05c3c2abd Improved accuracy of mid-line SCX writes 2021-10-08 19:36:05 +03:00
Lior Halphon
d4999fbbdb Give APU tests more time 2021-10-07 18:30:09 +03:00
Lior Halphon
ef053ff113 APU regression fix 2021-10-07 18:25:54 +03:00
Lior Halphon
d1caeafe5e Better handling of tiny ROMs 2021-10-05 19:53:43 +03:00
Lior Halphon
9a957674d9 Fix broken action 2021-10-05 19:53:19 +03:00
Lior Halphon
345e51647f API issue – RTC data should not be wiped after GB_reset 2021-09-30 21:23:52 +03:00
Lior Halphon
8068ff41fb Fix potential future compatibility issue, update workflow environments 2021-09-29 21:57:39 +03:00
Snowy
20d580881a Handle missing background.bmp 2021-09-26 23:08:13 -05:00
Lior Halphon
1050a7a533 More size changes for Big Bloat 2021-09-26 00:10:19 +03:00
Lior Halphon
6e2abe23ef Merge branch 'master' of https://github.com/LIJI32/SameBoy 2021-09-25 21:55:29 +03:00
Lior Halphon
7aca04f4c4 Things need to be slightly bigger in Big Sur 2021-09-25 21:55:12 +03:00
Lior Halphon
24a7467735 Merge pull request #406 from Talkashie/master
Fixed a typo in the debugger
2021-09-24 20:33:56 +03:00
Lior Halphon
84c5f8b92d Fix #402 2021-09-22 20:53:04 +03:00
Lior Halphon
51be70275d Fix broken wave RAM initialization in the boot ROM 2021-09-22 17:59:20 +03:00
Talkashie
2dc0e14d0a Update debugger.c
Fixed a typo
2021-09-13 21:20:19 -05:00
Lior Halphon
c25c94d142 Minor improvements to console behavior on startup 2021-09-10 14:17:07 +03:00
Lior Halphon
c5d91fc448 New console readline-like interface for the SDL port 2021-09-09 00:13:09 +03:00
Lior Halphon
336bc65dbf Remove Cocoa spam from the SDL port 2021-09-09 00:11:49 +03:00
Lior Halphon
d8a9f12a4f Smooth scrolling in the SDL port on macOS 2021-09-06 15:21:02 +03:00
Ghislain Antony Vaillant
e5809740a5 Reorder optimal audio drivers
Same order as defined in ares, which favor pulseaudio over ALSA.
2021-09-06 15:24:47 +10:00
Lior Halphon
b27bd4eed7 Remove redundant condition 2021-09-04 18:15:22 +03:00
Lior Halphon
e5454a39b7 Block wave RAM writes on the AGB 2021-09-04 14:18:46 +03:00
Lior Halphon
0ca1ee6a35 Minor APU clean ups 2021-09-02 01:29:38 +03:00
Lior Halphon
eefaac3d04 NR32 was treated as the wrong value on APU reset 2021-08-31 23:28:05 +03:00
Lior Halphon
3c6d094763 Update version to 0.14.5 2021-08-01 16:19:40 +03:00
Lior Halphon
50bf8c4919 Fixed a bug that sometimes prevented GBS files from being opened 2021-08-01 15:11:33 +03:00
Rupert Carmichael
063e645ff2 nall: File timestamp fix for OpenBSD and DragonFly BSD, add DragonFly BSD to PLATFORM_BSD definition 2021-08-01 14:50:01 +10:00
Rupert Carmichael
3ccb543622 Set up SameBoy log callback 2021-08-01 09:49:13 +10:00
Rupert Carmichael
8c1f41e65a Build updates for SameBoy 0.14.4 2021-08-01 09:48:51 +10:00
Tim Allen
56e359af28 Merge commit 'de500cd397f6028e43574ecd36168bc4665e30bc' into update-subtrees 2021-08-01 09:46:40 +10:00
Tim Allen
139a44b142 Merge commit 'fba00e5d3404e1bcfe1007ee2e3bfc3b3bb888af' into update-subtrees 2021-08-01 09:46:29 +10:00
Kawa
fba00e5d34 Merge pull request #33 from carmiker/master
Whitespace consistency in OpenBSD-specific code
2021-07-31 14:45:49 +02:00
Rupert Carmichael
d31ac2e10b Whitespace cleanup in OpenBSD-specific code 2021-07-30 21:16:15 -04:00
Lior Halphon
de500cd397 Update version to 0.14.4 2021-07-30 19:09:18 +03:00
Lior Halphon
c459058156 That was silly 2021-07-30 14:10:04 +03:00
Lior Halphon
48397683b8 Merge pull request #389 from tommitytom/master
Fix Windows build in clang-cl
2021-07-30 13:50:26 +03:00
Lior Halphon
0b2411ecc6 Merge branch 'libretro-core-options' 2021-07-29 23:29:47 +03:00
Lior Halphon
c7e8d7fa13 Minor cleanup 2021-07-29 23:19:13 +03:00
Lior Halphon
6138833b28 Style fixes 2021-07-29 23:03:36 +03:00
Lior Halphon
690a263648 Major improvements to JoyKit, fixing Xbox and 8BitDo controllers as well as analog mappings in PS controllers in some situations 2021-07-29 22:43:55 +03:00
Morilli
41f30f348a Remove unnecessary WIN* defines.
We keep WINVER and _WIN32_WINNT because different versions of mingw-w64 have different defaults.

Fixes #198.
2021-07-28 15:09:19 +10:00
Lior Halphon
0ff882f3bc Actually do what the previous commit claimed to do 2021-07-28 00:47:19 +03:00
Lior Halphon
b454ee28db Fix an issue where SameBoot gave DMG games the wrong palette and needlessly drew the DMG boot tilemap 2021-07-27 22:18:28 +03:00
Lior Halphon
4d1a28f1d1 Improved OAM bug accuracy in several read edge cases 2021-07-25 16:34:34 +03:00
Tim Allen
e8105c46a7 Add a link to the official Discord.
With Near's death, we no longer have access to update https://bsnes.dev,
so we'll need to put links in the README now.
2021-07-12 18:51:52 +10:00
Lior Halphon
1d7692cff5 Fix blurry VRAM viewer grid lines 2021-07-11 23:12:46 +03:00
Lior Halphon
a5325d3374 Improved ticks command, more accurate speed switch timings, better odd-mode warnings 2021-07-11 21:49:58 +03:00
Lior Halphon
6f6f72dcbd More accurate emulation of STOP 2021-07-11 12:11:12 +03:00
Lior Halphon
efb644bc72 MBC5 RAM enable is 8 bit 2021-07-10 15:02:15 +03:00
Rupert Carmichael
52d9bfde94 Port to OpenBSD 2021-07-06 20:09:44 +10:00
Ryunam
75ec1c0334 [Libretro] Fix small typo in palette description 2021-06-27 11:22:27 +02:00
Ryunam
e1453f1961 [Libretro] Upgrade Core Options to v1.3 2021-06-26 23:40:22 +02:00
Lior Halphon
278224299f Fixed double->single speed switch causing misaligned CPU timing 2021-06-26 13:55:34 +03:00
Lior Halphon
94add1d172 Add "Harsh Reality" color correction mode 2021-06-25 19:57:56 +03:00
Lior Halphon
a2d34c9bd9 Add -s/--stop-debugger flag to SDL, closes #392 2021-06-25 17:12:05 +03:00
Lior Halphon
ceacc226bc Fixed Switch Pro Controller in USB mode 2021-06-23 21:21:53 +03:00
Lior Halphon
23e8cc58c5 Vblank should occur 1 T-cycle later 2021-06-19 02:14:16 +03:00
Lior Halphon
b4709fd66b Disabled an accuracy-improvement-attempt that caused audio regressions until the proper behavior is well understood, fixes #390 2021-06-18 01:36:29 +03:00
Lior Halphon
339613263c Fixed a bug that prevented STAT interrupt blocking from functioning correctly in the transition to VBlank while the OAM interrupt was disabled 2021-06-18 01:20:05 +03:00
Tom Yaxley
a12ec3c8c8 Fix Windows build in clang-cl 2021-06-06 12:04:47 +10:00
Lior Halphon
7a6ae2d951 Improved DualSense LEDs, fix several analog controls issues 2021-06-04 22:21:41 +03:00
Lior Halphon
e71d3a7d3c First-tier support for DualSense controllers with rumble and LED support 2021-06-04 18:17:14 +03:00
Lior Halphon
b444ecd1ee Fix configuration of analog shoulder buttons for analog turbo/slow motion when using a PS5 controller 2021-06-01 00:46:06 +03:00
Lior Halphon
1e5e236e84 Correct default mapping for PS5 and PS4 controllers 2021-06-01 00:33:25 +03:00
Lior Halphon
ebb0cb5e81 Added optional OSD (SDL) 2021-05-30 23:39:59 +03:00
Lior Halphon
3ed18a76da Added optional OSD (Cocoa) 2021-05-30 20:55:04 +03:00
Morilli
64d484476d Fix vector<T>::acquire() arguments 2021-05-26 17:02:48 +10:00
Lior Halphon
033f025851 Added volume control to the Cocoa port 2021-05-21 18:12:29 +03:00
Lior Halphon
75d3470d55 That code made very little sense 2021-05-19 00:15:02 +03:00
Lior Halphon
fcbbecea17 Fix #386 2021-05-18 20:21:21 +03:00
Lior Halphon
2afeb7dee3 Place a cap on the GBS file size 2021-05-17 17:11:41 +03:00
Lior Halphon
ea67a7e3f0 Merge pull request #379 from jprjr/gbs-buffer
gbs: function to load from memory buffer
2021-05-17 16:53:12 +03:00
Lior Halphon
9b2dfe7ae2 Style fixes 2021-05-17 16:52:55 +03:00
Lior Halphon
e9ab7fa7df Merge pull request #382 from Mailaender/patch-1
Fixed the desktop categories
2021-05-17 16:44:53 +03:00
Lior Halphon
c944142b36 Fall back to .snX if no .sX save state found 2021-05-07 00:33:04 +03:00
Lior Halphon
a4a8ad00d5 Display usage on invalid options 2021-05-06 00:26:45 +03:00
Lior Halphon
0dff3ef144 A flag to disable OpenGL, better and more stable handling of no-OpenGL mode 2021-05-06 00:23:46 +03:00
Lior Halphon
1d0366052d Updater support 2021-04-25 22:28:24 +03:00
Matthias Mailänder
898ef2c981 Fix the desktop categories. 2021-04-23 20:43:34 +02:00
Lior Halphon
ea05a0c765 Don't save 0x6000 for MBC3 in BESS 2021-04-23 21:05:33 +03:00
Lior Halphon
ac5b0aca2c RTC accuracy fix 2021-04-23 21:01:17 +03:00
John Regan
0e8d8effdf gbs: function to load from memory buffer 2021-04-20 08:38:53 -04:00
Lior Halphon
a2d3b8c174 Support for non-standard GBS files with a loading address at 0 2021-04-19 20:58:27 +03:00
Lior Halphon
c29edc1963 Handle loading errors 2021-04-19 20:57:28 +03:00
Lior Halphon
2971b17701 Add support for ugetab's GBS extensions, fixes #377 2021-04-19 00:32:10 +03:00
Lior Halphon
5f2e893828 Allow GBS files with loading addresses 0x6E-0x3FF, fixes #376 2021-04-19 00:08:21 +03:00
Lior Halphon
d9b9385eb4 Typo fix 2021-04-17 18:13:19 +03:00
Lior Halphon
939817df73 Update version, finalize BESS 1.0 2021-04-17 16:59:22 +03:00
Lior Halphon
e8158be454 Merge branch 'bess' into gbs 2021-04-17 16:57:05 +03:00
Lior Halphon
9fcdc082d2 Fix an SDL crash, minor tweak to BESS SGB 2021-04-17 16:37:55 +03:00
Lior Halphon
817c4a7752 Merge branch 'bess' into gbs 2021-04-16 16:35:21 +03:00
Lior Halphon
87a2d48675 Redo TPP1 saving, fix RTC and HUC3 in BESS 2021-04-16 00:35:54 +03:00
Lior Halphon
f0a6488546 Added optional INFO block 2021-04-15 21:57:38 +03:00
Lior Halphon
2078c2a8fb Use semantic popup icons instead of always using error 2021-04-15 02:42:31 +03:00
Lior Halphon
98a39ae49a ATTR_CHR does not seem to wrap around screen (only lines/columns) 2021-04-14 23:39:07 +03:00
Lior Halphon
b325148544 Update and clarify specification 2021-04-14 23:37:00 +03:00
Lior Halphon
ba6e22dfc0 Merge branch 'bess' into gbs 2021-04-14 16:44:51 +03:00
Near
55e05c89c2 Fix critical undefined bit-shift length operation
Natural/Integer<T>.bit() (BitRange) was shifting by whatever type the source was to match the target bit length.
But this breaks when the target type is u64/s64 and the source type is u32/s32 or smaller. Shifting by >=32 becomes undefined behavior.
We have to cast the input source to the target type first, so that the source<<shift result is valid.
This is safe here regardless of source's signedness, because it's only used in =, &=, ^=, |= operations.
2021-04-14 22:55:36 +10:00
Lior Halphon
dd86077410 Use the older, more available API 2021-04-14 15:24:06 +03:00
Lior Halphon
8a84a5897e Allow drag&drop of state files 2021-04-14 15:20:01 +03:00
Lior Halphon
c1509b6339 KEY0 info 2021-04-13 23:34:49 +03:00
Lior Halphon
6f0b640702 More clarifications 2021-04-13 22:32:45 +03:00
Lior Halphon
79f109b463 Clarify MBC block 2021-04-13 22:08:25 +03:00
Lior Halphon
43fb86320e Hard fail on unexpected SGB blocks 2021-04-13 22:05:13 +03:00
Lior Halphon
0af4f1fa4d Clarify SGB multiplayer, handle count = 0 2021-04-13 21:33:13 +03:00
Lior Halphon
24915e41eb TPP1 in BESS 2021-04-13 20:56:09 +03:00
Lior Halphon
976f5e4d02 Merge branch 'master' into bess 2021-04-13 20:50:29 +03:00
Lior Halphon
fada772cb1 Don't use BESS for internal in-memory saves 2021-04-13 20:35:07 +03:00
Lior Halphon
dfdbff7304 Allow writes to the $a000-$bfff range in the MBC block 2021-04-13 16:01:44 +03:00
Lior Halphon
6ee488688b Update spec 2021-04-13 01:11:06 +03:00
Lior Halphon
a3a73602fc ATF is only 0xFD2 bytes, not 0xFE0 2021-04-13 01:09:29 +03:00
Lior Halphon
5b993ed775 Add HuC3 to BESS 2021-04-12 23:36:42 +03:00
Lior Halphon
4346b063f5 Wording 2021-04-12 22:48:05 +03:00
Lior Halphon
9c1889f450 Actually update spec 2021-04-12 22:43:23 +03:00
Lior Halphon
9a1f962281 Spec update 2021-04-12 22:39:13 +03:00
Lior Halphon
251dd15ff9 Fixed a bug where the screen would not redraw when certain controllers are rumbling in specific strengths in the Cocoa port 2021-04-11 23:36:42 +03:00
Lior Halphon
80f422d0ca Respect TPP1 feature flags for rumble and RTC 2021-04-11 23:16:31 +03:00
Lior Halphon
763de9d2e0 Fix Rumble support in TPP1 2021-04-11 22:52:34 +03:00
Lior Halphon
42471095e4 Normalize invalid weekdays only after a $11 command 2021-04-11 22:38:25 +03:00
Lior Halphon
0c5e15b49d Correct emulation of count overflow in ATTR_CHR, fixes #372 2021-04-11 02:38:58 +03:00
Lior Halphon
f24489b983 TPP1 support 2021-04-10 23:56:41 +03:00
Lior Halphon
44c75ae7be Remove commented out code 2021-04-10 18:43:24 +03:00
Lior Halphon
ad05eb6d0a GCC build fix 2021-04-10 16:15:40 +03:00
Lior Halphon
955ef59140 Merge branch 'bess' into gbs 2021-04-10 16:12:35 +03:00
Lior Halphon
f89c80caa5 Merge branch 'master' into bess 2021-04-10 16:12:03 +03:00
Lior Halphon
d0bbf383d6 Another cheat bugfix 2021-04-10 16:10:23 +03:00
Lior Halphon
6ddfcc9725 Added visualizer to the GBS player, various GBS UI improvements 2021-04-10 16:10:10 +03:00
Lior Halphon
77384a5f6a Merge branch 'bess' into gbs 2021-04-09 23:12:03 +03:00
Lior Halphon
20ffa27dd4 Forgot to commit the document update 2021-04-07 21:45:43 +03:00
Tim Allen
4ea984b688 sfc: You can turn off auto-joypad-polling while it's in progress.
Discovered by Jonas Quinn, and originally implemented for higan in commit
e422ddc.
2021-04-06 21:43:31 +10:00
Tim Allen
34af95da9e sfc: Remove unused auto-joypad-polling variables.
These variables stopped being useful after commit 39c37ec, which switched to
tracking auto-polling state in the autoJoypadCounter variable.
2021-04-06 21:43:31 +10:00
Lior Halphon
1c31812ffd BESS format updates 2021-04-06 01:02:49 +03:00
Lior Halphon
7a558492b6 Merge branch 'master' into bess 2021-04-05 23:10:00 +03:00
Lior Halphon
e6fa2336da Fix a potential crash/corruption when modifying cheats 2021-04-05 23:09:32 +03:00
Lior Halphon
f67d3947d6 UI Updates 2021-04-05 23:08:43 +03:00
Tim Allen
83e76c87eb hiro: Disable padding for the GTK+3 backend.
GTK+3 is designed for automatic layout, where widgets are automatically sized
and positioned according to the size of their contents. However, hiro has to be
compatible with Windows, which lacks an automatic layout system, so hiro apps
tend to position widgets manually.

Unfortunately, the GTK+3 default theme uses much bigger widgets than GTK+2 or
Windows, so hiro apps using the GTK+3 backend tend to have ugly, overlapping
widgets. To make GTK+3 behave more like other hiro targets, we add custom CSS
and override the default theme at runtime.

Fixes #168.
2021-04-03 19:24:31 +11:00
Lior Halphon
bb3a73ff88 Cocoa GBS Player 2021-04-03 01:29:43 +03:00
Lior Halphon
9996c7b4a2 Add GBS APIs 2021-04-03 01:29:06 +03:00
Lior Halphon
39c71b40e7 Fix memory leak 2021-04-02 19:07:28 +03:00
Lior Halphon
328e2d9e40 Merge branch 'master' into gbs 2021-04-02 19:06:15 +03:00
Lior Halphon
6b8eb8063a Fix a bug where SameBoy would start in "faux turbo mode" 2021-04-02 02:54:14 +03:00
Lior Halphon
b7348b5478 Add BESS format documentation 2021-04-01 00:16:28 +03:00
Lior Halphon
e460b0a7b4 Change the border format to SNES-style 2021-03-31 00:54:55 +03:00
Lior Halphon
9314bcf98d Merge pull request #371 from Jan200101/patch-1
Correct usage of PREFIX with DATA_DIR
2021-03-30 20:45:21 +03:00
Jan
48ec3e6413 Correct usage of PREFIX with DATA_DIR
slipped through in #370
DATA_DIR is not relative to PREFIX so having it is problematic
2021-03-30 17:29:55 +02:00
Lior Halphon
8adaba237e SGB support in BESS, BE fixes, changes to SGB save state format on BE machines 2021-03-29 02:47:57 +03:00
Lior Halphon
b9030bb2d0 Merge pull request #370 from Jan200101/patch-1
replace PREFIX/share/sameboy with DATA_DIR
2021-03-25 20:57:30 +02:00
Jan
aca2fd04b1 replace PREFIX/share/sameboy with DATA_DIR 2021-03-25 19:17:45 +01:00
Lior Halphon
659f954028 RTC support 2021-03-25 00:07:37 +02:00
Lior Halphon
a52302f2f6 Make NAME come before CORE 2021-03-25 00:07:37 +02:00
Lior Halphon
75bc1e9a86 Initial BESS support, no SGB nor RTC yet 2021-03-25 00:07:37 +02:00
Lior Halphon
925bd863c0 Better errnos 2021-03-22 00:18:49 +02:00
Lior Halphon
da1003263f Redo save states to remove severe code duplication between buffers and files 2021-03-21 20:32:30 +02:00
Lior Halphon
ad54dc57b0 Improved time syncing when turning the LCD on and off, fixes #193 2021-03-21 15:15:04 +02:00
Karim DRIDI
f57657f27d make it compilable on case-sensitive systems 2021-03-13 10:24:28 +11:00
Tim Allen
73b275a7d0 hiro: Remove gtksourceview dependency.
The GTK2 and GTK3 backends for hiro implement a source-code editing widget
based on gtksourceview. gtksourceview2 in particular is quite old and
unmaintained, and Linux distros are keen to drop it, so removing the dependency
helps keep bsnes portable to future platforms -- especially since bsnes doesn't
*use* the source-editing widget anywhere. It's only used by Near's text-editor,
amethyst.

We could just rip out the gtksourceview-related code and be done with it,
but since Near is still around and still working on his own copy of hiro, I
asked him to contribute his implementation so that it will be easier to merge
any future changes too.

This adds two new hiro targets, "gtk2-se" and "gtk3-se" which include the
source-code editing widget and the gtksourceview dependency. Since bsnes
defaults to "gtk2" (without the dependency) we no longer need that package
installed to build bsnes.

Fixes #137.
2021-03-04 20:29:51 +11:00
Lior Halphon
5c1b89e82d Update version 2021-03-01 23:27:40 +02:00
Lior Halphon
5a966bba91 Register ISX files on FreeDesktop 2021-03-01 23:21:07 +02:00
Lior Halphon
f50d9310a7 This shouldn't have been here 2021-03-01 23:00:11 +02:00
Lior Halphon
4d67fa8e80 Close all related windows when closing a document 2021-03-01 22:58:52 +02:00
Lior Halphon
ea97c1dc0b Fix an APU regression that caused some games in DMG mode to play in the wrong pitch 2021-03-01 21:44:54 +02:00
Lior Halphon
d2ed1343e5 Add missing mkdir 2021-02-28 20:41:58 +02:00
Lior Halphon
c6ea57209f Merge pull request #356 from RobLoach/libretro-updates
libretro: Sync updates from libretro
2021-02-28 20:14:15 +02:00
Rob Loach
f21fd33cc3 libretro: Remove APP_STL 2021-02-28 13:13:40 -05:00
Rob Loach
975d379d76 libretro: Remove empty CFLAGS 2021-02-28 13:13:12 -05:00
Lior Halphon
2d593a95e3 Update version to 0.14.1 2021-02-28 17:15:19 +02:00
Lior Halphon
57080c48bc No need for -1 2021-02-28 16:50:46 +02:00
Rob Loach
6a995bfe10 libretro: Sync updates from libretro 2021-02-28 09:45:18 -05:00
Lior Halphon
ec7d756e3b Merge pull request #351 from NieDzejkob/symbol-off-by-one
Fix off-by-one in symbol search
2021-02-28 15:27:50 +02:00
Lior Halphon
0fbd714d4a Merge pull request #352 from NieDzejkob/value-to-string-oob
value_to_string: use snprintf
2021-02-28 15:23:29 +02:00
Lior Halphon
81bfea9ba2 Coding style, ensuring string termination. 2021-02-28 15:23:14 +02:00
Lior Halphon
d2eb8e0996 Addresses issues mentioned by #355 2021-02-28 15:17:00 +02:00
Lior Halphon
5cc2dcc864 Fix #353 better 2021-02-28 14:55:30 +02:00
Lior Halphon
d50514ede9 Fix #353 2021-02-28 14:51:58 +02:00
Lior Halphon
5cd920d363 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2021-02-28 03:41:13 +02:00
Lior Halphon
1fdb4f09b4 Fix a sweep regression in DMG/SGB mode and CGB-C mode 2021-02-28 03:40:58 +02:00
Jakub Kądziołka
c9665d0449 value_to_string: use snprintf
Currently, value_to_string and debugger_value_to_string use an
error-prone calculation to avoid overflow. This was once adjusted
already, and one of the codepaths is still vulnerable. Put this in a
symfile:

    01:5678 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

and execute `p 1:$5679`. On Linux, the canary terminates the process.
2021-02-27 19:33:31 +01:00
Lior Halphon
ec2661ac03 Merge pull request #350 from NieDzejkob/destdir-mkdir
Fix DESTDIR installation
2021-02-27 20:29:22 +02:00
Jakub Kądziołka
e8bfc4050e Fix off-by-one in symbol search
Before this commit, printing an address that's after every symbol in a
bank would not show it relative to the last symbol.
2021-02-27 19:29:06 +01:00
Jakub Kądziołka
0a4cb8148f Fix DESTDIR installation
Installing into a fresh DESTDIR would error out due to non-existent bin
directory
2021-02-27 18:33:22 +01:00
Lior Halphon
54d733f356 Merge pull request #349 from NieDzejkob/memmove-fix
Use memmove for overlapping copy
2021-02-27 19:31:06 +02:00
Jakub Kądziołka
1dae345b24 Use memmove for overlapping copy 2021-02-27 18:29:59 +01:00
Lior Halphon
e57b5dd57e Update version and copyright date 2021-02-27 19:08:32 +02:00
Lior Halphon
a59cd856c7 Fix make install issues 2021-02-27 18:39:14 +02:00
Lior Halphon
cd2e4b3cef Fixes and improvements to XDG installation 2021-02-27 17:34:11 +02:00
Lior Halphon
3c0f4d458d Update Windows icon 2021-02-27 15:51:56 +02:00
Lior Halphon
aebc11744c Update readme 2021-02-27 15:37:40 +02:00
Lior Halphon
2b263937da Allow make install under FreeDesktop 2021-02-27 14:32:07 +02:00
Lior Halphon
0a983b788e Update icon 2021-02-27 04:13:31 +02:00
Lior Halphon
ce44773caa Make the printer not deadlock after a sudden termination 2021-02-26 16:40:35 +02:00
Lior Halphon
cb721dae5d Make the automation use the accurate RTC mode 2021-02-26 01:09:40 +02:00
Lior Halphon
34b0404ffa Add RTC setting to libretro 2021-02-26 01:07:46 +02:00
Lior Halphon
bae91cdb1d Add RTC option to the SDL port, fix a bug where rewind setting didn't update 2021-02-26 01:04:24 +02:00
Lior Halphon
72cb391612 Slightly improve MBC3 accuracy 2021-02-26 00:52:18 +02:00
Lior Halphon
71c6fa45e0 Accurate RTC emulation 2021-02-26 00:40:18 +02:00
Lior Halphon
a13469c4e2 Fix PAL SGB in the Cocoa port 2021-02-25 22:42:02 +02:00
Lior Halphon
e08df2a089 Add accurate RTC emulation mode 2021-02-25 22:12:14 +02:00
Lior Halphon
807712b9c2 Allow creating sav files from the tester (Fixes #311) 2021-02-25 18:04:52 +02:00
Lior Halphon
9fa564f97c Fix #336 2021-02-25 17:12:01 +02:00
Lior Halphon
6ec4583aa0 Tell GCC to calm down 2021-02-25 15:52:48 +02:00
Lior Halphon
fa5420136e I hate the audio thread 2021-02-25 15:43:52 +02:00
Lior Halphon
4c05ebcea6 Redo the volume envelope with better timings, locking emulation and zombie mode edge cases. Fixes #344 2021-02-25 15:43:38 +02:00
Lior Halphon
8809d8ac2f More correct emulation of manual clocking of channels 1 and 2 2021-02-22 15:27:36 +02:00
Lior Halphon
71c88323b7 Rename UNROLL to unrolled (unrolled for) 2021-02-22 14:45:30 +02:00
Lior Halphon
9da0449797 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2021-02-22 13:49:08 +02:00
Lior Halphon
393269ae1f Emulate volume envelope locking 2021-02-22 13:48:56 +02:00
C.W. Betts
c2481ac115 Update targets.md
Fix formatting
2021-02-22 20:00:06 +11:00
Lior Halphon
d50fdc52ea Further accuracy improvements to the audio envelope 2021-02-22 01:58:43 +02:00
Lior Halphon
6d2d88648e Improved emulation of the volume envelope 2021-02-22 01:10:14 +02:00
orbea
2dc384adcb ruby: Auto detect some dependencies with pkg-config. 2021-02-18 19:20:43 +11:00
Tim Allen
be0ee7652c Update the FreeBSD image to fix a build failure.
Apparently Ports only supports the latest stable release, not earlier releases
in the 12.x family.
2021-02-15 22:03:24 +11:00
Lior Halphon
759ff1927e Merge pull request #345 from jkotlinski/fail-nicely-on-missing-window
exit with error message instead of crash when a window cannot be opened
2021-02-14 02:33:58 +02:00
Johan Kotlinski
1a87c452b7 exit with error message instead of crash when a window cannot be opened 2021-02-14 01:31:49 +01:00
Lior Halphon
e7a5be70c2 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2021-02-13 23:00:30 +02:00
Lior Halphon
95051d1c1c Improved emulation of the NRx2 write glitch (Zombie mode) on models prior to CGB-D 2021-02-13 23:00:20 +02:00
Lior Halphon
d343f0c969 Merge pull request #330 from jverkoey/array
Add type annotations to GBImageView's grid arrays.
2021-02-13 14:38:07 +02:00
Lior Halphon
3316954d14 Merge pull request #326 from jverkoey/deprecations
Resolve various deprecation warnings.
2021-02-13 14:15:48 +02:00
Erendel
0ceddd3968 CI: Add settings.bml to Cirrus and Github Actions 2021-02-08 20:13:01 +11:00
Erendel
ee543e7ecd Add stock settings.bml 2021-02-08 20:13:01 +11:00
Near
bfab1a3a9c Update name and website link
Thank you ^_^
2021-02-08 00:11:38 +01:00
Lior Halphon
8ad08c1b35 Fix more audio deadlocks 2021-02-01 23:11:42 +02:00
Lior Halphon
301c0f41c2 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2021-01-31 19:17:56 +02:00
Lior Halphon
6798b1f11a Use a slider for temperature in the SDL GUI 2021-01-31 19:17:48 +02:00
Lior Halphon
2d76698279 Emulation of NR43 bit 3 glitch on CGB-C and older 2021-01-31 19:17:26 +02:00
Lior Halphon
d67580c964 Oops, that was reversed 2021-01-31 17:16:59 +02:00
Lior Halphon
fbfa20a2cd Merge pull request #337 from phobos2390/fix_for_signed_array_index
Fix for tolower extension signed char issue
2021-01-27 22:04:15 +02:00
phobos2390
bbfd16f63d Fix for tolower extension signed char issue 2021-01-25 23:37:46 -07:00
Near
b1a4f2700e Update website and copyright
I've registered https://bsnes.dev to be the new homepage for the project.
Screwtape and I are still working out how we're going to handle the page, but I want to get away from the old domain, and this is where we start that process.
2021-01-26 11:18:07 +11:00
Lior Halphon
ef9671010b More NR43 obscurities 2021-01-24 20:57:46 +02:00
Tim Allen
4649eb83ea README: use the bsnes logo from the about box.
It's a bit more proportionately sized.
2021-01-22 18:17:15 +11:00
Tim Allen
e7accf7092 doc: Document co_serializable(). 2021-01-22 18:10:06 +11:00
Tim Allen
4f75515cd3 doc: Add example programs using libco.
These examples were originally included in various standalone libco
releases, not as part of any higan or bsnes release. test_timing in
particular is a benchmark and smoke-test as well as a basic example
of how to use libco.
2021-01-22 18:10:06 +11:00
Lior Halphon
8e1e889ce0 Add a TODO 2021-01-16 15:31:09 +02:00
Lior Halphon
aa421258b8 Update the model enum so comparisons work correctly for SGB PAL and no-SFC SGBs 2021-01-16 14:51:06 +02:00
Lior Halphon
13a1e9d332 Timing fix 2021-01-16 14:43:32 +02:00
Lior Halphon
0056cc2d61 Revert "Further NR43 write glitch emulation" for now
This reverts commit e384707615.
2021-01-16 14:42:13 +02:00
Jeff Verkoeyen
557f554270 [Sameboy] Add type annotations to GBImageView's grid arrays. 2021-01-15 13:21:28 -05:00
Jeff Verkoeyen
8f91533a9a Revert nil check changes. 2021-01-15 12:49:24 -05:00
Lior Halphon
931045fd9b Merge pull request #325 from jverkoey/master
Annotate all Cocoa properties as nonatomic.
2021-01-15 14:15:09 +02:00
Lior Halphon
0b8ee0585a Merge pull request #329 from jverkoey/spritebug
Fix broken sprite rendering in the VRAM viewer due to mis-calculation of image data size.
2021-01-15 13:39:07 +02:00
Jeff Verkoeyen
1707c8818a Fix broken sprite rendering in the VRAM viewer due to mis-calculation of image data size. 2021-01-15 00:41:21 -05:00
Jeff Verkoeyen
60f226321d Resolve various deprecation warnings. 2021-01-13 14:52:18 -05:00
Jeff Verkoeyen
6dca01ad27 Annotate properties as nonatomic. 2021-01-13 14:12:34 -05:00
Zee
a22bd9dba2 doc: Update usage.md 2021-01-11 22:34:29 +11:00
Lior Halphon
e384707615 Further NR43 write glitch emulation 2021-01-10 17:20:25 +02:00
Lior Halphon
07e76a4ecf Oh boy, looks like my CGB-B is unique 2021-01-09 23:28:30 +02:00
Lior Halphon
1b3f52e8c0 Improved emulation of NR43 writes on different revisions 2021-01-09 21:21:22 +02:00
Lior Halphon
2aa171e0ea Better sample alignment on pre-CGB-D models 2021-01-09 16:26:56 +02:00
Lior Halphon
96736fe7c5 Fix false positives in odd-mode detection 2021-01-09 00:59:12 +02:00
Lior Halphon
c496797fce Merge branch 'master' of https://github.com/LIJI32/SameBoy 2021-01-09 00:31:26 +02:00
Lior Halphon
c0582fd994 More accurate emulation of NR10 writes 2021-01-09 00:31:16 +02:00
Tim Allen
0dcbe627c2 target-bsnes: Do not set the window background to black.
To resize a window on X11, the window manager tells the X11 server to change the
window size, then the X11 server tells the application to paint itself, and then
(eventually) the application tells the X11 server what to draw. This adds an
arbitrary amount of latency to resizing, so to make things feel more responsive,
the X11 server will paint any newly-exposed parts of the window with a default
background colour. If it happens to be the same colour as the appplication would
paint anyway, this gives resizing a much better user-experience.

Since most of bsnes' window is occupied by the viewport, which is always black,
bsnes accordingly set its window background colour to black for the best
resizing experience. However, this had two additional effects:

  - When no game is loaded, bsnes displays the bsnes icon in the main display
    area. Black canvas widgets are used as spacers to position the icon
    correctly, but the spacers don't cover the entire background, and the window
    background shines through.
  - GTK+3 draws widget transparent by default, so the background colour of the
    parent widget shines through child widgets. In particular, setting the
    window background to black makes the menu background black, even if the menu
    text is also a dark colour.

In order to get the menu to display properly in GTK+3 builds, we have to stop
bsnes from setting the top-level window background colour, and we also have to
ensure that the spacer widgets around the icon cover the entire surface of the
window.

Fixes #108.
2021-01-08 23:00:39 +11:00
Lior Halphon
8420fb7364 Merge pull request #319 from MaddTheSane/qlTrim
Fix visibility of a few functions in the QuickLook plug-in.
2021-01-05 21:25:08 +02:00
C.W. Betts
e4c7333a1a Fix visibility of a few functions in the QuickLook plug-in. 2021-01-04 01:08:31 -07:00
Lior Halphon
29a3b18186 Better camera noise on frontends without camera support 2021-01-03 16:52:18 +02:00
Lior Halphon
f9b13c66b1 Emulation of a newly discovered revision specific APU quirk 2021-01-03 13:49:36 +02:00
Lior Halphon
ecace40fb0 Minor APU bug fix 2021-01-02 18:27:21 +02:00
Lior Halphon
a9c337264e Fix the last remaining APU test 2021-01-02 16:23:34 +02:00
Lior Halphon
b54a72d9b9 Fixing a bug where where zero-shift sweep wouldn't tick 2021-01-02 14:56:45 +02:00
Lior Halphon
5c854dbdca Interference emulation 2020-12-31 00:07:04 +02:00
Lior Halphon
8e858c1bf1 Capitalization 2020-12-27 01:02:50 +02:00
Lior Halphon
e535d97e84 Fix GCC9 build break 2020-12-27 00:23:16 +02:00
Lior Halphon
9e808b255c Escape now returns to the previous menu if used from a submenu in the SDL port 2020-12-27 00:03:40 +02:00
Lior Halphon
1d34637bda Fix it harder 2020-12-26 23:56:26 +02:00
Lior Halphon
47ebc31733 Fixed a bug where the SDL and libretro frontend would not update the border when loading a new ROM 2020-12-26 23:52:41 +02:00
Lior Halphon
3dbd2eac91 Something went wrong with the color temperature commit somehow 2020-12-26 23:33:01 +02:00
Lior Halphon
7fc59b5cf4 Let the SDL port choose a boot ROMs folder 2020-12-26 15:10:11 +02:00
Lior Halphon
e1f797c212 Improved scrolling 2020-12-26 13:13:43 +02:00
Lior Halphon
c471696fbb Scrollbar and mouse wheel support 2020-12-26 03:20:53 +02:00
Lior Halphon
6d5ce6c54d Better scrolling a spacing in the SDL UI 2020-12-26 01:45:03 +02:00
Lior Halphon
544d39f19d Further improvements to STOP timing 2020-12-26 00:19:48 +02:00
Lior Halphon
4bbd27735f Fix a regression in speed switch timing, reset DIV on speed switch, better odd-mode detection and avoidance 2020-12-25 20:41:00 +02:00
Lior Halphon
159d9d0348 Color temperature control 2020-12-25 14:17:57 +02:00
Lior Halphon
b5a611c5db More accurate color correction curves 2020-12-24 23:17:20 +02:00
Lior Halphon
84b388692a Merge branch 'master' of https://github.com/LIJI32/SameBoy 2020-12-24 23:14:00 +02:00
Lior Halphon
66f62d696c More window fixes 2020-12-24 20:50:47 +02:00
Lior Halphon
aa2bdf2a1c Better support for non-QWERTY Latin layouts 2020-12-23 23:50:19 +02:00
Lior Halphon
8f64f49c3b More accurate emulation of window timing, actual correct fix of #123 2020-12-23 23:49:57 +02:00
Lior Halphon
b0eb87dfab Merge pull request #315 from messmerd/line_ending_fix
Prevent shader compilation issues due to line endings on Windows machines
2020-12-19 11:36:49 +02:00
Dalton Messmer
8a13b7be24 Add .gitattributes line ending settings
Always use LF line endings for shaders
2020-12-19 00:58:19 -05:00
Lior Halphon
7a3ebb708c LCDC write timing regression fix 2020-12-12 22:55:14 +02:00
Lior Halphon
db483ce95f Warn about potential odd-mode triggers 2020-12-12 20:40:35 +02:00
Lior Halphon
555835549a More accurate pausing behavior, including revision differences 2020-12-12 20:35:18 +02:00
Lior Halphon
770885440f Minor changes to debugger output 2020-12-12 19:09:53 +02:00
Lior Halphon
4f408eae7c Whoops 2020-12-12 18:13:55 +02:00
Lior Halphon
dffc12331b Emulate the delayed NR44 write on the DMG 2020-12-12 18:11:35 +02:00
Lior Halphon
6b30de5fb1 Fixed dark colors on Metal without frame blending 2020-12-12 16:02:46 +02:00
Lior Halphon
7de6194e28 Redo channel 4's timing accurately, emulate NR43 write quirks 2020-12-12 16:02:25 +02:00
Lior Halphon
1baa0446a9 More sweep improvements 2020-12-01 22:37:13 +02:00
Lior Halphon
13bc8679f9 Correct preservation of NRx1's state on pre-CGB models 2020-12-01 14:18:19 +02:00
Lior Halphon
74cf452a48 Further accuracy improvements to sweep; passes Blargg's APU tests again, this time for real 2020-12-01 14:17:35 +02:00
Lior Halphon
0485124076 Redo channel 1 sweep based on DMG schematics; emulates two newly discovered behaviors and also fixes #309 2020-11-28 19:31:25 +02:00
Lior Halphon
67c0e03f3b Fix a window bug in CGB mode, fixes #123 2020-11-22 00:21:19 +02:00
Lior Halphon
bbf609f46b Add TGA output option to the tester, closes #310 2020-11-21 21:05:03 +02:00
Lior Halphon
027cecde24 Added debugger "undo" command. Closes #156 2020-11-21 16:19:58 +02:00
Lior Halphon
bdd27ce50d IR support in the libretro port 2020-11-21 15:36:21 +02:00
Lior Halphon
1d9ac5ccc3 More accurate IR emulation, simplify API 2020-11-21 00:52:54 +02:00
Lior Halphon
b7f3454763 More accurate emulation of the IR port 2020-11-20 22:12:15 +02:00
Lior Halphon
cd2310f0a7 Wave RAM reads 0xFF while active on AGBs 2020-11-20 19:39:54 +02:00
Lior Halphon
7fdc58a07e Implement CGB-mode TILE_SEL mixing, fixes cgb-acid-hell and m3_lcdc_tile_sel_change2, closes #308 2020-11-20 16:24:16 +02:00
Lior Halphon
c36bdc22f6 More accurate interrupt emulation 2020-11-14 13:55:39 +02:00
Lior Halphon
60b8978762 Local link cable and infrared emulation in the Cocoa port 2020-11-13 23:07:35 +02:00
Lior Halphon
88198e64f4 Minor bug fixes 2020-11-13 23:02:17 +02:00
Tim Allen
67d8586720 hiro: Fix screensaver suspension under GNOME on X11.
On X11, hiro uses the xdg-screensaver helper tool to disable the screensaver,
which detects the screensaver that is running and uses the appropriate
mechanism to communicate with it. The tool's API expects an X11 window ID,
but at least some screensavers ignore it, so it can be set up however. The
GNOME backend *does* care about the window ID, but its expectations are not
documented anywhere, so byuu spent a frustrating few days trying things
at random to get it working, and failing.

It turns out, GNOME does *not* require the window to be mapped, but it *does*
require the window to have a name. Using XStoreName() to name the window fixes
screensaver suspension for me under GNOME 3.38.

Note: while XStoreName is technically deprecated, it's not going to go away
while X11 is still around, and the reason it's deprecated is because it doesn't
include character encoding data. We don't care — no user should ever see the
window name, and it's plain ASCII so it should be fine.

Fixes #102.
2020-11-12 20:56:40 +11:00
Asura
4f7a269ba5 sfc: Report auto joypad polling in the HVBJOY register.
This corrects the reporting bit of HVBJOY to be set during the auto joypad
polling sequence.

This change will fix *SpellCraft - Aspects of Valor*. SpellCraft works by
polling JOY1 nonstop once menus are entered on every scanline, so with incorrect
HVBJOY bit 0 reporting, the game was thinking it was safe to read JOY1 during
the auto joypad polling sequence, so partially shifted in results were being
read back as valid. With this patch, you'll find that the game stops polling
between V:225 H:130 and V:228 H:256, which is the auto polling time range.
Before, it was polling during that time. As a result of this fix, the password
menu can be accessed safely without it closing immediately.

Fixes #86.
2020-11-11 14:49:05 +11:00
John Chadwick
c15877a7b7 target-bsnes: Fixes for a couple of input settings bugs.
-   Fixes a bug where the program may crash or display improper buttons
    when changing the selected row during assignment.

    This appears to just be a mistake, accidentally using the 'batched'
    rows instead of the activeMapping row.

-   Fixes a bug where starting multiple assignments without finishing
    one leads to stale "Assigning..." text in some rows.

    This appears to be an oversight. Simply refreshing the mappings
    before starting an assignment fixes this.
2020-11-11 14:48:32 +11:00
Ghislain Antony Vaillant
083406f404 Missing install and uninstall steps 2020-11-10 22:13:16 +11:00
Ghislain Antony Vaillant
868fff9c06 Install icons to default theme
See the [Icon Theme Specification](https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html)
2020-11-10 18:03:44 +11:00
Ghislain Antony Vaillant
7a1d16bb3b Use XDG base directories 2020-11-10 17:59:14 +11:00
Sintendo
d29677b778 target-bsnes: Only suppress screensavers when active
This commit reworks when the screensaver suppression kicks in.

Previously, bsnes would only engage screensaver suppression once, on
application launch. Now that the option is exposed and can be toggled at
any time, we have to be a little more clever.

Additionally, screensaver suppression is now only engaged while
emulation is active, because it doesn't make much sense otherwise.
2020-11-09 20:25:35 +11:00
Sintendo
dba608a808 target-bsnes: Expose screensaver supression in UI
The setting already existed and could be changed by manually editing the
configuration file, but wasn't exposed in the UI. This commit adds the
corresponding check box.
2020-11-09 20:25:35 +11:00
Sintendo
0a9d15a978 hiro/cocoa: Implement Application::setScreenSaver
Based on code from Dolphin and SDL2.

908d6f8fa0/Source/Core/UICommon/UICommon.cpp (L416)
cf1c192936/src/video/cocoa/SDL_cocoaevents.m (L514)
2020-11-09 20:25:35 +11:00
Tim Allen
f78502e131 Add a skeleton for bsnes user documentation.
As I was doing the research for #51, I figured I should write down what I
learned before I forgot it, and if I was going to do that, I might as well
write it down in Markdown so we can make a website from it.
2020-11-07 23:45:20 +11:00
Tim Allen
a2571fe106 target-bsnes: Patch up broken recent-game entries.
In f09c45f, we fixed native file picker dialogs, so they would correctly set the
"option" field to Auto when loading games, instead of leaving it set to an empty
string which effectively forced NTSC mode. However, this wouldn't fix up the old
entries in the Recent Games menu, so we will patch them up if we encounter them.
2020-11-07 23:44:03 +11:00
Tim Allen
33cb7eb106 Add some documentation about what's in various bsnes directories. 2020-11-07 23:43:38 +11:00
Moonchild
09100f5d88 correctly set O_NONBLOCK in OSS 2020-11-06 21:34:39 +11:00
John Chadwick
d4e1c34d0b Fix EXHIROM-RAM-* board mappings.
It is unclear why these addresses were added to the mapping. Removing
these two mappings brings behavior inline with SNES9x:

https://github.com/snes9xgit/snes9x/blob/master/memmap.cpp#L2812
2020-11-06 15:04:28 +11:00
Tim Allen
216bcee66b nall: Support all the names endian.h provides on common platforms.
Also, moved the snippet that includes endian.h beneath the "Endian detection"
header, since I think it fits more neatly there.

Fixes #77.
2020-11-04 15:50:23 +11:00
asuramaru
6b38388a67 I have added comments to clarify the unknown behaviors that remain.
Specifically, we don't know what happens when reading from 4016-4017 or 4218-421f, or when writing to 4016 or 4200, during the auto joypad polling sequence.
Presumably, nothing good.
2020-10-29 15:24:40 +11:00
Asura
42f9e68fb2 Update timing.cpp
I have updated the comment to reflect the new stepOnce() name, instead of the older step() name.
2020-10-29 15:24:40 +11:00
asuramaru
39c37ec2d1 Fix SNES auto-joypad polling
anomie's notes indicate that polling begins between cycles 32.5-95.5, but his
notes were slightly off. 32.5-95.5 is referring to the PPU dot clock. If you
multiply by 4 you get the cycle count, 130-382. It's pretty clear that in
256-cycle units, that would need to be 130-384 or you'd have no event when it
lands on cycle 384. Jonas Quinn confirmed that with his testing in any case.

I chose to split the cycle range in half and run things every 128 clocks. So
that reduces us to 32.5-64.0, or 130 to 256 + 258-384. The reason I chose 128
over 256 was so I could emulate the time it takes to perform the joypad
latching. I don't believe you can set the controller latch to 1 and then 0
immediately. It needs time to let the controllers see this happening and then
release the latch, and time to let that take effect. Polling the controllers is
only one operation so it makes sense that happens once every 256 cycles, which
is why I have the (counter&1) test for that.

Think about it this way: we know the polling sequence takes 4224 cycles, and
4224/256 is 16.5. Isn't that a little strange to have half a cycle? But if we
consider the latching is actually twice as fast, then it's 2x128 + 16x256. If we
run on a 128-clock counter, it becomes 2x128 + 16x2x128, or 34 total states. But
now since we don't actually poll on the second half of each 16x2x256 states, we
don't need to bother running the event there, so we can stop at 33 instead of 34
and it's the same thing. And by doing that, it turns our polling duration into
4224 cycles, just like we've observed.

Fixes #61.
2020-10-29 15:24:40 +11:00
jsd1982
9d262ed113 nall: fix bad memory access pattern in string.format 2020-10-28 18:35:28 +11:00
Tim Allen
ac37afd153 Use byuu.org/bsnes as the official homepage.
Previously, we didn't have control of byuu.org and it wasn't obvious what we
should do about hosting. Now we can update byuu.org, though, we should continue
using it as the authoritative source information.

Fixes #2.
2020-10-27 23:21:19 +11:00
Tim Allen
f09c45f3e4 Fix region auto-detection when using native file dialogs.
hiro has two confusingly-named file-picker dialogs. "BrowserDialog" is the
custom dialog built entirely with hiro widgets, "BrowserWindow" is a wrapper
around the native file-picker. bsnes is built for BrowserDialog, but if you tick
"Use native file picker" in the Emulator options, when it needs a file it will
construct a BrowserDialog, copy the relevant config options across to a new
BrowserWindow and invoke that.

Unfortunately, BrowserDialog and BrowserWindow have different capabilities.
Specifically, BrowserDialog includes an "options" list which bsnes uses to let
the user override region detection when loading a game. BrowserWindow has no
such widget. Thus, when using a BrowserDialog the options list worked as intended,
but when using a BrowserWindow the options list was never initialised and no
option was ever chosen. As a result, when opening a game with the native file-
picker, bsnes always used NTSC emulation mode, instead of auto-detecting.

Previously, constructing a BrowserDialog and calling setOptions would leave the
BrowserDialog in an inconsistent state (with no option selected). This was OK if
you immediately displayed the dialog to the user (this would complete the
initialisation and choose a default), but bsnes also used BrowserDialog as an
*interface* typee, to represent the parameters and results of a file-picker
operation that was implemented elsewhere. For this use-case, the inconsistent
state caused problems.

Therefore, BrowserDialog has been changed:

  - setting the list of options always chooses a default, maintaining the
    invariant that `.options()` always returns one of the available options.
  - The internal BrowserDialogWindow class now takes a reference to a Response
    object, instead of constructing one from scratch and having to duplicate
    the "set .option to a reasonable value" code.

Fixes #44.
2020-10-27 23:20:56 +11:00
Tim Allen
090b79b3be Strip whitespace and empty lines from the cheat editor.
Previously, bsnes would turn the cheat text into a list of cheats by splitting
on '\n', producing an empty "cheat" after the last line of the editor:

    "7e0003=00\n".split("\n") -> ["7e0003=00", ""]

That empty "cheat" is not a valid cheat, so the result would be marked invalid.
Teaching bsnes to silently skip empty lines worked, but it would preserve
multiple blank lines between two cheats, which was silly.

Now we iterate over all the lines of the cheat editor, putting valid codes in a
new vector, and setting a flag for invalid codes.

Fixes #63.
2020-10-21 16:39:39 +11:00
John Chadwick
968e6b5feb Implement GitHub Actions Based CI.
This is lightly adapted from the implementation in Higan. For more
information, see that PR in higan-emu/higan#118.

The main difference is that we only compile one binary here, and
packaging is similar to (but adapted from) packaging byuu.
2020-10-19 17:37:02 +11:00
Tim Allen
1f943663b8 C89 requires __STDC__ to be defined, but not __STDC_VERSION__
gcc defines it anyway, but clang doesn't.

Fixes #22.
2020-10-17 10:46:43 +11:00
Lior Halphon
03cbab2f85 Windows is no longer officially supported in the standalone builds 2020-10-15 19:21:37 +03:00
Lior Halphon
1936dd7f67 Merge pull request #304 from JL2210/rgbds-link
Update RGBDS links in README and build-faq
2020-10-14 01:22:21 +03:00
James Larrowe
6e0c09f78c Update RGBDS links in README and build-faq
The repo's owner has changed twice since this link was used;
once from bentley to the neutral rednex organization, and then
from rednex to gbdev
2020-10-13 18:19:29 -04:00
Tim Allen
e866a909dc Apply bsnes' customisations back on top of the upstream SameBoy source.
This includes changes to SameBoy (updating the README to be clear about
provenance, and adding a GNUmakefile to integrate with bsnes' build system),
updates the SameBoy version number in the about box, and adds SameBoy to the
list of subtrees updated by update-subtrees.sh.
2020-10-12 18:40:44 +11:00
Tim Allen
ec18efcb04 Add 'bsnes/gb/' from commit '919a88ec23f8011dd0389a4abceb62b3d0c83e00'
git-subtree-dir: bsnes/gb
git-subtree-mainline: 844e23d0f4
git-subtree-split: 919a88ec23
2020-10-12 16:43:40 +11:00
Tim Allen
844e23d0f4 Remove old SameBoy snapshot. 2020-10-12 16:41:26 +11:00
Lior Halphon
919a88ec23 Merge pull request #301 from SimpleTease1/patch1
libretro changes
2020-10-11 02:42:02 +03:00
SimpleTease
eb295de218 shared version.mk 2020-10-10 23:33:58 +00:00
SimpleTease
696bebc673 libretro: joypad bitmasks 2020-10-10 17:14:53 +00:00
SimpleTease
714227883f cross-compile friendly 2020-10-10 13:46:44 +00:00
Lior Halphon
526c2e029a Fix #296 2020-10-10 14:50:11 +03:00
SimpleTease
2bfca48e0f libretro: fix core version 2020-10-10 04:02:21 +00:00
SimpleTease
cd526d960e libretro: changing model requires manual game restart 2020-10-10 04:00:30 +00:00
radius
8dc60d0b87 update makefile 2020-10-10 03:52:22 +00:00
twinaphex
efe8d6b643 Update Makefile 2020-10-10 01:22:51 +00:00
slash0042
faeb1d2e18 Add libnx port 2020-10-10 01:02:22 +00:00
Lior Halphon
8b45c32d77 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2020-10-09 16:40:00 +03:00
Lior Halphon
c35fe8b517 Make gb.h compatible with C++ again for bsnes integration. Fixed #300 2020-10-09 16:39:23 +03:00
Lior Halphon
195329463b Merge pull request #294 from yo-wotop/master
Windows Updates
2020-10-09 16:03:57 +03:00
Lior Halphon
99ec5b32fc Update build-faq.md 2020-10-09 16:03:32 +03:00
Lior Halphon
64963e1746 Update README.md 2020-10-09 15:57:23 +03:00
Tim Allen
0ab0ab6957 Merge commit '5e109224fb3480d806e44d74587d052c7f88bf83' into master 2020-10-09 02:31:32 +11:00
Ruslan Tretiakov
5e109224fb Make comments ANSI C compliant 2020-10-09 02:30:21 +11:00
yo
38afb187cf Resolving some comments and clarifying some language 2020-10-06 23:03:39 -07:00
yo
0b5853070a Updated instructions for Windows building 2020-10-05 14:37:49 -07:00
yo
28234da2d2 Updated instructions for Windows building 2020-10-05 14:34:00 -07:00
yo
04e5f1b8cf Updated for Windows clang and SDL2 changes 2020-10-05 14:33:36 -07:00
Ruslan Tretiakov
d0efbfbcd9 libretro: Add support for BS-X Satellaview 2020-10-02 23:57:23 +10:00
Tim Allen
d72874fa59 Merge libco repository's commit 'd31c6e75a54be12307d65fd80f55adfbe7aa9d67' into master 2020-10-01 16:34:55 +10:00
Ruslan Tretiakov
a2255f6052 Add update-subtrees.sh based on script from higan 2020-10-01 16:34:50 +10:00
Ruslan Tretiakov
fcc982dff0 PPU Mosaic fixes imported from higan 2020-10-01 09:47:47 +10:00
Lior Halphon
2a5aed626d Update README.md 2020-09-29 20:50:14 +03:00
Lior Halphon
1e9e961e9c Create CONTRIBUTING.md 2020-09-29 20:43:47 +03:00
Ruslan Tretiakov
9517080349 Merge fix from higan for Sound Novel Tsukura/Derby Stallion 96 (jbo-85) 2020-09-29 23:09:59 +10:00
Ruslan Tretiakov
7eee058864 libretro: sync Boards dump with upstream 2020-09-29 23:09:59 +10:00
Sanaki
366a20386c Corrected valid extensions to fix archive loading of GB/GBC 2020-09-29 23:09:59 +10:00
Rouven Spreckels
9ef085fb06 Add games Bahamut Lagoon and Tales of Phantasia.
This updates the game database to match higan's version.
2020-09-28 18:59:20 +10:00
Rouven Spreckels
1c83a6fe44 Add boards SHVC-1K1X-10 and SHVC-LJ3M-01. 2020-09-25 14:22:41 +10:00
Sintendo
a8c1f19f75 Add 'Unload Game' hotkey 2020-09-22 23:43:01 +10:00
Sintendo
c2c479440e Add 'Power Cycle' hotkey
Closes #25.
2020-09-22 23:43:01 +10:00
Lior Halphon
7c92845882 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2020-09-19 19:31:31 +03:00
Lior Halphon
7ff3556bc3 Workboy emulation (Cocoa only) 2020-09-19 19:31:24 +03:00
Alcaro
b9ccb90324 GNU Make 4.3 compatibility
* WARNING: Backward-incompatibility!
  Previously appending using '+=' to an empty variable would result in a value
  starting with a space.  Now the initial space is only added if the variable
  already contains some value.  Similarly, appending an empty string does not
  add a trailing space.

https://lwn.net/Articles/810071/
2020-09-19 23:22:13 +10:00
Tim Allen
24503fc922 hiro: qt.moc should be generated, not committed to the repo. 2020-09-18 22:31:17 +10:00
Zeno Sebastian Endemann
d383f0e883 Use pkg-config instead of hardcoded path to Qt5 moc 2020-09-18 22:31:17 +10:00
Lior Halphon
e35c22d405 Fix a potential single byte overflow 2020-09-17 23:47:35 +03:00
Lior Halphon
faf91508e2 Yes, I *do* mean -Wno-maybe-uninitialized! 2020-09-17 23:25:56 +03:00
Lior Halphon
abea3888db Fix compilation under GCC 9 2020-09-17 23:18:16 +03:00
Lior Halphon
e0d6aa59ad Merge pull request #289 from NieDzejkob/warning-fix
pb12: check the return value of write
2020-09-17 21:22:22 +03:00
Jakub Kądziołka
9c50a992af pb12: check the return value of write 2020-09-17 20:01:21 +02:00
Tim Allen
d31c6e75a5 Add a copy of the ISC license.
Apparently there's two versions of the ISC license; the original says "and"
while the updated one says "and/or". This was copied from the ares v115 release,
so it should be the variant byuu intended by "ISC".

Fixes #19.
2020-08-24 21:52:19 +10:00
Lior Halphon
2e4a638077 Update version to 0.13.6 2020-08-22 14:21:54 +03:00
Lior Halphon
abce93640c Set a default value in the struct (instead of just during sanitation) 2020-08-22 14:20:44 +03:00
Lior Halphon
ceec044a22 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2020-08-22 14:17:20 +03:00
Lior Halphon
ebcc0d18ce Merge pull request #281 from nadiaholmquist/feature/sdl-scale
SDL: Make default window scale configurable
2020-08-22 14:17:09 +03:00
Lior Halphon
e307de8064 Style fixes 2020-08-22 14:16:07 +03:00
Lior Halphon
dab1c1bcfa Fix RTC drift 2020-08-22 14:10:02 +03:00
Lior Halphon
832dc127a4 Fix Quick Look preview on Big Sur 2020-08-22 14:02:41 +03:00
Lior Halphon
c2410a4ffc Update UI for Big Sur 2020-08-22 13:06:27 +03:00
Lior Halphon
5cffdbcd27 Prevent asking for notification permissions until used by an HuC-3 game 2020-08-22 00:56:12 +03:00
Nadia Holmquist Pedersen
cc37632714 Remove printf 2020-08-19 06:15:36 +02:00
Nadia Holmquist Pedersen
d9f80db036 Consider the overscan setting when getting the aspect ratio 2020-08-15 15:35:30 +10:00
Naman Dixit
096df4242a Proper cross-platform thread_local and alignas 2020-08-12 01:35:57 +10:00
Lior Halphon
766529d7be Update version to 0.13.5 2020-08-06 21:01:55 +03:00
Lior Halphon
bce4bfba61 Fix major battery save regressions introduced by the last release, fixes #282 2020-08-06 19:34:57 +03:00
Nadia Holmquist Pedersen
012b9a2ba0 SDL: Make default window scale configurable 2020-08-06 03:08:19 +02:00
Lior Halphon
5b2eec214b Update version to 0.13.4 2020-08-05 21:17:22 +03:00
Lior Halphon
3f97b8eaa8 Even more regressions 2020-08-05 02:10:21 +03:00
Lior Halphon
d3664d5da0 Fix more RTC regressions 2020-08-05 01:39:19 +03:00
Lior Halphon
289853445f Fix long loading times when loading save states with bad local RTC times 2020-08-04 21:32:33 +03:00
Lior Halphon
b0d118f246 Fix broken and regressed MBC3 RTC emulation. Fixes #273, fixes #276, fixes #280 2020-08-04 21:32:27 +03:00
Lior Halphon
68b8d4bb1e Merge pull request #279 from renatoliveira/cartridge-patch
Cartridge patch
2020-08-01 19:22:34 +03:00
Renato Oliveira
445aa74b14 Fix "cartrdige" to "cartridge" in comments 2020-08-01 12:57:10 -03:00
Renato Oliveira
ac3b09966c Fix "Cartrdige" to "Cartridge" 2020-08-01 12:55:53 -03:00
Tim Allen
fdacdf976d Make the README use local assets, not remotely-hosted ones.
When Near took down byuu.org, he also removed the images that the bsnes
README was ointing to. He gave me backups of data from the site, including the
images used on the bsnes homepage, but apparently the README used different
images hosted in a different location.

I've replaced the missing images with ones from the bsnes homepage that
look reasonable.
2020-07-30 10:31:09 +10:00
Lior Halphon
4248ba8512 Merge pull request #272 from lpla/patch-2
Fix `make: write error` on macOS when `make CONF=native_release`
2020-06-25 20:54:58 +03:00
Leopoldo Pla
44ff0563c0 Fixes #259 2020-06-25 19:50:24 +02:00
Lior Halphon
a7942d6a1f Allow building fat x86-64 and ARM64 macOS binaries 2020-06-25 19:51:58 +03:00
Kawa
5bb5e34aa1 Merge pull request #18 from namandixit/clang-signature-warning
Fix Clang's -Wstrict-prototypes warning
2020-06-25 17:43:14 +02:00
Kawa
1931c7d20d Merge pull request #10 from namandixit/optional-libc
Made the dependency on stdlib.h and assert.h optional
2020-06-25 09:56:53 +02:00
Naman Dixit
d4a67ab8d5 Added void to function signatures, in order to fix Clang's -Wstrict-prototypes 2020-06-25 11:39:40 +05:30
Lior Halphon
64f381fa23 Update version to 0.13.3 2020-06-24 23:34:33 +03:00
Lior Halphon
a2e656a7c2 Fixed boot ROM regression; CGB games were given the wrong palettes 2020-06-24 20:34:52 +03:00
Lior Halphon
92c3eafc72 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2020-06-24 19:15:29 +03:00
Lior Halphon
cfcdce81ba Fix color in OpenGL when frame blending is disabled 2020-06-24 19:15:20 +03:00
Kawa
3808e8e25f Revert "Merge pull request #41 from RokkumanX/patch-10"
This reverts commit 5d1a33daf7, reversing
changes made to 8dc73b6cec.
2020-06-23 21:02:29 +02:00
Kawa
5d1a33daf7 Merge pull request #41 from RokkumanX/patch-10
SameBoy 0.13.2
2020-06-23 21:00:06 +02:00
Rokkuman X
57cabdcf58 SameBoy 0.13.2
Updated all files with changes between 0.13.1 and 0.13.2
2020-06-23 20:16:59 +02:00
Lior Halphon
ac521641ec Merge pull request #271 from JL2210/old-gcc
Compatibility hacks for old compilers
2020-06-22 23:23:47 +03:00
James Larrowe
87d25c0896 Compatibility hacks for old compilers
GCC versions below 4.8.1 didn't have __builtin_bswap16, so provide
a suitable replacement.
2020-06-22 20:14:32 +00:00
Lior Halphon
e88a48e0a1 Use gamma-corrected mixing in shaders 2020-06-19 23:18:38 +03:00
Lior Halphon
096eb78be7 Update version to 0.13.2 2020-06-11 13:39:25 +03:00
Lior Halphon
4f42f4f718 Minor layout fixes 2020-06-11 00:38:53 +03:00
Lior Halphon
7eb4a92d2a Improve print window, add a button for actual physical printing 2020-06-10 23:28:33 +03:00
Lior Halphon
006ee4f6cb What rhymes with "willows" and breaks when you edit a Makefile? 2020-06-10 23:00:41 +03:00
Lior Halphon
b6b56d0766 Fix various save state compatibility issues between Windows and non-Windows, and a potential crash 2020-06-10 22:46:19 +03:00
Lior Halphon
edf7762408 Improved Dark Mode support, improved Hex Fiend's general system-native appearance 2020-06-10 01:10:11 +03:00
Lior Halphon
4a51f5c956 Cherry-picking libretro memory map bugfix (Closes #227, #205). Fixing libretro build with modern macOS SDKs. 2020-06-09 20:09:50 +03:00
Kawa
8dc73b6cec Merge pull request #28 from Screwtapello/ci-testing
Fix Cirrus CI builds
2020-06-08 23:00:19 +02:00
Tim Allen
35598cf622 Prevent Debian packages from prompting for configuration.
At some point the Debian tzdata package started waiting for somebody to tell it
what timezone it was in, causing CI builds to timeout.
2020-06-09 06:02:16 +10:00
Tim Allen
f6d2645fd4 Apparently the MinGW compiler automatically appends the .exe extension now. 2020-06-09 06:02:16 +10:00
Tim Allen
92ebbae4ce Make CirrusCI use a supported version of FreeBSD. 2020-06-09 06:01:52 +10:00
Kawa
bbcdddfcd1 Revenge of the son of the bride of ambiguity
See also some of higan's recent commits.
2020-06-08 20:33:59 +02:00
Kawa
20fa36a7d8 Change docs from HTML to MD 2020-06-06 16:29:44 +02:00
Naman Dixit
fb700978ac Moved the libc override macros to settings.h, and removed __VA_ARGS__ 2020-06-06 18:57:44 +05:30
Naman Dixit
bd9d4c96be Made the dependency on stdlib.h and assert.h optional
Some platforms still depend on Libc (if they are exclusively POSIX/Unix/Linux),
or need some other functionality (e.g., memcpy)
2020-06-06 17:04:16 +05:30
Lior Halphon
c07588e3bd Console auto complete 2020-06-05 02:10:05 +03:00
Kawa
f98cb01d0a Update presentation.cpp
Should've hit "save all"
2020-06-03 21:21:29 +02:00
Kawa
7ff2a874b6 Forgot to hit save.
Kawa says sorry.
2020-06-03 21:20:58 +02:00
Kawa
b94720ffa6 Update to SameBoy 0.13.1 2020-06-03 21:16:30 +02:00
Kawa
b98ce40021 Update mbc.c
6a3cd371d0
2020-06-03 20:44:27 +02:00
Lior Halphon
ef203cf0e5 Update version to 0.13.1 2020-06-03 21:18:09 +03:00
Lior Halphon
b7a9039e50 Sanitize SDL preferences for cross-version stability 2020-06-03 21:06:47 +03:00
Lior Halphon
6a3cd371d0 Fix potential memory corruption when execution malformed ROMs 2020-06-03 20:54:06 +03:00
Lior Halphon
9e8b4345c0 Update version to 0.13 2020-05-31 21:55:04 +03:00
Lior Halphon
9521729e4e Fixed Windows build 2020-05-31 21:54:54 +03:00
Lior Halphon
08efb46d41 Made the command line debugger output “>” before inputs, added special magic sequence to break the debugger from stdin 2020-05-31 20:32:00 +03:00
Lior Halphon
0c0ca8e862 Last resort for Macs that can’t send reports to certain devices 2020-05-31 01:41:27 +03:00
Lior Halphon
97e844a0b7 GB_debugger_break is for external APIs, not available on libretro builds 2020-05-31 01:01:06 +03:00
Lior Halphon
5f4aee8ca1 Merge pull request #261 from JL2210/ld-b-b
Add ld b, b breakpoint
2020-05-31 00:55:17 +03:00
Lior Halphon
f1ea39f1c6 Spacing 2020-05-31 00:54:49 +03:00
Lior Halphon
fd97e11919 Spacing 2020-05-31 00:54:13 +03:00
James Larrowe
6fcf77c7f6 Make no argument for softbreak be equivalent to "on" 2020-05-30 16:46:17 -04:00
James Larrowe
abdece7737 add debugger command to enable and disable 2020-05-30 16:35:07 -04:00
James Larrowe
f105f28017 Add ld b,b breakpoint
Signed-off-by: James Larrowe <larrowe.semaj11@gmail.com>
2020-05-30 15:54:51 -04:00
Lior Halphon
83b959c126 Delay requests to show notifications 2020-05-30 22:46:06 +03:00
Lior Halphon
c665fcb2ed Minor fixes 2020-05-30 22:20:45 +03:00
Lior Halphon
c9b401135f Actually, don’t use rumble threads at all, because IOHIDDeviceSetReport seems to queue stuff despite being blocking 2020-05-30 22:18:32 +03:00
Lior Halphon
af5cb72edc Restore Switch LED support 2020-05-30 21:31:00 +03:00
Lior Halphon
e678b50101 Force all controllers to use a rumble thread 2020-05-30 20:15:13 +03:00
Lior Halphon
59b94b92ca Make sure reports are only sent from one thread 2020-05-30 18:43:09 +03:00
Lior Halphon
4d91081046 Do not send LED updates if nothing changed 2020-05-30 17:58:02 +03:00
Lior Halphon
fa7232944f Better emulation of CGB’s first frame behavior 2020-05-30 01:25:21 +03:00
Lior Halphon
ffa569deeb Partial emulation of reading VRAM right after mode 3 2020-05-29 23:10:23 +03:00
Lior Halphon
29b64d7545 Slightly reduce the scanline-ish LCD effect 2020-05-29 16:51:20 +03:00
Lior Halphon
17dfe0dd6a Fix minor CGB-C regression 2020-05-29 16:30:40 +03:00
Lior Halphon
f1442b0ea6 Attempt to add rumble support to SDL. Who knows it might work. 2020-05-24 23:04:36 +03:00
Lior Halphon
7af66387de HuC-3 alarm clock emulation 2020-05-23 14:50:54 +03:00
Lior Halphon
369410f370 Fix HuC-1 regression 2020-05-23 00:09:30 +03:00
Lior Halphon
08ca56eec7 Cleanup 2020-05-23 00:05:43 +03:00
Lior Halphon
ce9114ed55 Fix IR bugs 2020-05-19 01:24:09 +03:00
Lior Halphon
933b622886 Allow more GameShark cheats 2020-05-19 01:24:02 +03:00
Lior Halphon
157123e118 Fix clearing OAM and initializeing wave RAM 2020-05-17 19:24:11 +03:00
Lior Halphon
a588993f28 Add an HuC command required by Pocket Family 2 2020-05-17 00:10:43 +03:00
Lior Halphon
a9023d08c6 Emulate HuC-3’s IR and RTC 2020-05-16 23:27:17 +03:00
Lior Halphon
2cc980755e HuC1 IR support 2020-05-13 22:21:31 +03:00
Lior Halphon
060136306b Merge branch 'sdl_audio_fix' 2020-05-10 22:17:58 +03:00
Lior Halphon
1b7c3c4c7c Minor fixes, style update 2020-05-10 22:16:49 +03:00
Lior Halphon
0200596391 Fix #256 2020-05-10 22:05:47 +03:00
Lior Halphon
ca24f54bee Merge branch 'master' of https://github.com/LIJI32/SameBoy 2020-05-10 00:38:06 +03:00
Lior Halphon
3cba3e8e27 Emulate CGB-C PCM read glitch, fix a potential noise volume envelope bug 2020-05-10 00:37:52 +03:00
Rupert Carmichael
5f2c7b966f Pre-buffer audio samples before passing to SDL's queue 2020-05-09 11:49:20 -04:00
Lior Halphon
e4aa212f9a Merge pull request #254 from NieDzejkob/bootrom-2bpp
Fix segfault, save some bytes.
2020-05-09 15:32:19 +03:00
Jakub Kądziołka
24220defd6 Save 16 bytes in the CGB boot ROM 2020-05-09 13:11:51 +02:00
Lior Halphon
620ee3cf51 Make the libretro frontend not crash on rumble-less frontends 2020-05-07 23:43:49 +03:00
Lior Halphon
ccc7d2e887 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2020-05-07 22:47:52 +03:00
Lior Halphon
e063671816 No need to use malloc here, the buffer never gets large 2020-05-07 22:46:06 +03:00
Lior Halphon
c4a8669501 Merge pull request #253 from FredrIQ/multiaddr
Allow more than 1 symbol per debug address
2020-05-07 02:09:09 +03:00
Lior Halphon
8625b23c0d Whoops 2020-05-07 01:32:03 +03:00
Fredrik Ljungdahl
99ec31dfdc Allow more than 1 symbol per debug address 2020-05-07 00:12:35 +02:00
Lior Halphon
8f69703726 Merge branch 'bootrom-2bpp' 2020-05-06 23:30:56 +03:00
Lior Halphon
7cff35368d Port to C to remove the Python dep, remove leftovers 2020-05-06 23:30:01 +03:00
Lior Halphon
184743637e Fix silly regression 2020-05-06 01:10:46 +03:00
Lior Halphon
730567dc60 Proper color mixing 2020-05-06 01:06:22 +03:00
Lior Halphon
a3f261184d Optimize more 2020-05-05 01:44:48 +03:00
Lior Halphon
f46f138e9f Clear VRAM correctly 2020-05-04 23:54:43 +03:00
Lior Halphon
260f61f33a This window shouldn’t be resizeable 2020-05-04 22:48:00 +03:00
Lior Halphon
72a90ba91c Hacky color blending 2020-05-04 02:17:03 +03:00
Lior Halphon
2225fd114c Handle 2bpp palettes 2020-05-04 02:07:19 +03:00
Jakub Kądziołka
b057e0d10a Save 4 more bytes in the CGB boot ROM 2020-05-03 23:07:53 +02:00
Jakub Kądziołka
cb738190be Add a 2bpp CGB boot ROM logo, pending palettes 2020-05-03 22:45:23 +02:00
Jakub Kądziołka
19126df7f4 Save 8 bytes in the CGB boot ROM 2020-05-03 22:41:56 +02:00
Lior Halphon
6910c3d24b Complete DualShock 3 support 2020-05-03 20:23:37 +03:00
Lior Halphon
bb37f8d2f0 Optimize Joypad initialization 2020-05-02 23:04:12 +03:00
Lior Halphon
9413d68976 Add support for wired Switch Pro Controller 2020-05-02 22:14:53 +03:00
Lior Halphon
78e2b94cb5 Rewrite the "Sub Elements" design into a more powerful Custom Report design that can overwrite an entire report structure of a sepcific report by its ID 2020-05-02 20:55:54 +03:00
Lior Halphon
e5302a9b1e Set sane libretro defaults, add border settings (Closes #203), general libretro cleanup 2020-05-01 23:42:08 +03:00
Lior Halphon
c492022ae6 Fix a deadlock 2020-05-01 19:31:04 +03:00
Lior Halphon
69fb2ad0a3 Fix rumble on WUP-028 on ports other than 1 2020-05-01 18:46:00 +03:00
Lior Halphon
7e124e169e Avoid races 2020-05-01 18:44:26 +03:00
Lior Halphon
2854578527 Less ugly hacks 2020-05-01 18:26:48 +03:00
Lior Halphon
021cdb402d Various hacks for stopping the PWM thread when needed, important if we have a WUP-028 connected with more than one controller 2020-05-01 18:16:33 +03:00
Lior Halphon
4bf252800e Improve PWM quality, fix a crash 2020-05-01 18:08:44 +03:00
Lior Halphon
5a56c3b882 Style fixes 2020-05-01 16:03:26 +03:00
Lior Halphon
ea18ba9335 Add rumble settings to libretro 2020-05-01 15:50:22 +03:00
Lior Halphon
5da80062d9 Fix WUP-028 on Catalina, make controller configuration compatible between macOS versions 2020-05-01 00:34:00 +03:00
Lior Halphon
40562b1c54 Revert "Fix WUP-028 on Catalina, make controller configuration compatible between macOS versions"
This reverts commit 160282c42a.
2020-05-01 00:25:40 +03:00
Lior Halphon
160282c42a Fix WUP-028 on Catalina, make controller configuration compatible between macOS versions 2020-04-30 23:56:14 +03:00
Lior Halphon
60ad3160cf Fix an XIB oops 2020-04-29 23:52:28 +03:00
Lior Halphon
6bcaffe27d Fix sendReport on JOYMultiplayerControlle 2020-04-29 23:47:18 +03:00
Lior Halphon
4c1f073d20 Fix error report 2020-04-29 20:59:19 +03:00
Lior Halphon
0f73282e4e Actually allow it 2020-04-29 20:54:28 +03:00
Lior Halphon
03ea6dc708 Make builds possible without Xcode 2020-04-29 20:44:55 +03:00
Lior Halphon
9f876e380c Offical WUP-028s require an activation sequence 2020-04-29 20:08:00 +03:00
Lior Halphon
66112af37e Fix PWM performence issue 2020-04-29 19:53:47 +03:00
Lior Halphon
5c9d50e25f Fix job 2020-04-29 17:02:20 +03:00
Lior Halphon
05cf3656b8 Fix libretro 2020-04-29 16:58:38 +03:00
Lior Halphon
0c91502859 Remove log 2020-04-29 16:52:32 +03:00
Lior Halphon
4b24178553 Rumble mode selection 2020-04-29 16:50:31 +03:00
Lior Halphon
4c443d51ce Minor JoyKit improvements 2020-04-29 16:06:38 +03:00
Lior Halphon
6448a692e2 Add smart rumble to games without a rumblepak 2020-04-29 16:06:11 +03:00
Lior Halphon
151d58eb60 setRumble should be double 2020-04-29 16:05:31 +03:00
Lior Halphon
5a14eb93c6 Merge branch 'master' into JoyKit
# Conflicts:
#	Cocoa/Document.m
#	Cocoa/GBView.h
#	Cocoa/GBView.m
#	Cocoa/joypad.m
#	Cocoa/main.m
#	Core/display.c
#	Core/gb.h
#	Core/save_state.c
2020-04-29 15:52:03 +03:00
Lior Halphon
8f6047fdca Prevent -Wall from overriding -Wno flags 2020-04-28 21:53:37 +03:00
Lior Halphon
1e54c55c11 Making libretro compile without warnings with GCC 2020-04-28 21:44:29 +03:00
Lior Halphon
c64d5b58b6 Make failed builds easier to read 2020-04-28 20:01:22 +03:00
Lior Halphon
8d016f19d2 Move the audio code to a different file 2020-04-28 20:01:22 +03:00
Lior Halphon
110cedeaac Even better hueristics 2020-04-25 23:26:17 +03:00
Lior Halphon
d1e3ad7790 Better hueristics for wrong MBC type 2020-04-25 23:18:03 +03:00
Lior Halphon
0534b091a5 Fix SDL 2020-04-25 23:11:29 +03:00
Lior Halphon
9e99ce434e Allow loading .RAM files 2020-04-25 23:09:08 +03:00
Lior Halphon
ca567bee79 Fix Linux build break 2020-04-25 22:54:50 +03:00
Lior Halphon
152924e13f Add support to the ISX format, including symbols 2020-04-25 22:48:48 +03:00
Lior Halphon
36aa3f31b9 -q was not enough 2020-04-25 18:11:01 +03:00
Lior Halphon
f65dc73632 -q was not enough 2020-04-25 18:09:04 +03:00
Lior Halphon
9fbafab67f Use grep -q, put macOS first, restore -j 2020-04-25 18:04:27 +03:00
Lior Halphon
65fb6afd60 Make fixes 2020-04-25 17:57:19 +03:00
Lior Halphon
09e7068658 Fixing another duh 2020-04-25 17:22:43 +03:00
Lior Halphon
aa9ccc724f Fixing a duh 2020-04-25 17:20:06 +03:00
Lior Halphon
7760e11544 Better error handling 2020-04-25 17:12:53 +03:00
Lior Halphon
a35164dc0a Fixed unused variable on Linux 2020-04-25 17:06:24 +03:00
Lior Halphon
e819b91a97 Rename job, temporarily disable -j 2020-04-25 17:03:45 +03:00
Lior Halphon
bf67811392 Sanity test against a few test ROMs 2020-04-25 16:59:47 +03:00
Lior Halphon
8e702f1452 Also test libretro's buildability 2020-04-25 15:13:04 +03:00
Lior Halphon
bb5c9f7fc6 Fix libretro build 2020-04-25 15:12:10 +03:00
Lior Halphon
66112f4930 That wasn't enough to fix it, I'll just disable this warning 2020-04-25 14:55:51 +03:00
Lior Halphon
c62704e26b Minor fix for GCC's LTO 2020-04-25 14:51:17 +03:00
Lior Halphon
1e7737a239 Limit unroll to GCC 8 2020-04-25 14:46:01 +03:00
Lior Halphon
c2a395006e Update docs 2020-04-25 14:45:52 +03:00
Lior Halphon
097705456c Show compiler version 2020-04-25 14:05:35 +03:00
Lior Halphon
7e908fef0e The macOS environment doesn't come with GCC, it'll just test Clang again 2020-04-25 14:04:51 +03:00
Lior Halphon
17c97c3c2b Use brew's SDL2 on macOS 2020-04-25 13:59:31 +03:00
Lior Halphon
385cd1b8c7 Fix chmod 2020-04-25 13:52:18 +03:00
Lior Halphon
2df6d266bd Add a GitHub action to avoid breaking builds 2020-04-25 13:50:35 +03:00
Tim Allen
94acbce822 Merge libco's commit history.
The official libco repository was created as a snapshopt of the then-current state of libco
in the higan repository. However, it would be a shame to lose all the
development history and changelogs that led up to this point.

This commit merges in the change history extracted from the higan repository,
including reconstructed history from the bsnes-history-kit project. Note that
many commit messages mention changes outside of libco, and some *only* mention
non-libco changes because the libco change was relatively minor compared to the
overall changes. Hopefully it's generally clear what libco changes were made and
why... but even if it isn't, this is all the information we have.

Fixes #2.
2020-04-25 15:57:07 +10:00
Lior Halphon
ddad913e06 OK this time it will work. 2020-04-24 21:59:51 +03:00
Lior Halphon
8ac029d3fe Truly truly fix #249, fix #251 2020-04-24 21:06:44 +03:00
Lior Halphon
198942b273 Truly fix #249, fix #251 2020-04-24 21:00:30 +03:00
Lior Halphon
634dcefd01 Typo 2020-04-24 20:44:25 +03:00
Lior Halphon
0cf168f32b Fixing inconsistent style 2020-04-24 20:37:57 +03:00
Lior Halphon
d38fd41b0e Reorder flags so -Wpartial-availablility is affected by -Wno-unknown-warning -Wno-unknown-warning-option, fixes #249, fixes #251 2020-04-24 20:18:56 +03:00
MerryMage
30e274953a Add 'libco/' from commit '7871e50f7d48444f1a6333128308acb0a1c8ad2b'
git-subtree-dir: libco
git-subtree-mainline: c5b39e2dfc
git-subtree-split: 7871e50f7d
2020-04-19 17:41:20 +01:00
MerryMage
c5b39e2dfc libco: Remove to make space for libco subtree 2020-04-19 17:40:54 +01:00
MerryMage
7871e50f7d First commit 2020-04-19 17:36:19 +01:00
Lior Halphon
db9410caa5 Minor UI fix 2020-04-11 21:48:47 +03:00
Lior Halphon
32a0dc0e43 Rename the "Developer" menu to "Develop", like first party Mac apps 2020-04-11 20:44:15 +03:00
Lior Halphon
695c6ee943 Don't crash if a naughty frontend runs the boot ROM without a ROM 2020-04-11 19:21:00 +03:00
Lior Halphon
0abd3b2c46 Dump and load cheats 2020-04-11 19:15:40 +03:00
Lior Halphon
5df45417fa Console quirks 2020-04-11 18:27:31 +03:00
Lior Halphon
0c3db932b2 Fix Mavericks compatibility 2020-04-11 18:19:15 +03:00
Lior Halphon
2bc75caf9e Fix CRT shader on OpenGL 2020-04-11 18:03:21 +03:00
Lior Halphon
852a6997ed Add cheats UI to Cocoa 2020-04-11 18:03:10 +03:00
Lior Halphon
337e74352d Add cheats API, with GameShark and GameGenie import 2020-04-09 22:13:09 +03:00
Lior Halphon
1d80c185d8 Remove IDE comment 2020-04-09 17:25:14 +03:00
Lior Halphon
4a21dd3232 The Cocoa sidebar is now resizeable and collapseable 2020-04-09 15:29:49 +03:00
Lior Halphon
a6567d9ee1 Update old coding style 2020-04-09 14:32:52 +03:00
Lior Halphon
a9cd3f2c11 Fix operator priorities, fix parsing debugger bug 2020-04-09 14:21:07 +03:00
Lior Halphon
92d6cc6394 Use official register names 2020-04-09 02:36:27 +03:00
Lior Halphon
d8e89f5114 Fix banked 16-bit assignments; fixes #245 2020-04-08 19:17:45 +03:00
Lior Halphon
0ed5cf6b38 Proper MBC30 support, more accurate MBC3 emulation. Fixes #244 2020-04-08 19:07:29 +03:00
Kawa-oneechan
882e5d292f Fix QT pWindow::setModal
As in higan, not my code.
2020-04-07 20:32:45 +02:00
Kawa
1ebed1701a Merge pull request #6 from Sintendo/setting-input-crash
settings/input: Fix updateControls crashes
2020-04-03 00:38:21 +02:00
Sintendo
97452b6ec3 settings/input: Fix updateControls crashes
updateControls assumes that when activeMapping is set, an item from
mappingList is guaranteed to be selected. However, there are several
scenarios that break this assumption:

- changing port during an active mapping
- changing device during an active mapping
- reloading the input driver during an active mapping

In all of these cases, updateControls is eventually called. It sees an
outstanding activeMapping and proceeds to figure out the offset of the
currently selected item, but since there are no selected items it ends
up dereferncing a null pointer.

The assumption can be honored by having reloadMappings cancel the
outstanding activeMapping, thus preventing a crash.

Fixes #4.
2020-04-01 01:05:10 +02:00
Lior Halphon
d75b7c0023 Feature request; allow loading prefs.bin relatively 2020-03-28 22:56:19 +03:00
Lior Halphon
9f3bffd4dd Add volume control to SDL 2020-03-27 19:10:42 +03:00
Lior Halphon
2f1b8e5b57 IME is now available under the registers command 2020-03-27 18:56:47 +03:00
Lior Halphon
1a3572316f next now skips over halt, closes #233 2020-03-27 17:49:14 +03:00
Lior Halphon
05403d3a56 Fix the Joypad interrupt. Fixes #237 2020-03-27 17:36:55 +03:00
Lior Halphon
876b36ac1c More crash fixes, restore Metal support 2020-03-27 17:26:51 +03:00
Lior Halphon
588c0734a9 Fix a crash 2020-03-27 17:23:33 +03:00
Lior Halphon
4cb56dc76f Improve MBC2 emulation. Fixes #238 2020-03-27 16:35:36 +03:00
Lior Halphon
fa1c84f18f Remove the Blend Frames menu item 2020-03-27 15:43:30 +03:00
Lior Halphon
7a807f5cae Fix #243 2020-03-26 22:18:31 +02:00
Lior Halphon
5ecb845662 Add accurate frame blending option 2020-03-26 20:54:18 +02:00
Lior Halphon
e94e7cc501 Add another color correction mode 2020-03-25 20:33:13 +02:00
Sintendo
1cde5dfad8 libco/aarch64: Optimize co_swap_function
Improves thread-switching performance using the following techniques:

- Interleave stores/loads
- Restore the stack pointer and link register as early as possible
2020-03-23 23:31:19 +01:00
Sintendo
7d9ebc59a0 libco/aarch64: Fix vector register handling
The calling convention specifies that d8-d15 (the lower 64 bits of
vector registers q8-q15) are callee-saved. However, libco was
erroneously saving and restoring general-purpose registers x8-x15
instead.
2020-03-23 23:31:19 +01:00
MerryMage
69d527f322 presentation: Bugfix for macOS: about -> aboutBsnes 2020-03-22 17:24:53 +00:00
byuu
da335007e7 Remove documentation website link. 2020-03-23 01:28:48 +09:00
byuu
3df6623fbf Convert bsnes into a group project and relicense it to GPLv3 or later. 2020-03-23 00:57:29 +09:00
Lior Halphon
84e8e45b7b Implement ATTR_CHR 2020-03-13 13:35:54 +02:00
Lior Halphon
e7f6ac8828 Do the same for SGB 2020-03-06 21:19:53 +02:00
Lior Halphon
34cf0f558d It's more reasonable to do it this way 2020-03-06 18:56:51 +02:00
Lior Halphon
fe7667a00c Add drop shadows to the Monochrome LCD shader 2020-03-06 17:37:47 +02:00
Lior Halphon
4963ec4cc4 Gamma correction in the CRT shader 2020-03-06 17:37:29 +02:00
Lior Halphon
ee939a3782 New boot ROM animation in the DMG boot ROM 2020-03-06 17:37:18 +02:00
Lior Halphon
78b552fe82 More attempts to fix this bug 2020-03-06 17:37:04 +02:00
Lior Halphon
c6f9d05124 Emulate LCD-PPU horizontal desync on DMGs 2020-03-06 14:41:13 +02:00
Lior Halphon
4d2f56c42d Minor bug fix 2020-03-04 23:43:05 +02:00
Lior Halphon
1c7351fc85 Missing braces 2020-03-04 23:34:36 +02:00
byuu
8e80d2f8a4 v115 2020-03-03 19:56:48 +09:00
Lior Halphon
409ab2a6d4 Accurate emulation of tilemap advancement timings 2020-03-03 02:21:19 +02:00
Lior Halphon
e846f4f3b0 Hacky, but correct emulation of WX=166 2020-03-01 23:58:28 +02:00
Lior Halphon
2a8b26d5e6 Add TODO 2020-03-01 00:23:50 +02:00
Lior Halphon
b7194402eb Accurately emulate Window X = Object X 2020-03-01 00:17:45 +02:00
Lior Halphon
5ca602fbd2 WX=0 emulation 2020-02-29 18:26:16 +02:00
Lior Halphon
39b999a68b Emulate the FIFO insertion glitch (WX variant) 2020-02-29 17:06:08 +02:00
Lior Halphon
955860b463 Get rid of the FIFO pause flags 2020-02-28 22:36:51 +02:00
Lior Halphon
e29246fd91 Window tile is reset on WX trigger 2020-02-28 18:28:47 +02:00
Lior Halphon
2a8f15c68b The fetcher pushes pixels to the FIFO as soon as it's empty 2020-02-28 18:10:09 +02:00
Lior Halphon
60f01fe947 Merge branch 'master' into ppu_window 2020-02-28 15:21:38 +02:00
Lior Halphon
40868df759 Fix this bug again 2020-02-28 14:05:29 +02:00
byuu
bd1759eb45 Add credits. 2020-02-28 17:31:25 +09:00
Lior Halphon
0c716bd970 More accurate timing emulation of window-objects interaction 2020-02-27 23:42:16 +02:00
Lior Halphon
52a3bf5f24 Merge pull request #234 from NieDzejkob/spelling
Spell "length" properly
2020-02-27 19:36:20 +02:00
Jakub Kądziołka
67d5a53503 Spell "length" properly 2020-02-27 18:11:10 +01:00
Lior Halphon
89303ab046 WX access conflicts 2020-02-27 00:12:42 +02:00
Lior Halphon
9c7a8fdb1b WY is tested every cycle 2020-02-26 22:24:08 +02:00
byuu
5296176151 v114.6
Fixed accuracy PPU rendering issue affecting Secret of Mana
2020-02-26 19:57:21 +09:00
Lior Halphon
b37a0b285a Window Y still advances if WX=166 2020-02-24 23:59:18 +02:00
Lior Halphon
7456beb7b9 Better emulation of negative WX positions 2020-02-24 21:23:06 +02:00
Lior Halphon
248e7bc332 Timing improvements 2020-02-24 20:46:00 +02:00
Lior Halphon
25b51362e9 Safety first 2020-02-24 00:33:45 +02:00
Lior Halphon
3864ff37e1 Timing improvements 2020-02-24 00:32:47 +02:00
Lior Halphon
c22611c701 Minor bugfix 2020-02-23 23:48:08 +02:00
Lior Halphon
c0ba898ef2 Basic window implementation 2020-02-23 23:16:45 +02:00
byuu
64d20a062a Windows compilation fix. 2020-02-23 21:03:24 +09:00
byuu
c22ef09f13 PulseAudio compilation fix. 2020-02-23 20:36:28 +09:00
byuu
2223a843c9 Restore IOKit fix that was missing from higan ruby sync. 2020-02-23 20:34:10 +09:00
byuu
d2211d8818 v114.5
* improved appended firmware detection [devinacker]
* added dynamic rate control support to ALSA and PulseAudio drivers [RedDwarf]
* added option to use native file dialogs
2020-02-23 20:23:25 +09:00
Lior Halphon
2be58439bf Starting over – removing all window related code 2020-02-23 00:38:47 +02:00
Lior Halphon
83ea4edce2 Shut up, annoying log message 2020-02-23 00:16:15 +02:00
Lior Halphon
d8282fe3c9 Please pretend the last commit never happened 2020-02-22 00:45:52 +02:00
Lior Halphon
39b88d546b The upper bits of SCX might mid-line 2020-02-21 21:59:03 +02:00
Lior Halphon
ea2f32b255 The fetcher state machine advances even while handling an object 2020-02-21 21:44:44 +02:00
Lior Halphon
f86e682d2c Fix sign 2020-02-21 17:22:57 +02:00
Lior Halphon
8409d3bcfb Emulate changing sprite height mid-fetch 2020-02-21 16:43:51 +02:00
Lior Halphon
7d51ba3d97 More fixes, SGB emulation of the same quirk 2020-02-21 16:16:02 +02:00
Lior Halphon
91404edd13 Disgusting hacks to emulate disabling objects while an object is being fetched 2020-02-21 15:14:33 +02:00
Lior Halphon
56118d2a67 Move improvements to LCDC conflicts 2020-02-21 14:22:25 +02:00
Lior Halphon
a8f63aea3c Emulate DMG LCDC write conflicts correctly. This might vary between individual units. 2020-02-21 02:55:07 +02:00
byuu
c13745d753 v110.4
Merged Super Game Boy MLT_REQ fix [devinacker]
2020-02-18 20:07:05 +09:00
Lior Halphon
0290e70445 Improvements to AGB color correction 2020-02-17 23:05:11 +02:00
Lior Halphon
bf32ae66c6 Another attemp to fix Cocoa deadlocking 2020-02-15 19:23:04 +02:00
Lior Halphon
bec09a012c More accurate emulation of STOP mode 2020-02-15 19:21:43 +02:00
Lior Halphon
08eb2f3d98 Correct emulation of FF6C (Turns out it controls object priority) 2020-02-15 15:32:06 +02:00
Lior Halphon
f550360f1a More accurate CGB color correction curve 2020-02-15 13:21:21 +02:00
Lior Halphon
0677b1d099 Update the automation to not use internel APIs for input 2020-02-11 00:11:17 +02:00
Lior Halphon
8b7805b95d Hit ^T 2020-02-10 20:19:37 +02:00
Lior Halphon
804b9bec63 Fixed a bug where HDMA begins in the middle of an instruction while cycles are pending to be flushed. Fixes #230 2020-02-10 00:21:33 +02:00
Lior Halphon
dcb3f6db9e Fix minimum window size in the Cocoa frontend 2020-02-08 14:38:04 +02:00
Lior Halphon
103caa56e1 Allow displaying borders outside of SGB emulation, including borrowing SGB border. Allow not displaying SGB borders. (Todo: libretro support) 2020-02-08 13:28:46 +02:00
Lior Halphon
370f02661d Deadlock fix 2020-02-08 12:31:06 +02:00
Lior Halphon
b806ae4e82 Fix #228 2020-02-01 23:36:16 +02:00
Lior Halphon
38ee020653 Fixed a regression bug that made the first CGB frame blank instead of repeated. 2020-01-31 01:29:59 +02:00
Lior Halphon
ce5153544c Fix menu scrolling in SDL while emulating SGB 2020-01-29 20:55:17 +02:00
Lior Halphon
48d3504de7 Let the core handle boot ROM selection 2020-01-29 20:29:30 +02:00
Lior Halphon
99d2c0258c Add monochrome LCD shader 2020-01-29 15:51:53 +02:00
Lior Halphon
046b09052c Add DMG color palettes (SDL), add scrolling to SDL menus 2020-01-29 15:36:19 +02:00
Lior Halphon
163a5ea20c Add DMG color palettes (Cocoa) 2020-01-29 14:19:11 +02:00
byuu
7053a0b605 Readme updated. 2020-01-18 14:23:10 +09:00
byuu
58eb6838b7 Fixed links in readme. 2020-01-18 01:25:55 +09:00
byuu
1f4f1223a1 v114.3
Dot PPU: latch fine BG Hscroll at H=0 instead of H=56
(fixes minor scanline issues in Full Throttle Racing scoring screen)
(note: exact latch position is not currently known)
2020-01-17 09:09:01 +09:00
byuu
3cc8c589cc Remove debugging variables. 2020-01-16 23:16:37 +09:00
byuu
52d5b3e2a2 v114.2
Serialize SDD1 PEM
(fixes run-ahead in Star Ocean)
Dot PPU: calculate nameTableIndex and characterIndex from ppu.hcounter()
(fixes scanline glitch in Great Battle IV)
Dot PPU: do not latch BG H/V scroll registers
(fixes Air Strike Patrol raster effects)
(fixes Septentrion glitchy scanline)
2020-01-16 23:12:37 +09:00
byuu
358a3ceed7 libretro: added cheat support [rtretiakov]
libretro: aspect ratio correction [rtretiakov]
libretro: MSU1 lookup fix [rtretiakov]
libretro: merged latest resources and overrides from upstream
libretro: changed audioFrame() from float to double [byuu]
2020-01-16 05:45:35 +09:00
byuu
c6918fc170 Fix "make clean" when using cmd.exe shell on Windows 2020-01-16 05:40:55 +09:00
byuu
1afd440c86 Revert Emulator::Audio to use doubles instead of floats
* fixes ODR violations, but is slightly slower (378fps->376fps)
2020-01-16 05:34:00 +09:00
byuu
702977f0b9 Mosaic cleanups. 2020-01-16 05:26:56 +09:00
byuu
fb463d34ef v114.1
Improved vertical mosaic emulation.
2020-01-16 05:09:52 +09:00
byuu
55e78b03de Point to specific project. 2020-01-08 18:50:07 +09:00
byuu
47dcdc1b4f Added Windows binary release link. 2020-01-08 18:49:40 +09:00
byuu
e13ab011eb v114
Added fast PPU override for Marvelous (fixes text rendering)
Fixed disassembly of SNES CPU opcodes 0x74-0x76 [invertego]
2020-01-08 18:46:53 +09:00
Lior Halphon
0737655753 Merge branch 'master' into JoyKit 2020-01-03 23:42:25 +02:00
Lior Halphon
95af00a752 speling is veri difikult 2020-01-03 21:11:45 +02:00
Lior Halphon
89713521d4 Merge pull request #222 from Pixelnarium/master
fix SDL build -> Windows.h include at the wrong place
2020-01-02 11:54:27 +02:00
Pixelnarium
5a1812f237 fix SDL build 2020-01-02 10:50:55 +01:00
Lior Halphon
23c7fb2885 Update version, update copyright year 2020-01-01 23:43:36 +02:00
Lior Halphon
e9f6667cf5 Minor build cleanup 2020-01-01 23:36:15 +02:00
byuu
892f202945 Updated SNES game databases 2020-01-01 18:45:11 +09:00
Lior Halphon
3882b1b4b9 Fix Windows build, hopefully fix High DPI support on Windows 10 (fixes #202) 2020-01-01 00:27:41 +02:00
Lior Halphon
7929573dc1 Refinements to the last commit 2020-01-01 00:17:54 +02:00
byuu
e575196abc . 2019-12-31 19:42:11 +09:00
byuu
404caeab50 The input workaround for Taikyoku Igo benefits:
Williams Arcade's Greatest Hits and World Masters Golf;
in very subtle ways, so enable it for those two titles as well.
2019-12-31 19:40:35 +09:00
byuu
dde9b4c2c7 v113.5
It seems auto-joypad poll timing is needed for most games.
So that's back in as before. Instead, I added an override for
Taikyoku Igo - Goliath specifically, until auto-joypad emulation
can be improved further.
2019-12-31 10:22:31 +09:00
Lior Halphon
e434b625ea Allow the fullscreen key combo to work while in the menu 2019-12-30 16:19:06 +01:00
byuu
793f2e5bf4 v113.4
Completely disabled auto-joypad timing (happens immediately)
(fixes World Masters until this can be emulated fully)
Disabled fast PPU for Winter Olympic Games
(changes OAM tiledata address mid-frame)
Disabled fast PPU for World Cup Striker
(I'm not sure yet why it's not compatible)
Cleared overscan region when disabling overscan
(fixes World Class Service SNES Tester)
Added override for invalid SNES header in Yuyu no Quiz de Go! Go!
2019-12-30 06:00:17 +09:00
Lior Halphon
4c24323530 Fix Game Boy Camera support in macOS Mojave and newer 2019-12-29 17:34:43 +01:00
byuu
cc4ab9bc25 Added workaround to reduce auto-joypad polling delays
(until we can emulate the behavior more faithfully)
2019-12-28 13:53:06 +09:00
byuu
2551f20f3a v113.3
Fixed region heuristics for the one Scandanavian SNES game release
2019-12-28 13:41:57 +09:00
byuu
5b29ddbcaa Add hotfix for Nichibutsu Arcade Classics (Japan)
* Frisky Tom hangs sometimes when memory is randomized
2019-12-27 08:58:09 +09:00
byuu
ac4d16c917 Revert gamepak firmware naming to use architecture instead of identifier
* identifier naming interferes with game ROM naming lookup
2019-12-27 08:51:05 +09:00
byuu
01c16dcf4d Fix Taikyoku Igo - Goliath
(clear $4218-421f to 1s instead of 0s at start of auto-joypad polling)
2019-12-27 08:32:18 +09:00
byuu
169c0871c7 Added Super SWIV fast PPU override 2019-12-27 08:17:39 +09:00
Lior Halphon
8a99d41c31 Fix broken SDL builds on macOS and Windows 2019-12-26 02:00:58 +02:00
byuu
ffee61a1b1 Merge pull request #250 from Sintendo/xcode11-opengl-fix
ruby/CGL: explicitly set current OpenGL context
2019-12-24 18:51:01 +09:00
Sintendo
526df86ee6 ruby/CGL: explicitly set current OpenGL context
On builds made with Xcode 11+ the current OpenGL context wasn't being
properly configured anymore, resulting in shader compilation errors and
a red screen.

Explicitly calling makeCurrentContext fixes this.
2019-12-23 22:30:58 +01:00
byuu
748cf44f35 Added run-ahead support to libretro target [realnc]
Fixed typo in the GUI regarding HD mode 7 +/- hotkeys
2019-12-19 22:04:14 +09:00
byuu
a4f96f0648 Fix link. 2019-12-19 21:16:53 +09:00
byuu
2ca1bab9ed Updated links in readme file. 2019-12-19 21:16:06 +09:00
byuu
1e6a745f19 v113.1
Emergency hotfix for an issue affecting manually created save states.
Still need to determine root cause, but for now, reverting the code.
2019-12-16 01:59:39 +09:00
byuu
90b1350110 v113 2019-12-11 22:02:23 +09:00
byuu
357d054c19 Fix LLE gamepak firmware name lookups (use identifier, not architecture) 2019-12-11 21:56:29 +09:00
byuu
d62e3f3362 v112.14
Finally corrected Super Game Boy 2 audio [LIJI]
2019-12-11 21:40:07 +09:00
Anthony J. Bentley
7c9508ae96 Include the canonical SDL2 path, which drops the SDL2/ prefix.
Use pkg-config or sdl2-config to determine SDL and GL compilation flags.
2019-12-10 00:56:34 -07:00
byuu
4ec45a7453 Some more testing for Super Game Boy audio mixing. 2019-12-09 09:23:33 +09:00
byuu
f5d40bd1ee Testing: added Super Game Boy audio mixing test function. 2019-12-09 00:08:37 +09:00
byuu
6aa7c944d5 v112.3
Improvements to ruby driver crash detection.
Workaround added for rare crash on close on Windows.
2019-12-08 01:39:46 +09:00
byuu
dafd673177 v112.12
Update to SameBoy-master [2019-12-02]
2019-12-02 20:22:51 +09:00
byuu
a64c1adaa8 v112.11
SFC: Disable color blending for first hires pixel with accuracy PPU
(fixes a green scanline on the left-edge of Jurassic Park)
libco: Don't include <sys/mman.h> when not using mprotect
nall: Detect Windows without invoking uname [Alcaro]
2019-12-02 19:54:03 +09:00
byuu
1c7e6c58c3 v106.232
Correct merge issue with libco
Don't invoke uname on Windows targets [Alcaro]
2019-12-02 19:45:14 +09:00
byuu
0d6a02168b v106.231
SFC: disable math color bleed for first pixel
(fixes green line on the left-edge of Jurassic Park)
SFC/GG: attach Screen settings to Screen node, not PPU/VDP node
(fixes remembering Screen settings)
2019-12-02 19:28:48 +09:00
Nikos Chantziaras
d094c21824 Don't include sys/mman.h when not using mprotect 2019-11-25 13:26:30 +02:00
Lior Halphon
0ea361a82f Merge pull request #207 from libretro/master
Update from downstream
2019-11-22 11:29:10 +02:00
retro-wertz
436dc0b67a Fix GBC memory map and add IO port range for cheevos 2019-11-21 22:53:11 -05:00
Lior Halphon
bd9ac204c2 Allow SameBoy to compile on 4-byte-bools platforms 2019-11-20 22:40:03 +02:00
byuu
0d1d6f329d Scanline PPU render position override for Suguro Quest++ 2019-11-12 23:17:25 +09:00
byuu
7cd897b53b . 2019-11-10 10:18:24 +09:00
byuu
011f470b07 Add images to readme 2019-11-10 10:17:42 +09:00
byuu
6edad01fb8 . 2019-11-10 10:05:52 +09:00
byuu
3ecea80ecb v112.10
Fix accuracy PPU mosaic rendering when size!=0 && enable==0
2019-11-10 10:01:13 +09:00
byuu
b7b848eff5 Fix audio balance below 50% 2019-11-10 09:37:56 +09:00
Lior Halphon
31609319de Fix the set_joyp API 2019-11-09 14:45:38 +02:00
Lior Halphon
c802361800 Whoops, this function was missing 2019-11-08 16:14:16 +02:00
byuu
da7350ac5c Rename functions for consistency. 2019-11-08 16:12:33 +09:00
byuu
ba3fca27ad Fix GUI typos. 2019-11-08 16:00:27 +09:00
byuu
5775155714 v112.9
CPU IRQ improvement to fix Shin Nihon Pro Wrestling Kouhin '95
2019-11-08 15:56:27 +09:00
byuu
f1108408a8 Updated libretro resources file again 2019-11-05 09:01:54 +09:00
byuu
996358da66 v112.8
Made the main window canvas area (program icon) droppable for games
Merged the latest SameBoy core, but disabled it due to an input problem
2019-11-05 08:58:59 +09:00
Lior Halphon
143e1f88a8 There’s not reason it must be an integer 2019-11-03 22:02:33 +02:00
Lior Halphon
68187d7c5f Merge pull request #218 from ZenithMDC/SDL2-hide-mouse-cursor
SDL2: Hide mouse cursor when menu is not active
2019-11-03 21:07:50 +02:00
Lior Halphon
0bfcdafe2d Merge pull request #217 from ZenithMDC/SDL2-viewport-bugfix
SDL2: Fix fullscreen viewport bug
2019-11-03 21:06:42 +02:00
Lior Halphon
97a2cc2566 Merge pull request #216 from ZenithMDC/SDL2-hot-swap-battery-save
SDL2: Write battery to disk when ROMs are hot-swapped
2019-11-03 21:05:49 +02:00
Lior Halphon
cfc0215089 Merge pull request #204 from f21red/sgb
libretro: sgb updates
2019-11-03 21:05:19 +02:00
Matthew Coppola
2f4a10913b SDL2: Hide mouse cursor when menu is not active 2019-11-03 00:35:56 -04:00
Matthew Coppola
139ae8cc08 SDL2: Write battery to disk when ROMs are hot-swapped 2019-11-02 23:50:29 -04:00
Matthew Coppola
719a92d8a4 SDL2: Fix fullscreen viewport bug 2019-11-02 23:31:23 -04:00
byuu
c717a0e7bd Mapping fix for RPG Tsukuru 2 2019-11-01 06:26:24 +09:00
byuu
2884cd87d2 v112.7
Added BSC-1A7M-10 board
Corrected BSC-1AxM-xx masking
2019-11-01 05:36:02 +09:00
byuu
454b90be24 v112.6
Fix for Kishin Douji Zenki - Tenchi Meidou
2019-10-31 10:56:16 +09:00
byuu
2b9a22e1d8 Merge IOKit hotplug support patch [Sintendo]
Merge libretro Super Game Boy support improvement patch [fr500]
2019-10-31 09:19:27 +09:00
byuu
1c1cfd086b v112.5
Added game hotfix for Rendering Ranger R2.
2019-10-31 09:13:37 +09:00
Lior Halphon
70542137f2 Fix #214 2019-10-29 20:31:20 +02:00
byuu
f2978247c1 v112.4
Reverted Kishin Douji Zenki fix, as it seems to have been incorrect.
Disabled supersampling when EXTBG mode is active.
Fixed MSU1 and SGB audio when using run-ahead and overclocking.
macOS: fixed a serious issue with the IOKit joypad driver [kode54]
2019-10-27 13:13:59 +09:00
byuu
4f32551430 . 2019-10-27 01:31:33 +09:00
byuu
c61c3cabc6 . 2019-10-27 01:27:36 +09:00
byuu
819d6dbde4 v112.3
Fixed offset-per-tile regression with accurate PPU renderer.
2019-10-27 00:51:15 +09:00
byuu
f51bc06739 v112.2
Temporarily disabled crash detector to work around Windows issue.
Corrected PPU OAM address latching with the accuracy PPU.
2019-10-26 23:34:24 +09:00
byuu
4f09a3873d v112.1
Add SA1 generic board mapping without RAM.
2019-10-22 12:35:14 +09:00
byuu
55bfe402e7 v112 2019-10-20 02:18:37 +09:00
Lior Halphon
0ece21bca7 Replace the SDL-derived controller support with my own JoyKit framework. Adds rumble support, LED support, better manual and automatic configurations, analog speed controls. 2019-10-19 19:26:04 +03:00
byuu
0d87e92a10 v106.224 2019-10-20 01:14:04 +09:00
byuu
ef1d4b592a v106.223 2019-10-20 00:28:09 +09:00
Lior Halphon
7d6cdf3819 Fix SGB support in SDL’s software rendering. Fixes #208 2019-10-17 21:21:10 +03:00
byuu
30d7fa1923 v111.10
Fixed deterministic serialization on Windows.
2019-10-17 21:42:42 +09:00
byuu
9f86a3be26 v111.9
Cleanups.
2019-10-16 16:17:56 +09:00
byuu
6b7e6e01bb v111.8
Serialize SDD1 decompressor
Major speedup to nall/serializer [Alcaro]
Removed fast PPU tile cache (major speedup for run-ahead mode)
2019-10-16 16:12:28 +09:00
byuu
53f8de6ac3 Merge pull request #174 from Alcaro/master
Optimize serialization stuff a bit
2019-10-16 09:26:50 +09:00
Alcaro
cd18cdb1d6 Optimize serialization stuff a bit 2019-10-15 20:29:04 +02:00
byuu
6cb7d89d64 Update features. 2019-10-15 22:27:18 +09:00
byuu
19f3cdfd5e v111.8
Added fully working deterministic save state support (non-portable.)
Rewind is now 100% deterministic, disk save states are still portable.
Added run-ahead support.
2019-10-15 22:12:10 +09:00
byuu
a32b6fae74 Minor syntax edit. 2019-10-14 23:47:17 +09:00
byuu
03a6e1c7de Added CONTRIBUTING.md 2019-10-14 23:46:21 +09:00
byuu
6b34f134bf More libretro changes. 2019-10-14 23:16:25 +09:00
byuu
2de906ea46 v111.7
Added System/Serialization/Synchronize setting to settings.bml
This option is for experimental deterministic rewind support.
It does not currently work with SuperFX and SA-1 games,
and as such is set to true (force synchronize) for now.
2019-10-14 23:04:38 +09:00
byuu
3a1855a80f v106.222
Added port filter panel list
Renamed ProgramWindow to Program
2019-10-14 20:31:17 +09:00
byuu
95addddc46 v111.6
Added support for multiple serialization methods.
Revert to the fast method for games by default.
Default Tales of Phantasia and Star Ocean to the new strict method.
Added new Synchronization/Method settings file override.
Added new pseudo-fullscreen hotkey toggle by request.
Added new preset settings buttons to the driver settings panel.
Merged Super Game Boy support for the libretro target [rtretiakov]
2019-10-13 23:44:53 +09:00
byuu
45e9e0f0ea Language detection fix attempt 1. 2019-10-12 15:47:34 +09:00
byuu
0aea7fd5c5 NHL '94 (Japan) scanline override for fast PPU 2019-10-12 14:38:09 +09:00
byuu
fb95d5b59f v111.5
Updated frame advance to run after first advance when paused previously.
Moved frame events into the CPU core to prevent PPU<>NMI race condition.
Credit to r5 for pointing out there being an issue during frame advance.
2019-10-12 14:28:03 +09:00
byuu
3d646aef73 Added SHVC-2P3B-01 2019-10-10 11:34:45 +09:00
byuu
3fb7ff6bfe v110.4
Save state improvements.
2019-10-09 00:48:59 +09:00
byuu
d8bc2050be v111.4
Serialization improvements.
2019-10-09 00:45:57 +09:00
Lior Halphon
dee29c118c Added GB_set_sample_rate_by_clocks API, split SGB_NO_SFC into PAL and NTSC; now they report the correct clock rate. 2019-10-08 15:10:24 +03:00
byuu
e71da4d8c8 Fix detection of ST010 HLE mode when firmware is missing.
Fix display of ST011 missing firmware message.
2019-10-07 16:03:53 +09:00
byuu
e78aca34b9 v111.3
Save state improvements: rewind should be fully stable now.
Before, Star Ocean and Tales of Phantasia would rarely hang with rewind.
2019-10-07 13:32:21 +09:00
byuu
0c82cc325e v111.2
Two sprite fixes for the accurate PPU and Star Ocean.
2019-10-06 18:11:53 +09:00
f21red
0a7a0ca5fe libretro: sgb border option 2019-10-05 20:51:59 -05:00
byuu
78c76962ec v111.1 2019-10-06 10:45:03 +09:00
f21red
c50ea6a63f libretro: sgb color correction 2019-10-06 01:35:44 +00:00
byuu
e22167cf82 v111.1
More improvements to SameBoy audio interface for Super Game Boy.
Added a fix for a very rare crashing issue with SDL 2.0 joypad support.
2019-10-06 10:14:30 +09:00
byuu
1698533774 v111 2019-10-05 15:09:50 +09:00
byuu
7b66e1c531 libretro Makefile improvements [orbea] 2019-10-05 14:34:09 +09:00
byuu
c6f92b782c Minor touchups. 2019-10-05 14:30:55 +09:00
byuu
e3f2e634c8 Fixed audio crackling in Super Game Boy emulation. 2019-10-05 14:29:31 +09:00
byuu
e598e81ab9 Add compatibility fixes to libretro target. 2019-10-05 13:48:35 +09:00
byuu
d37fb1c12e Added 17 new pixel shaders courtesy of hunterk porting and testing them. 2019-10-05 13:44:51 +09:00
byuu
eaf33cb078 Fix issue with bsnes not remembering user-selected audio frequency. 2019-10-05 13:37:04 +09:00
byuu
07427e4697 v110.7
Improvements to HDMA timing (courtesy of test ROM from undisbeliever]
This fixes flickering in Full Throttle - All-American Racing
2019-10-05 13:24:14 +09:00
byuu
b5301b7ea8 v110.6
Revert AVX2 (see pull request for details)
2019-10-05 10:34:32 +09:00
byuu
57c53a86b4 v110.5
Merged Alcaro's AVX2 mode 7 renderer.
Enable by editing mode7hd.cpp: USE_AVX2=1
2019-10-02 09:56:13 +09:00
Lior Halphon
ca370eee7e A bit more accurate AGB audio rendering 2019-10-01 18:50:59 +03:00
byuu
f19f31938b Allow 2 megabit SRAM for SA-1 homebrew. 2019-10-01 06:56:50 +09:00
byuu
4efee7e9f1 Hotfix for Magical Drop (Japan)'s "tokoton mode" 2019-10-01 06:51:17 +09:00
byuu
3701236ca0 v107.4
Shrink Pixel struct for ~1.75% speedup [Alcaro]
2019-10-01 06:41:38 +09:00
byuu
2f684caa7c Merge pull request #132 from Alcaro/pixel4
Shrink struct SuperFamicom::PPUFast::Pixel from 12 to 4 bytes
2019-10-01 06:41:00 +09:00
Lior Halphon
ac418b9de1 Pass channel_1_freq_change_timing 2019-09-30 00:09:25 +03:00
Alcaro
3a064fc5a3 Shrink struct SuperFamicom::PPUFast::Pixel from 12 to 4 bytes
This gives approximately 3% speedup (118->122fps) on the F-Zero title screen
2019-09-29 13:02:20 +02:00
byuu
5a4b667eae v110.3
Added hotfix for bug in "The Hurricanes" (happens on a real SNES)
Added scanline override for NHL '94
Added fix for entering folder names into BrowserDialog filename box
2019-09-27 10:26:55 +09:00
byuu
62729df2d1 Build fixes [Screwtape] 2019-09-26 03:38:01 +09:00
byuu
1ef227f482 v110.2
Added CRT-Royale [hunterk]
Improved libretro target [rtretiakov]
2019-09-25 15:13:12 +09:00
byuu
6e5542aa20 v110.1
Fixed region detection issue in Hanguk Pro Yagu
Fixed boot hanging issue in Kishin Douji Zenki - Tenchi Meidou
Fixed slowdown issue in Mega Man X2 & X3
Added mute hotkey
Added HD mode 7 hotkeys (likely temporary, we'll see)
2019-09-23 09:50:40 +09:00
Lior Halphon
0c48ecb3f8 Updated version to 0.12.2 2019-09-14 20:06:01 +03:00
Lior Halphon
652e52df3d Pass the SGB multiplayer tests 2019-09-14 12:31:52 +03:00
Lior Halphon
851dbd3ccd SGB and AGB color correction 2019-09-13 17:13:21 +03:00
Lior Halphon
4fcc921b46 Fix SGB multiplayer, improve multiplayer accuracy 2019-09-13 17:10:58 +03:00
Lior Halphon
eaa1c1cd4a Merge bsnes’s changes 2019-08-16 17:38:43 +03:00
byuu
07c1beadfb v106.185 2019-07-24 22:05:39 +09:00
Shawn Anastasio
6d4cddb818 Implement ppc64 ELFv2 support in libco
The existing ppc implementation in libco only supports
the ELFv1 ABI on PowerPC 64 and therefore can't be used on
Little Endian systems and Big Endian systems running ELFv2
distros.

This commit introduces a new implementation of the libco
API for ppc64 elfv2. It has been tested with bsnes and higan.
The original ppc implementation is maintained for non-ELFv2
targets.
2019-07-23 17:24:45 -05:00
Lior Halphon
e3672e8293 Emulate built in SGB palettes 2019-07-20 16:10:24 +03:00
Lior Halphon
17793ef361 Merge pull request #191 from rzumer/gbc_memory_map
Fix libretro GBC memory map and add IO port range for cheevos
2019-07-20 00:04:36 +03:00
Lior Halphon
d2e9025be6 Fixed major performence issues in the Cocoa port that affected some Macs, especially when emulating SGB1 2019-07-19 23:59:25 +03:00
Raphaël Zumer
1a263a3acc Fix GBC memory map and add IO port range for cheevos 2019-07-19 16:55:59 -04:00
Lior Halphon
8c1f76a594 Fix HLE SGB 2019-07-19 20:37:58 +03:00
Lior Halphon
ffb9f1b134 Fix HLE SGB 2019-07-19 20:34:26 +03:00
Lior Halphon
e634019ac9 Fix CGB emulation 2019-07-19 20:27:53 +03:00
Lior Halphon
4f9c8e9374 Match the HLE timings to the LLE timings 2019-07-19 20:19:09 +03:00
Lior Halphon
ea7dec4e88 Merge branch 'master' into bsnes_integration 2019-07-19 15:51:10 +03:00
Lior Halphon
33198fc7b7 Give SGB its own conflict map 2019-07-19 15:50:49 +03:00
Lior Halphon
f0809a667f Fixed a potential Cocoa crash when closing a window 2019-07-19 15:50:36 +03:00
Lior Halphon
df7f7d8171 Fix silly desync inaccuracy 2019-07-18 22:55:11 +03:00
byuu
5ff2383af7 v106.181
* SFC: fixed PPU WIP regression with sprites in Donkey Kong Country 2
* libco: fix ELFv2 PowerPC compilation
* hiro: fix Cocoa compilation
* other: miscellaneous code cleanups
2019-07-19 00:39:19 +09:00
Lior Halphon
772289c545 Fix a silly bug 2019-07-18 00:53:11 +03:00
Lior Halphon
9651f2bb6b Merge branch 'master' of https://github.com/LIJI32/SameBoy 2019-07-18 00:13:54 +03:00
Lior Halphon
597dc72e46 Fix audio issues with some RetroArch audio drivers. Fixes #189 2019-07-18 00:13:41 +03:00
byuu
0d35f2277b Update license copyright dates. 2019-07-17 22:23:15 +09:00
Lior Halphon
ee4864449c Merge pull request #187 from webgeek1234/master
libretro: Android update
2019-07-17 00:52:27 +03:00
Lior Halphon
23ca397206 Remove unused flag 2019-07-17 00:52:01 +03:00
Lior Halphon
0857abe6a4 Merge pull request #190 from pinobatch/master
cgb_boot: Compress logo with PB8
2019-07-17 00:15:41 +03:00
Damian Yerrick
26cf970713 don't need logo-compress.c anymore 2019-07-16 17:04:23 -04:00
Damian Yerrick
4504de828a cgb_boot: Compress logo with PB8
The logo is compressed using PB8, a form of RLE with unary-coded
run lengths.  Each block representing 8 bytes consists of a control
byte, where each bit (MSB to LSB) is 0 for literal or 1 for repeat
previous, followed by the literals in that block.

PB8 compression is also used in a few NES games.  A variant called
PB16, where 1 means repeat 2 bytes back, is used in the Game Boy
port of 240p Test Suite and in Libbet and the Magic Floor.

Switching from logo-compress RLE to PB8 decreases the compressed
logo data size from 287 bytes to 253 bytes, saving 34 bytes.
The decompression code is also about 10 bytes smaller.
2019-07-16 16:58:16 -04:00
Lior Halphon
1bf5fb208f Silence an unwanted GCC warning 2019-07-16 23:41:05 +03:00
Lior Halphon
9efd20d7cd Revert "Silence some GCC warnings"
This reverts commit 11a9f1df21.
2019-07-16 23:33:07 +03:00
Lior Halphon
11a9f1df21 Silence some GCC warnings 2019-07-16 23:27:35 +03:00
Lior Halphon
eb95f1de55 Fixed a bug where the SDL port loaded the incorrect boot ROM for SGB2. Made SameBoy compatible with older SDL versions. 2019-07-16 23:14:26 +03:00
peterlemon
d6ffae9c1b Fix libco aarch64 typo 2019-07-16 20:12:03 +01:00
Lior Halphon
9ba6915c85 ICD JOYP write API 2019-07-16 21:42:57 +03:00
Lior Halphon
2d7f54a775 Load ROM from buffer API 2019-07-16 21:04:29 +03:00
Lior Halphon
ce9ce07817 Make the ICD APIs pixel based 2019-07-16 20:44:27 +03:00
Lior Halphon
346e499602 ICD APIs 2019-07-15 23:02:58 +03:00
Lior Halphon
e1873ad2ec Add JOYP write callback API 2019-07-15 22:35:21 +03:00
Lior Halphon
2bfe922650 Allow emulating an SGB without SFC HLE 2019-07-15 20:47:16 +03:00
Lior Halphon
9f7255cd23 Make the automation results more consistent across revisions, and making use of this change as a chance to add color correction to the automation 2019-07-13 20:29:11 +03:00
Lior Halphon
8c8d5afe62 Make the debugger compatible with more sym formats 2019-07-13 17:17:55 +03:00
Lior Halphon
f55c254959 Fixed a regression that made ly_lyc_0_write and ly_lyc_write fail 2019-07-12 02:18:25 +03:00
Lior Halphon
30a58ecd5c Use color correction in the QL previewer 2019-07-12 01:53:20 +03:00
Lior Halphon
6b06d07bcc More attempts to improve audio in the SDL frontend 2019-07-12 01:53:06 +03:00
Tim Allen
4dae9affda Update to v106r175 release.
byuu says:

  - ruby: fullscreen support for Windows OpenGL 3.2, DirectDraw 7.0, GDI drivers
  - ruby: output(width, height) support for all drivers on all platforms
  - hiro: improve focus capture for Canvas and Viewport widgets
  - hiro: added two hotfixes for the macOS Cocoa target [Sintendo]
  - higan, bsnes: focus the viewport after leaving fullscreen exclusive mode
  - freebsd: moved from GCC 8.2.0 to Clang 6.0.1
  - higan: added video display emulation option to Famicom and Mega Drive cores

The reason I moved to Clang was because GCC keeps deadlocking my FreeBSD system.
I don't know if it's GCC's fault, or suddenly running 32 copies of any high-CPU
usage program, heh. But at any rate, it's worth a try. The performance is the
same, but compilation takes a tiny bit longer with Clang.
2019-07-04 12:17:01 +10:00
Lior Halphon
4541efe86a Fixed a bug that prevented writing to the wave RAM, as well as a bug where the wave RAM was treated as zeros despite not being zero’d out 2019-06-29 14:03:42 +03:00
Tim Allen
8a751a7946 Update to v106r170 release.
byuu says:

I finally pass blargg's dmg-sound and cgb-sound tests, but at quite a cost.
Reads and writes can't happen on an exact T-cycle (clock cycle) point within an
M-cycle (opcode cycle) for the DMG. Writes to trigger take effect two clocks
after writes to wave RAM, for instance. Probably going to be a lot more of this
in low-level PPU emulation, so I'm biting the bullet and slowly converting the
Game Boy bus handler to this new format, which I'll use as a test bench for
doing this later to other systems with, since Game Boy performance isn't as
critical (it's a drop from 220fps to 200fps to have to poll the bus four times
per memory access and synchronize the CPU four times as often, so a lot less bad
than I'd feared at least.)
2019-06-27 22:13:03 +10:00
Aaron Kling
72be66414d libretro: jni: Switch stl to c++ in preparation for ndk r20 2019-06-26 22:05:42 -05:00
Lior Halphon
23229f1118 Update version to 0.12.1 2019-06-22 19:12:12 +03:00
Lior Halphon
080fde08b6 Improve audio quality on the SDL port by being more forgiving to system with bigger buffer sizes 2019-06-22 19:01:35 +03:00
Lior Halphon
970a5f562b Fix #183 2019-06-22 18:16:55 +03:00
Lior Halphon
f1b578fd2e Update version to 0.12, update copyright year 2019-06-21 19:20:51 +03:00
Lior Halphon
b478b5b568 Fix bugged mouse support on some platforms 2019-06-21 17:21:11 +03:00
Lior Halphon
72d1d9b154 Fix Windows build 2019-06-21 17:08:10 +03:00
Lior Halphon
36a87f96bd Formatting 2019-06-21 16:58:56 +03:00
Lior Halphon
24b58da8c6 Minor text change 2019-06-21 14:18:48 +03:00
Lior Halphon
7c61445fe3 Fixed out of bound read in GB_load_state_from_buffer. Closes #104 2019-06-21 03:04:38 +03:00
Lior Halphon
72b1fe0500 Minor Fixes™ 2019-06-21 01:03:52 +03:00
Lior Halphon
50a6a3e35c Fix libretro SGB1 FPS, fix un/serialization memory corruptions in libretro 2019-06-19 23:49:43 +03:00
Lior Halphon
91b0e491c5 Increase the minimum required cycles for a sync, fix SGB jingle audio 2019-06-19 22:44:54 +03:00
Lior Halphon
280f609785 Fix under clock speed (Should have been 0.5, but ended up as ~0.4 due to rounding errors) 2019-06-19 22:25:59 +03:00
Lior Halphon
431f1f8199 Remove redundant calls to display_vblank on non-SGB models and in irregular FPS scenarios. Affects #161 2019-06-18 23:16:28 +03:00
Lior Halphon
e268efefef Redesign and reimplement the audio API, let the frontends handle more stuff. Probably affects #161 2019-06-15 23:22:27 +03:00
Lior Halphon
083b4a2970 Fix joypad hat input in the menu in the SDL port 2019-06-15 12:53:00 +03:00
Lior Halphon
8b7922b679 Fix #144 by ignored malformed commands with 0 length 2019-06-15 03:42:53 +03:00
Lior Halphon
b2397a2e7a Joystick hat support in Cocoa 2019-06-14 18:06:15 +03:00
Lior Halphon
66b814a226 Don’t use libc’s random/rand 2019-06-14 16:49:41 +03:00
Lior Halphon
5a04054145 Style changes 2019-06-14 14:34:02 +03:00
Lior Halphon
8389c6a450 Long overdue capitalization fixes 2019-06-14 14:31:17 +03:00
Lior Halphon
a956d58ea1 Merge commit 'c678407d1eae9fec625a644506b3cd66654d9b1a' 2019-06-14 14:28:36 +03:00
Jakub Kądziołka
c678407d1e Compress the Sameboy logo. 117 bytes are now free 2019-06-10 17:45:14 +02:00
Lior Halphon
e2ef8dbbe0 Fix the GUI on some Windows 10 machines (Intel HD?). Fixes #112 2019-06-09 18:43:23 +03:00
Lior Halphon
843683a492 Randomize everything! 2019-06-09 18:14:32 +03:00
Jakub Kądziołka
8386aaf12f Save 20 bytes in the CGB boot ROM 2019-06-09 15:15:08 +02:00
Lior Halphon
8b1c165253 Automation fixes 2019-06-09 13:48:05 +03:00
Lior Halphon
a0c5baecd8 More realistic initial V/RAM values in the boot ROM. Fixes #150 and #91 2019-06-09 00:53:44 +03:00
Lior Halphon
49d8a5cb44 Fixed the parsing of comparison operators as well as their priorities. Fixes #155 2019-06-08 16:08:07 +03:00
Lior Halphon
0da2930109 Fix #175 2019-06-08 14:35:52 +03:00
Lior Halphon
bb7fa95426 Fix incorrect register values when changing the color palette via the boot ROM 2019-06-08 13:37:49 +03:00
Lior Halphon
5cda1f2f5f Fix the last commit 2019-06-08 00:04:58 +03:00
Lior Halphon
d0bd741049 Added SCX/SCY display in the VRAM viewer. Closes #168 2019-06-07 23:38:34 +03:00
Lior Halphon
274760746e Fix #165 2019-06-07 19:18:07 +03:00
Lior Halphon
7fc3de69da Mark CGB-C as experimental 2019-06-07 18:40:54 +03:00
Lior Halphon
9d8adbb581 This is not correct, this bug only affects the PCM registers and not actual output. Currently not emulated at all. 2019-06-07 18:37:19 +03:00
Lior Halphon
2f9de4942c Increase input polling frequency in the Cocoa and SDL frontends, should make inputs look less synthetic and potentially reduce input lag 2019-06-07 18:27:25 +03:00
Lior Halphon
64879f5b02 Accurate emulation of (most aspects of) stop mode 2019-06-07 13:53:50 +03:00
Lior Halphon
4c34e0a6e0 Turns out the AGB inverts Channel 3’s output 2019-06-01 18:22:58 +03:00
Lior Halphon
6888047102 Show flags in the registers command 2019-06-01 16:42:17 +03:00
Lior Halphon
9acb4636db Fix various GTK bugs 2019-06-01 16:19:44 +03:00
Lior Halphon
cdc36f329e Added open dialog to the SDL GUI, misc fixes 2019-06-01 14:29:46 +03:00
Lior Halphon
f9cc7a3b46 Fix SDL mouse support in SGB mode 2019-05-31 18:50:02 +03:00
Lior Halphon
54c353830f SDL GUI mouse support 2019-05-31 18:33:51 +03:00
Lior Halphon
1de34b12ac Merge pull request #181 from ISSOtm/master
Fix sample lengths for CH1, 2 and 4
2019-05-25 21:09:47 +03:00
Lior Halphon
85c43fa81f Fixed Channel 3’s first sample behavior, update analog characteristic to more realistic values. Fixes #177 2019-05-25 19:12:09 +03:00
Lior Halphon
c29b5b5800 Fixed the CRT shader for OpenGL frontends (SDL and older Macs) 2019-05-18 20:38:10 +03:00
Lior Halphon
e12e03d9c2 SGB revision selection in the SDL port 2019-05-18 20:37:41 +03:00
Lior Halphon
3e724afb0a Basic SGB support in the SDL port 2019-05-18 18:45:31 +03:00
ISSOtm
ec5d1b7b88 Fix sample lengths for CH1, 2 and 4 2019-05-18 03:01:20 +02:00
Lior Halphon
3ee2c64899 Make the apu command a bit safer 2019-05-17 22:03:23 +03:00
Lior Halphon
6648a0a84d Minor adjustments and style fixes to the new APU debug functions 2019-05-17 20:48:49 +03:00
Lior Halphon
8d9149b020 Merge pull request #178 from ISSOtm/master
Add APU-related debugger commands
2019-05-17 20:34:07 +03:00
Lior Halphon
280467ad38 Merge branch 'master' into master 2019-05-17 20:31:52 +03:00
Lior Halphon
0158803bde Merge pull request #176 from bentley/head-dd
Use dd instead of non-POSIX head(1) options to trim bootroms.
2019-05-17 20:29:32 +03:00
Lior Halphon
91eeb4d9d5 Emulate AGB audio mixing 2019-05-17 00:08:34 +03:00
ISSOtm
40f83c8f25 Add APU-related debugger commands
This change includes making one of the APU functions public
2019-05-15 12:45:51 +02:00
Anthony J. Bentley
07bdc60a49 Use dd instead of non-POSIX head(1) options to trim bootroms. 2019-05-11 21:38:32 -06:00
Lior Halphon
795823e372 Merge pull request #174 from funbars/lib1
fix libretro log interface
2019-05-11 00:17:26 +03:00
funbars
4a54985441 fix libretro log interface 2019-05-10 15:50:16 -05:00
Lior Halphon
ddc4e7484b Fix and restore optimization 2019-05-10 22:29:30 +03:00
Lior Halphon
32361589c9 Fix GCC build 2019-05-10 22:05:03 +03:00
Lior Halphon
06670fc970 Fix #172. Allow unroll optimizations when compiling with GCC. 2019-05-10 21:51:11 +03:00
Lior Halphon
1433c59778 Merge pull request #167 from rzumer/gbc_memory_map
Update libretro GBC memory map
2019-05-10 14:16:21 +03:00
Lior Halphon
aa0309e425 Merge pull request #171 from funbars/t1
libretro windows compiler (random) Fixes #111 #154
2019-05-10 14:15:49 +03:00
Lior Halphon
6ad8e30f88 Merge pull request #173 from orbea/build
Allow building with gcc.
2019-05-10 14:13:55 +03:00
orbea
2bded45397 Disable pragmas for gcc. 2019-05-09 10:55:31 -07:00
orbea
5ce8cf5016 Makefile: Allow setting CC. 2019-05-09 10:55:28 -07:00
funbars
b6e92dc8a7 libretro windows compiler (random) 2019-05-07 12:36:04 -05:00
Lior Halphon
10be34b5b2 Fix the fast CGB boot ROM booting with data on the second VRAM bank 2019-05-04 21:15:23 +03:00
Lior Halphon
2a0e5f667b Fix build on some Windows machines using non-Latin locales. Fixes #165 2019-05-04 15:35:17 +03:00
Lior Halphon
9e44306c04 Update .gitattributes 2019-04-19 14:49:09 +03:00
Raphaël Zumer
f8244c8119 Update libretro GBC memory map 2019-04-15 16:39:14 -04:00
Lior Halphon
82ce597573 Line breaks 2019-04-12 20:30:02 +03:00
Lior Halphon
05cd81b77c Implemented jump-to breakpoints 2019-04-12 20:29:43 +03:00
Lior Halphon
19f42d5a3a Merge pull request #159 from rzumer/master
Add static GBC RAM banks to libretro memory map
2019-04-12 17:37:18 +03:00
Raphaël Zumer
b3939e8fdc Add static GBC RAM banks to libretro memory map 2019-04-06 16:58:49 -04:00
Lior Halphon
a62541e577 Merge pull request #158 from trinemark/achievements
Fix libretro achievements
2019-04-06 13:05:22 +03:00
trinemark
d4e8a886c5 Fix libretro achievements
https://github.com/LIJI32/SameBoy/issues/48
https://github.com/LIJI32/SameBoy/issues/157
2019-04-05 22:35:52 -05:00
Lior Halphon
7242ddae64 speling is difikult 2019-03-16 20:56:22 +02:00
Lior Halphon
936afedb4b Merge commit '57b0fe7fed8e8218d7c890cd40dea4fa93f121a5' 2019-03-15 14:36:31 +02:00
Lior Halphon
c342663200 Emulate serial bit shifting, update the serial API to use bits instead of bytes, update printer emulation and libretro to use the new API 2019-03-15 14:36:10 +02:00
radius
57b0fe7fed fix input 2019-03-12 19:54:26 -05:00
Tim Allen
80cc16d62d Update to v106r107 release.
[This WIP was made after byuu's forum closed, so byuu only gave a one-line
description -Ed.]

byuu says:

This splits ColecoVision, SG-1000/SC-3000 away from Master System/Game Gear.
Was getting too crowded in there.
2019-02-27 23:03:24 +11:00
Lior Halphon
0b03b61564 Render the first line 0, as required for SGB emulation 2019-02-16 04:19:16 +02:00
Lior Halphon
9d0aadb83f Emulate missing Vreset signal (SGB only for now) and ICD2 desyncing 2019-02-15 17:04:48 +02:00
Lior Halphon
42ef41182d Merge branch 'master' of https://github.com/LIJI32/SameBoy 2019-02-15 14:12:39 +02:00
Lior Halphon
dde06e7cae Work around a crashing race condition, proper fix needed 2019-01-28 20:56:37 +02:00
Lior Halphon
5ead9d49f4 Merge pull request #139 from libretro/master
Ready to merge: SGB in the libretro core
2019-01-25 13:41:33 +02:00
Lior Halphon
b996ed9220 Writing to BGPD/OBPD while it’s blocked still increases BGPI/OBPI if needed. Fixes #145 2019-01-19 23:37:44 +02:00
Lior Halphon
73a54049d2 Accurate PPU access timings 2019-01-19 19:32:26 +02:00
radius
68a72037fa add 4p support too 2019-01-17 20:33:20 -05:00
radius
10547a6d74 hookup up 2 player SGB 2019-01-17 19:44:58 -05:00
Lior Halphon
4536581a6e Fixed a bug where modifying RTC data would corrupt cartridge RAM data. Fixes #136 2019-01-18 02:36:14 +02:00
radius
e2d9a353a0 remove single_dual mode, code cleanup 2019-01-14 23:11:42 -05:00
radius
c266e4045b try to hookup sgb2 2019-01-14 23:11:42 -05:00
radius
ca8426ea60 update libretro core 2019-01-14 23:11:42 -05:00
twinaphex
9fa6a2fe92 Add MSVC2017 target - doesn't work yet 2019-01-14 23:11:42 -05:00
Lior Halphon
312478e509 CGB palettes are not accessible during Mode 3, closes #84 2019-01-14 22:22:46 +02:00
Lior Halphon
879d3b607d Removed verified TODO 2019-01-14 20:32:52 +02:00
Lior Halphon
ba5c07bed9 Correctly emulate speed switch timing 2019-01-13 01:09:41 +02:00
Lior Halphon
c74b39e712 The CPU core of the Game Boy is (most likely) called SM83 2019-01-12 00:42:16 +02:00
Lior Halphon
21d2a59a5f Fixed a very rare edge case where an interrupt occurs when SP=FF11 2019-01-12 00:39:24 +02:00
Lior Halphon
4e2b5bb336 Fix the GB_run_frame API in SGB mode 2019-01-11 21:53:21 +02:00
Lior Halphon
c756861822 Merge pull request #138 from orbea/bootroms
Makefile: Fix typo.
2019-01-06 20:47:45 +02:00
Lior Halphon
9b22224bc4 Merge pull request #133 from aconbere/anders/add-faq
add FAQ file
2019-01-06 20:45:49 +02:00
Lior Halphon
653c7fc1e6 Update and rename FAQ.md to build-faq.md 2019-01-06 20:45:15 +02:00
orbea
de3718c718 Makefile: Fix typo.
Fixes:

make: *** No rule to make target 'build/bin/BootROMs/sgb_boot2.bin', needed by 'bootroms'.  Stop.
2019-01-05 17:54:14 -08:00
Lior Halphon
112a174f4a Proper window minimum size handling 2019-01-05 23:58:18 +02:00
Lior Halphon
7b36ee10a4 Merge branch 'master' into sgb 2019-01-05 19:00:22 +02:00
Lior Halphon
ae959cd878 ATTR_LIN and ATTR_DIV 2019-01-05 18:59:50 +02:00
Lior Halphon
4051f190a5 Cache cycles_per_sample to avoid FP arithmetic 2019-01-01 00:42:40 +02:00
Lior Halphon
9d947c7ce6 Unroll some APU loops 2018-12-31 23:09:56 +02:00
Lior Halphon
af0430dbc5 Unroll some loops in PPU code, more efficient timer handling 2018-12-31 22:06:20 +02:00
Lior Halphon
21eb96a2f5 Joypad multiplayer support (Cocoa) 2018-12-15 18:55:41 +02:00
Lior Halphon
7b02b3cb89 Fix automation 2018-12-15 18:01:30 +02:00
Lior Halphon
612cd07fb3 Fixed emulation of echo RAM 2018-12-12 23:44:00 +02:00
Lior Halphon
e8dfc18d11 Multiplayer SGB support in Cocoa (Keyboard only) 2018-12-05 00:00:16 +02:00
Lior Halphon
ea09dfc888 Fixed multiplayer SGB mode 2018-12-04 23:46:30 +02:00
Lior Halphon
241577a7f1 Merge branch 'master' into sgb 2018-12-02 00:15:07 +02:00
Lior Halphon
b852add773 Minor refinements to the icon 2018-12-01 22:43:35 +02:00
Lior Halphon
a1c39173dd SGB2 boot ROM 2018-12-01 17:28:57 +02:00
Lior Halphon
cbbe3fe207 Revision selection 2018-12-01 17:16:50 +02:00
Lior Halphon
51b7780d83 Redesign the preferences window 2018-12-01 17:16:29 +02:00
Lior Halphon
b1a2e45168 Improvements to the SGB animation 2018-12-01 13:39:43 +02:00
Lior Halphon
6d28e74667 Color 0 must always be shared 2018-11-24 15:53:53 +02:00
Lior Halphon
4b93f89763 Correct emulation of color masks 2018-11-24 15:42:54 +02:00
Lior Halphon
389d8ae045 Halt the CPU while the SGB animation is playing 2018-11-24 13:34:07 +02:00
Lior Halphon
2d6d1e6325 SGB boot animation 2018-11-24 13:21:00 +02:00
Lior Halphon
b3166135eb Clean up that crashing mess I made 2018-11-23 19:59:15 +02:00
Lior Halphon
558f9b9bae Updated SGB border, add “2” to SGB2 2018-11-23 14:16:48 +02:00
Lior Halphon
3ba1364d60 Fixed a boot ROM bug that made a few Nintendo games use incorrect object palettes 2018-11-23 01:09:14 +02:00
Lior Halphon
aaafd482cc Fixed Cocoa OpenGL regression, it was completely broken 2018-11-22 22:59:29 +02:00
Anders Conbere
a7d4c091a0 add FAQ file 2018-11-20 10:04:12 -08:00
Lior Halphon
6160f513aa CRT filter 2018-11-19 18:52:11 +02:00
Lior Halphon
67d52b78b6 Handling interrupted SGB commands 2018-11-17 12:26:07 +02:00
Lior Halphon
af5ef50cf9 Fixing default border 2018-11-17 01:39:38 +02:00
Lior Halphon
deb5e21842 More colorization commands 2018-11-17 00:44:18 +02:00
Lior Halphon
b698ce5d95 Correctly emulate SGB border color 0 2018-11-17 00:44:07 +02:00
Lior Halphon
e5e7ce8203 Basic colorization 2018-11-16 22:05:35 +02:00
Lior Halphon
d42cbcdee2 Palette transfer functions 2018-11-16 19:11:21 +02:00
Lior Halphon
91a3091b2e Build fix 2018-11-16 17:41:23 +02:00
Lior Halphon
2710939e1e That should be an inc file 2018-11-16 17:38:53 +02:00
Lior Halphon
595907cae2 Border fade animation 2018-11-16 17:36:21 +02:00
Lior Halphon
69ac36cca1 Add default SGB border 2018-11-16 17:22:57 +02:00
Lior Halphon
398148f7ea Basic SGB border support 2018-11-16 16:04:40 +02:00
Lior Halphon
382d9f8898 MASK_EN support 2018-11-16 12:42:52 +02:00
Lior Halphon
2f2b792edf SGB save states 2018-11-16 01:53:01 +02:00
Lior Halphon
634a54c046 SGB resolution support (Cocoa only so far) 2018-11-15 00:21:21 +02:00
Lior Halphon
6ba5cfbeef Support for multi-packet SGB commands 2018-11-13 23:45:26 +02:00
Lior Halphon
7735d638c6 Multiplayer SGB APIs/SGB detection 2018-11-12 00:37:06 +02:00
Lior Halphon
5c581651ce Handle the SGB header commands, disable SGB functions if needed. 2018-11-11 22:50:00 +02:00
Lior Halphon
44891d5c4a Initial code to support SGB, command “parsing”, replacement SGB boot ROM 2018-11-11 01:16:32 +02:00
Lior Halphon
a47e3cc62c Remove code duplication in the QL fast boot ROM, should fix some glitched thumbnails 2018-11-10 21:10:09 +02:00
Lior Halphon
7ffed9c43c Reconnect the joypad when SameBoy starts directly to a ROM (fixes #131) 2018-11-10 19:39:57 +02:00
Lior Halphon
94136f5741 Adjust DAC attributes to fix LADX’s crackling audio (Fixes #125) while keeping Cannon Fodder’s buzzing reasonable (Proper audio measurements still required) 2018-11-10 19:14:18 +02:00
Lior Halphon
453673a2a6 Apply the SDL 2.0.6 audio workaround to everything except Windows, check the linked version instead of the headers version. Fixes #130 2018-11-10 18:58:42 +02:00
Lior Halphon
969fb5a9d8 Merge branches 'master' and 'master' of https://github.com/LIJI32/SameBoy 2018-11-10 16:33:04 +02:00
Lior Halphon
bc48c9bc26 Added command line fullscreen flag to the SDL port, closes #126 2018-11-10 16:32:45 +02:00
Lior Halphon
06ff367fdb Merge pull request #127 from libretro/master
don't reinit on audio filter change or color correction
2018-11-10 16:18:55 +02:00
Lior Halphon
81582574c1 Merge pull request #129 from NieDzejkob/configurable-paths
Add a build-time option to change the resources directory.
2018-11-10 00:25:22 +02:00
NieDzejkob
91904df5e8 Add a build-time option to change the resources directory.
Normally, SameBoy would use executable-relative paths for any
resource files, which posed problems for packaging the software
by distributions, which usually prefer FHS-compliant file locations.

This commit makes it possible to specify an alternative base
directory with a compile-time environment variable.
2018-11-09 23:20:57 +01:00
Lior Halphon
bbffb49b8f Merge pull request #128 from NieDzejkob/fix-linux-tester
Fix building the tester binary on Linux
2018-11-09 23:20:36 +02:00
NieDzejkob
d05ee826d4 Fix building the tester binary on Linux 2018-11-09 22:20:35 +01:00
radius
792b45d5dd don't reinit on audio filter change or color correction 2018-11-05 18:59:44 -05:00
Lior Halphon
a39b314378 Fixed silly APU regression (Noise volume envelope ran too fast) Fixes #121 2018-11-03 14:37:19 +02:00
Lior Halphon
96e9ea2d1e Fix libretro RTC support. Fixes #41 2018-11-03 13:18:08 +02:00
Lior Halphon
c9d6a1381f Cross emulator compatibility with RTC saves 2018-11-03 01:31:14 +02:00
Lior Halphon
64922fff4b Fixed a bug where channels 1 and 2 would start playing earlier than they should have if NRx4 was written to twice. Fixes #86. 2018-10-29 00:44:43 +02:00
Lior Halphon
9ffeef88d5 Trying to fix libretro achievements (#48) 2018-10-27 17:19:53 +03:00
Lior Halphon
3035f43428 Emulation of DAC charging, Fixes #46, #85, #88 and #89 2018-10-19 23:53:01 +03:00
Lior Halphon
4276549acd Research notes TODOs 2018-10-19 01:02:27 +03:00
Lior Halphon
324201f336 Correct emulation of switching the DACs on and off. Fixes #100 and #87 2018-10-17 20:35:29 +03:00
Lior Halphon
839de39c1f Fix clang build 2018-10-14 14:57:09 +03:00
Lior Halphon
0f19db5e8e Merge pull request #120 from RobLoach/ignore-warnings
Ignore multichar and int-in-bool-context warnings
2018-10-14 00:25:44 +03:00
Rob Loach
7a6d6c3850 Ignore multichar and int-in-bool-context warnings 2018-10-13 17:19:05 -04:00
Lior Halphon
63fd5b4c10 Merge pull request #113 from RobLoach/patch-1
Use clang only if available
2018-10-13 14:16:51 +03:00
Rob Loach
86005bcfb8 Update Makefile to use clang if it's available 2018-10-12 20:14:34 -04:00
Lior Halphon
e9b78b6370 Merge pull request #114 from RobLoach/patch-2
Fix control reaches end of non-void function
2018-10-12 17:10:11 +03:00
Rob Loach
2da7a3f7fb Fix the return value of read_lvalue to be 0 2018-10-12 10:09:30 -04:00
Rob Loach
e834d32b8e Update switch to just return at the end instead 2018-10-12 09:41:25 -04:00
Lior Halphon
f8609e0279 Merge pull request #117 from RobLoach/patch-5
Fix parentheses around ‘+’ in operand of ‘&’
2018-10-12 13:12:13 +03:00
Rob Loach
ec41e87cf1 Update logic behind params 2018-10-11 22:39:43 -04:00
Rob Loach
b8825127fd Fix parentheses around ‘+’ in operand of ‘&’
```
Core/z80_cpu.c: In function ‘add_hl_rr’:
Core/z80_cpu.c:341:31: error: suggest parentheses around ‘+’ in operand of ‘&’ [-Werror=parentheses]
     if ( ((unsigned long) hl) + ((unsigned long) rr) & 0x10000) {
          ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
```
2018-10-11 22:37:26 -04:00
Rob Loach
f4ee044347 Fix control reaches end of non-void function
This change makes it so that there is a return value when a kind doens't match. Allows -Werror=return-type to pass.

```
Core/debugger.c: In function ‘read_lvalue’:
Core/debugger.c:239:1: error: control reaches end of non-void function [-Werror=return-type]
 }
```
2018-10-11 22:17:16 -04:00
Rob Loach
7854686903 Remove redefinition of CC
Redefining CC isn't a standard thing to do in Makefiles. See more information about this over at:
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
2018-10-11 21:54:04 -04:00
Lior Halphon
9080a23913 Improved idle performance in the Cocoa port when using Metal 2018-10-11 18:43:31 +03:00
Lior Halphon
1b049b8f75 Fixing UI bugs in the Cocoa debugger. Console windows now display the ROM file name 2018-09-15 17:57:59 +03:00
Lior Halphon
11c148c851 Starting G/HDMA directly takes one more M-cycle (More research required) 2018-09-15 00:48:31 +03:00
Lior Halphon
dbc338a887 Compensate for prefetch in DIV’s initial value 2018-09-15 00:47:26 +03:00
Lior Halphon
629550c30b Update .gitattributes 2018-09-10 19:02:45 +03:00
Lior Halphon
ec0a879a93 Correct emulation of enabling and disabling the volume envelope. Correct emulation of a glitch where the volume envelope ticks when it usually wouldn’t. 2018-09-10 16:59:59 +03:00
Lior Halphon
3151821e6d Fixed minor APU regression (Channels 1 and 2 were given no delay under certain circumstances) 2018-09-09 12:50:55 +03:00
Lior Halphon
57cc4809ba Merge pull request #108 from AlvaroBurnett/master
Improve compatibility with the Unix tools included in Git for Windows.
2018-08-19 23:20:44 +03:00
Alvaro Burnett
83ab8efbd7 Improve compatibility with the Unix tools included in Git for Windows.
Previously the Makefile, when run on Windows, expected the uname command to report either "MINGW" or "windows32". This was unfortunate because the uname included in Git for Windows reports "MSYS".

With this change, the Makefile will work properly with any uname, whether it comes from MinGW, GnuWin32 or Git for Windows.
2018-08-19 22:07:16 +02:00
Lior Halphon
737c1e2a4f Merge pull request #99 from max-m/daa-patch
Rewrite the DAA instruction
2018-07-22 20:07:30 +03:00
Maximilian Mader
a36dd791ec Rewrite the DAA instruction 2018-07-22 18:37:34 +02:00
Lior Halphon
f7b882f0e8 Whoops 2018-07-22 02:10:26 +03:00
Lior Halphon
b7426f93c0 Randomize object palettes. Slightly more accurate emulation of FF4C. 2018-07-20 23:23:47 +03:00
Lior Halphon
538038e49c Disable randomness in the automation for consistency 2018-07-20 12:35:15 +03:00
Lior Halphon
ce80acc818 Fixed HDMA timing )But still not verified) 2018-07-20 12:34:52 +03:00
Lior Halphon
b1cc55b786 Turns out Left/Right audio channels were flipped 2018-07-19 20:38:11 +03:00
Lior Halphon
c66b6fbafc Fixed an edge case with DAC discharge emulation 2018-07-16 23:08:25 +03:00
Lior Halphon
2e9e3424ec Document some revision differences 2018-07-14 21:52:54 +03:00
Lior Halphon
0145b790a3 Merge branch 'v0.11.x' 2018-07-11 20:08:33 +03:00
Lior Halphon
0783f131b8 Update version to v0.11.1 2018-07-11 20:07:54 +03:00
Lior Halphon
e5f4495ca0 Turns out the last Cocoa fix was neither reliable or actually working. 2018-07-11 19:48:54 +03:00
Lior Halphon
5f58323c01 Attempt to improve audio quality on frontend with big audio buffers 2018-07-10 21:33:03 +03:00
Lior Halphon
dc4c23c0da Worked around a macOS bug where fullscreen-mode SameBoy would render garbage on High Sierra. Fixed titlebar color when using the ugly Yosemite theme. 2018-07-10 20:35:07 +03:00
Lior Halphon
afcb7b8579 Fixed a regression where DMG mode on CGB would not activate on most DMG games. Fixes #98 2018-07-10 20:28:36 +03:00
Lior Halphon
dc5cb71c22 Emulate CGB-C’s quirky LFSR function 2018-07-04 21:55:12 +03:00
Lior Halphon
f3437d7cc0 Added todo 2018-07-03 23:47:50 +03:00
Lior Halphon
b7b35c9b59 CGB-C timing 2018-07-03 22:25:09 +03:00
Lior Halphon
0a78f735d3 Fetcher Y is not cached on CGB-C 2018-07-03 22:14:53 +03:00
Lior Halphon
18ae18a95c LYC bit on CGB-C 2018-07-03 21:56:32 +03:00
Lior Halphon
a7aabca618 Starting to add CGB-C support 2018-07-03 21:43:46 +03:00
Lior Halphon
47a74cb6c3 Randomize initial RAM values. Closes #82 2018-06-30 16:53:28 +03:00
Lior Halphon
d9dfbcd199 Updated version to 0.11, updated README 2018-06-29 13:51:01 +03:00
Lior Halphon
81662e954b Convert the Windows .rc file to UTF-16 (Seems like UTF-8 support is broken in rc) 2018-06-29 13:17:27 +03:00
Lior Halphon
045c863117 Fixed Windows build 2018-06-29 13:05:08 +03:00
Lior Halphon
32443a9675 Improved analog stick controls in both ports. Affects #34? 2018-06-26 19:36:14 +03:00
Lior Halphon
3a4ed6fd40 Made SDL menus more consistent between keyboards and joypads (Closes #35) 2018-06-23 22:36:29 +03:00
Lior Halphon
82436ad838 Added proper joypad configuration in SDL (Closes #33), can now use Rewind/Slow-Motion from the joypad. 2018-06-23 22:27:05 +03:00
Lior Halphon
74abf61a08 Fixed a crash that happened when changing the rewind length in Cocoa 2018-06-23 11:50:08 +03:00
Lior Halphon
1915365b1a Added rewind and underclocking support to the SDL port. Joystick controls to be done. 2018-06-23 00:10:28 +03:00
Lior Halphon
2791775c5d Improvements to the lcd debugger command 2018-06-22 18:38:54 +03:00
Lior Halphon
6b2c25475f Removed limitations around debugger output in the Cocoa frontend 2018-06-21 21:23:57 +03:00
Lior Halphon
0ffb936885 The Cocoa port now allows selecting a folder containing boot ROM files 2018-06-21 00:48:02 +03:00
Lior Halphon
30f13bd28c More accurate CGB initial register values. Closes #80 2018-06-19 23:59:16 +03:00
Lior Halphon
6a7c084177 Fixed window regression 2018-06-18 21:57:01 +03:00
Lior Halphon
70d68a500e Stop annoying exceptions in the preferences window 2018-06-17 23:24:02 +03:00
Lior Halphon
a4bfb026a8 Fixed rounded corners in Metal 2018-06-17 23:16:34 +03:00
Lior Halphon
a37a0b1b00 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2018-06-16 23:52:39 +03:00
Lior Halphon
d81c23cb16 Fixed HDMA regression 2018-06-16 23:52:24 +03:00
Lior Halphon
59c1468e5a Merge pull request #78 from fr500/master
libretro: allow changing model at runtime again, also do not reset bo…
2018-06-16 20:39:38 +03:00
radius
d6879c4f8a libretro: allow changing model at runtime again, also do not reset both gameboys on model change in dual mode 2018-06-16 11:06:00 -05:00
Lior Halphon
ca9249d4db Prevent memory viewer errors on reset 2018-06-16 14:46:16 +03:00
Lior Halphon
bc876ec30c Whoops 2018-06-16 14:36:06 +03:00
Lior Halphon
45c73e0175 Replaced the is_cgb bool with a more future compatible model enum. Removed the GB_init_cgb API and replaced it with an extended GB_init and GB_switch_model_and_reset APIs that now receive a model parameter. Increased the struct version. 2018-06-16 13:59:33 +03:00
Lior Halphon
c286203640 Fixed potential black screen on Metal 2018-06-16 12:46:57 +03:00
Lior Halphon
968ff4879a Enable fast math 2018-06-16 00:08:24 +03:00
Lior Halphon
1c1cddb53e OpenGL fallback 2018-06-15 20:03:59 +03:00
Lior Halphon
a068b7b09f Fixed Metal warnings, made everything static for performance 2018-06-15 19:18:30 +03:00
Lior Halphon
cd045fde15 Scaling filters in Metal 2018-06-15 19:11:06 +03:00
Lior Halphon
4466a55de6 Output resolution parameter 2018-06-15 18:44:22 +03:00
Lior Halphon
da7c32cb10 No more globals in shaders 2018-06-15 18:22:09 +03:00
Lior Halphon
c6dba26d02 Simplify shaders 2018-06-15 18:08:54 +03:00
Lior Halphon
c1fcd1a0c0 Added frame blending 2018-06-15 13:58:50 +03:00
Lior Halphon
5b39cacc8a Basic Metal support. No OpenGL fallback, no shaders, no blending. 2018-06-15 13:26:53 +03:00
Lior Halphon
9a3d53ae51 Remove OpenGL specific code from GBView 2018-06-11 22:11:33 +03:00
Lior Halphon
d95ad1ca54 SWAP was incorrectly disassembled as RLC 2018-06-09 15:39:40 +03:00
Lior Halphon
38c0cb3323 Typo 2018-06-09 15:12:42 +03:00
Lior Halphon
f64da1864f APU glitch: When turning the APU on while DIV's bit 4 (or 5 in double speed mode), the first DIV/APU event is skipped. 2018-06-09 15:11:20 +03:00
Lior Halphon
593cb7c107 Pixel accurate emulation of Prehistorik Man on a CGB-CPU-E 2018-06-08 18:44:03 +03:00
Lior Halphon
ca01ff6f79 Finally, perfect emulation of the STAT write bug. 2018-06-08 17:16:15 +03:00
Lior Halphon
127324d2d6 Fixed regression involving rendering a window with negative X position. Closes #75 2018-06-07 23:08:46 +03:00
Lior Halphon
f1dfa2a1bc More sensible implementation of the STAT interrupt. 2018-06-04 02:07:38 +03:00
Lior Halphon
8f892ab798 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2018-06-04 01:52:34 +03:00
Lior Halphon
0481ff9af5 Whoops 2018-06-04 01:52:24 +03:00
Lior Halphon
66ab22a5e9 Merge pull request #76 from Nadia-h/master
SDL: Add controller hat support in-game and in the GUI.
2018-06-03 17:41:28 +03:00
Nadia Pedersen
6f1070cccd SDL: Add controller hat support in-game and in the GUI. 2018-06-03 00:21:43 +02:00
Lior Halphon
8721a48206 Fixed incorrect double speed behavior. 2018-06-03 00:36:05 +03:00
Lior Halphon
7003e31b7e Fixed a regression with STAT blocking. 2018-06-02 04:00:10 +03:00
Lior Halphon
80c92daacd Include cleanup (#73) 2018-05-27 19:30:23 +03:00
Lior Halphon
6532aef089 Correct emulation of the DMG stat write bug 2018-05-26 18:06:40 +03:00
Lior Halphon
9693b2de6a Refined the STAT bug behavior. Still not perfect. 2018-05-26 17:06:49 +03:00
Lior Halphon
855ffb490a A HBlank interrupt cannot occur in the last M-cycle of HBlank. Correct emulation of STAT access conflicts on the CGB (Test: CPU-E, single speed only). Fixes a minor graphical glitch in Pokémon Puzzle Challenge. 2018-05-25 23:42:36 +03:00
Lior Halphon
249acb04cc Verified some timings on a DMG. Fixed palette write conflict timing (Although the fix kind of implies time traveling). Closes #65 2018-05-16 00:59:11 +03:00
Lior Halphon
562b43a7c5 Notes about the DMG wave-ram glitch 2018-05-15 23:02:07 +03:00
Lior Halphon
7df571d42f Less strict matching for delete and unwatch. Fixes #71 2018-05-13 23:17:23 +03:00
Lior Halphon
1fcde88d8a Improved accuracy of the halt bug 2018-05-12 22:13:52 +03:00
Lior Halphon
4527d9ee39 Styling fixes, fixed bugs caused by a rebellious brace, removed debug prints 2018-05-11 13:29:58 +03:00
Lior Halphon
9a29beb189 Merge commit '8f3fc1c2ade3c1c632cd3f3998ee26d2962e4dea'
# Conflicts:
#	SDL/main.c
2018-05-11 13:26:30 +03:00
Lior Halphon
6b6c25635a Merge commit '240730417774174315c2f7c148393834eb3297eb' 2018-05-11 13:11:53 +03:00
Lior Halphon
bfc96abf8f Make save state names consistent across the Cocoa and SDL port 2018-05-11 12:51:15 +03:00
Lior Halphon
feaa0d0654 Merge commit '7fe86cec59c1143275ffb7fc07b6716ae0116033' 2018-05-11 12:50:53 +03:00
Lior Halphon
f4eddf316b Merge commit '9343d8162d5e6934d7894d9eea57c55f52faa503' 2018-05-11 12:46:23 +03:00
Lior Halphon
713dc02e46 A bit tacky, but T-cycle accurate emulation of LYC write conflicts on the CGB. Only single speed mode verified. Closes #54 2018-05-11 12:38:55 +03:00
Lior Halphon
af3554c1d1 More accurate emulation of the LYC register and interrupt. (Still not perfect on a CGB) 2018-04-27 13:40:39 +03:00
Lior Halphon
0f8385a798 Refined line 153 behavior on a CGB. Verified on CGB-E. 2018-04-25 00:08:06 +03:00
Lothar Serra Mari
8f3fc1c2ad Fix check for SDL2 version 2018-04-22 16:20:11 +02:00
Lothar Serra Mari
ca571c6fa5 SDL2: Update to SDL_OpenAudioDevice()
Instead of the legacy SDL_OpenAudio() method, we now use the newer
SDL_OpenAudioDevice() functions. This fixes audio in Windows if the SDL
version is 2.0.6 or higher.

It also allows us to use 48kHz audio for Windows (96kHz somewhat works
too, but since we don't get absolutely smooth audio with it, I'd stick
with 48kHz for now until we find a solution. 44.1Khz is available as
fallback for SDL 2.0.5 and lower. Yes, the 2.0.5 to 2.0.6 transition was
quite harsh in terms of Windows audio support...
2018-04-22 15:22:10 +02:00
Lothar Serra Mari
2407304177 SDL2: Write battery file information before issueing RESET_COMMAND
Before performing the GB reset, we should perform a GB_save_battery.

Otherwise, resetting the emulation will kill ("kill" as in simply don't
write them into the .sav) all changes made to the battery save since
sameboy was started.
2018-04-19 16:47:54 +02:00
Lothar Serra Mari
7fe86cec59 Fix savestates in SDL2 port
Because SDL_SCANCODE_0 comes *after* SDL_SCANCODE_9 in the SDL keycode
table, we have to check if the keycode is between >=1 and <=0. We also
have to substract SDL_SCANCODE_1 in order to set command_parameter
properly.

Errata: Currently, the savestate created with CTRL+0 is created, but
refuses to load on Windows (working fine on Linux).
2018-04-19 14:52:36 +02:00
Lothar Serra Mari
9343d8162d Add fullscreen mode for the SDL2 port 2018-04-18 19:22:08 +02:00
Lior Halphon
be9df4d658 Added mechanism to handle MMIO read/write conflicts. Fixes #65 2018-04-14 17:57:00 +03:00
Lior Halphon
2c6f7906c5 Make multi-byte opcodes trigger the OAM bug when they increase PC 2018-04-14 15:32:55 +03:00
Lior Halphon
84aa06aba5 Clean up OAM bug code 2018-04-14 13:35:16 +03:00
Lior Halphon
d667d87bbe Refactor CPU code so handling access conflicts is possible 2018-04-14 13:25:55 +03:00
Lior Halphon
f1ec42d4ba H/GDMA was 4 times faster than it should have been. Made it also more accurate. Fixes #56 2018-04-13 14:41:39 +03:00
Lior Halphon
51e3cb7b9f Merge pull request #64 from orbea/debugger
Core: Fix libretro builds
2018-04-12 00:25:38 +03:00
orbea
10dc12c502 Core: Fix libretro builds 2018-04-11 14:21:46 -07:00
Lior Halphon
417ae21dfa Merge pull request #63 from libretro/master
Refactor android jni makefiles (#17)
2018-04-11 11:02:03 +03:00
webgeek1234
ebe0aa0c76 Refactor android jni makefiles (#17) 2018-04-10 21:42:04 -05:00
Lior Halphon
89094950f8 Correct emulation of mapping both button sets. Fixes #60 2018-04-07 16:45:31 +03:00
Lior Halphon
5be2b3db29 It appears that OAM DMA blocks PPU access to OAM 2018-04-07 13:59:36 +03:00
Lior Halphon
0725b008be Further simplifications 2018-04-07 13:02:53 +03:00
Lior Halphon
097b768127 Update comments 2018-04-07 03:36:47 +03:00
Lior Halphon
9ce028056a Cleanup 2018-04-07 03:26:10 +03:00
Lior Halphon
fed2556fc3 More reasonable implementation of sprite timings 2018-04-07 03:00:26 +03:00
Lior Halphon
0751eae90b Moved the fetcher state machine to another function 2018-04-06 19:29:49 +03:00
Lior Halphon
0461fb5b2a Simplified FIFO logic 2018-04-06 19:11:48 +03:00
Lior Halphon
cb01259073 Fixed #61 2018-04-06 11:37:49 +03:00
Lior Halphon
0c86ff1ee4 More CGB revision quirks 2018-04-06 04:00:37 +03:00
Lior Halphon
a6ed2029b7 New information about PPU changes between CGB-B and CGB-E 2018-04-06 03:19:47 +03:00
Lior Halphon
cc95c89d3c Surprise! The CGB has a 16-bit VRAM data bus 2018-04-05 16:15:51 +03:00
Lior Halphon
9aadc80f75 Implemented some obscure PPU rendering quirks, verified some timings 2018-04-05 15:33:21 +03:00
Lior Halphon
d785e45308 More accurate emulation of LCDC.0 2018-04-05 12:27:01 +03:00
Lior Halphon
d8e0683c35 Fixed a bug where skipping a sprite by modifying LCDC flags mid-scanline will disable sprites for the rest of the scalene. 2018-04-05 00:51:37 +03:00
Lior Halphon
b1d65fd84f Fixed boot_hwio-C (for SameBoy’s boot). Closes #59 2018-04-03 20:10:11 +03:00
Lior Halphon
5d63892949 T-cycle accurate timing of the extra OAM interrupt. Fixes vblank_stat_intr-GS, related to #54 2018-04-03 01:43:24 +03:00
Lior Halphon
ba07e7ba85 Fixed a bug where 0:$dxxx reads/writes from the wrong bank in CGB mode. Made sure symbols are reset after reloading a sym file. 2018-04-02 19:57:39 +03:00
Lior Halphon
e163026ca9 The STAT bug does not occur during the glitched mode 0 2018-04-02 01:05:32 +03:00
Lior Halphon
9339a6027f Slight refinement to the last fix 2018-04-01 22:20:26 +03:00
Lior Halphon
ec64c041ab The OAM interrupt is internally implemented differently from the other 3. Fixed the stat_write_if tests, relates to #54 2018-04-01 21:45:56 +03:00
Lior Halphon
69a625af97 How did I miss this thing after over 2 years?! 2018-04-01 16:53:21 +03:00
Lior Halphon
0d0d9ccdae Fixed a timer regression, fixes timer_if in DMG mode. Relates to #54 2018-03-31 15:52:31 +03:00
Lior Halphon
73dc3560a5 Mode 0 interrupts do not occur in the glitched mode 0 of the first line 0. The extra OAM interrupt bug also affects DMG. 2018-03-31 13:18:02 +03:00
Lior Halphon
0a2d6e6dcb Fixed DMG timing regression 2018-03-31 12:21:34 +03:00
Lior Halphon
7706b8727a Updated Cocoa copyright 2018-03-30 17:06:39 +03:00
Lior Halphon
9811dceca1 Emulate another OAM timing quirk; a sprite at x = 0 has extra penalty if SCX is not 0. Fixes intr_2_mode0_timing_sprites_scx*_nops, affects #54 2018-03-30 17:06:27 +03:00
Lior Halphon
2c44ffbe39 More accurate fetcher penalty emulation, fixed intr_2_mode0_timing_sprites_nops, affects #54 2018-03-30 02:53:49 +03:00
Lior Halphon
311a470806 Maybe now? Affects #55 2018-03-29 23:11:53 +03:00
Lior Halphon
3a52d2da97 Updated Windows copyright 2018-03-29 22:22:50 +03:00
Lior Halphon
5a81d83d30 Yet another attempt to fix building using MINGW. Affects #55 2018-03-29 22:02:01 +03:00
Lior Halphon
b757b4c590 Another attempt to fix building using MINGW. Affects #55 2018-03-29 21:46:14 +03:00
Lior Halphon
c7ca786e77 Attempt to fix building using MINGW. Affects #55 2018-03-29 21:27:19 +03:00
Lior Halphon
a9fbbd3894 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2018-03-29 21:07:04 +03:00
Lior Halphon
e380a00b67 Fixed another timing regression with the CB opcodes 2018-03-29 21:06:53 +03:00
Lior Halphon
b89c93a624 Merge pull request #53 from kylophone/fix_typo
Fix typo, file permissons
2018-03-29 10:56:54 +03:00
Kyle Swanson
7ffe132e79 fix typo 2018-03-28 21:38:48 -07:00
Kyle Swanson
7bfe5de9c7 chmod -x 2018-03-28 21:37:34 -07:00
Lior Halphon
96063fb0da Fixed Windows build, added Unicode support in Windows. 2018-03-28 21:59:27 +03:00
Lior Halphon
4cf78139a8 Fixed a bug where SameBoy freezes for a while after leaving turbo mode 2018-03-27 23:33:31 +03:00
Lior Halphon
fd2e169dc9 Seems like the audio bug introduced in SDL 2.0.5 for macOS wasn’t fixed. 2018-03-27 23:05:08 +03:00
Lior Halphon
0e3d2770d9 Properly handle cases where an object’s X position is modified between the OAM mode and rendering mode 2018-03-27 22:13:08 +03:00
Lior Halphon
0912a30bb9 Fixed a regression in dmg_sound-2 2018-03-27 21:04:55 +03:00
Lior Halphon
f5493e023d Fixed a timing regression in the CB opcodes 2018-03-27 20:21:24 +03:00
Lior Halphon
7671648fca Simplified a function 2018-03-27 19:06:36 +03:00
Lior Halphon
7543461c24 Increasing PC in OAM triggers the OAM bug 2018-03-27 16:36:39 +03:00
Lior Halphon
4cbade9a88 Function name change 2018-03-27 15:55:12 +03:00
Lior Halphon
4986930511 Mostly complete emulation of the OAM bug. Passes oam_bug-2. 2018-03-27 15:46:00 +03:00
Lior Halphon
9093f22293 More accurate emulation of the OAM bug 2018-03-24 14:46:51 +03:00
Lior Halphon
5cb74fb684 Bugfix: turning the PPU off during OAM mode made the OAM bug persist while the LCD is off 2018-03-24 02:58:37 +03:00
Lior Halphon
d343152fca Basic emulation of the OAM bug 2018-03-24 00:32:19 +03:00
Lior Halphon
f8c6b9e7a0 Fixed the lcd command 2018-03-23 21:26:49 +03:00
Lior Halphon
4e3928df81 Turns out the behavior differs between DMG and CGB – in DMG mode, the objects enabled bit is checked before halting the FIFOs, meaning that disabled sprites do not affect Mode 3’s length on the DMG. 2018-03-23 20:01:27 +03:00
Lior Halphon
48a8db233d Refinement to the last fix 2018-03-23 19:54:11 +03:00
Lior Halphon
e9eeace995 The object enabled bit is checked only when popping from the object FIFO. Objects affect timing even when disabled. 2018-03-23 19:50:19 +03:00
Lior Halphon
04bfc89816 Cycle accurate OAM search mode 2018-03-23 19:07:14 +03:00
Lior Halphon
c11af7ea26 Fix CGB timings 2018-03-23 12:58:51 +03:00
Lior Halphon
3e5e17d1a3 Fixed CB [hl] opcodes timings 2018-03-23 12:35:37 +03:00
Lior Halphon
18e32d1755 Merge branch 'master' into timing
# Conflicts:
#	Core/gb.c
2018-03-22 22:37:35 +02:00
Lior Halphon
2a5407cf70 Fix libretro build on master 2018-03-22 20:22:09 +02:00
Lior Halphon
577e23925b Fixed sources-dmgABCXmgbS 2018-03-22 20:09:01 +02:00
Lior Halphon
6176befecb Merge pull request #50 from libretro/master
Sync libretro port
2018-03-22 14:47:19 +02:00
radius
f050457976 fix error in savestate code 2018-03-22 00:20:51 -05:00
radius
337617afbb change sameboy emulated model selection to apply on restart (because otherwise it may crash due the change on savestate size with rewind enabled) 2018-03-22 00:00:03 -05:00
Lior Halphon
e9f243a913 Fix sprite priority 2018-03-21 00:02:35 +02:00
Lior Halphon
cb33a5b25a Fix Aevilla 2018-03-20 20:08:29 +02:00
radius
007765daa6 refine variables, add comments 2018-03-19 18:25:20 -05:00
radius
b1ea7c5f06 handle saving for GB2 in single cart mode 2018-03-19 18:25:20 -05:00
radius
3b5b400909 implement RTC saves in dual mode, capitalization nitpicking in core opts 2018-03-19 18:25:20 -05:00
Lior Halphon
3883b7d86a Merge branch 'master' into timing
# Conflicts:
#	Core/display.c
#	Core/z80_cpu.c
2018-03-19 23:46:33 +02:00
Lior Halphon
b50c97f4a7 Prevent starting HDMA in the middle of an instruction, making both the CPU and DMA access memory at the same time. Closes #47 2018-03-19 20:01:31 +02:00
Lior Halphon
202eb2b5cc Fix stat_lyc_onoff 2018-03-18 20:32:19 +02:00
Lior Halphon
80b1275e07 Fix stat_lyc_onoff 2018-03-18 20:08:45 +02:00
Lior Halphon
0dc30f081a CGB halt interrupt timing 2018-03-17 23:21:14 +02:00
Lior Halphon
12ae5745db While fixing some rendering issues, this change was incorrect. 2018-03-17 21:04:48 +02:00
Lior Halphon
269bac4626 More CGB fixes 2018-03-17 20:34:55 +02:00
Lior Halphon
2f1e21dc2d Merge branch 'master' into timing 2018-03-16 12:18:18 +02:00
Lior Halphon
8b4714d8e2 Merge pull request #45 from LMLB/patch-1
Fix some broken shaders
2018-03-16 12:14:32 +02:00
LMLB
c365c450a7 Fix shaders that break with specific pixel factors
OmniScaleLegacy seems to has problems with every odd factor (3x, 5x, 7x,
9x, etc.).
SmoothBilinear has problems with 5x and 11x and probably more.
2018-03-14 20:06:37 +01:00
LMLB
0c80ac3296 Fix shaders that sample at texel edges
Sampling at the edge between texels causes one or the other to be chosen
semi-randomly, depending on rounding errors. Add half a pixel so they
sample at texel centers instead.
2018-03-14 20:05:51 +01:00
Lior Halphon
029c685268 Merge pull request #43 from AlvaroBurnett/master
Makefile: Find SDL2.dll
2018-03-12 23:56:13 +02:00
Alvaro Burnett
05ba352f2f Makefile: Find SDL2.dll 2018-03-12 22:38:05 +01:00
Lior Halphon
21b75494a2 More CGB fixes (currently on DMG-mode CGB is verified). Halt interrupt timing isn’t correct yet. 2018-03-11 00:17:57 +02:00
Lior Halphon
15b6c48d7c Fixed vblank_stat_intr-C 2018-03-10 15:52:22 +02:00
Lior Halphon
c267ad00b5 Goodbye 2018-03-09 23:34:23 +02:00
Lior Halphon
e8b107efdb In double speed mode, there are no quirks where IF and STAT don’t update together 2018-03-09 23:31:49 +02:00
Lior Halphon
cb6bb0590e Starting to fix CGB timing quirks 2018-03-09 21:11:35 +02:00
Lior Halphon
9083e883fe CGB BG rendering 2018-03-09 18:52:36 +02:00
Lior Halphon
a32f232bb1 Fixed OAM-window priority glitch, fixed OAM glitch in Prehistoric Man 2018-03-09 17:10:19 +02:00
Lior Halphon
1149c266cf More regression fixes, actually fix Pinball Deluxe this time 2018-03-08 23:22:03 +02:00
Lior Halphon
544ca2be4c Changing the timings of memory writes so they’re not effectively one T-cycle late. This screws up APU’s cycle accuracy for now. 2018-03-05 21:17:37 +02:00
Lior Halphon
88a11b891f Object rendering 2018-03-04 23:27:31 +02:00
Lior Halphon
3d1c8b50c4 OAM search and OAM timing in mode 3 2018-03-04 22:21:56 +02:00
Lior Halphon
476133abd0 The scrolled y value is cached and not recalculated 2018-03-03 20:51:38 +02:00
Lior Halphon
518746f664 fixed rendering off by one 2018-03-03 19:52:48 +02:00
Lior Halphon
496c5589e6 Added window support 2018-03-03 19:36:21 +02:00
Lior Halphon
5ea33cc931 Cleanup 2018-03-03 19:05:29 +02:00
Lior Halphon
b08f02c4f3 Rewriting the PPU rendering: T-cycle accurate background rendering. DMG only, CGB completely broken 2018-03-03 15:47:36 +02:00
Lior Halphon
487c063d48 Merge branch 'master' into timing 2018-03-02 19:45:15 +02:00
Lior Halphon
6e8567eadc Silence some annoying Cocoa warnings, hopefully it won’t affect performance 2018-03-02 19:42:02 +02:00
Lior Halphon
3c8f3ad3fc Stop annoying beeps and exceptions 2018-03-02 19:37:40 +02:00
Lior Halphon
a67db0595b Fixed window behavior 2018-03-01 22:03:56 +02:00
Lior Halphon
b702d56547 Merge branch 'master' into timing
# Conflicts:
#	Core/display.c
#	Core/z80_cpu.c
2018-03-01 21:22:33 +02:00
Lior Halphon
94c6dbd281 Fixed ‘call’ instruction not being properly symbolicated. Closes #37 2018-03-01 21:12:37 +02:00
Lior Halphon
7248403be7 Fixed several DMG regressions, fixes Pinball Deluxe again 2018-03-01 00:12:04 +02:00
Lior Halphon
fb03479a1f Added 16-bit dereferencing operator ({address}) to the debugger. Closes #38 2018-02-28 19:39:22 +02:00
Lior Halphon
58d287da7a Merge pull request #36 from ISSOtm/patch-1
Make the main menu's last option's purpose more explicit
2018-02-28 19:24:50 +02:00
Panda Habert
980acc3fb8 Make the last option's purpose more explicit
I mistook it several times for the option to exit the menu :/
2018-02-26 02:27:50 +01:00
Lior Halphon
b02e40d5a2 Refinement to that last fix 2018-02-25 23:23:55 +02:00
Lior Halphon
90a943d05a Emulate an HDMA quirk required to properly emulate Aevilia 2018-02-25 22:32:41 +02:00
Lior Halphon
ef670986c6 Rewrote PPU (currently only emulates DMG correctly) to use the new timing mechanism. Removed “future interrupts” (No longer required because SameBoy is now T-cycle based) 2018-02-25 00:48:45 +02:00
Lior Halphon
42ab746a66 Starting to remove the delayed interrupts hack – done for timer interrupt, broken for display interrupts 2018-02-23 15:33:44 +02:00
Lior Halphon
c48097a484 Convert div counter to the SM mechanism 2018-02-23 13:16:05 +02:00
Lior Halphon
5974092c94 Bugfix 2018-02-20 23:04:35 +02:00
Lior Halphon
56eac9f875 Removed some dead code from display.c 2018-02-20 21:23:27 +02:00
Lior Halphon
9802ca41dd Components not affected by CGB’s double speed mode now operate in 8MHz mode to theoretically make advance_cycles(gb, 1) safe. 2018-02-20 21:17:12 +02:00
Lior Halphon
058913f8a2 Fixed libretro-Android build 2018-02-20 19:57:33 +02:00
Lior Halphon
d0202a3f9a Added LCD graphics filter; emulates low-resolution LCD artifacts 2018-02-17 20:43:48 +02:00
Lior Halphon
f79af39ea2 More accurate emulation of the APU’s analog characteristics 2018-02-16 18:01:50 +02:00
Lior Halphon
fc35111ae7 Corrected the emulated DAC’s range 2018-02-16 01:26:37 +02:00
Lior Halphon
0c231db9e7 This is probably not correct (and makes no sense from an hardware design perspective), but this correctly emulates my analog test cases and fixes the pops introduced by the last commit. 2018-02-13 23:13:15 +02:00
Lior Halphon
bfb37884e1 Inactive channels are not equivalent to channels with 0 volume. 2018-02-11 22:50:15 +02:00
Lior Halphon
afcc66fb3c Added CPU under/over-clocking support in Core, add under-clocking hotkey in the Cocoa port, allow modifier keys to be configured as input keys in Cocoa. 2018-02-10 23:30:30 +02:00
Lior Halphon
0cbbaac490 Updated incorrect comment after verification 2018-02-10 19:50:42 +02:00
Lior Halphon
220ba9ff38 Restored auto model selection in libretro. Fixed incorrect aspect ratio in libretro (Closes #30). 2018-02-10 15:41:00 +02:00
Lior Halphon
81f808e184 Refinements for the Wii U port 2018-02-10 15:02:22 +02:00
Lior Halphon
00c67f8842 Merge commit '217e9787bd640cbd1b8250e31c0064331ddc302f' 2018-02-10 14:49:57 +02:00
Lior Halphon
369a915d66 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2018-02-10 14:44:48 +02:00
Lior Halphon
1c61b006ba Added rewinding support to the core and the Cocoa frontend 2018-02-10 14:42:14 +02:00
radius
217e9787bd change MAX_CH_AMP on WiiU 2018-02-07 15:28:30 -05:00
Twinaphex
26d51a831c Merge pull request #14 from libretro/link
Link Cable
2018-02-06 01:12:23 +01:00
radius
cc296a3114 fix savefile names 2018-02-05 19:07:18 -05:00
radius
8dd94505a8 save ram handling for dual mode 2018-02-05 19:07:08 -05:00
radius
792087276e cleanup logs 2018-02-05 19:07:08 -05:00
radius
ff8a20ef04 disable this for now 2018-02-05 19:07:08 -05:00
radius
d3a67f9e19 make link cable a runtime option 2018-02-05 19:07:08 -05:00
radius
567936a21d cut code duplication a bit 2018-02-05 19:07:08 -05:00
radius
0b96df1428 readd single game link cable 2018-02-05 19:07:08 -05:00
radius
f98b71a257 rename core options 2018-02-05 19:07:07 -05:00
radius
a5b182f0fa standarize core options 2018-02-05 19:07:07 -05:00
radius
b74095a2cd set emulated devices automatically 2018-02-05 19:07:01 -05:00
radius
b169d86bf8 subsystem support 2018-02-05 19:07:01 -05:00
Tatsuya79
7459b9610c Reduce input lag by 1 frame 2018-02-05 19:06:56 -05:00
radius
a8741674ce better savestate code 2018-02-05 19:06:56 -05:00
radius
50fd7f1140 use set geometry instead 2018-02-05 19:06:56 -05:00
radius
120edb6f8c rebase from master 2018-02-05 19:06:56 -05:00
Brad Parker
ef143261e5 implement left-right screen layout option, add ASAN to Makefile 2018-02-05 19:06:55 -05:00
radius
5e04600ab1 add descriptors to P2 2018-02-05 19:06:55 -05:00
radius
408bf5baab add audio output selection 2018-02-05 19:06:55 -05:00
radius
945ee0bdb3 rename the array so it doesn't conflict with the function signature 2018-02-05 19:06:55 -05:00
radius
88dfb9a159 fix emulated model for slot 2 2018-02-05 19:06:55 -05:00
radius
457b3b3f06 change viewport size 2018-02-05 19:06:55 -05:00
radius
8b506e84fd fix changing mode between link enabled and disabled 2018-02-05 19:06:54 -05:00
radius
7ee063da28 single mode works 2018-02-05 19:06:54 -05:00
radius
f7d129bd24 separate core options for single and linked mode 2018-02-05 19:06:47 -05:00
radius
52634b8023 add layout core option 2018-02-05 19:06:42 -05:00
radius
b573fbcdc4 reduce code duplication 2018-02-05 19:06:41 -05:00
radius
49a8cd0bb5 hook up savestates for GB#2 2018-02-05 19:06:23 -05:00
radius
91816c30b5 fix gameboy synchronization thanks to @LIJI32 2018-02-05 19:06:23 -05:00
radius
45e0a75491 savefile hack for slot 2, both load from the same SRM file but gb2 doesn't save 2018-02-05 19:06:23 -05:00
radius
3b858fb6af initial link cable implementation 2018-02-05 19:06:23 -05:00
radius
ff4168b8f6 fix warning 2018-02-05 19:04:51 -05:00
radius
db0269cd3f clean whitespace 2018-02-05 18:39:25 -05:00
radius
dd7704e572 set sample rate to 44100 on WIIU 2018-02-05 18:31:31 -05:00
radius
a939fed872 cleanup whitespaces 2018-02-05 18:17:55 -05:00
radius
9a09f92032 update Android.mk 2018-02-05 18:13:36 -05:00
radius
a04646ab5b update Android.mk 2018-02-05 18:13:36 -05:00
radius
e1bd85caa6 add WiiU target 2018-02-05 18:13:35 -05:00
radius
3bd1c122c3 try to fix jni build 2018-02-05 18:13:35 -05:00
kwyxz
ede16f1d3b Allow build on Haiku target 2018-02-05 18:13:35 -05:00
Tatsuya79
9c23fe2563 Reduce input lag by 1 frame 2018-02-05 18:13:35 -05:00
radius
39c352c89b add address sanitizer support 2018-02-05 18:13:35 -05:00
radius
5660b762c0 add prebuilt roms again 2018-02-05 18:13:34 -05:00
radius
e97624ba7d fix warning 2018-02-05 18:13:34 -05:00
radius
d047897462 use the prebuilt roms 2018-02-05 18:13:34 -05:00
Lior Halphon
96f6839434 Merge pull request #28 from rootfather/enumlation
SDL: Fix typo in the GUI
2018-02-03 17:37:49 +02:00
rootfather
8f56da465a SDL: Fix typo in the GUI 2018-02-03 16:35:50 +01:00
Lior Halphon
51eacd3174 Update version to 0.10.1, update copyright to 2018 2018-02-03 00:50:38 +02:00
Lior Halphon
aeb9f0eda4 Prevent screensaver when using a joypad 2018-02-02 19:22:08 +02:00
Lior Halphon
f3c07f1f99 Fixed a silly bug that prevented libretro automatic model selection from functioning correctly. 2018-01-31 23:58:17 +02:00
Lior Halphon
95234036bb Added return value to GB_run API. 2018-01-31 15:18:04 +02:00
Lior Halphon
bc55531204 Added automatic model selection for the libretro port. 2018-01-27 21:46:13 +02:00
Lior Halphon
2bda598ac6 Merge commit 'ab49034205261e8e50708d097ec22151f153a801' 2018-01-27 02:16:55 +02:00
radius
ab49034205 update Bootroms 2018-01-26 19:08:31 -05:00
radius
b047c7a9e1 readd bootroms 2018-01-26 19:01:20 -05:00
radius
6d868c8f7c update to master 2018-01-26 18:51:39 -05:00
Lior Halphon
cc73796897 Merge pull request #26 from ConnorRigby/sdl/fix-load-from-cmdline
Fix loading game from command line.
2018-01-23 00:02:40 +02:00
connor rigby
ce31de47cb Fix loading game from command line. 2018-01-22 12:25:27 -08:00
Twinaphex
935b2f6114 Merge pull request #8 from lubosz/switch
Makefile: Add Switch target.
2018-01-22 17:52:24 +01:00
Lubosz Sarnecki
59fe551f26 Makefile: Add Switch target. 2018-01-22 16:58:06 +01:00
Lior Halphon
af143b0420 Added model selection to libretro, including GBA. Closes #23. 2018-01-20 00:06:33 +02:00
Lior Halphon
09dd47c6de Fixed unintentional delay in NR50 and NR51’s effects 2018-01-19 19:56:39 +02:00
Lior Halphon
37906bcd1f Fixed sound pops in Super Mario Land 2. 2018-01-19 00:47:46 +02:00
Lior Halphon
130c7c28c2 Re-do the way the libretro port does audio. Audio is now sent to libretro at 384KHz, which is then resampled to whatever rate the user configured. 2018-01-15 22:23:20 +02:00
Lior Halphon
5c16d0e656 Added model selection GUI in the SDL port. Closes #24 2018-01-13 13:49:20 +02:00
Lior Halphon
69a712b07f Added AGB as a model option in Cocoa 2018-01-13 13:31:06 +02:00
Lior Halphon
2cd5c49935 Made CGB boot more accurate, added AGB boot 2018-01-13 13:02:31 +02:00
Lior Halphon
59d4cb4bc2 Make menu key more obvious on the SDL port 2018-01-13 13:02:07 +02:00
radius
82e2df7a2a keep using prebuild roms for libretro 2018-01-07 20:02:36 -05:00
radius
bebb94738c Merge remote-tracking branch 'upstream/master' 2018-01-07 19:54:22 -05:00
Lior Halphon
a2a1148354 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2018-01-06 12:38:05 +02:00
Lior Halphon
0a76881eb6 Correctly emulating NRx4 effects on the sound envelop of the previously playing sound. Closes #19 2018-01-06 12:37:45 +02:00
Lior Halphon
a20e8a8220 Fixed bug in NR42 write that also caused memory corruption 2018-01-06 12:17:06 +02:00
Lior Halphon
a1af4c59ca Fixed NR51 volume levels (They’re 1-8, not 0-7) 2018-01-06 11:58:49 +02:00
Twinaphex
afbd62c665 Merge pull request #5 from retro-wertz/pitch
Fix pitch issue
2018-01-04 11:38:20 +01:00
Twinaphex
968399a409 Merge pull request #6 from retro-wertz/libretro_api
Access system and video ram using Librero API
2018-01-04 11:38:11 +01:00
Twinaphex
8bbfab3183 Merge pull request #7 from retro-wertz/makefile
Fix target location when compiling
2018-01-04 11:37:55 +01:00
retrowertz
acac96310b Fix target location when compiling 2018-01-04 16:46:57 +08:00
retrowertz
c578b36dfb Access system and video ram using Librero API 2018-01-04 16:43:31 +08:00
retrowertz
c0cf5646da Fix pitch issue
This issue affects when running in vulkan driver
2018-01-04 16:24:37 +08:00
Lior Halphon
60862a35c8 Merge pull request #22 from Nadia-h/patch-1
libretro: Fix video being broken with Vulkan
2018-01-02 10:42:58 +02:00
Nadia Pedersen
e4fbece88f libretro: Fix video being broken with Vulkan
This corrects the pitch parameter for the video refresh callback to be the actual pitch instead of 0.

Setting it to 0 seems to work fine for OpenGL, but it causes the graphics to be broken with Vulkan, at least with an AMD card on Linux.
2018-01-02 07:41:02 +01:00
Lior Halphon
d62ff4eb75 Fixed timing issues with the DMG boot ROM. Closes #20. 2017-12-31 23:02:28 +02:00
Andrés
f905c4d0f6 Merge pull request #4 from hizzlekizzle/master
update to upstream v0.10
2017-12-30 16:08:10 -05:00
hunterk
1272405f16 update to upstream v0.10 2017-12-30 14:33:52 -06:00
Lior Halphon
42bf575a0e Updated version to 0.10 2017-12-30 17:58:17 +02:00
Lior Halphon
2205493862 Bug fixes in the SDL port 2017-12-30 17:07:05 +02:00
Lior Halphon
a4465b72e7 Clean up unneeded joystick code, joystick is now internally driven by callbacks (instead of polling) 2017-12-30 17:00:07 +02:00
Lior Halphon
8eeda02d50 Added Joypad support, closes #9 2017-12-30 16:23:17 +02:00
Lior Halphon
d6236b87dd Fixed a crash in the OAM tab 2017-12-29 13:42:32 +02:00
Lior Halphon
595bb563f9 OmniScale is no longer beta 2017-12-29 13:35:03 +02:00
Lior Halphon
e8f0615635 Update README.md 2017-12-29 13:32:12 +02:00
Lior Halphon
fc15b5c9f9 Remove hardcoded version from libretro.c, use version from the Makefile 2017-12-29 13:26:11 +02:00
Lior Halphon
0891de668b Merge commit '1d96a10acb661e07775de954338f4bb3724705a3' into libretro_core
# Conflicts:
#	libretro/libretro.c
2017-12-29 13:18:52 +02:00
Lior Halphon
d3a2e49d38 Merge branch 'sdl_gui' into libretro_core
# Conflicts:
#	Makefile
#	SDL/main.c
2017-12-29 13:12:12 +02:00
Lior Halphon
600f0eadd9 Better Windows and Linux compatibility 2017-12-29 13:06:38 +02:00
Lior Halphon
3d8e22ed50 Use SDL’s OpenGL headers 2017-12-29 11:35:09 +02:00
Lior Halphon
b1edf540d8 Handle failures to create an OpenGL context better 2017-12-29 00:43:19 +02:00
Lior Halphon
ca92c51f51 Save user configuration 2017-12-28 21:46:59 +02:00
Lior Halphon
effc02ce8e Use SDL_GetBasePath for better portability 2017-12-28 20:29:15 +02:00
Lior Halphon
61f9dbd95d Use SDL’s key mapping when available 2017-12-28 20:22:54 +02:00
Lior Halphon
c559a308ad Slightly improved background 2017-12-27 23:20:06 +02:00
Lior Halphon
dc59fdf40e Highpass filter in SDL 2017-12-23 22:11:53 +02:00
Lior Halphon
3c1a805770 Frame blending 2017-12-23 22:11:53 +02:00
Lior Halphon
d262dde71a Scaling filters in SDL 2017-12-23 22:11:53 +02:00
Lior Halphon
c03ccba8db Basic Joypad support 2017-12-23 22:11:43 +02:00
Lior Halphon
3f9d62ceee Merge branch 'master' into sdl_gui 2017-12-22 22:26:16 +02:00
Lior Halphon
f48194f480 Added configurable controls 2017-12-22 22:25:53 +02:00
Lior Halphon
f0e772ca97 Fixed: Loading states in DMG mode results in a black screen 2017-12-22 21:58:31 +02:00
Twinaphex
1d96a10acb Merge pull request #2 from orbea/cxxflags
libretro: Change CXXFLAGS to CFLAGS.
2017-12-22 08:02:36 +01:00
Twinaphex
2a69081e53 Merge pull request #3 from orbea/git_version
libretro: Add GIT_VERSION
2017-12-22 06:25:57 +01:00
orbea
536e47c567 libretro: Add GIT_VERSION 2017-12-21 21:16:55 -08:00
orbea
2184fd0902 libretro: Change CXXFLAGS to CFLAGS.
This core does not use CXXFLAGS...
2017-12-21 21:03:41 -08:00
radius
be3385a8c1 Update to upstream/master 2017-12-09 21:07:11 -05:00
Lior Halphon
19c382c9e0 Fixed ei_sequence test 2017-12-03 21:07:34 +02:00
Tim Allen
40524fef8a Update to v105r1 release.
byuu says:

Changelog:

  - higan: readded support for soft-reset to Famicom, Super Famicom,
    Mega Drive cores (work in progress)
      - handhelds lack soft reset obviously
      - the PC Engine also lacks a physical reset button
      - the Master System's reset button acts like a gamepad button, so
        can't show up in the menu
  - Mega Drive: power cycle wasn't initializing CPU (M68K) or APU (Z80)
    RAM
  - Super Famicom: fix SPC700 opcode 0x3b regression; fixes Majuu Ou
    [Jonas Quinn]
  - Super Famicom: fix SharpRTC save regression; fixes Dai Kaijuu
    Monogatari II's real-time clock [Talarubi]
  - Super Famicom: fix EpsonRTC save regression; fixes Tengai Makyou
    Zero's real-time clock [Talarubi]
  - Super Famicom: removed `*::init()` functions, as they were never used
  - Super Famicom: removed all but two `*::load()` functions, as they
    were not used
  - higan: added option to auto-save backup RAM every five seconds
    (enabled by default)
      - this is in case the emulator crashes, or there's a power outage;
        turn it off under advanced settings if you want
  - libco: updated license from public domain to ISC, for consistency
    with nall, ruby, hiro
  - nall: Linux compiler defaults to g++; override with g++-version if
    g++ is <= 4.8
      - FreeBSD compiler default is going to remain g++49 until my dev
        box OS ships with g++ >= 4.9

Errata: I have weird RAM initialization constants, thanks to hex_usr
and onethirdxcubed for both finding this:
http://wiki.nesdev.com/w/index.php?title=CPU_power_up_state&diff=11711&oldid=11184

I'll remove this in the next WIP.
2017-11-07 09:05:54 +11:00
Talarubi
57826a7ef1 Update version and license
Added LICENSE.txt and GPLv3.txt. Also updated libco documentation.

After discussion with byuu, libco gets a more specific ISC license
to match nall, ruby and hiro. higan, as clarified in LICENSE.txt,
continues to be GPL version 3 only (no "or later" clause).
2017-10-24 23:37:22 -04:00
Brad Parker
8c9ff67b21 add travis build script 2017-10-24 13:32:22 -04:00
radius
212947d83c really strong rumble 2017-10-17 23:42:55 +03:00
radius
f1bcddf421 hookup reset and unload 2017-10-17 23:42:55 +03:00
radius
32e4d705c6 check_variables later 2017-10-17 23:42:55 +03:00
leiradel
a8dbae00c2 Added cheevos support 2017-10-17 23:42:54 +03:00
radius
85971e9158 hookup color filter & highpass filter 2017-10-17 23:42:54 +03:00
Lior Halphon
4b69331321 Merge branch 'master' into libretro_core 2017-10-16 20:49:33 +03:00
Lior Halphon
e71154b7e0 Fixed set_color_correction breaking DMG’s palette 2017-10-16 20:48:39 +03:00
radius
55412d7093 don't apply color correction for DMG 2017-10-15 22:08:13 -05:00
radius
f724cbbacd really strong rumble 2017-10-15 18:46:37 -05:00
radius
9f8d871c9c hookup reset and unload 2017-10-15 18:08:31 -05:00
radius
d57d4dbe24 check_variables later 2017-10-15 15:48:56 -05:00
leiradel
d8e460ca47 Added cheevos support 2017-10-15 12:47:33 -05:00
radius
7313473fd2 use prebuilt bootroms 2017-10-15 12:47:33 -05:00
radius
a42fed5d53 hookup color filter & highpass filter 2017-10-15 12:47:33 -05:00
radius
930ee8145c move the target to TLD for our fork 2017-10-15 12:47:33 -05:00
Lior Halphon
42712a0280 Refined dep-generation condition 2017-10-15 20:26:49 +03:00
Lior Halphon
8e61098fec Use scan codes instead of key symbols 2017-10-14 20:24:13 +03:00
Lior Halphon
47d5b485d4 Better controls and visuals for settings 2017-10-14 17:08:52 +03:00
Lior Halphon
2dfe22e834 Added graphics options menu, fixed issues with exiting not saving battery in some cases 2017-10-14 14:10:26 +03:00
Lior Halphon
c66e9a06cf Added basic menu 2017-10-14 01:41:51 +03:00
Lior Halphon
7a024d2a69 Merge branch 'master' into sdl_gui 2017-10-14 00:25:02 +03:00
Lior Halphon
c7e82b4a47 Use hexdump instead of xxd (more portable) 2017-10-13 18:13:26 +03:00
Lior Halphon
6c97bb9052 Accidentally reversed ifdef condition 2017-10-13 17:28:32 +03:00
Lior Halphon
57f50edaa2 Use $(MAKE) instead of make 2017-10-13 00:14:32 +03:00
Lior Halphon
bbd3b7e550 Got rid of -ICore 2017-10-13 00:02:02 +03:00
Lior Halphon
27b5718b07 Merge branch 'master' into libretro_core 2017-10-12 22:50:02 +03:00
Lior Halphon
a753e00b59 Added direct_access interface to interrupt_enable/IE register 2017-10-12 22:49:39 +03:00
Lior Halphon
a5f66c8b8b Updated readme 2017-10-12 22:46:35 +03:00
Lior Halphon
a498b19bfd Moved libretro’s Makefile to libretro’s folder 2017-10-12 22:40:48 +03:00
Lior Halphon
49095ebc5e Moved libretro’s target to the build folder 2017-10-12 22:27:08 +03:00
Lior Halphon
40e4f93637 Replaced libretro specific code with a generic API 2017-10-12 22:06:01 +03:00
Lior Halphon
6b71d1d477 “Baked” boot ROM is now auto-generated. 2017-10-12 21:52:51 +03:00
Lior Halphon
441781cbe9 Libretro .o files are now in the build/obj folder and are suffixed with _libretro (since they have different compilation flags). This also lets us rename gbmemory.c/h back to its original name. 2017-10-12 19:42:30 +03:00
Lior Halphon
7c0ad24175 Added compilation flag to disable timekeeping for frontends that handle fps keeping on their own 2017-10-12 19:24:12 +03:00
Lior Halphon
a50aa2486b Removed input callbacks when no debugger is included 2017-10-12 19:16:33 +03:00
Lior Halphon
dcadfc37f4 Changed the way HAVE_DEBUGGER works and renamed it (so it’s on by default) to DISABLE_DEBUGGER. Fixes build break. 2017-10-12 19:05:27 +03:00
Lior Halphon
9615ca6fa6 Merge pull request #14 from libretro/master
libretro core
2017-10-12 18:29:26 +03:00
Lior Halphon
65dd02cc52 Added 3 color correction profiles, added color correction setting to Cocoa GUI, improved cross-platform and cross-frontend save-state compatibility 2017-10-12 17:22:22 +03:00
radius
6f40885f73 this seems to improve audio a lot but I still hear some small crackles 2017-10-10 20:29:46 -05:00
radius
8d691563c7 include unistd 2017-10-09 19:53:07 -05:00
radius
18b376ac5f Updates:
-fix input descriptors
-implement savestates
-implement sram interface
2017-10-09 14:21:32 -05:00
Yoshi Sugawara
dd30b63426 support for iOS arm64 build 2017-10-09 11:36:56 -05:00
twinaphex
1eb1113a24 Update Makefile 2017-10-09 11:36:56 -05:00
ggf906
a009616726 (VITA) Fix compilation 2017-10-09 11:36:55 -05:00
twinaphex
a7db98c22e Memory needs to be uniquely named for Android 2017-10-09 11:36:55 -05:00
twinaphex
b02aeab022 We don't need stdin 2017-10-09 11:36:54 -05:00
twinaphex
5e3a24573e Bump up version 2017-10-09 11:36:54 -05:00
twinaphex
091df682cd Silence warning 2017-10-09 11:36:54 -05:00
twinaphex
09f4edda57 Comment out debugger code - add HAVE_DEBUGGER ifdef 2017-10-09 11:36:53 -05:00
twinaphex
aeea20ae9d Comment out nsleep 2017-10-09 11:36:53 -05:00
twinaphex
9f5b746e0b Fix compiler error 2017-10-09 11:36:53 -05:00
twinaphex
63b17e14af Update 2017-10-09 11:36:24 -05:00
twinaphex
fedea2cad7 Don't hook up regular audio_cb 2017-10-09 11:36:24 -05:00
radius
7d2dbe2988 no need for turbo mode in libretro 2017-10-09 11:36:24 -05:00
radius
765a072c73 this fixes fast forwarding but probably has to change to a proper fix 2017-10-09 11:36:24 -05:00
radius
3dffa3a0ca fix gbc 2017-10-09 11:36:23 -05:00
radius
65e6e5f30b use GB_run_frame 2017-10-09 11:36:23 -05:00
twinaphex
33a9c54842 Correct memset lines 2017-10-09 11:36:23 -05:00
twinaphex
d433cdf260 Add baked-in generated BIOS files 2017-10-09 11:36:23 -05:00
Not6
3f86d898a3 some others input 2017-10-09 11:36:23 -05:00
Not6
009a66d723 basic libretro port 2017-10-09 11:36:23 -05:00
Lior Halphon
947c62bea9 Oops 2017-10-04 13:14:37 +03:00
Lior Halphon
d171a0ccee Updating the DMG palette to match the new SDL GUI 2017-10-04 12:43:46 +03:00
Lior Halphon
9cc8b3320a Starting to add a GUI to the SDL port 2017-10-04 12:43:31 +03:00
Lior Halphon
c1f27d7b27 Spacing 2017-10-02 22:59:03 +03:00
Lior Halphon
d9b0576351 Emulation of NRX2-write glitches. Fixes Prehistorik Man audio. 2017-10-02 22:56:24 +03:00
Lior Halphon
78446f0ed4 Fixed several memory leaks (mostly in Cocoa port debugging utils) 2017-09-27 22:09:26 +03:00
Lior Halphon
7a41a9b417 Refined OAM interrupt timing. Fixes Pinball Deluxe in DMG mode; closes #1. 2017-09-23 21:08:05 +03:00
Lior Halphon
1804a5c8e6 Updated save struct version 2017-09-23 00:25:21 +03:00
Lior Halphon
67f1566b5e Minor refinement to sweep 2017-09-23 00:23:02 +03:00
Lior Halphon
e0a6edac35 Setting sweep period to 0 cancels pending calculate event 2017-09-22 14:53:24 +03:00
Lior Halphon
2ffce49e16 Minor bugfixes related to sweeping 2017-09-22 14:39:39 +03:00
Lior Halphon
75db33559a Current sample index (Channel 1 and 2) is only reset after turning the APU off 2017-09-22 02:25:06 +03:00
Lior Halphon
8f4cd5c412 Corrected behavior for channel 1 and 2 restart 2017-09-22 02:04:29 +03:00
Lior Halphon
882b141478 Fixed dmg_sound-1 2017-09-21 18:32:21 +03:00
Lior Halphon
2ca550273a Fixed dmg_sound-5 2017-09-21 18:18:10 +03:00
Lior Halphon
d3c15ef6ca Fixing APU bugs, one at a time: Blargg’s dmg_sound 8.2 2017-09-21 14:52:09 +03:00
Lior Halphon
02ac609f3c Merge branch 'master' into new_apu 2017-09-20 16:16:05 +03:00
Lior Halphon
be038dc8e7 Refinement to the last fix 2017-09-20 03:08:54 +03:00
Lior Halphon
57e7782ac4 Interrupt servicing is now more accurate. Fixes mooneye-gb’s ie_push (all models) and Pinball Deluxe (!!!) for CGB mode 2017-09-20 02:49:45 +03:00
Lior Halphon
09b7e2fff4 Fixed a bug in scx_delay’s calculation 2017-09-11 23:56:35 +03:00
Lior Halphon
b9bdd6c49c Merge branch 'master' into new_apu 2017-09-10 02:33:40 +03:00
Lior Halphon
14f267b4fa Another whoops 2017-09-09 19:31:05 +03:00
Lior Halphon
02841ddde6 Whoops 2017-09-09 16:55:55 +03:00
Lior Halphon
026baddbab Implemented delayed/future interrupts for DMG hblank interrupt. Restores vblank_stat_intr-GS support. 2017-09-09 13:45:01 +03:00
Lior Halphon
1e90400916 Reimplemented delayed/future interrupts, currently correct only for CGB. 2017-09-09 13:32:12 +03:00
Lior Halphon
742c9e95d3 Updated previous timing improvements to correctly implement double speed behavior 2017-09-08 23:46:38 +03:00
Lior Halphon
e5d354e896 Refined SCX’s effects on PPU timing 2017-09-08 23:02:24 +03:00
Lior Halphon
0f1fa3176f Refinements to LCD timing (breaks vblank_stat_intr-GS for now) 2017-09-08 12:59:57 +03:00
Lior Halphon
0f643e01b7 Removing the delayed interrupt mechanism, research is not complete enough for implementation 2017-09-08 12:58:35 +03:00
Lior Halphon
ba0e66a5b7 Merge branch 'master' into new_apu 2017-09-04 18:41:13 +03:00
Lior Halphon
72d26c7046 Fixed obscure timer behavior, fixed regression in rapid_toggle.gb. 2017-09-04 18:40:43 +03:00
Lior Halphon
9bde98dede SCY latching is now correctly emulated, rendering mode timing refined. 2017-09-04 15:45:18 +03:00
Lior Halphon
a1a13c61bf On CGB, the VBlank and STAT interrupts are “delayed” by one T-cycle (relative to IF) since they’re not aligned to a T-Cycle 2017-09-03 00:41:52 +03:00
Lior Halphon
0532d2a159 A test ROM I wrote seems to contradicts some of AntonioND’s findings regrading PPU timing in CGB mode. CGB mode now behaves like DMG mode until I figure out what caused the difference. 2017-09-02 23:51:02 +03:00
Lior Halphon
9b490396bb Fixed timing when turning the LCD display on during double speed mode 2017-09-02 23:26:45 +03:00
Lior Halphon
54eb51d8db Refined timer interrupt timing 2017-09-02 22:08:20 +03:00
Lior Halphon
e7d5cdbb42 Merge branch 'master' into new_apu 2017-08-20 01:37:33 +03:00
Lior Halphon
cbbaf2ee84 Refined Window behavior once more, Fixes #12 (While not breaking Donkey Kong or 007) 2017-08-20 01:34:12 +03:00
Lior Halphon
62878fdc7a More accurate div-event handling 2017-08-15 22:27:15 +03:00
Lior Halphon
8d011ca4b9 Accuracy improvements (Sweep) 2017-08-15 22:05:20 +03:00
Lior Halphon
5d84ee250e Added Cocoa GUI for the High-Pass filter selection 2017-08-15 21:59:53 +03:00
Lior Halphon
d04aaddcbd Added highpass filter 2017-08-15 21:59:11 +03:00
Lior Halphon
ca59aca4a6 Fixed a bug where writing to NR52 affected channels 1 and 2’s duty pattern in DMG mode. Fixed NR43 being written to NR44 as well. 2017-08-13 20:26:35 +03:00
Lior Halphon
36943866e2 Better click prevention 2017-08-12 23:35:18 +03:00
Lior Halphon
d43daed6a6 Merge branch 'master' into new_apu 2017-08-12 21:43:09 +03:00
Lior Halphon
7df4e56454 KEY1 is only writable in CGB mode; screen should be black is LCD is on while in stop mode. 2017-08-12 21:42:47 +03:00
Lior Halphon
dba7370d6d Turns out APU signal is inverted. This fixes Perfect Dark’s audio. 2017-08-12 20:47:55 +03:00
Lior Halphon
688991f57f The volume envelopes and length controls are handled in different phases of the div-divider 2017-08-12 20:17:20 +03:00
Lior Halphon
4b8be255ce Fixed some channel 4 delays, documented a not currently emulated timing quirk. 2017-08-12 19:50:39 +03:00
Lior Halphon
066efab985 In DMG mode, the length registers are not affected by turning the APU on and off. Why? Why not! 2017-08-11 22:23:03 +03:00
Lior Halphon
0e22ad8eb1 Noise channel support 2017-08-11 17:57:08 +03:00
Lior Halphon
1a8bcd314d Accuracy improvements to sweeping (Still not complete though, more research needed) 2017-08-10 19:42:23 +03:00
Lior Halphon
ab5611119a Accuracy improvements, especially to the length control 2017-08-02 21:14:23 +03:00
Lior Halphon
d65c2247e5 Added channel 1 and 2, fixed accuracy issues with channel 3 2017-07-27 23:11:33 +03:00
Tim Allen
0382100a97 Update to v103r21 release.
byuu says:

Changelog:

  - gb: added TAMA emulation [thanks to endrift for the initial notes]
  - gb: save RTC memory to disk (MBC3 doesn't write to said memory yet;
    TAMA doesn't emulate it yet)
  - gb: expect MMM01 boot loader to be at end of ROM instead of start
  - gb: store MBC2 save RAM as 256-bytes (512x4-bit) instead of
    512-bytes (with padding)
  - gb: major cleanups to every cartridge mapper; moved to Mapper class
    instead of MMIO class
  - gb: don't serialize all mapper states with every save state; only
    serialize the active mapper
  - gb: serialize RAM even if a battery isn't present¹
  - gb/cartridge: removed unnecessary code; refactored other code to
    eliminate duplication of functions
  - icarus: improve GB(C) heuristics generation to not include filenames
    for cartridges without battery backup
  - icarus: remove incorrect rearrangement of MMM01 ROM data
  - md/vdp: fix CRAM reads -- fixes Sonic Spinball colors [hex\_usr]
  - tomoko: hide the main higan window when entering fullscreen
    exclusive mode; helps with multi-monitor setups
  - tomoko: destroy ruby drivers before calling Application::quit()
    [Screwtape]
  - libco: add settings.h and defines to fiber, ucontext [Screwtape]

¹: this is one of those crystal clear indications that nobody's
actually playing the higan DMG/CGB cores, or at least not with save
states. This was a major mistake.

Note: I can't find any official documentation that `GL_ALPHA_TEST` was
removed from OpenGL 3.2. Since it's not hurting anything except showing
some warnings in debug mode, I'm just going to leave it there for now.
2017-07-26 22:42:06 +10:00
Tim Allen
9a271f5452 Update to v103r20 release.
byuu says:

Changelog:

  - ruby/audio/xaudio2: ported to new ruby API
  - ruby/video/cgl: ported to new ruby API (untested, won't compile)
  - ruby/video/directdraw: ported to new ruby API
  - ruby/video/gdi: ported to new ruby API
  - ruby/video/glx: ported to new ruby API
  - ruby/video/wgl: ported to new ruby API
  - ruby/video/opengl: code cleanups

The macOS CGL driver is sure to have compilation errors. If someone will
post the compilation error log, I can hopefully fix it in one or two
iterations of WIPs.

I am unable to test the Xorg GLX driver, because my FreeBSD desktop
video card drivers do not support OpenGL 3.2. If the driver doesn't
work, I'm going to need help tracking down what broke from the older
releases.

The real fun is still yet to come ... all the Linux-only drivers, where
I don't have a single Linux machine to test with.

Todo:

  - libco/fiber
  - libco/ucontext (I should really just delete this)
  - tomoko: hide main UI window when in exclusive fullscreen mode
2017-07-24 15:23:40 +10:00
Tim Allen
91104e6ab6 Update to v103r19 release.
byuu says:

Changelog:

  - tomoko: Application::onMain assigned at end of Program::Program()
    [Screwtape]¹
  - libco: add `#define _XOPEN_SOURCE 500` to fix compilation of sjlj.c
    [Screwtape]
  - ruby/audio/openal: fixed device driver string list enumeration
  - ruby/audio/wasapi: changing device re-initializes the driver now
  - ruby/audio/wasapi: probably a pointless change, but don't fill the
    buffer beyond the queue size with silence
  - ruby/video/xvideo: renamed from ruby/video/xv
  - ruby/video/xvideo: check to see if `XV_AUTOPAINT_COLORKEY` exists
    before setting it [SuperMikeMan]
  - ruby/video/xvideo: align buffer sizes to be evenly divisible by four
    [SuperMikeMan]
  - ruby/video/xvideo: fail nicely without crashing (hopefully)
  - ruby/video/xvideo: add support for YV12 and I420 12-bit planar YUV
    formats²

¹: prevents crashes when drivers fail to initialize from running the
main loop that polls input drivers before the input driver is
initialized (or fails to initialize itself.) Some drivers still don't
block their main functions when initialization fails, so they will still
crash, but I'll work to fix them.

²: this was a **major** pain in the ass, heh. You only get one chroma
sample for every four luma samples, so the color reproduction is even
worse than UYVY and YUYV (which is two to four chroma to luma.) Further,
the planar format took forever to figure out. Apparently it doesn't care
what portion of the image you specify in XvShmPutImage, it expects you
to use the buffer dimensions to locate the U and V portions of the data.

This is probably the most thorough X-Video driver in existence now.

Notes:

  - forgot to rename the configuration settings dialog window title to
    just "Settings"
2017-07-23 19:18:16 +10:00
Lior Halphon
2936f7fa57 Fixed channel 3 counter behavior, verified with new tests. The DIV register ticks the APU at 512Hz. 2017-07-22 19:51:11 +03:00
Lior Halphon
a19ee1e5e0 2MHz audio downscaling support. Implemented NR50 and NR51. 2017-07-21 23:17:48 +03:00
Lior Halphon
baccf336d7 Complete rewrite of the APU. Channel 3 is complete and passes all the relevant tests from blargg’s suite, as well as PCM34-based tests. Actual sound output is basic and limited, though. 2017-07-21 19:06:55 +03:00
Lior Halphon
c0a8a570e8 Merge pull request #11 from nattthebear/master
Fix compilation in GCC 4.6.4
2017-07-17 12:22:52 +03:00
nattthebear
eb7492c6c6 Fix undefined behavior (sequence point modification). GCC 4.6.4 compiles the code incorrectly without this fix. 2017-07-16 21:08:07 -04:00
Lior Halphon
efc11783c7 Updated SameBoy’s “score” on mooneye-gb’s tests 2017-06-23 18:04:51 +03:00
Lior Halphon
c4ccbd5cce Improved serial interrupt timing, fixes boot_sclk_align. 2017-06-23 17:58:04 +03:00
Lior Halphon
623f92378d Added --boot option to the automatic tester to specify the boot ROM, better support for automatic testing of the mooneye-GB tests 2017-06-21 23:25:39 +03:00
Lior Halphon
c59272d46d Misc minor fixes, fixes several Mooneye-GB tests 2017-06-21 20:39:23 +03:00
Lior Halphon
efbc385417 Forgot to amend the last commit, it was broken. 2017-06-21 01:07:11 +03:00
Lior Halphon
aefca34b39 Improved MBC1 emulation. Fixed incorrect error messages. 2017-06-19 19:46:09 +03:00
Lior Halphon
abf7efcc5a Fixed lcdon_write_timing. 2017-06-18 21:27:07 +03:00
Lior Halphon
86c9f9d89d Updated SameBoy to pass Mooneye-GB’s lcdon_timing test (on a DMG), as well as refined related CBG behaviors. 2017-06-17 22:17:58 +03:00
Lior Halphon
bbd2ca8ddf Fixed Linux compilation 2017-06-16 01:25:39 +03:00
Lior Halphon
babcc0a7dc Added API to load/save states from RAM 2017-06-14 00:23:34 +03:00
Lior Halphon
204e22657b The CGB boot ROM will now not finish if the user is still selecting palettes 2017-06-09 19:52:40 +03:00
Lior Halphon
144d0348dd Loading a save state creating during the effect of the previous MBC RAM bug will now attempt to fix the (broken) save state. 2017-06-08 23:26:04 +03:00
Lior Halphon
c650337928 Fixed a bug where MBC RAM was no longer accessible after using the GB_reset functions 2017-06-08 22:48:23 +03:00
Lior Halphon
a9475fbdf4 Refined the behavior of the last fix on a DMG. 2017-06-03 20:06:52 +03:00
Lior Halphon
65b0dcb2c5 Fixed a bug where SameBoy freeze for a moment after leaving turbo mode 2017-06-03 17:02:12 +03:00
Lior Halphon
d72807dd67 Implemented LCD first-frame-skip behavior, fixes a visual glitch in Pokémon Pinball 2017-06-03 16:42:42 +03:00
Lior Halphon
48acc09e91 Fixed the first item in the backtrace command 2017-06-03 16:19:39 +03:00
Lior Halphon
22ee6f6ca2 Fixed incorrect calculation in rendering timing. Fixes some of the issues in Prehistorik Man (and doesn’t break GBVideoPlayer) 2017-05-31 23:58:14 +03:00
Lior Halphon
81de2c3d9b Incremented version to 0.9, updated copyright 2017-05-27 19:41:09 +03:00
Lior Halphon
1e228e1d9b Fixed a bug where the SDL port exited on “warning” logs when loading ROMs 2017-05-27 19:16:07 +03:00
Lior Halphon
9b89d76b3b Todo cleanup 2017-05-27 17:30:12 +03:00
Lior Halphon
f34103473e Fixed ^C not giving focus to the console window 2017-05-27 17:16:20 +03:00
Lior Halphon
a69f0a64b1 Added reverse text search to the Cocoa console 2017-05-27 17:15:52 +03:00
Lior Halphon
6b2a302393 Terminal-style command history in the Cocoa debugger 2017-05-27 14:32:32 +03:00
Lior Halphon
44b414d45f Fixed VRAM window not showing correctly if opened while the game is paused 2017-05-27 12:52:31 +03:00
Lior Halphon
da852119de Updated readme to SDL2 2017-05-27 12:47:25 +03:00
Lior Halphon
096bd8ba94 Merge branch 'sdl2' 2017-05-27 12:30:25 +03:00
Lior Halphon
6e7ab3558a Use a smaller audio buffer size if supported. 2017-05-27 12:29:36 +03:00
Lior Halphon
a01ea29cf1 The first entry in the backtrace command is now in the same format as the rest 2017-05-26 20:21:39 +03:00
Lior Halphon
7d88ee00cc Added side view to Cocoa debugger 2017-05-26 20:16:19 +03:00
Lior Halphon
ece1a11a23 SDL port: GUI-based error reporting, added help dialog (? on macOS, F1 on everything else) 2017-05-25 23:28:48 +03:00
Lior Halphon
4d5dc6a30e Cleanup 2017-05-24 21:44:43 +03:00
Lior Halphon
52e99adc32 SDL port: Resizing, resizing modes, and pause support 2017-05-24 20:33:39 +03:00
Lior Halphon
00439f4d49 SDL port: added drag and drop support, added model switch command, fixed macOS audio 2017-05-23 23:18:16 +03:00
Lior Halphon
bef89c6604 Upgraded Sameboy-SDL to SDL2, fixed Windows build, fixed save states in SDL, added reset and mute to SDL. The SDL port now renders via OpenGL. 2017-05-21 21:45:19 +03:00
Lior Halphon
50a21da4d5 False positive fixes 2017-05-13 22:55:59 +03:00
Lior Halphon
6dd24e0733 Fixed hung note issue. Closes #7 2017-05-13 17:04:05 +03:00
Lior Halphon
86332d0311 Modifying WX and WY outside of VBlank is now more accurate, but still requires more research. Closes #6. 2017-05-12 19:33:42 +03:00
Lior Halphon
00623d4eea - Added audio supersampling support to greatly improve audio quality.
- Fixed a bug where low sampling rate or disabled sound resulted in wrong APU behavior.
- Added API to get the current number of pending samples.
- This change broke save state compatibility with v0.8 and older
Closes #8.
2017-05-12 17:11:55 +03:00
Lior Halphon
b858f17425 Added the GB_run_frame API; closes #5. 2017-04-25 00:19:10 +03:00
Lior Halphon
22d3510dde Added LCD command to the debugger 2017-04-22 14:55:17 +03:00
Lior Halphon
c766704267 More accurate FPS capping that tracks time correctly even when the screen is off. Should also support restarting the LCD during blank to increase FPS to 63. 2017-04-21 16:00:53 +03:00
Lior Halphon
fb55c35f87 New APIs, Document.m no longer requires GB_INTERNAL, fixed a bug where the sprite viewer showed incorrect sprites for some CGB exclusive games. 2017-04-19 23:26:39 +03:00
Lior Halphon
3feaeb153e New turbo related APIs, Quick Look no longer requires GB_INTERNAL 2017-04-19 21:55:58 +03:00
Lior Halphon
a925ef130d Stabilizing API: New joypad, debugger and reset APIs; internal APIs and direct struct access are no longer available without defining GB_INTERNAL. The SDL port uses the new “public” APIs, as well as most of the non-debug Cocoa code. 2017-04-17 20:16:17 +03:00
Lior Halphon
0b1e2784cd Fixed saves and save states not working correctly on Windows 2017-03-24 14:39:39 +03:00
Lior Halphon
4bf391b1c8 SCX now effects Mode 3’s length. Fixes hblank_ly_scx_timing-GS 2017-02-25 23:30:31 +02:00
Lior Halphon
55e54d9499 Refinements to DMG STAT write interrupt bug. Fixes stat_irq_blocking on DMG. 2017-02-25 21:56:46 +02:00
Lior Halphon
2c1d2571d3 More false positive fixes 2017-02-25 16:06:38 +02:00
Lior Halphon
dbd04f09e8 HBlank HDMA should start instantly when starting during HBlank. Fixes 3-D Ultra Pinball. 2017-02-25 15:42:59 +02:00
Lior Halphon
9fbcce689c False positive stack overflow detection 2017-02-24 23:00:10 +02:00
Lior Halphon
ce05b5f7f0 Added the faster but unportable native_release configuration 2017-02-24 18:35:31 +02:00
Lior Halphon
371b575d2e Added information to stack overflow detection in the automatic tester 2017-02-24 18:25:27 +02:00
Lior Halphon
c116c70bfa Better GUI for user errors/warnings in Cocoa 2017-02-24 18:15:31 +02:00
Lior Halphon
724153e5ef Minimal attempt to be compatible with ROMs without correct headers 2017-02-24 15:14:47 +02:00
Lior Halphon
3d99773ddb Changed how the Cocoa port initializes GB_gameboy_t 2017-02-24 15:14:00 +02:00
Lior Halphon
39253bec80 Yet-another-false-positive automation fix 2017-02-24 01:19:44 +02:00
Lior Halphon
319857db89 Fixed window behavior 2017-02-24 00:59:07 +02:00
Lior Halphon
a420cfd798 HUC1’s RAM Enable only controls writing 2017-02-23 00:27:08 +02:00
Lior Halphon
c5ce14dad1 Prevent Hblank HDMAs when the LCD is off 2017-02-21 22:33:09 +02:00
Lior Halphon
f4a364c3db It seems like STAT’s LYC flag should be on while the screen is off. 2017-02-21 21:31:52 +02:00
Lior Halphon
fed3b4f9cd Symbolicate LDH instructions 2017-02-21 21:31:22 +02:00
Lior Halphon
aca7687edd Fixed a bug where LYC would be compared to the wrong value in the first cycle of a frame 2017-02-20 22:52:34 +02:00
Lior Halphon
b0dfb8c5ac Added built-in IO-Register symbols 2017-02-20 14:37:15 +02:00
Lior Halphon
91513ced22 Minor adjustment to LCD timing after enabling it. 2017-02-20 14:20:45 +02:00
Lior Halphon
399e88d5fe STAT timing and LCD interrupts rewritten, should be more accurate. 2017-02-19 02:22:50 +02:00
Lior Halphon
74d00b84b7 Treat STOP as a 2-byte instruction 2017-02-17 00:21:02 +02:00
Lior Halphon
6b1363e96e Fixed: Writing to 3XXX in MBC5 before writing to 2XXX no longer switches to the wrong bank. 2017-02-16 23:13:55 +02:00
Lior Halphon
421d3b27f5 Correct emulation of HUC1 banks higher than 0x1F 2017-02-16 21:07:35 +02:00
Lior Halphon
10ab2b4fe0 Fixed typo in the disassembler. 2017-02-16 20:51:32 +02:00
Lior Halphon
86837761fa Improved compatibility with SameBoy's boot ROM by removing the RAM bank switch (The original boot ROM does that for no reason, but eventually switches back to bank 1) 2017-02-15 22:37:43 +02:00
Lior Halphon
3fbc2c5716 DI should not be delayed. 2017-02-15 19:04:53 +02:00
Lior Halphon
4b6fda0cb6 Simplified HDMA and fixed the reading of the HDMA5 register 2017-02-08 21:58:15 +02:00
Lior Halphon
d5c9a52337 Fixed: HDMA registers were not being updated during transfer 2017-02-07 00:24:26 +02:00
Lior Halphon
7ee96766b6 Updated documents to refer to the new website 2017-02-05 21:50:46 +02:00
Lior Halphon
cfe0e55df8 Updated change log and incremented version to 0.8 2017-02-05 21:13:42 +02:00
Lior Halphon
a17213d89c Fixed SDL compilation on macOS Sierra 2017-02-04 19:00:48 +02:00
Lior Halphon
eed8a06fc0 Several fixes to the help command 2017-02-04 19:00:31 +02:00
Lior Halphon
57c73c8a51 Fixed the help command for the disassemble command 2017-02-04 17:49:22 +02:00
Lior Halphon
6f94664428 Close Open Panels if a document is opened via other means 2017-01-24 23:10:50 +02:00
Lior Halphon
a5f72627fe Cocoa key bindings now based on key codes 2017-01-24 21:00:56 +02:00
Tim Allen
dd76846cf2 Update to v102r02 release.
byuu says:

Changelog:

  - I caved on the `samples[] = {0.0}` thing, but I'm very unhappy about it
      - if it's really invalid C++, then GCC needs to stop accepting it
        in strict `-std=c++14` mode
  - Emulator::Interface::Information::resettable is gone
  - Emulator::Interface::reset() is gone
  - FC, SFC, MD cores updated to remove soft reset behavior
  - split GameBoy::Interface into GameBoyInterface,
    GameBoyColorInterface
  - split WonderSwan::Interface into WonderSwanInterface,
    WonderSwanColorInterface
  - PCE: fixed off-by-one scanline error [hex_usr]
  - PCE: temporary hack to prevent crashing when VDS is set to < 2
  - hiro: Cocoa: removed (u)int(#) constants; converted (u)int(#)
    types to (u)int_(#)t types
  - icarus: replaced usage of unique with strip instead (so we don't
    mess up frameworks on macOS)
  - libco: added macOS-specific section marker [Ryphecha]

So ... the major news this time is the removal of the soft reset
behavior. This is a major!! change that results in a 100KiB diff file,
and it's very prone to accidental mistakes!! If anyone is up for
testing, or even better -- looking over the code changes between v102r01
and v102r02 and looking for any issues, please do so. Ideally we'll want
to test every NES mapper type and every SNES coprocessor type by loading
said games and power cycling to make sure the games are all cleanly
resetting. It's too big of a change for me to cover there not being any
issues on my own, but this is truly critical code, so yeah ... please
help if you can.

We technically lose a bit of hardware documentation here. The soft reset
events do all kinds of interesting things in all kinds of different
chips -- or at least they do on the SNES. This is obviously not ideal.
But in the process of removing these portions of code, I found a few
mistakes I had made previously. It simplifies resetting the system state
a lot when not trying to have all the power() functions call the reset()
functions to share partial functionality.

In the future, the goal will be to come up with a way to add back in the
soft reset behavior via keyboard binding as with the Master System core.
What's going to have to happen is that the key binding will have to send
a "reset pulse" to every emulated chip, and those chips are going to
have to act independently to power() instead of reusing functionality.
We'll get there eventually, but there's many things of vastly greater
importance to work on right now, so it'll be a while. The information
isn't lost ... we'll just have to pull it out of v102 when we are ready.

Note that I left the SNES reset vector simulation code in, even though
it's not possible to trigger, for the time being.

Also ... the Super Game Boy core is still disconnected. To be honest, it
totally slipped my mind when I released v102 that it wasn't connected
again yet. This one's going to be pretty tricky to be honest. I'm
thinking about making a third GameBoy::Interface class just for SGB, and
coming up with some way of bypassing platform-> calls when in this
mode.
2017-01-23 08:04:26 +11:00
Lior Halphon
9779635c34 Added NSSupportsAutomaticGraphicsSwitching to Cocoa's Info.plist 2017-01-22 22:25:15 +02:00
Lior Halphon
7a9377de34 Fixed compilation issues under more recent Xcode versions 2017-01-22 21:53:52 +02:00
Lior Halphon
430b733da6 Disabled Quick Look preview/thumbnail cancelation. It seems that the API sometime return true for no reason, and documentation of QL APIs is extremely poor. 2017-01-22 21:04:10 +02:00
Lior Halphon
0d8244748c Fixed icon alignment 2017-01-22 00:37:25 +02:00
Lior Halphon
a012d721a3 Added a Preview generator for Quick Look, so QL framework won't "ban" our plugin for failing to generate these. 2017-01-22 00:10:27 +02:00
Lior Halphon
517e72f92b Printer compression support 2017-01-20 23:00:02 +02:00
Lior Halphon
8cd82ebb68 Quick Look icon generation for GameBoy ROMs, using screenshots from the actual ROMs 2017-01-20 18:35:20 +02:00
Lior Halphon
8d5bacf6ae Updated Cocoa cartridge icons 2017-01-20 18:16:45 +02:00
Lior Halphon
5dcc8e744e Fixed a crash in the Cocoa port that might happen after closing GameBoy Camera 2017-01-14 19:45:07 +02:00
Lior Halphon
613d3b2e82 Printer support in Cocoa 2017-01-13 22:26:44 +02:00
Lior Halphon
527ae01e0e Printer API, compression not supported yet 2017-01-13 22:20:11 +02:00
Lior Halphon
cd382ef236 Fixed: Conditional read watchpoints crashed if the expression referred to the 'new' variable. Breakpoint and watchpoint conditions no longer trigger watchpoints. 2017-01-12 23:11:26 +02:00
Lior Halphon
8c14ec3268 An interrupt should also occur when using external clock. 2016-11-13 00:42:05 +02:00
Lior Halphon
22c34e1095 Serial API 2016-11-12 01:58:53 +02:00
Lior Halphon
15f6412581 Update README.md 2016-10-29 22:54:32 +03:00
Lior Halphon
388fb600de Added VRAM-debugging APIs, added VRAM viewer to Cocoa Port, fixed uninitialized VRAM, fixed memory viewer crash 2016-10-27 00:23:24 +03:00
Lior Halphon
47aaf44017 Rumble API 2016-10-22 15:37:03 +03:00
Lior Halphon
2d51d13479 Various optimizations 2016-10-22 02:18:29 +03:00
Lior Halphon
1b8832a7ff Added disassemble command 2016-10-19 23:55:23 +03:00
Lior Halphon
ee51dec20e Added modifier syntax to debugger: Changed watch's syntax, added format modifier to print/eval, added count option to examine command. 2016-10-19 23:48:46 +03:00
Lior Halphon
18ec502cfe Fine tuning the stack-overflow tester detection 2016-10-18 02:35:21 +03:00
Lior Halphon
edf93abff1 According to Mooneye's test ROMs, this behavior does not happen on a CGB 2016-10-18 00:31:07 +03:00
Lior Halphon
11f8c41305 Basic HUC3 support 2016-10-17 18:51:43 +03:00
Lior Halphon
3fc4fcc538 Added a custom automation combo for Tsuri Sensei, to avoid an in-game buffer-overflow 2016-10-14 01:30:54 +03:00
Lior Halphon
9ca7540c69 Fixed dereferencing a non-banked address in the debugger 2016-10-14 01:19:39 +03:00
Lior Halphon
5cca2a4168 Be more forgiving about stack overflows. Some games commercially leak stack every once in a while when being stress-tested. 2016-10-11 14:53:54 +03:00
Lior Halphon
fa35869bc4 Implemented DMG STAT-write interrupt bug, fixed Road Rash and Zero no Densetsu (These game do not work on CGBs) 2016-10-11 13:37:43 +03:00
Lior Halphon
11cbe58eb1 False positive corrections 2016-10-05 23:57:19 +03:00
Lior Halphon
76c795a966 Whoops. 2016-10-04 04:01:06 +03:00
Lior Halphon
90b7383df7 The camera's get pixel callback must return the same value for every coordinate until a new photo is taken. 2016-10-03 23:05:47 +03:00
Lior Halphon
2d06599a85 Edge enhancement support 2016-10-03 19:39:20 +03:00
Lior Halphon
8941504863 Refinements to camera support according to AntonioND's docs 2016-10-03 18:24:15 +03:00
Lior Halphon
dd23fffcc0 Proper (I believe) emulation of most GameBoy Camera registers 2016-10-03 14:22:54 +03:00
Lior Halphon
2a84d62187 Forbid reading the image while the camera is busy 2016-10-03 01:29:54 +03:00
Lior Halphon
b50b38c78a GameBoy Camera support in Cocoa 2016-10-03 00:26:12 +03:00
Lior Halphon
479a64dca6 Dither using a pattern, closer to actual GameBoy Camera 2016-10-02 23:36:20 +03:00
Lior Halphon
de7c15fc68 Another camera API bugfix 2016-10-02 18:33:33 +03:00
Lior Halphon
9c68ac1419 Camera API bugfix 2016-10-02 18:14:05 +03:00
Lior Halphon
ab5f66795a Gameboy Camera API 2016-10-02 17:14:58 +03:00
Lior Halphon
b3b041a151 Basic GB Camera support (Emulate only MBC, enough for the ROM to boot). 2016-10-02 03:40:11 +03:00
Lior Halphon
9b71454f07 Basic HUC1 support (Emulated as MBC1) 2016-10-02 02:15:03 +03:00
Lior Halphon
58a4081b48 Improved open performance in Cocoa 2016-10-02 00:10:31 +03:00
Lior Halphon
21b91adf6a Improved open-dialog behavior in Cocoa 2016-10-02 00:10:09 +03:00
Lior Halphon
4904277f0d Corrected behavior of palette registers in DMG mode. This affected a broken Game & Watch Gallery 2 ROM that was previously used in the automation test. 2016-10-01 22:10:44 +03:00
Lior Halphon
80a1b12ae7 Added palette command to the debugger 2016-10-01 22:08:34 +03:00
Lior Halphon
3dd1580256 Automation triggered a bug in DX Bakenou, fixed false positive. 2016-10-01 14:31:34 +03:00
Lior Halphon
4a2bec239a MBC2 RAM support was completely broken. 2016-09-30 23:34:06 +03:00
Lior Halphon
17748b980a Fixed a false positive with the FF-loop detection 2016-09-30 18:24:01 +03:00
Lior Halphon
5c5b1cd3ae Seems like even 1 second isn't enough for some games. 2016-09-30 14:12:41 +03:00
Lior Halphon
4f9b86c900 Make Github not count HexFiend into the language stats. 2016-09-30 13:51:59 +03:00
Lior Halphon
7bf9cc8f1a Detect blank screens by actual screen content, as some games modify LCDC between vblanks. 2016-09-30 01:10:50 +03:00
Lior Halphon
5565c096c7 Misc optimizations, especially for the tester 2016-09-30 01:09:44 +03:00
Lior Halphon
3ac3eccebb Bugfix: Multiple watchpoints did not work correctly and conflicted with breakpoints 2016-09-30 01:09:17 +03:00
Lior Halphon
258500bda3 Merge branch 'master' into rateless_apu 2016-09-23 18:53:38 +03:00
Lior Halphon
52ed2ca55e Corrected BG enable's behavior (Fixes visual glitch with Krusty's Funhouse) 2016-09-23 18:30:07 +03:00
Lior Halphon
42c01a21b2 Fixed crash when accessing MBC RAM on a cartridge that "has RAM", but it's 0-sized. 2016-09-22 01:52:40 +03:00
Lior Halphon
0991705379 Refined HALT bug behavior, fixed Robocop 2016-09-22 01:51:09 +03:00
Lior Halphon
bc3cab7dfa Forbid pressing two opposing direction keys. Fixes Pocket Bomberman (U). 2016-09-21 02:15:02 +03:00
Lior Halphon
252439c1af Fixed a deadlocking race condition that might happen when reading APU memory in the hex viewer 2016-09-21 01:59:43 +03:00
Lior Halphon
c40b86d4a4 Merge branch 'master' into rateless_apu 2016-09-21 00:23:59 +03:00
Lior Halphon
6f2b36cacb The HALT bug also happens on CGBs, regardless of DMG mode. 2016-09-20 22:59:25 +03:00
Lior Halphon
97eb3fe209 Detect games stuck on blank screens 2016-09-20 22:59:00 +03:00
Lior Halphon
f88c9d299b Merge branch 'master' into rateless_apu 2016-09-20 20:05:03 +03:00
Lior Halphon
f46414b7b1 Updated struct version :( 2016-09-20 20:04:38 +03:00
Lior Halphon
37e895352f Volumes no longer doubles 2016-09-20 19:58:30 +03:00
Lior Halphon
a026f8b26d Update README.md 2016-09-20 01:45:02 +03:00
Lior Halphon
f049284324 Emulate the HALT bug on a DMG 2016-09-20 01:22:21 +03:00
Lior Halphon
1a3a96762b CPU cleanup 2016-09-18 23:50:04 +03:00
Lior Halphon
ed31358934 Forgot to emulate LCDC bit 0! 2016-09-18 21:00:05 +03:00
Lior Halphon
fe51805ed7 Incorrect constant name 2016-09-16 18:24:38 +03:00
Lior Halphon
f4c5cf20bc Cleanup of ret_cc 2016-09-16 13:27:32 +03:00
Lior Halphon
71d4ba21f2 Added a tick-counting debugger command 2016-09-16 11:58:31 +03:00
Lior Halphon
4beb946468 Slight APU optimization 2016-09-14 22:49:35 +03:00
Tim Allen
45a725e4b7 Update to v101r18 release.
byuu says:

Changelog:

  - added 30 new PAL games to icarus (courtesy of Mikerochip)
  - new version of libco no longer requires mprotect nor W|X permissions
  - nall: default C compiler to -std=c11 instead of -std=c99
  - nall: use `-fno-strict-aliasing` during compilation
  - updated nall/certificates (hopefully for the last time)
  - updated nall/http to newer coding conventions
  - nall: improve handling of range() function

I didn't really work on higan at all, this is mostly just a release
because lots of other things have changed.

The most interesting is `-fno-strict-aliasing` ... basically, it joins
`-fwrapv` as being "stop the GCC developers from doing *really* evil
shit that could lead to security vulnerabilities or instabilities."

For the most part, it's a ~2% speed penalty for higan. Except for the
Sega Genesis, where it's a ~10% speedup. I have no idea how that's
possible, but clearly something's going very wrong with strict aliasing
on the Genesis core.

So ... it is what it is. If you need the performance for the non-Genesis
cores, you can turn it off in your builds. But I'm getting quite sick of
C++'s "surprises" and clever compiler developers, so I'm keeping it on
in all of my software going forward.
2016-09-14 21:55:53 +10:00
Lior Halphon
f274cbc2ec Read wave form while playing 2016-09-13 17:40:10 +03:00
Lior Halphon
594aea2d5a APU is now being run lazily 2016-09-13 17:33:48 +03:00
Lior Halphon
eefc998e43 Removed for loop in APU 2016-09-13 17:06:35 +03:00
Lior Halphon
ff7b8a6854 Removed doubles, reorganized code a bit 2016-09-13 16:57:16 +03:00
Lior Halphon
b95860c034 Making the APU independent of sample rate 2016-09-13 16:55:26 +03:00
Lior Halphon
43be91f032 Slightly more readable code. 2016-09-13 01:20:18 +03:00
Lior Halphon
71a9b7eb77 Updated change log and incremented version to 0.7 2016-09-10 20:59:02 +03:00
Lior Halphon
6e86dbcebb Cocoa port now shows the open dialog if no ROM is open. 2016-09-10 19:46:42 +03:00
Lior Halphon
95cfb114a2 Properly setting MBC RAM 2016-09-10 13:25:18 +03:00
Lior Halphon
6d836b9f48 Fixed APU bug that prevented some games from working 2016-09-10 02:20:44 +03:00
Lior Halphon
ad604036a5 More false-negative fixes 2016-09-09 19:29:14 +03:00
Lior Halphon
7bafb6a843 Cocoa port: remember breakpoints and watchpoints after reset 2016-09-07 00:44:00 +03:00
Lior Halphon
62ecadeb57 Fixed another reset-while-debugging deadlock in Cocoa 2016-09-07 00:37:11 +03:00
Lior Halphon
01fc137256 Fixed an APU issue that might occur when having more than one GB_gameboy_t object 2016-09-06 22:36:16 +03:00
Lior Halphon
ae003ee020 Fixed several automation false negatives. 2016-09-06 18:00:05 +03:00
Lior Halphon
603b8969ab Correct (disconnected) serial emulation. 2016-09-06 13:13:14 +03:00
Lior Halphon
ab2e532cc3 Added link to automation results 2016-09-03 23:24:47 +03:00
Lior Halphon
84a4701733 Auto-detect common crashes, fixed logs about unsupported carts not being written. 2016-09-03 22:59:23 +03:00
Lior Halphon
a6c5a8fdaa Fixed a bug that caused the Cocoa port to freeze sometimes if the emulator was reset while debugging. 2016-09-03 13:34:49 +03:00
Lior Halphon
a2d77b1754 Warn about unsupported cartridges/MBCs 2016-09-03 04:00:37 +03:00
Lior Halphon
a746c726ee Added basic automatic ROM tester 2016-09-03 03:39:32 +03:00
Lior Halphon
833cd88aea Allow compilation with precompiled boot ROMs. 2016-08-27 01:30:11 +03:00
Lior Halphon
ee4907949b Support for RTC latching. Fixes #4. 2016-08-21 22:33:57 +03:00
Lior Halphon
92c2b22735 Cocoa port now remembers the mute switch 2016-08-21 21:58:33 +03:00
Lior Halphon
33da8734fe Mouse hiding is now only enabled during full screen mode 2016-08-21 00:38:26 +03:00
Lior Halphon
9479fce7d0 Update README.md 2016-08-20 23:05:13 +03:00
Lior Halphon
0420538034 Update README.md 2016-08-20 23:03:28 +03:00
Lior Halphon
276fe53385 Added icon and version information to Windows port 2016-08-20 22:59:03 +03:00
Lior Halphon
44dfb60c9c Updated README 2016-08-20 18:15:15 +03:00
Lior Halphon
e7626535a8 Initial Windows support 2016-08-20 17:51:17 +03:00
Lior Halphon
0734e990b3 Memory viewer now has a Goto command, different memory space modes, and allows viewing/editing specific banks 2016-08-19 14:54:54 +03:00
Lior Halphon
f9236d12bf Improvements to the help command and general debugger usability. 2016-08-13 22:52:41 +03:00
Lior Halphon
e79ddee705 Basic memory hex viewer/editor, using a (heavily stripped down) HexFiend framework 2016-08-13 00:58:52 +03:00
Lior Halphon
806d0775a4 Added backtrace command to debugger 2016-08-09 22:48:53 +03:00
Lior Halphon
a5670b6643 Fixed boot ROM trimming 2016-08-07 00:39:32 +03:00
Lior Halphon
109af49933 Updated DMG boot ROM to finish with the same register values as the original boot ROM 2016-08-06 19:11:54 +03:00
Lior Halphon
bebb5c7a41 Correctly emulating the unused OAM memory in DMG mode 2016-08-06 18:58:44 +03:00
Lior Halphon
cc8664b0a8 Correctly emulating a disconnected serial cable 2016-08-06 18:57:33 +03:00
Lior Halphon
af10e07ed7 Initing OBP0/1 correctly 2016-08-06 18:57:13 +03:00
Lior Halphon
5816b6a688 Updated change log and incremented version to 0.6 2016-08-06 17:16:39 +03:00
Lior Halphon
e95d2c4abe Fixed DI instruction on CGB 2016-08-06 17:16:38 +03:00
Lior Halphon
68740c70e4 Stripping executables on release to reduce file size 2016-08-06 16:19:04 +03:00
Lior Halphon
722550c5bc Enabled link time optimization when building in release, improving speed by about 6% 2016-08-06 16:18:23 +03:00
Lior Halphon
553f700b79 Fixed needless deep generation, which caused errors when compiling the Cocoa GUI when SDL is not installed 2016-08-06 15:57:32 +03:00
Lior Halphon
d03a1fbd16 Fixed TMA writing while reloading. 2016-08-06 14:36:33 +03:00
Lior Halphon
85a33ed8ef Emulating DMA delay correctly 2016-08-06 14:24:43 +03:00
Lior Halphon
4a50000e83 Corrected timing for many instructions 2016-08-06 14:00:35 +03:00
Lior Halphon
8dd5462525 Correct DMA timing 2016-08-06 13:57:38 +03:00
Lior Halphon
0f98ac5ff9 Emulate TIMA reloading 2016-08-06 13:56:29 +03:00
Lior Halphon
55cbe5d4d0 Accuracy improvements to timers 2016-08-06 00:24:12 +03:00
Lior Halphon
d098458ee4 Major improvements to accuracy: Fixed instruction timing, DMA timing, and IO reg masking. Passes most of mooneye-gb acceptance tests. 2016-08-05 16:36:38 +03:00
Lior Halphon
47e3300b66 Improved DMA accuracy, mooneyegb test ROMs no longer crash miserably. (but still fail) 2016-08-03 23:31:10 +03:00
Lior Halphon
fad1007427 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2016-08-03 22:28:28 +03:00
Lior Halphon
e6d4cac00e Fix logical bug when changing watchpoint flags 2016-07-21 15:20:25 +03:00
Lior Halphon
185e71fe12 Improvements to IR API, since timing is VERY important 2016-07-21 01:03:13 +03:00
Lior Halphon
b740b7f3ba Fixed Cocoa memory leak 2016-07-20 23:52:29 +03:00
Lior Halphon
1d35c04ab1 Infrared API 2016-07-18 22:11:18 +03:00
Lior Halphon
0fbc72f197 SDL save states 2016-07-18 14:37:06 +03:00
Lior Halphon
da0911d69b Fixed SDL crash 2016-07-18 14:30:21 +03:00
Lior Halphon
b30822fd0b Async commands in SDL port, better handling of ^C and ^D 2016-07-18 13:10:19 +03:00
Lior Halphon
aa6438fa06 Async debugger commands 2016-07-18 00:46:45 +03:00
Lior Halphon
67f3a3a9d8 Symbol support in SDL port 2016-07-17 23:08:07 +03:00
Lior Halphon
9d53760016 Fixing Linux build 2016-07-17 22:43:23 +03:00
Lior Halphon
a68b06226a Fixed crash on free 2016-07-15 23:20:14 +03:00
Lior Halphon
eaca0634aa Reading and writing absolute addresses in the expression evaluator. 2016-07-15 17:06:46 +03:00
Lior Halphon
e20e81befd Symbol support in the expression evaluator 2016-07-15 14:31:27 +03:00
Lior Halphon
c3a831db7d Debugger's pc "variable" now returns a full address 2016-07-14 23:27:48 +03:00
Lior Halphon
909f3ba75e Bank-specific breakpoints and watchpoints 2016-07-14 23:25:16 +03:00
Lior Halphon
ce837b3727 Bank-specific examine support 2016-07-14 21:15:24 +03:00
Lior Halphon
65f37bccbd Initial 25-bit debugger values support 2016-07-14 21:01:45 +03:00
Lior Halphon
ea082b777d ...And another crash 2016-07-14 01:46:55 +03:00
Lior Halphon
f6b10ed439 Operators priorities were inverted! 2016-07-13 23:51:46 +03:00
Lior Halphon
46714108ac ...And a crash. 2016-07-13 23:46:18 +03:00
Lior Halphon
c3f1eb26b1 Fixed potential overflow 2016-07-13 23:07:36 +03:00
Lior Halphon
d49404d248 Debugger can now read .sym files, and display them. (No expression support yet) 2016-07-13 23:00:50 +03:00
Lior Halphon
e9b3a38171 Uniform syntax for debugger input and output 2016-07-12 23:30:18 +03:00
Lior Halphon
bd7f8f2555 Support for an alternative MBC1 wiring, should solve most N-in-1 carts (Issue #3) 2016-07-09 19:25:25 +03:00
Lior Halphon
c6bafe3fc3 Rewrote MBC support 2016-07-09 17:34:55 +03:00
Lior Halphon
78a809795e Renaming MBC constants 2016-07-09 14:45:25 +03:00
Lior Halphon
b4208be4f4 Multiple watchpoints were broken 2016-07-09 14:37:11 +03:00
Lior Halphon
de4983099a Added (conditional) r/w watchpoints. Fixed a bug where breakpoint condition syntax is not checked. Added != operator. 2016-07-07 00:29:25 +03:00
Lior Halphon
dce0e5fdeb Hide mouse cursor when running (Cocoa) 2016-07-05 23:34:33 +03:00
Lior Halphon
1268bf3a35 Keeping aspect ratio is now optional (but default) 2016-07-05 21:23:55 +03:00
Lior Halphon
c9d4a4ebb5 Proper fullscreen support (Including Yosemite and older) 2016-07-03 21:32:58 +03:00
Lior Halphon
39f91f0dd6 Proportional Reiszing 2016-07-03 20:58:25 +03:00
Lior Halphon
9321df9630 Prevent the Cocoa port from being both "paused" and "debug_paused" 2016-07-02 20:58:06 +03:00
Lior Halphon
cc9af4a5c5 Updated change log and incremented version to 0.5 2016-07-01 20:57:50 +03:00
Lior Halphon
19aea4096b Added condition breakpoint. Fixed a possible crash when deleting a breakpoint. 2016-07-01 18:24:21 +03:00
Lior Halphon
8eee70aed9 Fixed disassembler bugs 2016-07-01 18:04:25 +03:00
Lior Halphon
79fd9ed6ad Added boolean operators to the debugger 2016-07-01 13:12:04 +03:00
Lior Halphon
70bd90740a Mass name and type changes. Save states are now compatible between 32- and 64-bit systems. Maybe. 2016-06-18 20:29:11 +03:00
Lior Halphon
32a1ad87b7 Fixed a bug where a Cocoa emulator window will appear frozen (or partially frozen) until resized 2016-06-18 17:48:24 +03:00
Lior Halphon
180f0e16b0 Cocoa port now remembers the previous window size 2016-06-18 17:43:39 +03:00
Lior Halphon
b99ed2676a Use NSThread instead of GDC when invoking run 2016-06-18 17:20:40 +03:00
Lior Halphon
64832e0e9e HDMA accuracy improvement 2016-06-18 16:51:25 +03:00
Lior Halphon
d58ddef07b Proper initial value for the Joypad register 2016-06-18 15:01:51 +03:00
Lior Halphon
07c5e8fcb1 Fixed smooth bilinear filter 2016-06-18 02:05:52 +03:00
Lior Halphon
7e8d5fe57c Updated SCALING.md 2016-06-18 00:01:51 +03:00
Lior Halphon
846a9318ba Added anti aliasing to OmniScale. Fixed color differentiation for HQ2x and OmniScale 2016-06-17 23:47:41 +03:00
Lior Halphon
5723b82293 Fixed graphical glitches caused by the last change to LCDC emulation 2016-06-17 02:27:32 +03:00
Lior Halphon
6f73ee053d The old OmniScale filter became OmniScale Legacy. A new OmniScale filter was added instead. 2016-06-17 01:06:52 +03:00
Lior Halphon
e6c4b4d1b2 Seems like I forgot to finish implementing the stop instruction! 2016-06-14 14:12:13 +03:00
Lior Halphon
52afba21d1 Added HQ2x shader, upgrading to OpenGL 3 2016-06-14 14:11:37 +03:00
Lior Halphon
8153b765a2 General cleanup. Minor fixes to LCD Controller accuracy. 2016-06-12 19:39:05 +03:00
Lior Halphon
d7d8da3fa9 More accurate emulation of the SCX register 2016-06-11 17:58:00 +03:00
Lior Halphon
b7e999b242 Modified saved data to be more future-compatible. 2016-06-11 17:49:42 +03:00
Lior Halphon
36d46567ba Updated change log and incremented version to 0.4 2016-06-10 18:07:39 +03:00
Lior Halphon
6c7dd761e2 Fixed a crash related to adding and deleting breakpoints 2016-06-10 18:03:12 +03:00
Lior Halphon
ee7e58e44b Fixed a bug introduced by the last STAT fix. This restores GBVideoPlayer support. 2016-06-10 17:29:49 +03:00
Lior Halphon
759b497c07 Fixed bug introduced by the stereo support 2016-06-10 16:38:20 +03:00
Lior Halphon
aca5873de2 More accurate STAT interrupt. This fixes Altered Space and partially fixes Pinball Deluxe. It breaks GBVideoPlayer, however. 2016-06-10 16:31:57 +03:00
Lior Halphon
3e1863ec51 Battery save support in the SDL version 2016-06-10 15:48:40 +03:00
Lior Halphon
6bc64a9902 Added stereo support. Correct some PCM register behavior. 2016-06-10 15:28:50 +03:00
Lior Halphon
4d8f2cfac8 Added missing -framework Carbon 2016-06-09 18:22:47 +03:00
Lior Halphon
c27ee9d879 Fixed a bug in the Cocoa port that made SameBoy ignore some input keys when the keyboard layout is set to a non-Latin/ASCII keyboard. This was solved by forcing an ASCII layout. 2016-06-09 00:37:00 +03:00
Lior Halphon
94ea44da0c Introducing the OmniScale (beta) algorithm to SameBoy 2016-06-09 00:06:55 +03:00
Lior Halphon
8a3e0c3f24 Merge branch 'master' of https://github.com/LIJI32/SameBoy 2016-06-04 17:39:16 +03:00
Lior Halphon
da65b4e90d Audio support for the SDL port 2016-05-23 22:22:09 +03:00
Lior Halphon
8d59bfcbdd Filter support for Cocoa port + 7 basic filters 2016-04-29 00:45:56 +03:00
Lior Halphon
dde983db8f Updated change log and incremented version to 0.3 2016-04-16 15:21:22 +03:00
Lior Halphon
79e4c22c6b Fixed string in MBC command 2016-04-16 15:18:40 +03:00
Lior Halphon
0fa2d6ea2f Prevent creating .sav files for ROMs claiming they have a battery but have no cartridge RAM or RTC 2016-04-16 14:09:56 +03:00
Lior Halphon
7dc575d01e Fixed a bug where audio channel 3 was playing silently instead of being muted. 2016-04-16 14:08:30 +03:00
Lior Halphon
ddc9605271 Load DMG's tilemap for specific games in the CGB boot (Fixes X's title screen and an unknown game with title checksum $43) 2016-04-16 13:50:29 +03:00
Lior Halphon
d63a801821 Fixed a mistake that made the CGB boot ROM not initialize the wave pattern. Closes #2. 2016-04-15 22:09:06 +03:00
Lior Halphon
b8bc84db4e Corrected read of HDMA5, fixing A Bug's Life 2016-04-15 01:26:48 +03:00
Lior Halphon
4a05c4243d Corrected description for the breakpoint command 2016-04-13 22:48:07 +03:00
Lior Halphon
2a5375a0c8 Configurable keys for the Cocoa port 2016-04-13 22:43:16 +03:00
Lior Halphon
8dd1b3c854 Added (experimental) stack-leak and stack-overflow detection command to the debugger. 2016-04-10 23:22:54 +03:00
Lior Halphon
71ef40f4b6 "Standardized" the finish/next call depth as debugger "hooks" 2016-04-10 22:36:54 +03:00
Lior Halphon
bf6dff30cb Corrected debugger's finish behavior's on interrupt handlers 2016-04-10 20:58:14 +03:00
Lior Halphon
0a09fba091 Correcting DIV and TIMA speed in CGB's double speed mode 2016-04-09 16:48:37 +03:00
Lior Halphon
de95e6f6fc Fixed incorrect DMA validity check, fixing The Smurfs 3 2016-04-09 15:00:29 +03:00
Lior Halphon
80d03f3c91 Added ROM-bank wrapping support, making bootleg game "Pocket Monster Adventures" boot.
(Although this game is better not booting)
2016-04-09 02:18:09 +03:00
Lior Halphon
a3b44d20cb Added mbc/cartridge command to debugger 2016-04-09 02:00:10 +03:00
Lior Halphon
6fd2daae06 Added changelog, updated version to 0.2 2016-04-08 14:05:21 +03:00
Lior Halphon
c97033b81c Console output is now configurable in the Cocoa port as "Developer Mode" 2016-04-08 13:54:34 +03:00
Lior Halphon
d580a33a7f Save user's preferences in the Cocoa port 2016-04-08 13:10:01 +03:00
Lior Halphon
d5a13900dd Missing </body> in Cocoa's License.html 2016-04-08 12:41:41 +03:00
Lior Halphon
448e46ddce Support for PCM_12 and PCM_34 in SDL port 2016-04-08 12:37:09 +03:00
Lior Halphon
f448865b8a Silently ignoring empty lines 2016-04-08 01:53:21 +03:00
Lior Halphon
1069637e45 Added support for multiple breakpoints 2016-04-07 00:25:41 +03:00
Lior Halphon
eb3e0eaa1e Pause the debugger on SIGINT in the SDL port 2016-04-06 22:58:30 +03:00
Lior Halphon
1c2af7fa5b Fixed the default debugger input to strip new lines, fixing the debugger in SDL 2016-04-06 22:57:37 +03:00
Lior Halphon
eb0b642247 Improved debugger command style and usability, made code more flexible 2016-04-06 01:43:35 +03:00
Lior Halphon
3e135a7c00 More accurate emulation of the DMG-emulation-mode registers. 2016-04-05 23:21:51 +03:00
Lior Halphon
cda6621dc2 Fixed mask for TAC and STAT 2016-04-04 22:12:00 +03:00
Lior Halphon
af7309b98d Moved the call to display_run to advance_cycle.
This fixes games with delicate timings such as X/Ekkusu, that expect STAT to change *during* an opcode.
2016-04-02 19:15:07 +03:00
Lior Halphon
0787e5b271 Debugger's next command can now exit a function 2016-04-02 19:06:43 +03:00
Lior Halphon
b7555e9976 Correct OAM interrupt behavior 2016-04-02 16:29:27 +03:00
Lior Halphon
da00e240e5 Correct read of IF and write of IE 2016-04-02 16:29:02 +03:00
Lior Halphon
8ff433bb97 Remove useless key from plist 2016-04-02 12:51:07 +03:00
Lior Halphon
cc8a09763f Version 0.1 2016-04-01 23:36:43 +03:00
Lior Halphon
1538ad451c Copy the license to the SDL build directory 2016-04-01 23:29:03 +03:00
Lior Halphon
abfebf0eb2 Added debug/release configurations 2016-04-01 22:53:29 +03:00
Lior Halphon
1a66f26a5e Added readme 2016-04-01 22:25:26 +03:00
Lior Halphon
e11faaf3fb Added license and copyright 2016-04-01 22:13:05 +03:00
Lior Halphon
a3dd58c92c Fixed inaccurate LCD controller behavior that caused Pokémon Pinball to freeze. 2016-04-01 21:27:16 +03:00
Lior Halphon
3344480de7 Vblank now returns a white screen if LCD is off, instead of keeping the buffer unmodified. 2016-04-01 21:27:16 +03:00
Lior Halphon
e822f17bb7 Wrapping external RAM banking support. Required for Pokémon Pinball's saves. 2016-04-01 21:27:16 +03:00
Lior Halphon
ec8823e620 Cocoa port can now enter an empty line in the debugger to repeat the previous command 2016-04-01 21:27:15 +03:00
Lior Halphon
f1e9623371 Initial public commit 2016-04-01 21:27:01 +03:00
Tim Allen
750af6ebc3 Update to v096r02 (OS X Preview for Developers) release.
byuu says:

Warning: this is not for the faint of heart. This is a very early,
unpolished, buggy release. But help testing/fixing bugs would be greatly
appreciated for anyone willing.

Requirements:
- Mac OS X 10.7+
- Xcode 7.2+

Installation Commands:

    cd higan
    gmake -j 4
    gmake install
    cd ../icarus
    gmake -j 4
    gmake install

(gmake install is absolutely required, sorry. You'll be missing key
files in key places if you don't run it, and nothing will work.)

(gmake uninstall also exists, or you can just delete the .app bundles
from your Applications folder, and the Dev folder on your desktop.)

If you want to use the GBA emulation, then you need to drop the GBA BIOS
into ~/Emulation/System/Game\ Boy\ Advance.sys\bios.rom

Usage:
You'll now find higan.app and icarus.app in your Applications folders.
First, run icarus.app, navigate to where you keep your game ROMs. Now
click the settings button at the bottom right, and check "Create
Manifests", and click OK. (You'll need to do this every time you run
icarus because there's some sort of bug on OSX saving the settings.) Now
click "Import", and let it bring in your games into ~/Emulation.

Note: "Create Manifests" is required. I don't yet have a pipe
implementation on OS X for higan to invoke icarus yet. If you don't
check this box, it won't create manifest.bml files, and your games won't
run at all.

Now you can run higan.app. The first thing you'll want to do is go to
higan->Preferences... and assign inputs for your gamepads. At the very
least, do it for the default controller for all the systems you want to
emulate.

Now this is very important ... close the application at this point so
that it writes your config file to disk. There's a serious crashing bug,
and if you trigger it, you'll lose your input bindings.

Now the really annoying part ... go to Library->{System} and pick the
game you want to play. Right now, there's a ~50% chance the application
will bomb. It seems the hiro::pListView object is getting destroyed, yet
somehow the internal Cocoa callbacks are being triggered anyway. I don't
know how this is possible, and my attempts to debug with lldb have been
a failure :(

If you're unlucky, the application will crash. Restart and try again. If
it crashes every single time, then you can try launching your game from
the command-line instead. Example:

    open /Applications/higan.app \
	--args ~/Emulation/Super\ Famicom/Zelda3.sfc/

Help wanted:
I could really, really, really use some help with that crashing on game
loading. There's a lot of rough edges, but they're all cosmetic. This
one thing is pretty much the only major show-stopping issue at the
moment, preventing a wider general audience pre-compiled binary preview.
2016-01-07 19:17:15 +11:00
Tim Allen
f0d1b7fa8c Update to v096r01 release.
byuu says:

Changelog:

- restructured the project and removed a whole bunch of old/dead
  directives from higan/GNUmakefile
- huge amounts of work on hiro/cocoa (compiles but ~70% of the
  functionality is commented out)
- fixed a masking error in my ARM CPU disassembler [Lioncash]
- SFC: decided to change board cic=(411,413) back to board
  region=(ntsc,pal) ... the former was too obtuse

If you rename Boolean (it's a problem with an include from ruby, not
from hiro) and disable all the ruby drivers, you can compile an
OS X binary, but obviously it's not going to do anything.

It's a boring WIP, I just wanted to push out the project structure
change now at the start of this WIP cycle.
2015-12-30 17:54:59 +11:00
Tim Allen
6b44980c6c Update to v094r29 release.
byuu says:

Note: for Windows users, please go to nall/intrinsics.hpp line 60 and
correct the typo from "DISPLAY_WINDOW" to "DISPLAY_WINDOWS" before
compiling, otherwise things won't work at all.

This will be a really major WIP for the core SNES emulation, so please
test as thoroughly as possible.

I rewrote the 65816 CPU core's dispatcher from a jump table to a switch
table. This was so that I could pass class variables as parameters to
opcodes without crazy theatrics.

With that, I killed the regs.r[N] stuff, the flag_t operator|=, &=, ^=
stuff, and all of the template versions of opcodes.

I also removed some stupid pointless flag tests in xcn and pflag that
would always be true.

I sure hope that AWJ is happy with this; because this change was so that
my flag assignments and branch tests won't need to build regs.P into
a full 8-bit variable anymore.

It does of course incur a slight performance hit when you pass in
variables by-value to functions, but it should help with binary size
(and thus cache) by reducing a lot of extra functions. (I know I could
have used template parameters for some things even with a switch table,
but chose not to for the aforementioned reasons.)

Overall, it's about a ~1% speedup from the previous build. The CPU core
instructions were never a bottleneck, but I did want to fix the P flag
building stuff because that really was a dumb mistake v_v'
2015-06-22 23:31:49 +10:00
Tim Allen
ddffcd7600 Update to v094r28 release.
byuu says:

This WIP substantially restructures the ruby API for the first time
since that project started.

It is my hope that with this restructuring, destruction of the ruby
objects should now be deterministic, which should fix the crashing on
closing the emulator on Linux. We'll see I guess ... either way, it
removed two layers of wrappers from ruby, so it's a pretty nice code
cleanup.

It won't compile on Windows due to a few issues I didn't see until
uploading the WIP, too lazy to upload another. But I fixed all the
compilation issues locally, so it'll work on Windows again with the next
WIP (unless I break something else.)

(Kind of annoying that Linux defines glActiveTexture but Windows
doesn't.)
2015-06-20 15:44:05 +10:00
Tim Allen
81a87a1e01 Update to v093 release.
byuu says:

Changelog:
- added Cocoa target: higan can now be compiled for OS X Lion
  [Cydrak, byuu]
- SNES/accuracy profile hires color blending improvements - fixes
  Marvelous text [AWJ]
- fixed a slight bug in SNES/SA-1 VBR support caused by a typo
- added support for multi-pass shaders that can load external textures
  (requires OpenGL 3.2+)
- added game library path (used by ananke->Import Game) to
  Settings->Advanced
- system profiles, shaders and cheats database can be stored in "all
  users" shared folders now (eg /usr/share on Linux)
- all configuration files are in BML format now, instead of XML (much
  easier to read and edit this way)
- main window supports drag-and-drop of game folders (but not game files
  / ZIP archives)
- audio buffer clears when entering a modal loop on Windows (prevents
  audio repetition with DirectSound driver)
- a substantial amount of code clean-up (probably the biggest
  refactoring to date)

One highly desired target for this release was to default to the optimal
drivers instead of the safest drivers, but because AMD drivers don't
seem to like my OpenGL 3.2 driver, I've decided to postpone that. AMD
has too big a market share. Hopefully with v093 officially released, we
can get some public input on what AMD doesn't like.
2013-08-18 13:21:14 +10:00
Tim Allen
5a09a0476d Update to higan v091 release.
byuu says:

Basically just a project rename, with s/bsnes/higan and the new icon
from lowkee added in.

It won't compile on Windows because I forgot to update the resource.rc
file, and a path transform command isn't working on Windows.
It was really just meant as a starting point, so that v091 WIPs can flow
starting from .00 with the new name (it overshadows bsnes v091, so
publicly speaking this "shouldn't exist" and will probably be deleted
from Google Code when v092 is ready.)
2012-12-26 17:46:36 +11:00
Tim Allen
d9d3ac685a Update to v090 release.
byuu says:

Most notably, this release adds Nintendo DS emulation. The Nintendo DS
module was written entirely by Cydrak, so please give him all of the
credit for it. I for one am extremely grateful to be allowed to use his
module in bsnes.

The Nintendo DS emulator's standalone name is dasShiny. You will need
the Nintendo DS firmware, which I cannot provide, in order to use it. It
also cannot (currently?) detect the save type used by NDS games. As
such, manifest.xml files must be created manually for this purpose. The
long-term plan is to create a database of save types for each game.
Also, you will need an analog input device for the touch screen for now
(joypad axes work well.)

There have also been a lot of changes from my end: a unified
manifest.xml format across all systems, major improvements to SPC7110
emulation, enhancements to RTC emulation, MSU1 enhancements, icons in
the file browser list, improvements to SNES coprocessor memory mapping,
cleanups and improvements in the libraries used to build bsnes, etc.

I've also included kaijuu (which allows launching game folders directly
with bsnes) and purify (which allows opening images that are compressed,
have copier headers, and have wrong extensions); both of which are fully
GUI-based.

This release only loads game folders, not files. Use purify to load ROM
files in bsnes.

Note that this will likely be the last release for a long time, and that
I will probably rename the emulator for the next release, due to how
many additional systems it now supports.
2012-08-08 00:08:37 +10:00
Tim Allen
772fb31ee5 Update to v073r02 release.
byuu says:

Changelog:
- removed bsnes/supergameboy (libgameboy -> libgambatte binding)
- added direct ICD2-R coprocessor emulation
- linked in bgameboy to the ICD2-R module
- Makefile removes -Isnes, all files adjusted from <name.hpp> to
  <snes/name.hpp> [relic from asnes split]

You can now play Super Game Boy games with the core bsnes library.
2011-01-08 21:01:51 +11:00
Tim Allen
648061bb95 Initial commit of bgameboy v000.
The source tarball also included empty obj/ and out/ directories which
git does not support.

byuu says:

Project started, so basically everything is new.

It's basically a rough skeleton that mimics bsnes project structure.
Eventually the src/gameboy folder will be copied into bsnes-official and
used by the chip/supergameboy core.
The middleware layer (supergameboy/interface) will be merged into a new
chip/icd2 folder that will represent direct Super Game Boy emulation in
the future.
At least, if all goes according to plan.

There is a simple GUI that can load ROMs, but do nothing after it. It's
not hooked up to ruby yet.
There is a basic system class and interface to expose the
video/audio/input functions.
There is a basic memory bus that doesn't support any MBCs yet.
There is a CPU skeleton that only handles easy read/write access to the
CPU registers (AF is a really fucked up register.)
The core is not hooked up to libco yet, but I intend for it to be, so
that I can run the CPU + LCD how I like.
If it turns out the LCD+audio is easily enslavable, then I'll probably
drop libco and just run it like a regular emulator, using a thread
wrapper around it in bsnes only. We'll see.

The CPU doesn't actually support any opcodes, and loading a ROM won't
actually execute anything.
2010-12-28 12:53:15 +11:00
Tim Allen
7dcdaef9bd Update to v073 release.
byuu says:

This release marks a major step forward, offering full low-level
emulation of all four DSP coprocessors based on the NEC uPD77C25
processor core. Many people were responsible for this milestone: Dr.
Decapitator for the actual decapping and extraction; Lord Nightmare for
the cartridges and some special analysis tools; myself, Jonas Quinn and
Cydrak for the uPD77C25 emulation; and all of the donors who raised the
necessary $1,000 for the necessary hardware and equipment needed to pull
this all off. To say thanks to the donors, I am releasing the uPD77C25
emulation core to the public domain, so that everyone can benefit from
it.

All four DSP emulations will be improved by this by way of having
realistic timing; the DSP-4 will benefit further as the high-level
emulation was incomplete and somewhat buggy; and the DSP-3 will benefit
the most as the high-levle emulation there was not complete enough to be
playable. As a result, most notably, this means bsnes v073 is the first
emulator to fully be able to play SD Gundam GX (J)!

As bsnes' primary goal is accuracy, the LLE DSP support renders the old
HLE DSP support obsolete. Ergo, I have removed the 166KB of HLE source
code, and replaced it with the uPD77C25 core, which comprises a mere
20KB of source code. As this LLE module supports save states, this also
means that for the first time, DSP-3 and DSP-4 games have save state
support.

On the other hand, this also means that to run any DSP game, you will
need the appropriate program ROM. As these are copyrighted, I cannot
distribute them nor tell you where to get them. All I can do is provide
you with the necessary filenames and hashes.

Changelog (since v072 release):
* added NEC uPD77C25 emulation core
* added low-level emulation of the DSP-1, DSP-1B, DSP-2, DSP-3, DSP-4
  coprocessors
* removed high-level emulation of the DSP-n coprocessors
* added blargg's libco::ppc.c module, which is far more portable, even
  running on the PS3
* added software filter support via binary plugins
* added debugger (currently Linux-only); but it is as yet unstable
* added pause shortcut
* updated mightymo's cheat code database
2010-12-26 23:24:34 +11:00
Tim Allen
cc2950139d Update to 20100808 release.
byuu says:

This fixes libsnes and debugger builds, and collapses bsnes/ppu/bppu to
bsnes/ppu and bsnes/dsp/sdsp to bsnes/dsp. It also introduces
bsnes/sync.sh, which will synchronize all of asnes/ with bsnes/,
excepting the custom speed-focused modules. So far, that's bsnes/ppu
(scanline renderer) and bsnes/dsp (state machine.)

Should make keeping the two ports in sync much, much easier. It's
basically the same thing as before, only you run sync.sh and have a few
duplicated folders now. May make it clearer by creating a stub/ or src/
folder inside bsnes to do all of the copying, so that you only see the
custom folders in bsnes/' root directory.
2010-08-09 23:31:09 +10:00
byuu
e6e19a7c89 Update to bsnes v053 release.
This release greatly polishes the user interface, adds a new cheat code search utility, adds the snesfilter library, and adds Qt-based GUI support to both snesfilter and snesreader. snesfilter gains 2xSaI, Super 2xSaI and Super Eagle support, plus full configuration for both the NTSC and scanline filters; and snesreader gains support support for multi-file ROM archives (eg GoodMerge sets.)
Statically linking Qt to bsnes, snesfilter and snesreader would be too prohibitive size-wise (~10MB or so.) I have to link dynamically so that all three can share the same Qt runtime, which gets all of bsnes and its modules to ~1MB (including the debugger build); and Qt itself to about ~2.5MB.
However, there is some bad news. There's a serious bug in MinGW 4.4+, where it is not generating profile-guided input files (*.gcno files.) There is also a serious bug in Qt 4.5.2/Windows when using dynamic linking: the library is hanging indefinitely, forcing me to manually terminate the process upon exit. This prevents the creation of profile-guided output files (*.gcda files.) It would be tough enough to work around one, but facing both of these issues at once is too much.
I'm afraid I have no choice but to disable profile-guided optimizations until these issues can be addressed. I did not know about these bugs until trying to build the official v053 release, so it's too late to revert to an all-in-one binary now. And I'm simply not willing to stop releasing new builds because of bugs in third-party software. As soon as I can work around this, I'll post a new optimized binary. In the mean time, despite the fact that this release is actually more optimized, please understand that the Windows binary will run approximately ~10% slower than previous releases. I recommend keeping v052 for now if you need the performance. Linux and OS X users are unaffected.
Changelog:
    - save RAM is initialized to 0xff again to work around Ken Griffey Jr Baseball issue
    - libco adds assembly-optimized targets for Win64 and PPC-ELF [the latter courtesy of Kernigh]
    - libco/x86 and libco/amd64 use pre-assembled blocks now, obviates need for custom compilation flags
    - added a new cheat code search utility to the tools menu
    - separated filters from main bsnes binary to libsnesfilter / snesfilter.dll
    - added 2xSaI, Super 2xSaI and Super Eagle filters [kode54]
    - added full configuration settings for NTSC and scanline filters (12+ new options)
    - further optimized HQ2x filter [blargg]
    - added Vsync support to the Mac OS X OpenGL driver
    - added folder creation button to custom file load dialog
    - fixed a few oddities with loading of "game folders" (see older news for an explanation on what this is)
    - updated to blargg's file_extractor v1.0.0
    - added full support for multi-file archives (eg GoodMerge sets)
    - split multi-cart loading again (BS-X, Sufami Turbo, etc) as required for multi-file support
    - cleaned up handling of file placement detection for save files (.srm, .cht, etc)
    - file load dialog now remembers your previous folder path across runs even without a custom games folder assigned
    - windows now save their exact positioning and size across runs, they no longer forcibly center
    - menus now have radio button and check box icons where appropriate
    - debugger's hex editor now has a working scrollbar widget
    - added resize splitter to settings and tools windows
    - worked around Qt style sheet bug where subclassed widgets were not properly applying style properties
2009-10-18 17:33:04 +00:00
byuu
b45ff0433e Update to bsnes v029 release.
A new version of bsnes has been released. It contains a few minor emulation fixes, as well as user interface improvements. Behind the scenes, the source has been cleaned up more in preparation for running the CPU and PPU (video processor) separately from each other (eg with no enslavement.) This is required for implementing a clock cycle based PPU renderer.
    - Greatly improved invalid DMA transfer behavior, should be nearly perfect now
    - Major code cleanup -- most importantly, almost all PPU timing-related settings moved back to PPU, from CPU
    - Added option to auto-detect file type by inspecting file headers rather than file extensions
    - Rewrote video filter system to move it out of the emulation core -- HQ2x and Scale2x will work even in hires and interlace modes now, 50% scanline filter added
    - Re-added bsnes window icon
    - Added new controller graphic when assigning joypad keys [FitzRoy]
    - Redundant "Advanced" panel settings which can be configured via the GUI are no longer displayed
    - Improved speed regulation settings
    - XP and Vista themes will now apply to bsnes controls
    - Added "Path Settings" window to allow easy selection of default file directories
    - Tab key now mostly works throughout most of the GUI (needs improvement)
    - Main window will no longer disappear when setting a video multipler which results in a window size larger than the current desktop resolution
    - Added two new advanced options: one to control GUI window opacity, and one to adjust the statusbar text
2008-03-18 06:19:43 +00:00
byuu
dc692754c3 Update to bsnes v028 release.
Changelog:
    - OpenGL (with hardware filter mode support) and SDL video drivers added to Linux port
    - OpenAL (with speed regulation disable support) and OSS audio drivers added to Linux port [Nach]
    - SDL input driver (with joypad support) added to Linux port
    - Emulator pause option added
    - Added option to select behavior of bsnes when idle: allow input, ignore input or pause emulator
    - Added support to remap common GUI actions to key/joypad presses on the "Input Configuration" screen
    - bsnes will now clamp the video output size when it is larger than the screen resolution
    - GUI library has been enhanced, and renamed to hiro
    - Fullscreen mode now always centers video, rather than approximates
    - Fullscreen mode now works correctly on Linux/Openbox
    - Extra layer of abstraction in src/ui has been removed, as GUI lib unifies all ports anyway
    - Video, audio and input drivers unified into standard library, named ruby
    - All custom headers have been merged into a new template library, named nall
    - Makefile rewritten, vastly improved. Allows quick toggling of compiled-in drivers
    - Makefile: all object files now placed in /src/obj, binary placed in /
    - libco greatly enhanced, no longer requires an assembler to build [byuu, blargg, Nach]
    - libco SJLJ driver added; bsnes should now build on any Unix-derivative now (Solaris, OS X, PS3, etc) [Nach]
    - Fixed register $213e.d4 PPU1 open bus behavior [zones]
    - Windows port will not activate screensaver while bsnes is running [Nightcrawler]
    - Visual C++ target no longer requires stdint.h
    - And lots more -- mostly code refactoring related
2008-02-04 16:16:34 +00:00
byuu
b934ce41d9 Update to bsnes v027 release.
This version replaces libui with miu -- a new GUI wrapper library, and cleans up large portions of the source code.
Unfortunately, the GUI rewrite took far, far longer than I ever imagined. As a result, no work has gone into the core emulation for this version. But with the GUI rewrite out of the way, that should change in the near future. And thanks to the new UI library, I can now begin work on adding a cross-platform debugger to bsnes, at long last.
Changelog:
    - Major source code cleanup (lib/, ui/miu/, ui/vai/)
    - Cheat code editor was broken in v0.026, this is now fixed
    - Cheat code file format simplified for human readability
    - Makefile install target improvements [belegdol]
    - libui replaced with miu GUI library
    - Custom video / audio / input drivers replaced with vai HW library
    - ppc and ppc64 libco targets added [Vas Crabb]
    - x86 and x86-64 libco targets now work on OS X [Lucas Newman]
2007-12-22 18:26:54 +00:00
1028 changed files with 229902 additions and 9503 deletions

BIN
.assets/bahamut-lagoon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
.assets/user-interface.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -1,81 +0,0 @@
linux-x86_64-binaries_task:
container:
image: ubuntu:latest
setup_script:
- apt-get update && apt-get -y install build-essential libgtk2.0-dev libpulse-dev mesa-common-dev libgtksourceview2.0-dev libcairo2-dev libsdl2-dev libxv-dev libao-dev libopenal-dev libudev-dev zip
compile_script:
- make -C bsnes local=false
package_script:
- mkdir bsnes-nightly
- mkdir bsnes-nightly/Database
- mkdir bsnes-nightly/Firmware
- cp -a bsnes/out/bsnes bsnes-nightly/bsnes
- cp -a bsnes/Database/* bsnes-nightly/Database
- cp -a GPLv3.txt bsnes-nightly
- zip -r bsnes-nightly.zip bsnes-nightly
bsnes-nightly_artifacts:
path: "bsnes-nightly.zip"
freebsd-x86_64-binaries_task:
freebsd_instance:
image: freebsd-12-0-release-amd64
setup_script:
- pkg install --yes gmake gdb gcc8 pkgconf sdl2 openal-soft gtksourceview2 libXv zip
compile_script:
- gmake -C bsnes local=false
package_script:
- mkdir bsnes-nightly
- mkdir bsnes-nightly/Database
- mkdir bsnes-nightly/Firmware
- cp -a bsnes/out/bsnes bsnes-nightly/bsnes
- cp -a bsnes/Database/* bsnes-nightly/Database
- cp -a GPLv3.txt bsnes-nightly
- zip -r bsnes-nightly.zip bsnes-nightly
bsnes-nightly_artifacts:
path: "bsnes-nightly.zip"
windows-x86_64-binaries_task:
container:
image: ubuntu:latest
setup_script:
- apt-get update && apt-get -y install build-essential mingw-w64 zip
compile_script:
- make -C bsnes local=false platform=windows compiler="x86_64-w64-mingw32-g++" windres="x86_64-w64-mingw32-windres"
package_script:
- mkdir bsnes-nightly
- mkdir bsnes-nightly/Database
- mkdir bsnes-nightly/Firmware
- cp -a bsnes/out/bsnes bsnes-nightly/bsnes.exe
- cp -a bsnes/Database/* bsnes-nightly/Database
- cp -a GPLv3.txt bsnes-nightly
- zip -r bsnes-nightly.zip bsnes-nightly
bsnes-nightly_artifacts:
path: "bsnes-nightly.zip"
macOS-x86_64-binaries_task:
osx_instance:
image: mojave-base
compile_script:
- make -C bsnes local=false
package_script:
- mkdir bsnes-nightly
- cp -a bsnes/out/bsnes.app bsnes-nightly
- cp -a GPLv3.txt bsnes-nightly
- zip -r bsnes-nightly.zip bsnes-nightly
bsnes-nightly_artifacts:
path: "bsnes-nightly.zip"

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
*.fs linguist-detectable=false
*.vs linguist-detectable=false

1
.github/FUNDING.yml vendored
View File

@@ -1 +0,0 @@
patreon: byuu

158
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,158 @@
name: Build
on:
push:
branches: [ master ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]
permissions:
contents: write
jobs:
build:
strategy:
matrix:
os:
- name: ubuntu
version: latest
- name: windows
version: latest
- name: macos
version: latest
runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
if: matrix.os.name == 'ubuntu'
run: |
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev libgtk-3-dev gtksourceview-3.0 libao-dev libopenal-dev
- name: Make
run: make -j4 -C bsnes local=false
- name: Upload
uses: actions/upload-artifact@v4
with:
name: bsnes-${{ matrix.os.name }}
path: bsnes/out/bsnes*
build-freebsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: vmactions/freebsd-vm@v1
with:
release: "14.3"
usesh: true
prepare: |
pkg install --yes gmake gdb gcc14 pkgconf sdl2 openal-soft gtk3 gtksourceview3 libXv zip
run: |
gmake -j4 -C bsnes local=false
- name: Upload
uses: actions/upload-artifact@v4
with:
name: bsnes-freebsd
path: bsnes/out/bsnes*
release:
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
# Prevent multiple conflicting release jobs from running at once.
concurrency: release-${{ github.ref == 'refs/heads/master' && 'nightly' || github.ref }}
runs-on: ubuntu-latest
needs:
- build
- build-freebsd
steps:
- uses: actions/checkout@v4
with:
path: 'src'
- name: Download Artifacts
uses: actions/download-artifact@v4.1.7
with:
path: 'bin'
- name: Package Artifacts
run: |
set -eu
case ${GITHUB_REF} in
refs/tags/*) suffix="-${GITHUB_REF#refs/tags/}" ;;
refs/heads/master) suffix="-nightly" ;;
*) suffix="" ;;
esac
srcdir="${GITHUB_WORKSPACE}/src"
bindir="${GITHUB_WORKSPACE}/bin"
# Hack: Workaround for GitHub artifacts losing attributes.
for program in bsnes
do
chmod +x ${bindir}/${program}-ubuntu/${program}
chmod +x ${bindir}/${program}-macos/${program}.app/Contents/MacOS/${program}
done
for os in ubuntu windows macos freebsd
do
mkdir "${os}"
cd "${os}"
# Package bsnes.
outdir=bsnes${suffix}
mkdir ${outdir}
mkdir ${outdir}/Database
mkdir ${outdir}/Firmware
cp -ar ${bindir}/bsnes-${os}/* ${outdir}
cp -a ${srcdir}/bsnes/Database/* ${outdir}/Database
cp -a ${srcdir}/shaders ${outdir}/Shaders
cp -a ${srcdir}/GPLv3.txt ${outdir}
cp -a ${srcdir}/extras/* ${outdir}
zip -r ../bsnes-${os}.zip ${outdir}
cd -
done
- name: Calculate release info
id: relinfo
run: |
echo "datetime=$(date -u +"%Y-%m-%d %T %Z")" >> $GITHUB_OUTPUT
echo "date=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
- name: Delete old nightly release
uses: actions/github-script@v7
id: release
if: ${{!startsWith(github.ref, 'refs/tags/')}}
with:
retries: 3
script: |
const {owner, repo} = context.repo;
try {
const release = await github.rest.repos.getReleaseByTag({owner, repo, tag: "nightly"});
if (release && release.status === 200) {
await github.rest.repos.deleteRelease({owner, repo, release_id: release.data.id});
}
} catch (e) {
console.log(`error deleting old release: ${e}`);
}
try {
await github.rest.git.deleteRef({owner, repo, ref: "tags/nightly"});
} catch (e) {
console.log(`error trying to delete ref: ${e}`);
}
await github.rest.git.createTag({
owner,
repo,
tag: "nightly",
message: "nightly release",
object: context.sha,
type: "commit",
})
- name: Create nightly release
uses: softprops/action-gh-release@v1
if: ${{!startsWith(github.ref, 'refs/tags/')}}
with:
tag_name: nightly
name: bsnes nightly ${{steps.relinfo.outputs.date}}
body: Auto-generated nightly release on ${{steps.relinfo.outputs.datetime}}
files: bsnes*.zip
prerelease: true
- name: Create version release
uses: softprops/action-gh-release@v1
if: ${{startsWith(github.ref, 'refs/tags/')}}
with:
name: bsnes ${{github.ref_name}}
body: This is bsnes ${{github.ref_name}}, released on ${{steps.relinfo.outputs.date}}.
files: bsnes*.zip

1
.gitignore vendored
View File

@@ -0,0 +1 @@
hiro/qt/qt.moc

59
CREDITS.md Normal file
View File

@@ -0,0 +1,59 @@
bsnes was originally developed by byuu, and is now a group project.
This software would not be where it is today without the help and support of the following individuals:
- Andreas Naive
- Ange Albertini
- anomie
- AWJ
- BearOso
- Bisqwit
- blargg
- byuu
- Łukasz Krawczyk
- Danish
- DerKoun
- DMV27
- Dr. Decapitator
- endrift
- Fatbag
- FitzRoy
- gekkio
- GIGO
- Hendricks266
- hex_usr
- ikari_01
- jchadwick
- Jonas Quinn
- kode54
- krom
- Lioncash
- Lord Nightmare
- lowkey
- Matthew Callis
- Max833
- MerryMage
- mightymo
- Nach
- ncbncb
- neviksti
- OV2
- Overload
- p4plus2
- quequotion
- qwertymodo
- RedDwarf
- Richard Bannister
- Ryphecha
- segher
- Sintendo
- SuperMikeMan
- Talarubi
- tetsuo55
- TmEE
- TRAC
- wareya
- zones
If you feel you are missing from this list, please submit a pull request and we will be happy to add your name here!

View File

@@ -1,14 +1,14 @@
----------------------------------------------------------------------
bsnes - Super Nintendo emulator
Copyright © 2004-2019 byuu
Copyright © 2004-2020 byuu et al
https://byuu.org
https://byuu.org/bsnes/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, specifically version 3 of the License
and no other version.
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -25,7 +25,7 @@ nall - C++ template library
ruby - Hardware abstraction library
hiro - User interface library
Copyright © 2006-2019 byuu
Copyright © 2006-2020 byuu et al
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the

View File

@@ -1,29 +1,15 @@
bsnes
=====
bsnes is a multi-platform Super Nintendo (Super Famicom) emulator that focuses
on performance, features, and ease of use.
![bsnes logo](bsnes/target-bsnes/resource/logo.png)
bsnes currently enjoys 100% known, bug-free compatibility with the entire SNES
library when configured to its most accurate settings, giving it the same
accuracy level as higan. Accuracy can also optionally be traded for performance,
allowing bsnes to operate more than 300% faster than higan while still remaining
almost as accurate.
Development
-----------
Git is used for the development of new releases, and represents a staging
environment. As bsnes is rather mature, things should generally be quite stable.
However, bugs will exist, regressions will occur, so proceed at your own risk.
If stability is required, please download the latest stable release from the
[official website.](https://bsnes.byuu.org)
bsnes is a multi-platform Super Nintendo (Super Famicom) emulator, originally
developed by Near, which focuses on performance,
features, and ease of use.
Unique Features
---------------
- 100% (known) bug-free compatibility with the entire officially licensed SNES games library
- True Super Game Boy emulation (using the SameBoy core by Lior Halphon)
- HD mode 7 graphics with optional supersampling (by DerKoun)
- Low-level emulation of all SNES coprocessors (DSP-n, ST-01n, Cx4)
@@ -32,12 +18,11 @@ Unique Features
- Built-in games database with thousands of game entries
- Built-in cheat code database for hundreds of popular games (by mightymo)
- Built-in save state manager with screenshot previews and naming capabilities
- Support for ASIO low-latency audio
- Customizable per-byte game mappings to support any cartridges, including prototype games
- 7-zip decompression support
- Extensive Satellaview emulation, including BS Memory flash write and wear-leveling emulation
- 30-bit color output support (where supported)
- Optional higan game folder support (standard game ROM files are also fully supported!)
- Advanced mapping system allowing multiple bindings to every emulated input
Standard Features
-----------------
@@ -49,6 +34,7 @@ Standard Features
- Several built-in software filters, including HQ2x (by MaxSt) and snes_ntsc (by blargg)
- Adaptive sync and dynamic rate control for perfect audio/video synchronization
- Just-in-time input polling for minimal input latency
- Run-ahead support for removing internal game engine input latency
- Support for Direct3D exclusive mode video
- Support for WASAPI exclusive mode audio
- Periodic auto-saving of game saves
@@ -56,6 +42,7 @@ Standard Features
- Sprite limit disable support
- Cubic audio interpolation support
- Optional high-level emulation of most SNES coprocessors
- Optional emulation of flaws in older emulators for compatibility with older unofficial software
- CPU, SA1, and SuperFX overclocking support
- Frame advance support
- Screenshot support
@@ -63,19 +50,26 @@ Standard Features
- Movie recording and playback support
- Rewind support
- HiDPI support
- Multi-monitor support
- Turbo support for controller inputs
Links
-----
- [Official website](https://bsnes.byuu.org)
- [Official git repository](https://github.com/byuu/bsnes)
- [Donations](https://patreon.com/byuu)
- [Official git repository](https://github.com/bsnes-emu/bsnes)
- [Official Discord](https://discord.gg/B27hf27ZVf)
Nightly Builds
--------------
- [Download](https://cirrus-ci.com/github/byuu/bsnes/master)
- ![Build status](https://api.cirrus-ci.com/github/byuu/bsnes.svg?task=windows-x86_64-binaries)
- ![Build status](https://api.cirrus-ci.com/github/byuu/bsnes.svg?task=macOS-x86_64-binaries)
- ![Build status](https://api.cirrus-ci.com/github/byuu/bsnes.svg?task=linux-x86_64-binaries)
- ![Build status](https://api.cirrus-ci.com/github/byuu/bsnes.svg?task=freebsd-x86_64-binaries)
- [Windows](https://github.com/bsnes-emu/bsnes/releases/download/nightly/bsnes-windows.zip)
- [macOS](https://github.com/bsnes-emu/bsnes/releases/download/nightly/bsnes-macos.zip)
- [Linux](https://github.com/bsnes-emu/bsnes/releases/download/nightly/bsnes-ubuntu.zip)
- [FreeBSD](https://api.cirrus-ci.com/v1/artifact/github/bsnes-emu/bsnes/freebsd-x86_64-binaries/bsnes-nightly/bsnes-nightly.zip)
Preview
-------
![bsnes user interface](.assets/user-interface.png)
![bsnes running Bahamut Lagoon](.assets/bahamut-lagoon.png)
![bsnes running Tengai Makyou Zero](.assets/tengai-makyou-zero.png)

View File

@@ -1,5 +1,5 @@
database
revision: 2018-09-20
revision: 2020-01-01
//BS Memory (JPN)

View File

@@ -1,5 +1,5 @@
database
revision: 2018-09-20
revision: 2020-01-01
//Sufami Turbo (JPN)

View File

@@ -1,5 +1,5 @@
database
revision: 2018-09-20
revision: 2020-01-21
//Prototypes (JPN)
@@ -125,7 +125,7 @@ game
//Super Famicom (JPN)
database
revision: 2018-09-20
revision: 2020-01-21
game
sha256: 5c4e283efc338958b8dd45ebd6daf133a9eb280420a98e2e1df358ae0242c366
@@ -171,6 +171,22 @@ game
size: 0x8000
content: Save
game
sha256: a98eb5f0521746e6ce6d208591e86d366b6e0479d96474bfff43856fe8cfec12
label: バハムートラグーン
name: Bahamut Lagoon
region: SHVC-AXBJ-JPN
revision: SHVC-AXBJ-0
board: SHVC-1J3M-20
memory
type: ROM
size: 0x300000
content: Program
memory
type: RAM
size: 0x2000
content: Save
game
sha256: 47779500c43a0c2e75d7684078489a17baea31170a123063b8ece6ce77359413
label: ボール・ブレット・ガン
@@ -1277,7 +1293,7 @@ game
size: 0x100
content: Boot
manufacturer: Nintendo
architecture: LR35902
architecture: SM83
identifier: SGB1
game
@@ -1296,7 +1312,7 @@ game
size: 0x100
content: Boot
manufacturer: Nintendo
architecture: LR35902
architecture: SM83
identifier: SGB2
oscillator
frequency: 20971520
@@ -1465,6 +1481,22 @@ game
size: 0x2000
content: Save
game
sha256: 77b2d5450ce3c87185f913c2584673530c13dfbe8cc433b1e9fe5e9a653bf7d5
label: テイルズオブファンタジア
name: Tales of Phantasia
region: SHVC-ATVJ-JPN
revision: SHVC-ATVJ-0
board: SHVC-LJ3M-01
memory
type: ROM
size: 0x600000
content: Program
memory
type: RAM
size: 0x2000
content: Save
game
sha256: c9002e77bcc656e033c35e2574ee6067c4c0d070943359a850806c123a558949
label: 戦え原始人3 主役はやっぱりジョーアンドマック
@@ -1705,7 +1737,7 @@ game
//Super Nintendo (ESP)
database
revision: 2018-04-14
revision: 2018-09-21
game
sha256: bd5e7a6bc08f64d39c54204b82c6c156f144c03e13c890128588c5faa560659c
@@ -1767,6 +1799,50 @@ game
size: 0x200000
content: Program
game
sha256: bd7e98db82d6b52307be1f3e1fd171e1e7204dc1f8810a95ee2cc64757087e4a
label: The Lost Vikings
name: Lost Vikings, The
region: SNSP-LV-ESP
revision: SESP-LV-0
board: SHVC-1A0N-20
memory
type: ROM
size: 0x100000
content: Program
game
sha256: 6eecabd46305ac95d9cf3a17e1392c24a1b68a7a313173ef0c5b5a3a24cf3353
label: Lufia
name: Lufia
region: SNSP-ANIS-ESP
revision: SPAL-ANIS-0
board: SHVC-1A3M-30
memory
type: ROM
size: 0x300000
content: Program
memory
type: RAM
size: 0x2000
content: Save
game
sha256: d70bc7916ed5132c3b0053f2adbb5004d78ccb986210c9440fedf642cac68554
label: MechWarrior
name: MechWarrior
region: SNSP-WM-ESP
revision: SESP-WM-0
board: SHVC-1A1M-10
memory
type: ROM
size: 0x100000
content: Program
memory
type: RAM
size: 0x800
content: Save
game
sha256: d2233d6310522bbf183b6ca9bbe3e2afaf24de0cc4304bff6d0d547d678aed6f
label: Sonic Blast Man
@@ -1779,6 +1855,18 @@ game
size: 0x100000
content: Program
game
sha256: a20d346da18ddabf70dc43f5095c4189c4a646ca8e6d4ed6c68c20e380f50332
label: Super Battletank 2
name: Super Battletank 2
region: SNSP-2X-ESP
revision: SESP-2X-0
board: SHVC-1A0N-20
memory
type: ROM
size: 0x200000
content: Program
game
sha256: 9eaf1c46d8a068c910d66f582e23b1155882ddfa4b9fd0813819fc5c008167e2
label: Super James Pond
@@ -1803,6 +1891,46 @@ game
size: 0x100000
content: Program
game
sha256: 7f731f4bb620e682132660da39641dda5762211dca4732f8192dd2411211b822
label: Terranigma
name: Terranigma
region: SNSP-AQTS-ESP
revision: SPAL-AQTS-0
board: SHVC-1J3M-20
memory
type: ROM
size: 0x400000
content: Program
memory
type: RAM
size: 0x2000
content: Save
game
sha256: 981128c93f0753dec7af29ec084f13e704cc5d02414be55bb477fc4b2fef5e58
label: Tiny Toon Adventures: Buster Busts Loose!
name: Tiny Toon Adventures - Buster Busts Loose!
region: SNSP-TA-ESP
revision: SESP-TA-0
board: SHVC-1A0N-20
memory
type: ROM
size: 0x100000
content: Program
game
sha256: ce2445ecd0a43f6025dc80857d91dae7c46d33f7821bf98232c2894ca1959da2
label: Turn and Burn: No-Fly Zone
name: Turn and Burn - No-Fly Zone
region: SNSP-ZN-ESP
revision: SESP-ZN-0
board: SHVC-1A0N-20
memory
type: ROM
size: 0x200000
content: Program
game
sha256: 9ed876a632aa699047e9efba8a64ab57abc55086a0aab6b5fa67d87ea4647f3f
label: Whirlo
@@ -1846,7 +1974,7 @@ game
//Super Nintendo (EUR)
database
revision: 2018-05-06
revision: 2018-09-21
game
sha256: ec3e81d628a293514e303b44e3b1ac03461ddd1da32764b10b7fab1e507602df
@@ -2904,6 +3032,18 @@ game
size: 0x100000
content: Program
game
sha256: 4ad736a9e1c7f34740afaa7777b8f1a31da4bb4a021e7ae341d1dafd74fa0acc
label: True Lies
name: True Lies
region: SNSP-ATLP-EUR
revision: SPAL-ATLP-0
board: SHVC-1A0N-30
memory
type: ROM
size: 0x200000
content: Program
game
sha256: dbf11d4c77b9aa3416f687201d57d71a23bb8fb0b8fe5e9e8212db3fac036631
label: Turbo Toons
@@ -2942,7 +3082,7 @@ game
game
sha256: 1217ddf2fe475661a54f50e111864102faf854397ce5aceea4297204ebd6cbb6
label: Val d'isére Championship
label: Val d'isère Championship
name: Val d'isere Championship
region: SNSP-8Z-EUR
revision: SPAL-8Z-0
@@ -3016,7 +3156,7 @@ game
//Super Nintendo (FAH)
database
revision: 2018-04-14
revision: 2018-09-21
game
sha256: 0aafd04a43ae29266e43920a7f9954d4a49f6fe43a5abffecc9c2fd5ad7d6cea
@@ -3110,6 +3250,18 @@ game
size: 0x800
content: Save
game
sha256: 826a328f401cdf5a9ee87aaa7a2784cbb21813b165a6c7ca3f702fe6ba8c0804
label: Eric Cantona: Football Challenge
name: Eric Cantona - Football Challenge
region: SNSP-EC-FAH
revision: SPAL-EC-0
board: SHVC-1A0N-20
memory
type: ROM
size: 0x80000
content: Program
game
sha256: ce09743d44a54f64862d8c53c11c2c84f2f861ec74c778bd8b05b0a3b07708d6
label: FIFA International Soccer
@@ -3423,10 +3575,22 @@ game
size: 0x180000
content: Program
game
sha256: 5a9103b04b9246f63af9018cbbd7934c6b79076dd9b0062887bd16077cd37c81
label: Val d'Isère Championship
name: Val d'Isere Championship
region: SNSP-8V-FAH
revision: SPAL-8V-0
board: SHVC-1A0N-20
memory
type: ROM
size: 0x100000
content: Program
//Super Nintendo (FRA)
database
revision: 2018-04-14
revision: 2018-09-21
game
sha256: 65df600780021f13ced52e7fbc507b7b2e6491b2c5c25fe78d0515dcbe669403
@@ -3660,6 +3824,22 @@ game
size: 0x180000
content: Program
game
sha256: b730adcbb34a19f8fd1c2abe27455cc3256329a9b8a021291e3009ea33004127
label: Secret of Mana
name: Secret of Mana
region: SNSP-K2-FRA
revision: SFRA-K2-1
board: SHVC-1J3M-11
memory
type: ROM
size: 0x200000
content: Program
memory
type: RAM
size: 0x2000
content: Save
game
sha256: f73e6da9e979c839c7c22ec487bea6667d3e65e7d8f9fcc97a2bcdeb4487cddf
label: SimCity
@@ -3676,6 +3856,38 @@ game
size: 0x8000
content: Save
game
sha256: 1f226553ba05fe738d085a88154469bbc9f9058f7dfc320a327259d84ae5f393
label: Soul Blazer
name: Soul Blazer
region: SNSP-SO-FRA
revision: SFRA-SO-0
board: SHVC-1J3M-20
memory
type: ROM
size: 0x100000
content: Program
memory
type: RAM
size: 0x2000
content: Save
game
sha256: 5d0a234a2fcb343d169206d9d7d578507c44f800ead9cc9ccfa0b1d4cb1cc9e5
label: Terranigma
name: Terranigma
region: SNSP-AQTF-FRA
revision: SPAL-AQTF-0
board: SHVC-1J3M-20
memory
type: ROM
size: 0x400000
content: Program
memory
type: RAM
size: 0x2000
content: Save
//Super Nintendo (FRG)
database
@@ -3762,7 +3974,23 @@ game
//Super Nintendo (ITA)
database
revision: 2018-04-14
revision: 2018-09-21
game
sha256: deab7aad7c168423e43eae14e9e31efa29c7341ab84f936be508911ce508b372
label: MechWarrior
name: MechWarrior
region: SNSP-WM-ITA
revision: SITA-WM-0
board: SHVC-1A1M-01
memory
type: ROM
size: 0x100000
content: Program
memory
type: RAM
size: 0x800
content: Save
game
sha256: aafbae4c2a7a5a35c81a183df0470027b4b5690f836592af21c15af6b259328d
@@ -3796,7 +4024,7 @@ game
//Super Nintendo (NOE)
database
revision: 2018-04-14
revision: 2020-01-01
game
sha256: b342d12d71729edebc1911725ea23d58c1a397b27253a5c8cd96cfb58af242a9
@@ -4394,6 +4622,18 @@ game
size: 0x80000
content: Program
game
sha256: 09299d142e485ba2fcdbd9b3a6d1a5acfbc7fc70b06cf22be28479686419a7a9
label: Jimmy Connors Pro Tennis Tour
name: Jimmy Connors Pro Tennis Tour
region: SNSP-JC-NOE
revision: SFRG-JC-0
board: SHVC-1A0N-20
memory
type: ROM
size: 0x80000
content: Program
game
sha256: 74c55ea3c9733bf263628a260df7492fc840d7de1c3fceebb7bcf6d99a8c81d6
label: Joe & Mac: Caveman Ninja
@@ -4470,6 +4710,18 @@ game
size: 0x100000
content: Program
game
sha256: 4a7444780a750f97943d974589586d4cf89d8957e396cc5a7ad565cd4c1b70a7
label: The Legend of the Mystical Ninja
name: Legend of the Mystical Ninja, The
region: SNSP-GG-NOE
revision: SFRG-GG-0
board: SHVC-1A0N-20
memory
type: ROM
size: 0x100000
content: Program
game
sha256: 5ec66298ddb579b35cc5d3df5bfeeee05bdf71347565c7c5f5f3869bf4f1e469
label: Looney Tunes Basketball
@@ -4820,7 +5072,7 @@ game
size: 0x100
content: Boot
manufacturer: Nintendo
architecture: LR35902
architecture: SM83
identifier: SGB1
game
@@ -4975,6 +5227,18 @@ game
size: 0x100000
content: Program
game
sha256: 94e6fe78bb1a1d89ccfd74ad92e2a489f8e2e257d6dfe62404155741763f962f
label: True Lies
name: True Lies
region: SNSP-ATLD-NOE
revision: SPAL-ATLD-0
board: SHVC-1A0N-30
memory
type: ROM
size: 0x200000
content: Program
game
sha256: a1105819d48c04d680c8292bbfa9abbce05224f1bc231afd66af43b7e0a1fd4e
label: Unirally
@@ -5054,7 +5318,7 @@ game
//Super Nintendo (SCN)
database
revision: 2018-04-14
revision: 2018-09-21
game
sha256: beb379ba48f63561c0f939ecd8f623ec06c1b5e06976eef9887e5c62f3df2766
@@ -5080,6 +5344,22 @@ game
size: 0x300000
content: Program
game
sha256: 4fb9eb8fa4d9c3a0b6c24bac5b0a0b0f079f083f5e6dfa937a161c8f4bcde853
label: Shadowrun
name: Shadowrun
region: SNSP-WR-SCN
revision: SSWE-WR-0
board: SHVC-1A3M-20
memory
type: ROM
size: 0x100000
content: Program
memory
type: RAM
size: 0x2000
content: Save
game
sha256: e15247495311e91db9431d61777a264d4b42def011291d512b273fc8acd1cbfa
label: Soul Blazer
@@ -5096,6 +5376,18 @@ game
size: 0x2000
content: Save
game
sha256: 687c4f9a14cc16605f5e92aa0fe33bf083fe8e39ba781676259fadf932480890
label: Tintin i Tibet
name: Tintin i Tibet
region: SNSP-AT6X-SCN
revision: SPAL-AT6X-0
board: SHVC-2A0N-20
memory
type: ROM
size: 0x180000
content: Program
game
sha256: a6297356fb06f1575b432fae463171f53e3b786fd77b841557547a9117fb52fe
label: X-Zone
@@ -5761,7 +6053,7 @@ game
//Super Nintendo (USA)
database
revision: 2018-09-20
revision: 2020-01-01
game
sha256: 2ffe8828480f943056fb1ab5c3c84d48a0bf8cbe3ed7c9960b349b59adb07f3b
@@ -6555,8 +6847,8 @@ game
sha256: 6fa6b8a8804ff6544bdedf94339a86ba64ce0b6dbf059605abb1cd6f102d3483
label: Bill Laimbeer's Combat Basketball
name: Bill Laimbeer's Combat Basketball
region: SNS-C8-USA
revision: SNS-C8-0
region: SNS-CB-USA
revision: SNS-CB-0
board: SHVC-1A3B-12
memory
type: ROM
@@ -13628,7 +13920,7 @@ game
size: 0x100
content: Boot
manufacturer: Nintendo
architecture: LR35902
architecture: SM83
identifier: SGB1
game
@@ -14516,8 +14808,8 @@ game
sha256: 3cdebbd8adc4bb6773a7995f542fdac49adefca71cba583255a1c1bf37ac3946
label: Tetris & Dr. Mario
name: Tetris & Dr. Mario
region: SNS-AFTE-USA
revision: SNS-AFTE-0
region: SNS-ATFE-USA
revision: SNS-ATFE-0
board: SHVC-1A0N-30
memory
type: ROM

View File

@@ -42,8 +42,6 @@ else ifneq ($(filter $(platform),linux bsd),)
flags += -fPIC
options += -shared
endif
else
$(error "unsupported platform")
endif
objects := libco emulator filter lzma

53
bsnes/README.md Normal file
View File

@@ -0,0 +1,53 @@
bsnes source code
=================
A guide to what all these directories are for:
- [Database](./Database/)
contains the databases bsnes uses
to figure out what circuit board a game expects,
and also the database of pre-made game cheats
- [emulator](./emulator/)
contains the interface
that the emulation core in [sfc](./sfc/) implements
- It comes from higan v106,
which has many emulation cores
that all implement the same interface —
bsnes only has one,
but the interface is still a good abstraction,
so it's still here.
- [filter](./filter/)
contains classic CPU-based image upscaling filters,
like HQ2x and Super Eagle
- [gb](./gb/)
contains the SameBoy emulator code
used for Super Game Boy emulation
- [heuristics](./heuristics/)
contains the logic that guesses
which memory map a particular game expects
and what extra hardware it assumes is present,
when a game cannot be found in the database
- [Locale](./Locale/)
contains translation databases
that bsnes can use to display its user interface
in a different language
- [lzma](./lzma/)
contains the 7-Zip SDK
allowing bsnes to understad `.7z` archives
- [processor](./processor/)
contains all the CPU emulation cores
used by the hardware bsnes emulates
- Another holdover from higan v106,
where different supported systems
happen to use the same model CPU,
so the CPU emulation cores
are not specific to a system
- [sfc](./sfc/)
contains Super Famicom (SNES) emulation code
- [target-bsnes](./target-bsnes/)
contains the normal bsnes user interface
- [target-libretro](./target-libretro/)
implements the "libretro" API
on top of bsnes' native
[emulator](./emulator/) API,
so bsnes can be used with libretro-based frontends

View File

@@ -1,5 +1,3 @@
#define double float
namespace Emulator {
#include "stream.cpp"

View File

@@ -1,5 +1,4 @@
#pragma once
#define double float
#include <nall/dsp/iir/dc-removal.hpp>
#include <nall/dsp/iir/one-pole.hpp>
@@ -55,14 +54,16 @@ struct Filter {
struct Stream {
auto reset(uint channels, double inputFrequency, double outputFrequency) -> void;
auto reset() -> void;
auto frequency() const -> double;
auto setFrequency(double inputFrequency, maybe<double> outputFrequency = nothing) -> void;
auto addDCRemovalFilter() -> void;
auto addLowPassFilter(double cutoffFrequency, Filter::Order order, uint passes = 1) -> void;
auto addHighPassFilter(double cutoffFrequency, Filter::Order order, uint passes = 1) -> void;
auto pending() const -> bool;
auto pending() const -> uint;
auto read(double samples[]) -> uint;
auto write(const double samples[]) -> void;
@@ -71,6 +72,8 @@ struct Stream {
write(samples);
}
auto serialize(serializer&) -> void;
private:
struct Channel {
vector<Filter> filters;

View File

@@ -9,6 +9,16 @@ auto Stream::reset(uint channelCount, double inputFrequency, double outputFreque
setFrequency(inputFrequency, outputFrequency);
}
auto Stream::reset() -> void {
for(auto& channel : channels) {
channel.resampler.reset(this->inputFrequency, this->outputFrequency);
}
}
auto Stream::frequency() const -> double {
return inputFrequency;
}
auto Stream::setFrequency(double inputFrequency, maybe<double> outputFrequency) -> void {
this->inputFrequency = inputFrequency;
if(outputFrequency) this->outputFrequency = outputFrequency();
@@ -77,8 +87,9 @@ auto Stream::addHighPassFilter(double cutoffFrequency, Filter::Order order, uint
}
}
auto Stream::pending() const -> bool {
return channels && channels[0].resampler.pending();
auto Stream::pending() const -> uint {
if(!channels) return 0;
return channels[0].resampler.pending();
}
auto Stream::read(double samples[]) -> uint {
@@ -104,3 +115,11 @@ auto Stream::write(const double samples[]) -> void {
audio.process();
}
auto Stream::serialize(serializer& s) -> void {
for(auto& channel : channels) {
channel.resampler.serialize(s);
}
s.real(inputFrequency);
s.real(outputFrequency);
}

View File

@@ -1,5 +1,7 @@
#pragma once
#include <libco/libco.h>
#include <nall/platform.hpp>
#include <nall/adaptive-array.hpp>
#include <nall/any.hpp>
@@ -20,22 +22,20 @@
#include <nall/hash/sha256.hpp>
using namespace nall;
#include <libco/libco.h>
#include <emulator/types.hpp>
#include <emulator/memory/readable.hpp>
#include <emulator/memory/writable.hpp>
#include <emulator/audio/audio.hpp>
namespace Emulator {
static const string Name = "bsnes";
static const string Version = "110";
static const string Author = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org";
static const string Name = "bsnes";
static const string Version = "115";
static const string Copyright = "bsnes team";
static const string License = "GPLv3 or later";
static const string Website = "https://github.com/bsnes-emu/bsnes/";
//incremented only when serialization format changes
static const string SerializerVersion = "110";
static const string SerializerVersion = "115.1";
namespace Constants {
namespace Colorburst {

View File

@@ -81,7 +81,7 @@ struct Interface {
virtual auto synchronize(uint64 timestamp = 0) -> void {}
//state functions
virtual auto serialize() -> serializer { return {}; }
virtual auto serialize(bool synchronize = true) -> serializer { return {}; }
virtual auto unserialize(serializer&) -> bool { return false; }
//cheat functions
@@ -101,6 +101,9 @@ struct Interface {
virtual auto frameSkip() -> uint { return 0; }
virtual auto setFrameSkip(uint frameSkip) -> void {}
virtual auto runAhead() -> bool { return false; }
virtual auto setRunAhead(bool runAhead) -> void {}
};
}

View File

@@ -17,7 +17,7 @@ struct Platform {
virtual auto open(uint id, string name, vfs::file::mode mode, bool required = false) -> shared_pointer<vfs::file> { return {}; }
virtual auto load(uint id, string name, string type, vector<string> options = {}) -> Load { return {}; }
virtual auto videoFrame(const uint16* data, uint pitch, uint width, uint height, uint scale) -> void {}
virtual auto audioFrame(const float* samples, uint channels) -> void {}
virtual auto audioFrame(const double* samples, uint channels) -> void {}
virtual auto inputPoll(uint port, uint device, uint input) -> int16 { return 0; }
virtual auto inputRumble(uint port, uint device, uint input, bool enable) -> void {}
virtual auto dipSettings(Markup::Node node) -> uint { return 0; }

11
bsnes/gb/.gitattributes vendored Normal file
View File

@@ -0,0 +1,11 @@
# Always use LF line endings for shaders
*.fsh text eol=lf
*.metal text eol=lf
HexFiend/* linguist-vendored
*.inc linguist-language=C
Core/*.h linguist-language=C
SDL/*.h linguist-language=C
Windows/*.h linguist-language=C
XdgThumbnailer/*.h linguist-language=C
Cocoa/*.h linguist-language=Objective-C

3
bsnes/gb/.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: LIJI32

25
bsnes/gb/.github/actions/LICENSE vendored Normal file
View File

@@ -0,0 +1,25 @@
Blargg's Test ROMs by Shay Green <gblargg@gmail.com>
Acid2 tests by Matt Currie under MIT:
MIT License
Copyright (c) 2020 Matt Currie
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

BIN
bsnes/gb/.github/actions/cgb-acid2.gbc vendored Normal file

Binary file not shown.

BIN
bsnes/gb/.github/actions/cgb_sound.gb vendored Normal file

Binary file not shown.

BIN
bsnes/gb/.github/actions/dmg-acid2.gb vendored Normal file

Binary file not shown.

BIN
bsnes/gb/.github/actions/dmg_sound-2.gb vendored Executable file

Binary file not shown.

36
bsnes/gb/.github/actions/install_deps.sh vendored Executable file
View File

@@ -0,0 +1,36 @@
case `echo $1 | cut -d '-' -f 1` in
ubuntu)
sudo apt-get -qq update
sudo apt-get install -yq bison libpng-dev pkg-config libsdl2-dev libgdk-pixbuf2.0-dev
(
cd `mktemp -d`
curl -L https://github.com/rednex/rgbds/archive/v0.6.0.zip > rgbds.zip
unzip rgbds.zip
cd rgbds-*
make -sj
sudo make install
cd ..
rm -rf *
)
(
cd `mktemp -d`
curl -L https://github.com/BR903/cppp/archive/refs/heads/master.zip > cppp.zip
unzip cppp.zip
cd cppp-*
make -sj
sudo make install
cd ..
rm -rf *
)
;;
macos)
brew install rgbds sdl2 cppp
;;
*)
echo "Unsupported OS"
exit 1
;;
esac

BIN
bsnes/gb/.github/actions/oam_bug-2.gb vendored Executable file

Binary file not shown.

35
bsnes/gb/.github/actions/sanity_tests.sh vendored Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/sh
set -e
./build/bin/tester/sameboy_tester --jobs 5 \
--length 45 .github/actions/cgb_sound.gb \
--length 10 .github/actions/cgb-acid2.gbc \
--length 10 .github/actions/dmg-acid2.gb \
--dmg --length 45 .github/actions/dmg_sound-2.gb \
--dmg --length 20 .github/actions/oam_bug-2.gb
mv .github/actions/dmg-acid2.bmp .github/actions/dmg-mode-acid2.bmp
./build/bin/tester/sameboy_tester \
--dmg --length 10 .github/actions/dmg-acid2.gb
set +e
FAILED_TESTS=`
shasum .github/actions/*.bmp | grep -E -v \(\
64c3fd9a5fe9aee40fe15f3371029c0d2f20f5bc\ \ .github/actions/cgb-acid2.bmp\|\
dbcc438dcea13b5d1b80c5cd06bda2592cc5d9e0\ \ .github/actions/cgb_sound.bmp\|\
0caadf9634e40247ae9c15ff71992e8f77bbf89e\ \ .github/actions/dmg-acid2.bmp\|\
fbdb5e342bfdd2edda3ea5601d35d0ca60d18034\ \ .github/actions/dmg-mode-acid2.bmp\|\
c9e944b7e01078bdeba1819bc2fa9372b111f52d\ \ .github/actions/dmg_sound-2.bmp\|\
f0172cc91867d3343fbd113a2bb98100074be0de\ \ .github/actions/oam_bug-2.bmp\
\)`
if [ -n "$FAILED_TESTS" ] ; then
echo "Failed the following tests:"
echo $FAILED_TESTS | tr " " "\n" | grep -o -E "[^/]+\.bmp" | sed s/.bmp// | sort
exit 1
fi
echo Passed all tests

30
bsnes/gb/.github/actions/update_libretro.sh vendored Executable file
View File

@@ -0,0 +1,30 @@
set -ex
git fetch --tags
LATEST=$(git tag --sort=-creatordate | grep "^v" | grep -v libretro | head -n 1)
if [ $(git tag -l "$LATEST"-libretro) ]; then
echo "The libretro branch is already up-to-date"
exit 0
fi
git config --global --add --bool push.autoSetupRemote true
git config --global user.name 'Libretro Updater'
git config --global user.email '<>'
cp libretro/gitlab-ci.yml .gitlab-ci.yml
echo "Switching to tag $LATEST"
git branch --delete libretro || true
git checkout tags/$LATEST -b libretro
echo "Building boot ROMs..."
make -j bootroms
echo "Updating branch"
mv build/bin/BootROMs BootROMs/prebuilt
git add BootROMs/prebuilt/* .gitlab-ci.yml
git commit -m "Update libretro branch to $LATEST"
git tag "$LATEST"-libretro
git push --force
git push --tags

28
bsnes/gb/.github/workflows/libretro.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: "libretro branch update"
on:
push:
branches:
- master
jobs:
libretro-prebuilt-update:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
name: Checkout
with:
repository: LIJI32/SameBoy
token: ${{ secrets.WEBSITETOKEN }}
submodules: false
- name: Install Deps
shell: bash
run: |
./.github/actions/install_deps.sh ${{ matrix.os }}
- name: Build Boot ROMs and Push
run: |
./.github/actions/update_libretro.sh

44
bsnes/gb/.github/workflows/sanity.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: "Bulidability and Sanity"
on:
push:
branches:
- master
- '*'
- '!libretro'
jobs:
sanity:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, ubuntu-22.04]
cc: [gcc, clang]
include:
- os: macos-latest
cc: clang
extra_targets: cocoa ios-ipa ios-deb
exclude:
- os: macos-latest
cc: gcc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install deps
shell: bash
run: |
./.github/actions/install_deps.sh ${{ matrix.os }}
- name: Build
run: |
${{ matrix.cc }} -v; (make -j all CONF=release CC=${{ matrix.cc }} || (echo "==== Build Failed ==="; make all CONF=release CC=${{ matrix.cc }}))
- name: Sanity tests
shell: bash
run: |
./.github/actions/sanity_tests.sh
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: sameboy-canary-${{ matrix.os }}-${{ matrix.cc }}
path: |
build/bin
build/lib
build/include

1
bsnes/gb/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
build

View File

@@ -0,0 +1,12 @@
#import <Foundation/Foundation.h>
#import <Core/gb.h>
@interface GBAudioClient : NSObject
@property (nonatomic, strong) void (^renderBlock)(UInt32 sampleRate, UInt32 nFrames, GB_sample_t *buffer);
@property (nonatomic, readonly) UInt32 rate;
@property (nonatomic, readonly, getter=isPlaying) bool playing;
- (void)start;
- (void)stop;
- (id)initWithRendererBlock:(void (^)(UInt32 sampleRate, UInt32 nFrames, GB_sample_t *buffer)) block
andSampleRate:(UInt32) rate;
@end

View File

@@ -0,0 +1,134 @@
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import "GBAudioClient.h"
static OSStatus render(
GBAudioClient *self,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData)
{
GB_sample_t *buffer = (GB_sample_t *)ioData->mBuffers[0].mData;
self.renderBlock(self.rate, inNumberFrames, buffer);
return noErr;
}
@implementation GBAudioClient
{
AudioComponentInstance audioUnit;
}
- (id)initWithRendererBlock:(void (^)(UInt32 sampleRate, UInt32 nFrames, GB_sample_t *buffer)) block
andSampleRate:(UInt32) rate
{
if (!(self = [super init])) {
return nil;
}
// Configure the search parameters to find the default playback output unit
// (called the kAudioUnitSubType_RemoteIO on iOS but
// kAudioUnitSubType_DefaultOutput on Mac OS X)
AudioComponentDescription defaultOutputDescription;
defaultOutputDescription.componentType = kAudioUnitType_Output;
#if TARGET_OS_IPHONE
defaultOutputDescription.componentSubType = kAudioUnitSubType_RemoteIO;
#else
defaultOutputDescription.componentSubType = kAudioUnitSubType_DefaultOutput;
#endif
defaultOutputDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
defaultOutputDescription.componentFlags = 0;
defaultOutputDescription.componentFlagsMask = 0;
// Get the default playback output unit
AudioComponent defaultOutput = AudioComponentFindNext(NULL, &defaultOutputDescription);
if (!defaultOutput) {
NSLog(@"Can't find default output");
return nil;
}
// Create a new unit based on this that we'll use for output
OSErr err = AudioComponentInstanceNew(defaultOutput, &audioUnit);
if (!audioUnit) {
NSLog(@"Error creating unit: %hd", err);
return nil;
}
// Set our tone rendering function on the unit
AURenderCallbackStruct input;
input.inputProc = (void*)render;
input.inputProcRefCon = (__bridge void *)(self);
err = AudioUnitSetProperty(audioUnit,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input,
0,
&input,
sizeof(input));
if (err) {
NSLog(@"Error setting callback: %hd", err);
return nil;
}
AudioStreamBasicDescription streamFormat;
streamFormat.mSampleRate = rate;
streamFormat.mFormatID = kAudioFormatLinearPCM;
streamFormat.mFormatFlags =
kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked | kAudioFormatFlagsNativeEndian;
streamFormat.mBytesPerPacket = 4;
streamFormat.mFramesPerPacket = 1;
streamFormat.mBytesPerFrame = 4;
streamFormat.mChannelsPerFrame = 2;
streamFormat.mBitsPerChannel = 2 * 8;
err = AudioUnitSetProperty (audioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
0,
&streamFormat,
sizeof(AudioStreamBasicDescription));
if (err) {
NSLog(@"Error setting stream format: %hd", err);
return nil;
}
err = AudioUnitInitialize(audioUnit);
if (err) {
NSLog(@"Error initializing unit: %hd", err);
return nil;
}
self.renderBlock = block;
_rate = rate;
return self;
}
-(void) start
{
OSErr err = AudioOutputUnitStart(audioUnit);
if (err) {
NSLog(@"Error starting unit: %hd", err);
return;
}
_playing = true;
}
-(void) stop
{
AudioOutputUnitStop(audioUnit);
_playing = false;
}
-(void) dealloc
{
[self stop];
AudioUnitUninitialize(audioUnit);
AudioComponentInstanceDispose(audioUnit);
}
@end

View File

@@ -0,0 +1,36 @@
#import <TargetConditionals.h>
#if TARGET_OS_IPHONE
#define NSView UIView
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#import <Core/gb.h>
typedef enum {
GB_FRAME_BLENDING_MODE_DISABLED,
GB_FRAME_BLENDING_MODE_SIMPLE,
GB_FRAME_BLENDING_MODE_ACCURATE,
GB_FRAME_BLENDING_MODE_ACCURATE_EVEN = GB_FRAME_BLENDING_MODE_ACCURATE,
GB_FRAME_BLENDING_MODE_ACCURATE_ODD,
} GB_frame_blending_mode_t;
@interface GBViewBase : NSView
{
@public
GB_gameboy_t *_gb;
}
@property (nonatomic) GB_gameboy_t *gb;
@property (nonatomic) GB_frame_blending_mode_t frameBlendingMode;
@property (nonatomic, strong) NSView *internalView;
- (void) flip;
- (uint32_t *) pixels;
- (void)screenSizeChanged;
- (void) createInternalView;
- (uint32_t *)currentBuffer;
- (uint32_t *)previousBuffer;
- (instancetype)mirroredView;
@end

View File

@@ -0,0 +1,121 @@
#import "GBViewBase.h"
@implementation GBViewBase
{
uint32_t *_imageBuffers[3];
unsigned _currentBuffer;
GB_frame_blending_mode_t _frameBlendingMode;
bool _oddFrame;
GBViewBase *_parent;
__weak GBViewBase *_child;
}
- (void)screenSizeChanged
{
if (_parent) return;
if (_imageBuffers[0]) free(_imageBuffers[0]);
if (_imageBuffers[1]) free(_imageBuffers[1]);
if (_imageBuffers[2]) free(_imageBuffers[2]);
size_t buffer_size = sizeof(_imageBuffers[0][0]) * GB_get_screen_width(_gb) * GB_get_screen_height(_gb);
_imageBuffers[0] = calloc(1, buffer_size);
_imageBuffers[1] = calloc(1, buffer_size);
_imageBuffers[2] = calloc(1, buffer_size);
}
- (void)flip
{
if (_parent) return;
_currentBuffer = (_currentBuffer + 1) % self.numberOfBuffers;
_oddFrame = GB_is_odd_frame(_gb);
[_child flip];
}
- (unsigned) numberOfBuffers
{
assert(!_parent);
return _frameBlendingMode? 3 : 2;
}
- (void) createInternalView
{
assert(false && "createInternalView must not be inherited");
}
- (uint32_t *)currentBuffer
{
if (GB_unlikely(_parent)) {
return [_parent currentBuffer];
}
return _imageBuffers[_currentBuffer];
}
- (uint32_t *)previousBuffer
{
if (GB_unlikely(_parent)) {
return [_parent previousBuffer];
}
return _imageBuffers[(_currentBuffer + 2) % self.numberOfBuffers];
}
- (uint32_t *) pixels
{
assert(!_parent);
return _imageBuffers[(_currentBuffer + 1) % self.numberOfBuffers];
}
- (void) setFrameBlendingMode:(GB_frame_blending_mode_t)frameBlendingMode
{
_frameBlendingMode = frameBlendingMode;
[self setNeedsDisplay];
[_child setNeedsDisplay];
}
- (GB_frame_blending_mode_t)frameBlendingMode
{
if (GB_unlikely(_parent)) {
return [_parent frameBlendingMode];
}
if (_frameBlendingMode == GB_FRAME_BLENDING_MODE_ACCURATE) {
if (!_gb || GB_is_sgb(_gb)) {
return GB_FRAME_BLENDING_MODE_SIMPLE;
}
return _oddFrame ? GB_FRAME_BLENDING_MODE_ACCURATE_ODD : GB_FRAME_BLENDING_MODE_ACCURATE_EVEN;
}
return _frameBlendingMode;
}
- (void)dealloc
{
if (_parent) return;
free(_imageBuffers[0]);
free(_imageBuffers[1]);
free(_imageBuffers[2]);
}
#if !TARGET_OS_IPHONE
- (void)setNeedsDisplay
{
[self setNeedsDisplay:true];
}
#endif
- (void)setGb:(GB_gameboy_t *)gb
{
assert(!_parent);
_gb = gb;
if (_child) {
_child->_gb = gb;
}
}
- (instancetype)mirroredView
{
if (_child) return _child;
GBViewBase *ret = [[self.class alloc] initWithFrame:self.bounds];
ret->_parent = self;
ret->_gb = _gb;
return _child = ret;
}
@end

View File

@@ -0,0 +1,11 @@
#import <TargetConditionals.h>
#import <MetalKit/MetalKit.h>
#if TARGET_OS_IPHONE
#import "../iOS/GBView.h"
#else
#import "../Cocoa/GBView.h"
#endif
@interface GBViewMetal : GBView<MTKViewDelegate>
+ (bool) isSupported;
@end

View File

@@ -0,0 +1,266 @@
#import <CoreImage/CoreImage.h>
#import "GBViewMetal.h"
#pragma clang diagnostic ignored "-Wpartial-availability"
#if !TARGET_OS_IPHONE
#import "../Cocoa/NSObject+DefaultsObserver.h"
#endif
static const vector_float2 rect[] =
{
{-1, -1},
{ 1, -1},
{-1, 1},
{ 1, 1},
};
@implementation GBViewMetal
{
id<MTLDevice> _device;
id<MTLTexture> _texture, _previousTexture;
id<MTLBuffer> _vertices;
id<MTLRenderPipelineState> _pipelineState;
id<MTLCommandQueue> _commandQueue;
id<MTLBuffer> _frameBlendingModeBuffer;
id<MTLBuffer> _outputResolutionBuffer;
vector_float2 _outputResolution;
id<MTLCommandBuffer> _commandBuffer;
bool _waitedForFrame;
_Atomic unsigned _pendingFrames;
}
+ (bool)isSupported
{
#if TARGET_OS_IPHONE
return true;
#else
if (MTLCopyAllDevices) {
return [MTLCopyAllDevices() count];
}
return false;
#endif
}
- (void) allocateTextures
{
if (!_device) return;
MTLTextureDescriptor *texture_descriptor = [[MTLTextureDescriptor alloc] init];
texture_descriptor.pixelFormat = MTLPixelFormatRGBA8Unorm;
texture_descriptor.width = GB_get_screen_width(self.gb);
texture_descriptor.height = GB_get_screen_height(self.gb);
_texture = [_device newTextureWithDescriptor:texture_descriptor];
_previousTexture = [_device newTextureWithDescriptor:texture_descriptor];
}
- (void)createInternalView
{
MTKView *view = [[MTKView alloc] initWithFrame:self.frame device:(_device = MTLCreateSystemDefaultDevice())];
view.delegate = self;
self.internalView = view;
view.paused = true;
view.enableSetNeedsDisplay = true;
view.framebufferOnly = false;
_vertices = [_device newBufferWithBytes:rect
length:sizeof(rect)
options:MTLResourceStorageModeShared];
static const GB_frame_blending_mode_t default_blending_mode = GB_FRAME_BLENDING_MODE_DISABLED;
_frameBlendingModeBuffer = [_device newBufferWithBytes:&default_blending_mode
length:sizeof(default_blending_mode)
options:MTLResourceStorageModeShared];
_outputResolutionBuffer = [_device newBufferWithBytes:&_outputResolution
length:sizeof(_outputResolution)
options:MTLResourceStorageModeShared];
_outputResolution = (simd_float2){view.drawableSize.width, view.drawableSize.height};
/* TODO: NSObject+DefaultsObserver can replace the less flexible `addDefaultObserver` in iOS */
#if TARGET_OS_IPHONE
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadShader) name:@"GBFilterChanged" object:nil];
[self loadShader];
#else
[self observeStandardDefaultsKey:@"GBFilter" selector:@selector(loadShader)];
#endif
}
- (void)loadShader
{
NSError *error = nil;
NSString *shader_source = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"MasterShader"
ofType:@"metal"
inDirectory:@"Shaders"]
encoding:NSUTF8StringEncoding
error:nil];
NSString *shader_name = [[NSUserDefaults standardUserDefaults] objectForKey:@"GBFilter"];
NSString *scaler_source = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:shader_name
ofType:@"fsh"
inDirectory:@"Shaders"]
encoding:NSUTF8StringEncoding
error:nil];
shader_source = [shader_source stringByReplacingOccurrencesOfString:@"{filter}"
withString:scaler_source];
MTLCompileOptions *options = [[MTLCompileOptions alloc] init];
options.fastMathEnabled = true;
id<MTLLibrary> library = [_device newLibraryWithSource:shader_source
options:options
error:&error];
if (error) {
NSLog(@"Error: %@", error);
if (!library) {
return;
}
}
id<MTLFunction> vertex_function = [library newFunctionWithName:@"vertex_shader"];
id<MTLFunction> fragment_function = [library newFunctionWithName:@"fragment_shader"];
// Set up a descriptor for creating a pipeline state object
MTLRenderPipelineDescriptor *pipeline_state_descriptor = [[MTLRenderPipelineDescriptor alloc] init];
pipeline_state_descriptor.vertexFunction = vertex_function;
pipeline_state_descriptor.fragmentFunction = fragment_function;
pipeline_state_descriptor.colorAttachments[0].pixelFormat = ((MTKView *)self.internalView).colorPixelFormat;
error = nil;
_pipelineState = [_device newRenderPipelineStateWithDescriptor:pipeline_state_descriptor
error:&error];
if (error) {
NSLog(@"Failed to created pipeline state, error %@", error);
return;
}
_commandQueue = [_device newCommandQueue];
}
- (void)mtkView:(MTKView *)view drawableSizeWillChange:(CGSize)size
{
_outputResolution = (vector_float2){size.width, size.height};
dispatch_async(dispatch_get_main_queue(), ^{
[(MTKView *)self.internalView draw];
});
}
- (void)drawInMTKView:(MTKView *)view
{
#if !TARGET_OS_IPHONE
if (!(view.window.occlusionState & NSWindowOcclusionStateVisible)) return;
#endif
if (!self.gb) return;
if (_texture.width != GB_get_screen_width(self.gb) ||
_texture.height != GB_get_screen_height(self.gb)) {
[self allocateTextures];
}
MTLRegion region = {
{0, 0, 0}, // MTLOrigin
{_texture.width, _texture.height, 1} // MTLSize
};
/* Don't start rendering if the previous frame hasn't finished yet. Either wait, or skip the frame */
if (_commandBuffer && _commandBuffer.status != MTLCommandBufferStatusCompleted) {
if (_waitedForFrame) return;
[_commandBuffer waitUntilCompleted];
_waitedForFrame = true;
}
else {
_waitedForFrame = false;
}
GB_frame_blending_mode_t mode = [self frameBlendingMode];
[_texture replaceRegion:region
mipmapLevel:0
withBytes:[self currentBuffer]
bytesPerRow:_texture.width * 4];
if (mode) {
[_previousTexture replaceRegion:region
mipmapLevel:0
withBytes:[self previousBuffer]
bytesPerRow:_texture.width * 4];
}
MTLRenderPassDescriptor *renderPassDescriptor = view.currentRenderPassDescriptor;
_commandBuffer = [_commandQueue commandBuffer];
if (renderPassDescriptor) {
*(GB_frame_blending_mode_t *)[_frameBlendingModeBuffer contents] = mode;
*(vector_float2 *)[_outputResolutionBuffer contents] = _outputResolution;
id<MTLRenderCommandEncoder> renderEncoder =
[_commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor];
[renderEncoder setViewport:(MTLViewport){0.0, 0.0,
_outputResolution.x,
_outputResolution.y,
-1.0, 1.0}];
[renderEncoder setRenderPipelineState:_pipelineState];
[renderEncoder setVertexBuffer:_vertices
offset:0
atIndex:0];
[renderEncoder setFragmentBuffer:_frameBlendingModeBuffer
offset:0
atIndex:0];
[renderEncoder setFragmentBuffer:_outputResolutionBuffer
offset:0
atIndex:1];
[renderEncoder setFragmentTexture:_texture
atIndex:0];
[renderEncoder setFragmentTexture:_previousTexture
atIndex:1];
[renderEncoder drawPrimitives:MTLPrimitiveTypeTriangleStrip
vertexStart:0
vertexCount:4];
[renderEncoder endEncoding];
[_commandBuffer presentDrawable:view.currentDrawable];
}
[_commandBuffer commit];
}
- (void)flip
{
[super flip];
if (_pendingFrames == 2) return;
_pendingFrames++;
dispatch_async(dispatch_get_main_queue(), ^{
[(MTKView *)self.internalView draw];
_pendingFrames--;
});
}
#if !TARGET_OS_IPHONE
- (NSImage *)renderToImage
{
CIImage *ciImage = [CIImage imageWithMTLTexture:[[(MTKView *)self.internalView currentDrawable] texture]
options:@{
kCIImageColorSpace: (__bridge_transfer id)CGColorSpaceCreateDeviceRGB(),
kCIImageProperties: [NSNull null]
}];
ciImage = [ciImage imageByApplyingTransform:CGAffineTransformTranslate(CGAffineTransformMakeScale(1, -1),
0, ciImage.extent.size.height)];
CIContext *context = [CIContext context];
CGImageRef cgImage = [context createCGImage:ciImage fromRect:ciImage.extent];
NSImage *ret = [[NSImage alloc] initWithCGImage:cgImage size:self.internalView.bounds.size];
CGImageRelease(cgImage);
return ret;
}
#endif
@end

259
bsnes/gb/BESS.md Normal file
View File

@@ -0,0 +1,259 @@
# BESS Best Effort Save State 1.0
## Motivation
BESS is a save state format specification designed to allow different emulators, as well as majorly different versions of the same emulator, to import save states from other BESS-compliant save states. BESS works by appending additional, implementation-agnostic information about the emulation state. This allows a single save state file to be read as both a fully-featured, implementation specific save state which includes detailed timing information; and as a portable "best effort" save state that represents a state accurately enough to be restored in casual use-cases.
## Specification
Every integer used in the BESS specification is stored in Little Endian encoding.
### BESS footer
BESS works by appending a detectable footer at the end of an existing save state format. The footer uses the following format:
| Offset from end of file | Content |
|-------------------------|-------------------------------------------------------|
| -8 | Offset to the first BESS Block, from the file's start |
| -4 | The ASCII string 'BESS' |
### BESS blocks
BESS uses a block format where each block contains the following header:
| Offset | Content |
|--------|-----------------------------------------------------------|
| 0 | A four-letter ASCII identifier |
| 4 | Length of the block as a 32-bit integer, excluding header |
Every block is followed by another block, until the END block is reached. If an implementation encounters an unsupported block, it should be completely ignored (Should not have any effect and should not trigger a failure).
#### NAME block
The NAME block uses the `'NAME'` identifier, and is an optional block that contains the name of the emulator that created this save state. While optional, it is highly recommended to be included in every implementation it allows the user to know which emulator and version is compatible with the native save state format contained in this file. When used, this block should come first.
The length of the NAME block is variable, and it only contains the name and version of the originating emulator in ASCII.
#### INFO block
The INFO block uses the `'INFO'` identifier, and is an optional block that contains information about the ROM this save state originates from. When used, this block should come before `CORE` but after `NAME`. This block is 0x12 bytes long, and it follows this structure:
| Offset | Content |
|--------|--------------------------------------------------|
| 0x00 | Bytes 0x134-0x143 from the ROM (Title) |
| 0x10 | Bytes 0x14E-0x14F from the ROM (Global checksum) |
#### CORE block
The CORE block uses the `'CORE'` identifier, and is a required block that contains both core state information, as well as basic information about the BESS version used. This block must be the first block, unless the `NAME` or `INFO` blocks exist then it must come directly after them. An implementation should not enforce block order on blocks unknown to it for future compatibility.
The length of the CORE block is 0xD0 bytes, but implementations are expected to ignore any excess bytes. Following the BESS block header, the structure is as follows:
| Offset | Content |
|--------|----------------------------------------|
| 0x00 | Major BESS version as a 16-bit integer |
| 0x02 | Minor BESS version as a 16-bit integer |
Both major and minor versions should be 1. Implementations are expected to reject incompatible majors, but still attempt to read newer minor versions.
| Offset | Content |
|--------|----------------------------------------|
| 0x04 | A four-character ASCII model identifier |
BESS uses a four-character string to identify Game Boy models:
* The first letter represents mutually-incompatible families of models and is required. The allowed values are `'G'` for the original Game Boy family, `'S'` for the Super Game Boy family, and `'C'` for the Game Boy Color and Advance family.
* The second letter represents a specific model within the family, and is optional (If an implementation does not distinguish between specific models in a family, a space character may be used). The allowed values for family G are `'D'` for DMG and `'M'` for MGB; the allowed values for family S are `'N'` for NTSC, `'P'` for PAL, and `'2'` for SGB2; and the allowed values for family C are `'C'` for CGB, and `'A'` for the various GBA line models.
* The third letter represents a specific CPU revision within a model, and is optional (If an implementation does not distinguish between revisions, a space character may be used). The allowed values for model GD (DMG) are `'0'` and `'A'`, through `'C'`; the allowed values for model CC (CGB) are `'0'` and `'A'`, through `'E'`; the allowed values for model CA (AGB, AGS, GBP) are `'0'`, `'A'` and `'B'`; and for every other model this value must be a space character.
* The last character is used for padding and must be a space character.
For example; `'GD '` represents a DMG of an unspecified revision, `'S '` represents some model of the SGB family, and `'CCE '` represent a CGB using CPU revision E.
| Offset | Content |
|--------|--------------------------------------------------------|
| 0x08 | The value of the PC register |
| 0x0A | The value of the AF register |
| 0x0C | The value of the BC register |
| 0x0E | The value of the DE register |
| 0x10 | The value of the HL register |
| 0x12 | The value of the SP register |
| 0x14 | The value of IME (0 or 1) |
| 0x15 | The value of the IE register |
| 0x16 | Execution state (0 = running; 1 = halted; 2 = stopped) |
| 0x17 | Reserved, must be 0 |
| 0x18 | The values of every memory-mapped register (128 bytes) |
The values of memory-mapped registers should be written 'as-is' to memory as if the actual ROM wrote them, with the following exceptions and note:
* Unused registers have Don't-Care values which should be ignored
* Unused register bits have Don't-Care values which should be ignored
* If the model is CGB or newer, the value of KEY0 (FF4C) must be valid as it determines DMG mode
* Bit 2 determines DMG mode. A value of 0x04 usually denotes DMG mode, while a value of `0x80` usually denotes CGB mode.
* Object priority is derived from KEY0 (FF4C) instead of OPRI (FF6C) because OPRI can be modified after booting, but only the value of OPRI during boot ROM execution takes effect
* If a register doesn't exist on the emulated model (For example, KEY0 (FF4C) on a DMG), its value should be ignored.
* BANK (FF50) should be 0 if the boot ROM is still mapped, and 1 otherwise, and must be valid.
* Implementations should not start a serial transfer when writing the value of SB
* Similarly, no value of NRx4 should trigger a sound pulse on save state load
* And similarly again, implementations should not trigger DMA transfers when writing the values of DMA or HDMA5
* The value store for DIV will be used to set the internal divisor to `DIV << 8`
* Implementation should apply care when ordering the write operations (For example, writes to NR52 must come before writes to the other APU registers)
| Offset | Content |
|--------|--------------------------------------------------------------------|
| 0x98 | The size of RAM (32-bit integer) |
| 0x9C | The offset of RAM from file start (32-bit integer) |
| 0xA0 | The size of VRAM (32-bit integer) |
| 0xA4 | The offset of VRAM from file start (32-bit integer) |
| 0xA8 | The size of MBC RAM (32-bit integer) |
| 0xAC | The offset of MBC RAM from file start (32-bit integer) |
| 0xB0 | The size of OAM (=0xA0, 32-bit integer) |
| 0xB4 | The offset of OAM from file start (32-bit integer) |
| 0xB8 | The size of HRAM (=0x7F, 32-bit integer) |
| 0xBC | The offset of HRAM from file start (32-bit integer) |
| 0xC0 | The size of background palettes (=0x40 or 0, 32-bit integer) |
| 0xC4 | The offset of background palettes from file start (32-bit integer) |
| 0xC8 | The size of object palettes (=0x40 or 0, 32-bit integer) |
| 0xCC | The offset of object palettes from file start (32-bit integer) |
The contents of large buffers are stored outside of BESS structure so data from an implementation's native save state format can be reused. The offsets are absolute offsets from the save state file's start. Background and object palette sizes must be 0 for models prior to Game Boy Color.
An implementation needs handle size mismatches gracefully. For example, if too large MBC RAM size is specified, the superfluous data should be ignored. On the other hand, if a too small VRAM size is specified (For example, if it's a save state from an emulator emulating a CGB in DMG mode, and it didn't save the second CGB VRAM bank), the implementation is expected to set that extra bank to all zeros.
#### XOAM block
The XOAM block uses the `'XOAM'` identifier, and is an optional block that contains the data of extra OAM (addresses `0xFEA0-0xFEFF`). This block length must be `0x60`. Implementations that do not emulate this extra range are free to ignore the excess bytes, and to not create this block.
#### MBC block
The MBC block uses the `'MBC '` identifier, and is an optional block that is only used when saving states of ROMs that use an MBC. The length of this block is variable and must be divisible by 3.
This block contains an MBC-specific number of 3-byte-long pairs that represent the values of each MBC register. For example, for MBC5 the contents would look like:
| Offset | Content |
|--------|---------------------------------------|
| 0x0 | The value 0x0000 as a 16-bit integer |
| 0x2 | 0x0A if RAM is enabled, 0 otherwise |
| 0x3 | The value 0x2000 as a 16-bit integer |
| 0x5 | The lower 8 bits of the ROM bank |
| 0x6 | The value 0x3000 as a 16-bit integer |
| 0x8 | The bit 9 of the ROM bank |
| 0x9 | The value 0x4000 as a 16-bit integer |
| 0xB | The current RAM bank |
An implementation should parse this block as a series of writes to be made. Values outside the `0x0000-0x7FFF` and `0xA000-0xBFFF` ranges are not allowed. Implementations must perform the writes in order (i.e. not reverse, sorted, or any other transformation on their order)
#### RTC block
The RTC block uses the `'RTC '` identifier, and is an optional block that is used while emulating an MBC3 with an RTC. The contents of this block are identical to 64-bit RTC saves from VBA, which are also used by SameBoy and different emulators such as BGB.
The length of this block is 0x30 bytes long and it follows the following structure:
| Offset | Content |
|--------|------------------------------------------------------------------------|
| 0x00 | Current seconds (1 byte), followed by 3 bytes of padding |
| 0x04 | Current minutes (1 byte), followed by 3 bytes of padding |
| 0x08 | Current hours (1 byte), followed by 3 bytes of padding |
| 0x0C | Current days (1 byte), followed by 3 bytes of padding |
| 0x10 | Current high/overflow/running (1 byte), followed by 3 bytes of padding |
| 0x14 | Latched seconds (1 byte), followed by 3 bytes of padding |
| 0x18 | Latched minutes (1 byte), followed by 3 bytes of padding |
| 0x1C | Latched hours (1 byte), followed by 3 bytes of padding |
| 0x20 | Latched days (1 byte), followed by 3 bytes of padding |
| 0x24 | Latched high/overflow/running (1 byte), followed by 3 bytes of padding |
| 0x28 | UNIX timestamp at the time of the save state (64-bit) |
#### HUC3 block
The HUC3 block uses the `'HUC3'` identifier, and is an optional block that is used while emulating an HuC3 cartridge to store RTC and alarm information. The contents of this block are identical to HuC3 RTC saves from SameBoy.
The length of this block is 0x11 bytes long and it follows the following structure:
| Offset | Content |
|--------|-------------------------------------------------------|
| 0x00 | UNIX timestamp at the time of the save state (64-bit) |
| 0x08 | RTC minutes (16-bit) |
| 0x0A | RTC days (16-bit) |
| 0x0C | Scheduled alarm time minutes (16-bit) |
| 0x0E | Scheduled alarm time days (16-bit) |
| 0x10 | Alarm enabled flag (8-bits, either 0 or 1) |
#### TPP1 block
The TPP1 block uses the `'TPP1'` identifier, and is an optional block that is used while emulating a TPP1 cartridge to store RTC information. This block can be omitted if the ROM header does not specify the inclusion of a RTC.
The length of this block is 0x11 bytes long and it follows the following structure:
| Offset | Content |
|--------|-------------------------------------------------------|
| 0x00 | UNIX timestamp at the time of the save state (64-bit) |
| 0x08 | The current RTC data (4 bytes) |
| 0x0C | The latched RTC data (4 bytes) |
| 0x10 | The value of the MR4 register (8-bits) |
#### MBC7 block
The MBC7 block uses the `'MBC7'` identifier, and is an optional block that is used while emulating an MBC7 cartridge to store the EEPROM communication state and motion control state.
The length of this block is 0xA bytes long and it follows the following structure:
| Offset | Content |
|--------|-------------------------------------------------------|
| 0x00 | Flags (8-bits) |
| 0x01 | Argument bits left (8-bits) |
| 0x02 | Current EEPROM command (16-bits) |
| 0x04 | Pending bits to read (16-bits) |
| 0x06 | Latched gyro X value (16-bits) |
| 0x08 | Latched gyro Y value (16-bits) |
The meaning of the individual bits in flags are:
* Bit 0: Latch ready; set after writing `0x55` to `0xAX0X` and reset after writing `0xAA` to `0xAX1X`
* Bit 1: EEPROM DO line
* Bit 2: EEPROM DI line
* Bit 3: EEPROM CLK line
* Bit 4: EEPROM CS line
* Bit 5: EEPROM write enable; set after an `EWEN` command, reset after an `EWDS` command
* Bits 6-7: Unused.
The current EEPROM command field has bits pushed to its LSB first, padded with zeros. For example, if the ROM clocked a single `1` bit, this field should contain `0b1`; if the ROM later clocks a `0` bit, this field should contain `0b10`.
If the currently transmitted command has an argument, the "Argument bits left" field should contain the number argument bits remaining. Otherwise, it should contain 0.
The "Pending bits to read" field contains the pending bits waiting to be shifted into the DO signal, MSB first, padded with ones.
#### SGB block
The SGB block uses the `'SGB '` identifier, and is an optional block that is only used while emulating an SGB or SGB2 *and* SGB commands enabled. Implementations must not save this block on other models or when SGB commands are disabled, and should assume SGB commands are disabled if this block is missing.
The length of this block is 0x39 bytes, but implementations should allow and ignore excess data in this block for extensions. The block follows the following structure:
| Offset | Content |
|--------|--------------------------------------------------------------------------------------------------------------------------|
| 0x00 | The size of the border tile data (=0x2000, 32-bit integer) |
| 0x04 | The offset of the border tile data (SNES tile format, 32-bit integer) |
| 0x08 | The size of the border tilemap (=0x800, 32-bit integer) |
| 0x0C | The offset of the border tilemap (LE 16-bit sequences, 32-bit integer) |
| 0x10 | The size of the border palettes (=0x80, 32-bit integer) |
| 0x14 | The offset of the border palettes (LE 16-bit sequences, 32-bit integer) |
| 0x18 | The size of active colorization palettes (=0x20, 32-bit integer) |
| 0x1C | The offset of the active colorization palettes (LE 16-bit sequences, 32-bit integer) |
| 0x20 | The size of RAM colorization palettes (=0x1000, 32-bit integer) |
| 0x24 | The offset of the RAM colorization palettes (LE 16-bit sequences, 32-bit integer) |
| 0x28 | The size of the attribute map (=0x168, 32-bit integer) |
| 0x2C | The offset of the attribute map (32-bit integer) |
| 0x30 | The size of the attribute files (=0xfd2, 32-bit integer) |
| 0x34 | The offset of the attribute files (32-bit integer) |
| 0x38 | Multiplayer status (1 byte); high nibble is player count (1, 2 or 4), low nibble is current player (Where Player 1 is 0) |
If only some of the size-offset pairs are available (for example, partial HLE SGB implementation), missing fields are allowed to have 0 as their size, and implementations are expected to fall back to a sane default.
#### END block
The END block uses the `'END '` identifier, and is a required block that marks the end of BESS data. Naturally, it must be the last block. The length of the END block must be 0.
## Validation and Failures
Other than previously specified required fail conditions, an implementation is free to decide what format errors should abort the loading of a save file. Structural errors (e.g. a block with an invalid length, a file offset that is outside the file's range, or a missing END block) should be considered as irrecoverable errors. Other errors that are considered fatal by SameBoy's implementation:
* Duplicate CORE block
* A known block, other than NAME, appearing before CORE
* An invalid length for the XOAM, RTC, SGB or HUC3 blocks
* An invalid length of MBC (not a multiple of 3)
* A write outside the $0000-$7FFF and $A000-$BFFF ranges in the MBC block
* An SGB block on a save state targeting another model
* An END block with non-zero length

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

View File

@@ -0,0 +1,2 @@
DEF AGB = 1
include "cgb_boot.asm"

View File

@@ -0,0 +1,2 @@
DEF CGB0 = 1
include "cgb_boot.asm"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
DEF FAST = 1
include "cgb_boot.asm"

View File

@@ -0,0 +1,196 @@
; SameBoy DMG bootstrap ROM
include "sameboot.inc"
SECTION "BootCode", ROM0[$0000]
Start:
; Init stack pointer
ld sp, $FFFE
; Clear memory VRAM
ld hl, _VRAM
xor a
.clearVRAMLoop
ldi [hl], a
bit 5, h
jr z, .clearVRAMLoop
; Init Audio
ld a, AUDENA_ON
ldh [rNR52], a
assert AUDENA_ON == AUDLEN_DUTY_50
ldh [rNR11], a
ld a, $F3
ldh [rNR12], a ; Envelope $F, decreasing, sweep $3
ldh [rNR51], a ; Channels 1+2+3+4 left, channels 1+2 right
ld a, $77
ldh [rNR50], a ; Volume $7, left and right
; Init BG palette
ld a, %01_01_01_00
ldh [rBGP], a
; Load logo from ROM.
; A nibble represents a 4-pixels line, 2 bytes represent a 4x4 tile, scaled to 8x8.
; Tiles are ordered left to right, top to bottom.
ld de, NintendoLogo
ld hl, _VRAM + $10 ; This is where we load the tiles in VRAM
.loadLogoLoop
ld a, [de] ; Read 2 rows
ld b, a
call DoubleBitsAndWriteRow
call DoubleBitsAndWriteRow
inc de
ld a, e
xor LOW(NintendoLogoEnd)
jr nz, .loadLogoLoop
; Load trademark symbol
ld de, TrademarkSymbol
ld c, TrademarkSymbolEnd - TrademarkSymbol
.loadTrademarkSymbolLoop:
ld a, [de]
inc de
ldi [hl], a
inc hl
dec c
jr nz, .loadTrademarkSymbolLoop
; Set up tilemap
ld a, $19 ; Trademark symbol tile ID
ld [_SCRN0 + 8 * SCRN_VX_B + 16], a ; ... put in the superscript position
ld hl, _SCRN0 + 9 * SCRN_VX_B + 15 ; Bottom right corner of the logo
ld c, 12 ; Tiles in a logo row
.tilemapLoop
dec a
jr z, .tilemapDone
ldd [hl], a
dec c
jr nz, .tilemapLoop
ld l, $0F ; Jump to top row
jr .tilemapLoop
.tilemapDone
ld a, 30
ldh [rSCY], a
; Turn on LCD
ld a, LCDCF_ON | LCDCF_BLK01 | LCDCF_BGON
ldh [rLCDC], a
ld d, LOW(-119)
ld c, 15
.animate
call WaitFrame
ld a, d
sra a
sra a
ldh [rSCY], a
ld a, d
add c
ld d, a
ld a, c
cp 8
jr nz, .noPaletteChange
ld a, %10_10_10_00
ldh [rBGP], a
.noPaletteChange
dec c
jr nz, .animate
ld a, %11_11_11_00
ldh [rBGP], a
; Play first sound
ld a, $83
call PlaySound
ld b, 5
call WaitBFrames
; Play second sound
ld a, $C1
call PlaySound
; Wait ~1 second
ld b, 60
call WaitBFrames
; Set registers to match the original DMG boot
IF DEF(MGB)
lb hl, BOOTUP_A_MGB, %10110000
ELSE
lb hl, BOOTUP_A_DMG, %10110000
ENDC
push hl
pop af
ld hl, HeaderChecksum
lb bc, 0, LOW(rNR13) ; $0013
lb de, 0, $D8 ; $00D8
; Boot the game
jp BootGame
DoubleBitsAndWriteRow:
; Double the most significant 4 bits, b is shifted by 4
ld a, 4
ld c, 0
.doubleCurrentBit
sla b
push af
rl c
pop af
rl c
dec a
jr nz, .doubleCurrentBit
ld a, c
; Write as two rows
ldi [hl], a
inc hl
ldi [hl], a
inc hl
ret
WaitFrame:
push hl
ld hl, rIF
res 0, [hl]
.wait
bit 0, [hl]
jr z, .wait
pop hl
ret
WaitBFrames:
call WaitFrame
dec b
jr nz, WaitBFrames
ret
PlaySound:
ldh [rNR13], a
ld a, AUDHIGH_RESTART | $7
ldh [rNR14], a
ret
TrademarkSymbol:
pusho
opt b.X
db %..XXXX..
db %.X....X.
db %X.XXX..X
db %X.X..X.X
db %X.XXX..X
db %X.X..X.X
db %.X....X.
db %..XXXX..
popo
TrademarkSymbolEnd:
SECTION "BootGame", ROM0[$00FE]
BootGame:
ldh [rBANK], a ; unmap boot ROM

1113
bsnes/gb/BootROMs/hardware.inc Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
DEF MGB = 1
include "dmg_boot.asm"

102
bsnes/gb/BootROMs/pb12.c Normal file
View File

@@ -0,0 +1,102 @@
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
static void opts(uint8_t byte, uint8_t *options)
{
*(options++) = byte | ((byte << 1) & 0xff);
*(options++) = byte & (byte << 1);
*(options++) = byte | ((byte >> 1) & 0xff);
*(options++) = byte & (byte >> 1);
}
static void write_all(int fd, const void *buf, size_t count) {
while (count) {
ssize_t written = write(fd, buf, count);
if (written < 0) {
fprintf(stderr, "write");
exit(1);
}
count -= written;
buf += written;
}
}
int main(void)
{
static uint8_t source[0x4000];
size_t size = read(STDIN_FILENO, &source, sizeof(source));
unsigned pos = 0;
assert(size <= 0x4000);
while (size && source[size - 1] == 0) {
size--;
}
uint8_t literals[8];
size_t literals_size = 0;
unsigned bits = 0;
unsigned control = 0;
unsigned prev[2] = {-1, -1}; // Unsigned to allow "not set" values
while (true) {
uint8_t byte = 0;
if (pos == size){
if (bits == 0) break;
}
else {
byte = source[pos++];
}
if (byte == prev[0] || byte == prev[1]) {
bits += 2;
control <<= 1;
control |= 1;
control <<= 1;
if (byte == prev[1]) {
control |= 1;
}
}
else {
bits += 2;
control <<= 2;
uint8_t options[4];
opts(prev[1], options);
bool found = false;
for (unsigned i = 0; i < 4; i++) {
if (options[i] == byte) {
// 01 = modify
control |= 1;
bits += 2;
control <<= 2;
control |= i;
found = true;
break;
}
}
if (!found) {
literals[literals_size++] = byte;
}
}
prev[0] = prev[1];
prev[1] = byte;
if (bits >= 8) {
uint8_t outctl = control >> (bits - 8);
assert(outctl != 1); // 1 is reserved as the end byte
write_all(STDOUT_FILENO, &outctl, 1);
write_all(STDOUT_FILENO, literals, literals_size);
bits -= 8;
control &= (1 << bits) - 1;
literals_size = 0;
}
}
uint8_t end_byte = 1;
write_all(STDOUT_FILENO, &end_byte, 1);
return 0;
}

View File

@@ -0,0 +1,40 @@
IF !DEF(SAMEBOY_INC)
DEF SAMEBOY_INC EQU 1
include "hardware.inc"
DEF rKEY0 EQU $FF4C
DEF rBANK EQU $FF50
DEF rJOYP EQU rP1
MACRO lb ; r16, high, low
ld \1, LOW(\2) << 8 | LOW(\3)
ENDM
MACRO header_section ; name, address
PUSHS
SECTION "\1", ROM0[\2]
\1:
POPS
ENDM
header_section EntryPoint, $0100
header_section NintendoLogo, $0104
header_section NintendoLogoEnd, $0134
header_section Title, $0134
header_section ManufacturerCode, $013F
header_section CGBFlag, $0143
header_section NewLicenseeCode, $0144
header_section SGBFlag, $0146
header_section CartridgeType, $0147
header_section ROMSize, $0148
header_section RAMSize, $0149
header_section DestinationCode, $014A
header_section OldLicenseeCode, $014B
header_section MaskRomVersion, $014C
header_section HeaderChecksum, $014D
header_section GlobalChecksum, $014E
ENDC

View File

@@ -0,0 +1,2 @@
DEF SGB2 = 1
include "sgb_boot.asm"

View File

@@ -0,0 +1,235 @@
; SameBoy SGB bootstrap ROM
include "sameboot.inc"
SECTION "BootCode", ROM0[$0000]
Start:
; Init stack pointer
ld sp, $FFFE
; Clear memory VRAM
ld hl, _VRAM
xor a
.clearVRAMLoop
ldi [hl], a
bit 5, h
jr z, .clearVRAMLoop
; Init Audio
ld a, AUDENA_ON
ldh [rNR52], a
assert AUDENA_ON == AUDLEN_DUTY_50
ldh [rNR11], a
ld a, $F3
ldh [rNR12], a ; Envelope $F, decreasing, sweep $3
ldh [rNR51], a ; Channels 1+2+3+4 left, channels 1+2 right
ld a, $77
ldh [rNR50], a ; Volume $7, left and right
; Init BG palette to white
ld a, %00_00_00_00
ldh [rBGP], a
; Load logo from ROM.
; A nibble represents a 4-pixels line, 2 bytes represent a 4x4 tile, scaled to 8x8.
; Tiles are ordered left to right, top to bottom.
ld de, NintendoLogo
ld hl, _VRAM + $10 ; This is where we load the tiles in VRAM
.loadLogoLoop
ld a, [de] ; Read 2 rows
ld b, a
call DoubleBitsAndWriteRow
call DoubleBitsAndWriteRow
inc de
ld a, e
xor LOW(NintendoLogoEnd)
jr nz, .loadLogoLoop
; Load trademark symbol
ld de, TrademarkSymbol
ld c, TrademarkSymbolEnd - TrademarkSymbol
.loadTrademarkSymbolLoop:
ld a, [de]
inc de
ldi [hl], a
inc hl
dec c
jr nz, .loadTrademarkSymbolLoop
; Set up tilemap
ld a, $19 ; Trademark symbol tile ID
ld [_SCRN0 + 8 * SCRN_VX_B + 16], a ; ... put in the superscript position
ld hl, _SCRN0 + 9 * SCRN_VX_B + 15 ; Bottom right corner of the logo
ld c, 12 ; Tiles in a logo row
.tilemapLoop
dec a
jr z, .tilemapDone
ldd [hl], a
dec c
jr nz, .tilemapLoop
ld l, $0F ; Jump to top row
jr .tilemapLoop
.tilemapDone
; Turn on LCD
ld a, LCDCF_ON | LCDCF_BLK01 | LCDCF_BGON
ldh [rLCDC], a
ld a, $F1 ; Packet magic, increases by 2 for every packet
ldh [hCommand], a
ld hl, NintendoLogo ; Header start
xor a
ld c, a ; JOYP
.sendCommand
xor a
ldh [c], a
ld a, $30
ldh [c], a
ldh a, [hCommand]
call SendByte
push hl
ld b, 14
ld d, 0
.checksumLoop
call ReadHeaderByte
add d
ld d, a
dec b
jr nz, .checksumLoop
; Send checksum
call SendByte
pop hl
ld b, 14
.sendLoop
call ReadHeaderByte
call SendByte
dec b
jr nz, .sendLoop
; Done bit
ld a, $20
ldh [c], a
ld a, $30
ldh [c], a
; Wait 4 frames
ld e, 4
ld a, 1
ldh [rIE], a
xor a
.waitLoop
ldh [rIF], a
halt
nop
dec e
jr nz, .waitLoop
ldh [rIE], a
; Update command
ldh a, [hCommand]
add 2
ldh [hCommand], a
ld a, $58
cp l
jr nz, .sendCommand
; Write to sound registers for DMG compatibility
ld c, LOW(rNR13)
ld a, $C1
ldh [c], a
inc c
ld a, $7
ldh [c], a
; Init BG palette
ld a, %11_11_11_00
ldh [rBGP], a
; Set registers to match the original SGB boot
IF DEF(SGB2)
ld a, BOOTUP_A_MGB
ELSE
ld a, BOOTUP_A_DMG
ENDC
ld hl, $C060
; Boot the game
jp BootGame
ReadHeaderByte:
ld a, $4F
cp l
jr c, .zero
ld a, [hli]
ret
.zero:
inc hl
xor a
ret
SendByte:
ld e, a
ld d, 8
.loop
ld a, $10
rr e
jr c, .zeroBit
add a ; 10 -> 20
.zeroBit
ldh [c], a
ld a, $30
ldh [c], a
dec d
ret z
jr .loop
DoubleBitsAndWriteRow:
; Double the most significant 4 bits, b is shifted by 4
ld a, 4
ld c, 0
.doubleCurrentBit
sla b
push af
rl c
pop af
rl c
dec a
jr nz, .doubleCurrentBit
ld a, c
; Write as two rows
ldi [hl], a
inc hl
ldi [hl], a
inc hl
ret
TrademarkSymbol:
pusho
opt b.X
db %..XXXX..
db %.X....X.
db %X.XXX..X
db %X.X..X.X
db %X.XXX..X
db %X.X..X.X
db %.X....X.
db %..XXXX..
popo
TrademarkSymbolEnd:
SECTION "BootGame", ROM0[$00FE]
BootGame:
ldh [rBANK], a
SECTION "HRAM", HRAM[_HRAM]
hCommand:
ds 1

1
bsnes/gb/CHANGES.md Normal file
View File

@@ -0,0 +1 @@
See https://sameboy.github.io/changelog/

79
bsnes/gb/CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,79 @@
# SameBoy Coding and Contribution Guidelines
## Issues
GitHub Issues are the most effective way to report a bug or request a feature in SameBoy. When reporting a bug, make sure you use the latest stable release, and make sure you mention the SameBoy frontend (Cocoa, SDL, Libretro) and operating system you're using. If you're using Linux/BSD/etc, or you build your own copy of SameBoy for another reason, give as much details as possible on your environment.
If your bug involves a crash, please attach a crash log or a core dump. If you're using Linux/BSD/etc, or if you're using the Libretro core, please attach the `sameboy` binary (or `libretro_sameboy` library) in that case.
If your bug is a regression, it'd be extremely helpful if you can report the the first affected version. You get extra credits if you use `git bisect` to point the exact breaking commit.
If your bug is an emulation bug (Such as a failing test ROM), and you have access to a Game Boy you can test on, please confirm SameBoy is indeed behaving differently from hardware, and report both the emulated model and revision in SameBoy, and the hardware revision you're testing on.
If your issue is a feature request, demonstrating use cases can help me better prioritize it.
## Pull Requests
To allow quicker integration into SameBoy's master branch, contributors are asked to follow SameBoy's style and coding guidelines. Keep in mind that despite the seemingly strict guidelines, all pull requests are welcome not following the guidelines does not mean your pull request will not be accepted, but it will require manual tweaks from my side for integrating.
### Languages and Compilers
SameBoy's core, SDL frontend, Libretro frontend, and automatic tester (Folders `Core`, `SDL` & `OpenDialog`, `libretro`, and `Tester`; respectively) are all written in C11. The Cocoa frontend, SameBoy's fork of Hex Fiend, JoyKit and the Quick Look previewer (Folders `Cocoa`, `HexFiend`, `JoyKit` and `QuickLook`; respectively) are all written in ARC-enabled Objective-C. The SameBoot ROMs (Under `BootROMs`) are written in rgbds-flavor SM83 assembly, with build tools in C11. The shaders (inside `Shaders`) are written in a polyglot GLSL and Metal style, with a few GLSL- and Metal-specific sources. The build system uses standalone Make, in the GNU flavor. Avoid adding new languages (C++, Swift, Python, CMake...) to any of the existing sub-projects.
SameBoy's main target compiler is Clang, but GCC is also supported when targeting Linux and Libretro. Other compilers (e.g. MSVC) are not supported, and unless there's a good reason, there's no need to go out of your way to add specific support for them. Extensions that are supported by both compilers (Such as `typeof`) may be used if it makes sense. It's OK if you can't test one of these compilers yourself; once you push a commit, the CI bot will let you know if you broke something.
### Third Party Libraries and Tools
Avoid adding new required dependencies; run-time and compile-time dependencies alike. Most importantly, avoid linking against GPL licensed libraries (LGPL libraries are fine), so SameBoy can retain its Expat license.
### Spacing, Indentation and Formatting
In all files and languages (Other than Makefiles when required), 4 spaces are used for indentation. Unix line endings (`\n`) are used exclusively, even in Windows-specific source files. (`\r` and `\t` shouldn't appear in any source file). Opening braces belong on the same line as their control flow directive, and on their own line when following a function prototype. The `else` keyword always starts on its own line. The `case` keyword is indented relative to its `switch` block, and the code inside a `case` is indented relative to its label. A control flow keyword should have a space between it and the following `(`, commas should follow a space, and operator (except `.` and `->`) should be surrounded by spaces.
Control flow statements must use `{}`, with the exception of `if` statements that only contain a single `break`, `continue`, or trivial `return` statements. If `{}`s are omitted, the statement must be on the same line as the `if` condition. Functions that do not have any argument must be specified as `(void)`, as mandated by the C standard. The `sizeof` and `typeof` operators should be used as if they're functions (With `()`). `*`, when used to declare pointer types (including functions that return pointers), and when used to dereference a pointer, is attached to the right side (The variable name) not to the left, and not with spaces on both sides.
No strict limitations on a line's maximum width, but use your best judgement if you think a statement would benefit from an additional line break.
Well formatted code example:
```
static void my_function(void)
{
GB_something_t *thing = GB_function(&gb, GB_FLAG_ONE | GB_FLAG_TWO, sizeof(thing));
if (GB_is_thing(thing)) return;
switch (*thing) {
case GB_QUACK:
// Something
case GB_DUCK:
// Something else
}
}
```
Badly formatted code example:
```
static void my_function(){
GB_something_t* thing=GB_function(&gb , GB_FLAG_ONE|GB_FLAG_TWO , sizeof thing);
if( GB_is_thing ( thing ) )
return;
switch(* thing)
{
case GB_QUACK:
// Something
case GB_DUCK:
// Something else
}
}
```
### Other Coding Conventions
The primitive types to be used in SameBoy are `unsigned` and `signed` (Without the `int` keyword), the `(u)int*_t` types, `char *` for UTF-8 strings, `double` for non-integer numbers, and `bool` for booleans (Including in Objective-C code, avoid `BOOL`). As long as it's not mandated by a 3rd-party API (e.g. `int` when using file descriptors), avoid using other primitive types. Use `const` whenever possible.
Most C names should be `lower_case_snake_case`. Constants and macros use `UPPER_CASE_SNAKE_CASE`. Type definitions use a `_t` suffix. Type definitions, as well as non-static (exported) core symbols, should be prefixed with `GB_` (SameBoy's core is intended to be used as a library, so it shouldn't contaminate the global namespace without prefixes). Exported symbols that are only meant to be used by other parts of the core should still get the `GB_` prefix, but their header definition should be inside `#ifdef GB_INTERNAL`.
For Objective-C naming conventions, use Apple's conventions (Some old Objective-C code mixes these with the C naming convention; new code should use Apple's convention exclusively). The name prefix for SameBoy classes and constants is `GB`. JoyKit's prefix is `JOY`, and Hex Fiend's prefix is `HF`.
In all languages, prefer long, unambiguous names over short ambiguous ones.

BIN
bsnes/gb/Cocoa/AppIcon.icns Normal file

Binary file not shown.

BIN
bsnes/gb/Cocoa/Assets.car Normal file

Binary file not shown.

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14868" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14868"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="Document">
<connections>
<outlet property="audioFormatButton" destination="knX-AW-zt5" id="fKt-eI-H0y"/>
<outlet property="audioRecordingAccessoryView" destination="c22-O7-iKe" id="XD8-Gi-qOC"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="c22-O7-iKe">
<rect key="frame" x="0.0" y="0.0" width="354" height="36"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Atq-RE-328">
<rect key="frame" x="18" y="10" width="56" height="16"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Format:" id="dso-NS-JlD">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="knX-AW-zt5">
<rect key="frame" x="81" y="4" width="256" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="Apple AIFF" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="1" imageScaling="proportionallyDown" inset="2" selectedItem="M3Z-UN-VKZ" id="tLM-Di-Dy3">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<menu key="menu" id="gqn-SL-AA5">
<items>
<menuItem title="Apple AIFF" state="on" tag="1" id="M3Z-UN-VKZ"/>
<menuItem title="RIFF WAVE" tag="2" id="zA0-Np-4XD"/>
<menuItem title="Raw PCM (Stereo 96KHz, 16-bit LE)" id="r9J-4k-XH5"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="audioFormatChanged:" target="-2" id="I1k-d9-afp"/>
</connections>
</popUpButton>
</subviews>
<point key="canvasLocation" x="75" y="19"/>
</customView>
</objects>
</document>

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

View File

@@ -0,0 +1,26 @@
#import <Cocoa/Cocoa.h>
/* Backport the toolbarStyle property to allow compilation with older SDKs*/
#ifndef __MAC_10_16
typedef NS_ENUM(NSInteger, NSWindowToolbarStyle) {
// The default value. The style will be determined by the window's given configuration
NSWindowToolbarStyleAutomatic,
// The toolbar will appear below the window title
NSWindowToolbarStyleExpanded,
// The toolbar will appear below the window title and the items in the toolbar will attempt to have equal widths when possible
NSWindowToolbarStylePreference,
// The window title will appear inline with the toolbar when visible
NSWindowToolbarStyleUnified,
// Same as NSWindowToolbarStyleUnified, but with reduced margins in the toolbar allowing more focus to be on the contents of the window
NSWindowToolbarStyleUnifiedCompact
} API_AVAILABLE(macos(11.0));
@interface NSWindow (toolbarStyle)
@property (nonatomic) NSWindowToolbarStyle toolbarStyle API_AVAILABLE(macos(11.0));
@end
@interface NSImage (SFSymbols)
+ (instancetype)imageWithSystemSymbolName:(NSString *)symbolName accessibilityDescription:(NSString *)description API_AVAILABLE(macos(11.0));
@end
#endif

BIN
bsnes/gb/Cocoa/CPU.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
bsnes/gb/Cocoa/CPU@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

View File

@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24093.7" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24093.7"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="GBCheatSearchController">
<connections>
<outlet property="addCheatButton" destination="o1I-5D-V4k" id="lRE-uQ-vul"/>
<outlet property="conditionField" destination="XN7-BO-THS" id="vzh-y2-CcN"/>
<outlet property="conditionTypeButton" destination="6RO-h8-lZ8" id="5wx-NY-lbK"/>
<outlet property="dataTypeButton" destination="5Db-vP-S60" id="wdR-m7-fEI"/>
<outlet property="operandField" destination="Q42-Vu-TJW" id="hRn-67-UmU"/>
<outlet property="resultsLabel" destination="wbN-MX-lEy" id="gJB-fD-eKK"/>
<outlet property="tableView" destination="fSU-85-fVM" id="1kO-kP-yBb"/>
<outlet property="window" destination="QvC-M9-y7g" id="g09-DO-GsE"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Cheat Search" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="GBPanel">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="372"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
<value key="minSize" type="size" width="480" height="372"/>
<value key="maxSize" type="size" width="480" height="99999"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="480" height="372"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="24" horizontalPageScroll="10" verticalLineScroll="24" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fvf-Co-5Ga">
<rect key="frame" x="-1" y="155" width="482" height="218"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" drawsBackground="NO" id="1kJ-HR-keu">
<rect key="frame" x="1" y="1" width="480" height="216"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" tableStyle="plain" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="24" headerView="oyv-sh-ulk" id="fSU-85-fVM">
<rect key="frame" x="0.0" y="0.0" width="480" height="188"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="17" height="0.0"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="AutomaticTableColumnIdentifier.0" editable="NO" width="143" minWidth="40" maxWidth="1000" id="8z0-o5-dNI">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Address">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="large" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" title="Text Cell" id="bmG-fw-HDR" customClass="GBCenteredTextCell">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
</tableColumn>
<tableColumn identifier="AutomaticTableColumnIdentifier.1" editable="NO" width="143" minWidth="40" maxWidth="1000" id="mBc-yv-f00">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Previous Value">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="large" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" title="Text Cell" id="BSe-S3-KNH" customClass="GBCenteredTextCell">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
</tableColumn>
<tableColumn width="143" minWidth="10" maxWidth="3.4028234663852886e+38" id="F7j-ck-3H0">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Current Value">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableHeaderCell>
<textFieldCell key="dataCell" controlSize="large" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="wjH-Ei-6hv" customClass="GBCenteredTextCell">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
</tableColumn>
</tableColumns>
<connections>
<outlet property="dataSource" destination="-2" id="Yqt-V5-OkG"/>
<outlet property="delegate" destination="-2" id="TRM-gh-TG4"/>
</connections>
</tableView>
</subviews>
<nil key="backgroundColor"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="ZbQ-IG-kyP">
<rect key="frame" x="1" y="201" width="480" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="wK3-8v-kAQ">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" wantsLayer="YES" id="oyv-sh-ulk">
<rect key="frame" x="0.0" y="0.0" width="480" height="28"/>
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
</scrollView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KdM-lW-WbP">
<rect key="frame" x="371" y="24" width="96" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Search" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="t4Y-Ud-mJm">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="search:" target="-2" id="7pG-JY-vEF"/>
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fTv-nr-5FT">
<rect key="frame" x="6" y="95" width="124" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" alignment="right" title="Search Condition:" id="9C2-Xp-JIA">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vMd-zb-8jT">
<rect key="frame" x="6" y="64" width="124" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" alignment="right" title="Expression:" id="Jgg-sA-jjs">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5Db-vP-S60">
<rect key="frame" x="133" y="120" width="197" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<popUpButtonCell key="cell" type="push" title="8-Bit" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="al4-Jb-OJB" id="dkg-V5-wsX">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="message"/>
<menu key="menu" id="e5r-qR-pg7">
<items>
<menuItem title="8-Bit" state="on" id="al4-Jb-OJB"/>
<menuItem title="16-Bit" tag="1" id="G2m-fU-8Lt"/>
<menuItem title="16-Bit (Big Endian)" tag="3" id="JRa-DB-dyG"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6RO-h8-lZ8">
<rect key="frame" x="133" y="89" width="197" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<popUpButtonCell key="cell" type="push" title="Is Equal To…" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="Vfb-Dg-Jkb" id="DPm-QO-c64">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="message"/>
<menu key="menu" id="Kg9-Rd-1GQ">
<items>
<menuItem title="Any" id="cEg-eI-4hb"/>
<menuItem title="Is Equal To…" state="on" id="Vfb-Dg-Jkb"/>
<menuItem title="Is Different From…" id="JDg-d9-5Ux"/>
<menuItem title="Is Greater Than…" id="Rir-w0-737"/>
<menuItem title="Is Equal or Greater Than…" id="Lvo-pV-Syt"/>
<menuItem title="Is Less Than…" id="VUW-DY-2cI"/>
<menuItem title="Is Equal or Less Than…" id="rDN-UF-tIo"/>
<menuItem title="Did Change" id="JdI-CW-E8H"/>
<menuItem title="Did Not Change" id="sWc-Yz-Cve"/>
<menuItem title="Did Increase" id="LHF-Lf-7tK"/>
<menuItem title="Did Decrease" id="8s2-8n-aQO"/>
<menuItem title="Custom…" id="8xc-2v-YQj"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="conditionChanged:" target="-2" id="KF9-vz-yNC"/>
</connections>
</popUpButton>
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Q42-Vu-TJW">
<rect key="frame" x="334" y="93" width="126" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" continuous="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" title="$0" drawsBackground="YES" usesSingleLineMode="YES" id="WDs-GG-7Lc">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<allowedInputSourceLocales>
<string>NSAllRomanInputSourcesLocaleIdentifier</string>
</allowedInputSourceLocales>
</textFieldCell>
<connections>
<action selector="search:" target="-2" id="BDa-5j-qEz"/>
<outlet property="delegate" destination="-2" id="1bO-hp-igc"/>
</connections>
</textField>
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XN7-BO-THS">
<rect key="frame" x="136" y="62" width="324" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" enabled="NO" sendsActionOnEndEditing="YES" borderStyle="bezel" title="new == ($0)" drawsBackground="YES" usesSingleLineMode="YES" id="Krh-8w-4ug">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<allowedInputSourceLocales>
<string>NSAllRomanInputSourcesLocaleIdentifier</string>
</allowedInputSourceLocales>
</textFieldCell>
<connections>
<action selector="search:" target="-2" id="sv5-eX-Kb9"/>
</connections>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tBa-6c-9AY">
<rect key="frame" x="13" y="24" width="96" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Reset" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Pge-SU-Y1n">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="reset:" target="-2" id="KCy-Ob-tlg"/>
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wbN-MX-lEy">
<rect key="frame" x="-3" y="4" width="486" height="14"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="clipping" alignment="center" title="Status" id="CM3-4U-qao">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="o1I-5D-V4k">
<rect key="frame" x="264" y="24" width="110" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Add Cheat" bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="GGV-nm-ASn">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="addCheat:" target="-2" id="7ax-kM-TeV"/>
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="veO-Qn-0Sz">
<rect key="frame" x="6" y="126" width="124" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Data Type:" id="KuT-rz-eHm">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<contentBorderThickness minY="22"/>
<point key="canvasLocation" x="161" y="182"/>
</window>
</objects>
</document>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

BIN
bsnes/gb/Cocoa/Display.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

98
bsnes/gb/Cocoa/Document.h Normal file
View File

@@ -0,0 +1,98 @@
#import <Cocoa/Cocoa.h>
#import "GBView.h"
#import "GBImageView.h"
#import "GBSplitView.h"
#import "GBVisualizerView.h"
#import "GBCPUView.h"
#import "GBOSDView.h"
#import "GBDebuggerButton.h"
enum model {
MODEL_NONE,
MODEL_DMG,
MODEL_CGB,
MODEL_AGB,
MODEL_SGB,
MODEL_MGB,
MODEL_AUTO,
MODEL_QUICK_RESET = -1,
};
@class GBCheatWindowController;
@class GBPaletteView;
@class GBObjectView;
@interface Document : NSDocument <NSWindowDelegate, GBImageViewDelegate, NSSplitViewDelegate>
@property (readonly) GB_gameboy_t *gb;
@property IBOutlet GBView *view;
@property IBOutlet NSTextView *consoleOutput;
@property IBOutlet NSPanel *consoleWindow;
@property IBOutlet NSTextField *consoleInput;
@property IBOutlet NSWindow *mainWindow;
@property IBOutlet NSView *memoryView;
@property IBOutlet NSPanel *memoryWindow;
@property (readonly) GB_gameboy_t *gameboy;
@property IBOutlet NSTextField *memoryBankInput;
@property IBOutlet NSToolbarItem *memoryBankItem;
@property IBOutlet NSPopUpButton *memorySpaceButton;
@property IBOutlet GBImageView *tilesetImageView;
@property IBOutlet NSPopUpButton *tilesetPaletteButton;
@property IBOutlet GBImageView *tilemapImageView;
@property IBOutlet NSPopUpButton *tilemapPaletteButton;
@property IBOutlet NSPopUpButton *tilemapMapButton;
@property IBOutlet NSPopUpButton *TilemapSetButton;
@property IBOutlet NSButton *gridButton;
@property IBOutlet NSTabView *vramTabView;
@property IBOutlet NSPanel *vramWindow;
@property IBOutlet NSTextField *vramStatusLabel;
@property IBOutlet GBPaletteView *paletteView;
@property IBOutlet GBObjectView *objectView;
@property IBOutlet NSPanel *printerFeedWindow;
@property IBOutlet NSProgressIndicator *printerSpinner;
@property IBOutlet NSImageView *feedImageView;
@property IBOutlet NSTextView *debuggerSideViewInput;
@property IBOutlet NSTextView *debuggerSideView;
@property IBOutlet GBSplitView *debuggerSplitView;
@property IBOutlet NSBox *debuggerVerticalLine;
@property IBOutlet NSPanel *cheatsWindow;
@property IBOutlet GBCheatWindowController *cheatWindowController;
@property (readonly) Document *partner;
@property (readonly) bool isSlave;
@property IBOutlet NSView *gbsPlayerView;
@property IBOutlet NSTextField *gbsTitle;
@property IBOutlet NSTextField *gbsAuthor;
@property IBOutlet NSTextField *gbsCopyright;
@property IBOutlet NSPopUpButton *gbsTracks;
@property IBOutlet NSButton *gbsPlayPauseButton;
@property IBOutlet NSButton *gbsRewindButton;
@property IBOutlet NSSegmentedControl *gbsNextPrevButton;
@property IBOutlet GBVisualizerView *gbsVisualizer;
@property IBOutlet GBOSDView *osdView;
@property (readonly) GB_oam_info_t *oamInfo;
@property uint8_t oamCount;
@property uint8_t oamHeight;
@property IBOutlet NSView *audioRecordingAccessoryView;
@property IBOutlet NSPopUpButton *audioFormatButton;
@property IBOutlet NSVisualEffectView *debuggerSidebarEffectView API_AVAILABLE(macos(10.10));
@property IBOutlet GBDebuggerButton *debuggerContinueButton;
@property IBOutlet GBDebuggerButton *debuggerNextButton;
@property IBOutlet GBDebuggerButton *debuggerStepButton;
@property IBOutlet GBDebuggerButton *debuggerFinishButton;
@property IBOutlet GBDebuggerButton *debuggerBackstepButton;
@property IBOutlet NSScrollView *debuggerScrollView;
@property IBOutlet NSView *debugBar;
@property IBOutlet GBCPUView *cpuView;
@property IBOutlet NSTextField *cpuCounter;
+ (NSImage *) imageFromData:(NSData *)data width:(NSUInteger) width height:(NSUInteger) height scale:(double) scale;
- (void) performAtomicBlock: (void (^)())block;
- (void) connectLinkCable:(NSMenuItem *)sender;
- (int)loadStateFile:(const char *)path noErrorOnNotFound:(bool)noErrorOnFileNotFound;
- (NSString *)captureOutputForBlock: (void (^)())block;
- (NSFont *)debuggerFontOfSize:(unsigned)size;
@end

2972
bsnes/gb/Cocoa/Document.m Normal file

File diff suppressed because it is too large Load Diff

1034
bsnes/gb/Cocoa/Document.xib Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

27
bsnes/gb/Cocoa/GBApp.h Normal file
View File

@@ -0,0 +1,27 @@
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import <JoyKit/JoyKit.h>
@interface GBApp : NSApplication <NSApplicationDelegate, NSUserNotificationCenterDelegate, NSMenuDelegate, WebUIDelegate, WebPolicyDelegate, WebFrameLoadDelegate, JOYListener>
@property (nonatomic, strong) IBOutlet NSWindow *preferencesWindow;
@property (nonatomic, strong) IBOutlet NSView *graphicsTab;
@property (nonatomic, strong) IBOutlet NSView *emulationTab;
@property (nonatomic, strong) IBOutlet NSView *audioTab;
@property (nonatomic, strong) IBOutlet NSView *controlsTab;
@property (nonatomic, strong) IBOutlet NSView *updatesTab;
- (IBAction)showPreferences: (id) sender;
- (IBAction)toggleDeveloperMode:(id)sender;
- (IBAction)switchPreferencesTab:(id)sender;
@property (nonatomic, weak) IBOutlet NSMenuItem *linkCableMenuItem;
@property (nonatomic, strong) IBOutlet NSWindow *updateWindow;
@property (nonatomic, strong) IBOutlet WebView *updateChanges;
@property (nonatomic, strong) IBOutlet NSProgressIndicator *updatesSpinner;
@property (strong) IBOutlet NSButton *updatesButton;
@property (strong) IBOutlet NSTextField *updateProgressLabel;
@property (strong) IBOutlet NSButton *updateProgressButton;
@property (strong) IBOutlet NSWindow *updateProgressWindow;
@property (strong) IBOutlet NSProgressIndicator *updateProgressSpinner;
- (void)updateThemesDefault:(bool)overwrite;
@end

817
bsnes/gb/Cocoa/GBApp.m Normal file
View File

@@ -0,0 +1,817 @@
#import "GBApp.h"
#import "GBButtons.h"
#import "GBView.h"
#import "Document.h"
#import "GBJoyConManager.h"
#import <Core/gb.h>
#import <Carbon/Carbon.h>
#import <JoyKit/JoyKit.h>
#import <WebKit/WebKit.h>
#import <mach-o/dyld.h>
#include <sys/mount.h>
#include <sys/xattr.h>
#define UPDATE_SERVER "https://sameboy.github.io"
@interface NSToolbarItem(private)
- (NSButton *)_view;
@end
static uint32_t color_to_int(NSColor *color)
{
color = [color colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]];
return (((unsigned)(color.redComponent * 0xFF)) << 16) |
(((unsigned)(color.greenComponent * 0xFF)) << 8) |
((unsigned)(color.blueComponent * 0xFF));
}
@implementation GBApp
{
NSArray<NSView *> *_preferencesTabs;
NSString *_lastVersion;
NSString *_updateURL;
NSURLSessionDownloadTask *_updateTask;
enum {
UPDATE_DOWNLOADING,
UPDATE_EXTRACTING,
UPDATE_WAIT_INSTALL,
UPDATE_INSTALLING,
UPDATE_FAILED,
} _updateState;
NSString *_downloadDirectory;
AuthorizationRef _auth;
bool _simulatingMenuEvent;
}
- (void) applicationDidFinishLaunching:(NSNotification *)notification
{
// Refresh icon if launched via a software update
if (@available(macOS 26.0, *)) {
// Severely broken on macOS 26
}
else {
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:[[NSBundle mainBundle] bundlePath]];
icon.size = [NSApplication sharedApplication].applicationIconImage.size;
[NSApplication sharedApplication].applicationIconImage = icon;
}
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
for (unsigned i = 0; i < GBKeyboardButtonCount; i++) {
if ([[defaults objectForKey:button_to_preference_name(i, 0)] isKindOfClass:[NSString class]]) {
[defaults removeObjectForKey:button_to_preference_name(i, 0)];
}
}
bool hasSFMono = false;
if (@available(macOS 10.15, *)) {
hasSFMono = [[NSFont monospacedSystemFontOfSize:12 weight:NSFontWeightRegular].displayName containsString:@"SF"];
}
[[NSUserDefaults standardUserDefaults] registerDefaults:@{
@"GBRight": @(kVK_RightArrow),
@"GBLeft": @(kVK_LeftArrow),
@"GBUp": @(kVK_UpArrow),
@"GBDown": @(kVK_DownArrow),
@"GBA": @(kVK_ANSI_X),
@"GBB": @(kVK_ANSI_Z),
@"GBSelect": @(kVK_Delete),
@"GBStart": @(kVK_Return),
@"GBTurbo": @(kVK_Space),
@"GBRewind": @(kVK_Tab),
@"GBSlow-Motion": @(kVK_Shift),
@"GBFilter": @"NearestNeighbor",
@"GBColorCorrection": @(GB_COLOR_CORRECTION_MODERN_BALANCED),
@"GBHighpassFilter": @(GB_HIGHPASS_ACCURATE),
@"GBRewindLength": @(120),
@"GBFrameBlendingMode": @([defaults boolForKey:@"DisableFrameBlending"]? GB_FRAME_BLENDING_MODE_DISABLED : GB_FRAME_BLENDING_MODE_ACCURATE),
@"GBDMGModel": @(GB_MODEL_DMG_B),
@"GBCGBModel": @(GB_MODEL_CGB_E),
@"GBAGBModel": @(GB_MODEL_AGB_A),
@"GBSGBModel": @(GB_MODEL_SGB2),
@"GBRumbleMode": @(GB_RUMBLE_CARTRIDGE_ONLY),
@"GBVolume": @(1.0),
@"GBMBC7JoystickOverride": @NO,
@"GBMBC7AllowMouse": @YES,
@"GBJoyConAutoPair": @YES,
@"GBJoyConsDefaultsToHorizontal": @YES,
@"GBEmulatedModel": @(MODEL_AUTO),
@"GBDebuggerFont": hasSFMono? @"SF Mono" : @"Menlo",
@"GBDebuggerFontSize": @12,
@"GBColorPalette": @1,
@"GBTurboCap": @0,
// Default themes
@"GBThemes": @{
@"Canyon": @{
@"BrightnessBias": @0.1227009965823247,
@"Colors": @[@0xff0c1e20, @0xff122b91, @0xff466aa2, @0xfff1efae, @0xfff1efae],
@"DisabledLCDColor": @NO,
@"HueBias": @0.01782661816105247,
@"HueBiasStrength": @1,
@"Manual": @NO,
},
@"Desert": @{
@"BrightnessBias": @0.0,
@"Colors": @[@0xff302f3e, @0xff576674, @0xff839ba4, @0xffb1d0d2, @0xffb7d7d8],
@"DisabledLCDColor": @YES,
@"HueBias": @0.10087773904382469,
@"HueBiasStrength": @0.062142056772908363,
@"Manual": @NO,
},
@"Evening": @{
@"BrightnessBias": @-0.10168700106441975,
@"Colors": @[@0xff362601, @0xff695518, @0xff899853, @0xffa6e4ae, @0xffa9eebb],
@"DisabledLCDColor": @YES,
@"HueBias": @0.60027079191058874,
@"HueBiasStrength": @0.33816297305747867,
@"Manual": @NO,
},
@"Fog": @{
@"BrightnessBias": @0.0,
@"Colors": @[@0xff373c34, @0xff737256, @0xff9da386, @0xffc3d2bf, @0xffc7d8c6],
@"DisabledLCDColor": @YES,
@"HueBias": @0.55750435756972117,
@"HueBiasStrength": @0.18424738545816732,
@"Manual": @NO,
},
@"Green Slate": @{
@"BrightnessBias": @0.2210012227296829,
@"Colors": @[@0xff343117, @0xff6a876f, @0xff98b4a1, @0xffc3daca, @0xffc8decf],
@"DisabledLCDColor": @YES,
@"HueBias": @0.1887667975388467,
@"HueBiasStrength": @0.1272283345460892,
@"Manual": @NO,
},
@"Green Tea": @{
@"BrightnessBias": @-0.4946326622596153,
@"Colors": @[@0xff1a1d08, @0xff1d5231, @0xff3b9774, @0xff97e4c6, @0xffa9eed1],
@"DisabledLCDColor": @YES,
@"HueBias": @0.1912955007245464,
@"HueBiasStrength": @0.3621708039314516,
@"Manual": @NO,
},
@"Lavender": @{
@"BrightnessBias": @0.10072476038566,
@"Colors": @[@0xff2b2a3a, @0xff8c507c, @0xffbf82a8, @0xffe9bcce, @0xffeec3d3],
@"DisabledLCDColor": @YES,
@"HueBias": @0.7914529587142169,
@"HueBiasStrength": @0.2498168498277664,
@"Manual": @NO,
},
@"Magic Eggplant": @{
@"BrightnessBias": @0.0,
@"Colors": @[@0xff3c2136, @0xff942e84, @0xffc7699d, @0xfff1e4b0, @0xfff6f9b2],
@"DisabledLCDColor": @YES,
@"HueBias": @0.87717878486055778,
@"HueBiasStrength": @0.65018052788844627,
@"Manual": @NO,
},
@"Mystic Blue": @{
@"BrightnessBias": @-0.3291049897670746,
@"Colors": @[@0xff3b2306, @0xffa27807, @0xffd1b523, @0xfff6ebbe, @0xfffaf1e4],
@"DisabledLCDColor": @YES,
@"HueBias": @0.5282051088288426,
@"HueBiasStrength": @0.7699633836746216,
@"Manual": @NO,
},
@"Pink Pop": @{
@"BrightnessBias": @0.624908447265625,
@"Colors": @[@0xff28140a, @0xff7c42cb, @0xffaa83de, @0xffd1ceeb, @0xffd5d8ec],
@"DisabledLCDColor": @YES,
@"HueBias": @0.9477411056868732,
@"HueBiasStrength": @0.80024421215057373,
@"Manual": @NO,
},
@"Radioactive Pea": @{
@"BrightnessBias": @-0.48079556772908372,
@"Colors": @[@0xff215200, @0xff1f7306, @0xff169e34, @0xff03ceb8, @0xff00d4d1],
@"DisabledLCDColor": @YES,
@"HueBias": @0.3795131972111554,
@"HueBiasStrength": @0.34337649402390436,
@"Manual": @NO,
},
@"Rose": @{
@"BrightnessBias": @0.2727272808551788,
@"Colors": @[@0xff001500, @0xff4e1fae, @0xff865ac4, @0xffb7e6d3, @0xffbdffd4],
@"DisabledLCDColor": @YES,
@"HueBias": @0.9238900924101472,
@"HueBiasStrength": @0.9957716464996338,
@"Manual": @NO,
},
@"Seaweed": @{
@"BrightnessBias": @-0.28532744023904377,
@"Colors": @[@0xff3f0015, @0xff426532, @0xff58a778, @0xff95e0df, @0xffa0e7ee],
@"DisabledLCDColor": @YES,
@"HueBias": @0.2694067480079681,
@"HueBiasStrength": @0.51565612549800799,
@"Manual": @NO,
},
@"Twilight": @{
@"BrightnessBias": @-0.091789093625498031,
@"Colors": @[@0xff3f0015, @0xff461286, @0xff6254bd, @0xff97d3e9, @0xffa0e7ee],
@"DisabledLCDColor": @YES,
@"HueBias": @0.0,
@"HueBiasStrength": @0.49710532868525897,
@"Manual": @NO,
},
},
@"NSToolbarItemForcesStandardSize": @YES, // Forces Monterey to resepect toolbar item sizes
@"NSToolbarItemWarnOnMinMaxSize": @NO, // Not going to use Constraints, Apple
}];
[JOYController startOnRunLoop:[NSRunLoop currentRunLoop] withOptions:@{
JOYAxes2DEmulateButtonsKey: @YES,
JOYHatsEmulateButtonsKey: @YES,
}];
[GBJoyConManager sharedInstance]; // Starts handling Joy-Cons
[JOYController registerListener:self];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"GBNotificationsUsed"]) {
[NSUserNotificationCenter defaultUserNotificationCenter].delegate = self;
}
[self askAutoUpdates];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"GBAutoUpdatesEnabled"]) {
[self checkForUpdates];
}
if ([[NSProcessInfo processInfo].arguments containsObject:@"--update-launch"]) {
[NSApp activateIgnoringOtherApps:true];
}
if (![[[NSUserDefaults standardUserDefaults] stringForKey:@"GBThemesVersion"] isEqualToString:@(GB_VERSION)]) {
[self updateThemesDefault:false];
[[NSUserDefaults standardUserDefaults] setObject:@(GB_VERSION) forKey:@"GBThemesVersion"];
}
}
- (void)updateThemesDefault:(bool)overwrite
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *currentThemes = [defaults dictionaryForKey:@"GBThemes"].mutableCopy;
[defaults removeObjectForKey:@"GBThemes"];
NSMutableDictionary *defaultThemes = [defaults dictionaryForKey:@"GBThemes"].mutableCopy;
if (![[NSUserDefaults standardUserDefaults] stringForKey:@"GBThemesVersion"]) {
// Force update the Pink Pop theme, it was glitchy in 1.0
[currentThemes removeObjectForKey:@"Pink Pop"];
}
if (overwrite) {
[currentThemes addEntriesFromDictionary:defaultThemes];
[defaults setObject:currentThemes forKey:@"GBThemes"];
}
else {
[defaultThemes addEntriesFromDictionary:currentThemes];
[defaults setObject:defaultThemes forKey:@"GBThemes"];
}
}
- (IBAction)toggleDeveloperMode:(id)sender
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:![defaults boolForKey:@"DeveloperMode"] forKey:@"DeveloperMode"];
}
- (IBAction)switchPreferencesTab:(id)sender
{
for (NSView *view in _preferencesTabs) {
[view removeFromSuperview];
}
NSView *tab = _preferencesTabs[[sender tag]];
NSRect old = [_preferencesWindow frame];
NSRect new = [_preferencesWindow frameRectForContentRect:tab.frame];
new.origin.x = old.origin.x;
new.origin.y = old.origin.y + (old.size.height - new.size.height);
[_preferencesWindow setFrame:new display:true animate:_preferencesWindow.visible];
[_preferencesWindow.contentView addSubview:tab];
}
- (BOOL)validateMenuItem:(NSMenuItem *)anItem
{
if ([anItem action] == @selector(toggleDeveloperMode:)) {
[(NSMenuItem *)anItem setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"DeveloperMode"]];
}
if (anItem == self.linkCableMenuItem) {
return [[NSDocumentController sharedDocumentController] documents].count > 1;
}
return true;
}
- (void)menuNeedsUpdate:(NSMenu *)menu
{
NSMutableArray *items = [NSMutableArray array];
NSDocument *currentDocument = [[NSDocumentController sharedDocumentController] currentDocument];
for (NSDocument *document in [[NSDocumentController sharedDocumentController] documents]) {
if (document == currentDocument) continue;
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:document.displayName action:@selector(connectLinkCable:) keyEquivalent:@""];
item.representedObject = document;
item.image = [[NSWorkspace sharedWorkspace] iconForFile:document.fileURL.path];
[item.image setSize:NSMakeSize(16, 16)];
[items addObject:item];
}
[menu removeAllItems];
for (NSMenuItem *item in items) {
[menu addItem:item];
}
}
- (IBAction) showPreferences: (id) sender
{
NSArray *objects;
if (!_preferencesWindow) {
[[NSBundle mainBundle] loadNibNamed:@"Preferences" owner:self topLevelObjects:&objects];
NSToolbarItem *first_toolbar_item = [_preferencesWindow.toolbar.items firstObject];
_preferencesWindow.toolbar.selectedItemIdentifier = [first_toolbar_item itemIdentifier];
_preferencesTabs = @[self.emulationTab, self.graphicsTab, self.audioTab, self.controlsTab, self.updatesTab];
[self switchPreferencesTab:first_toolbar_item];
[_preferencesWindow center];
#ifndef UPDATE_SUPPORT
[_preferencesWindow.toolbar removeItemAtIndex:4];
#endif
for (unsigned i = _preferencesWindow.toolbar.items.count; i--;) {
[_preferencesWindow.toolbar.items[i] _view].imageScaling = NSImageScaleNone;
}
}
[_preferencesWindow makeKeyAndOrderFront:self];
}
- (BOOL)applicationOpenUntitledFile:(NSApplication *)sender
{
[self askAutoUpdates];
/* Bring an existing panel to the foreground */
for (NSWindow *window in [[NSApplication sharedApplication] windows]) {
if ([window isKindOfClass:[NSOpenPanel class]]) {
[(NSOpenPanel *)window makeKeyAndOrderFront:nil];
return true;
}
}
[[NSDocumentController sharedDocumentController] openDocument:self];
return true;
}
- (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
{
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:notification.identifier display:true];
}
- (void)updateFound
{
[[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@UPDATE_SERVER "/raw_changes"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSColor *linkColor = [NSColor colorWithRed:0.125 green:0.325 blue:1.0 alpha:1.0];
if (@available(macOS 10.10, *)) {
linkColor = [NSColor linkColor];
}
NSString *changes = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSRange cutoffRange = [changes rangeOfString:@"<!--(" GB_VERSION ")-->"];
if (cutoffRange.location != NSNotFound) {
changes = [changes substringToIndex:cutoffRange.location];
}
NSString *html = [NSString stringWithFormat:@"<!DOCTYPE html><html><head><title></title>"
"<style>html {background-color:transparent; color: #%06x; line-height:1.5} a:link, a:visited{color:#%06x; text-decoration:none}</style>"
"</head><body>%@</body></html>",
color_to_int([NSColor textColor]),
color_to_int(linkColor),
changes];
if ([(NSHTTPURLResponse *)response statusCode] == 200) {
dispatch_async(dispatch_get_main_queue(), ^{
NSArray *objects;
[[NSBundle mainBundle] loadNibNamed:@"UpdateWindow" owner:self topLevelObjects:&objects];
if (@available(macOS 10.11, *)) {
self.updateChanges.preferences.standardFontFamily = @"-apple-system";
}
else if (@available(macOS 10.10, *)) {
self.updateChanges.preferences.standardFontFamily = @"Helvetica Neue";
}
else {
self.updateChanges.preferences.standardFontFamily = @"Lucida Grande";
}
if (@available(macOS 10.15, *)) {
self.updateChanges.preferences.fixedFontFamily = [NSFont monospacedSystemFontOfSize:12 weight:NSFontWeightRegular].displayName;
}
else {
self.updateChanges.preferences.fixedFontFamily = @"Menlo";
}
self.updateChanges.drawsBackground = false;
[self.updateChanges.mainFrame loadHTMLString:html baseURL:nil];
});
}
}] resume];
}
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems
{
// Disable reload context menu
if ([defaultMenuItems count] <= 2) {
return nil;
}
return defaultMenuItems;
}
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sender.mainFrame.frameView.documentView.enclosingScrollView.drawsBackground = true;
sender.mainFrame.frameView.documentView.enclosingScrollView.backgroundColor = [NSColor textBackgroundColor];
sender.policyDelegate = self;
[self.updateWindow center];
[self.updateWindow makeKeyAndOrderFront:nil];
});
}
- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
{
[listener ignore];
[[NSWorkspace sharedWorkspace] openURL:[request URL]];
}
- (void)checkForUpdates
{
#ifdef UPDATE_SUPPORT
[[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@UPDATE_SERVER "/latest_version"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.updatesSpinner stopAnimation:nil];
[self.updatesButton setEnabled:true];
});
if ([(NSHTTPURLResponse *)response statusCode] == 200) {
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSArray <NSString *> *components = [string componentsSeparatedByString:@"|"];
if (components.count != 2) return;
_lastVersion = components[0];
_updateURL = components[1];
if (![@GB_VERSION isEqualToString:_lastVersion] &&
![[[NSUserDefaults standardUserDefaults] stringForKey:@"GBSkippedVersion"] isEqualToString:_lastVersion]) {
[self updateFound];
}
}
}] resume];
#endif
}
- (IBAction)userCheckForUpdates:(id)sender
{
if (self.updateWindow) {
[self.updateWindow makeKeyAndOrderFront:sender];
}
else {
[[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"GBSkippedVersion"];
[self checkForUpdates];
[sender setEnabled:false];
[self.updatesSpinner startAnimation:sender];
}
}
- (void)askAutoUpdates
{
#ifdef UPDATE_SUPPORT
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"GBAskedAutoUpdates"]) {
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = @"Should SameBoy check for updates when launched?";
alert.informativeText = @"SameBoy is frequently updated with new features, accuracy improvements, and bug fixes. This setting can always be changed in the preferences window.";
[alert addButtonWithTitle:@"Check on Launch"];
[alert addButtonWithTitle:@"Don't Check on Launch"];
[[NSUserDefaults standardUserDefaults] setBool:[alert runModal] == NSAlertFirstButtonReturn forKey:@"GBAutoUpdatesEnabled"];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"GBAskedAutoUpdates"];
}
#endif
}
- (IBAction)skipVersion:(id)sender
{
[[NSUserDefaults standardUserDefaults] setObject:_lastVersion forKey:@"GBSkippedVersion"];
[self.updateWindow performClose:sender];
}
- (bool)executePath:(NSString *)path withArguments:(NSArray <NSString *> *)arguments
{
if (!_auth) {
NSTask *task = [[NSTask alloc] init];
task.launchPath = path;
task.arguments = arguments;
[task launch];
[task waitUntilExit];
return task.terminationStatus == 0 && task.terminationReason == NSTaskTerminationReasonExit;
}
char *argv[arguments.count + 1];
argv[arguments.count] = NULL;
for (unsigned i = 0; i < arguments.count; i++) {
argv[i] = (char *)arguments[i].UTF8String;
}
return AuthorizationExecuteWithPrivileges(_auth, path.UTF8String, kAuthorizationFlagDefaults, argv, NULL) == errAuthorizationSuccess;
}
- (void)deauthorize
{
if (_auth) {
AuthorizationFree(_auth, kAuthorizationFlagDefaults);
_auth = nil;
}
}
- (IBAction)installUpdate:(id)sender
{
bool needsAuthorization = false;
if ([self executePath:@"/usr/sbin/spctl" withArguments:@[@"--status"]]) { // Succeeds when GateKeeper is on
// GateKeeper is on, we need to --add ourselves as root, else we might get a GateKeeper crash
needsAuthorization = true;
}
else if (access(_dyld_get_image_name(0), W_OK)) {
// We don't have write access, so we need authorization to update as root
needsAuthorization = true;
}
if (needsAuthorization && !_auth) {
AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagPreAuthorize | kAuthorizationFlagInteractionAllowed, &_auth);
// Make sure we can modify the bundle
if (![self executePath:@"/usr/sbin/chown" withArguments:@[@"-R", [NSString stringWithFormat:@"%d:%d", getuid(), getgid()], [NSBundle mainBundle].bundlePath]]) {
[self deauthorize];
return;
}
}
[self.updateProgressSpinner startAnimation:nil];
self.updateProgressButton.title = @"Cancel";
self.updateProgressButton.enabled = true;
self.updateProgressLabel.stringValue = @"Downloading update…";
_updateState = UPDATE_DOWNLOADING;
_updateTask = [[NSURLSession sharedSession] downloadTaskWithURL: [NSURL URLWithString:_updateURL] completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error) {
_updateTask = nil;
dispatch_sync(dispatch_get_main_queue(), ^{
self.updateProgressButton.enabled = false;
self.updateProgressLabel.stringValue = @"Extracting update…";
_updateState = UPDATE_EXTRACTING;
});
_downloadDirectory = [[[NSFileManager defaultManager] URLForDirectory:NSItemReplacementDirectory
inDomain:NSUserDomainMask
appropriateForURL:[[NSBundle mainBundle] bundleURL]
create:true
error:nil] path];
if (!_downloadDirectory) {
[self deauthorize];
dispatch_sync(dispatch_get_main_queue(), ^{
self.updateProgressButton.enabled = false;
self.updateProgressLabel.stringValue = @"Failed to extract update.";
_updateState = UPDATE_FAILED;
self.updateProgressButton.title = @"Close";
self.updateProgressButton.enabled = true;
[self.updateProgressSpinner stopAnimation:nil];
});
return;
}
NSTask *unzipTask;
unzipTask = [[NSTask alloc] init];
unzipTask.launchPath = @"/usr/bin/unzip";
unzipTask.arguments = @[location.path, @"-d", _downloadDirectory];
[unzipTask launch];
[unzipTask waitUntilExit];
if (unzipTask.terminationStatus != 0 || unzipTask.terminationReason != NSTaskTerminationReasonExit) {
[self deauthorize];
[[NSFileManager defaultManager] removeItemAtPath:_downloadDirectory error:nil];
dispatch_sync(dispatch_get_main_queue(), ^{
self.updateProgressButton.enabled = false;
self.updateProgressLabel.stringValue = @"Failed to extract update.";
_updateState = UPDATE_FAILED;
self.updateProgressButton.title = @"Close";
self.updateProgressButton.enabled = true;
[self.updateProgressSpinner stopAnimation:nil];
});
return;
}
dispatch_sync(dispatch_get_main_queue(), ^{
self.updateProgressButton.enabled = false;
self.updateProgressLabel.stringValue = @"Update ready, save your game progress and click Install.";
_updateState = UPDATE_WAIT_INSTALL;
self.updateProgressButton.title = @"Install";
self.updateProgressButton.enabled = true;
[self.updateProgressSpinner stopAnimation:nil];
});
}];
[_updateTask resume];
self.updateProgressWindow.preventsApplicationTerminationWhenModal = false;
[self.updateWindow beginSheet:self.updateProgressWindow completionHandler:^(NSModalResponse returnCode) {
[self.updateWindow close];
}];
}
- (void)performUpgrade
{
self.updateProgressButton.enabled = false;
self.updateProgressLabel.stringValue = @"Instaling update…";
_updateState = UPDATE_INSTALLING;
self.updateProgressButton.enabled = false;
[self.updateProgressSpinner startAnimation:nil];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *executablePath = [[NSBundle mainBundle] executablePath];
NSString *contentsPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Contents"];
NSString *contentsTempPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"TempContents"];
NSString *updateContentsPath = [_downloadDirectory stringByAppendingPathComponent:@"SameBoy.app/Contents"];
NSError *error = nil;
[[NSFileManager defaultManager] moveItemAtPath:contentsPath toPath:contentsTempPath error:&error];
if (error) {
[self deauthorize];
[[NSFileManager defaultManager] removeItemAtPath:_downloadDirectory error:nil];
_downloadDirectory = nil;
dispatch_sync(dispatch_get_main_queue(), ^{
self.updateProgressButton.enabled = false;
self.updateProgressLabel.stringValue = @"Failed to install update.";
_updateState = UPDATE_FAILED;
self.updateProgressButton.title = @"Close";
self.updateProgressButton.enabled = true;
[self.updateProgressSpinner stopAnimation:nil];
});
return;
}
[[NSFileManager defaultManager] moveItemAtPath:updateContentsPath toPath:contentsPath error:&error];
if (error) {
[self deauthorize];
[[NSFileManager defaultManager] moveItemAtPath:contentsTempPath toPath:contentsPath error:nil];
[[NSFileManager defaultManager] removeItemAtPath:_downloadDirectory error:nil];
_downloadDirectory = nil;
dispatch_sync(dispatch_get_main_queue(), ^{
self.updateProgressButton.enabled = false;
self.updateProgressLabel.stringValue = @"Failed to install update.";
_updateState = UPDATE_FAILED;
self.updateProgressButton.title = @"Close";
self.updateProgressButton.enabled = true;
[self.updateProgressSpinner stopAnimation:nil];
});
return;
}
[[NSFileManager defaultManager] removeItemAtPath:_downloadDirectory error:nil];
[[NSFileManager defaultManager] removeItemAtPath:contentsTempPath error:nil];
// Remove the quarantine flag so we don't have to escape translocation
NSString *bundlePath = [NSBundle mainBundle].bundlePath;
removexattr(bundlePath.UTF8String, "com.apple.quarantine", 0);
for (NSString *path in [[NSFileManager defaultManager] enumeratorAtPath:bundlePath]) {
removexattr([bundlePath stringByAppendingPathComponent:path].UTF8String, "com.apple.quarantine", 0);
};
_downloadDirectory = nil;
atexit_b(^{
execl(executablePath.UTF8String, executablePath.UTF8String, "--update-launch", NULL);
});
dispatch_async(dispatch_get_main_queue(), ^{
[NSApp terminate:nil];
});
});
}
- (IBAction)updateAction:(id)sender
{
switch (_updateState) {
case UPDATE_DOWNLOADING:
[_updateTask cancelByProducingResumeData:nil];
_updateTask = nil;
[self.updateProgressWindow close];
break;
case UPDATE_WAIT_INSTALL:
[self performUpgrade];
break;
case UPDATE_EXTRACTING:
case UPDATE_INSTALLING:
break;
case UPDATE_FAILED:
[self.updateProgressWindow close];
break;
}
}
- (void)orderFrontAboutPanel:(id)sender
{
// NSAboutPanelOptionApplicationIcon is not available prior to 10.13, but the key is still there and working.
[[NSApplication sharedApplication] orderFrontStandardAboutPanelWithOptions:@{
@"ApplicationIcon": [NSImage imageNamed:@"Icon"]
}];
}
- (void)controller:(JOYController *)controller buttonChangedState:(JOYButton *)button
{
if (!button.isPressed) return;
NSDictionary *mapping = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"JoyKitInstanceMapping"][controller.uniqueID];
if (!mapping) {
mapping = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"JoyKitNameMapping"][controller.deviceName];
}
JOYButtonUsage usage = ((JOYButtonUsage)[mapping[n2s(button.uniqueID)] unsignedIntValue]) ?: -1;
if (!mapping && usage >= JOYButtonUsageGeneric0) {
usage = GB_inline_const(JOYButtonUsage[], {JOYButtonUsageY, JOYButtonUsageA, JOYButtonUsageB, JOYButtonUsageX})[(usage - JOYButtonUsageGeneric0) & 3];
}
if (usage == GBJoyKitHotkey1 || usage == GBJoyKitHotkey2) {
if (_preferencesWindow && self.keyWindow == _preferencesWindow) {
return;
}
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"GBAllowBackgroundControllers"] && !self.keyWindow) {
return;
}
NSString *keyEquivalent = [[NSUserDefaults standardUserDefaults] stringForKey:usage == GBJoyKitHotkey1? @"GBJoypadHotkey1" : @"GBJoypadHotkey2"];
NSEventModifierFlags flags = NSEventModifierFlagCommand;
if ([keyEquivalent hasPrefix:@"^"]) {
flags |= NSEventModifierFlagShift;
[keyEquivalent substringFromIndex:1];
}
_simulatingMenuEvent = true;
[[NSApplication sharedApplication] sendEvent:[NSEvent keyEventWithType:NSEventTypeKeyDown
location:(NSPoint){0,}
modifierFlags:flags
timestamp:0
windowNumber:0
context:NULL
characters:keyEquivalent
charactersIgnoringModifiers:keyEquivalent
isARepeat:false
keyCode:0]];
_simulatingMenuEvent = false;
}
}
- (NSWindow *)keyWindow
{
NSWindow *ret = [super keyWindow];
if (!ret && _simulatingMenuEvent) {
ret = [(Document *)self.orderedDocuments.firstObject mainWindow];
}
return ret;
}
- (NSWindow *)mainWindow
{
NSWindow *ret = [super mainWindow];
if (!ret && _simulatingMenuEvent) {
ret = [(Document *)self.orderedDocuments.firstObject mainWindow];
}
return ret;
}
- (IBAction)openDebuggerHelp:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://sameboy.github.io/debugger/"]];
}
- (IBAction)openSponsor:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/sponsors/LIJI32"]];
}
- (void)dealloc
{
if (_downloadDirectory) {
[[NSFileManager defaultManager] removeItemAtPath:_downloadDirectory error:nil];
}
}
- (IBAction)nop:(id)sender
{
}
/* This runs before C constructors. If we need to escape translocation, we should
do it ASAP to minimize our launch time. */
+ (void)load
{
if (@available(macOS 10.12, *)) {
/* Detect and escape translocation so we can safely update ourselves */
if ([[[NSBundle mainBundle] bundlePath] containsString:@"/AppTranslocation/"]) {
const char *mountPath = [[[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent].UTF8String;
struct statfs *mntbuf;
int mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
for (unsigned i = 0; i < mntsize; i++) {
if (strcmp(mntbuf[i].f_mntonname, mountPath) == 0) {
NSBundle *origBundle = [NSBundle bundleWithPath:@(mntbuf[i].f_mntfromname)];
execl(origBundle.executablePath.UTF8String, origBundle.executablePath.UTF8String, NULL);
break;
}
}
}
}
}
@end

View File

@@ -0,0 +1,5 @@
#import <Cocoa/Cocoa.h>
@interface GBBorderView : NSView
@end

View File

@@ -0,0 +1,26 @@
#import "GBBorderView.h"
@implementation GBBorderView
- (void)awakeFromNib
{
self.wantsLayer = true;
}
- (BOOL)wantsUpdateLayer
{
return true;
}
- (void)updateLayer
{
/* Wonderful, wonderful windowserver(?) bug. Using 0,0,0 here would cause it to render garbage
on fullscreen windows on some High Sierra machines. Any other value, including the one used
here (which is rendered exactly the same due to rounding) works around this bug. */
self.layer.backgroundColor = [NSColor colorWithCalibratedRed:0
green:0
blue:1.0 / 1024.0
alpha:1.0].CGColor;
}
@end

View File

@@ -0,0 +1,40 @@
typedef enum {
GBRight,
GBLeft,
GBUp,
GBDown,
GBA,
GBB,
GBSelect,
GBStart,
GBRapidA,
GBRapidB,
GBTurbo,
GBRewind,
GBUnderclock,
GBHotkey1,
GBHotkey2,
GBTotalButtonCount,
GBKeyboardButtonCount = GBUnderclock + 1,
GBPerPlayerButtonCount = GBRapidB + 1,
} GBButton;
#define GBJoyKitHotkey1 JOYButtonUsageGeneric0 + 0x100
#define GBJoyKitHotkey2 JOYButtonUsageGeneric0 + 0x101
#define GBJoyKitRapidA JOYButtonUsageGeneric0 + 0x102
#define GBJoyKitRapidB JOYButtonUsageGeneric0 + 0x103
extern NSString const *GBButtonNames[GBTotalButtonCount];
static inline NSString *n2s(uint64_t number)
{
return [NSString stringWithFormat:@"%llx", number];
}
static inline NSString *button_to_preference_name(GBButton button, unsigned player)
{
if (player) {
return [NSString stringWithFormat:@"GBPlayer%d%@", player + 1, GBButtonNames[button]];
}
return [NSString stringWithFormat:@"GB%@", GBButtonNames[button]];
}

View File

@@ -0,0 +1,4 @@
#import <Foundation/Foundation.h>
#import "GBButtons.h"
NSString const *GBButtonNames[] = {@"Right", @"Left", @"Up", @"Down", @"A", @"B", @"Select", @"Start", @"Rapid A", @"Rapid B", @"Turbo", @"Rewind", @"Slow-Motion", @"Hotkey 1", @"Hotkey 2"};

View File

@@ -0,0 +1,5 @@
#import <Cocoa/Cocoa.h>
@interface GBCPUView : NSView
- (void)addSample:(double)sample;
@end

126
bsnes/gb/Cocoa/GBCPUView.m Normal file
View File

@@ -0,0 +1,126 @@
#import "GBCPUView.h"
#define SAMPLE_COUNT 0x100 // ~4 seconds
@implementation GBCPUView
{
double _samples[SAMPLE_COUNT];
size_t _position;
}
- (void)drawRect:(NSRect)dirtyRect
{
CGRect bounds = self.bounds;
NSSize size = bounds.size;
unsigned factor = [[self.window screen] backingScaleFactor];
NSBitmapImageRep *maskBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:(unsigned)size.width * factor
pixelsHigh:(unsigned)size.height * factor
bitsPerSample:8
samplesPerPixel:2
hasAlpha:true
isPlanar:false
colorSpaceName:NSDeviceWhiteColorSpace
bytesPerRow:size.width * 2 * factor
bitsPerPixel:16];
NSGraphicsContext *mainContext = [NSGraphicsContext currentContext];
NSColor *greenColor, *redColor;
if (@available(macOS 10.10, *)) {
greenColor = [NSColor systemGreenColor];
redColor = [NSColor systemRedColor];
}
else {
greenColor = [NSColor colorWithRed:3.0 / 16 green:0.5 blue:5.0 / 16 alpha:1.0];
redColor = [NSColor colorWithRed:13.0 / 16 green:0.25 blue:0.25 alpha:1.0];
}
NSBitmapImageRep *colorBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:SAMPLE_COUNT
pixelsHigh:1
bitsPerSample:8
samplesPerPixel:3
hasAlpha:false
isPlanar:false
colorSpaceName:NSDeviceRGBColorSpace
bytesPerRow:SAMPLE_COUNT * 4
bitsPerPixel:32];
unsigned lastFill = 0;
NSBezierPath *line = [NSBezierPath bezierPath];
bool isRed = false;
{
double sample = _samples[_position % SAMPLE_COUNT];
[line moveToPoint:NSMakePoint(0,
(sample * (size.height - 1) + 0.5) * factor)];
isRed = sample == 1;
}
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:colorBitmap]];
for (unsigned i = 1; i < SAMPLE_COUNT; i++) {
double sample = _samples[(i + _position) % SAMPLE_COUNT];
[line lineToPoint:NSMakePoint(size.width * i * factor / (SAMPLE_COUNT - 1),
(sample * (size.height - 1) + 0.5) * factor)];
if (isRed != (sample == 1)) {
// Color changed
[(isRed? redColor : greenColor) setFill];
NSRectFill(CGRectMake(lastFill, 0, i - lastFill, 1));
lastFill = i;
isRed ^= true;
}
}
[(isRed? redColor : greenColor) setFill];
NSRectFill(CGRectMake(lastFill, 0, SAMPLE_COUNT - lastFill, 1));
NSBezierPath *fill = [line copy];
[fill lineToPoint:NSMakePoint(size.width * factor, 0)];
[fill lineToPoint:NSMakePoint(0, 0)];
NSColor *strokeColor = [NSColor whiteColor];
NSColor *fillColor = [strokeColor colorWithAlphaComponent:1 / 3.0];
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:maskBitmap]];
[fillColor setFill];
[fill fill];
[strokeColor setStroke];
[line setLineWidth:factor];
[line stroke];
CGContextRef maskContext = CGContextRetain([NSGraphicsContext currentContext].graphicsPort);
[NSGraphicsContext setCurrentContext:mainContext];
CGContextSaveGState(mainContext.graphicsPort);
CGImageRef maskImage = CGBitmapContextCreateImage(maskContext);
CGContextClipToMask(mainContext.graphicsPort, bounds, maskImage);
CGImageRelease(maskImage);
NSImage *colors = [[NSImage alloc] initWithSize:NSMakeSize(SAMPLE_COUNT, 1)];
[colors addRepresentation:colorBitmap];
[colors drawInRect:bounds];
CGContextRestoreGState(mainContext.graphicsPort);
CGContextRelease(maskContext);
[super drawRect:dirtyRect];
}
- (void)addSample:(double)sample
{
_samples[_position++] = sample;
if (_position == SAMPLE_COUNT) {
_position = 0;
}
}
@end

View File

@@ -0,0 +1,5 @@
#import <Cocoa/Cocoa.h>
@interface GBCenteredTextCell : NSTextFieldCell
@end

View File

@@ -0,0 +1,29 @@
#import "GBCenteredTextCell.h"
@implementation GBCenteredTextCell
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
double height = round([self.attributedStringValue size].height);
cellFrame.origin.y += (cellFrame.size.height - height) / 2;
cellFrame.size.height = height;
[super drawInteriorWithFrame:cellFrame inView:controlView];
}
- (void)selectWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate start:(NSInteger)selStart length:(NSInteger)selLength
{
double height = round([self.attributedStringValue size].height);
rect.origin.y += (rect.size.height - height) / 2;
rect.size.height = height;
[super selectWithFrame:rect inView:controlView editor:textObj delegate:delegate start:selStart length:selLength];
}
- (void)editWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate event:(NSEvent *)event
{
double height = round([self.attributedStringValue size].height);
rect.origin.y += (rect.size.height - height) / 2;
rect.size.height = height;
[super editWithFrame:rect inView:controlView editor:textObj delegate:delegate event:event];
}
@end

View File

@@ -0,0 +1,8 @@
#import <AppKit/AppKit.h>
#import "Document.h"
@interface GBCheatSearchController<NSTableViewDelegate, NSTableViewDataSource, NSControlTextEditingDelegate> : NSObject
@property IBOutlet NSWindow *window;
@property IBOutlet NSTableView *tableView;
+ (instancetype)controllerWithDocument:(Document *)document;
@end

View File

@@ -0,0 +1,234 @@
#import "GBCheatSearchController.h"
#import "GBWarningPopover.h"
#import "GBCheatWindowController.h"
#import "GBPanel.h"
@interface GBCheatSearchController() <NSTableViewDelegate, NSTableViewDataSource>
@property IBOutlet NSPopUpButton *dataTypeButton;
@property IBOutlet NSPopUpButton *conditionTypeButton;
@property IBOutlet NSTextField *operandField;
@property IBOutlet NSTextField *conditionField;
@property IBOutlet NSTextField *resultsLabel;
@property (strong) IBOutlet NSButton *addCheatButton;
@end
@implementation GBCheatSearchController
{
__weak Document *_document;
size_t _resultCount;
GB_cheat_search_result_t *_results;
GBPanel *_window;
}
+ (instancetype)controllerWithDocument:(Document *)document
{
GBCheatSearchController *ret = [[self alloc] init];
ret->_document = document;
NSArray *objects;
[[NSBundle mainBundle] loadNibNamed:@"CheatSearch" owner:ret topLevelObjects:&objects];
ret->_resultsLabel.stringValue = @"";
ret->_resultsLabel.cell.backgroundStyle = NSBackgroundStyleRaised;
ret->_window.ownerWindow = document.mainWindow;
return ret;
}
- (IBAction)reset:(id)sender
{
_dataTypeButton.enabled = true;
[_document performAtomicBlock:^{
GB_cheat_search_reset(_document.gb);
}];
_resultCount = 0;
if (_results) {
free(_results);
_results = NULL;
}
[_tableView reloadData];
_resultsLabel.stringValue = @"";
}
- (IBAction)search:(id)sender
{
// Dispatch to work around firstResponder oddities
dispatch_async(dispatch_get_main_queue(), ^{
if ([sender isKindOfClass:[NSTextField class]]) {
// Action sent by losing focus rather than pressing enter
if (![sender currentEditor]) return;
}
_dataTypeButton.enabled = false;
[_document performAtomicBlock:^{
__block bool success = false;
NSString *error = [_document captureOutputForBlock:^{
success = GB_cheat_search_filter(_document.gb, _conditionField.stringValue.UTF8String, _dataTypeButton.selectedTag);
}];
if (!success) {
dispatch_async(dispatch_get_main_queue(), ^{
[GBWarningPopover popoverWithContents:error onView:_conditionField];
NSBeep();
});
return;
}
_resultCount = GB_cheat_search_result_count(_document.gb);
_results = malloc(sizeof(*_results) * _resultCount);
GB_cheat_search_get_results(_document.gb, _results);
}];
if (_resultCount == 0) {
_dataTypeButton.enabled = true;
_resultsLabel.stringValue = @"No results.";
}
else {
_resultsLabel.stringValue = [NSString stringWithFormat:@"%@ result%s",
[NSNumberFormatter localizedStringFromNumber:@(_resultCount)
numberStyle:NSNumberFormatterDecimalStyle],
_resultCount > 1? "s" : ""];
}
[_tableView reloadData];
});
}
- (IBAction)conditionChanged:(id)sender
{
unsigned index = [_conditionTypeButton indexOfSelectedItem];
_conditionField.enabled = index == 11;
_operandField.enabled = index >= 1 && index <= 6;
switch ([_conditionTypeButton indexOfSelectedItem]) {
case 0: _conditionField.stringValue = @"1"; break;
case 1: _conditionField.stringValue = [NSString stringWithFormat:@"new == (%@)", _operandField.stringValue]; break;
case 2: _conditionField.stringValue = [NSString stringWithFormat:@"new != (%@)", _operandField.stringValue]; break;
case 3: _conditionField.stringValue = [NSString stringWithFormat:@"new > (%@)", _operandField.stringValue]; break;
case 4: _conditionField.stringValue = [NSString stringWithFormat:@"new >= (%@)", _operandField.stringValue]; break;
case 5: _conditionField.stringValue = [NSString stringWithFormat:@"new < (%@)", _operandField.stringValue]; break;
case 6: _conditionField.stringValue = [NSString stringWithFormat:@"new <= (%@)", _operandField.stringValue]; break;
case 7: _conditionField.stringValue = @"new != old"; break;
case 8: _conditionField.stringValue = @"new == old"; break;
case 9: _conditionField.stringValue = @"new > old"; break;
case 10: _conditionField.stringValue = @"new < old"; break;
}
}
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
{
return _resultCount;
}
- (uint8_t *)addressForRow:(unsigned)row
{
uint8_t *base;
uint32_t offset;
if (_results[row].addr < 0xc000) {
base = GB_get_direct_access(_document.gb, GB_DIRECT_ACCESS_CART_RAM, NULL, NULL);
offset = (_results[row].addr & 0x1FFF) + _results[row].bank * 0x2000;
}
else if (_results[row].addr < 0xe000) {
base = GB_get_direct_access(_document.gb, GB_DIRECT_ACCESS_RAM, NULL, NULL);
offset = (_results[row].addr & 0xFFF) + _results[row].bank * 0x1000;
}
else {
base = GB_get_direct_access(_document.gb, GB_DIRECT_ACCESS_HRAM, NULL, NULL);
offset = (_results[row].addr & 0x7F);
}
return base + offset;
}
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
switch ([[tableView tableColumns] indexOfObject:tableColumn]) {
case 0:
return [NSString stringWithFormat:@"$%02x:$%04x", _results[row].bank, _results[row].addr];
case 1:
if (_dataTypeButton.selectedTag & GB_CHEAT_SEARCH_DATA_TYPE_16BIT) {
return [NSString stringWithFormat:@"$%04x", _results[row].value];
}
return [NSString stringWithFormat:@"$%02x", _results[row].value];
default: {
const uint8_t *data = [self addressForRow:row];
GB_cheat_search_data_type_t dataType = _dataTypeButton.selectedTag;
uint16_t value = data[0];
if (!(dataType & GB_CHEAT_SEARCH_DATA_TYPE_16BIT)) {
return [NSString stringWithFormat:@"$%02x", value];
}
value |= data[1] << 8;
if ((dataType & GB_CHEAT_SEARCH_DATA_TYPE_BE_BIT)) {
value = __builtin_bswap16(value);
}
return [NSString stringWithFormat:@"$%04x", value];
}
}
}
- (void)tableView:(NSTableView *)tableView setObjectValue:(NSString *)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
[_document performAtomicBlock:^{
__block bool success = false;
__block uint16_t value;
NSString *error = [_document captureOutputForBlock:^{
success = !GB_debugger_evaluate(_document.gb, object.UTF8String, &value, NULL);
}];
if (!success) {
dispatch_async(dispatch_get_main_queue(), ^{
[GBWarningPopover popoverWithContents:error onView:tableView];
NSBeep();
});
return;
}
uint8_t *dest = [self addressForRow:row];
GB_cheat_search_data_type_t dataType = _dataTypeButton.selectedTag;
if (dataType & GB_CHEAT_SEARCH_DATA_TYPE_BE_BIT) {
value = __builtin_bswap16(value);
}
dest[0] = value;
if (dataType & GB_CHEAT_SEARCH_DATA_TYPE_16BIT) {
dest[1] = value >> 8;
}
dispatch_async(dispatch_get_main_queue(), ^{
[tableView reloadData];
});
}];
}
- (void)controlTextDidChange:(NSNotification *)obj
{
[self conditionChanged:nil];
}
- (IBAction)addCheat:(id)sender
{
GB_cheat_search_result_t *result = _results + _tableView.selectedRow;
uint8_t *data = [self addressForRow:_tableView.selectedRow];
GB_cheat_search_data_type_t dataType = _dataTypeButton.selectedTag;
size_t rowToSelect = 0;
GB_get_cheats(_document.gb, &rowToSelect);
[_document performAtomicBlock:^{
GB_add_cheat(_document.gb,
(dataType & GB_CHEAT_SEARCH_DATA_TYPE_16BIT)? "New Cheat (Part 1)" : "New Cheat",
result->addr, result->bank,
*data,
0, false,
true);
if (dataType & GB_CHEAT_SEARCH_DATA_TYPE_16BIT) {
GB_add_cheat(_document.gb,
(dataType & GB_CHEAT_SEARCH_DATA_TYPE_16BIT)? "New Cheat (Part 2)" : "New Cheat",
result->addr + 1, result->bank,
data[1],
0, false,
true);
}
GB_set_cheats_enabled(_document.gb, true);
}];
[_document.cheatsWindow makeKeyAndOrderFront:nil];
[_document.cheatWindowController.cheatsTable reloadData];
[_document.cheatWindowController.cheatsTable selectRow:rowToSelect byExtendingSelection:false];
[_document.cheatWindowController.cheatsTable.delegate tableViewSelectionDidChange:nil];
}
- (void)tableViewSelectionDidChange:(NSNotification *)notification
{
_addCheatButton.enabled = _tableView.numberOfSelectedRows != 0;
}
- (void)dealloc
{
if (_results) free(_results);
}
@end

View File

@@ -0,0 +1,5 @@
#import <Cocoa/Cocoa.h>
@interface GBCheatTextFieldCell : NSTextFieldCell
@property (nonatomic) bool usesAddressFormat;
@end

View File

@@ -0,0 +1,123 @@
#import "GBCheatTextFieldCell.h"
@interface GBCheatTextView : NSTextView
@property bool usesAddressFormat;
@end
@implementation GBCheatTextView
- (bool)_internalInsertText:(NSString *)string replacementRange:(NSRange)range
{
if (range.location == NSNotFound) {
range = self.selectedRange;
}
NSString *new = [self.string stringByReplacingCharactersInRange:range withString:string];
if (!self.usesAddressFormat) {
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^(\\$[0-9A-Fa-f]{1,2}|[0-9]{1,3})$" options:0 error:NULL];
if ([regex numberOfMatchesInString:new options:0 range:NSMakeRange(0, new.length)]) {
[super insertText:string replacementRange:range];
return true;
}
if ([regex numberOfMatchesInString:[@"$" stringByAppendingString:new] options:0 range:NSMakeRange(0, new.length + 1)]) {
[super insertText:string replacementRange:range];
[super insertText:@"$" replacementRange:NSMakeRange(0, 0)];
return true;
}
if ([new isEqualToString:@"$"] || [string length] == 0) {
self.string = @"$00";
self.selectedRange = NSMakeRange(1, 2);
return true;
}
}
else {
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^(\\$[0-9A-Fa-f]{1,3}:)?\\$[0-9a-fA-F]{1,4}$" options:0 error:NULL];
if ([regex numberOfMatchesInString:new options:0 range:NSMakeRange(0, new.length)]) {
[super insertText:string replacementRange:range];
return true;
}
if ([string length] == 0) {
NSUInteger index = [new rangeOfString:@":"].location;
if (index != NSNotFound) {
if (range.location > index) {
self.string = [[new componentsSeparatedByString:@":"] firstObject];
self.selectedRange = NSMakeRange(self.string.length, 0);
return true;
}
self.string = [[new componentsSeparatedByString:@":"] lastObject];
self.selectedRange = NSMakeRange(0, 0);
return true;
}
else if ([[self.string substringWithRange:range] isEqualToString:@":"]) {
self.string = [[self.string componentsSeparatedByString:@":"] lastObject];
self.selectedRange = NSMakeRange(0, 0);
return true;
}
}
if ([new isEqualToString:@"$"] || [string length] == 0) {
self.string = @"$0000";
self.selectedRange = NSMakeRange(1, 4);
return true;
}
if (([string isEqualToString:@"$"] || [string isEqualToString:@":"]) && range.length == 0 && range.location == 0) {
if ([self _internalInsertText:@"$00:" replacementRange:range]) {
self.selectedRange = NSMakeRange(1, 2);
return true;
}
}
if ([string isEqualToString:@":"] && range.length + range.location == self.string.length) {
if ([self _internalInsertText:@":$0" replacementRange:range]) {
self.selectedRange = NSMakeRange(self.string.length - 2, 2);
return true;
}
}
if ([string isEqualToString:@"$"]) {
if ([self _internalInsertText:@"$0" replacementRange:range]) {
self.selectedRange = NSMakeRange(range.location + 1, 1);
return true;
}
}
}
return false;
}
- (NSUndoManager *)undoManager
{
return nil;
}
- (void)insertText:(id)string replacementRange:(NSRange)replacementRange
{
if (![self _internalInsertText:string replacementRange:replacementRange]) {
if (![self _internalInsertText:[@"$" stringByAppendingString:string] replacementRange:replacementRange]) {
NSBeep();
}
}
}
/* Private API, don't tell the police! */
- (void)_userReplaceRange:(NSRange)range withString:(NSString *)string
{
[self insertText:string replacementRange:range];
}
@end
@implementation GBCheatTextFieldCell
{
bool _drawing, _editing;
GBCheatTextView *_fieldEditor;
}
- (NSTextView *)fieldEditorForView:(NSView *)controlView
{
if (_fieldEditor) {
_fieldEditor.usesAddressFormat = self.usesAddressFormat;
return _fieldEditor;
}
_fieldEditor = [[GBCheatTextView alloc] initWithFrame:controlView.frame];
_fieldEditor.fieldEditor = true;
_fieldEditor.usesAddressFormat = self.usesAddressFormat;
return _fieldEditor;
}
@end

View File

@@ -0,0 +1,16 @@
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import "Document.h"
@interface GBCheatWindowController : NSObject <NSTableViewDelegate, NSTableViewDataSource, NSTextFieldDelegate>
@property (nonatomic, weak) IBOutlet NSTableView *cheatsTable;
@property (nonatomic, weak) IBOutlet NSTextField *addressField;
@property (nonatomic, weak) IBOutlet NSTextField *valueField;
@property (nonatomic, weak) IBOutlet NSTextField *oldValueField;
@property (nonatomic, weak) IBOutlet NSButton *oldValueCheckbox;
@property (nonatomic, weak) IBOutlet NSTextField *descriptionField;
@property (nonatomic, weak) IBOutlet NSTextField *importCodeField;
@property (nonatomic, weak) IBOutlet NSTextField *importDescriptionField;
@property (nonatomic, weak) IBOutlet Document *document;
- (void)cheatsUpdated;
@end

Some files were not shown because too many files have changed in this diff Show More