6704 Commits

Author SHA1 Message Date
cpasjuste
776bb49ba1 switch: minor cleanup 2021-06-18 15:08:55 +01:00
cpasjuste
481c32b352 switch: use unix timers 2021-06-18 15:08:55 +01:00
Cpasjuste
93d84618b2 switch: fix window cropping (#35) 2021-06-18 15:08:55 +01:00
rsn8887
c30ec89b7a Switch: Add support for physical keyboard and mouse (#33) 2021-06-18 15:08:55 +01:00
Cpasjuste
12f161236f switch: use audren audio
fix suspend, allow freqs other than 48khz
2021-06-18 15:08:55 +01:00
Cpasjuste
0c22a3c059 switch: lower down thread priority for SDL_THREAD_PRIORITY_HIGH
major speed improvement when audio is used
2021-06-18 15:08:55 +01:00
Cpasjuste
c465ab9b4d Switch sdl2 syscond fix (#28)
* switch: return SDL_MUTEX_TIMEDOUT when SDL_CondWaitTimeout... timeout
2021-06-18 15:08:55 +01:00
Cpasjuste
8629d3ff0b switch: fix SDL_CondWaitTimeout (#27) 2021-06-18 15:08:55 +01:00
Cpasjuste
45b864bb7b switch: use new gfx (#26) 2021-06-18 15:08:55 +01:00
Cpasjuste
6748b87af8 switch: use c11 threads 2021-06-18 15:08:55 +01:00
rsn8887
063a1c9265 switch: support reading SL/SR buttons on LAYOUT_LEFT and LAYOUT_RIGHT (#23) 2021-06-18 15:08:55 +01:00
Cpasjuste
2ca320b95a switch: remove SDL_LoadFunction/SDL_UnloadObject from SDL_switchopengles.c(#22)
Functions already defined in dummy loadso
2021-06-18 15:08:55 +01:00
Cpasjuste
a96c709351 switch: increase thread stack size (fix a lot of stuff)
switch: enable load balancing across cores (@fincs)
2021-06-18 15:08:55 +01:00
Cpasjuste
2776779715 switch: move to opengles 2 renderer
* switch: move to opengles 2 rendering

* switch: remove libglad dependecy

* switch: minor cleanup

* switch: minor cleanup 2

* switch: use SDL2 EGL video, fix inputs, major cleanup

* switch: fix configure flags (static EGL funcs)

* switch: update to latest mesa (remove SDL_egl.c hacks)

* switch: restore vanilla SDL_egl.c (remove crap)

* switch: use RGBA8888 display mode instead of ARGB888

* switch: add "multiple display" mode support
2021-06-18 15:08:55 +01:00
Cpasjuste
9e06af0445 switch: update for latest libnx 2021-06-18 15:08:55 +01:00
cpasjuste
20c0dad801 switch: revert thread priority back to 0x1C as it's faster 2021-06-18 15:08:55 +01:00
Jeremy S. Postelnek
26a79e4d1c fix player one joycon to auto use handheld or detached (#16) 2021-06-18 15:08:55 +01:00
Cpasjuste
137217702f switch: let the user handle single/dual joycons mode (#14) 2021-06-18 15:08:55 +01:00
Cpasjuste
2e41af5305 switch: update threading code, add SDL_SYS_SetThreadPriority (#15) 2021-06-18 15:08:55 +01:00
Carsten Teibes
f77437cd4b Switch: Enable more audio formats with resampling (#12)
Instead of erroring out, just tell SDL2 we want a different format, so
it will do the necessary steps (configuring the resampler) and still
feed us with a format known supported by the hardware.
2021-06-18 15:08:55 +01:00
Cpasjuste
bf248dd581 switch: add touchscreen support 2021-06-18 15:08:55 +01:00
Cpasjuste
97afa95d57 switch: increase audio thread priority
switch: use bigger stack size
switch: fix bytes per sample ? (seems perfect audio at least)
2021-06-18 15:08:55 +01:00
Cpasjuste
3b41de6ba9 switch: fix clear framebuffers 2021-06-18 15:08:55 +01:00
Cpasjuste
b2f8a546da switch: fix incorrect window centering (#10) 2021-06-18 15:08:55 +01:00
Cpasjuste
abf3a5b7ed switch: add game controller support 2021-06-18 15:08:46 +01:00
Cpasjuste
05b71ace4f switch: handle aspect ratio correction in fullscreen mode 2021-06-18 14:22:40 +01:00
cpasjuste
53e19d42b9 SWITCH: fix crash on exit (hidSetNpadJoyAssignmentModeDual on invalid controller in quit) 2021-06-18 14:22:40 +01:00
Cpasjuste
1a52258796 SWITCH: properly implement multiple joysticks support 2021-06-18 14:22:40 +01:00
cpasjuste
fd0204cc42 SWITCH: prevent fb overflow in case of external resolution change 2021-06-18 14:22:40 +01:00
Cpasjuste
daf09af4dd SWITCH: allow any window size, handle SDL_SetWindowDisplayMode
* SWITCH: update test for latest changes
* SWITCH: fix devkitpro build
2021-06-18 14:22:40 +01:00
cpasjuste
42c8e7e175 SWITCH: bitmask joystick buttons to fit HidControllerKeys
SWITCH: improve and comment test
2021-06-18 14:22:40 +01:00
cpasjuste
25454343e2 SWITCH: properly close thread 2021-06-18 14:22:40 +01:00
cpasjuste
c451671c4d SWITCH: thread entry should be static 2021-06-18 14:22:40 +01:00
cpasjuste
f6e5951ebf SWITCH: add audio support 2021-06-18 14:22:40 +01:00
Cpasjuste
9d4ad79af1 SWITCH: thread fix 2021-06-18 14:22:01 +01:00
Cpasjuste
b926068855 SWITCH: add joystick support 2021-06-18 14:22:01 +01:00
Cpasjuste
005829b775 SWITCH: first commit, missing audio, input... (#1)
* SWITCH: first commit, missing audio, input...
2021-06-18 14:22:01 +01:00
Dave Murphy
9a27289760 get aarch64-none-elf to configure & build 2021-06-18 14:20:10 +01:00
Ryan C. Gordon
839387ed0a
video/dummy: Don't zero out the fake display mode before adding it.
The SDL_zero call was in the wrong place as a historical accident, I think.
2021-06-17 22:11:10 -04:00
Sam Lantinga
268fbcd460 Fixed compiler warning on Visual Studio 2021-06-17 11:23:47 -07:00
Sam Lantinga
d8dba5bcf3 Added support for the Logitech G923 racing wheel 2021-06-17 11:22:08 -07:00
Ethan Lee
7f261d3b76 wayland: Fix returning to a window from fullscreen without calling SetWindowSize 2021-06-15 09:00:18 -07:00
Ivan Epifanov
8da0dd17a1 Oops. Renderer already queues viewport change 2021-06-15 08:58:53 -07:00
Ivan Epifanov
1fc519880d Reset/re-apply viewport on frame start/target change. Fixes SDL_RenderSetLogicalSize on PSVita 2021-06-15 08:58:53 -07:00
Phillip Trudeau
bc7ac134db Windows: Fix SDL_GetBasePath() truncating paths
SDL_GetBasePath grows its path buffer for long paths, but GetModuleFileNameExW always truncates and succeeds,
so `len` was always equal to (buflen - 1) which is 127. This is easily fixed by checking for (buflen - 1) instead of buflen.
For paths longer than MAX_PATH, this problem sometimes got hidden by Windows path shortening ("C:\PROGRA~1\" etc.).

Tested on Windows 10 x64 19041 and 10586.
2021-06-12 23:07:46 -04:00
Paul Cercueil
db5cd8c694 joystick: virtual: Fix event injection for axes/hats
SDL_JoystickSetVirtualAxisInner() and SDL_JoystickSetVirtualHatInner()
did not properly sanitize the 'axis' and 'hat' parameters.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
2021-06-12 17:55:03 +03:00
Paul Cercueil
f3cf019ecb joystick: Add missing comma in joystick drivers list
Without this comma it is impossible to enable both the Vita and Dummy
drivers at the same time.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
2021-06-12 15:50:02 +03:00
Ozkan Sezer
bc9888c9b5 OS2_GetDisplayModes: malloc a new copy of mode's driver data.
Based on a patch by Jochen Schäfer <josch1710@live.de> :

The problem is, that in the initialization code uses the same structure for
desktop_mode and current_mode.  See SDL_os2video.c:OS2_VideoInit():

  stSDLDisplay.desktop_mode = stSDLDisplayMode;
  stSDLDisplay.current_mode = stSDLDisplayMode;
  ...
  stSDLDisplayMode.driverdata = pDisplayData;

Then, if you call GetDisplayModes, current_mode will added to the modes
list, with the same driverdata pointer to desktop_mode.

  SDL_AddDisplayMode( display, &display->current_mode );

When VideoQuit gets called, first the modes list gets freed including the
driverdata, the desktop_mode gets freed.  See SDL_video.c:SDL_VideoQuit():

  for (j = display->num_display_modes; j--;) {
      SDL_free(display->display_modes[j].driverdata);
      display->display_modes[j].driverdata = NULL;
  }
  SDL_free(display->display_modes);
  display->display_modes = NULL;
  SDL_free(display->desktop_mode.driverdata);
  display->desktop_mode.driverdata = NULL;

So, the display_modes[j].driverdata gets freed, but desktop_mode->driverdata
points to the same memory, but is not NULL'ed. When desktop_mode->driverdata
gets freed the memory is already freed, and libcx crashes the application on
SDL_Quit.
2021-06-12 14:55:24 +03:00
Ozkan Sezer
d28437de3c SDL_keyboard.c: Add bounds guards when assigning to the scancode array.
Based on a patch by Jochen Schäfer <josch1710@live.de> :
On a T420 pressing the ACPI button for volume control, big scancodes
were emitted. This was causing an overflow, because missing guards.
2021-06-12 08:00:50 +03:00
Ethan Lee
eb15b4e962 wayland: Drop SwapWindow calls for hidden windows 2021-06-11 21:50:18 -07:00