Commit Graph

4082 Commits

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 `override`s
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