Commit Graph

650 Commits

Author SHA1 Message Date
StanleyKid-22 b25e8a6d01
Updating Ukrainian translation 2023-03-25 12:42:03 +02:00
BearOso 8e78a431cc Gtk: Exclude slang_test from all target. 2023-03-24 13:25:07 -05:00
bearoso 8ac2ac7be5
Merge branch 'master' into master 2023-03-22 14:25:17 -05:00
Felipe be9f19830e
Updated brazilian portuguese translation
Updated translation with the strings that were changed.
2023-03-22 11:54:04 -03:00
BearOso 5157426cb6 Gtk: Use translated binding names in preferences. 2023-03-21 17:45:39 -05:00
BearOso 26291d185d Gtk: Fix some missing lines again. 2023-03-21 17:41:08 -05:00
BearOso 8593d9014b Gtk: Fix xgettext missing a few strings. 2023-03-21 17:32:08 -05:00
BearOso e34097ecdf Gtk: Only adjust the numeric locale with file reads. 2023-03-21 16:47:39 -05:00
BearOso 13a5592ba6 Gtk: Add the missing lines from a couple .po files. 2023-03-21 16:33:52 -05:00
BearOso e1eb7ea9de Gtk: Fix up some internationalization problems. 2023-03-21 15:45:16 -05:00
BearOso 50f9f9eba1 Move S9xSyncSpeed call.
DMA can last multiple frames, and so can S9xMainLoop.
If we throttle outside of S9xMainLoop or only as we're exiting the
loop as is currently done, we zoom through multiple frames and
overrun the audio. Moving S9xSyncSpeed just after EndScreenRefresh
causes it to be called every frame.

This seemingly wasn't a problem because throttling with vsync *did*
happen every frame regardless. Oops.
2023-03-20 16:02:36 -05:00
BearOso 176556dfd3 Add menu items to scale windows up to 10x. 2023-03-12 11:10:02 -05:00
BearOso 22e0b373e4 Gtk: Add clear recent items item. 2023-03-11 17:46:40 -06:00
BearOso 87bb383797 Gtk: Multiple assignment syntax. 2023-03-11 16:47:07 -06:00
bearoso 3378d6cc02
Merge pull request #753 from Felipefpl/master
Updated brazilian portuguese translation
2023-03-11 14:36:13 -06:00
BearOso b293366fdf Gtk: Remove meson remnant. 2023-03-07 14:50:23 -06:00
BearOso e9f8b9925f Gtk: Refresh window canvas when first displayed.
Wayland/OpenGL doesn't receive a redraw cue after Gtk resizes the
window and it scales a 256x224 corner of the larger surface up with
the viewport extension.
2023-03-07 14:06:59 -06:00
BearOso 1b10ca7ab0 Gtk/OpenGL: Remove npot variable. 2023-03-07 14:01:29 -06:00
BearOso 1f59744ab9 Gtk/Wayland: Don't require libwayland >= 1.20.
Used old version of wayland-scanner to generate protocol files.
2023-03-07 14:01:29 -06:00
BearOso 790962f2bb Gtk: Add missing Wayland protocol files. 2023-03-07 14:01:29 -06:00
BearOso aa2a46f87b Gtk/OpenGL/Wayland: Support fractional scale. 2023-03-07 14:01:29 -06:00
BearOso f1286eda4c Gtk/Wayland: Support fractional scale. 2023-03-07 14:01:29 -06:00
BearOso 7a7e5226cc Gtk: Set auto_vrr to false by default. 2023-03-07 14:01:29 -06:00
BearOso 1434dce671 Gtk: Add setting to configure for VRR automatically.
Swaps to ideal config for VRR in fullscreen. Switches sound
input rate and frame rate to exact SNES rate and uses timers for
sync.
2023-03-07 14:01:29 -06:00
BearOso 6ae1a4478e Gtk/Vulkan: Handle failure to acquire swapchain image. 2023-03-07 14:01:29 -06:00
BearOso 309f9e650d vulkan: Move throttle out of swapchain.
Make the swapchain wrapper more flexible, allowing deferring the
swap from the end_frame function.
2023-03-07 14:01:29 -06:00
BearOso b82edaac96 vulkan: Add a throttler before present for precise frame rates. 2023-03-07 14:01:29 -06:00
BearOso 130e1509da Revert "vulkan/slang: Allow a cache for spv."
This reverts commit db554aa8cd62f083b93d4b2e7147c5d2500366d9.
2023-03-07 14:01:29 -06:00
BearOso 8907541f28 vulkan/slang: Allow a cache for spv. 2023-03-07 14:01:29 -06:00
BearOso 3c1d330169 Gtk: Make it possible to build without Slang/Vulkan. 2023-03-07 14:01:29 -06:00
BearOso 948506ad95 Gtk: Add dynamic rate control to SDL driver. 2023-03-07 14:01:29 -06:00
BearOso bb210dc1a1 Gtk: Move simple vulkan output into separate class. 2023-03-07 13:58:22 -06:00
BearOso 410696ce4e Gtk: Remove SDL_GetDefaultAudioInfo. 2023-03-07 13:58:22 -06:00
BearOso 2fb67c7329 Gtk: Clean up asan leaks. 2023-03-07 13:58:22 -06:00
BearOso c3366477a7 Gtk: Lower CMake required version. 2023-03-07 13:58:22 -06:00
BearOso f4f7f03be3 Remove meson as build option for Gtk.
Meson isn't flexible with our port subdirectory approach.
2023-03-07 13:58:22 -06:00
BearOso 246a44a940 Error handling. 2023-03-07 13:58:22 -06:00
BearOso e4768f9b80 Wayland compatibility with Vulkan. 2023-03-07 13:58:21 -06:00
BearOso fa03a2c5b2 Gtk: Remove some superfluous graphics options.
PBOs aren't generally faster any more.
NPOT textures are widely supported.
Giving control over to Gtk while waiting for a swap doesn't really work
that well, so the sync control extension options are removed.

This means the OpenGL and Vulkan backends are in parity with regard to
options.
2023-03-07 13:58:21 -06:00
BearOso 259dfd07ae Vulkan support.
Gtk port support. Breaks other platforms.
2023-03-07 13:58:21 -06:00
BearOso 109fedf42c Gtk: Convert driver setting to a string. 2023-03-07 13:58:21 -06:00
BearOso 6433b8f689 Gtk: Clean up and modernize a bit. 2023-03-07 13:58:21 -06:00
BearOso 2e39f2f477 Modernize cheat stuff. 2023-03-07 13:58:21 -06:00
BearOso c69552ccff More cleaning. 2023-03-07 13:58:21 -06:00
BearOso 596e84af2a Start simplifying filesystem stuff. 2023-03-07 13:58:21 -06:00
BearOso 4a3f7b4d84 Gtk: Use more std::filesystem. 2023-03-07 13:58:21 -06:00
BearOso b9bb200a78 Gtk: Reorganize some of startup. 2023-03-07 13:58:21 -06:00
BearOso 453bbbe779 Update glslang. Fix meson build. 2023-03-07 13:58:21 -06:00
BearOso 19c7ce56e0 Gtk: Use fmt for string. 2023-03-07 13:58:21 -06:00
BearOso 375a263961 Gtk: Stringify some things. 2023-03-07 13:58:21 -06:00
Gutawer 7321eb3320 Gtk: Fix some keys not being usable with modifiers 2023-01-25 17:04:25 +00:00
Nick Burtner 86ab38408c Fixes issue where non-archive msu-1 files would have improper file extensions 2022-11-01 17:50:21 -04:00
BearOso 8c0a4a4168 Gtk: Fix replacing last directory component instead adding filename 2022-04-30 12:37:07 -05:00
BearOso f3fafab8b3 Remove unused logger.cpp and logger.h. 2022-04-25 15:45:39 -05:00
BearOso 3c729a9763 Gtk: Remove option to disable OpenGL.
OpenGL is the optimal display mode until Vulkan is in, and it's
mandatory on Wayland. Don't let it be disabled.
2022-04-19 17:22:42 -05:00
BearOso 1085ed6fad Remove Settings.SupportHires
There's no point in disabling it at this point, so it's always supported.
2022-04-13 15:06:13 -05:00
BearOso aa6abace40 Create output buffer in core.
TODO: Fix Windows.
2022-04-10 16:41:16 -05:00
BearOso 784667f5b2 Gtk: Update gtk_file.cpp for modern C++
Uses std::filesystem and std::string.
2022-04-09 17:19:01 -05:00
Felipe d61e8b1817
Updated brazilian portuguese 2022-03-31 14:05:49 -03:00
BearOso b759ebbf19 Gtk: Lower meson required version. 2022-03-24 16:37:35 -05:00
BearOso 8b0cc9ae52 Gtk: Add missing CMake options. 2022-03-24 16:33:20 -05:00
BearOso a4cf41e879 Gtk: Add CMake as build option. 2022-03-24 12:21:52 -05:00
BearOso 17cb084df0 Gtk: Experiment with symlink. 2022-03-22 14:09:30 -05:00
BearOso fe5fbb0c80 Gtk: Fix compile with moved deps. 2022-03-18 15:49:54 -05:00
BearOso a8fafcd94c Gtk: Clean up a couple sound drivers.
Make them more idiomatic C++.
2022-03-12 11:19:39 -06:00
BearOso 1041ff3e24 Gtk: Add Ukrainian translation from StanleyKid-22. 2022-03-01 18:22:03 -06:00
BearOso 8f5afb1013 gtk: Initialize jd 2022-02-19 13:22:20 -06:00
bearoso 17e75b1469
Merge pull request #741 from jraby/gtk-joystick-hotplug
gtk: Support adding/removing joysticks at runtime
2022-02-19 13:20:38 -06:00
Jean Raby 65d41e7b37 joynums.fill(false); 2022-02-18 16:12:19 -05:00
Jean Raby 38b1e495ea Move joystick + related functions under JoyDevices 2022-02-18 15:43:52 -05:00
Jean Raby e1685b05eb range-based for loops + simplify joynum assignment 2022-02-18 11:08:20 -05:00
Jean Raby cdbf783fc4 gtk: Support adding/removing joysticks at runtime
Reworked how/where SDL events are polled:
  - poll_joystick_events is now a static member of JoyDevice so it can be
    called from outside when needed (preference window for config and
    caliration).
  - S9xProcessEvents calls JoyDevice::poll_joystick_events directly so
    events are polled when no joysticks are attached.
  - JoyDevice::poll_joystick_events handles SDL_JOYDEVICE{ADDED,REMOVED}
    events.
  - Individual JoyDevice no longer call poll_joystick_events from
    get_events.

Reworked how attached joysticks are maintained in Snes9xConfig:
  - Use a map for joysticks keyed on SDL JoystickID (instance id in sdl
    parlance), which is stable while a joystick is attached instead of
    an array keyed on device_index.
    The instance id is what poll_joystick_events gets with every
    event (except for SDL_JOYDEVICEADDED which gets a device_index...)
    Instance id is an incrementing int starting from 0, they are never reused.
    i.e. each attach/dettach/attach cycle yields a new id.
    Whereas device index are reused and can "move".
  - On SDL_JOYDEVICEADDED the joystick is handed a "joynum", that is, an
    int from 0 to NUM_JOYPADS-1. A new joystick always get the lowest
    available joynum.
    (joynum was already a member of JoyDevice but wasn't initialized,
    this seemed like a proper way to use it.)
  - On SDL_JOYDEVICEREMOVED, the joystick associated with the instance
    id is simply removed from the map.

All this allows for the following behaviors.
It is possible to start without any joystick, add one joystick and it works.
(disconnect/reconnect cycles with a single joystick also work)

Joystick numbers are "stable" while they remain connected. For example:
 - Start with joystick0 and joystick1 connected
 - if joystick0 is disconnected, joystick1 keeps its number and keeps
   working
 - if joystick0 (or any new joystick) is connected at this time,
   it gets to become joystick0

If all joysticks are disconnected while snes9x is running, the order of
the "reconnections" will determine the joystick number of each joystick.

I think there is room for improvement still, with regards to code
organization. For instance, there could be a "JoyDevices" class which
would handle all the attached JoyDevice. This would allow moving all the
"joystick_*" methods from Snes9xConfig to that new class, and
poll_joystick_events could also be moved there.
The functionality wouldn't change, but the intent/ownership would probably be clearer.
2022-02-17 11:02:53 -05:00
Jean Raby e6118290e2 gtk: Simplify S9xOpenSnapshotFile
This is basically what osx and libretro do, just use the provided
filename.
The code this replaces had a hard time handling relative paths,
it would prepend the leading directories to fname, which would
most of the time resolve to an invalid path.
(e.g ./roms/romname.000 -> ./roms/roms/romname.000)
2022-02-13 21:57:58 -05:00
Jean Raby c81d3baca1 gtk: save_state_dialog - use filename without dir 2022-02-13 21:56:42 -05:00
BearOso d4cec8eb2a Gtk: Wayland: Use older wayland API for compatibility. 2022-01-31 16:56:17 -06:00
BearOso da23559f2f Gtk: Add wayland-client as wayland dep. 2022-01-31 16:32:27 -06:00
BearOso f56b1e7668 Gtk: Wayland: Add idle inhibitor. 2022-01-30 21:23:33 -06:00
BearOso c8ffda83e7 Gtk: Set default background to starfield. 2022-01-30 18:34:51 -06:00
BearOso eb2c993a91 Update version and copyright for 1.61. 2022-01-30 17:52:50 -06:00
BearOso 34b6160805 pulseaudio: Fix potential stall with Pipewire
Pipewire allows very small buffer sizes. It's possible that Snes9x
will accumulate enough samples in fast-forward to exceed this.
Instead of waiting forever for the buffer capacity to free up, just
write the number of samples for the free space after one small wait.
2021-12-20 12:21:43 -06:00
BearOso cf2d1bf791 Gtk: OpenGL: Fix non-PBO output path. 2021-05-15 11:23:12 -05:00
BearOso da4bd2a018 Gtk: Make sound driver check a little simpler. 2021-05-15 11:23:12 -05:00
BearOso 364aa1ba5d Gtk: OpenGL: Use correct screen for fbconfig. 2020-11-04 13:11:28 -06:00
BearOso 77fb6ff958 Gtk: Unthread preferences creation. 2020-11-04 12:55:25 -06:00
BearOso 2bab4c41b1 Revert "Gtk: OpenGL: Try to ensure window is mapped."
This reverts commit c4a269b32a.
2020-11-04 12:54:44 -06:00
BearOso b4de90a0f1 Revert "Gtk: Reorder init."
This reverts commit a9a9b0fafb.
2020-11-04 12:41:55 -06:00
BearOso a9a9b0fafb Gtk: Reorder init.
This should give the window time to create, and we ensure Gtk
has a main loop iteration so it's done.
2020-11-04 12:10:30 -06:00
BearOso c4a269b32a Gtk: OpenGL: Try to ensure window is mapped. 2020-11-04 12:03:28 -06:00
BearOso c283df610c Fix misspelling.
Complement, not compliment.
2020-11-03 10:28:01 -06:00
BearOso bb622bdf5b Add a compat.cpp file for compatibility symbols. 2020-09-07 10:57:17 -05:00
BearOso 2fc8b40e0e Gtk: Fix '&' in rom info dialog. 2020-08-24 14:21:24 -05:00
BearOso 6d1d0ab121 Gtk: Still use theme icon if available. 2020-08-23 17:47:27 -05:00
BearOso 4c3d043880 Gtk: Update built-in mini-icon. 2020-08-23 17:46:25 -05:00
BearOso 1fc5a2d4d6 Gtk: Fix crash when no icon is found. 2020-08-23 17:17:55 -05:00
BearOso 95c7fdad1f Gtk: Thread preferences creation. 2020-08-23 16:28:01 -05:00
BearOso a3c0c4621d Gtk: Don't pass arguments to gtkmm application.
It tries to usurp the filename argument.
2020-08-09 14:28:20 -05:00
BearOso 03d3f69a0c Gtk: Shaders: Use our copy of glslang headers
Add include to compiler command to prevent use of system headers.
2020-08-08 12:01:10 -05:00
BearOso e705e71a97 Remove S9xChooseMovieFilename
This is integration of the frontend with the core. Disable
the button mappings that use it. The frontend should implement on
its own.
2020-08-07 14:08:51 -05:00
BearOso f04f1bbe44 Remove S9xChooseFilename
This is integration of the frontend with the core. Disable
the snapshot button mappings that use it. Any frontend should
implement those port commands its own.
2020-08-07 14:08:51 -05:00
BearOso 063b3a959c Move _splitpath and _makepath into core. 2020-08-07 14:08:51 -05:00