Commit Graph

50 Commits

Author SHA1 Message Date
BearOso 945cd27841 Gtk: Add UI option to configure size, indicators. 2023-04-25 17:36:48 -05: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 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 2fb67c7329 Gtk: Clean up asan leaks. 2023-03-07 13:58:22 -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 109fedf42c Gtk: Convert driver setting to a string. 2023-03-07 13:58:21 -06: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
Jean Raby 38b1e495ea Move joystick + related functions under JoyDevices 2022-02-18 15:43:52 -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
BearOso da4bd2a018 Gtk: Make sound driver check a little simpler. 2021-05-15 11:23:12 -05:00
Brandon Wright e17ff69533 Gtk: Switch codebase to gtkmm.
GTK: Remove support for GTK+ 2.0.

GTK 3 is stable and widespread enough now.

GTK: Rearrange headers to eliminate gtk_s9xcore.h

Gtk: Initial gtkmm conversion work.

Gtk: More gtkmm conversion and bug fixing.

Gtk: More gtkmm fixes.

Gtk: More Fixes

OpenGL no longer creates a second window.
Accelerators are fixed.

Gtk: More fixes

Removed GLX context dependency on Gtk.

Gtk: Fix formatting.

Gtk: Remove a #pragma once
2020-07-17 14:48:34 -05:00
Brandon Wright 5c3fbf6740 Fix some warnings.
Removed sstrncpy function.
Changed bindings in GTK port to std::array and fixed packing nonsense.
2020-06-20 10:44:11 -05:00
Brandon Wright 19f7423f42 GTK: Add a couple animated background splashes. 2019-11-08 17:05:36 -06:00
Brandon Wright 9c733497fe GTK: Allow shutting off button and menu icons. 2019-04-16 11:47:35 -05:00
Brandon Wright 656f085331 Another splash option. 2019-03-25 16:16:08 -05:00
Brandon Wright 0deed414b9 GTK: Remove mostly unused status bar.
Don't bypass compositor in UI-fullscreen mode.
2019-03-24 12:25:29 -05:00
Brandon Wright dfe66f57b3 GTK: Add new splash background options. 2019-03-21 16:37:00 -05:00
Brandon Wright 7b310a0cf4 GTK: Swap glFenceSync for sync control extension. 2019-03-02 15:25:59 -06:00
Brandon Wright 191b82f14d GTK: Break display settings into tabs. 2019-02-17 20:55:59 -06:00
Brandon Wright 0cb166862f GTK+: Add things to shader parameters dialog:
Spin buttons next to sliders for precise control.
Save as box to save a new preset.
2019-01-31 16:33:17 -06:00
Brandon Wright e632740be3 GTK+: Use std::string for some config options. 2018-12-28 18:36:23 -06:00
Brandon Wright fcdead0028 GTK+: Use lowercase true/false, bool in more places. 2018-12-28 17:07:32 -06:00
Brandon Wright 3eea50654f GTK+: OpenGL: Separate glFinish and glFenceSync options. 2018-12-28 12:06:31 -06:00
Brandon Wright a718990735 GTK+: Remove vertex_shader and rename fragment_shader. 2018-12-10 15:10:40 -06:00
Brandon Wright 536c6708c3 GTK+: Various cleanups. 2018-12-03 17:32:12 -06:00
Brandon Wright c21539d269 GTK+: Mandate Netplay, Joystick, JMA. 2018-12-03 17:32:12 -06:00
Brandon Wright a48703796a GTK+: Use std::string here. 2018-11-18 13:08:42 -06:00
Brandon Wright f0ddb097f9 Mark all of GTK+ with header stub, and a couple others. 2018-11-15 17:42:29 -06:00
Brandon Wright 61cced4734 GTK+: Use root snes_ntsc implementation.
Implement scanlines there.
2018-11-12 16:51:21 -06:00
Brandon Wright af2df5869d GTK+: Remove goofy headerbar experiment. 2018-11-07 15:09:27 -06:00
Brandon Wright cadffa0073 GTK+: Relative save slots. 2018-11-06 16:39:23 -06:00
Brandon Wright b5b7c4390c GTK+: Add support for header bar. 2018-11-02 19:20:46 -05:00
Brandon Wright a04ccfc02c GTK+: Style: Remove voids from parameter list. 2018-11-02 15:52:26 -05:00
Brandon Wright 0c3bc1d350 GTK+: Remove XML config format. 2018-11-01 21:11:39 -05:00
Brandon Wright 79b1ab0250 GTK+: Clean up speed throttling.
No more frameskip selection, only 4 options:

* Timer throttling to Settings.FrameRate
* Same, but skips frames when late
* Wait on sound buffer
* Don't throttle.

Dynamic rate control is automatically disabled for option 3.
2018-10-28 16:55:33 -05:00
Brandon Wright 7411df6c73 Make rewinding and bilinear filtering global Snes9x settings. 2018-05-13 17:31:25 -05:00
Brandon Wright 6ad137aca2 Work towards configurable parameters. 2018-05-12 15:07:07 -05:00
Brandon Wright 3668c5c7a2 Simplify XRR config. 2018-05-04 17:56:57 -05:00
Brandon Wright d726c6a8dd Mandate XRandR libraries and headers. 2018-05-02 16:53:54 -05:00
Brandon Wright c48f212a8a Rework XRandR support to list all modes and refresh rates. 2018-04-28 18:36:40 -05:00
Brandon Wright 7223e2283e Save rewind variables to config file. Rename rewind variables to fit port style. Set default rewind buffer to 0. 2016-10-08 21:33:34 -05:00
Brandon Wright 90be7fb762 Merge branch 'master' of http://github.com/juhalaukkanen/snes9x into juhalaukken-master 2016-10-08 21:15:45 -05:00
Brandon Wright 1442378a13 Add option to mute sound on turbo 2016-08-02 10:31:05 -05:00
Juha Laukkanen 118544e8ac Use of rewind feature (stateman) with GTK. 2014-06-27 08:36:36 +00:00
Brandon Wright 288a629311 Add high-resolution blending option to GTK+ port. 2011-01-23 16:25:46 -06:00
Brandon Wright 5a5d3f9192 Allow bilinear filtering in GTK output driver. 2010-11-18 06:31:27 -06:00
Brandon Wright c6677d8292 Add hidden option for enabling non-modal dialogs. 2010-10-30 09:21:26 -05:00
Brandon Wright 31f45619a5 Import of GTK port changes. 2010-09-26 04:19:15 -05:00
OV2 d1666860e0 Initial 1.52 import 2010-09-25 17:46:12 +02:00