Commit Graph

97 Commits

Author SHA1 Message Date
BearOso
945cd27841 Gtk: Add UI option to configure size, indicators. 2023-04-25 17:36:48 -05: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
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
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
4a3f7b4d84 Gtk: Use more std::filesystem. 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
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
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
BearOso
c8ffda83e7 Gtk: Set default background to starfield. 2022-01-30 18:34:51 -06: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
0f0914cca5 GTK: Config code cleanup. 2020-06-21 15:25:54 -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
00da664a60 GTK: Don't change config directory mode every time.
This triggers something laggy in GNOME environment.
2019-10-10 18:50:36 -05:00
Taimoor Ahmad
d16c9775a9 Only show if DisplayTime is enabled in settings 2019-05-11 23:24:17 -04:00
Brandon Wright
9c733497fe GTK: Allow shutting off button and menu icons. 2019-04-16 11:47:35 -05:00
Brandon Wright
a820272191 GTK: Save echo buffer hack value.
Sanitize overclock settings when UI doesn't make them available.
2019-04-13 15:54:41 -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
83505d88c2 GTK: Fix broken keys. 2019-03-22 11:59:50 -05:00
Brandon Wright
bdf0e426e0 GTK: Allow one key for multi joypad assignments.
Lets you do stuff like Chrono Trigger L+R+A or all punch buttons in
fighting games.
2019-03-21 17:54:27 -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
ef70758053 GTK: Use actual NTSC frame time. 2019-02-27 13:55:19 -06:00
Brandon Wright
6757f93830 Snes9x, not Snes9X
Win32 title will display "ROM base name - Snes9x"
2019-02-18 15:15:28 -06:00
Brandon Wright
191b82f14d GTK: Break display settings into tabs. 2019-02-17 20:55:59 -06:00
Brandon Wright
1d57e214b3 GTK/Unix: Consistent default playback rate. 2019-02-15 13:06:25 -06:00
Brandon Wright
5b4ca50792 GTK+: Strip out extra sound code.
No more Stereo, 16-bit or Reverse options.
2019-02-06 19:41:33 -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
56d9cb3d2e GTK+: The config file show know about none. 2018-12-12 16:46:30 -06:00
Brandon Wright
c9a8b28d18 GTK+: Hook up Settings.DisplayPressedKeys 2018-12-12 16:24:21 -06:00
Brandon Wright
a718990735 GTK+: Remove vertex_shader and rename fragment_shader. 2018-12-10 15:10:40 -06:00
Brandon Wright
c1cbe9c65f GTK+: More sensible defaults.
16666 NTSC frame time is closer to correct than 16667.
32000/32040 is irrelevant because resampling is always needed.
Don't recommend 32000 in UI.
2018-12-10 15:02:57 -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
5e9f06858d GTK+: Fix partial config files. Fix sanity check. 2018-12-01 18:54:25 -06:00
Brandon Wright
a48703796a GTK+: Use std::string here. 2018-11-18 13:08:42 -06:00
Brandon Wright
1cd825090b GTK+: OpenGL: Don't reset state we don't change. 2018-11-17 12:19:16 -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
7a64ed801d GTK+: Don't translate config file entries. 2018-11-14 14:51:39 -06:00
Brandon Wright
7ae93a539e GTK+: Save controller ports to config file. 2018-11-08 14:59:24 -06:00