Browse Source

bsp/simulator: improve Visual Studio 2012 project (#10253)

* bsp/simulator: update SDL2 Windows prebuilt binaries to 2.32.6 with x86 and x64 binaries

* bsp/simulator: tidy and extend the Visual Studio 2012 project

* bsp/simulator: fix format for SDL2 Windows headers
Kenji Mouri / 毛利 研二 1 month ago
parent
commit
74245ed18c
100 changed files with 9763 additions and 6754 deletions
  1. 6 4
      bsp/simulator/SDL2/include/SDL.h
  2. 29 23
      bsp/simulator/SDL2/include/SDL_assert.h
  3. 60 47
      bsp/simulator/SDL2/include/SDL_atomic.h
  4. 156 118
      bsp/simulator/SDL2/include/SDL_audio.h
  5. 20 9
      bsp/simulator/SDL2/include/SDL_bits.h
  6. 24 25
      bsp/simulator/SDL2/include/SDL_blendmode.h
  7. 51 4
      bsp/simulator/SDL2/include/SDL_clipboard.h
  8. 31 277
      bsp/simulator/SDL2/include/SDL_config.h
  9. 0 445
      bsp/simulator/SDL2/include/SDL_config.h.cmake
  10. 0 389
      bsp/simulator/SDL2/include/SDL_config.h.in
  11. 50 13
      bsp/simulator/SDL2/include/SDL_config_android.h
  12. 218 0
      bsp/simulator/SDL2/include/SDL_config_emscripten.h
  13. 73 22
      bsp/simulator/SDL2/include/SDL_config_iphoneos.h
  14. 108 28
      bsp/simulator/SDL2/include/SDL_config_macosx.h
  15. 26 13
      bsp/simulator/SDL2/include/SDL_config_minimal.h
  16. 89 0
      bsp/simulator/SDL2/include/SDL_config_ngage.h
  17. 204 0
      bsp/simulator/SDL2/include/SDL_config_os2.h
  18. 29 16
      bsp/simulator/SDL2/include/SDL_config_pandora.h
  19. 0 144
      bsp/simulator/SDL2/include/SDL_config_psp.h
  20. 168 60
      bsp/simulator/SDL2/include/SDL_config_windows.h
  21. 253 0
      bsp/simulator/SDL2/include/SDL_config_wingdk.h
  22. 85 80
      bsp/simulator/SDL2/include/SDL_config_winrt.h
  23. 0 121
      bsp/simulator/SDL2/include/SDL_config_wiz.h
  24. 240 0
      bsp/simulator/SDL2/include/SDL_config_xbox.h
  25. 2 2
      bsp/simulator/SDL2/include/SDL_copying.h
  26. 53 9
      bsp/simulator/SDL2/include/SDL_cpuinfo.h
  27. 64 15
      bsp/simulator/SDL2/include/SDL_egl.h
  28. 90 11
      bsp/simulator/SDL2/include/SDL_endian.h
  29. 10 9
      bsp/simulator/SDL2/include/SDL_error.h
  30. 187 124
      bsp/simulator/SDL2/include/SDL_events.h
  31. 13 9
      bsp/simulator/SDL2/include/SDL_filesystem.h
  32. 218 107
      bsp/simulator/SDL2/include/SDL_gamecontroller.h
  33. 10 10
      bsp/simulator/SDL2/include/SDL_gesture.h
  34. 107 0
      bsp/simulator/SDL2/include/SDL_guid.h
  35. 342 328
      bsp/simulator/SDL2/include/SDL_haptic.h
  36. 34 42
      bsp/simulator/SDL2/include/SDL_hidapi.h
  37. 2042 928
      bsp/simulator/SDL2/include/SDL_hints.h
  38. 249 107
      bsp/simulator/SDL2/include/SDL_joystick.h
  39. 64 19
      bsp/simulator/SDL2/include/SDL_keyboard.h
  40. 20 15
      bsp/simulator/SDL2/include/SDL_keycode.h
  41. 24 22
      bsp/simulator/SDL2/include/SDL_loadso.h
  42. 6 5
      bsp/simulator/SDL2/include/SDL_locale.h
  43. 62 61
      bsp/simulator/SDL2/include/SDL_log.h
  44. 63 15
      bsp/simulator/SDL2/include/SDL_main.h
  45. 22 19
      bsp/simulator/SDL2/include/SDL_messagebox.h
  46. 11 9
      bsp/simulator/SDL2/include/SDL_metal.h
  47. 4 4
      bsp/simulator/SDL2/include/SDL_misc.h
  48. 52 42
      bsp/simulator/SDL2/include/SDL_mouse.h
  49. 104 30
      bsp/simulator/SDL2/include/SDL_mutex.h
  50. 2 2
      bsp/simulator/SDL2/include/SDL_name.h
  51. 6 63
      bsp/simulator/SDL2/include/SDL_opengl.h
  52. 706 91
      bsp/simulator/SDL2/include/SDL_opengl_glext.h
  53. 5 6
      bsp/simulator/SDL2/include/SDL_opengles.h
  54. 5 6
      bsp/simulator/SDL2/include/SDL_opengles2.h
  55. 374 339
      bsp/simulator/SDL2/include/SDL_opengles2_gl2.h
  56. 817 1199
      bsp/simulator/SDL2/include/SDL_opengles2_gl2ext.h
  57. 7 10
      bsp/simulator/SDL2/include/SDL_opengles2_gl2platform.h
  58. 43 14
      bsp/simulator/SDL2/include/SDL_opengles2_khrplatform.h
  59. 98 56
      bsp/simulator/SDL2/include/SDL_pixels.h
  60. 51 11
      bsp/simulator/SDL2/include/SDL_platform.h
  61. 13 14
      bsp/simulator/SDL2/include/SDL_power.h
  62. 15 23
      bsp/simulator/SDL2/include/SDL_quit.h
  63. 175 23
      bsp/simulator/SDL2/include/SDL_rect.h
  64. 234 205
      bsp/simulator/SDL2/include/SDL_render.h
  65. 6 2
      bsp/simulator/SDL2/include/SDL_revision.h
  66. 62 73
      bsp/simulator/SDL2/include/SDL_rwops.h
  67. 57 32
      bsp/simulator/SDL2/include/SDL_scancode.h
  68. 98 70
      bsp/simulator/SDL2/include/SDL_sensor.h
  69. 11 11
      bsp/simulator/SDL2/include/SDL_shape.h
  70. 218 64
      bsp/simulator/SDL2/include/SDL_stdinc.h
  71. 180 174
      bsp/simulator/SDL2/include/SDL_surface.h
  72. 115 36
      bsp/simulator/SDL2/include/SDL_system.h
  73. 23 21
      bsp/simulator/SDL2/include/SDL_syswm.h
  74. 3 3
      bsp/simulator/SDL2/include/SDL_test.h
  75. 11 11
      bsp/simulator/SDL2/include/SDL_test_assert.h
  76. 13 12
      bsp/simulator/SDL2/include/SDL_test_common.h
  77. 4 4
      bsp/simulator/SDL2/include/SDL_test_compare.h
  78. 7 7
      bsp/simulator/SDL2/include/SDL_test_crc32.h
  79. 96 9
      bsp/simulator/SDL2/include/SDL_test_font.h
  80. 31 30
      bsp/simulator/SDL2/include/SDL_test_fuzzer.h
  81. 7 7
      bsp/simulator/SDL2/include/SDL_test_harness.h
  82. 4 4
      bsp/simulator/SDL2/include/SDL_test_images.h
  83. 5 5
      bsp/simulator/SDL2/include/SDL_test_log.h
  84. 6 6
      bsp/simulator/SDL2/include/SDL_test_md5.h
  85. 5 5
      bsp/simulator/SDL2/include/SDL_test_memory.h
  86. 6 6
      bsp/simulator/SDL2/include/SDL_test_random.h
  87. 37 33
      bsp/simulator/SDL2/include/SDL_thread.h
  88. 22 20
      bsp/simulator/SDL2/include/SDL_timer.h
  89. 16 8
      bsp/simulator/SDL2/include/SDL_touch.h
  90. 3 8
      bsp/simulator/SDL2/include/SDL_types.h
  91. 42 25
      bsp/simulator/SDL2/include/SDL_version.h
  92. 308 189
      bsp/simulator/SDL2/include/SDL_video.h
  93. 18 14
      bsp/simulator/SDL2/include/SDL_vulkan.h
  94. 21 19
      bsp/simulator/SDL2/include/begin_code.h
  95. 4 4
      bsp/simulator/SDL2/include/close_code.h
  96. BIN
      bsp/simulator/SDL2/lib/x64/SDL2.dll
  97. BIN
      bsp/simulator/SDL2/lib/x64/SDL2.lib
  98. BIN
      bsp/simulator/SDL2/lib/x64/SDL2.pdb
  99. BIN
      bsp/simulator/SDL2/lib/x64/SDL2main.lib
  100. BIN
      bsp/simulator/SDL2/lib/x64/SDL2test.lib

+ 6 - 4
bsp/simulator/SDL2/include/SDL.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -25,7 +25,6 @@
  *  Main include header for the SDL library
  *  Main include header for the SDL library
  */
  */
 
 
-
 #ifndef SDL_h_
 #ifndef SDL_h_
 #define SDL_h_
 #define SDL_h_
 
 
@@ -41,6 +40,7 @@
 #include "SDL_events.h"
 #include "SDL_events.h"
 #include "SDL_filesystem.h"
 #include "SDL_filesystem.h"
 #include "SDL_gamecontroller.h"
 #include "SDL_gamecontroller.h"
+#include "SDL_guid.h"
 #include "SDL_haptic.h"
 #include "SDL_haptic.h"
 #include "SDL_hidapi.h"
 #include "SDL_hidapi.h"
 #include "SDL_hints.h"
 #include "SDL_hints.h"
@@ -69,6 +69,8 @@
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
+/* WIKI CATEGORY: Init */
+
 /* As of version 0.5, SDL is loaded dynamically into the application */
 /* As of version 0.5, SDL is loaded dynamically into the application */
 
 
 /**
 /**
@@ -129,7 +131,7 @@ extern "C" {
  * call SDL_Quit() to force shutdown). If a subsystem is already loaded then
  * call SDL_Quit() to force shutdown). If a subsystem is already loaded then
  * this call will increase the ref-count and return.
  * this call will increase the ref-count and return.
  *
  *
- * \param flags subsystem initialization flags
+ * \param flags subsystem initialization flags.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -229,4 +231,4 @@ extern DECLSPEC void SDLCALL SDL_Quit(void);
 
 
 #endif /* SDL_h_ */
 #endif /* SDL_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 29 - 23
bsp/simulator/SDL2/include/SDL_assert.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -22,7 +22,7 @@
 #ifndef SDL_assert_h_
 #ifndef SDL_assert_h_
 #define SDL_assert_h_
 #define SDL_assert_h_
 
 
-#include "SDL_config.h"
+#include "SDL_stdinc.h"
 
 
 #include "begin_code.h"
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
 /* Set up for C function definitions, even when using C++ */
@@ -51,14 +51,22 @@ assert can have unique static variables associated with it.
 /* Don't include intrin.h here because it contains C++ code */
 /* Don't include intrin.h here because it contains C++ code */
     extern void __cdecl __debugbreak(void);
     extern void __cdecl __debugbreak(void);
     #define SDL_TriggerBreakpoint() __debugbreak()
     #define SDL_TriggerBreakpoint() __debugbreak()
+#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
+    #define SDL_TriggerBreakpoint() __builtin_debugtrap()
 #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
 #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
+#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
+    #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
 #elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) )  /* this might work on other ARM targets, but this is a known quantity... */
 #elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) )  /* this might work on other ARM targets, but this is a known quantity... */
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
 #elif defined(__APPLE__) && defined(__arm__)
 #elif defined(__APPLE__) && defined(__arm__)
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
+#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) )
+    #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" )
 #elif defined(__386__) && defined(__WATCOMC__)
 #elif defined(__386__) && defined(__WATCOMC__)
-    #define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
+    #define SDL_TriggerBreakpoint()
+    { _asm
+    { int 0x03 } }
 #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
 #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
     #include <signal.h>
     #include <signal.h>
     #define SDL_TriggerBreakpoint() raise(SIGTRAP)
     #define SDL_TriggerBreakpoint() raise(SIGTRAP)
@@ -69,7 +77,7 @@ assert can have unique static variables associated with it.
 
 
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
 #   define SDL_FUNCTION __func__
 #   define SDL_FUNCTION __func__
-#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
+#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
 #   define SDL_FUNCTION __FUNCTION__
 #   define SDL_FUNCTION __FUNCTION__
 #else
 #else
 #   define SDL_FUNCTION "???"
 #   define SDL_FUNCTION "???"
@@ -123,12 +131,10 @@ typedef struct SDL_AssertData
     const struct SDL_AssertData *next;
     const struct SDL_AssertData *next;
 } SDL_AssertData;
 } SDL_AssertData;
 
 
-#if (SDL_ASSERT_LEVEL > 0)
-
 /* Never call this directly. Use the SDL_assert* macros. */
 /* Never call this directly. Use the SDL_assert* macros. */
 extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
 extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
-                                                             const char *,
-                                                             const char *, int)
+                                                            const char *,
+                                                            const char *, int)
 #if defined(__clang__)
 #if defined(__clang__)
 #if __has_feature(attribute_analyzer_noreturn)
 #if __has_feature(attribute_analyzer_noreturn)
 /* this tells Clang's static analysis that we're a custom assert function,
 /* this tells Clang's static analysis that we're a custom assert function,
@@ -148,22 +154,21 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
 */
 */
 #define SDL_enabled_assert(condition) \
 #define SDL_enabled_assert(condition) \
     do { \
     do { \
-        while ( !(condition) ) { \
-            static struct SDL_AssertData sdl_assert_data = { \
-                0, 0, #condition, 0, 0, 0, 0 \
-            }; \
+        while ( !(condition) )
+        { \
+            static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
             const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
             const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
-            if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
+            if (sdl_assert_state == SDL_ASSERTION_RETRY)
+            { \
                 continue; /* go again. */ \
                 continue; /* go again. */ \
-            } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
+            } else if (sdl_assert_state == SDL_ASSERTION_BREAK)
+            { \
                 SDL_TriggerBreakpoint(); \
                 SDL_TriggerBreakpoint(); \
             } \
             } \
             break; /* not retrying. */ \
             break; /* not retrying. */ \
         } \
         } \
     } while (SDL_NULL_WHILE_LOOP_CONDITION)
     } while (SDL_NULL_WHILE_LOOP_CONDITION)
 
 
-#endif  /* enabled assertions support code */
-
 /* Enable various levels of assertions. */
 /* Enable various levels of assertions. */
 #if SDL_ASSERT_LEVEL == 0   /* assertions disabled */
 #if SDL_ASSERT_LEVEL == 0   /* assertions disabled */
 #   define SDL_assert(condition) SDL_disabled_assert(condition)
 #   define SDL_assert(condition) SDL_disabled_assert(condition)
@@ -193,8 +198,8 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
  * A callback that fires when an SDL assertion fails.
  * A callback that fires when an SDL assertion fails.
  *
  *
  * \param data a pointer to the SDL_AssertData structure corresponding to the
  * \param data a pointer to the SDL_AssertData structure corresponding to the
- *             current assertion
- * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
+ *             current assertion.
+ * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler().
  * \returns an SDL_AssertState value indicating how to handle the failure.
  * \returns an SDL_AssertState value indicating how to handle the failure.
  */
  */
 typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
 typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
@@ -214,8 +219,8 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
  * This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
  * This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
  *
  *
  * \param handler the SDL_AssertionHandler function to call when an assertion
  * \param handler the SDL_AssertionHandler function to call when an assertion
- *                fails or NULL for the default handler
- * \param userdata a pointer that is passed to `handler`
+ *                fails or NULL for the default handler.
+ * \param userdata a pointer that is passed to `handler`.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -256,7 +261,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void
  * data, it is safe to pass a NULL pointer to this function to ignore it.
  * data, it is safe to pass a NULL pointer to this function to ignore it.
  *
  *
  * \param puserdata pointer which is filled with the "userdata" pointer that
  * \param puserdata pointer which is filled with the "userdata" pointer that
- *                  was passed to SDL_SetAssertionHandler()
+ *                  was passed to SDL_SetAssertionHandler().
  * \returns the SDL_AssertionHandler that is called when an assert triggers.
  * \returns the SDL_AssertionHandler that is called when an assert triggers.
  *
  *
  * \since This function is available since SDL 2.0.2.
  * \since This function is available since SDL 2.0.2.
@@ -275,7 +280,8 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puse
  *
  *
  * ```c
  * ```c
  * const SDL_AssertData *item = SDL_GetAssertionReport();
  * const SDL_AssertData *item = SDL_GetAssertionReport();
- * while (item) {
+ * while (item)
+ {
  *    printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
  *    printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
  *           item->condition, item->function, item->filename,
  *           item->condition, item->function, item->filename,
  *           item->linenum, item->trigger_count,
  *           item->linenum, item->trigger_count,
@@ -321,4 +327,4 @@ extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
 
 
 #endif /* SDL_assert_h_ */
 #endif /* SDL_assert_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 60 - 47
bsp/simulator/SDL2/include/SDL_atomic.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,38 +20,29 @@
 */
 */
 
 
 /**
 /**
- * \file SDL_atomic.h
+ * # CategoryAtomic
  *
  *
  * Atomic operations.
  * Atomic operations.
  *
  *
- * IMPORTANT:
- * If you are not an expert in concurrent lockless programming, you should
- * only be using the atomic lock and reference counting functions in this
- * file.  In all other cases you should be protecting your data structures
- * with full mutexes.
+ * IMPORTANT: If you are not an expert in concurrent lockless programming, you
+ * should not be using any functions in this file. You should be protecting
+ * your data structures with full mutexes instead.
  *
  *
- * The list of "safe" functions to use are:
- *  SDL_AtomicLock()
- *  SDL_AtomicUnlock()
- *  SDL_AtomicIncRef()
- *  SDL_AtomicDecRef()
+ * ***Seriously, here be dragons!***
  *
  *
- * Seriously, here be dragons!
- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- *
- * You can find out a little more about lockless programming and the
- * subtle issues that can arise here:
- * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
+ * You can find out a little more about lockless programming and the subtle
+ * issues that can arise here:
+ * https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming
  *
  *
  * There's also lots of good information here:
  * There's also lots of good information here:
- * http://www.1024cores.net/home/lock-free-algorithms
- * http://preshing.com/
  *
  *
- * These operations may or may not actually be implemented using
- * processor specific atomic operations. When possible they are
- * implemented as true processor specific atomic operations. When that
- * is not possible the are implemented using locks that *do* use the
- * available atomic operations.
+ * - https://www.1024cores.net/home/lock-free-algorithms
+ * - https://preshing.com/
+ *
+ * These operations may or may not actually be implemented using processor
+ * specific atomic operations. When possible they are implemented as true
+ * processor specific atomic operations. When that is not possible the are
+ * implemented using locks that *do* use the available atomic operations.
  *
  *
  * All of the atomic operations that modify memory are full memory barriers.
  * All of the atomic operations that modify memory are full memory barriers.
  */
  */
@@ -94,7 +85,7 @@ typedef int SDL_SpinLock;
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * doing. Please be careful using any sort of spinlock!***
  * doing. Please be careful using any sort of spinlock!***
  *
  *
- * \param lock a pointer to a lock variable
+ * \param lock a pointer to a lock variable.
  * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
  * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
  *          held.
  *          held.
  *
  *
@@ -111,7 +102,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * doing. Please be careful using any sort of spinlock!***
  * doing. Please be careful using any sort of spinlock!***
  *
  *
- * \param lock a pointer to a lock variable
+ * \param lock a pointer to a lock variable.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -128,7 +119,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * ***Please note that spinlocks are dangerous if you don't know what you're
  * doing. Please be careful using any sort of spinlock!***
  * doing. Please be careful using any sort of spinlock!***
  *
  *
- * \param lock a pointer to a lock variable
+ * \param lock a pointer to a lock variable.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -209,7 +200,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
 #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
 #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
 #define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("dmb ish" : : : "memory")
 #define SDL_MemoryBarrierRelease()   __asm__ __volatile__ ("dmb ish" : : : "memory")
 #define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("dmb ish" : : : "memory")
 #define SDL_MemoryBarrierAcquire()   __asm__ __volatile__ ("dmb ish" : : : "memory")
-#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
+#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
 #ifdef __thumb__
 #ifdef __thumb__
 /* The mcr instruction isn't available in thumb mode, use real functions */
 /* The mcr instruction isn't available in thumb mode, use real functions */
 #define SDL_MEMORY_BARRIER_USES_FUNCTION
 #define SDL_MEMORY_BARRIER_USES_FUNCTION
@@ -237,11 +228,33 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
 #endif
 #endif
 #endif
 #endif
 
 
+/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
+#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
+    #define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n")  /* Some assemblers can't do REP NOP, so go with PAUSE. */
+#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
+    #define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
+#elif (defined(__powerpc__) || defined(__powerpc64__))
+    #define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
+#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
+    #define SDL_CPUPauseInstruction() _mm_pause()  /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
+#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
+    #define SDL_CPUPauseInstruction() __yield()
+#elif defined(__WATCOMC__) && defined(__386__)
+    extern __inline void SDL_CPUPauseInstruction(void);
+    #pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
+#else
+    #define SDL_CPUPauseInstruction()
+#endif
+
+
 /**
 /**
- * \brief A type representing an atomic integer value.  It is a struct
- *        so people don't accidentally use numeric operations on it.
+ * A type representing an atomic integer value.
+ *
+ * It is a struct so people don't accidentally use numeric operations on it.
  */
  */
-typedef struct { int value; } SDL_atomic_t;
+typedef struct SDL_atomic_t {
+    int value;
+} SDL_atomic_t;
 
 
 /**
 /**
  * Set an atomic variable to a new value if it is currently an old value.
  * Set an atomic variable to a new value if it is currently an old value.
@@ -249,9 +262,9 @@ typedef struct { int value; } SDL_atomic_t;
  * ***Note: If you don't know what this function is for, you shouldn't use
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  * it!***
  *
  *
- * \param a a pointer to an SDL_atomic_t variable to be modified
- * \param oldval the old value
- * \param newval the new value
+ * \param a a pointer to an SDL_atomic_t variable to be modified.
+ * \param oldval the old value.
+ * \param newval the new value.
  * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
  * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -270,8 +283,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int
  * ***Note: If you don't know what this function is for, you shouldn't use
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  * it!***
  *
  *
- * \param a a pointer to an SDL_atomic_t variable to be modified
- * \param v the desired value
+ * \param a a pointer to an SDL_atomic_t variable to be modified.
+ * \param v the desired value.
  * \returns the previous value of the atomic variable.
  * \returns the previous value of the atomic variable.
  *
  *
  * \since This function is available since SDL 2.0.2.
  * \since This function is available since SDL 2.0.2.
@@ -286,7 +299,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
  * ***Note: If you don't know what this function is for, you shouldn't use
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  * it!***
  *
  *
- * \param a a pointer to an SDL_atomic_t variable
+ * \param a a pointer to an SDL_atomic_t variable.
  * \returns the current value of an atomic variable.
  * \returns the current value of an atomic variable.
  *
  *
  * \since This function is available since SDL 2.0.2.
  * \since This function is available since SDL 2.0.2.
@@ -303,8 +316,8 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
  * ***Note: If you don't know what this function is for, you shouldn't use
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  * it!***
  *
  *
- * \param a a pointer to an SDL_atomic_t variable to be modified
- * \param v the desired value to add
+ * \param a a pointer to an SDL_atomic_t variable to be modified.
+ * \param v the desired value to add.
  * \returns the previous value of the atomic variable.
  * \returns the previous value of the atomic variable.
  *
  *
  * \since This function is available since SDL 2.0.2.
  * \since This function is available since SDL 2.0.2.
@@ -337,9 +350,9 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
  * ***Note: If you don't know what this function is for, you shouldn't use
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  * it!***
  *
  *
- * \param a a pointer to a pointer
- * \param oldval the old pointer value
- * \param newval the new pointer value
+ * \param a a pointer to a pointer.
+ * \param oldval the old pointer value.
+ * \param newval the new pointer value.
  * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
  * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -356,8 +369,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *
  * ***Note: If you don't know what this function is for, you shouldn't use
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  * it!***
  *
  *
- * \param a a pointer to a pointer
- * \param v the desired pointer value
+ * \param a a pointer to a pointer.
+ * \param v the desired pointer value.
  * \returns the previous value of the pointer.
  * \returns the previous value of the pointer.
  *
  *
  * \since This function is available since SDL 2.0.2.
  * \since This function is available since SDL 2.0.2.
@@ -373,7 +386,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
  * ***Note: If you don't know what this function is for, you shouldn't use
  * ***Note: If you don't know what this function is for, you shouldn't use
  * it!***
  * it!***
  *
  *
- * \param a a pointer to a pointer
+ * \param a a pointer to a pointer.
  * \returns the current value of a pointer.
  * \returns the current value of a pointer.
  *
  *
  * \since This function is available since SDL 2.0.2.
  * \since This function is available since SDL 2.0.2.
@@ -392,4 +405,4 @@ extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
 
 
 #endif /* SDL_atomic_h_ */
 #endif /* SDL_atomic_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 156 - 118
bsp/simulator/SDL2/include/SDL_audio.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -22,9 +22,9 @@
 /* !!! FIXME: several functions in here need Doxygen comments. */
 /* !!! FIXME: several functions in here need Doxygen comments. */
 
 
 /**
 /**
- *  \file SDL_audio.h
+ * # CategoryAudio
  *
  *
- *  Access to the raw audio mixing buffer for the SDL library.
+ * Access to the raw audio mixing buffer for the SDL library.
  */
  */
 
 
 #ifndef SDL_audio_h_
 #ifndef SDL_audio_h_
@@ -44,24 +44,24 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  \brief Audio format flags.
- *
- *  These are what the 16 bits in SDL_AudioFormat currently mean...
- *  (Unspecified bits are always zero).
- *
- *  \verbatim
-    ++-----------------------sample is signed if set
-    ||
-    ||       ++-----------sample is bigendian if set
-    ||       ||
-    ||       ||          ++---sample is float if set
-    ||       ||          ||
-    ||       ||          || +---sample bit size---+
-    ||       ||          || |                     |
-    15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
-    \endverbatim
- *
- *  There are macros in SDL 2.0 and later to query these bits.
+ * Audio format flags.
+ *
+ * These are what the 16 bits in SDL_AudioFormat currently mean...
+ * (Unspecified bits are always zero).
+ *
+ * ```
+ * ++-----------------------sample is signed if set
+ * ||
+ * ||       ++-----------sample is bigendian if set
+ * ||       ||
+ * ||       ||          ++---sample is float if set
+ * ||       ||          ||
+ * ||       ||          || +---sample bit size---+
+ * ||       ||          || |                     |
+ * 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
+ * ```
+ *
+ * There are macros in SDL 2.0 and later to query these bits.
  */
  */
 typedef Uint16 SDL_AudioFormat;
 typedef Uint16 SDL_AudioFormat;
 
 
@@ -149,33 +149,30 @@ typedef Uint16 SDL_AudioFormat;
 /* @} *//* Audio flags */
 /* @} *//* Audio flags */
 
 
 /**
 /**
- *  This function is called when the audio device needs more data.
- *
- *  \param userdata An application-specific parameter saved in
- *                  the SDL_AudioSpec structure
- *  \param stream A pointer to the audio data buffer.
- *  \param len    The length of that buffer in bytes.
- *
- *  Once the callback returns, the buffer will no longer be valid.
- *  Stereo samples are stored in a LRLRLR ordering.
+ * This function is called when the audio device needs more data.
  *
  *
- *  You can choose to avoid callbacks and use SDL_QueueAudio() instead, if
- *  you like. Just open your audio device with a NULL callback.
+ * \param userdata An application-specific parameter saved in the
+ *                 SDL_AudioSpec structure.
+ * \param stream A pointer to the audio data buffer.
+ * \param len Length of **stream** in bytes.
  */
  */
 typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
 typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
                                             int len);
                                             int len);
 
 
 /**
 /**
- *  The calculated values in this structure are calculated by SDL_OpenAudio().
- *
- *  For multi-channel audio, the default SDL channel mapping is:
- *  2:  FL FR                       (stereo)
- *  3:  FL FR LFE                   (2.1 surround)
- *  4:  FL FR BL BR                 (quad)
- *  5:  FL FR FC BL BR              (quad + center)
- *  6:  FL FR FC LFE SL SR          (5.1 surround - last two can also be BL BR)
- *  7:  FL FR FC LFE BC SL SR       (6.1 surround)
- *  8:  FL FR FC LFE BL BR SL SR    (7.1 surround)
+ * The calculated values in this structure are calculated by SDL_OpenAudio().
+ *
+ * For multi-channel audio, the default SDL channel mapping is:
+ *
+ * ```
+ * 2:  FL  FR                          (stereo)
+ * 3:  FL  FR LFE                      (2.1 surround)
+ * 4:  FL  FR  BL  BR                  (quad)
+ * 5:  FL  FR LFE  BL  BR              (4.1 surround)
+ * 6:  FL  FR  FC LFE  SL  SR          (5.1 surround - last two can also be BL BR)
+ * 7:  FL  FR  FC LFE  BC  SL  SR      (6.1 surround)
+ * 8:  FL  FR  FC LFE  BL  BR  SL  SR  (7.1 surround)
+ * ```
  */
  */
 typedef struct SDL_AudioSpec
 typedef struct SDL_AudioSpec
 {
 {
@@ -196,11 +193,11 @@ typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
                                           SDL_AudioFormat format);
                                           SDL_AudioFormat format);
 
 
 /**
 /**
- *  \brief Upper limit of filters in SDL_AudioCVT
+ * Upper limit of filters in SDL_AudioCVT
  *
  *
- *  The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
- *  currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers,
- *  one of which is the terminating NULL pointer.
+ * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
+ * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, one
+ * of which is the terminating NULL pointer.
  */
  */
 #define SDL_AUDIOCVT_MAX_FILTERS 9
 #define SDL_AUDIOCVT_MAX_FILTERS 9
 
 
@@ -287,7 +284,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
  * meant to be proper names.
  * meant to be proper names.
  *
  *
  * \param index the index of the audio driver; the value ranges from 0 to
  * \param index the index of the audio driver; the value ranges from 0 to
- *              SDL_GetNumAudioDrivers() - 1
+ *              SDL_GetNumAudioDrivers() - 1.
  * \returns the name of the audio driver at the requested index, or NULL if an
  * \returns the name of the audio driver at the requested index, or NULL if an
  *          invalid index was specified.
  *          invalid index was specified.
  *
  *
@@ -314,7 +311,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
  * specific need to designate the audio driver you want to use. You should
  * specific need to designate the audio driver you want to use. You should
  * normally use SDL_Init() or SDL_InitSubSystem().
  * normally use SDL_Init() or SDL_InitSubSystem().
  *
  *
- * \param driver_name the name of the desired audio driver
+ * \param driver_name the name of the desired audio driver.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -408,13 +405,13 @@ extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
                                           SDL_AudioSpec * obtained);
                                           SDL_AudioSpec * obtained);
 
 
 /**
 /**
- *  SDL Audio Device IDs.
+ * SDL Audio Device IDs.
  *
  *
- *  A successful call to SDL_OpenAudio() is always device id 1, and legacy
- *  SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
- *  always returns devices >= 2 on success. The legacy calls are good both
- *  for backwards compatibility and when you don't care about multiple,
- *  specific, or capture devices.
+ * A successful call to SDL_OpenAudio() is always device id 1, and legacy SDL
+ * audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
+ * always returns devices >= 2 on success. The legacy calls are good both for
+ * backwards compatibility and when you don't care about multiple, specific,
+ * or capture devices.
  */
  */
 typedef Uint32 SDL_AudioDeviceID;
 typedef Uint32 SDL_AudioDeviceID;
 
 
@@ -452,7 +449,7 @@ typedef Uint32 SDL_AudioDeviceID;
  * ```
  * ```
  *
  *
  * \param iscapture zero to request playback devices, non-zero to request
  * \param iscapture zero to request playback devices, non-zero to request
- *                  recording devices
+ *                  recording devices.
  * \returns the number of available devices exposed by the current driver or
  * \returns the number of available devices exposed by the current driver or
  *          -1 if an explicit list of devices can't be determined. A return
  *          -1 if an explicit list of devices can't be determined. A return
  *          value of -1 does not necessarily mean an error condition.
  *          value of -1 does not necessarily mean an error condition.
@@ -478,7 +475,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
  * invalid next time any of several other SDL functions are called.
  * invalid next time any of several other SDL functions are called.
  *
  *
  * \param index the index of the audio device; valid values range from 0 to
  * \param index the index of the audio device; valid values range from 0 to
- *              SDL_GetNumAudioDevices() - 1
+ *              SDL_GetNumAudioDevices() - 1.
  * \param iscapture non-zero to query the list of recording devices, zero to
  * \param iscapture non-zero to query the list of recording devices, zero to
  *                  query the list of output devices.
  *                  query the list of output devices.
  * \returns the name of the audio device at the requested index, or NULL on
  * \returns the name of the audio device at the requested index, or NULL on
@@ -487,6 +484,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
  * \sa SDL_GetNumAudioDevices
  * \sa SDL_GetNumAudioDevices
+ * \sa SDL_GetDefaultAudioInfo
  */
  */
 extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
 extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
                                                            int iscapture);
                                                            int iscapture);
@@ -500,26 +498,60 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
  * hardware.
  * hardware.
  *
  *
  * `spec` will be filled with the sample rate, sample format, and channel
  * `spec` will be filled with the sample rate, sample format, and channel
- * count. All other values in the structure are filled with 0. When the
- * supported struct members are 0, SDL was unable to get the property from the
- * backend.
+ * count.
  *
  *
  * \param index the index of the audio device; valid values range from 0 to
  * \param index the index of the audio device; valid values range from 0 to
- *              SDL_GetNumAudioDevices() - 1
+ *              SDL_GetNumAudioDevices() - 1.
  * \param iscapture non-zero to query the list of recording devices, zero to
  * \param iscapture non-zero to query the list of recording devices, zero to
  *                  query the list of output devices.
  *                  query the list of output devices.
  * \param spec The SDL_AudioSpec to be initialized by this function.
  * \param spec The SDL_AudioSpec to be initialized by this function.
- * \returns 0 on success, nonzero on error
+ * \returns 0 on success, nonzero on error.
  *
  *
  * \since This function is available since SDL 2.0.16.
  * \since This function is available since SDL 2.0.16.
  *
  *
  * \sa SDL_GetNumAudioDevices
  * \sa SDL_GetNumAudioDevices
+ * \sa SDL_GetDefaultAudioInfo
  */
  */
 extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
 extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
                                                    int iscapture,
                                                    int iscapture,
                                                    SDL_AudioSpec *spec);
                                                    SDL_AudioSpec *spec);
 
 
 
 
+/**
+ * Get the name and preferred format of the default audio device.
+ *
+ * Some (but not all!) platforms have an isolated mechanism to get information
+ * about the "default" device. This can actually be a completely different
+ * device that's not in the list you get from SDL_GetAudioDeviceSpec(). It can
+ * even be a network address! (This is discussed in SDL_OpenAudioDevice().)
+ *
+ * As a result, this call is not guaranteed to be performant, as it can query
+ * the sound server directly every time, unlike the other query functions. You
+ * should call this function sparingly!
+ *
+ * `spec` will be filled with the sample rate, sample format, and channel
+ * count, if a default device exists on the system. If `name` is provided,
+ * will be filled with either a dynamically-allocated UTF-8 string or NULL.
+ *
+ * \param name A pointer to be filled with the name of the default device (can
+ *             be NULL). Please call SDL_free() when you are done with this
+ *             pointer!
+ * \param spec The SDL_AudioSpec to be initialized by this function.
+ * \param iscapture non-zero to query the default recording device, zero to
+ *                  query the default output device.
+ * \returns 0 on success, nonzero on error.
+ *
+ * \since This function is available since SDL 2.24.0.
+ *
+ * \sa SDL_GetAudioDeviceName
+ * \sa SDL_GetAudioDeviceSpec
+ * \sa SDL_OpenAudioDevice
+ */
+extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name,
+                                                    SDL_AudioSpec *spec,
+                                                    int iscapture);
+
+
 /**
 /**
  * Open a specific audio device.
  * Open a specific audio device.
  *
  *
@@ -559,7 +591,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
  *   frames_ (with stereo output, two samples--left and right--would make a
  *   frames_ (with stereo output, two samples--left and right--would make a
  *   single sample frame). This number should be a power of two, and may be
  *   single sample frame). This number should be a power of two, and may be
  *   adjusted by the audio driver to a value more suitable for the hardware.
  *   adjusted by the audio driver to a value more suitable for the hardware.
- *   Good values seem to range between 512 and 8096 inclusive, depending on
+ *   Good values seem to range between 512 and 4096 inclusive, depending on
  *   the application and CPU speed. Smaller values reduce latency, but can
  *   the application and CPU speed. Smaller values reduce latency, but can
  *   lead to underflow if the application is doing heavy processing and cannot
  *   lead to underflow if the application is doing heavy processing and cannot
  *   fill the audio buffer in time. Note that the number of sample frames is
  *   fill the audio buffer in time. Note that the number of sample frames is
@@ -586,6 +618,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
  * - `SDL_AUDIO_ALLOW_FREQUENCY_CHANGE`
  * - `SDL_AUDIO_ALLOW_FREQUENCY_CHANGE`
  * - `SDL_AUDIO_ALLOW_FORMAT_CHANGE`
  * - `SDL_AUDIO_ALLOW_FORMAT_CHANGE`
  * - `SDL_AUDIO_ALLOW_CHANNELS_CHANGE`
  * - `SDL_AUDIO_ALLOW_CHANNELS_CHANGE`
+ * - `SDL_AUDIO_ALLOW_SAMPLES_CHANGE`
  * - `SDL_AUDIO_ALLOW_ANY_CHANGE`
  * - `SDL_AUDIO_ALLOW_ANY_CHANGE`
  *
  *
  * These flags specify how SDL should behave when a device cannot offer a
  * These flags specify how SDL should behave when a device cannot offer a
@@ -609,12 +642,12 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
  *               driver-specific name as appropriate. NULL requests the most
  *               driver-specific name as appropriate. NULL requests the most
  *               reasonable default device.
  *               reasonable default device.
  * \param iscapture non-zero to specify a device should be opened for
  * \param iscapture non-zero to specify a device should be opened for
- *                  recording, not playback
+ *                  recording, not playback.
  * \param desired an SDL_AudioSpec structure representing the desired output
  * \param desired an SDL_AudioSpec structure representing the desired output
- *                format; see SDL_OpenAudio() for more information
+ *                format; see SDL_OpenAudio() for more information.
  * \param obtained an SDL_AudioSpec structure filled in with the actual output
  * \param obtained an SDL_AudioSpec structure filled in with the actual output
- *                 format; see SDL_OpenAudio() for more information
- * \param allowed_changes 0, or one or more flags OR'd together
+ *                 format; see SDL_OpenAudio() for more information.
+ * \param allowed_changes 0, or one or more flags OR'd together.
  * \returns a valid device ID that is > 0 on success or 0 on failure; call
  * \returns a valid device ID that is > 0 on success or 0 on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -676,7 +709,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
  * Use this function to get the current audio state of an audio device.
  * Use this function to get the current audio state of an audio device.
  *
  *
  * \param dev the ID of an audio device previously opened with
  * \param dev the ID of an audio device previously opened with
- *            SDL_OpenAudioDevice()
+ *            SDL_OpenAudioDevice().
  * \returns the SDL_AudioStatus of the specified audio device.
  * \returns the SDL_AudioStatus of the specified audio device.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -709,7 +742,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioDeviceStatus(SDL_AudioDevice
  *
  *
  * ...and is only useful if you used the legacy SDL_OpenAudio() function.
  * ...and is only useful if you used the legacy SDL_OpenAudio() function.
  *
  *
- * \param pause_on non-zero to pause, 0 to unpause
+ * \param pause_on non-zero to pause, 0 to unpause.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -739,8 +772,8 @@ extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
  * callback, you shouldn't pause the audio device, as it will lead to dropouts
  * callback, you shouldn't pause the audio device, as it will lead to dropouts
  * in the audio playback. Instead, you should use SDL_LockAudioDevice().
  * in the audio playback. Instead, you should use SDL_LockAudioDevice().
  *
  *
- * \param dev a device opened by SDL_OpenAudioDevice()
- * \param pause_on non-zero to pause, 0 to unpause
+ * \param dev a device opened by SDL_OpenAudioDevice().
+ * \param pause_on non-zero to pause, 0 to unpause.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -805,14 +838,14 @@ extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
  * SDL_LoadWAV("sample.wav", &spec, &buf, &len);
  * SDL_LoadWAV("sample.wav", &spec, &buf, &len);
  * ```
  * ```
  *
  *
- * \param src The data source for the WAVE data
- * \param freesrc If non-zero, SDL will _always_ free the data source
+ * \param src The data source for the WAVE data.
+ * \param freesrc If non-zero, SDL will _always_ free the data source.
  * \param spec An SDL_AudioSpec that will be filled in with the wave file's
  * \param spec An SDL_AudioSpec that will be filled in with the wave file's
- *             format details
+ *             format details.
  * \param audio_buf A pointer filled with the audio data, allocated by the
  * \param audio_buf A pointer filled with the audio data, allocated by the
  *                  function.
  *                  function.
  * \param audio_len A pointer filled with the length of the audio data buffer
  * \param audio_len A pointer filled with the length of the audio data buffer
- *                  in bytes
+ *                  in bytes.
  * \returns This function, if successfully called, returns `spec`, which will
  * \returns This function, if successfully called, returns `spec`, which will
  *          be filled with the audio data format of the wave source data.
  *          be filled with the audio data format of the wave source data.
  *          `audio_buf` will be filled with a pointer to an allocated buffer
  *          `audio_buf` will be filled with a pointer to an allocated buffer
@@ -838,8 +871,9 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
                                                       Uint32 * audio_len);
                                                       Uint32 * audio_len);
 
 
 /**
 /**
- *  Loads a WAV from a file.
- *  Compatibility convenience function.
+ * Loads a WAV from a file.
+ *
+ * Compatibility convenience function.
  */
  */
 #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
 #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
     SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
     SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
@@ -852,7 +886,7 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
  * this function with a NULL pointer.
  * this function with a NULL pointer.
  *
  *
  * \param audio_buf a pointer to the buffer created by SDL_LoadWAV() or
  * \param audio_buf a pointer to the buffer created by SDL_LoadWAV() or
- *                  SDL_LoadWAV_RW()
+ *                  SDL_LoadWAV_RW().
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -876,15 +910,16 @@ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf);
  * and then can call SDL_ConvertAudio() to complete the conversion.
  * and then can call SDL_ConvertAudio() to complete the conversion.
  *
  *
  * \param cvt an SDL_AudioCVT structure filled in with audio conversion
  * \param cvt an SDL_AudioCVT structure filled in with audio conversion
- *            information
+ *            information.
  * \param src_format the source format of the audio data; for more info see
  * \param src_format the source format of the audio data; for more info see
- *                   SDL_AudioFormat
- * \param src_channels the number of channels in the source
- * \param src_rate the frequency (sample-frames-per-second) of the source
+ *                   SDL_AudioFormat.
+ * \param src_channels the number of channels in the source.
+ * \param src_rate the frequency (sample-frames-per-second) of the source.
  * \param dst_format the destination format of the audio data; for more info
  * \param dst_format the destination format of the audio data; for more info
- *                   see SDL_AudioFormat
- * \param dst_channels the number of channels in the destination
- * \param dst_rate the frequency (sample-frames-per-second) of the destination
+ *                   see SDL_AudioFormat.
+ * \param dst_channels the number of channels in the destination.
+ * \param dst_rate the frequency (sample-frames-per-second) of the
+ *                 destination.
  * \returns 1 if the audio filter is prepared, 0 if no conversion is needed,
  * \returns 1 if the audio filter is prepared, 0 if no conversion is needed,
  *          or a negative error code on failure; call SDL_GetError() for more
  *          or a negative error code on failure; call SDL_GetError() for more
  *          information.
  *          information.
@@ -955,12 +990,12 @@ typedef struct _SDL_AudioStream SDL_AudioStream;
 /**
 /**
  * Create a new audio stream.
  * Create a new audio stream.
  *
  *
- * \param src_format The format of the source audio
- * \param src_channels The number of channels of the source audio
- * \param src_rate The sampling rate of the source audio
- * \param dst_format The format of the desired audio output
- * \param dst_channels The number of channels of the desired audio output
- * \param dst_rate The sampling rate of the desired audio output
+ * \param src_format The format of the source audio.
+ * \param src_channels The number of channels of the source audio.
+ * \param src_rate The sampling rate of the source audio.
+ * \param dst_format The format of the desired audio output.
+ * \param dst_channels The number of channels of the desired audio output.
+ * \param dst_rate The sampling rate of the desired audio output.
  * \returns 0 on success, or -1 on error.
  * \returns 0 on success, or -1 on error.
  *
  *
  * \since This function is available since SDL 2.0.7.
  * \since This function is available since SDL 2.0.7.
@@ -982,9 +1017,9 @@ extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioForm
 /**
 /**
  * Add data to be converted/resampled to the stream.
  * Add data to be converted/resampled to the stream.
  *
  *
- * \param stream The stream the audio data is being added to
- * \param buf A pointer to the audio data to add
- * \param len The number of bytes to write to the stream
+ * \param stream The stream the audio data is being added to.
+ * \param buf A pointer to the audio data to add.
+ * \param len The number of bytes to write to the stream.
  * \returns 0 on success, or -1 on error.
  * \returns 0 on success, or -1 on error.
  *
  *
  * \since This function is available since SDL 2.0.7.
  * \since This function is available since SDL 2.0.7.
@@ -1001,10 +1036,10 @@ extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const vo
 /**
 /**
  * Get converted/resampled data from the stream
  * Get converted/resampled data from the stream
  *
  *
- * \param stream The stream the audio is being requested from
- * \param buf A buffer to fill with audio data
- * \param len The maximum number of bytes to fill
- * \returns the number of bytes read from the stream, or -1 on error
+ * \param stream The stream the audio is being requested from.
+ * \param buf A buffer to fill with audio data.
+ * \param len The maximum number of bytes to fill.
+ * \returns the number of bytes read from the stream, or -1 on error.
  *
  *
  * \since This function is available since SDL 2.0.7.
  * \since This function is available since SDL 2.0.7.
  *
  *
@@ -1082,6 +1117,9 @@ extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream);
  */
  */
 extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
 extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
 
 
+/**
+ * Maximum volume allowed in calls to SDL_MixAudio and SDL_MixAudioFormat.
+ */
 #define SDL_MIX_MAXVOLUME 128
 #define SDL_MIX_MAXVOLUME 128
 
 
 /**
 /**
@@ -1096,11 +1134,11 @@ extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
  * ...where `format` is the obtained format of the audio device from the
  * ...where `format` is the obtained format of the audio device from the
  * legacy SDL_OpenAudio() function.
  * legacy SDL_OpenAudio() function.
  *
  *
- * \param dst the destination for the mixed audio
- * \param src the source audio buffer to be mixed
- * \param len the length of the audio buffer in bytes
+ * \param dst the destination for the mixed audio.
+ * \param src the source audio buffer to be mixed.
+ * \param len the length of the audio buffer in bytes.
  * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
  * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
- *               for full audio volume
+ *               for full audio volume.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -1129,13 +1167,13 @@ extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src,
  * SDL_MixAudioFormat() is really only needed when you're mixing a single
  * SDL_MixAudioFormat() is really only needed when you're mixing a single
  * audio stream with a volume adjustment.
  * audio stream with a volume adjustment.
  *
  *
- * \param dst the destination for the mixed audio
- * \param src the source audio buffer to be mixed
+ * \param dst the destination for the mixed audio.
+ * \param src the source audio buffer to be mixed.
  * \param format the SDL_AudioFormat structure representing the desired audio
  * \param format the SDL_AudioFormat structure representing the desired audio
- *               format
- * \param len the length of the audio buffer in bytes
+ *               format.
+ * \param len the length of the audio buffer in bytes.
  * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
  * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
- *               for full audio volume
+ *               for full audio volume.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  */
  */
@@ -1179,9 +1217,9 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
  * from planar audio formats into a non-planar one (see SDL_AudioFormat)
  * from planar audio formats into a non-planar one (see SDL_AudioFormat)
  * before queuing audio.
  * before queuing audio.
  *
  *
- * \param dev the device ID to which we will queue audio
- * \param data the data to queue to the device for later playback
- * \param len the number of bytes (not samples!) to which `data` points
+ * \param dev the device ID to which we will queue audio.
+ * \param data the data to queue to the device for later playback.
+ * \param len the number of bytes (not samples!) to which `data` points.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -1227,9 +1265,9 @@ extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *da
  * You should not call SDL_LockAudio() on the device before dequeueing; SDL
  * You should not call SDL_LockAudio() on the device before dequeueing; SDL
  * handles locking internally for this function.
  * handles locking internally for this function.
  *
  *
- * \param dev the device ID from which we will dequeue audio
- * \param data a pointer into where audio data should be copied
- * \param len the number of bytes (not samples!) to which (data) points
+ * \param dev the device ID from which we will dequeue audio.
+ * \param data a pointer into where audio data should be copied.
+ * \param len the number of bytes (not samples!) to which (data) points.
  * \returns the number of bytes dequeued, which could be less than requested;
  * \returns the number of bytes dequeued, which could be less than requested;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
  *
  *
@@ -1263,7 +1301,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *dat
  * You should not call SDL_LockAudio() on the device before querying; SDL
  * You should not call SDL_LockAudio() on the device before querying; SDL
  * handles locking internally for this function.
  * handles locking internally for this function.
  *
  *
- * \param dev the device ID of which we will query queued audio size
+ * \param dev the device ID of which we will query queued audio size.
  * \returns the number of bytes (not samples!) of queued audio.
  * \returns the number of bytes (not samples!) of queued audio.
  *
  *
  * \since This function is available since SDL 2.0.4.
  * \since This function is available since SDL 2.0.4.
@@ -1298,7 +1336,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
  *
  *
  * This function always succeeds and thus returns void.
  * This function always succeeds and thus returns void.
  *
  *
- * \param dev the device ID of which to clear the audio queue
+ * \param dev the device ID of which to clear the audio queue.
  *
  *
  * \since This function is available since SDL 2.0.4.
  * \since This function is available since SDL 2.0.4.
  *
  *
@@ -1370,7 +1408,7 @@ extern DECLSPEC void SDLCALL SDL_LockAudio(void);
  * at once, not only will you block the audio callback, you'll block the other
  * at once, not only will you block the audio callback, you'll block the other
  * thread.
  * thread.
  *
  *
- * \param dev the ID of the device to be locked
+ * \param dev the ID of the device to be locked.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -1403,7 +1441,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
  *
  *
  * This function should be paired with a previous SDL_LockAudioDevice() call.
  * This function should be paired with a previous SDL_LockAudioDevice() call.
  *
  *
- * \param dev the ID of the device to be unlocked
+ * \param dev the ID of the device to be unlocked.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -1445,7 +1483,7 @@ extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
  * The device ID is invalid as soon as the device is closed, and is eligible
  * The device ID is invalid as soon as the device is closed, and is eligible
  * for reuse in a new SDL_OpenAudioDevice() call immediately.
  * for reuse in a new SDL_OpenAudioDevice() call immediately.
  *
  *
- * \param dev an audio device previously opened with SDL_OpenAudioDevice()
+ * \param dev an audio device previously opened with SDL_OpenAudioDevice().
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -1461,4 +1499,4 @@ extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev);
 
 
 #endif /* SDL_audio_h_ */
 #endif /* SDL_audio_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 20 - 9
bsp/simulator/SDL2/include/SDL_bits.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_bits.h
+ * # CategoryBits
  *
  *
- *  Functions for fiddling with bits and bitmasks.
+ * Functions for fiddling with bits and bitmasks.
  */
  */
 
 
 #ifndef SDL_bits_h_
 #ifndef SDL_bits_h_
@@ -56,6 +56,12 @@ extern __inline int _SDL_bsr_watcom(Uint32);
     modify exact [eax] nomemory;
     modify exact [eax] nomemory;
 #endif
 #endif
 
 
+/**
+ * Use this function to get the index of the most significant (set) bit in a
+ *
+ * \param x the number to find the MSB of.
+ * \returns the index of the most significant bit of x, or -1 if x is 0.
+ */
 SDL_FORCE_INLINE int
 SDL_FORCE_INLINE int
 SDL_MostSignificantBitIndex32(Uint32 x)
 SDL_MostSignificantBitIndex32(Uint32 x)
 {
 {
@@ -63,18 +69,21 @@ SDL_MostSignificantBitIndex32(Uint32 x)
     /* Count Leading Zeroes builtin in GCC.
     /* Count Leading Zeroes builtin in GCC.
      * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
      * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
      */
      */
-    if (x == 0) {
+    if (x == 0)
+    {
         return -1;
         return -1;
     }
     }
     return 31 - __builtin_clz(x);
     return 31 - __builtin_clz(x);
 #elif defined(__WATCOMC__) && defined(__386__)
 #elif defined(__WATCOMC__) && defined(__386__)
-    if (x == 0) {
+    if (x == 0)
+    {
         return -1;
         return -1;
     }
     }
     return _SDL_bsr_watcom(x);
     return _SDL_bsr_watcom(x);
 #elif defined(_MSC_VER)
 #elif defined(_MSC_VER)
     unsigned long index;
     unsigned long index;
-    if (_BitScanReverse(&index, x)) {
+    if (_BitScanReverse(&index, x))
+    {
         return index;
         return index;
     }
     }
     return -1;
     return -1;
@@ -89,7 +98,8 @@ SDL_MostSignificantBitIndex32(Uint32 x)
     int msbIndex = 0;
     int msbIndex = 0;
     int i;
     int i;
 
 
-    if (x == 0) {
+    if (x == 0)
+    {
         return -1;
         return -1;
     }
     }
 
 
@@ -109,7 +119,8 @@ SDL_MostSignificantBitIndex32(Uint32 x)
 SDL_FORCE_INLINE SDL_bool
 SDL_FORCE_INLINE SDL_bool
 SDL_HasExactlyOneBitSet32(Uint32 x)
 SDL_HasExactlyOneBitSet32(Uint32 x)
 {
 {
-    if (x && !(x & (x - 1))) {
+    if (x && !(x & (x - 1)))
+    {
         return SDL_TRUE;
         return SDL_TRUE;
     }
     }
     return SDL_FALSE;
     return SDL_FALSE;
@@ -123,4 +134,4 @@ SDL_HasExactlyOneBitSet32(Uint32 x)
 
 
 #endif /* SDL_bits_h_ */
 #endif /* SDL_bits_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 24 - 25
bsp/simulator/SDL2/include/SDL_blendmode.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_blendmode.h
+ * # CategoryBlendmode
  *
  *
- *  Header file declaring the SDL_BlendMode enumeration
+ * Header file declaring the SDL_BlendMode enumeration
  */
  */
 
 
 #ifndef SDL_blendmode_h_
 #ifndef SDL_blendmode_h_
@@ -35,9 +35,9 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  \brief The blend mode used in SDL_RenderCopy() and drawing operations.
+ * The blend mode used in SDL_RenderCopy() and drawing operations.
  */
  */
-typedef enum
+typedef enum SDL_BlendMode
 {
 {
     SDL_BLENDMODE_NONE = 0x00000000,     /**< no blending
     SDL_BLENDMODE_NONE = 0x00000000,     /**< no blending
                                               dstRGBA = srcRGBA */
                                               dstRGBA = srcRGBA */
@@ -52,7 +52,7 @@ typedef enum
                                               dstA = dstA */
                                               dstA = dstA */
     SDL_BLENDMODE_MUL = 0x00000008,      /**< color multiply
     SDL_BLENDMODE_MUL = 0x00000008,      /**< color multiply
                                               dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
                                               dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
-                                              dstA = (srcA * dstA) + (dstA * (1-srcA)) */
+                                              dstA = dstA */
     SDL_BLENDMODE_INVALID = 0x7FFFFFFF
     SDL_BLENDMODE_INVALID = 0x7FFFFFFF
 
 
     /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
     /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
@@ -60,22 +60,22 @@ typedef enum
 } SDL_BlendMode;
 } SDL_BlendMode;
 
 
 /**
 /**
- *  \brief The blend operation used when combining source and destination pixel components
+ * The blend operation used when combining source and destination pixel
+ * components
  */
  */
-typedef enum
+typedef enum SDL_BlendOperation
 {
 {
     SDL_BLENDOPERATION_ADD              = 0x1,  /**< dst + src: supported by all renderers */
     SDL_BLENDOPERATION_ADD              = 0x1,  /**< dst + src: supported by all renderers */
-    SDL_BLENDOPERATION_SUBTRACT         = 0x2,  /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
-    SDL_BLENDOPERATION_REV_SUBTRACT     = 0x3,  /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
-    SDL_BLENDOPERATION_MINIMUM          = 0x4,  /**< min(dst, src) : supported by D3D11 */
-    SDL_BLENDOPERATION_MAXIMUM          = 0x5   /**< max(dst, src) : supported by D3D11 */
-
+    SDL_BLENDOPERATION_SUBTRACT         = 0x2,  /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
+    SDL_BLENDOPERATION_REV_SUBTRACT     = 0x3,  /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
+    SDL_BLENDOPERATION_MINIMUM          = 0x4,  /**< min(dst, src) : supported by D3D9, D3D11 */
+    SDL_BLENDOPERATION_MAXIMUM          = 0x5   /**< max(dst, src) : supported by D3D9, D3D11 */
 } SDL_BlendOperation;
 } SDL_BlendOperation;
 
 
 /**
 /**
- *  \brief The normalized factor used to multiply pixel components
+ * The normalized factor used to multiply pixel components
  */
  */
-typedef enum
+typedef enum SDL_BlendFactor
 {
 {
     SDL_BLENDFACTOR_ZERO                = 0x1,  /**< 0, 0, 0, 0 */
     SDL_BLENDFACTOR_ZERO                = 0x1,  /**< 0, 0, 0, 0 */
     SDL_BLENDFACTOR_ONE                 = 0x2,  /**< 1, 1, 1, 1 */
     SDL_BLENDFACTOR_ONE                 = 0x2,  /**< 1, 1, 1, 1 */
@@ -87,7 +87,6 @@ typedef enum
     SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8,  /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */
     SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8,  /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */
     SDL_BLENDFACTOR_DST_ALPHA           = 0x9,  /**< dstA, dstA, dstA, dstA */
     SDL_BLENDFACTOR_DST_ALPHA           = 0x9,  /**< dstA, dstA, dstA, dstA */
     SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA   /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */
     SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA   /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */
-
 } SDL_BlendFactor;
 } SDL_BlendFactor;
 
 
 /**
 /**
@@ -135,10 +134,10 @@ typedef enum
  * SDL 2.0.6. All renderers support the four blend modes listed in the
  * SDL 2.0.6. All renderers support the four blend modes listed in the
  * SDL_BlendMode enumeration.
  * SDL_BlendMode enumeration.
  *
  *
- * - **direct3d**: Supports `SDL_BLENDOPERATION_ADD` with all factors.
- * - **direct3d11**: Supports all operations with all factors. However, some
+ * - **direct3d**: Supports all operations with all factors. However, some
  *   factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and
  *   factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and
  *   `SDL_BLENDOPERATION_MAXIMUM`.
  *   `SDL_BLENDOPERATION_MAXIMUM`.
+ * - **direct3d11**: Same as Direct3D 9.
  * - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
  * - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
  *   factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL
  *   factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL
  *   2.0.6.
  *   2.0.6.
@@ -160,18 +159,18 @@ typedef enum
  * case.
  * case.
  *
  *
  * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and
  * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and
- *                       blue components of the source pixels
+ *                       blue components of the source pixels.
  * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and
  * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and
- *                       blue components of the destination pixels
+ *                       blue components of the destination pixels.
  * \param colorOperation the SDL_BlendOperation used to combine the red,
  * \param colorOperation the SDL_BlendOperation used to combine the red,
  *                       green, and blue components of the source and
  *                       green, and blue components of the source and
- *                       destination pixels
+ *                       destination pixels.
  * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of
  * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of
- *                       the source pixels
+ *                       the source pixels.
  * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of
  * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of
- *                       the destination pixels
+ *                       the destination pixels.
  * \param alphaOperation the SDL_BlendOperation used to combine the alpha
  * \param alphaOperation the SDL_BlendOperation used to combine the alpha
- *                       component of the source and destination pixels
+ *                       component of the source and destination pixels.
  * \returns an SDL_BlendMode that represents the chosen factors and
  * \returns an SDL_BlendMode that represents the chosen factors and
  *          operations.
  *          operations.
  *
  *
@@ -197,4 +196,4 @@ extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor
 
 
 #endif /* SDL_blendmode_h_ */
 #endif /* SDL_blendmode_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 51 - 4
bsp/simulator/SDL2/include/SDL_clipboard.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,7 +20,7 @@
 */
 */
 
 
 /**
 /**
- * \file SDL_clipboard.h
+ * # CategoryClipboard
  *
  *
  * Include file for SDL clipboard handling
  * Include file for SDL clipboard handling
  */
  */
@@ -41,7 +41,7 @@ extern "C" {
 /**
 /**
  * Put UTF-8 text into the clipboard.
  * Put UTF-8 text into the clipboard.
  *
  *
- * \param text the text to store in the clipboard
+ * \param text the text to store in the clipboard.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -82,6 +82,53 @@ extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
  */
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
 extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
 
 
+/**
+ * Put UTF-8 text into the primary selection.
+ *
+ * \param text the text to store in the primary selection.
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.26.0.
+ *
+ * \sa SDL_GetPrimarySelectionText
+ * \sa SDL_HasPrimarySelectionText
+ */
+extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
+
+/**
+ * Get UTF-8 text from the primary selection, which must be freed with
+ * SDL_free().
+ *
+ * This functions returns empty string if there was not enough memory left for
+ * a copy of the primary selection's content.
+ *
+ * \returns the primary selection text on success or an empty string on
+ *          failure; call SDL_GetError() for more information. Caller must
+ *          call SDL_free() on the returned pointer when done with it (even if
+ *          there was an error).
+ *
+ * \since This function is available since SDL 2.26.0.
+ *
+ * \sa SDL_HasPrimarySelectionText
+ * \sa SDL_SetPrimarySelectionText
+ */
+extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
+
+/**
+ * Query whether the primary selection exists and contains a non-empty text
+ * string.
+ *
+ * \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it
+ *          does not.
+ *
+ * \since This function is available since SDL 2.26.0.
+ *
+ * \sa SDL_GetPrimarySelectionText
+ * \sa SDL_SetPrimarySelectionText
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
+
 
 
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
@@ -91,4 +138,4 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
 
 
 #endif /* SDL_clipboard_h_ */
 #endif /* SDL_clipboard_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 31 - 277
bsp/simulator/SDL2/include/SDL_config.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,287 +19,41 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-#ifndef SDL_config_windows_h_
-#define SDL_config_windows_h_
+#ifndef SDL_config_h_
 #define SDL_config_h_
 #define SDL_config_h_
 
 
 #include "SDL_platform.h"
 #include "SDL_platform.h"
 
 
-/* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK,
- * but out of caution we'll only use it if the compiler supports __has_include() to confirm its presence.
- * If your compiler doesn't support __has_include() but you have winsdkver.h, define HAVE_WINSDKVER_H.  */
-#if !defined(HAVE_WINSDKVER_H) && defined(__has_include)
-#if __has_include(<winsdkver.h>)
-#define HAVE_WINSDKVER_H 1
-#endif
-#endif
-
-#ifdef HAVE_WINSDKVER_H
-#include <winsdkver.h>
-#endif
-
-/* This is a set of defines to configure the SDL features */
-
-#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
-#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) || defined(__BORLANDC__) || defined(__CODEGEARC__)
-#define HAVE_STDINT_H   1
-#elif defined(_MSC_VER)
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#ifndef _UINTPTR_T_DEFINED
-#ifdef  _WIN64
-typedef unsigned __int64 uintptr_t;
+/* WIKI CATEGORY: - */
+
+/* Add any platform that doesn't build using the configure system. */
+#if defined(__WIN32__)
+#include "SDL_config_windows.h"
+#elif defined(__WINRT__)
+#include "SDL_config_winrt.h"
+#elif defined(__WINGDK__)
+#include "SDL_config_wingdk.h"
+#elif defined(__XBOXONE__) || defined(__XBOXSERIES__)
+#include "SDL_config_xbox.h"
+#elif defined(__MACOSX__)
+#include "SDL_config_macosx.h"
+#elif defined(__IPHONEOS__)
+#include "SDL_config_iphoneos.h"
+#elif defined(__ANDROID__)
+#include "SDL_config_android.h"
+#elif defined(__OS2__)
+#include "SDL_config_os2.h"
+#elif defined(__EMSCRIPTEN__)
+#include "SDL_config_emscripten.h"
+#elif defined(__NGAGE__)
+#include "SDL_config_ngage.h"
 #else
 #else
-typedef unsigned int uintptr_t;
-#endif
-#define _UINTPTR_T_DEFINED
-#endif
-/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
-#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
-#define DWORD_PTR DWORD
-#endif
-#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
-#define LONG_PTR LONG
-#endif
-#else /* !__GNUC__ && !_MSC_VER */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-#ifndef _SIZE_T_DEFINED_
-#define _SIZE_T_DEFINED_
-typedef unsigned int size_t;
-#endif
-typedef unsigned int uintptr_t;
-#endif /* __GNUC__ || _MSC_VER */
-#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
+/* This is a minimal configuration just to get SDL running on new platforms. */
+#include "SDL_config_minimal.h"
+#endif /* platform config */
 
 
-#ifdef _WIN64
-# define SIZEOF_VOIDP 8
-#else
-# define SIZEOF_VOIDP 4
+#ifdef USING_GENERATED_CONFIG_H
+#error Wrong SDL_config.h, check your include path?
 #endif
 #endif
 
 
-#define HAVE_DDRAW_H 1
-#define HAVE_DINPUT_H 1
-#define HAVE_DSOUND_H 1
-#define HAVE_DXGI_H 1
-#define HAVE_XINPUT_H 1
-#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00  /* Windows 10 SDK */
-#define HAVE_WINDOWS_GAMING_INPUT_H 1
-#endif
-#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602  /* Windows 8 SDK */
-#define HAVE_D3D11_H 1
-#endif
-#define HAVE_MMDEVICEAPI_H 1
-#define HAVE_AUDIOCLIENT_H 1
-#define HAVE_TPCSHRD_H 1
-#define HAVE_SENSORSAPI_H 1
-#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
-#define HAVE_IMMINTRIN_H 1
-#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
-# if __has_include(<immintrin.h>)
-#   define HAVE_IMMINTRIN_H 1
-# endif
-#endif
-
-/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
-#ifdef HAVE_LIBC
-/* Useful headers */
-#define STDC_HEADERS 1
-#define HAVE_CTYPE_H 1
-#define HAVE_FLOAT_H 1
-#define HAVE_LIMITS_H 1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H 1
-#define HAVE_STDIO_H 1
-#define HAVE_STRING_H 1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE__STRREV 1
-/* These functions have security warnings, so we won't use them */
-/* #undef HAVE__STRUPR */
-/* #undef HAVE__STRLWR */
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-/* #undef HAVE_STRTOK_R */
-/* These functions have security warnings, so we won't use them */
-/* #undef HAVE__LTOA */
-/* #undef HAVE__ULTOA */
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE__STRICMP 1
-#define HAVE__STRNICMP 1
-#define HAVE__WCSICMP 1
-#define HAVE__WCSNICMP 1
-#define HAVE__WCSDUP 1
-#define HAVE_ACOS   1
-#define HAVE_ACOSF  1
-#define HAVE_ASIN   1
-#define HAVE_ASINF  1
-#define HAVE_ATAN   1
-#define HAVE_ATANF  1
-#define HAVE_ATAN2  1
-#define HAVE_ATAN2F 1
-#define HAVE_CEILF  1
-#define HAVE__COPYSIGN 1
-#define HAVE_COS    1
-#define HAVE_COSF   1
-#define HAVE_EXP    1
-#define HAVE_EXPF   1
-#define HAVE_FABS   1
-#define HAVE_FABSF  1
-#define HAVE_FLOOR  1
-#define HAVE_FLOORF 1
-#define HAVE_FMOD   1
-#define HAVE_FMODF  1
-#define HAVE_LOG    1
-#define HAVE_LOGF   1
-#define HAVE_LOG10  1
-#define HAVE_LOG10F 1
-#define HAVE_POW    1
-#define HAVE_POWF   1
-#define HAVE_SIN    1
-#define HAVE_SINF   1
-#define HAVE_SQRT   1
-#define HAVE_SQRTF  1
-#define HAVE_TAN    1
-#define HAVE_TANF   1
-#if defined(_MSC_VER)
-/* These functions were added with the VC++ 2013 C runtime library */
-#if _MSC_VER >= 1800
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOULL 1
-#define HAVE_VSSCANF 1
-#define HAVE_LROUND 1
-#define HAVE_LROUNDF 1
-#define HAVE_ROUND 1
-#define HAVE_ROUNDF 1
-#define HAVE_SCALBN 1
-#define HAVE_SCALBNF 1
-#define HAVE_TRUNC  1
-#define HAVE_TRUNCF 1
-#endif
-/* This function is available with at least the VC++ 2008 C runtime library */
-#if _MSC_VER >= 1400
-#define HAVE__FSEEKI64 1
-#endif
-#endif
-#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
-#define HAVE_M_PI 1
-#endif
-#else
-#define HAVE_STDARG_H   1
-#define HAVE_STDDEF_H   1
-#endif
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_WASAPI 1
-#define SDL_AUDIO_DRIVER_DSOUND 1
-#define SDL_AUDIO_DRIVER_WINMM  1
-#define SDL_AUDIO_DRIVER_DISK   1
-#define SDL_AUDIO_DRIVER_DUMMY  1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_DINPUT 1
-#define SDL_JOYSTICK_HIDAPI 1
-#ifndef __WINRT__
-#define SDL_JOYSTICK_RAWINPUT   1
-#endif
-#define SDL_JOYSTICK_VIRTUAL    1
-#ifdef HAVE_WINDOWS_GAMING_INPUT_H
-#define SDL_JOYSTICK_WGI    1
-#endif
-#define SDL_JOYSTICK_XINPUT 1
-#define SDL_HAPTIC_DINPUT   1
-#define SDL_HAPTIC_XINPUT   1
-
-/* Enable the sensor driver */
-#define SDL_SENSOR_WINDOWS  1
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_WINDOWS  1
-
-/* Enable various threading systems */
-#define SDL_THREAD_GENERIC_COND_SUFFIX 1
-#define SDL_THREAD_WINDOWS  1
-
-/* Enable various timer systems */
-#define SDL_TIMER_WINDOWS   1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_DUMMY  1
-#define SDL_VIDEO_DRIVER_WINDOWS    1
-
-#ifndef SDL_VIDEO_RENDER_D3D
-#define SDL_VIDEO_RENDER_D3D    1
-#endif
-#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
-#define SDL_VIDEO_RENDER_D3D11  1
-#endif
-
-/* Enable OpenGL support */
-#ifndef SDL_VIDEO_OPENGL
-#define SDL_VIDEO_OPENGL    1
-#endif
-#ifndef SDL_VIDEO_OPENGL_WGL
-#define SDL_VIDEO_OPENGL_WGL    1
-#endif
-#ifndef SDL_VIDEO_RENDER_OGL
-#define SDL_VIDEO_RENDER_OGL    1
-#endif
-#ifndef SDL_VIDEO_RENDER_OGL_ES2
-#define SDL_VIDEO_RENDER_OGL_ES2    1
-#endif
-#ifndef SDL_VIDEO_OPENGL_ES2
-#define SDL_VIDEO_OPENGL_ES2    1
-#endif
-#ifndef SDL_VIDEO_OPENGL_EGL
-#define SDL_VIDEO_OPENGL_EGL    1
-#endif
-
-/* Enable Vulkan support */
-#define SDL_VIDEO_VULKAN 1
-
-/* Enable system power support */
-#define SDL_POWER_WINDOWS 1
-
-/* Enable filesystem support */
-#define SDL_FILESYSTEM_WINDOWS  1
-
-/* Enable assembly routines (Win64 doesn't have inline asm) */
-#ifndef _WIN64
-#define SDL_ASSEMBLY_ROUTINES   1
-#endif
-
-#endif /* SDL_config_windows_h_ */
-
-/* vi: set ts=4 sw=4 expandtab: */
+#endif /* SDL_config_h_ */

+ 0 - 445
bsp/simulator/SDL2/include/SDL_config.h.cmake

@@ -1,445 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_config_h_
-#define SDL_config_h_
-
-/**
- *  \file SDL_config.h.in
- *
- *  This is a set of defines to configure the SDL features
- */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-/* C language features */
-#cmakedefine const @HAVE_CONST@
-#cmakedefine inline @HAVE_INLINE@
-#cmakedefine volatile @HAVE_VOLATILE@
-
-/* C datatypes */
-/* Define SIZEOF_VOIDP for 64/32 architectures */
-#ifdef __LP64__
-#define SIZEOF_VOIDP 8
-#else
-#define SIZEOF_VOIDP 4
-#endif
-
-#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@
-#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@
-
-#cmakedefine HAVE_D3D_H @HAVE_D3D_H@
-#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@
-#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@
-#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@
-#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
-#cmakedefine HAVE_XAUDIO2_H @HAVE_XAUDIO2_H@
-#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
-#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
-#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
-#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
-
-/* Comment this if you want to build without any C library requirements */
-#cmakedefine HAVE_LIBC 1
-#if HAVE_LIBC
-
-/* Useful headers */
-#cmakedefine HAVE_ALLOCA_H 1
-#cmakedefine HAVE_SYS_TYPES_H 1
-#cmakedefine HAVE_STDIO_H 1
-#cmakedefine STDC_HEADERS 1
-#cmakedefine HAVE_STDLIB_H 1
-#cmakedefine HAVE_STDARG_H 1
-#cmakedefine HAVE_MALLOC_H 1
-#cmakedefine HAVE_MEMORY_H 1
-#cmakedefine HAVE_STRING_H 1
-#cmakedefine HAVE_STRINGS_H 1
-#cmakedefine HAVE_WCHAR_H 1
-#cmakedefine HAVE_INTTYPES_H 1
-#cmakedefine HAVE_STDINT_H 1
-#cmakedefine HAVE_CTYPE_H 1
-#cmakedefine HAVE_MATH_H 1
-#cmakedefine HAVE_ICONV_H 1
-#cmakedefine HAVE_SIGNAL_H 1
-#cmakedefine HAVE_ALTIVEC_H 1
-#cmakedefine HAVE_PTHREAD_NP_H 1
-#cmakedefine HAVE_LIBUDEV_H 1
-#cmakedefine HAVE_DBUS_DBUS_H 1
-#cmakedefine HAVE_IBUS_IBUS_H 1
-#cmakedefine HAVE_FCITX_FRONTEND_H 1
-#cmakedefine HAVE_LIBSAMPLERATE_H 1
-
-/* C library functions */
-#cmakedefine HAVE_MALLOC 1
-#cmakedefine HAVE_CALLOC 1
-#cmakedefine HAVE_REALLOC 1
-#cmakedefine HAVE_FREE 1
-#cmakedefine HAVE_ALLOCA 1
-#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
-#cmakedefine HAVE_GETENV 1
-#cmakedefine HAVE_SETENV 1
-#cmakedefine HAVE_PUTENV 1
-#cmakedefine HAVE_UNSETENV 1
-#endif
-#cmakedefine HAVE_QSORT 1
-#cmakedefine HAVE_ABS 1
-#cmakedefine HAVE_BCOPY 1
-#cmakedefine HAVE_MEMSET 1
-#cmakedefine HAVE_MEMCPY 1
-#cmakedefine HAVE_MEMMOVE 1
-#cmakedefine HAVE_MEMCMP 1
-#cmakedefine HAVE_WCSLEN 1
-#cmakedefine HAVE_WCSLCPY 1
-#cmakedefine HAVE_WCSLCAT 1
-#cmakedefine HAVE_WCSCMP 1
-#cmakedefine HAVE_STRLEN 1
-#cmakedefine HAVE_STRLCPY 1
-#cmakedefine HAVE_STRLCAT 1
-#cmakedefine HAVE_STRDUP 1
-#cmakedefine HAVE__STRREV 1
-#cmakedefine HAVE__STRUPR 1
-#cmakedefine HAVE__STRLWR 1
-#cmakedefine HAVE_INDEX 1
-#cmakedefine HAVE_RINDEX 1
-#cmakedefine HAVE_STRCHR 1
-#cmakedefine HAVE_STRRCHR 1
-#cmakedefine HAVE_STRSTR 1
-#cmakedefine HAVE_ITOA 1
-#cmakedefine HAVE__LTOA 1
-#cmakedefine HAVE__UITOA 1
-#cmakedefine HAVE__ULTOA 1
-#cmakedefine HAVE_STRTOL 1
-#cmakedefine HAVE_STRTOUL 1
-#cmakedefine HAVE__I64TOA 1
-#cmakedefine HAVE__UI64TOA 1
-#cmakedefine HAVE_STRTOLL 1
-#cmakedefine HAVE_STRTOULL 1
-#cmakedefine HAVE_STRTOD 1
-#cmakedefine HAVE_ATOI 1
-#cmakedefine HAVE_ATOF 1
-#cmakedefine HAVE_STRCMP 1
-#cmakedefine HAVE_STRNCMP 1
-#cmakedefine HAVE__STRICMP 1
-#cmakedefine HAVE_STRCASECMP 1
-#cmakedefine HAVE__STRNICMP 1
-#cmakedefine HAVE_STRNCASECMP 1
-#cmakedefine HAVE_VSSCANF 1
-#cmakedefine HAVE_VSNPRINTF 1
-#cmakedefine HAVE_M_PI 1
-#cmakedefine HAVE_ATAN 1
-#cmakedefine HAVE_ATAN2 1
-#cmakedefine HAVE_ACOS 1
-#cmakedefine HAVE_ASIN 1
-#cmakedefine HAVE_CEIL 1
-#cmakedefine HAVE_COPYSIGN 1
-#cmakedefine HAVE_COS 1
-#cmakedefine HAVE_COSF 1
-#cmakedefine HAVE_FABS 1
-#cmakedefine HAVE_FLOOR 1
-#cmakedefine HAVE_LOG 1
-#cmakedefine HAVE_POW 1
-#cmakedefine HAVE_SCALBN 1
-#cmakedefine HAVE_SIN 1
-#cmakedefine HAVE_SINF 1
-#cmakedefine HAVE_SQRT 1
-#cmakedefine HAVE_SQRTF 1
-#cmakedefine HAVE_TAN 1
-#cmakedefine HAVE_TANF 1
-#cmakedefine HAVE_FOPEN64 1
-#cmakedefine HAVE_FSEEKO 1
-#cmakedefine HAVE_FSEEKO64 1
-#cmakedefine HAVE_SIGACTION 1
-#cmakedefine HAVE_SA_SIGACTION 1
-#cmakedefine HAVE_SETJMP 1
-#cmakedefine HAVE_NANOSLEEP 1
-#cmakedefine HAVE_SYSCONF 1
-#cmakedefine HAVE_SYSCTLBYNAME 1
-#cmakedefine HAVE_CLOCK_GETTIME 1
-#cmakedefine HAVE_GETPAGESIZE 1
-#cmakedefine HAVE_MPROTECT 1
-#cmakedefine HAVE_ICONV 1
-#cmakedefine HAVE_PTHREAD_SETNAME_NP 1
-#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1
-#cmakedefine HAVE_SEM_TIMEDWAIT 1
-#cmakedefine HAVE_GETAUXVAL 1
-#cmakedefine HAVE_POLL 1
-
-#elif __WIN32__
-#cmakedefine HAVE_STDARG_H 1
-#cmakedefine HAVE_STDDEF_H 1
-#else
-/* We may need some replacement for stdarg.h here */
-#include <stdarg.h>
-#endif /* HAVE_LIBC */
-
-/* SDL internal assertion support */
-#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
-
-/* Allow disabling of core subsystems */
-#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@
-#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@
-#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@
-#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@
-#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
-#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
-#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
-#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
-#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
-#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@
-#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@
-#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@
-#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@
-#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@
-
-/* Enable various audio drivers */
-#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@
-#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@
-#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@
-#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
-#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
-#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
-#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@
-#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
-#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@
-#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@
-#cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@
-#cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@
-#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@
-#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@
-#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@
-#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@
-#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@
-#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@
-#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@
-#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
-#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@
-#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@
-
-/* Enable various input drivers */
-#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
-#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
-#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@
-#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
-#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
-#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
-#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@
-#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@
-#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@
-#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@
-#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
-#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@
-#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
-#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@
-#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@
-#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
-#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
-#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
-#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
-#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
-#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
-
-/* Enable various shared object loading systems */
-#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
-#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
-#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@
-#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@
-
-/* Enable various threading systems */
-#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@
-#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@
-#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@
-#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@
-
-/* Enable various timer systems */
-#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@
-#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@
-#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@
-#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@
-#cmakedefine SDL_TIMER_WINCE @SDL_TIMER_WINCE@
-
-/* Enable various video drivers */
-#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@
-#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@
-#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@
-#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@
-#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@
-#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@
-#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@
-#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@
-#cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@
-#cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@
-
-#cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@
-#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM@
-
-#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH @SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH@
-#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@
-#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@
-#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@
-
-#cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@
-#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@
-#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@
-#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@
-#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@
-#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@
-#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@
-#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@
-#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@
-
-#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@
-#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@
-#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@
-#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@
-#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@
-#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@
-
-/* Enable OpenGL support */
-#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@
-#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@
-#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@
-#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@
-#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
-#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@
-#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@
-#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@
-#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@
-#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@
-
-/* Enable Vulkan support */
-#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@
-
-/* Enable system power support */
-#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@
-#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
-#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@
-#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@
-#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@
-#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@
-#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
-
-/* Enable system filesystem support */
-#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@
-#cmakedefine SDL_FILESYSTEM_HAIKU @SDL_FILESYSTEM_HAIKU@
-#cmakedefine SDL_FILESYSTEM_COCOA @SDL_FILESYSTEM_COCOA@
-#cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@
-#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@
-#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@
-#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@
-
-/* Enable assembly routines */
-#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
-#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
-
-/* Enable dynamic libsamplerate support */
-#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@
-
-/* Platform specific definitions */
-#if !defined(__WIN32__)
-#  if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
-typedef unsigned int size_t;
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-typedef unsigned long uintptr_t;
-#  endif /* if (stdint.h isn't available) */
-#else /* __WIN32__ */
-#  if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
-#    if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
-#define HAVE_STDINT_H	1
-#    elif defined(_MSC_VER)
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#      ifndef _UINTPTR_T_DEFINED
-#        ifdef  _WIN64
-typedef unsigned __int64 uintptr_t;
-#          else
-typedef unsigned int uintptr_t;
-#        endif
-#define _UINTPTR_T_DEFINED
-#      endif
-/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
-#      if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
-#define DWORD_PTR DWORD
-#      endif
-#      if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
-#define LONG_PTR LONG
-#      endif
-#    else /* !__GNUC__ && !_MSC_VER */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-#      ifndef _SIZE_T_DEFINED_
-#define _SIZE_T_DEFINED_
-typedef unsigned int size_t;
-#      endif
-typedef unsigned int uintptr_t;
-#    endif /* __GNUC__ || _MSC_VER */
-#  endif /* !_STDINT_H_ && !HAVE_STDINT_H */
-#endif /* __WIN32__ */
-
-#endif /* SDL_config_h_ */

+ 0 - 389
bsp/simulator/SDL2/include/SDL_config.h.in

@@ -1,389 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_config_h_
-#define SDL_config_h_
-
-/**
- *  \file SDL_config.h.in
- *
- *  This is a set of defines to configure the SDL features
- */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-/* Make sure that this isn't included by Visual C++ */
-#ifdef _MSC_VER
-#error You should run hg revert SDL_config.h 
-#endif
-
-/* C language features */
-#undef const
-#undef inline
-#undef volatile
-
-/* C datatypes */
-#ifdef __LP64__
-#define SIZEOF_VOIDP 8
-#else
-#define SIZEOF_VOIDP 4
-#endif
-#undef HAVE_GCC_ATOMICS
-#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET
-
-#undef HAVE_DDRAW_H
-#undef HAVE_DINPUT_H
-#undef HAVE_DSOUND_H
-#undef HAVE_DXGI_H
-#undef HAVE_XINPUT_H
-#undef HAVE_XINPUT_GAMEPAD_EX
-#undef HAVE_XINPUT_STATE_EX
-
-/* Comment this if you want to build without any C library requirements */
-#undef HAVE_LIBC
-#if HAVE_LIBC
-
-/* Useful headers */
-#undef HAVE_ALLOCA_H
-#undef HAVE_SYS_TYPES_H
-#undef HAVE_STDIO_H
-#undef STDC_HEADERS
-#undef HAVE_STDLIB_H
-#undef HAVE_STDARG_H
-#undef HAVE_MALLOC_H
-#undef HAVE_MEMORY_H
-#undef HAVE_STRING_H
-#undef HAVE_STRINGS_H
-#undef HAVE_WCHAR_H
-#undef HAVE_INTTYPES_H
-#undef HAVE_STDINT_H
-#undef HAVE_CTYPE_H
-#undef HAVE_MATH_H
-#undef HAVE_ICONV_H
-#undef HAVE_SIGNAL_H
-#undef HAVE_ALTIVEC_H
-#undef HAVE_PTHREAD_NP_H
-#undef HAVE_LIBUDEV_H
-#undef HAVE_DBUS_DBUS_H
-#undef HAVE_IBUS_IBUS_H
-#undef HAVE_FCITX_FRONTEND_H
-#undef HAVE_LIBSAMPLERATE_H
-
-/* C library functions */
-#undef HAVE_MALLOC
-#undef HAVE_CALLOC
-#undef HAVE_REALLOC
-#undef HAVE_FREE
-#undef HAVE_ALLOCA
-#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
-#undef HAVE_GETENV
-#undef HAVE_SETENV
-#undef HAVE_PUTENV
-#undef HAVE_UNSETENV
-#endif
-#undef HAVE_QSORT
-#undef HAVE_ABS
-#undef HAVE_BCOPY
-#undef HAVE_MEMSET
-#undef HAVE_MEMCPY
-#undef HAVE_MEMMOVE
-#undef HAVE_MEMCMP
-#undef HAVE_WCSLEN
-#undef HAVE_WCSLCPY
-#undef HAVE_WCSLCAT
-#undef HAVE_WCSCMP
-#undef HAVE_STRLEN
-#undef HAVE_STRLCPY
-#undef HAVE_STRLCAT
-#undef HAVE_STRDUP
-#undef HAVE__STRREV
-#undef HAVE__STRUPR
-#undef HAVE__STRLWR
-#undef HAVE_INDEX
-#undef HAVE_RINDEX
-#undef HAVE_STRCHR
-#undef HAVE_STRRCHR
-#undef HAVE_STRSTR
-#undef HAVE_ITOA
-#undef HAVE__LTOA
-#undef HAVE__UITOA
-#undef HAVE__ULTOA
-#undef HAVE_STRTOL
-#undef HAVE_STRTOUL
-#undef HAVE__I64TOA
-#undef HAVE__UI64TOA
-#undef HAVE_STRTOLL
-#undef HAVE_STRTOULL
-#undef HAVE_STRTOD
-#undef HAVE_ATOI
-#undef HAVE_ATOF
-#undef HAVE_STRCMP
-#undef HAVE_STRNCMP
-#undef HAVE__STRICMP
-#undef HAVE_STRCASECMP
-#undef HAVE__STRNICMP
-#undef HAVE_STRNCASECMP
-#undef HAVE_SSCANF
-#undef HAVE_VSSCANF
-#undef HAVE_SNPRINTF
-#undef HAVE_VSNPRINTF
-#undef HAVE_M_PI
-#undef HAVE_ATAN
-#undef HAVE_ATAN2
-#undef HAVE_ACOS
-#undef HAVE_ASIN
-#undef HAVE_CEIL
-#undef HAVE_COPYSIGN
-#undef HAVE_COS
-#undef HAVE_COSF
-#undef HAVE_FABS
-#undef HAVE_FLOOR
-#undef HAVE_LOG
-#undef HAVE_POW
-#undef HAVE_SCALBN
-#undef HAVE_SIN
-#undef HAVE_SINF
-#undef HAVE_SQRT
-#undef HAVE_SQRTF
-#undef HAVE_TAN
-#undef HAVE_TANF
-#undef HAVE_FOPEN64
-#undef HAVE_FSEEKO
-#undef HAVE_FSEEKO64
-#undef HAVE_SIGACTION
-#undef HAVE_SA_SIGACTION
-#undef HAVE_SETJMP
-#undef HAVE_NANOSLEEP
-#undef HAVE_SYSCONF
-#undef HAVE_SYSCTLBYNAME
-#undef HAVE_CLOCK_GETTIME
-#undef HAVE_GETPAGESIZE
-#undef HAVE_MPROTECT
-#undef HAVE_ICONV
-#undef HAVE_PTHREAD_SETNAME_NP
-#undef HAVE_PTHREAD_SET_NAME_NP
-#undef HAVE_SEM_TIMEDWAIT
-#undef HAVE_GETAUXVAL
-#undef HAVE_POLL
-
-#else
-#define HAVE_STDARG_H   1
-#define HAVE_STDDEF_H   1
-#define HAVE_STDINT_H   1
-#endif /* HAVE_LIBC */
-
-/* SDL internal assertion support */
-#undef SDL_DEFAULT_ASSERT_LEVEL
-
-/* Allow disabling of core subsystems */
-#undef SDL_ATOMIC_DISABLED
-#undef SDL_AUDIO_DISABLED
-#undef SDL_CPUINFO_DISABLED
-#undef SDL_EVENTS_DISABLED
-#undef SDL_FILE_DISABLED
-#undef SDL_JOYSTICK_DISABLED
-#undef SDL_HAPTIC_DISABLED
-#undef SDL_LOADSO_DISABLED
-#undef SDL_RENDER_DISABLED
-#undef SDL_THREADS_DISABLED
-#undef SDL_TIMERS_DISABLED
-#undef SDL_VIDEO_DISABLED
-#undef SDL_POWER_DISABLED
-#undef SDL_FILESYSTEM_DISABLED
-
-/* Enable various audio drivers */
-#undef SDL_AUDIO_DRIVER_ALSA
-#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-#undef SDL_AUDIO_DRIVER_ANDROID
-#undef SDL_AUDIO_DRIVER_ARTS
-#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
-#undef SDL_AUDIO_DRIVER_COREAUDIO
-#undef SDL_AUDIO_DRIVER_DISK
-#undef SDL_AUDIO_DRIVER_DSOUND
-#undef SDL_AUDIO_DRIVER_DUMMY
-#undef SDL_AUDIO_DRIVER_EMSCRIPTEN
-#undef SDL_AUDIO_DRIVER_ESD
-#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
-#undef SDL_AUDIO_DRIVER_FUSIONSOUND
-#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
-#undef SDL_AUDIO_DRIVER_HAIKU
-#undef SDL_AUDIO_DRIVER_JACK
-#undef SDL_AUDIO_DRIVER_JACK_DYNAMIC
-#undef SDL_AUDIO_DRIVER_NACL
-#undef SDL_AUDIO_DRIVER_NAS
-#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
-#undef SDL_AUDIO_DRIVER_NETBSD
-#undef SDL_AUDIO_DRIVER_OSS
-#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
-#undef SDL_AUDIO_DRIVER_PAUDIO
-#undef SDL_AUDIO_DRIVER_PULSEAUDIO
-#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
-#undef SDL_AUDIO_DRIVER_QSA
-#undef SDL_AUDIO_DRIVER_SNDIO
-#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
-#undef SDL_AUDIO_DRIVER_SUNAUDIO
-#undef SDL_AUDIO_DRIVER_WASAPI
-#undef SDL_AUDIO_DRIVER_WINMM
-#undef SDL_AUDIO_DRIVER_XAUDIO2
-
-/* Enable various input drivers */
-#undef SDL_INPUT_LINUXEV
-#undef SDL_INPUT_LINUXKD
-#undef SDL_INPUT_TSLIB
-#undef SDL_JOYSTICK_HAIKU
-#undef SDL_JOYSTICK_DINPUT
-#undef SDL_JOYSTICK_XINPUT
-#undef SDL_JOYSTICK_DUMMY
-#undef SDL_JOYSTICK_IOKIT
-#undef SDL_JOYSTICK_LINUX
-#undef SDL_JOYSTICK_ANDROID
-#undef SDL_JOYSTICK_WINMM
-#undef SDL_JOYSTICK_USBHID
-#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
-#undef SDL_JOYSTICK_EMSCRIPTEN
-#undef SDL_HAPTIC_DUMMY
-#undef SDL_HAPTIC_LINUX
-#undef SDL_HAPTIC_IOKIT
-#undef SDL_HAPTIC_DINPUT
-#undef SDL_HAPTIC_XINPUT
-
-/* Enable various shared object loading systems */
-#undef SDL_LOADSO_DLOPEN
-#undef SDL_LOADSO_DUMMY
-#undef SDL_LOADSO_LDG
-#undef SDL_LOADSO_WINDOWS
-
-/* Enable various threading systems */
-#undef SDL_THREAD_PTHREAD
-#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
-#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
-#undef SDL_THREAD_WINDOWS
-
-/* Enable various timer systems */
-#undef SDL_TIMER_HAIKU
-#undef SDL_TIMER_DUMMY
-#undef SDL_TIMER_UNIX
-#undef SDL_TIMER_WINDOWS
-
-/* Enable various video drivers */
-#undef SDL_VIDEO_DRIVER_HAIKU
-#undef SDL_VIDEO_DRIVER_COCOA
-#undef SDL_VIDEO_DRIVER_DIRECTFB
-#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
-#undef SDL_VIDEO_DRIVER_DUMMY
-#undef SDL_VIDEO_DRIVER_WINDOWS
-#undef SDL_VIDEO_DRIVER_WAYLAND
-#undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
-#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
-#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
-#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
-#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
-#undef SDL_VIDEO_DRIVER_MIR
-#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC
-#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
-#undef SDL_VIDEO_DRIVER_X11
-#undef SDL_VIDEO_DRIVER_RPI
-#undef SDL_VIDEO_DRIVER_KMSDRM
-#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC
-#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM
-#undef SDL_VIDEO_DRIVER_ANDROID
-#undef SDL_VIDEO_DRIVER_EMSCRIPTEN
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE
-#undef SDL_VIDEO_DRIVER_X11_XCURSOR
-#undef SDL_VIDEO_DRIVER_X11_XDBE
-#undef SDL_VIDEO_DRIVER_X11_XINERAMA
-#undef SDL_VIDEO_DRIVER_X11_XINPUT2
-#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
-#undef SDL_VIDEO_DRIVER_X11_XRANDR
-#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER
-#undef SDL_VIDEO_DRIVER_X11_XSHAPE
-#undef SDL_VIDEO_DRIVER_X11_XVIDMODE
-#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
-#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY
-#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
-#undef SDL_VIDEO_DRIVER_NACL
-#undef SDL_VIDEO_DRIVER_VIVANTE
-#undef SDL_VIDEO_DRIVER_VIVANTE_VDK
-#undef SDL_VIDEO_DRIVER_QNX
-
-#undef SDL_VIDEO_RENDER_D3D
-#undef SDL_VIDEO_RENDER_D3D11
-#undef SDL_VIDEO_RENDER_OGL
-#undef SDL_VIDEO_RENDER_OGL_ES
-#undef SDL_VIDEO_RENDER_OGL_ES2
-#undef SDL_VIDEO_RENDER_DIRECTFB
-
-/* Enable OpenGL support */
-#undef SDL_VIDEO_OPENGL
-#undef SDL_VIDEO_OPENGL_ES
-#undef SDL_VIDEO_OPENGL_ES2
-#undef SDL_VIDEO_OPENGL_BGL
-#undef SDL_VIDEO_OPENGL_CGL
-#undef SDL_VIDEO_OPENGL_EGL
-#undef SDL_VIDEO_OPENGL_GLX
-#undef SDL_VIDEO_OPENGL_WGL
-#undef SDL_VIDEO_OPENGL_OSMESA
-#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
-
-/* Enable Vulkan support */
-#undef SDL_VIDEO_VULKAN
-
-/* Enable system power support */
-#undef SDL_POWER_LINUX
-#undef SDL_POWER_WINDOWS
-#undef SDL_POWER_MACOSX
-#undef SDL_POWER_HAIKU
-#undef SDL_POWER_ANDROID
-#undef SDL_POWER_EMSCRIPTEN
-#undef SDL_POWER_HARDWIRED
-
-/* Enable system filesystem support */
-#undef SDL_FILESYSTEM_HAIKU
-#undef SDL_FILESYSTEM_COCOA
-#undef SDL_FILESYSTEM_DUMMY
-#undef SDL_FILESYSTEM_UNIX
-#undef SDL_FILESYSTEM_WINDOWS
-#undef SDL_FILESYSTEM_NACL
-#undef SDL_FILESYSTEM_ANDROID
-#undef SDL_FILESYSTEM_EMSCRIPTEN
-
-/* Enable assembly routines */
-#undef SDL_ASSEMBLY_ROUTINES
-#undef SDL_ALTIVEC_BLITTERS
-
-/* Enable ime support */
-#undef SDL_USE_IME
-
-/* Enable dynamic udev support */
-#undef SDL_UDEV_DYNAMIC
-
-/* Enable dynamic libsamplerate support */
-#undef SDL_LIBSAMPLERATE_DYNAMIC
-
-#endif /* SDL_config_h_ */

+ 50 - 13
bsp/simulator/SDL2/include/SDL_config_android.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -35,18 +35,20 @@
 
 
 #define HAVE_GCC_ATOMICS    1
 #define HAVE_GCC_ATOMICS    1
 
 
-#define HAVE_ALLOCA_H       1
-#define HAVE_SYS_TYPES_H    1
-#define HAVE_STDIO_H    1
 #define STDC_HEADERS    1
 #define STDC_HEADERS    1
-#define HAVE_STRING_H   1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H   1
+#define HAVE_ALLOCA_H       1
 #define HAVE_CTYPE_H    1
 #define HAVE_CTYPE_H    1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H   1
 #define HAVE_MATH_H 1
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
 #define HAVE_SIGNAL_H 1
+#define HAVE_STDINT_H   1
+#define HAVE_STDIO_H    1
+#define HAVE_STRING_H   1
+#define HAVE_SYS_TYPES_H    1
 
 
 /* C library functions */
 /* C library functions */
+#define HAVE_DLOPEN 1
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC    1
 #define HAVE_REALLOC    1
@@ -58,6 +60,7 @@
 #define HAVE_SETENV 1
 #define HAVE_SETENV 1
 #define HAVE_UNSETENV   1
 #define HAVE_UNSETENV   1
 #define HAVE_QSORT  1
 #define HAVE_QSORT  1
+#define HAVE_BSEARCH 1
 #define HAVE_ABS    1
 #define HAVE_ABS    1
 #define HAVE_BCOPY  1
 #define HAVE_BCOPY  1
 #define HAVE_MEMSET 1
 #define HAVE_MEMSET 1
@@ -67,10 +70,10 @@
 #define HAVE_STRLEN 1
 #define HAVE_STRLEN 1
 #define HAVE_STRLCPY    1
 #define HAVE_STRLCPY    1
 #define HAVE_STRLCAT    1
 #define HAVE_STRLCAT    1
-#define HAVE_STRDUP 1
 #define HAVE_STRCHR 1
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR    1
 #define HAVE_STRRCHR    1
 #define HAVE_STRSTR 1
 #define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
 #define HAVE_STRTOL 1
 #define HAVE_STRTOL 1
 #define HAVE_STRTOUL    1
 #define HAVE_STRTOUL    1
 #define HAVE_STRTOLL    1
 #define HAVE_STRTOLL    1
@@ -82,43 +85,77 @@
 #define HAVE_STRNCMP    1
 #define HAVE_STRNCMP    1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRNCASECMP 1
 #define HAVE_STRNCASECMP 1
+#define HAVE_STRCASESTR 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_VSNPRINTF  1
-#define HAVE_M_PI   1
+#define HAVE_ACOS   1
+#define HAVE_ACOSF  1
+#define HAVE_ASIN   1
+#define HAVE_ASINF  1
 #define HAVE_ATAN   1
 #define HAVE_ATAN   1
+#define HAVE_ATANF  1
 #define HAVE_ATAN2  1
 #define HAVE_ATAN2  1
-#define HAVE_ACOS  1
-#define HAVE_ASIN  1
+#define HAVE_ATAN2F 1
 #define HAVE_CEIL   1
 #define HAVE_CEIL   1
+#define HAVE_CEILF  1
 #define HAVE_COPYSIGN   1
 #define HAVE_COPYSIGN   1
+#define HAVE_COPYSIGNF  1
 #define HAVE_COS    1
 #define HAVE_COS    1
 #define HAVE_COSF   1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABS   1
+#define HAVE_FABSF  1
 #define HAVE_FLOOR  1
 #define HAVE_FLOOR  1
+#define HAVE_FLOORF 1
+#define HAVE_FMOD   1
+#define HAVE_FMODF  1
 #define HAVE_LOG    1
 #define HAVE_LOG    1
+#define HAVE_LOGF   1
+#define HAVE_LOG10  1
+#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
 #define HAVE_POW    1
 #define HAVE_POW    1
+#define HAVE_POWF   1
+#define HAVE_ROUND  1
+#define HAVE_ROUNDF 1
 #define HAVE_SCALBN 1
 #define HAVE_SCALBN 1
+#define HAVE_SCALBNF    1
 #define HAVE_SIN    1
 #define HAVE_SIN    1
 #define HAVE_SINF   1
 #define HAVE_SINF   1
 #define HAVE_SQRT   1
 #define HAVE_SQRT   1
 #define HAVE_SQRTF  1
 #define HAVE_SQRTF  1
 #define HAVE_TAN    1
 #define HAVE_TAN    1
 #define HAVE_TANF   1
 #define HAVE_TANF   1
+#define HAVE_TRUNC    1
+#define HAVE_TRUNCF   1
 #define HAVE_SIGACTION 1
 #define HAVE_SIGACTION 1
 #define HAVE_SETJMP 1
 #define HAVE_SETJMP 1
 #define HAVE_NANOSLEEP  1
 #define HAVE_NANOSLEEP  1
 #define HAVE_SYSCONF    1
 #define HAVE_SYSCONF    1
 #define HAVE_CLOCK_GETTIME  1
 #define HAVE_CLOCK_GETTIME  1
 
 
+#ifdef __LP64__
+#define SIZEOF_VOIDP 8
+#else
 #define SIZEOF_VOIDP 4
 #define SIZEOF_VOIDP 4
+#endif
 
 
 /* Enable various audio drivers */
 /* Enable various audio drivers */
 #define SDL_AUDIO_DRIVER_ANDROID    1
 #define SDL_AUDIO_DRIVER_ANDROID    1
+#define SDL_AUDIO_DRIVER_OPENSLES   1
+#define SDL_AUDIO_DRIVER_AAUDIO     1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 
 
 /* Enable various input drivers */
 /* Enable various input drivers */
 #define SDL_JOYSTICK_ANDROID    1
 #define SDL_JOYSTICK_ANDROID    1
-#define SDL_HAPTIC_ANDROID    1
+#define SDL_JOYSTICK_HIDAPI     1
+#define SDL_JOYSTICK_VIRTUAL    1
+#define SDL_HAPTIC_ANDROID  1
+
+/* Enable sensor driver */
+#define SDL_SENSOR_ANDROID  1
 
 
 /* Enable various shared object loading systems */
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_DLOPEN   1
 #define SDL_LOADSO_DLOPEN   1
@@ -154,4 +191,4 @@
 /* Enable the filesystem driver */
 /* Enable the filesystem driver */
 #define SDL_FILESYSTEM_ANDROID   1
 #define SDL_FILESYSTEM_ANDROID   1
 
 
-#endif /* SDL_config_android_h_ */
+#endif /* SDL_config_android_h_ */

+ 218 - 0
bsp/simulator/SDL2/include/SDL_config_emscripten.h

@@ -0,0 +1,218 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef _SDL_config_emscripten_h_
+#define _SDL_config_emscripten_h_
+
+#include "SDL_platform.h"
+
+/**
+ *  \file SDL_config_emscripten.h
+ *
+ *  This is a configuration that can be used to build SDL for Emscripten.
+ */
+
+#ifdef __LP64__
+#define SIZEOF_VOIDP 8
+#else
+#define SIZEOF_VOIDP 4
+#endif
+#define HAVE_GCC_ATOMICS 1
+
+/* Useful headers */
+#define STDC_HEADERS 1
+#define HAVE_ALLOCA_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_ICONV_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MATH_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_SIGNAL_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_WCHAR_H 1
+
+/* C library functions */
+#define HAVE_DLOPEN 1
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_GETENV 1
+#define HAVE_SETENV 1
+#define HAVE_PUTENV 1
+#define HAVE_UNSETENV 1
+#define HAVE_QSORT 1
+#define HAVE_BSEARCH 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_WCSLEN 1
+#define HAVE_WCSDUP 1
+#define HAVE_WCSSTR 1
+#define HAVE_WCSCMP 1
+#define HAVE_WCSNCMP 1
+#define HAVE_WCSCASECMP 1
+#define HAVE_WCSNCASECMP 1
+#define HAVE_STRLEN 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRLCAT 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_VSSCANF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_M_PI 1
+#define HAVE_ACOS 1
+#define HAVE_ACOSF 1
+#define HAVE_ASIN 1
+#define HAVE_ASINF 1
+#define HAVE_ATAN 1
+#define HAVE_ATANF 1
+#define HAVE_ATAN2 1
+#define HAVE_ATAN2F 1
+#define HAVE_CEIL 1
+#define HAVE_CEILF 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_COS 1
+#define HAVE_COSF 1
+#define HAVE_EXP 1
+#define HAVE_EXPF 1
+#define HAVE_FABS 1
+#define HAVE_FABSF 1
+#define HAVE_FLOOR 1
+#define HAVE_FLOORF 1
+#define HAVE_FMOD 1
+#define HAVE_FMODF 1
+#define HAVE_LOG 1
+#define HAVE_LOGF 1
+#define HAVE_LOG10 1
+#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
+#define HAVE_POW 1
+#define HAVE_POWF 1
+#define HAVE_ROUND  1
+#define HAVE_ROUNDF 1
+#define HAVE_SCALBN 1
+#define HAVE_SCALBNF 1
+#define HAVE_SIN 1
+#define HAVE_SINF 1
+#define HAVE_SQRT 1
+#define HAVE_SQRTF 1
+#define HAVE_TAN 1
+#define HAVE_TANF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
+#define HAVE_FSEEKO 1
+#define HAVE_FSEEKO64 1
+#define HAVE_SIGACTION 1
+#define HAVE_SA_SIGACTION 1
+#define HAVE_SETJMP 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_SYSCONF 1
+#define HAVE_CLOCK_GETTIME 1
+/* #undef HAVE_GETPAGESIZE */
+#define HAVE_MPROTECT 1
+#define HAVE_ICONV 1
+
+/* SDL internal assertion support */
+/* #undef SDL_DEFAULT_ASSERT_LEVEL */
+
+#define SDL_CPUINFO_DISABLED 1
+#define SDL_HAPTIC_DISABLED 1
+#define SDL_HIDAPI_DISABLED 1
+#ifndef __EMSCRIPTEN_PTHREADS__
+#define SDL_THREADS_DISABLED 1
+#endif
+
+/* Enable various audio drivers */
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1
+
+/* Enable various input drivers */
+#define SDL_JOYSTICK_EMSCRIPTEN 1
+
+/* Enable various sensor drivers */
+#define SDL_SENSOR_DUMMY 1
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_DLOPEN 1
+
+/* Enable various threading systems */
+#ifdef __EMSCRIPTEN_PTHREADS__
+#define SDL_THREAD_PTHREAD 1
+#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
+#endif
+
+/* Enable various timer systems */
+#define SDL_TIMER_UNIX 1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_EMSCRIPTEN 1
+
+#define SDL_VIDEO_RENDER_OGL_ES2 1
+
+/* Enable OpenGL support */
+/* #undef SDL_VIDEO_OPENGL */
+/* #undef SDL_VIDEO_OPENGL_ES */
+#define SDL_VIDEO_OPENGL_ES2 1
+/* #undef SDL_VIDEO_OPENGL_BGL */
+/* #undef SDL_VIDEO_OPENGL_CGL */
+/* #undef SDL_VIDEO_OPENGL_GLX */
+/* #undef SDL_VIDEO_OPENGL_WGL */
+#define SDL_VIDEO_OPENGL_EGL 1
+/* #undef SDL_VIDEO_OPENGL_OSMESA */
+/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
+
+/* Enable system power support */
+#define SDL_POWER_EMSCRIPTEN 1
+
+/* Enable system filesystem support */
+#define SDL_FILESYSTEM_EMSCRIPTEN 1
+
+#endif /* _SDL_config_emscripten_h_ */

+ 73 - 22
bsp/simulator/SDL2/include/SDL_config_iphoneos.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -33,18 +33,22 @@
 
 
 #define HAVE_GCC_ATOMICS    1
 #define HAVE_GCC_ATOMICS    1
 
 
-#define HAVE_ALLOCA_H       1
-#define HAVE_SYS_TYPES_H    1
-#define HAVE_STDIO_H    1
 #define STDC_HEADERS    1
 #define STDC_HEADERS    1
-#define HAVE_STRING_H   1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H   1
+#define HAVE_ALLOCA_H       1
 #define HAVE_CTYPE_H    1
 #define HAVE_CTYPE_H    1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H   1
 #define HAVE_MATH_H 1
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H   1
 #define HAVE_SIGNAL_H   1
+#define HAVE_STDINT_H   1
+#define HAVE_STDIO_H    1
+#define HAVE_STRING_H   1
+#define HAVE_SYS_TYPES_H    1
+/* The libunwind functions are only available on x86 */
+/* #undef HAVE_LIBUNWIND_H */
 
 
 /* C library functions */
 /* C library functions */
+#define HAVE_DLOPEN 1
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC    1
 #define HAVE_REALLOC    1
@@ -56,6 +60,7 @@
 #define HAVE_SETENV 1
 #define HAVE_SETENV 1
 #define HAVE_UNSETENV   1
 #define HAVE_UNSETENV   1
 #define HAVE_QSORT  1
 #define HAVE_QSORT  1
+#define HAVE_BSEARCH 1
 #define HAVE_ABS    1
 #define HAVE_ABS    1
 #define HAVE_BCOPY  1
 #define HAVE_BCOPY  1
 #define HAVE_MEMSET 1
 #define HAVE_MEMSET 1
@@ -65,10 +70,10 @@
 #define HAVE_STRLEN 1
 #define HAVE_STRLEN 1
 #define HAVE_STRLCPY    1
 #define HAVE_STRLCPY    1
 #define HAVE_STRLCAT    1
 #define HAVE_STRLCAT    1
-#define HAVE_STRDUP 1
 #define HAVE_STRCHR 1
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR    1
 #define HAVE_STRRCHR    1
 #define HAVE_STRSTR 1
 #define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
 #define HAVE_STRTOL 1
 #define HAVE_STRTOL 1
 #define HAVE_STRTOUL    1
 #define HAVE_STRTOUL    1
 #define HAVE_STRTOLL    1
 #define HAVE_STRTOLL    1
@@ -80,33 +85,58 @@
 #define HAVE_STRNCMP    1
 #define HAVE_STRNCMP    1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRNCASECMP 1
 #define HAVE_STRNCASECMP 1
+#define HAVE_STRCASESTR 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_VSNPRINTF  1
 #define HAVE_M_PI   1
 #define HAVE_M_PI   1
+#define HAVE_ACOS   1
+#define HAVE_ACOSF  1
+#define HAVE_ASIN   1
+#define HAVE_ASINF  1
 #define HAVE_ATAN   1
 #define HAVE_ATAN   1
+#define HAVE_ATANF  1
 #define HAVE_ATAN2  1
 #define HAVE_ATAN2  1
-#define HAVE_ACOS  1
-#define HAVE_ASIN  1
+#define HAVE_ATAN2F 1
 #define HAVE_CEIL   1
 #define HAVE_CEIL   1
+#define HAVE_CEILF  1
 #define HAVE_COPYSIGN   1
 #define HAVE_COPYSIGN   1
+#define HAVE_COPYSIGNF  1
 #define HAVE_COS    1
 #define HAVE_COS    1
 #define HAVE_COSF   1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABS   1
+#define HAVE_FABSF  1
 #define HAVE_FLOOR  1
 #define HAVE_FLOOR  1
+#define HAVE_FLOORF 1
+#define HAVE_FMOD   1
+#define HAVE_FMODF  1
 #define HAVE_LOG    1
 #define HAVE_LOG    1
+#define HAVE_LOGF   1
+#define HAVE_LOG10  1
+#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
 #define HAVE_POW    1
 #define HAVE_POW    1
+#define HAVE_POWF   1
+#define HAVE_ROUND  1
+#define HAVE_ROUNDF 1
 #define HAVE_SCALBN 1
 #define HAVE_SCALBN 1
+#define HAVE_SCALBNF    1
 #define HAVE_SIN    1
 #define HAVE_SIN    1
 #define HAVE_SINF   1
 #define HAVE_SINF   1
 #define HAVE_SQRT   1
 #define HAVE_SQRT   1
 #define HAVE_SQRTF  1
 #define HAVE_SQRTF  1
 #define HAVE_TAN    1
 #define HAVE_TAN    1
 #define HAVE_TANF   1
 #define HAVE_TANF   1
+#define HAVE_TRUNC  1
+#define HAVE_TRUNCF 1
 #define HAVE_SIGACTION  1
 #define HAVE_SIGACTION  1
 #define HAVE_SETJMP 1
 #define HAVE_SETJMP 1
 #define HAVE_NANOSLEEP  1
 #define HAVE_NANOSLEEP  1
 #define HAVE_SYSCONF    1
 #define HAVE_SYSCONF    1
 #define HAVE_SYSCTLBYNAME 1
 #define HAVE_SYSCTLBYNAME 1
+#define HAVE_O_CLOEXEC 1
 
 
 /* enable iPhone version of Core Audio driver */
 /* enable iPhone version of Core Audio driver */
 #define SDL_AUDIO_DRIVER_COREAUDIO 1
 #define SDL_AUDIO_DRIVER_COREAUDIO 1
@@ -116,8 +146,18 @@
 /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
 /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
 #define SDL_HAPTIC_DUMMY 1
 #define SDL_HAPTIC_DUMMY 1
 
 
-/* Enable MFi joystick support */
+/* Enable joystick support */
+/* Only enable HIDAPI support if you want to support Steam Controllers on iOS and tvOS */
+/*#define SDL_JOYSTICK_HIDAPI 1*/
 #define SDL_JOYSTICK_MFI 1
 #define SDL_JOYSTICK_MFI 1
+#define SDL_JOYSTICK_VIRTUAL    1
+
+#ifdef __TVOS__
+#define SDL_SENSOR_DUMMY    1
+#else
+/* Enable the CoreMotion sensor driver */
+#define SDL_SENSOR_COREMOTION   1
+#endif
 
 
 /* Enable Unix style SO loading */
 /* Enable Unix style SO loading */
 #define SDL_LOADSO_DLOPEN 1
 #define SDL_LOADSO_DLOPEN 1
@@ -133,17 +173,33 @@
 #define SDL_VIDEO_DRIVER_UIKIT  1
 #define SDL_VIDEO_DRIVER_UIKIT  1
 #define SDL_VIDEO_DRIVER_DUMMY  1
 #define SDL_VIDEO_DRIVER_DUMMY  1
 
 
-/* enable OpenGL ES */
+/* Enable OpenGL ES */
+#if !TARGET_OS_MACCATALYST
 #define SDL_VIDEO_OPENGL_ES2 1
 #define SDL_VIDEO_OPENGL_ES2 1
 #define SDL_VIDEO_OPENGL_ES 1
 #define SDL_VIDEO_OPENGL_ES 1
 #define SDL_VIDEO_RENDER_OGL_ES 1
 #define SDL_VIDEO_RENDER_OGL_ES 1
 #define SDL_VIDEO_RENDER_OGL_ES2    1
 #define SDL_VIDEO_RENDER_OGL_ES2    1
+#endif
 
 
-/* Enable Vulkan support */
-#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM // Only 64-bit devices have Metal
-#define SDL_VIDEO_VULKAN 1
+/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer
+   Also supported in simulator from iOS 13.0 and tvOS 13.0
+ */
+#if (TARGET_OS_SIMULATOR && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (__TV_OS_VERSION_MIN_REQUIRED >= 130000))) || (!TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)))
+#define SDL_PLATFORM_SUPPORTS_METAL 1
 #else
 #else
-#define SDL_VIDEO_VULKAN 0
+#define SDL_PLATFORM_SUPPORTS_METAL 0
+#endif
+
+#if SDL_PLATFORM_SUPPORTS_METAL
+#define SDL_VIDEO_RENDER_METAL  1
+#endif
+
+#if SDL_PLATFORM_SUPPORTS_METAL
+#define SDL_VIDEO_VULKAN 1
+#endif
+
+#if SDL_PLATFORM_SUPPORTS_METAL
+#define SDL_VIDEO_METAL 1
 #endif
 #endif
 
 
 /* Enable system power support */
 /* Enable system power support */
@@ -155,12 +211,7 @@
 /* enable iOS extended launch screen */
 /* enable iOS extended launch screen */
 #define SDL_IPHONE_LAUNCHSCREEN 1
 #define SDL_IPHONE_LAUNCHSCREEN 1
 
 
-/* Set max recognized G-force from accelerometer
-   See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed
- */
-#define SDL_IPHONE_MAX_GFORCE 5.0
-
 /* enable filesystem support */
 /* enable filesystem support */
 #define SDL_FILESYSTEM_COCOA   1
 #define SDL_FILESYSTEM_COCOA   1
 
 
-#endif /* SDL_config_iphoneos_h_ */
+#endif /* SDL_config_iphoneos_h_ */

+ 108 - 28
bsp/simulator/SDL2/include/SDL_config_macosx.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -37,18 +37,22 @@
 #endif
 #endif
 
 
 /* Useful headers */
 /* Useful headers */
-#define HAVE_ALLOCA_H       1
-#define HAVE_SYS_TYPES_H    1
-#define HAVE_STDIO_H    1
 #define STDC_HEADERS    1
 #define STDC_HEADERS    1
-#define HAVE_STRING_H   1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H   1
+#define HAVE_ALLOCA_H       1
 #define HAVE_CTYPE_H    1
 #define HAVE_CTYPE_H    1
+#define HAVE_FLOAT_H    1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H   1
 #define HAVE_MATH_H 1
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H   1
 #define HAVE_SIGNAL_H   1
+#define HAVE_STDINT_H   1
+#define HAVE_STDIO_H    1
+#define HAVE_STRING_H   1
+#define HAVE_SYS_TYPES_H    1
+#define HAVE_LIBUNWIND_H    1
 
 
 /* C library functions */
 /* C library functions */
+#define HAVE_DLOPEN 1
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC    1
 #define HAVE_REALLOC    1
@@ -59,6 +63,7 @@
 #define HAVE_PUTENV 1
 #define HAVE_PUTENV 1
 #define HAVE_UNSETENV   1
 #define HAVE_UNSETENV   1
 #define HAVE_QSORT  1
 #define HAVE_QSORT  1
+#define HAVE_BSEARCH 1
 #define HAVE_ABS    1
 #define HAVE_ABS    1
 #define HAVE_BCOPY  1
 #define HAVE_BCOPY  1
 #define HAVE_MEMSET 1
 #define HAVE_MEMSET 1
@@ -68,10 +73,10 @@
 #define HAVE_STRLEN 1
 #define HAVE_STRLEN 1
 #define HAVE_STRLCPY    1
 #define HAVE_STRLCPY    1
 #define HAVE_STRLCAT    1
 #define HAVE_STRLCAT    1
-#define HAVE_STRDUP 1
 #define HAVE_STRCHR 1
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR    1
 #define HAVE_STRRCHR    1
 #define HAVE_STRSTR 1
 #define HAVE_STRSTR 1
+#define HAVE_STRTOK_R 1
 #define HAVE_STRTOL 1
 #define HAVE_STRTOL 1
 #define HAVE_STRTOUL    1
 #define HAVE_STRTOUL    1
 #define HAVE_STRTOLL    1
 #define HAVE_STRTOLL    1
@@ -83,32 +88,69 @@
 #define HAVE_STRNCMP    1
 #define HAVE_STRNCMP    1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRCASECMP 1
 #define HAVE_STRNCASECMP 1
 #define HAVE_STRNCASECMP 1
+#define HAVE_STRCASESTR 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSNPRINTF  1
 #define HAVE_VSNPRINTF  1
+#define HAVE_M_PI   1
+#define HAVE_ACOS   1
+#define HAVE_ACOSF  1
+#define HAVE_ASIN   1
+#define HAVE_ASINF  1
+#define HAVE_ATAN   1
+#define HAVE_ATANF  1
+#define HAVE_ATAN2  1
+#define HAVE_ATAN2F 1
 #define HAVE_CEIL   1
 #define HAVE_CEIL   1
+#define HAVE_CEILF  1
 #define HAVE_COPYSIGN   1
 #define HAVE_COPYSIGN   1
+#define HAVE_COPYSIGNF  1
 #define HAVE_COS    1
 #define HAVE_COS    1
 #define HAVE_COSF   1
 #define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
 #define HAVE_FABS   1
 #define HAVE_FABS   1
+#define HAVE_FABSF  1
 #define HAVE_FLOOR  1
 #define HAVE_FLOOR  1
+#define HAVE_FLOORF 1
+#define HAVE_FMOD   1
+#define HAVE_FMODF  1
 #define HAVE_LOG    1
 #define HAVE_LOG    1
+#define HAVE_LOGF   1
+#define HAVE_LOG10  1
+#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
 #define HAVE_POW    1
 #define HAVE_POW    1
+#define HAVE_POWF   1
+#define HAVE_ROUND  1
+#define HAVE_ROUNDF 1
 #define HAVE_SCALBN 1
 #define HAVE_SCALBN 1
+#define HAVE_SCALBNF    1
 #define HAVE_SIN    1
 #define HAVE_SIN    1
 #define HAVE_SINF   1
 #define HAVE_SINF   1
 #define HAVE_SQRT   1
 #define HAVE_SQRT   1
 #define HAVE_SQRTF  1
 #define HAVE_SQRTF  1
 #define HAVE_TAN    1
 #define HAVE_TAN    1
 #define HAVE_TANF   1
 #define HAVE_TANF   1
+#define HAVE_TRUNC    1
+#define HAVE_TRUNCF   1
 #define HAVE_SIGACTION  1
 #define HAVE_SIGACTION  1
 #define HAVE_SETJMP 1
 #define HAVE_SETJMP 1
 #define HAVE_NANOSLEEP  1
 #define HAVE_NANOSLEEP  1
 #define HAVE_SYSCONF    1
 #define HAVE_SYSCONF    1
 #define HAVE_SYSCTLBYNAME 1
 #define HAVE_SYSCTLBYNAME 1
-#define HAVE_ATAN 1
-#define HAVE_ATAN2 1
-#define HAVE_ACOS 1
-#define HAVE_ASIN 1
+
+#if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
+# if __has_include(<immintrin.h>)
+#   define HAVE_IMMINTRIN_H 1
+# endif
+#endif
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
+#define HAVE_O_CLOEXEC 1
+#endif
+
+#define HAVE_GCC_ATOMICS 1
 
 
 /* Enable various audio drivers */
 /* Enable various audio drivers */
 #define SDL_AUDIO_DRIVER_COREAUDIO  1
 #define SDL_AUDIO_DRIVER_COREAUDIO  1
@@ -116,9 +158,19 @@
 #define SDL_AUDIO_DRIVER_DUMMY  1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 
 
 /* Enable various input drivers */
 /* Enable various input drivers */
+#define SDL_JOYSTICK_HIDAPI 1
 #define SDL_JOYSTICK_IOKIT  1
 #define SDL_JOYSTICK_IOKIT  1
+#define SDL_JOYSTICK_VIRTUAL    1
 #define SDL_HAPTIC_IOKIT    1
 #define SDL_HAPTIC_IOKIT    1
 
 
+/* The MFI controller support requires ARC Objective C runtime */
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)
+#define SDL_JOYSTICK_MFI 1
+#endif
+
+/* Enable the dummy sensor driver */
+#define SDL_SENSOR_DUMMY  1
+
 /* Enable various shared object loading systems */
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_DLOPEN   1
 #define SDL_LOADSO_DLOPEN   1
 
 
@@ -133,19 +185,15 @@
 #define SDL_VIDEO_DRIVER_COCOA  1
 #define SDL_VIDEO_DRIVER_COCOA  1
 #define SDL_VIDEO_DRIVER_DUMMY  1
 #define SDL_VIDEO_DRIVER_DUMMY  1
 #undef SDL_VIDEO_DRIVER_X11
 #undef SDL_VIDEO_DRIVER_X11
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
 #define SDL_VIDEO_DRIVER_X11_XDBE 1
 #define SDL_VIDEO_DRIVER_X11_XDBE 1
-#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
 #define SDL_VIDEO_DRIVER_X11_XRANDR 1
 #define SDL_VIDEO_DRIVER_X11_XRANDR 1
 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
-#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
 #define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
 #define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
 
 
 #ifdef MAC_OS_X_VERSION_10_8
 #ifdef MAC_OS_X_VERSION_10_8
@@ -156,17 +204,41 @@
  */
  */
 #define SDL_VIDEO_DRIVER_X11_XINPUT2 1
 #define SDL_VIDEO_DRIVER_X11_XINPUT2 1
 #define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
 #define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
-#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
 #endif
 #endif
 
 
 #ifndef SDL_VIDEO_RENDER_OGL
 #ifndef SDL_VIDEO_RENDER_OGL
 #define SDL_VIDEO_RENDER_OGL    1
 #define SDL_VIDEO_RENDER_OGL    1
 #endif
 #endif
 
 
+#ifndef SDL_VIDEO_RENDER_OGL_ES2
+#define SDL_VIDEO_RENDER_OGL_ES2 1
+#endif
+
+/* Metal only supported on 64-bit architectures with 10.11+ */
+#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
+#define SDL_PLATFORM_SUPPORTS_METAL    1
+#else
+#define SDL_PLATFORM_SUPPORTS_METAL    0
+#endif
+
+#ifndef SDL_VIDEO_RENDER_METAL
+#if SDL_PLATFORM_SUPPORTS_METAL
+#define SDL_VIDEO_RENDER_METAL    1
+#else
+#define SDL_VIDEO_RENDER_METAL    0
+#endif
+#endif
+
 /* Enable OpenGL support */
 /* Enable OpenGL support */
 #ifndef SDL_VIDEO_OPENGL
 #ifndef SDL_VIDEO_OPENGL
 #define SDL_VIDEO_OPENGL    1
 #define SDL_VIDEO_OPENGL    1
 #endif
 #endif
+#ifndef SDL_VIDEO_OPENGL_ES2
+#define SDL_VIDEO_OPENGL_ES2    1
+#endif
+#ifndef SDL_VIDEO_OPENGL_EGL
+#define SDL_VIDEO_OPENGL_EGL    1
+#endif
 #ifndef SDL_VIDEO_OPENGL_CGL
 #ifndef SDL_VIDEO_OPENGL_CGL
 #define SDL_VIDEO_OPENGL_CGL    1
 #define SDL_VIDEO_OPENGL_CGL    1
 #endif
 #endif
@@ -174,12 +246,21 @@
 #define SDL_VIDEO_OPENGL_GLX    1
 #define SDL_VIDEO_OPENGL_GLX    1
 #endif
 #endif
 
 
-/* Enable Vulkan support */
-/* Metal/MoltenVK/Vulkan only supported on 64-bit architectures with 10.11+ */
-#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
+/* Enable Vulkan and Metal support */
+#ifndef SDL_VIDEO_VULKAN
+#if SDL_PLATFORM_SUPPORTS_METAL
 #define SDL_VIDEO_VULKAN 1
 #define SDL_VIDEO_VULKAN 1
 #else
 #else
-#define  SDL_VIDEO_VULKAN 0
+#define SDL_VIDEO_VULKAN 0
+#endif
+#endif
+
+#ifndef SDL_VIDEO_METAL
+#if SDL_PLATFORM_SUPPORTS_METAL
+#define SDL_VIDEO_METAL 1
+#else
+#define SDL_VIDEO_METAL 0
+#endif
 #endif
 #endif
 
 
 /* Enable system power support */
 /* Enable system power support */
@@ -189,9 +270,8 @@
 #define SDL_FILESYSTEM_COCOA   1
 #define SDL_FILESYSTEM_COCOA   1
 
 
 /* Enable assembly routines */
 /* Enable assembly routines */
-#define SDL_ASSEMBLY_ROUTINES   1
 #ifdef __ppc__
 #ifdef __ppc__
 #define SDL_ALTIVEC_BLITTERS    1
 #define SDL_ALTIVEC_BLITTERS    1
 #endif
 #endif
 
 
-#endif /* SDL_config_macosx_h_ */
+#endif /* SDL_config_macosx_h_ */

+ 26 - 13
bsp/simulator/SDL2/include/SDL_config_minimal.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -34,22 +34,29 @@
 #define HAVE_STDARG_H   1
 #define HAVE_STDARG_H   1
 #define HAVE_STDDEF_H   1
 #define HAVE_STDDEF_H   1
 
 
+#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
 /* Most everything except Visual Studio 2008 and earlier has stdint.h now */
 /* Most everything except Visual Studio 2008 and earlier has stdint.h now */
 #if defined(_MSC_VER) && (_MSC_VER < 1600)
 #if defined(_MSC_VER) && (_MSC_VER < 1600)
-/* Here are some reasonable defaults */
-typedef unsigned int size_t;
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-typedef unsigned long uintptr_t;
+typedef signed __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef signed __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef signed __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef signed __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#ifndef _UINTPTR_T_DEFINED
+#ifdef  _WIN64
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
 #else
 #else
 #define HAVE_STDINT_H 1
 #define HAVE_STDINT_H 1
 #endif /* Visual Studio 2008 */
 #endif /* Visual Studio 2008 */
+#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
 
 
 #ifdef __GNUC__
 #ifdef __GNUC__
 #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
 #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
@@ -64,6 +71,12 @@ typedef unsigned long uintptr_t;
 /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
 /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
 #define SDL_HAPTIC_DISABLED 1
 #define SDL_HAPTIC_DISABLED 1
 
 
+/* Enable the stub HIDAPI */
+#define SDL_HIDAPI_DISABLED 1
+
+/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */
+#define SDL_SENSOR_DISABLED 1
+
 /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
 /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
 #define SDL_LOADSO_DISABLED 1
 #define SDL_LOADSO_DISABLED 1
 
 
@@ -79,4 +92,4 @@ typedef unsigned long uintptr_t;
 /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */
 /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */
 #define SDL_FILESYSTEM_DUMMY  1
 #define SDL_FILESYSTEM_DUMMY  1
 
 
-#endif /* SDL_config_minimal_h_ */
+#endif /* SDL_config_minimal_h_ */

+ 89 - 0
bsp/simulator/SDL2/include/SDL_config_ngage.h

@@ -0,0 +1,89 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef SDL_config_ngage_h_
+#define SDL_config_ngage_h_
+#define SDL_config_h_
+
+#include "SDL_platform.h"
+
+typedef signed char        int8_t;
+typedef unsigned char      uint8_t;
+typedef signed short       int16_t;
+typedef unsigned short     uint16_t;
+typedef signed int         int32_t;
+typedef unsigned int       uint32_t;
+typedef signed long long   int64_t;
+typedef unsigned long long uint64_t;
+typedef unsigned long      uintptr_t;
+
+#define HAVE_STDARG_H    1
+#define HAVE_STDDEF_H    1
+#define HAVE_STDIO_H     1
+#define HAVE_STDLIB_H    1
+#define HAVE_MATH_H      1
+#define HAVE_CEIL        1
+#define HAVE_COPYSIGN    1
+#define HAVE_COS         1
+#define HAVE_EXP         1
+#define HAVE_FABS        1
+#define HAVE_FLOOR       1
+#define HAVE_LOG         1
+#define HAVE_LOG10       1
+#define HAVE_SCALBN      1
+#define HAVE_SIN         1
+#define HAVE_SQRT        1
+#define HAVE_TAN         1
+#define HAVE_MALLOC      1
+#define SDL_MAIN_NEEDED  1
+#define LACKS_SYS_MMAN_H 1
+
+/* Enable the N-Gage thread support (src/thread/ngage/\*.c) */
+#define SDL_THREAD_NGAGE 1
+
+/* Enable the N-Gage timer support (src/timer/ngage/\*.c) */
+#define SDL_TIMER_NGAGE  1
+
+/* Enable the N-Gage video driver (src/video/ngage/\*.c) */
+#define SDL_VIDEO_DRIVER_NGAGE 1
+
+/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
+#define SDL_AUDIO_DRIVER_DUMMY  1
+
+/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
+#define SDL_JOYSTICK_DISABLED   1
+
+/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
+#define SDL_HAPTIC_DISABLED 1
+
+/* Enable the stub HIDAPI */
+#define SDL_HIDAPI_DISABLED 1
+
+/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */
+#define SDL_SENSOR_DISABLED 1
+
+/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
+#define SDL_LOADSO_DISABLED 1
+
+/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */
+#define SDL_FILESYSTEM_DUMMY 1
+
+#endif /* SDL_config_ngage_h_ */

+ 204 - 0
bsp/simulator/SDL2/include/SDL_config_os2.h

@@ -0,0 +1,204 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef SDL_config_os2_h_
+#define SDL_config_os2_h_
+#define SDL_config_h_
+
+#include "SDL_platform.h"
+
+#define SIZEOF_VOIDP 4
+
+#define SDL_AUDIO_DRIVER_DUMMY 1
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_OS2 1
+
+#define SDL_POWER_DISABLED  1
+#define SDL_HAPTIC_DISABLED 1
+
+#define SDL_SENSOR_DUMMY 1
+#define SDL_VIDEO_DRIVER_DUMMY 1
+#define SDL_VIDEO_DRIVER_OS2 1
+#define SDL_JOYSTICK_OS2 1
+#ifndef HAVE_LIBUSB_H  /* see Makefile */
+#define SDL_HIDAPI_DISABLED 1
+/*#undef SDL_JOYSTICK_HIDAPI */
+#else
+#define SDL_JOYSTICK_HIDAPI 1
+#define HAVE_LIBUSB 1
+/* dynamically loaded libusb-1.0 dll: */
+#define SDL_LIBUSB_DYNAMIC "usb100.dll"
+#endif
+#define SDL_JOYSTICK_VIRTUAL 1
+
+/* Enable OpenGL support */
+/* #undef SDL_VIDEO_OPENGL */
+
+#define SDL_THREAD_OS2 1
+#define SDL_LOADSO_OS2 1
+#define SDL_TIMER_OS2 1
+#define SDL_FILESYSTEM_OS2 1
+
+/* use libsamplerate for audio rate conversion. */
+/*#define HAVE_LIBSAMPLERATE_H 1 */
+
+/* Enable dynamic libsamplerate support */
+#define SDL_LIBSAMPLERATE_DYNAMIC "SAMPRATE.DLL"
+
+#define HAVE_LIBC 1
+
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
+#define HAVE_STDINT_H 1
+
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STDLIB_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_WCHAR_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_FLOAT_H 1
+#define HAVE_SIGNAL_H 1
+
+#if 0 /* see Makefile */
+#define HAVE_ICONV 1
+#define HAVE_ICONV_H 1
+#endif
+
+/* #undef HAVE_DLOPEN */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#if defined(__WATCOMC__)
+#define HAVE__FSEEKI64 1
+#define HAVE__FTELLI64 1
+#endif
+#define HAVE_ALLOCA 1
+#define HAVE_GETENV 1
+#define HAVE_SETENV 1
+#define HAVE_PUTENV 1
+/* OpenWatcom requires specific calling conventions for qsort and bsearch */
+#ifndef __WATCOMC__
+#define HAVE_QSORT 1
+#define HAVE_BSEARCH 1
+#endif
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_WCSCMP 1
+#define HAVE__WCSICMP 1
+#define HAVE__WCSNICMP 1
+#define HAVE_WCSLEN 1
+#define HAVE_WCSLCPY 1
+#define HAVE_WCSLCAT 1
+/* #undef HAVE_WCSDUP */
+#define HAVE__WCSDUP 1
+#define HAVE_WCSSTR 1
+#define HAVE_WCSCMP 1
+#define HAVE_WCSNCMP 1
+#define HAVE_STRLEN 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRLCAT 1
+#define HAVE__STRREV 1
+#define HAVE__STRUPR 1
+#define HAVE__STRLWR 1
+/* #undef HAVE_INDEX */
+/* #undef HAVE_RINDEX */
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+/* #undef HAVE_STRTOK_R */
+#define HAVE_ITOA 1
+#define HAVE__LTOA 1
+#define HAVE__ULTOA 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE__I64TOA 1
+#define HAVE__UI64TOA 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE_STRICMP 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF  1
+#define HAVE_VSSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_SETJMP 1
+#define HAVE_ACOS 1
+/* #undef HAVE_ACOSF */
+#define HAVE_ASIN 1
+/* #undef HAVE_ASINF */
+#define HAVE_ATAN 1
+#define HAVE_ATAN2 1
+/* #undef HAVE_ATAN2F */
+#define HAVE_CEIL 1
+/* #undef HAVE_CEILF */
+/* #undef HAVE_COPYSIGN */
+/* #undef HAVE_COPYSIGNF */
+#define HAVE_COS 1
+/* #undef HAVE_COSF */
+#define HAVE_EXP 1
+/* #undef HAVE_EXPF */
+#define HAVE_FABS 1
+/* #undef HAVE_FABSF */
+#define HAVE_FLOOR 1
+/* #undef HAVE_FLOORF */
+#define HAVE_FMOD 1
+/* #undef HAVE_FMODF */
+#define HAVE_LOG 1
+/* #undef HAVE_LOGF */
+#define HAVE_LOG10 1
+/* #undef HAVE_LOG10F */
+#define HAVE_POW 1
+/* #undef HAVE_POWF */
+#define HAVE_SIN 1
+/* #undef HAVE_SINF */
+/* #undef HAVE_SCALBN */
+/* #undef HAVE_SCALBNF */
+#define HAVE_SQRT 1
+/* #undef HAVE_SQRTF */
+#define HAVE_TAN 1
+/* #undef HAVE_TANF */
+/* #undef HAVE_TRUNC */
+/* #undef HAVE_TRUNCF */
+/* #undef HAVE_LROUND */
+/* #undef HAVE_LROUNDF */
+/* #undef HAVE_ROUND */
+/* #undef HAVE_ROUNDF */
+
+#endif /* SDL_config_os2_h_ */

+ 29 - 16
bsp/simulator/SDL2/include/SDL_config_pandora.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -36,22 +36,25 @@
 
 
 #define SDL_BYTEORDER 1234
 #define SDL_BYTEORDER 1234
 
 
-#define HAVE_ALLOCA_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_STDIO_H 1
 #define STDC_HEADERS 1
 #define STDC_HEADERS 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
+#define HAVE_ALLOCA_H 1
 #define HAVE_CTYPE_H 1
 #define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
 #define HAVE_ICONV_H 1
 #define HAVE_ICONV_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MATH_H 1
+#define HAVE_MEMORY_H 1
 #define HAVE_SIGNAL_H 1
 #define HAVE_SIGNAL_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYS_TYPES_H 1
+
+#define HAVE_DLOPEN 1
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC 1
 #define HAVE_REALLOC 1
@@ -62,13 +65,13 @@
 #define HAVE_PUTENV 1
 #define HAVE_PUTENV 1
 #define HAVE_UNSETENV 1
 #define HAVE_UNSETENV 1
 #define HAVE_QSORT 1
 #define HAVE_QSORT 1
+#define HAVE_BSEARCH 1
 #define HAVE_ABS 1
 #define HAVE_ABS 1
 #define HAVE_BCOPY 1
 #define HAVE_BCOPY 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMCPY 1
 #define HAVE_MEMCPY 1
 #define HAVE_MEMMOVE 1
 #define HAVE_MEMMOVE 1
 #define HAVE_STRLEN 1
 #define HAVE_STRLEN 1
-#define HAVE_STRDUP 1
 #define HAVE_STRCHR 1
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRSTR 1
 #define HAVE_STRSTR 1
@@ -89,9 +92,15 @@
 #define HAVE_COPYSIGN 1
 #define HAVE_COPYSIGN 1
 #define HAVE_COS 1
 #define HAVE_COS 1
 #define HAVE_COSF 1
 #define HAVE_COSF 1
+#define HAVE_EXP 1
 #define HAVE_FABS 1
 #define HAVE_FABS 1
 #define HAVE_FLOOR 1
 #define HAVE_FLOOR 1
 #define HAVE_LOG 1
 #define HAVE_LOG 1
+#define HAVE_LOG10 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
 #define HAVE_SCALBN 1
 #define HAVE_SCALBN 1
 #define HAVE_SIN 1
 #define HAVE_SIN 1
 #define HAVE_SINF 1
 #define HAVE_SINF 1
@@ -99,6 +108,8 @@
 #define HAVE_SQRTF 1
 #define HAVE_SQRTF 1
 #define HAVE_TAN 1
 #define HAVE_TAN 1
 #define HAVE_TANF 1
 #define HAVE_TANF 1
+#define HAVE_TRUNC 1
+#define HAVE_TRUNCF 1
 #define HAVE_SIGACTION 1
 #define HAVE_SIGACTION 1
 #define HAVE_SETJMP 1
 #define HAVE_SETJMP 1
 #define HAVE_NANOSLEEP 1
 #define HAVE_NANOSLEEP 1
@@ -107,10 +118,12 @@
 #define SDL_AUDIO_DRIVER_OSS 1
 #define SDL_AUDIO_DRIVER_OSS 1
 
 
 #define SDL_INPUT_LINUXEV 1
 #define SDL_INPUT_LINUXEV 1
-#define SDL_INPUT_TSLIB 1
 #define SDL_JOYSTICK_LINUX 1
 #define SDL_JOYSTICK_LINUX 1
+#define SDL_JOYSTICK_VIRTUAL 1
 #define SDL_HAPTIC_LINUX 1
 #define SDL_HAPTIC_LINUX 1
 
 
+#define SDL_SENSOR_DUMMY 1
+
 #define SDL_LOADSO_DLOPEN 1
 #define SDL_LOADSO_DLOPEN 1
 
 
 #define SDL_THREAD_PTHREAD 1
 #define SDL_THREAD_PTHREAD 1
@@ -125,4 +138,4 @@
 #define SDL_VIDEO_RENDER_OGL_ES 1
 #define SDL_VIDEO_RENDER_OGL_ES 1
 #define SDL_VIDEO_OPENGL_ES 1
 #define SDL_VIDEO_OPENGL_ES 1
 
 
-#endif /* SDL_config_pandora_h_ */
+#endif /* SDL_config_pandora_h_ */

+ 0 - 144
bsp/simulator/SDL2/include/SDL_config_psp.h

@@ -1,144 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_config_psp_h_
-#define SDL_config_psp_h_
-#define SDL_config_h_
-
-#include "SDL_platform.h"
-
-
-
-#ifdef __GNUC__
-#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
-#endif
-
-#define HAVE_GCC_ATOMICS    1
-
-#define HAVE_ALLOCA_H       1
-#define HAVE_SYS_TYPES_H    1
-#define HAVE_STDIO_H    1
-#define STDC_HEADERS    1
-#define HAVE_STRING_H   1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H   1
-#define HAVE_CTYPE_H    1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H   1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC    1
-#define HAVE_FREE   1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_SETENV 1
-#define HAVE_UNSETENV   1
-#define HAVE_QSORT  1
-#define HAVE_ABS    1
-#define HAVE_BCOPY  1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE    1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRLCPY    1
-#define HAVE_STRLCAT    1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR    1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL    1
-#define HAVE_STRTOLL    1
-#define HAVE_STRTOULL   1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI   1
-#define HAVE_ATOF   1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP    1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_VSSCANF 1
-#define HAVE_VSNPRINTF  1
-#define HAVE_M_PI   1
-#define HAVE_ATAN   1
-#define HAVE_ATAN2  1
-#define HAVE_ACOS  1
-#define HAVE_ASIN  1
-#define HAVE_CEIL   1
-#define HAVE_COPYSIGN   1
-#define HAVE_COS    1
-#define HAVE_COSF   1
-#define HAVE_FABS   1
-#define HAVE_FLOOR  1
-#define HAVE_LOG    1
-#define HAVE_POW    1
-#define HAVE_SCALBN 1
-#define HAVE_SIN    1
-#define HAVE_SINF   1
-#define HAVE_SQRT   1
-#define HAVE_SQRTF  1
-#define HAVE_TAN    1
-#define HAVE_TANF   1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP  1
-/* #define HAVE_SYSCONF  1 */
-/* #define HAVE_SIGACTION    1 */
-
-
-/* PSP isn't that sophisticated */
-#define LACKS_SYS_MMAN_H 1
-
-/* Enable the stub thread support (src/thread/psp/\*.c) */
-#define SDL_THREAD_PSP  1
-
-/* Enable the stub timer support (src/timer/psp/\*.c) */
-#define SDL_TIMERS_PSP  1
-
-/* Enable the stub joystick driver (src/joystick/psp/\*.c) */
-#define SDL_JOYSTICK_PSP        1
-
-/* Enable the stub audio driver (src/audio/psp/\*.c) */
-#define SDL_AUDIO_DRIVER_PSP    1
-
-/* PSP video dirver */
-#define SDL_VIDEO_DRIVER_PSP   1
-
-/* PSP render dirver */
-#define SDL_VIDEO_RENDER_PSP   1
-
-#define SDL_POWER_PSP          1
-
-/* !!! FIXME: what does PSP do for filesystem stuff? */
-#define SDL_FILESYSTEM_DUMMY   1
-
-/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */
-#define SDL_HAPTIC_DISABLED    1
-
-/* PSP can't load shared object (src/loadso/dummy/\*.c) */
-#define SDL_LOADSO_DISABLED    1
-
-
-#endif /* SDL_config_psp_h_ */

+ 168 - 60
bsp/simulator/SDL2/include/SDL_config_windows.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -25,12 +25,36 @@
 
 
 #include "SDL_platform.h"
 #include "SDL_platform.h"
 
 
+/* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK,
+ * but out of caution we'll only use it if the compiler supports __has_include() to confirm its presence.
+ * If your compiler doesn't support __has_include() but you have winsdkver.h, define HAVE_WINSDKVER_H.  */
+#if !defined(HAVE_WINSDKVER_H) && defined(__has_include)
+#if __has_include(<winsdkver.h>)
+#define HAVE_WINSDKVER_H 1
+#endif
+#endif
+
+#ifdef HAVE_WINSDKVER_H
+#include <winsdkver.h>
+#endif
+
+/* sdkddkver.h defines more specific SDK version numbers. This is needed because older versions of the
+ * Windows 10 SDK have broken declarations for the C API for DirectX 12. */
+#if !defined(HAVE_SDKDDKVER_H) && defined(__has_include)
+#if __has_include(<sdkddkver.h>)
+#define HAVE_SDKDDKVER_H 1
+#endif
+#endif
+
+#ifdef HAVE_SDKDDKVER_H
+#include <sdkddkver.h>
+#endif
+
 /* This is a set of defines to configure the SDL features */
 /* This is a set of defines to configure the SDL features */
 
 
-#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
-#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
-#define HAVE_STDINT_H   1
-#elif defined(_MSC_VER)
+#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
+/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
+#if defined(_MSC_VER) && (_MSC_VER < 1600)
 typedef signed __int8 int8_t;
 typedef signed __int8 int8_t;
 typedef unsigned __int8 uint8_t;
 typedef unsigned __int8 uint8_t;
 typedef signed __int16 int16_t;
 typedef signed __int16 int16_t;
@@ -47,28 +71,9 @@ typedef unsigned int uintptr_t;
 #endif
 #endif
 #define _UINTPTR_T_DEFINED
 #define _UINTPTR_T_DEFINED
 #endif
 #endif
-/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
-#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
-#define DWORD_PTR DWORD
-#endif
-#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
-#define LONG_PTR LONG
-#endif
-#else /* !__GNUC__ && !_MSC_VER */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-#ifndef _SIZE_T_DEFINED_
-#define _SIZE_T_DEFINED_
-typedef unsigned int size_t;
-#endif
-typedef unsigned int uintptr_t;
-#endif /* __GNUC__ || _MSC_VER */
+#else
+#define HAVE_STDINT_H 1
+#endif /* Visual Studio 2008 */
 #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
 #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
 
 
 #ifdef _WIN64
 #ifdef _WIN64
@@ -77,21 +82,55 @@ typedef unsigned int uintptr_t;
 # define SIZEOF_VOIDP 4
 # define SIZEOF_VOIDP 4
 #endif
 #endif
 
 
+#ifdef __clang__
+# define HAVE_GCC_ATOMICS 1
+#endif
+
 #define HAVE_DDRAW_H 1
 #define HAVE_DDRAW_H 1
 #define HAVE_DINPUT_H 1
 #define HAVE_DINPUT_H 1
 #define HAVE_DSOUND_H 1
 #define HAVE_DSOUND_H 1
+#ifndef __WATCOMC__
 #define HAVE_DXGI_H 1
 #define HAVE_DXGI_H 1
 #define HAVE_XINPUT_H 1
 #define HAVE_XINPUT_H 1
+#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00  /* Windows 10 SDK */
+#define HAVE_WINDOWS_GAMING_INPUT_H 1
+#endif
+#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602  /* Windows 8 SDK */
+#define HAVE_D3D11_H 1
+#define HAVE_ROAPI_H 1
+#endif
+#if defined(__has_include)
+#if __has_include(<d3d12.h>) && __has_include(<d3d12sdklayers.h>)
+#define HAVE_D3D12_H 1
+#endif
+#endif
+#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603  /* Windows 8.1 SDK */
+#define HAVE_SHELLSCALINGAPI_H 1
+#endif
+#define HAVE_MMDEVICEAPI_H 1
+#define HAVE_AUDIOCLIENT_H 1
+#define HAVE_TPCSHRD_H 1
+#define HAVE_SENSORSAPI_H 1
+#endif
+#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
+#define HAVE_IMMINTRIN_H 1
+#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
+# if __has_include(<immintrin.h>)
+#   define HAVE_IMMINTRIN_H 1
+# endif
+#endif
 
 
 /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
 /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
 #ifdef HAVE_LIBC
 #ifdef HAVE_LIBC
 /* Useful headers */
 /* Useful headers */
-#define HAVE_STDIO_H 1
 #define STDC_HEADERS 1
 #define STDC_HEADERS 1
-#define HAVE_STRING_H 1
 #define HAVE_CTYPE_H 1
 #define HAVE_CTYPE_H 1
+#define HAVE_FLOAT_H 1
+#define HAVE_LIMITS_H 1
 #define HAVE_MATH_H 1
 #define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
 #define HAVE_SIGNAL_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STRING_H 1
 
 
 /* C library functions */
 /* C library functions */
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
@@ -99,7 +138,11 @@ typedef unsigned int uintptr_t;
 #define HAVE_REALLOC 1
 #define HAVE_REALLOC 1
 #define HAVE_FREE 1
 #define HAVE_FREE 1
 #define HAVE_ALLOCA 1
 #define HAVE_ALLOCA 1
+/* OpenWatcom requires specific calling conventions for qsort and bsearch */
+#ifndef __WATCOMC__
 #define HAVE_QSORT 1
 #define HAVE_QSORT 1
+#define HAVE_BSEARCH 1
+#endif
 #define HAVE_ABS 1
 #define HAVE_ABS 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMCPY 1
 #define HAVE_MEMCPY 1
@@ -107,13 +150,16 @@ typedef unsigned int uintptr_t;
 #define HAVE_MEMCMP 1
 #define HAVE_MEMCMP 1
 #define HAVE_STRLEN 1
 #define HAVE_STRLEN 1
 #define HAVE__STRREV 1
 #define HAVE__STRREV 1
-#define HAVE__STRUPR 1
-#define HAVE__STRLWR 1
+/* These functions have security warnings, so we won't use them */
+/* #undef HAVE__STRUPR */
+/* #undef HAVE__STRLWR */
 #define HAVE_STRCHR 1
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRSTR 1
 #define HAVE_STRSTR 1
-#define HAVE__LTOA 1
-#define HAVE__ULTOA 1
+/* #undef HAVE_STRTOK_R */
+/* These functions have security warnings, so we won't use them */
+/* #undef HAVE__LTOA */
+/* #undef HAVE__ULTOA */
 #define HAVE_STRTOL 1
 #define HAVE_STRTOL 1
 #define HAVE_STRTOUL 1
 #define HAVE_STRTOUL 1
 #define HAVE_STRTOD 1
 #define HAVE_STRTOD 1
@@ -123,30 +169,75 @@ typedef unsigned int uintptr_t;
 #define HAVE_STRNCMP 1
 #define HAVE_STRNCMP 1
 #define HAVE__STRICMP 1
 #define HAVE__STRICMP 1
 #define HAVE__STRNICMP 1
 #define HAVE__STRNICMP 1
-#define HAVE_ATAN 1
-#define HAVE_ATAN2 1
-#define HAVE_ACOS  1
-#define HAVE_ASIN  1
-#define HAVE_CEIL 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_LOG 1
-#define HAVE_POW 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#define HAVE_SQRTF 1
-#define HAVE_TAN 1
-#define HAVE_TANF 1
+#define HAVE__WCSICMP 1
+#define HAVE__WCSNICMP 1
+#define HAVE__WCSDUP 1
+#define HAVE_ACOS   1
+#define HAVE_ASIN   1
+#define HAVE_ATAN   1
+#define HAVE_ATAN2  1
+#define HAVE_CEIL   1
+#define HAVE_COS    1
+#define HAVE_EXP    1
+#define HAVE_FABS   1
+#define HAVE_FLOOR  1
+#define HAVE_FMOD   1
+#define HAVE_LOG    1
+#define HAVE_LOG10  1
+#define HAVE_POW    1
+#define HAVE_SIN    1
+#define HAVE_SQRT   1
+#define HAVE_TAN    1
+#ifndef __WATCOMC__
+#define HAVE_ACOSF  1
+#define HAVE_ASINF  1
+#define HAVE_ATANF  1
+#define HAVE_ATAN2F 1
+#define HAVE_CEILF  1
+#define HAVE__COPYSIGN 1
+#define HAVE_COSF   1
+#define HAVE_EXPF   1
+#define HAVE_FABSF  1
+#define HAVE_FLOORF 1
+#define HAVE_FMODF  1
+#define HAVE_LOGF   1
+#define HAVE_LOG10F 1
+#define HAVE_POWF   1
+#define HAVE_SINF   1
+#define HAVE_SQRTF  1
+#define HAVE_TANF   1
+#endif
+#if defined(_MSC_VER)
+/* These functions were added with the VC++ 2013 C runtime library */
 #if _MSC_VER >= 1800
 #if _MSC_VER >= 1800
 #define HAVE_STRTOLL 1
 #define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
 #define HAVE_VSSCANF 1
 #define HAVE_VSSCANF 1
-#define HAVE_COPYSIGN 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
 #define HAVE_SCALBN 1
 #define HAVE_SCALBN 1
+#define HAVE_SCALBNF 1
+#define HAVE_TRUNC  1
+#define HAVE_TRUNCF 1
+#endif
+/* This function is available with at least the VC++ 2008 C runtime library */
+#if _MSC_VER >= 1400
+#define HAVE__FSEEKI64 1
 #endif
 #endif
-#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
+#ifdef _USE_MATH_DEFINES
+#define HAVE_M_PI 1
+#endif
+#elif defined(__WATCOMC__)
+#define HAVE__FSEEKI64 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_VSSCANF 1
+#define HAVE_ROUND 1
+#define HAVE_SCALBN 1
+#define HAVE_TRUNC  1
+#else
 #define HAVE_M_PI 1
 #define HAVE_M_PI 1
 #endif
 #endif
 #else
 #else
@@ -155,23 +246,40 @@ typedef unsigned int uintptr_t;
 #endif
 #endif
 
 
 /* Enable various audio drivers */
 /* Enable various audio drivers */
+#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)
 #define SDL_AUDIO_DRIVER_WASAPI 1
 #define SDL_AUDIO_DRIVER_WASAPI 1
+#endif
 #define SDL_AUDIO_DRIVER_DSOUND 1
 #define SDL_AUDIO_DRIVER_DSOUND 1
-#define SDL_AUDIO_DRIVER_XAUDIO2    0
 #define SDL_AUDIO_DRIVER_WINMM  1
 #define SDL_AUDIO_DRIVER_WINMM  1
 #define SDL_AUDIO_DRIVER_DISK   1
 #define SDL_AUDIO_DRIVER_DISK   1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 
 
 /* Enable various input drivers */
 /* Enable various input drivers */
 #define SDL_JOYSTICK_DINPUT 1
 #define SDL_JOYSTICK_DINPUT 1
+#define SDL_JOYSTICK_HIDAPI 1
+#ifndef __WINRT__
+#define SDL_JOYSTICK_RAWINPUT   1
+#endif
+#define SDL_JOYSTICK_VIRTUAL    1
+#ifdef HAVE_WINDOWS_GAMING_INPUT_H
+#define SDL_JOYSTICK_WGI    1
+#endif
 #define SDL_JOYSTICK_XINPUT 1
 #define SDL_JOYSTICK_XINPUT 1
 #define SDL_HAPTIC_DINPUT   1
 #define SDL_HAPTIC_DINPUT   1
 #define SDL_HAPTIC_XINPUT   1
 #define SDL_HAPTIC_XINPUT   1
 
 
+/* Enable the sensor driver */
+#ifdef HAVE_SENSORSAPI_H
+#define SDL_SENSOR_WINDOWS  1
+#else
+#define SDL_SENSOR_DUMMY    1
+#endif
+
 /* Enable various shared object loading systems */
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_WINDOWS  1
 #define SDL_LOADSO_WINDOWS  1
 
 
 /* Enable various threading systems */
 /* Enable various threading systems */
+#define SDL_THREAD_GENERIC_COND_SUFFIX 1
 #define SDL_THREAD_WINDOWS  1
 #define SDL_THREAD_WINDOWS  1
 
 
 /* Enable various timer systems */
 /* Enable various timer systems */
@@ -184,8 +292,11 @@ typedef unsigned int uintptr_t;
 #ifndef SDL_VIDEO_RENDER_D3D
 #ifndef SDL_VIDEO_RENDER_D3D
 #define SDL_VIDEO_RENDER_D3D    1
 #define SDL_VIDEO_RENDER_D3D    1
 #endif
 #endif
-#ifndef SDL_VIDEO_RENDER_D3D11
-#define SDL_VIDEO_RENDER_D3D11  0
+#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
+#define SDL_VIDEO_RENDER_D3D11  1
+#endif
+#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
+#define SDL_VIDEO_RENDER_D3D12  1
 #endif
 #endif
 
 
 /* Enable OpenGL support */
 /* Enable OpenGL support */
@@ -217,9 +328,6 @@ typedef unsigned int uintptr_t;
 /* Enable filesystem support */
 /* Enable filesystem support */
 #define SDL_FILESYSTEM_WINDOWS  1
 #define SDL_FILESYSTEM_WINDOWS  1
 
 
-/* Enable assembly routines (Win64 doesn't have inline asm) */
-#ifndef _WIN64
-#define SDL_ASSEMBLY_ROUTINES   1
-#endif
-
 #endif /* SDL_config_windows_h_ */
 #endif /* SDL_config_windows_h_ */
+
+/* vi: set ts=4 sw=4 expandtab: */

+ 253 - 0
bsp/simulator/SDL2/include/SDL_config_wingdk.h

@@ -0,0 +1,253 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef SDL_config_wingdk_h_
+#define SDL_config_wingdk_h_
+#define SDL_config_h_
+
+#include "SDL_platform.h"
+
+/* Windows GDK does not need Windows SDK version checks because it requires
+ * a recent version of the Windows 10 SDK. */
+
+/* GDK only supports 64-bit */
+# define SIZEOF_VOIDP 8
+
+#ifdef __clang__
+# define HAVE_GCC_ATOMICS 1
+#endif
+
+#define HAVE_DDRAW_H 1
+#define HAVE_DINPUT_H 1
+#define HAVE_DSOUND_H 1
+/* No SDK version checks needed for these because the SDK has to be new. */
+#define HAVE_DXGI_H 1
+#define HAVE_XINPUT_H 1
+#define HAVE_WINDOWS_GAMING_INPUT_H 1
+#define HAVE_D3D11_H 1
+#define HAVE_ROAPI_H 1
+#define HAVE_D3D12_H 1
+#define HAVE_SHELLSCALINGAPI_H 1
+#define HAVE_MMDEVICEAPI_H 1
+#define HAVE_AUDIOCLIENT_H 1
+#define HAVE_TPCSHRD_H 1
+#define HAVE_SENSORSAPI_H 1
+#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
+#define HAVE_IMMINTRIN_H 1
+#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
+# if __has_include(<immintrin.h>)
+#   define HAVE_IMMINTRIN_H 1
+# endif
+#endif
+
+/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
+#ifdef HAVE_LIBC
+/* Useful headers */
+#define STDC_HEADERS 1
+#define HAVE_CTYPE_H 1
+#define HAVE_FLOAT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MATH_H 1
+#define HAVE_SIGNAL_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STRING_H 1
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_QSORT 1
+#define HAVE_BSEARCH 1
+#define HAVE_ABS 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE__STRREV 1
+/* These functions have security warnings, so we won't use them */
+/* #undef HAVE__STRUPR */
+/* #undef HAVE__STRLWR */
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+/* #undef HAVE_STRTOK_R */
+/* These functions have security warnings, so we won't use them */
+/* #undef HAVE__LTOA */
+/* #undef HAVE__ULTOA */
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE__STRICMP 1
+#define HAVE__STRNICMP 1
+#define HAVE__WCSICMP 1
+#define HAVE__WCSNICMP 1
+#define HAVE__WCSDUP 1
+#define HAVE_ACOS   1
+#define HAVE_ASIN   1
+#define HAVE_ATAN   1
+#define HAVE_ATAN2  1
+#define HAVE_CEIL   1
+#define HAVE_COS    1
+#define HAVE_EXP    1
+#define HAVE_FABS   1
+#define HAVE_FLOOR  1
+#define HAVE_FMOD   1
+#define HAVE_LOG    1
+#define HAVE_LOG10  1
+#define HAVE_POW    1
+#define HAVE_SIN    1
+#define HAVE_SQRT   1
+#define HAVE_TAN    1
+#define HAVE_ACOSF  1
+#define HAVE_ASINF  1
+#define HAVE_ATANF  1
+#define HAVE_ATAN2F 1
+#define HAVE_CEILF  1
+#define HAVE__COPYSIGN 1
+#define HAVE_COSF   1
+#define HAVE_EXPF   1
+#define HAVE_FABSF  1
+#define HAVE_FLOORF 1
+#define HAVE_FMODF  1
+#define HAVE_LOGF   1
+#define HAVE_LOG10F 1
+#define HAVE_POWF   1
+#define HAVE_SINF   1
+#define HAVE_SQRTF  1
+#define HAVE_TANF   1
+#if defined(_MSC_VER)
+/* These functions were added with the VC++ 2013 C runtime library */
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_VSSCANF 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SCALBN 1
+#define HAVE_SCALBNF 1
+#define HAVE_TRUNC  1
+#define HAVE_TRUNCF 1
+#define HAVE__FSEEKI64 1
+#ifdef _USE_MATH_DEFINES
+#define HAVE_M_PI 1
+#endif
+#else
+#define HAVE_M_PI 1
+#endif
+#else
+#define HAVE_STDARG_H   1
+#define HAVE_STDDEF_H   1
+#define HAVE_STDINT_H   1
+#endif
+
+/* Enable various audio drivers */
+#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)
+#define SDL_AUDIO_DRIVER_WASAPI 1
+#endif
+#define SDL_AUDIO_DRIVER_DSOUND 1
+#define SDL_AUDIO_DRIVER_WINMM  1
+#define SDL_AUDIO_DRIVER_DISK   1
+#define SDL_AUDIO_DRIVER_DUMMY  1
+
+/* Enable various input drivers */
+#define SDL_JOYSTICK_DINPUT 1
+#define SDL_JOYSTICK_HIDAPI 1
+#define SDL_JOYSTICK_RAWINPUT   1
+#define SDL_JOYSTICK_VIRTUAL    1
+#ifdef HAVE_WINDOWS_GAMING_INPUT_H
+#define SDL_JOYSTICK_WGI    1
+#endif
+#define SDL_JOYSTICK_XINPUT 1
+#define SDL_HAPTIC_DINPUT   1
+#define SDL_HAPTIC_XINPUT   1
+
+/* Enable the sensor driver */
+#ifdef HAVE_SENSORSAPI_H
+#define SDL_SENSOR_WINDOWS  1
+#else
+#define SDL_SENSOR_DUMMY    1
+#endif
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_WINDOWS  1
+
+/* Enable various threading systems */
+#define SDL_THREAD_GENERIC_COND_SUFFIX 1
+#define SDL_THREAD_WINDOWS  1
+
+/* Enable various timer systems */
+#define SDL_TIMER_WINDOWS   1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_DUMMY  1
+#define SDL_VIDEO_DRIVER_WINDOWS    1
+
+#ifndef SDL_VIDEO_RENDER_D3D
+#define SDL_VIDEO_RENDER_D3D    1
+#endif
+#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
+#define SDL_VIDEO_RENDER_D3D11  1
+#endif
+#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
+#define SDL_VIDEO_RENDER_D3D12  1
+#endif
+
+/* Enable OpenGL support */
+#ifndef SDL_VIDEO_OPENGL
+#define SDL_VIDEO_OPENGL    1
+#endif
+#ifndef SDL_VIDEO_OPENGL_WGL
+#define SDL_VIDEO_OPENGL_WGL    1
+#endif
+#ifndef SDL_VIDEO_RENDER_OGL
+#define SDL_VIDEO_RENDER_OGL    1
+#endif
+#ifndef SDL_VIDEO_RENDER_OGL_ES2
+#define SDL_VIDEO_RENDER_OGL_ES2    1
+#endif
+#ifndef SDL_VIDEO_OPENGL_ES2
+#define SDL_VIDEO_OPENGL_ES2    1
+#endif
+#ifndef SDL_VIDEO_OPENGL_EGL
+#define SDL_VIDEO_OPENGL_EGL    1
+#endif
+
+/* Enable Vulkan support */
+#define SDL_VIDEO_VULKAN 1
+
+/* Enable system power support */
+#define SDL_POWER_WINDOWS 1
+
+/* Enable filesystem support */
+#define SDL_FILESYSTEM_WINDOWS  1
+
+#endif /* SDL_config_wingdk_h_ */
+
+/* vi: set ts=4 sw=4 expandtab: */

+ 85 - 80
bsp/simulator/SDL2/include/SDL_config_winrt.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -42,69 +42,36 @@
 
 
 /* This is a set of defines to configure the SDL features */
 /* This is a set of defines to configure the SDL features */
 
 
-#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
-#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
-#define HAVE_STDINT_H   1
-#elif defined(_MSC_VER)
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#ifndef _UINTPTR_T_DEFINED
-#ifdef  _WIN64
-typedef unsigned __int64 uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
-#define _UINTPTR_T_DEFINED
-#endif
-/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
-#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
-#define DWORD_PTR DWORD
-#endif
-#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
-#define LONG_PTR LONG
-#endif
-#else /* !__GNUC__ && !_MSC_VER */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-#ifndef _SIZE_T_DEFINED_
-#define _SIZE_T_DEFINED_
-typedef unsigned int size_t;
-#endif
-typedef unsigned int uintptr_t;
-#endif /* __GNUC__ || _MSC_VER */
-#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
-
 #ifdef _WIN64
 #ifdef _WIN64
 # define SIZEOF_VOIDP 8
 # define SIZEOF_VOIDP 8
 #else
 #else
 # define SIZEOF_VOIDP 4
 # define SIZEOF_VOIDP 4
 #endif
 #endif
 
 
+#ifdef __clang__
+# define HAVE_GCC_ATOMICS 1
+#endif
+
 /* Useful headers */
 /* Useful headers */
 #define HAVE_DXGI_H 1
 #define HAVE_DXGI_H 1
-#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
+#if !SDL_WINAPI_FAMILY_PHONE
 #define HAVE_XINPUT_H 1
 #define HAVE_XINPUT_H 1
 #endif
 #endif
+
+#define HAVE_MMDEVICEAPI_H 1
+#define HAVE_AUDIOCLIENT_H 1
+#define HAVE_TPCSHRD_H 1
+
 #define HAVE_LIBC 1
 #define HAVE_LIBC 1
-#define HAVE_STDIO_H 1
 #define STDC_HEADERS 1
 #define STDC_HEADERS 1
-#define HAVE_STRING_H 1
 #define HAVE_CTYPE_H 1
 #define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
 #define HAVE_FLOAT_H 1
 #define HAVE_FLOAT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MATH_H 1
 #define HAVE_SIGNAL_H 1
 #define HAVE_SIGNAL_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STRING_H 1
 
 
 /* C library functions */
 /* C library functions */
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
@@ -113,6 +80,7 @@ typedef unsigned int uintptr_t;
 #define HAVE_FREE 1
 #define HAVE_FREE 1
 #define HAVE_ALLOCA 1
 #define HAVE_ALLOCA 1
 #define HAVE_QSORT 1
 #define HAVE_QSORT 1
+#define HAVE_BSEARCH 1
 #define HAVE_ABS 1
 #define HAVE_ABS 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMSET 1
 #define HAVE_MEMCPY 1
 #define HAVE_MEMCPY 1
@@ -121,16 +89,13 @@ typedef unsigned int uintptr_t;
 #define HAVE_STRLEN 1
 #define HAVE_STRLEN 1
 #define HAVE__STRREV 1
 #define HAVE__STRREV 1
 #define HAVE__STRUPR 1
 #define HAVE__STRUPR 1
-//#define HAVE__STRLWR 1    // TODO, WinRT: consider using _strlwr_s instead
 #define HAVE_STRCHR 1
 #define HAVE_STRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRRCHR 1
 #define HAVE_STRSTR 1
 #define HAVE_STRSTR 1
-//#define HAVE_ITOA 1   // TODO, WinRT: consider using _itoa_s instead
-//#define HAVE__LTOA 1  // TODO, WinRT: consider using _ltoa_s instead
-//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead
 #define HAVE_STRTOL 1
 #define HAVE_STRTOL 1
 #define HAVE_STRTOUL 1
 #define HAVE_STRTOUL 1
-//#define HAVE_STRTOLL 1
+/* #undef HAVE_STRTOLL */
+/* #undef HAVE_STRTOULL */
 #define HAVE_STRTOD 1
 #define HAVE_STRTOD 1
 #define HAVE_ATOI 1
 #define HAVE_ATOI 1
 #define HAVE_ATOF 1
 #define HAVE_ATOF 1
@@ -139,47 +104,89 @@ typedef unsigned int uintptr_t;
 #define HAVE__STRICMP 1
 #define HAVE__STRICMP 1
 #define HAVE__STRNICMP 1
 #define HAVE__STRNICMP 1
 #define HAVE_VSNPRINTF 1
 #define HAVE_VSNPRINTF 1
-//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead
+/* TODO, WinRT: consider using ??_s versions of the following */
+/* #undef HAVE__STRLWR */
+/* #undef HAVE_ITOA */
+/* #undef HAVE__LTOA */
+/* #undef HAVE__ULTOA */
+/* #undef HAVE_SSCANF */
 #define HAVE_M_PI 1
 #define HAVE_M_PI 1
-#define HAVE_ATAN 1
-#define HAVE_ATAN2 1
-#define HAVE_CEIL 1
+#define HAVE_ACOS   1
+#define HAVE_ACOSF  1
+#define HAVE_ASIN   1
+#define HAVE_ASINF  1
+#define HAVE_ATAN   1
+#define HAVE_ATANF  1
+#define HAVE_ATAN2  1
+#define HAVE_ATAN2F 1
+#define HAVE_CEIL   1
+#define HAVE_CEILF  1
 #define HAVE__COPYSIGN 1
 #define HAVE__COPYSIGN 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_LOG 1
-#define HAVE_POW 1
-//#define HAVE_SCALBN 1
+#define HAVE_COS    1
+#define HAVE_COSF   1
+#define HAVE_EXP    1
+#define HAVE_EXPF   1
+#define HAVE_FABS   1
+#define HAVE_FABSF  1
+#define HAVE_FLOOR  1
+#define HAVE_FLOORF 1
+#define HAVE_FMOD   1
+#define HAVE_FMODF  1
+#define HAVE_LOG    1
+#define HAVE_LOGF   1
+#define HAVE_LOG10  1
+#define HAVE_LOG10F 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
+#define HAVE_POW    1
+#define HAVE_POWF   1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
 #define HAVE__SCALB 1
 #define HAVE__SCALB 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#define HAVE_SQRTF 1
-#define HAVE_TAN 1
-#define HAVE_TANF 1
+#define HAVE_SIN    1
+#define HAVE_SINF   1
+#define HAVE_SQRT   1
+#define HAVE_SQRTF  1
+#define HAVE_TAN    1
+#define HAVE_TANF   1
+#define HAVE_TRUNC  1
+#define HAVE_TRUNCF 1
 #define HAVE__FSEEKI64 1
 #define HAVE__FSEEKI64 1
 
 
+#define HAVE_ROAPI_H  1
+
 /* Enable various audio drivers */
 /* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_XAUDIO2    1
+#define SDL_AUDIO_DRIVER_WASAPI 1
 #define SDL_AUDIO_DRIVER_DISK   1
 #define SDL_AUDIO_DRIVER_DISK   1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 #define SDL_AUDIO_DRIVER_DUMMY  1
 
 
 /* Enable various input drivers */
 /* Enable various input drivers */
-#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
+#if SDL_WINAPI_FAMILY_PHONE
 #define SDL_JOYSTICK_DISABLED 1
 #define SDL_JOYSTICK_DISABLED 1
 #define SDL_HAPTIC_DISABLED 1
 #define SDL_HAPTIC_DISABLED 1
 #else
 #else
+#define SDL_JOYSTICK_VIRTUAL    1
+#if (NTDDI_VERSION >= NTDDI_WIN10)
+#define SDL_JOYSTICK_WGI    1
+#define SDL_HAPTIC_DISABLED 1
+#else
 #define SDL_JOYSTICK_XINPUT 1
 #define SDL_JOYSTICK_XINPUT 1
 #define SDL_HAPTIC_XINPUT   1
 #define SDL_HAPTIC_XINPUT   1
+#endif /* WIN10 */
 #endif
 #endif
 
 
+/* WinRT doesn't have HIDAPI available */
+#define SDL_HIDAPI_DISABLED    1
+
+/* Enable the dummy sensor driver */
+#define SDL_SENSOR_DUMMY  1
+
 /* Enable various shared object loading systems */
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_WINDOWS  1
 #define SDL_LOADSO_WINDOWS  1
 
 
 /* Enable various threading systems */
 /* Enable various threading systems */
 #if (NTDDI_VERSION >= NTDDI_WINBLUE)
 #if (NTDDI_VERSION >= NTDDI_WINBLUE)
+#define SDL_THREAD_GENERIC_COND_SUFFIX 1
 #define SDL_THREAD_WINDOWS  1
 #define SDL_THREAD_WINDOWS  1
 #else
 #else
 /* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */
 /* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */
@@ -200,16 +207,14 @@ typedef unsigned int uintptr_t;
 /* Enable appropriate renderer(s) */
 /* Enable appropriate renderer(s) */
 #define SDL_VIDEO_RENDER_D3D11  1
 #define SDL_VIDEO_RENDER_D3D11  1
 
 
-#if SDL_VIDEO_OPENGL_ES2
+/* Disable D3D12 as it's not implemented for WinRT */
+/* #undef SDL_VIDEO_RENDER_D3D12 */
+
+#ifdef SDL_VIDEO_OPENGL_ES2
 #define SDL_VIDEO_RENDER_OGL_ES2 1
 #define SDL_VIDEO_RENDER_OGL_ES2 1
 #endif
 #endif
 
 
 /* Enable system power support */
 /* Enable system power support */
 #define SDL_POWER_WINRT 1
 #define SDL_POWER_WINRT 1
 
 
-/* Enable assembly routines (Win64 doesn't have inline asm) */
-#ifndef _WIN64
-#define SDL_ASSEMBLY_ROUTINES   1
-#endif
-
-#endif /* SDL_config_winrt_h_ */
+#endif /* SDL_config_winrt_h_ */

+ 0 - 121
bsp/simulator/SDL2/include/SDL_config_wiz.h

@@ -1,121 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SDL_config_wiz_h_
-#define SDL_config_wiz_h_
-#define SDL_config_h_
-
-/* This is a set of defines to configure the SDL features */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-#define SDL_BYTEORDER 1234
-
-#define HAVE_ALLOCA_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#define HAVE_ICONV_H 1
-#define HAVE_SIGNAL_H 1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_UNSETENV 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_BCOPY 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_STRLEN 1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOULL 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_VSSCANF 1
-#define HAVE_VSNPRINTF 1
-#define HAVE_M_PI 1
-#define HAVE_CEIL 1
-#define HAVE_COPYSIGN 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_FABS 1
-#define HAVE_FLOOR 1
-#define HAVE_LOG 1
-#define HAVE_SCALBN 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#define HAVE_SQRTF 1
-#define HAVE_TAN 1
-#define HAVE_TANF 1
-#define HAVE_SIGACTION 1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP 1
-#define HAVE_POW 1
-
-#define SDL_AUDIO_DRIVER_DUMMY 1
-#define SDL_AUDIO_DRIVER_OSS 1
-
-#define SDL_INPUT_LINUXEV 1
-#define SDL_INPUT_TSLIB 1
-#define SDL_JOYSTICK_LINUX 1
-#define SDL_HAPTIC_LINUX 1
-
-#define SDL_LOADSO_DLOPEN 1
-
-#define SDL_THREAD_PTHREAD 1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
-
-#define SDL_TIMER_UNIX 1
-
-#define SDL_VIDEO_DRIVER_DUMMY 1
-#define SDL_VIDEO_DRIVER_PANDORA 1
-#define SDL_VIDEO_RENDER_OGL_ES 1
-#define SDL_VIDEO_OPENGL_ES 1
-
-#endif /* SDL_config_wiz_h_ */

+ 240 - 0
bsp/simulator/SDL2/include/SDL_config_xbox.h

@@ -0,0 +1,240 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef SDL_config_wingdk_h_
+#define SDL_config_wingdk_h_
+#define SDL_config_h_
+
+#include "SDL_platform.h"
+
+/* Windows GDK does not need Windows SDK version checks because it requires
+ * a recent version of the Windows 10 SDK. */
+
+/* GDK only supports 64-bit */
+# define SIZEOF_VOIDP 8
+
+#ifdef __clang__
+# define HAVE_GCC_ATOMICS 1
+#endif
+
+/*#define HAVE_DDRAW_H 1*/
+/*#define HAVE_DINPUT_H 1*/
+/*#define HAVE_DSOUND_H 1*/
+/* No SDK version checks needed for these because the SDK has to be new. */
+/* #define HAVE_DXGI_H 1 */
+#define HAVE_XINPUT_H 1
+/*#define HAVE_WINDOWS_GAMING_INPUT_H 1*/
+/*#define HAVE_D3D11_H 1*/
+/*#define HAVE_ROAPI_H 1*/
+#define HAVE_D3D12_H 1
+/*#define HAVE_SHELLSCALINGAPI_H 1*/
+#define HAVE_MMDEVICEAPI_H 1
+#define HAVE_AUDIOCLIENT_H 1
+/*#define HAVE_TPCSHRD_H  1*/
+/*#define HAVE_SENSORSAPI_H 1*/
+#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
+#define HAVE_IMMINTRIN_H 1
+#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
+# if __has_include(<immintrin.h>)
+#   define HAVE_IMMINTRIN_H 1
+# endif
+#endif
+
+/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
+#ifdef HAVE_LIBC
+/* Useful headers */
+#define STDC_HEADERS 1
+#define HAVE_CTYPE_H 1
+#define HAVE_FLOAT_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_MATH_H 1
+#define HAVE_SIGNAL_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STRING_H 1
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_QSORT 1
+#define HAVE_BSEARCH 1
+#define HAVE_ABS 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE__STRREV 1
+/* These functions have security warnings, so we won't use them */
+/* #undef HAVE__STRUPR */
+/* #undef HAVE__STRLWR */
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+/* #undef HAVE_STRTOK_R */
+/* These functions have security warnings, so we won't use them */
+/* #undef HAVE__LTOA */
+/* #undef HAVE__ULTOA */
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE__STRICMP 1
+#define HAVE__STRNICMP 1
+#define HAVE__WCSICMP 1
+#define HAVE__WCSNICMP 1
+#define HAVE__WCSDUP 1
+#define HAVE_ACOS   1
+#define HAVE_ASIN   1
+#define HAVE_ATAN   1
+#define HAVE_ATAN2  1
+#define HAVE_CEIL   1
+#define HAVE_COS    1
+#define HAVE_EXP    1
+#define HAVE_FABS   1
+#define HAVE_FLOOR  1
+#define HAVE_FMOD   1
+#define HAVE_LOG    1
+#define HAVE_LOG10  1
+#define HAVE_POW    1
+#define HAVE_SIN    1
+#define HAVE_SQRT   1
+#define HAVE_TAN    1
+#define HAVE_ACOSF  1
+#define HAVE_ASINF  1
+#define HAVE_ATANF  1
+#define HAVE_ATAN2F 1
+#define HAVE_CEILF  1
+#define HAVE__COPYSIGN 1
+#define HAVE_COSF   1
+#define HAVE_EXPF   1
+#define HAVE_FABSF  1
+#define HAVE_FLOORF 1
+#define HAVE_FMODF  1
+#define HAVE_LOGF   1
+#define HAVE_LOG10F 1
+#define HAVE_POWF   1
+#define HAVE_SINF   1
+#define HAVE_SQRTF  1
+#define HAVE_TANF   1
+#if defined(_MSC_VER)
+/* These functions were added with the VC++ 2013 C runtime library */
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_VSSCANF 1
+#define HAVE_LROUND 1
+#define HAVE_LROUNDF 1
+#define HAVE_ROUND 1
+#define HAVE_ROUNDF 1
+#define HAVE_SCALBN 1
+#define HAVE_SCALBNF 1
+#define HAVE_TRUNC  1
+#define HAVE_TRUNCF 1
+#define HAVE__FSEEKI64 1
+#ifdef _USE_MATH_DEFINES
+#define HAVE_M_PI 1
+#endif
+#else
+#define HAVE_M_PI 1
+#endif
+#else
+#define HAVE_STDARG_H   1
+#define HAVE_STDDEF_H   1
+#define HAVE_STDINT_H   1
+#endif
+
+/* Enable various audio drivers */
+#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)
+#define SDL_AUDIO_DRIVER_WASAPI 1
+#endif
+/*#define SDL_AUDIO_DRIVER_DSOUND 1*/
+/*#define SDL_AUDIO_DRIVER_WINMM  1*/
+#define SDL_AUDIO_DRIVER_DISK   1
+#define SDL_AUDIO_DRIVER_DUMMY  1
+
+/* Enable various input drivers */
+/*#define SDL_JOYSTICK_DINPUT 1*/
+/*#define SDL_JOYSTICK_HIDAPI 1*/
+/*#define SDL_JOYSTICK_RAWINPUT   1*/
+#define SDL_JOYSTICK_VIRTUAL    1
+#ifdef HAVE_WINDOWS_GAMING_INPUT_H
+#define SDL_JOYSTICK_WGI    1
+#endif
+#define SDL_JOYSTICK_XINPUT 1
+/*#define SDL_HAPTIC_DINPUT   1*/
+#define SDL_HAPTIC_XINPUT   1
+
+/* Enable the sensor driver */
+#ifdef HAVE_SENSORSAPI_H
+#define SDL_SENSOR_WINDOWS  1
+#else
+#define SDL_SENSOR_DUMMY    1
+#endif
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_WINDOWS  1
+
+/* Enable various threading systems */
+#define SDL_THREAD_GENERIC_COND_SUFFIX 1
+#define SDL_THREAD_WINDOWS  1
+
+/* Enable various timer systems */
+#define SDL_TIMER_WINDOWS   1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_DUMMY  1
+#define SDL_VIDEO_DRIVER_WINDOWS    1
+
+#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
+#define SDL_VIDEO_RENDER_D3D12  1
+#endif
+
+/* Enable OpenGL support */
+#ifndef SDL_VIDEO_OPENGL
+#define SDL_VIDEO_OPENGL    1
+#endif
+#ifndef SDL_VIDEO_OPENGL_WGL
+#define SDL_VIDEO_OPENGL_WGL    1
+#endif
+#ifndef SDL_VIDEO_RENDER_OGL
+#define SDL_VIDEO_RENDER_OGL    1
+#endif
+
+/* Enable system power support */
+/*#define SDL_POWER_WINDOWS 1*/
+#define SDL_POWER_HARDWIRED 1
+
+/* Enable filesystem support */
+/* #define SDL_FILESYSTEM_WINDOWS 1*/
+#define SDL_FILESYSTEM_XBOX 1
+
+/* Disable IME as not supported yet (TODO: Xbox IME?) */
+#define SDL_DISABLE_WINDOWS_IME 1
+
+#endif /* SDL_config_wingdk_h_ */
+
+/* vi: set ts=4 sw=4 expandtab: */

+ 2 - 2
bsp/simulator/SDL2/include/SDL_copying.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -17,4 +17,4 @@
   2. Altered source versions must be plainly marked as such, and must not be
   2. Altered source versions must be plainly marked as such, and must not be
      misrepresented as being the original software.
      misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
-*/
+*/

+ 53 - 9
bsp/simulator/SDL2/include/SDL_cpuinfo.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,10 +19,16 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
+/* WIKI CATEGORY: CPUInfo */
+
 /**
 /**
- *  \file SDL_cpuinfo.h
+ * # CategoryCPUInfo
+ *
+ * CPU feature detection for SDL.
  *
  *
- *  CPU feature detection for SDL.
+ * These functions are largely concerned with reporting if the system has
+ * access to various SIMD instruction sets, but also has other important info
+ * to share, such as number of logical CPU cores.
  */
  */
 
 
 #ifndef SDL_cpuinfo_h_
 #ifndef SDL_cpuinfo_h_
@@ -53,9 +59,11 @@ _m_prefetch(void *__P)
 #ifndef __MMX__
 #ifndef __MMX__
 #define __MMX__
 #define __MMX__
 #endif
 #endif
+/*
 #ifndef __3dNOW__
 #ifndef __3dNOW__
 #define __3dNOW__
 #define __3dNOW__
 #endif
 #endif
+*/
 #endif
 #endif
 #ifndef __SSE__
 #ifndef __SSE__
 #define __SSE__
 #define __SSE__
@@ -79,7 +87,7 @@ _m_prefetch(void *__P)
 #if !defined(SDL_DISABLE_ARM_NEON_H)
 #if !defined(SDL_DISABLE_ARM_NEON_H)
 #  if defined(__ARM_NEON)
 #  if defined(__ARM_NEON)
 #    include <arm_neon.h>
 #    include <arm_neon.h>
-#  elif defined(__WINDOWS__) || defined(__WINRT__)
+#  elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)
 /* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
 /* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
 #    if defined(_M_ARM)
 #    if defined(_M_ARM)
 #      include <armintr.h>
 #      include <armintr.h>
@@ -90,6 +98,7 @@ _m_prefetch(void *__P)
 #      include <arm64intr.h>
 #      include <arm64intr.h>
 #      include <arm64_neon.h>
 #      include <arm64_neon.h>
 #      define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
 #      define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
+#      define __ARM_ARCH 8
 #    endif
 #    endif
 #  endif
 #  endif
 #endif
 #endif
@@ -98,7 +107,16 @@ _m_prefetch(void *__P)
 #if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
 #if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
 #include <mm3dnow.h>
 #include <mm3dnow.h>
 #endif
 #endif
-#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
+#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H)
+#include <lsxintrin.h>
+#define __LSX__
+#endif
+#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H)
+#include <lasxintrin.h>
+#define __LASX__
+#endif
+#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) && \
+   (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86))
 #include <immintrin.h>
 #include <immintrin.h>
 #else
 #else
 #if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
 #if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
@@ -433,10 +451,36 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
  */
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
 extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
 
 
+/**
+ * Determine whether the CPU has LSX (LOONGARCH SIMD) features.
+ *
+ * This always returns false on CPUs that aren't using LOONGARCH instruction
+ * sets.
+ *
+ * \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if
+ *          not.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
+
+/**
+ * Determine whether the CPU has LASX (LOONGARCH SIMD) features.
+ *
+ * This always returns false on CPUs that aren't using LOONGARCH instruction
+ * sets.
+ *
+ * \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if
+ *          not.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
+
 /**
 /**
  * Get the amount of RAM configured in the system.
  * Get the amount of RAM configured in the system.
  *
  *
- * \returns the amount of RAM configured in the system in MB.
+ * \returns the amount of RAM configured in the system in MiB.
  *
  *
  * \since This function is available since SDL 2.0.1.
  * \since This function is available since SDL 2.0.1.
  */
  */
@@ -494,7 +538,7 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
  *
  *
  * \since This function is available since SDL 2.0.10.
  * \since This function is available since SDL 2.0.10.
  *
  *
- * \sa SDL_SIMDAlignment
+ * \sa SDL_SIMDGetAlignment
  * \sa SDL_SIMDRealloc
  * \sa SDL_SIMDRealloc
  * \sa SDL_SIMDFree
  * \sa SDL_SIMDFree
  */
  */
@@ -518,7 +562,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  *
  *
- * \sa SDL_SIMDAlignment
+ * \sa SDL_SIMDGetAlignment
  * \sa SDL_SIMDAlloc
  * \sa SDL_SIMDAlloc
  * \sa SDL_SIMDFree
  * \sa SDL_SIMDFree
  */
  */
@@ -556,4 +600,4 @@ extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr);
 
 
 #endif /* SDL_cpuinfo_h_ */
 #endif /* SDL_cpuinfo_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 64 - 15
bsp/simulator/SDL2/include/SDL_egl.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,11 +19,10 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
- *  \file SDL_egl.h
- *
- *  This is a simple file to encapsulate the EGL API headers.
+/*
+ * This is a simple file to encapsulate the EGL API headers.
  */
  */
+
 #if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
 #if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
 
 
 #if defined(__vita__) || defined(__psp2__)
 #if defined(__vita__) || defined(__psp2__)
@@ -192,6 +191,20 @@ typedef int64_t                 khronos_int64_t;
 typedef uint64_t                khronos_uint64_t;
 typedef uint64_t                khronos_uint64_t;
 #define KHRONOS_SUPPORT_INT64   1
 #define KHRONOS_SUPPORT_INT64   1
 #define KHRONOS_SUPPORT_FLOAT   1
 #define KHRONOS_SUPPORT_FLOAT   1
+/*
+ * To support platform where unsigned long cannot be used interchangeably with
+ * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
+ * Ideally, we could just use (u)intptr_t everywhere, but this could result in
+ * ABI breakage if khronos_uintptr_t is changed from unsigned long to
+ * unsigned long long or similar (this results in different C++ name mangling).
+ * To avoid changes for existing platforms, we restrict usage of intptr_t to
+ * platforms where the size of a pointer is larger than the size of long.
+ */
+#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
+#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
+#define KHRONOS_USE_INTPTR_T
+#endif
+#endif
 
 
 #elif defined(__VMS ) || defined(__sgi)
 #elif defined(__VMS ) || defined(__sgi)
 
 
@@ -274,14 +287,21 @@ typedef unsigned short int     khronos_uint16_t;
  * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
  * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
  * to be the only LLP64 architecture in current use.
  * to be the only LLP64 architecture in current use.
  */
  */
-#ifdef _WIN64
+#ifdef KHRONOS_USE_INTPTR_T
+typedef intptr_t               khronos_intptr_t;
+typedef uintptr_t              khronos_uintptr_t;
+#elif defined(_WIN64)
 typedef signed   long long int khronos_intptr_t;
 typedef signed   long long int khronos_intptr_t;
 typedef unsigned long long int khronos_uintptr_t;
 typedef unsigned long long int khronos_uintptr_t;
-typedef signed   long long int khronos_ssize_t;
-typedef unsigned long long int khronos_usize_t;
 #else
 #else
 typedef signed   long  int     khronos_intptr_t;
 typedef signed   long  int     khronos_intptr_t;
 typedef unsigned long  int     khronos_uintptr_t;
 typedef unsigned long  int     khronos_uintptr_t;
+#endif
+
+#if defined(_WIN64)
+typedef signed   long long int khronos_ssize_t;
+typedef unsigned long long int khronos_usize_t;
+#else
 typedef signed   long  int     khronos_ssize_t;
 typedef signed   long  int     khronos_ssize_t;
 typedef unsigned long  int     khronos_usize_t;
 typedef unsigned long  int     khronos_usize_t;
 #endif
 #endif
@@ -516,7 +536,7 @@ extern "C" {
 ** used to make the header, and the header can be found at
 ** used to make the header, and the header can be found at
 **   http://www.khronos.org/registry/egl
 **   http://www.khronos.org/registry/egl
 **
 **
-** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
+** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
 */
 */
 
 
 /*#include <EGL/eglplatform.h>*/
 /*#include <EGL/eglplatform.h>*/
@@ -525,7 +545,7 @@ extern "C" {
 #define EGL_EGL_PROTOTYPES 1
 #define EGL_EGL_PROTOTYPES 1
 #endif
 #endif
 
 
-/* Generated on date 20210901 */
+/* Generated on date 20220525 */
 
 
 /* Generated C header for:
 /* Generated C header for:
  * API: egl
  * API: egl
@@ -860,12 +880,12 @@ extern "C" {
 ** used to make the header, and the header can be found at
 ** used to make the header, and the header can be found at
 **   http://www.khronos.org/registry/egl
 **   http://www.khronos.org/registry/egl
 **
 **
-** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
+** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
 */
 */
 
 
 /*#include <EGL/eglplatform.h>*/
 /*#include <EGL/eglplatform.h>*/
 
 
-#define EGL_EGLEXT_VERSION 20210901
+#define EGL_EGLEXT_VERSION 20220525
 
 
 /* Generated C header for:
 /* Generated C header for:
  * API: egl
  * API: egl
@@ -1569,6 +1589,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLi
 #define EGL_RENDERER_EXT                  0x335F
 #define EGL_RENDERER_EXT                  0x335F
 #endif /* EGL_EXT_device_query_name */
 #endif /* EGL_EXT_device_query_name */
 
 
+#ifndef EGL_EXT_explicit_device
+#define EGL_EXT_explicit_device 1
+#endif /* EGL_EXT_explicit_device */
+
 #ifndef EGL_EXT_gl_colorspace_bt2020_linear
 #ifndef EGL_EXT_gl_colorspace_bt2020_linear
 #define EGL_EXT_gl_colorspace_bt2020_linear 1
 #define EGL_EXT_gl_colorspace_bt2020_linear 1
 #define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
 #define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
@@ -1794,6 +1818,31 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr
 #define EGL_METADATA_SCALING_EXT          50000
 #define EGL_METADATA_SCALING_EXT          50000
 #endif /* EGL_EXT_surface_SMPTE2086_metadata */
 #endif /* EGL_EXT_surface_SMPTE2086_metadata */
 
 
+#ifndef EGL_EXT_surface_compression
+#define EGL_EXT_surface_compression 1
+#define EGL_SURFACE_COMPRESSION_EXT       0x34B0
+#define EGL_SURFACE_COMPRESSION_PLANE1_EXT 0x328E
+#define EGL_SURFACE_COMPRESSION_PLANE2_EXT 0x328F
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x34B1
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x34B2
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x34B4
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x34B5
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x34B6
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x34B7
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x34B8
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x34B9
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x34BA
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x34BB
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x34BC
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x34BD
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x34BE
+#define EGL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x34BF
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXTPROC) (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySupportedCompressionRatesEXT (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
+#endif
+#endif /* EGL_EXT_surface_compression */
+
 #ifndef EGL_EXT_swap_buffers_with_damage
 #ifndef EGL_EXT_swap_buffers_with_damage
 #define EGL_EXT_swap_buffers_with_damage 1
 #define EGL_EXT_swap_buffers_with_damage 1
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
@@ -2028,12 +2077,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
 #define EGL_STREAM_IMAGE_ADD_NV           0x3374
 #define EGL_STREAM_IMAGE_ADD_NV           0x3374
 #define EGL_STREAM_IMAGE_REMOVE_NV        0x3375
 #define EGL_STREAM_IMAGE_REMOVE_NV        0x3375
 #define EGL_STREAM_IMAGE_AVAILABLE_NV     0x3376
 #define EGL_STREAM_IMAGE_AVAILABLE_NV     0x3376
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
 typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
 typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
 #ifdef EGL_EGLEXT_PROTOTYPES
 #ifdef EGL_EGLEXT_PROTOTYPES
-EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
 EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
 EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
 EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
 EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
 EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
 EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
@@ -2299,4 +2348,4 @@ EGLAPI struct wl_buffer *EGLAPIENTRY eglCreateWaylandBufferFromImageWL (EGLDispl
 
 
 #endif /* __eglext_h_ */
 #endif /* __eglext_h_ */
 
 
-#endif /* _MSC_VER */
+#endif /* _MSC_VER */

+ 90 - 11
bsp/simulator/SDL2/include/SDL_endian.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_endian.h
+ * # CategoryEndian
  *
  *
- *  Functions for reading and writing endian-specific values
+ * Functions for reading and writing endian-specific values
  */
  */
 
 
 #ifndef SDL_endian_h_
 #ifndef SDL_endian_h_
@@ -39,7 +39,7 @@
 static __inline__ void __attribute__((__always_inline__, __nodebug__))
 static __inline__ void __attribute__((__always_inline__, __nodebug__))
 _m_prefetch(void *__P)
 _m_prefetch(void *__P)
 {
 {
-  __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
+  __builtin_prefetch(__P, 0, 3 /* _MM_HINT_T0 */);
 }
 }
 #endif /* __PRFCHWINTRIN_H */
 #endif /* __PRFCHWINTRIN_H */
 #endif /* __clang__ */
 #endif /* __clang__ */
@@ -59,18 +59,36 @@ _m_prefetch(void *__P)
 #ifdef __linux__
 #ifdef __linux__
 #include <endian.h>
 #include <endian.h>
 #define SDL_BYTEORDER  __BYTE_ORDER
 #define SDL_BYTEORDER  __BYTE_ORDER
-#elif defined(__OpenBSD__)
+#elif defined(__sun) && defined(__SVR4)  /* Solaris */
+#include <sys/byteorder.h>
+#if defined(_LITTLE_ENDIAN)
+#define SDL_BYTEORDER   SDL_LIL_ENDIAN
+#elif defined(_BIG_ENDIAN)
+#define SDL_BYTEORDER   SDL_BIG_ENDIAN
+#else
+#error Unsupported endianness
+#endif
+#elif defined(__OpenBSD__) || defined(__DragonFly__)
 #include <endian.h>
 #include <endian.h>
 #define SDL_BYTEORDER  BYTE_ORDER
 #define SDL_BYTEORDER  BYTE_ORDER
 #elif defined(__FreeBSD__) || defined(__NetBSD__)
 #elif defined(__FreeBSD__) || defined(__NetBSD__)
 #include <sys/endian.h>
 #include <sys/endian.h>
 #define SDL_BYTEORDER  BYTE_ORDER
 #define SDL_BYTEORDER  BYTE_ORDER
+/* predefs from newer gcc and clang versions: */
+#elif defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__BYTE_ORDER__)
+#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
+#define SDL_BYTEORDER   SDL_LIL_ENDIAN
+#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
+#define SDL_BYTEORDER   SDL_BIG_ENDIAN
+#else
+#error Unsupported endianness
+#endif /**/
 #else
 #else
 #if defined(__hppa__) || \
 #if defined(__hppa__) || \
     defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
     defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
     (defined(__MIPS__) && defined(__MIPSEB__)) || \
     (defined(__MIPS__) && defined(__MIPSEB__)) || \
-    defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
-    defined(__sparc__)
+    defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
+    defined(__sparc__) || defined(__sparc)
 #define SDL_BYTEORDER   SDL_BIG_ENDIAN
 #define SDL_BYTEORDER   SDL_BIG_ENDIAN
 #else
 #else
 #define SDL_BYTEORDER   SDL_LIL_ENDIAN
 #define SDL_BYTEORDER   SDL_LIL_ENDIAN
@@ -78,6 +96,28 @@ _m_prefetch(void *__P)
 #endif /* __linux__ */
 #endif /* __linux__ */
 #endif /* !SDL_BYTEORDER */
 #endif /* !SDL_BYTEORDER */
 
 
+#ifndef SDL_FLOATWORDORDER           /* Not defined in SDL_config.h? */
+/* predefs from newer gcc versions: */
+#if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__)
+#if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
+#define SDL_FLOATWORDORDER   SDL_LIL_ENDIAN
+#elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
+#define SDL_FLOATWORDORDER   SDL_BIG_ENDIAN
+#else
+#error Unsupported endianness
+#endif /**/
+#elif defined(__MAVERICK__)
+/* For Maverick, float words are always little-endian. */
+#define SDL_FLOATWORDORDER   SDL_LIL_ENDIAN
+#elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__)
+/* For FPA, float words are always big-endian. */
+#define SDL_FLOATWORDORDER   SDL_BIG_ENDIAN
+#else
+/* By default, assume that floats words follow the memory system mode. */
+#define SDL_FLOATWORDORDER   SDL_BYTEORDER
+#endif /* __FLOAT_WORD_ORDER__ */
+#endif /* !SDL_FLOATWORDORDER */
+
 
 
 #include "begin_code.h"
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
 /* Set up for C function definitions, even when using C++ */
@@ -109,7 +149,7 @@ extern "C" {
 
 
 #if HAS_BUILTIN_BSWAP16
 #if HAS_BUILTIN_BSWAP16
 #define SDL_Swap16(x) __builtin_bswap16(x)
 #define SDL_Swap16(x) __builtin_bswap16(x)
-#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
 #pragma intrinsic(_byteswap_ushort)
 #pragma intrinsic(_byteswap_ushort)
 #define SDL_Swap16(x) _byteswap_ushort(x)
 #define SDL_Swap16(x) _byteswap_ushort(x)
 #elif defined(__i386__) && !HAS_BROKEN_BSWAP
 #elif defined(__i386__) && !HAS_BROKEN_BSWAP
@@ -149,6 +189,16 @@ extern __inline Uint16 SDL_Swap16(Uint16);
   parm   [ax]   \
   parm   [ax]   \
   modify [ax];
   modify [ax];
 #else
 #else
+
+/**
+ * Use this function to swap the byte order of a 16-bit value.
+ *
+ * \param x the value to be swapped.
+ * \returns the swapped value.
+ *
+ * \sa SDL_SwapBE16
+ * \sa SDL_SwapLE16
+ */
 SDL_FORCE_INLINE Uint16
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 SDL_Swap16(Uint16 x)
 {
 {
@@ -158,7 +208,7 @@ SDL_Swap16(Uint16 x)
 
 
 #if HAS_BUILTIN_BSWAP32
 #if HAS_BUILTIN_BSWAP32
 #define SDL_Swap32(x) __builtin_bswap32(x)
 #define SDL_Swap32(x) __builtin_bswap32(x)
-#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
 #pragma intrinsic(_byteswap_ulong)
 #pragma intrinsic(_byteswap_ulong)
 #define SDL_Swap32(x) _byteswap_ulong(x)
 #define SDL_Swap32(x) _byteswap_ulong(x)
 #elif defined(__i386__) && !HAS_BROKEN_BSWAP
 #elif defined(__i386__) && !HAS_BROKEN_BSWAP
@@ -200,6 +250,16 @@ extern __inline Uint32 SDL_Swap32(Uint32);
   parm   [eax] \
   parm   [eax] \
   modify [eax];
   modify [eax];
 #else
 #else
+
+/**
+ * Use this function to swap the byte order of a 32-bit value.
+ *
+ * \param x the value to be swapped.
+ * \returns the swapped value.
+ *
+ * \sa SDL_SwapBE32
+ * \sa SDL_SwapLE32
+ */
 SDL_FORCE_INLINE Uint32
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 SDL_Swap32(Uint32 x)
 {
 {
@@ -210,7 +270,7 @@ SDL_Swap32(Uint32 x)
 
 
 #if HAS_BUILTIN_BSWAP64
 #if HAS_BUILTIN_BSWAP64
 #define SDL_Swap64(x) __builtin_bswap64(x)
 #define SDL_Swap64(x) __builtin_bswap64(x)
-#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
 #pragma intrinsic(_byteswap_uint64)
 #pragma intrinsic(_byteswap_uint64)
 #define SDL_Swap64(x) _byteswap_uint64(x)
 #define SDL_Swap64(x) _byteswap_uint64(x)
 #elif defined(__i386__) && !HAS_BROKEN_BSWAP
 #elif defined(__i386__) && !HAS_BROKEN_BSWAP
@@ -245,6 +305,16 @@ extern __inline Uint64 SDL_Swap64(Uint64);
   parm [eax edx]  \
   parm [eax edx]  \
   modify [eax edx];
   modify [eax edx];
 #else
 #else
+
+/**
+ * Use this function to swap the byte order of a 64-bit value.
+ *
+ * \param x the value to be swapped.
+ * \returns the swapped value.
+ *
+ * \sa SDL_SwapBE64
+ * \sa SDL_SwapLE64
+ */
 SDL_FORCE_INLINE Uint64
 SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
 SDL_Swap64(Uint64 x)
 {
 {
@@ -262,6 +332,15 @@ SDL_Swap64(Uint64 x)
 #endif
 #endif
 
 
 
 
+/**
+ * Use this function to swap the byte order of a floating point value.
+ *
+ * \param x the value to be swapped.
+ * \returns the swapped value.
+ *
+ * \sa SDL_SwapFloatBE
+ * \sa SDL_SwapFloatLE
+ */
 SDL_FORCE_INLINE float
 SDL_FORCE_INLINE float
 SDL_SwapFloat(float x)
 SDL_SwapFloat(float x)
 {
 {
@@ -314,4 +393,4 @@ SDL_SwapFloat(float x)
 
 
 #endif /* SDL_endian_h_ */
 #endif /* SDL_endian_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 10 - 9
bsp/simulator/SDL2/include/SDL_error.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_error.h
+ * # CategoryError
  *
  *
- *  Simple error message routines for SDL.
+ * Simple error message routines for SDL.
  */
  */
 
 
 #ifndef SDL_error_h_
 #ifndef SDL_error_h_
@@ -48,14 +48,15 @@ extern "C" {
  * failing result, leading to this idiom:
  * failing result, leading to this idiom:
  *
  *
  * ```c
  * ```c
- * if (error_code) {
+ * if (error_code)
+ {
  *     return SDL_SetError("This operation has failed: %d", error_code);
  *     return SDL_SetError("This operation has failed: %d", error_code);
  * }
  * }
  * ```
  * ```
  *
  *
- * \param fmt a printf()-style message format string
+ * \param fmt a printf()-style message format string.
  * \param ... additional parameters matching % tokens in the `fmt` string, if
  * \param ... additional parameters matching % tokens in the `fmt` string, if
- *            any
+ *            any.
  * \returns always -1.
  * \returns always -1.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -109,8 +110,8 @@ extern DECLSPEC const char *SDLCALL SDL_GetError(void);
  * otherwise operates exactly the same as SDL_GetError().
  * otherwise operates exactly the same as SDL_GetError().
  *
  *
  * \param errstr A buffer to fill with the last error message that was set for
  * \param errstr A buffer to fill with the last error message that was set for
- *               the current thread
- * \param maxlen The size of the buffer pointed to by the errstr parameter
+ *               the current thread.
+ * \param maxlen The size of the buffer pointed to by the errstr parameter.
  * \returns the pointer passed in as the `errstr` parameter.
  * \returns the pointer passed in as the `errstr` parameter.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -160,4 +161,4 @@ extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
 
 
 #endif /* SDL_error_h_ */
 #endif /* SDL_error_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 187 - 124
bsp/simulator/SDL2/include/SDL_events.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_events.h
+ * # CategoryEvents
  *
  *
- *  Include file for SDL event handling.
+ * Include file for SDL event handling.
  */
  */
 
 
 #ifndef SDL_events_h_
 #ifndef SDL_events_h_
@@ -52,7 +52,7 @@ extern "C" {
 /**
 /**
  * The types of events that can be delivered.
  * The types of events that can be delivered.
  */
  */
-typedef enum
+typedef enum SDL_EventType
 {
 {
     SDL_FIRSTEVENT     = 0,     /**< Unused (do not remove) */
     SDL_FIRSTEVENT     = 0,     /**< Unused (do not remove) */
 
 
@@ -102,6 +102,7 @@ typedef enum
     SDL_KEYMAPCHANGED,          /**< Keymap changed due to a system event such as an
     SDL_KEYMAPCHANGED,          /**< Keymap changed due to a system event such as an
                                      input language or keyboard layout change.
                                      input language or keyboard layout change.
                                 */
                                 */
+    SDL_TEXTEDITING_EXT,       /**< Extended keyboard text editing (composition) */
 
 
     /* Mouse events */
     /* Mouse events */
     SDL_MOUSEMOTION    = 0x400, /**< Mouse moved */
     SDL_MOUSEMOTION    = 0x400, /**< Mouse moved */
@@ -117,6 +118,7 @@ typedef enum
     SDL_JOYBUTTONUP,            /**< Joystick button released */
     SDL_JOYBUTTONUP,            /**< Joystick button released */
     SDL_JOYDEVICEADDED,         /**< A new joystick has been inserted into the system */
     SDL_JOYDEVICEADDED,         /**< A new joystick has been inserted into the system */
     SDL_JOYDEVICEREMOVED,       /**< An opened joystick has been removed */
     SDL_JOYDEVICEREMOVED,       /**< An opened joystick has been removed */
+    SDL_JOYBATTERYUPDATED,      /**< Joystick battery level change */
 
 
     /* Game controller events */
     /* Game controller events */
     SDL_CONTROLLERAXISMOTION  = 0x650, /**< Game controller axis motion */
     SDL_CONTROLLERAXISMOTION  = 0x650, /**< Game controller axis motion */
@@ -129,6 +131,8 @@ typedef enum
     SDL_CONTROLLERTOUCHPADMOTION,      /**< Game controller touchpad finger was moved */
     SDL_CONTROLLERTOUCHPADMOTION,      /**< Game controller touchpad finger was moved */
     SDL_CONTROLLERTOUCHPADUP,          /**< Game controller touchpad finger was lifted */
     SDL_CONTROLLERTOUCHPADUP,          /**< Game controller touchpad finger was lifted */
     SDL_CONTROLLERSENSORUPDATE,        /**< Game controller sensor was updated */
     SDL_CONTROLLERSENSORUPDATE,        /**< Game controller sensor was updated */
+    SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3,
+    SDL_CONTROLLERSTEAMHANDLEUPDATED,  /**< Game controller Steam handle has changed */
 
 
     /* Touch events */
     /* Touch events */
     SDL_FINGERDOWN      = 0x700,
     SDL_FINGERDOWN      = 0x700,
@@ -141,7 +145,7 @@ typedef enum
     SDL_MULTIGESTURE,
     SDL_MULTIGESTURE,
 
 
     /* Clipboard events */
     /* Clipboard events */
-    SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
+    SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard or primary selection changed */
 
 
     /* Drag and drop events */
     /* Drag and drop events */
     SDL_DROPFILE        = 0x1000, /**< The system requests a file open */
     SDL_DROPFILE        = 0x1000, /**< The system requests a file open */
@@ -163,7 +167,7 @@ typedef enum
     /* Internal events */
     /* Internal events */
     SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
     SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
 
 
-    /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
+    /** Events SDL_USEREVENT through SDL_LASTEVENT are for your use,
      *  and should be allocated with SDL_RegisterEvents()
      *  and should be allocated with SDL_RegisterEvents()
      */
      */
     SDL_USEREVENT    = 0x8000,
     SDL_USEREVENT    = 0x8000,
@@ -175,7 +179,7 @@ typedef enum
 } SDL_EventType;
 } SDL_EventType;
 
 
 /**
 /**
- *  \brief Fields shared by every event
+ * Fields shared by every event
  */
  */
 typedef struct SDL_CommonEvent
 typedef struct SDL_CommonEvent
 {
 {
@@ -184,14 +188,14 @@ typedef struct SDL_CommonEvent
 } SDL_CommonEvent;
 } SDL_CommonEvent;
 
 
 /**
 /**
- *  \brief Display state change event data (event.display.*)
+ * Display state change event data (event.display.*)
  */
  */
 typedef struct SDL_DisplayEvent
 typedef struct SDL_DisplayEvent
 {
 {
-    Uint32 type;        /**< ::SDL_DISPLAYEVENT */
+    Uint32 type;        /**< SDL_DISPLAYEVENT */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 display;     /**< The associated display index */
     Uint32 display;     /**< The associated display index */
-    Uint8 event;        /**< ::SDL_DisplayEventID */
+    Uint8 event;        /**< SDL_DisplayEventID */
     Uint8 padding1;
     Uint8 padding1;
     Uint8 padding2;
     Uint8 padding2;
     Uint8 padding3;
     Uint8 padding3;
@@ -199,14 +203,14 @@ typedef struct SDL_DisplayEvent
 } SDL_DisplayEvent;
 } SDL_DisplayEvent;
 
 
 /**
 /**
- *  \brief Window state change event data (event.window.*)
+ * Window state change event data (event.window.*)
  */
  */
 typedef struct SDL_WindowEvent
 typedef struct SDL_WindowEvent
 {
 {
-    Uint32 type;        /**< ::SDL_WINDOWEVENT */
+    Uint32 type;        /**< SDL_WINDOWEVENT */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The associated window */
     Uint32 windowID;    /**< The associated window */
-    Uint8 event;        /**< ::SDL_WindowEventID */
+    Uint8 event;        /**< SDL_WindowEventID */
     Uint8 padding1;
     Uint8 padding1;
     Uint8 padding2;
     Uint8 padding2;
     Uint8 padding3;
     Uint8 padding3;
@@ -215,14 +219,14 @@ typedef struct SDL_WindowEvent
 } SDL_WindowEvent;
 } SDL_WindowEvent;
 
 
 /**
 /**
- *  \brief Keyboard button event structure (event.key.*)
+ * Keyboard button event structure (event.key.*)
  */
  */
 typedef struct SDL_KeyboardEvent
 typedef struct SDL_KeyboardEvent
 {
 {
-    Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
+    Uint32 type;        /**< SDL_KEYDOWN or SDL_KEYUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The window with keyboard focus, if any */
     Uint32 windowID;    /**< The window with keyboard focus, if any */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
+    Uint8 state;        /**< SDL_PRESSED or SDL_RELEASED */
     Uint8 repeat;       /**< Non-zero if this is a key repeat */
     Uint8 repeat;       /**< Non-zero if this is a key repeat */
     Uint8 padding2;
     Uint8 padding2;
     Uint8 padding3;
     Uint8 padding3;
@@ -230,12 +234,13 @@ typedef struct SDL_KeyboardEvent
 } SDL_KeyboardEvent;
 } SDL_KeyboardEvent;
 
 
 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
+
 /**
 /**
- *  \brief Keyboard text editing event structure (event.edit.*)
+ * Keyboard text editing event structure (event.edit.*)
  */
  */
 typedef struct SDL_TextEditingEvent
 typedef struct SDL_TextEditingEvent
 {
 {
-    Uint32 type;                                /**< ::SDL_TEXTEDITING */
+    Uint32 type;                                /**< SDL_TEXTEDITING */
     Uint32 timestamp;                           /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;                           /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;                            /**< The window with keyboard focus, if any */
     Uint32 windowID;                            /**< The window with keyboard focus, if any */
     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
@@ -243,25 +248,57 @@ typedef struct SDL_TextEditingEvent
     Sint32 length;                              /**< The length of selected editing text */
     Sint32 length;                              /**< The length of selected editing text */
 } SDL_TextEditingEvent;
 } SDL_TextEditingEvent;
 
 
+/**
+ * Extended keyboard text editing event structure (event.editExt.*) when text
+ * would be truncated if stored in the text buffer SDL_TextEditingEvent
+ */
+typedef struct SDL_TextEditingExtEvent
+{
+    Uint32 type;                                /**< SDL_TEXTEDITING_EXT */
+    Uint32 timestamp;                           /**< In milliseconds, populated using SDL_GetTicks() */
+    Uint32 windowID;                            /**< The window with keyboard focus, if any */
+    char* text;                                 /**< The editing text, which should be freed with SDL_free(), and will not be NULL */
+    Sint32 start;                               /**< The start cursor of selected editing text */
+    Sint32 length;                              /**< The length of selected editing text */
+} SDL_TextEditingExtEvent;
 
 
+/**
+ * The maximum bytes of text that can be supplied in an SDL_TextInputEvent.
+ */
 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
+
 /**
 /**
- *  \brief Keyboard text input event structure (event.text.*)
+ * Keyboard text input event structure (event.text.*)
+ *
+ * `text` is limited to SDL_TEXTINPUTEVENT_TEXT_SIZE bytes. If the incoming
+ * string is larger than this, SDL will split it and send it in pieces, across
+ * multiple events. The string is in UTF-8 format, and if split, SDL
+ * guarantees that it will not split in the middle of a UTF-8 sequence, so any
+ * event will only contain complete codepoints. However, if there are several
+ * codepoints that go together into a single glyph (like an emoji "thumbs up"
+ * followed by a skin color), they may be split between events.
+ *
+ * This event will never be delivered unless text input is enabled by calling
+ * SDL_StartTextInput(). Text input is enabled by default on desktop
+ * platforms, and disabled by default on mobile platforms!
+ *
+ * \sa SDL_StartTextInput
+ * \sa SDL_StopTextInput
  */
  */
 typedef struct SDL_TextInputEvent
 typedef struct SDL_TextInputEvent
 {
 {
-    Uint32 type;                              /**< ::SDL_TEXTINPUT */
+    Uint32 type;                              /**< SDL_TEXTINPUT */
     Uint32 timestamp;                         /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;                         /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;                          /**< The window with keyboard focus, if any */
     Uint32 windowID;                          /**< The window with keyboard focus, if any */
-    char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
+    char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text; UTF-8 encoded. */
 } SDL_TextInputEvent;
 } SDL_TextInputEvent;
 
 
 /**
 /**
- *  \brief Mouse motion event structure (event.motion.*)
+ * Mouse motion event structure (event.motion.*)
  */
  */
 typedef struct SDL_MouseMotionEvent
 typedef struct SDL_MouseMotionEvent
 {
 {
-    Uint32 type;        /**< ::SDL_MOUSEMOTION */
+    Uint32 type;        /**< SDL_MOUSEMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
@@ -273,16 +310,16 @@ typedef struct SDL_MouseMotionEvent
 } SDL_MouseMotionEvent;
 } SDL_MouseMotionEvent;
 
 
 /**
 /**
- *  \brief Mouse button event structure (event.button.*)
+ * Mouse button event structure (event.button.*)
  */
  */
 typedef struct SDL_MouseButtonEvent
 typedef struct SDL_MouseButtonEvent
 {
 {
-    Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
+    Uint32 type;        /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
     Uint8 button;       /**< The mouse button index */
     Uint8 button;       /**< The mouse button index */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
+    Uint8 state;        /**< SDL_PRESSED or SDL_RELEASED */
     Uint8 clicks;       /**< 1 for single-click, 2 for double-click, etc. */
     Uint8 clicks;       /**< 1 for single-click, 2 for double-click, etc. */
     Uint8 padding1;
     Uint8 padding1;
     Sint32 x;           /**< X coordinate, relative to window */
     Sint32 x;           /**< X coordinate, relative to window */
@@ -290,11 +327,11 @@ typedef struct SDL_MouseButtonEvent
 } SDL_MouseButtonEvent;
 } SDL_MouseButtonEvent;
 
 
 /**
 /**
- *  \brief Mouse wheel event structure (event.wheel.*)
+ * Mouse wheel event structure (event.wheel.*)
  */
  */
 typedef struct SDL_MouseWheelEvent
 typedef struct SDL_MouseWheelEvent
 {
 {
-    Uint32 type;        /**< ::SDL_MOUSEWHEEL */
+    Uint32 type;        /**< SDL_MOUSEWHEEL */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
@@ -303,14 +340,16 @@ typedef struct SDL_MouseWheelEvent
     Uint32 direction;   /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
     Uint32 direction;   /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
     float preciseX;     /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
     float preciseX;     /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
     float preciseY;     /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
     float preciseY;     /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
+    Sint32 mouseX;      /**< X coordinate, relative to window (added in 2.26.0) */
+    Sint32 mouseY;      /**< Y coordinate, relative to window (added in 2.26.0) */
 } SDL_MouseWheelEvent;
 } SDL_MouseWheelEvent;
 
 
 /**
 /**
- *  \brief Joystick axis motion event structure (event.jaxis.*)
+ * Joystick axis motion event structure (event.jaxis.*)
  */
  */
 typedef struct SDL_JoyAxisEvent
 typedef struct SDL_JoyAxisEvent
 {
 {
-    Uint32 type;        /**< ::SDL_JOYAXISMOTION */
+    Uint32 type;        /**< SDL_JOYAXISMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 axis;         /**< The joystick axis index */
     Uint8 axis;         /**< The joystick axis index */
@@ -322,11 +361,11 @@ typedef struct SDL_JoyAxisEvent
 } SDL_JoyAxisEvent;
 } SDL_JoyAxisEvent;
 
 
 /**
 /**
- *  \brief Joystick trackball motion event structure (event.jball.*)
+ * Joystick trackball motion event structure (event.jball.*)
  */
  */
 typedef struct SDL_JoyBallEvent
 typedef struct SDL_JoyBallEvent
 {
 {
-    Uint32 type;        /**< ::SDL_JOYBALLMOTION */
+    Uint32 type;        /**< SDL_JOYBALLMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 ball;         /**< The joystick trackball index */
     Uint8 ball;         /**< The joystick trackball index */
@@ -338,18 +377,18 @@ typedef struct SDL_JoyBallEvent
 } SDL_JoyBallEvent;
 } SDL_JoyBallEvent;
 
 
 /**
 /**
- *  \brief Joystick hat position change event structure (event.jhat.*)
+ * Joystick hat position change event structure (event.jhat.*)
  */
  */
 typedef struct SDL_JoyHatEvent
 typedef struct SDL_JoyHatEvent
 {
 {
-    Uint32 type;        /**< ::SDL_JOYHATMOTION */
+    Uint32 type;        /**< SDL_JOYHATMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 hat;          /**< The joystick hat index */
     Uint8 hat;          /**< The joystick hat index */
     Uint8 value;        /**< The hat position value.
     Uint8 value;        /**< The hat position value.
-                         *   \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
-                         *   \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
-                         *   \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
+                         *   \sa SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
+                         *   \sa SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
+                         *   \sa SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
                          *
                          *
                          *   Note that zero means the POV is centered.
                          *   Note that zero means the POV is centered.
                          */
                          */
@@ -358,36 +397,51 @@ typedef struct SDL_JoyHatEvent
 } SDL_JoyHatEvent;
 } SDL_JoyHatEvent;
 
 
 /**
 /**
- *  \brief Joystick button event structure (event.jbutton.*)
+ * Joystick button event structure (event.jbutton.*)
  */
  */
 typedef struct SDL_JoyButtonEvent
 typedef struct SDL_JoyButtonEvent
 {
 {
-    Uint32 type;        /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
+    Uint32 type;        /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 button;       /**< The joystick button index */
     Uint8 button;       /**< The joystick button index */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
+    Uint8 state;        /**< SDL_PRESSED or SDL_RELEASED */
     Uint8 padding1;
     Uint8 padding1;
     Uint8 padding2;
     Uint8 padding2;
 } SDL_JoyButtonEvent;
 } SDL_JoyButtonEvent;
 
 
 /**
 /**
- *  \brief Joystick device event structure (event.jdevice.*)
+ * Joystick device event structure (event.jdevice.*)
+ *
+ * SDL will send JOYSTICK_ADDED events for devices that are already plugged in
+ * during SDL_Init.
+ *
+ * \sa SDL_ControllerDeviceEvent
  */
  */
 typedef struct SDL_JoyDeviceEvent
 typedef struct SDL_JoyDeviceEvent
 {
 {
-    Uint32 type;        /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
+    Uint32 type;        /**< SDL_JOYDEVICEADDED or SDL_JOYDEVICEREMOVED */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
 } SDL_JoyDeviceEvent;
 } SDL_JoyDeviceEvent;
 
 
+/**
+ * Joysick battery level change event structure (event.jbattery.*)
+ */
+typedef struct SDL_JoyBatteryEvent
+{
+    Uint32 type;        /**< SDL_JOYBATTERYUPDATED */
+    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
+    SDL_JoystickID which; /**< The joystick instance id */
+    SDL_JoystickPowerLevel level; /**< The joystick battery level */
+} SDL_JoyBatteryEvent;
 
 
 /**
 /**
- *  \brief Game controller axis motion event structure (event.caxis.*)
+ * Game controller axis motion event structure (event.caxis.*)
  */
  */
 typedef struct SDL_ControllerAxisEvent
 typedef struct SDL_ControllerAxisEvent
 {
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERAXISMOTION */
+    Uint32 type;        /**< SDL_CONTROLLERAXISMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 axis;         /**< The controller axis (SDL_GameControllerAxis) */
     Uint8 axis;         /**< The controller axis (SDL_GameControllerAxis) */
@@ -400,36 +454,42 @@ typedef struct SDL_ControllerAxisEvent
 
 
 
 
 /**
 /**
- *  \brief Game controller button event structure (event.cbutton.*)
+ * Game controller button event structure (event.cbutton.*)
  */
  */
 typedef struct SDL_ControllerButtonEvent
 typedef struct SDL_ControllerButtonEvent
 {
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
+    Uint32 type;        /**< SDL_CONTROLLERBUTTONDOWN or SDL_CONTROLLERBUTTONUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 button;       /**< The controller button (SDL_GameControllerButton) */
     Uint8 button;       /**< The controller button (SDL_GameControllerButton) */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
+    Uint8 state;        /**< SDL_PRESSED or SDL_RELEASED */
     Uint8 padding1;
     Uint8 padding1;
     Uint8 padding2;
     Uint8 padding2;
 } SDL_ControllerButtonEvent;
 } SDL_ControllerButtonEvent;
 
 
 
 
 /**
 /**
- *  \brief Controller device event structure (event.cdevice.*)
+ * Controller device event structure (event.cdevice.*)
+ *
+ * Joysticks that are supported game controllers receive both an
+ * SDL_JoyDeviceEvent and an SDL_ControllerDeviceEvent.
+ *
+ * SDL will send CONTROLLERDEVICEADDED events for joysticks that are already
+ * plugged in during SDL_Init() and are recognized as game controllers.
  */
  */
 typedef struct SDL_ControllerDeviceEvent
 typedef struct SDL_ControllerDeviceEvent
 {
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
+    Uint32 type;        /**< SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED, or SDL_CONTROLLERSTEAMHANDLEUPDATED */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
 } SDL_ControllerDeviceEvent;
 } SDL_ControllerDeviceEvent;
 
 
 /**
 /**
- *  \brief Game controller touchpad event structure (event.ctouchpad.*)
+ * Game controller touchpad event structure (event.ctouchpad.*)
  */
  */
 typedef struct SDL_ControllerTouchpadEvent
 typedef struct SDL_ControllerTouchpadEvent
 {
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
+    Uint32 type;        /**< SDL_CONTROLLERTOUCHPADDOWN or SDL_CONTROLLERTOUCHPADMOTION or SDL_CONTROLLERTOUCHPADUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     SDL_JoystickID which; /**< The joystick instance id */
     Sint32 touchpad;    /**< The index of the touchpad */
     Sint32 touchpad;    /**< The index of the touchpad */
@@ -440,23 +500,24 @@ typedef struct SDL_ControllerTouchpadEvent
 } SDL_ControllerTouchpadEvent;
 } SDL_ControllerTouchpadEvent;
 
 
 /**
 /**
- *  \brief Game controller sensor event structure (event.csensor.*)
+ * Game controller sensor event structure (event.csensor.*)
  */
  */
 typedef struct SDL_ControllerSensorEvent
 typedef struct SDL_ControllerSensorEvent
 {
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERSENSORUPDATE */
+    Uint32 type;        /**< SDL_CONTROLLERSENSORUPDATE */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     SDL_JoystickID which; /**< The joystick instance id */
-    Sint32 sensor;      /**< The type of the sensor, one of the values of ::SDL_SensorType */
+    Sint32 sensor;      /**< The type of the sensor, one of the values of SDL_SensorType */
     float data[3];      /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
     float data[3];      /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
+    Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
 } SDL_ControllerSensorEvent;
 } SDL_ControllerSensorEvent;
 
 
 /**
 /**
- *  \brief Audio device event structure (event.adevice.*)
+ * Audio device event structure (event.adevice.*)
  */
  */
 typedef struct SDL_AudioDeviceEvent
 typedef struct SDL_AudioDeviceEvent
 {
 {
-    Uint32 type;        /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
+    Uint32 type;        /**< SDL_AUDIODEVICEADDED, or SDL_AUDIODEVICEREMOVED */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 which;       /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
     Uint32 which;       /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
     Uint8 iscapture;    /**< zero if an output device, non-zero if a capture device. */
     Uint8 iscapture;    /**< zero if an output device, non-zero if a capture device. */
@@ -467,11 +528,11 @@ typedef struct SDL_AudioDeviceEvent
 
 
 
 
 /**
 /**
- *  \brief Touch finger event structure (event.tfinger.*)
+ * Touch finger event structure (event.tfinger.*)
  */
  */
 typedef struct SDL_TouchFingerEvent
 typedef struct SDL_TouchFingerEvent
 {
 {
-    Uint32 type;        /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
+    Uint32 type;        /**< SDL_FINGERMOTION or SDL_FINGERDOWN or SDL_FINGERUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_TouchID touchId; /**< The touch device id */
     SDL_TouchID touchId; /**< The touch device id */
     SDL_FingerID fingerId;
     SDL_FingerID fingerId;
@@ -485,11 +546,11 @@ typedef struct SDL_TouchFingerEvent
 
 
 
 
 /**
 /**
- *  \brief Multiple Finger Gesture Event (event.mgesture.*)
+ * Multiple Finger Gesture Event (event.mgesture.*)
  */
  */
 typedef struct SDL_MultiGestureEvent
 typedef struct SDL_MultiGestureEvent
 {
 {
-    Uint32 type;        /**< ::SDL_MULTIGESTURE */
+    Uint32 type;        /**< SDL_MULTIGESTURE */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_TouchID touchId; /**< The touch device id */
     SDL_TouchID touchId; /**< The touch device id */
     float dTheta;
     float dTheta;
@@ -502,11 +563,11 @@ typedef struct SDL_MultiGestureEvent
 
 
 
 
 /**
 /**
- * \brief Dollar Gesture Event (event.dgesture.*)
+ * Dollar Gesture Event (event.dgesture.*)
  */
  */
 typedef struct SDL_DollarGestureEvent
 typedef struct SDL_DollarGestureEvent
 {
 {
-    Uint32 type;        /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
+    Uint32 type;        /**< SDL_DOLLARGESTURE or SDL_DOLLARRECORD */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_TouchID touchId; /**< The touch device id */
     SDL_TouchID touchId; /**< The touch device id */
     SDL_GestureID gestureId;
     SDL_GestureID gestureId;
@@ -518,13 +579,15 @@ typedef struct SDL_DollarGestureEvent
 
 
 
 
 /**
 /**
- *  \brief An event used to request a file open by the system (event.drop.*)
- *         This event is enabled by default, you can disable it with SDL_EventState().
- *  \note If this event is enabled, you must free the filename in the event.
+ * An event used to request a file open by the system (event.drop.*)
+ *
+ * This event is enabled by default, you can disable it with SDL_EventState().
+ *
+ * If this event is enabled, you must free the filename in the event.
  */
  */
 typedef struct SDL_DropEvent
 typedef struct SDL_DropEvent
 {
 {
-    Uint32 type;        /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
+    Uint32 type;        /**< SDL_DROPBEGIN or SDL_DROPFILE or SDL_DROPTEXT or SDL_DROPCOMPLETE */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     char *file;         /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
     char *file;         /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
     Uint32 windowID;    /**< The window that was dropped on, if any */
     Uint32 windowID;    /**< The window that was dropped on, if any */
@@ -532,40 +595,32 @@ typedef struct SDL_DropEvent
 
 
 
 
 /**
 /**
- *  \brief Sensor event structure (event.sensor.*)
+ * Sensor event structure (event.sensor.*)
  */
  */
 typedef struct SDL_SensorEvent
 typedef struct SDL_SensorEvent
 {
 {
-    Uint32 type;        /**< ::SDL_SENSORUPDATE */
+    Uint32 type;        /**< SDL_SENSORUPDATE */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Sint32 which;       /**< The instance ID of the sensor */
     Sint32 which;       /**< The instance ID of the sensor */
     float data[6];      /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
     float data[6];      /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
+    Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
 } SDL_SensorEvent;
 } SDL_SensorEvent;
 
 
 /**
 /**
- *  \brief The "quit requested" event
+ * The "quit requested" event
  */
  */
 typedef struct SDL_QuitEvent
 typedef struct SDL_QuitEvent
 {
 {
-    Uint32 type;        /**< ::SDL_QUIT */
+    Uint32 type;        /**< SDL_QUIT */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
 } SDL_QuitEvent;
 } SDL_QuitEvent;
 
 
 /**
 /**
- *  \brief OS Specific event
- */
-typedef struct SDL_OSEvent
-{
-    Uint32 type;        /**< ::SDL_QUIT */
-    Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
-} SDL_OSEvent;
-
-/**
- *  \brief A user-defined event type (event.user.*)
+ * A user-defined event type (event.user.*)
  */
  */
 typedef struct SDL_UserEvent
 typedef struct SDL_UserEvent
 {
 {
-    Uint32 type;        /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
+    Uint32 type;        /**< SDL_USEREVENT through SDL_LASTEVENT-1 */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The associated window if any */
     Uint32 windowID;    /**< The associated window if any */
     Sint32 code;        /**< User defined event code */
     Sint32 code;        /**< User defined event code */
@@ -578,20 +633,24 @@ struct SDL_SysWMmsg;
 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
 
 
 /**
 /**
- *  \brief A video driver dependent system event (event.syswm.*)
- *         This event is disabled by default, you can enable it with SDL_EventState()
+ * A video driver dependent system event (event.syswm.*)
+ *
+ * This event is disabled by default, you can enable it with SDL_EventState()
  *
  *
- *  \note If you want to use this event, you should include SDL_syswm.h.
+ * If you want to use this event, you should include SDL_syswm.h.
  */
  */
 typedef struct SDL_SysWMEvent
 typedef struct SDL_SysWMEvent
 {
 {
-    Uint32 type;        /**< ::SDL_SYSWMEVENT */
+    Uint32 type;        /**< SDL_SYSWMEVENT */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_SysWMmsg *msg;  /**< driver dependent data, defined in SDL_syswm.h */
     SDL_SysWMmsg *msg;  /**< driver dependent data, defined in SDL_syswm.h */
 } SDL_SysWMEvent;
 } SDL_SysWMEvent;
 
 
 /**
 /**
- *  \brief General event structure
+ * General event structure
+ *
+ * The SDL_Event structure is the core of all event handling in SDL. SDL_Event
+ * is a union of all event structures used in SDL.
  */
  */
 typedef union SDL_Event
 typedef union SDL_Event
 {
 {
@@ -601,6 +660,7 @@ typedef union SDL_Event
     SDL_WindowEvent window;                 /**< Window event data */
     SDL_WindowEvent window;                 /**< Window event data */
     SDL_KeyboardEvent key;                  /**< Keyboard event data */
     SDL_KeyboardEvent key;                  /**< Keyboard event data */
     SDL_TextEditingEvent edit;              /**< Text editing event data */
     SDL_TextEditingEvent edit;              /**< Text editing event data */
+    SDL_TextEditingExtEvent editExt;        /**< Extended text editing event data */
     SDL_TextInputEvent text;                /**< Text input event data */
     SDL_TextInputEvent text;                /**< Text input event data */
     SDL_MouseMotionEvent motion;            /**< Mouse motion event data */
     SDL_MouseMotionEvent motion;            /**< Mouse motion event data */
     SDL_MouseButtonEvent button;            /**< Mouse button event data */
     SDL_MouseButtonEvent button;            /**< Mouse button event data */
@@ -610,6 +670,7 @@ typedef union SDL_Event
     SDL_JoyHatEvent jhat;                   /**< Joystick hat event data */
     SDL_JoyHatEvent jhat;                   /**< Joystick hat event data */
     SDL_JoyButtonEvent jbutton;             /**< Joystick button event data */
     SDL_JoyButtonEvent jbutton;             /**< Joystick button event data */
     SDL_JoyDeviceEvent jdevice;             /**< Joystick device change event data */
     SDL_JoyDeviceEvent jdevice;             /**< Joystick device change event data */
+    SDL_JoyBatteryEvent jbattery;           /**< Joystick battery event data */
     SDL_ControllerAxisEvent caxis;          /**< Game Controller axis event data */
     SDL_ControllerAxisEvent caxis;          /**< Game Controller axis event data */
     SDL_ControllerButtonEvent cbutton;      /**< Game Controller button event data */
     SDL_ControllerButtonEvent cbutton;      /**< Game Controller button event data */
     SDL_ControllerDeviceEvent cdevice;      /**< Game Controller device event data */
     SDL_ControllerDeviceEvent cdevice;      /**< Game Controller device event data */
@@ -672,7 +733,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NUL
 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
 
 
 /* @{ */
 /* @{ */
-typedef enum
+typedef enum SDL_eventaction
 {
 {
     SDL_ADDEVENT,
     SDL_ADDEVENT,
     SDL_PEEKEVENT,
     SDL_PEEKEVENT,
@@ -699,15 +760,15 @@ typedef enum
  *
  *
  * This function is thread-safe.
  * This function is thread-safe.
  *
  *
- * \param events destination buffer for the retrieved events
+ * \param events destination buffer for the retrieved events.
  * \param numevents if action is SDL_ADDEVENT, the number of events to add
  * \param numevents if action is SDL_ADDEVENT, the number of events to add
  *                  back to the event queue; if action is SDL_PEEKEVENT or
  *                  back to the event queue; if action is SDL_PEEKEVENT or
- *                  SDL_GETEVENT, the maximum number of events to retrieve
- * \param action action to take; see [[#action|Remarks]] for details
+ *                  SDL_GETEVENT, the maximum number of events to retrieve.
+ * \param action action to take; see [[#action|Remarks]] for details.
  * \param minType minimum value of the event type to be considered;
  * \param minType minimum value of the event type to be considered;
- *                SDL_FIRSTEVENT is a safe choice
+ *                SDL_FIRSTEVENT is a safe choice.
  * \param maxType maximum value of the event type to be considered;
  * \param maxType maximum value of the event type to be considered;
- *                SDL_LASTEVENT is a safe choice
+ *                SDL_LASTEVENT is a safe choice.
  * \returns the number of events actually stored or a negative error code on
  * \returns the number of events actually stored or a negative error code on
  *          failure; call SDL_GetError() for more information.
  *          failure; call SDL_GetError() for more information.
  *
  *
@@ -728,7 +789,7 @@ extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
  * If you need to check for a range of event types, use SDL_HasEvents()
  * If you need to check for a range of event types, use SDL_HasEvents()
  * instead.
  * instead.
  *
  *
- * \param type the type of event to be queried; see SDL_EventType for details
+ * \param type the type of event to be queried; see SDL_EventType for details.
  * \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if
  * \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if
  *          events matching `type` are not present.
  *          events matching `type` are not present.
  *
  *
@@ -745,9 +806,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
  * If you need to check for a single event type, use SDL_HasEvent() instead.
  * If you need to check for a single event type, use SDL_HasEvent() instead.
  *
  *
  * \param minType the low end of event type to be queried, inclusive; see
  * \param minType the low end of event type to be queried, inclusive; see
- *                SDL_EventType for details
+ *                SDL_EventType for details.
  * \param maxType the high end of event type to be queried, inclusive; see
  * \param maxType the high end of event type to be queried, inclusive; see
- *                SDL_EventType for details
+ *                SDL_EventType for details.
  * \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are
  * \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are
  *          present, or SDL_FALSE if not.
  *          present, or SDL_FALSE if not.
  *
  *
@@ -771,7 +832,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
  * sure that all pending OS events are flushed, you can call SDL_PumpEvents()
  * sure that all pending OS events are flushed, you can call SDL_PumpEvents()
  * on the main thread immediately before the flush call.
  * on the main thread immediately before the flush call.
  *
  *
- * \param type the type of event to be cleared; see SDL_EventType for details
+ * \param type the type of event to be cleared; see SDL_EventType for details.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -794,9 +855,9 @@ extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
  * on the main thread immediately before the flush call.
  * on the main thread immediately before the flush call.
  *
  *
  * \param minType the low end of event type to be cleared, inclusive; see
  * \param minType the low end of event type to be cleared, inclusive; see
- *                SDL_EventType for details
+ *                SDL_EventType for details.
  * \param maxType the high end of event type to be cleared, inclusive; see
  * \param maxType the high end of event type to be cleared, inclusive; see
- *                SDL_EventType for details
+ *                SDL_EventType for details.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -826,9 +887,11 @@ extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
  * usually as a first step before updating the game's state:
  * usually as a first step before updating the game's state:
  *
  *
  * ```c
  * ```c
- * while (game_is_still_running) {
+ * while (game_is_still_running)
+ {
  *     SDL_Event event;
  *     SDL_Event event;
- *     while (SDL_PollEvent(&event)) {  // poll until all events are handled!
+ *     while (SDL_PollEvent(&event))
+ {  // poll until all events are handled!
  *         // decide what to do with this event.
  *         // decide what to do with this event.
  *     }
  *     }
  *
  *
@@ -837,7 +900,7 @@ extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
  * ```
  * ```
  *
  *
  * \param event the SDL_Event structure to be filled with the next event from
  * \param event the SDL_Event structure to be filled with the next event from
- *              the queue, or NULL
+ *              the queue, or NULL.
  * \returns 1 if there is a pending event or 0 if there are none available.
  * \returns 1 if there is a pending event or 0 if there are none available.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -861,7 +924,7 @@ extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
  * this function in the thread that initialized the video subsystem.
  * this function in the thread that initialized the video subsystem.
  *
  *
  * \param event the SDL_Event structure to be filled in with the next event
  * \param event the SDL_Event structure to be filled in with the next event
- *              from the queue, or NULL
+ *              from the queue, or NULL.
  * \returns 1 on success or 0 if there was an error while waiting for events;
  * \returns 1 on success or 0 if there was an error while waiting for events;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
  *
  *
@@ -884,9 +947,9 @@ extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
  * this function in the thread that initialized the video subsystem.
  * this function in the thread that initialized the video subsystem.
  *
  *
  * \param event the SDL_Event structure to be filled in with the next event
  * \param event the SDL_Event structure to be filled in with the next event
- *              from the queue, or NULL
+ *              from the queue, or NULL.
  * \param timeout the maximum number of milliseconds to wait for the next
  * \param timeout the maximum number of milliseconds to wait for the next
- *                available event
+ *                available event.
  * \returns 1 on success or 0 if there was an error while waiting for events;
  * \returns 1 on success or 0 if there was an error while waiting for events;
  *          call SDL_GetError() for more information. This also returns 0 if
  *          call SDL_GetError() for more information. This also returns 0 if
  *          the timeout elapsed without an event arriving.
  *          the timeout elapsed without an event arriving.
@@ -921,7 +984,7 @@ extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
  * get an event type that does not conflict with other code that also wants
  * get an event type that does not conflict with other code that also wants
  * its own custom event types.
  * its own custom event types.
  *
  *
- * \param event the SDL_Event to be added to the queue
+ * \param event the SDL_Event to be added to the queue.
  * \returns 1 on success, 0 if the event was filtered, or a negative error
  * \returns 1 on success, 0 if the event was filtered, or a negative error
  *          code on failure; call SDL_GetError() for more information. A
  *          code on failure; call SDL_GetError() for more information. A
  *          common reason for error is the event queue being full.
  *          common reason for error is the event queue being full.
@@ -937,11 +1000,11 @@ extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
 /**
 /**
  * A function pointer used for callbacks that watch the event queue.
  * A function pointer used for callbacks that watch the event queue.
  *
  *
- * \param userdata what was passed as `userdata` to SDL_SetEventFilter()
- *        or SDL_AddEventWatch, etc
- * \param event the event that triggered the callback
- * \returns 1 to permit event to be added to the queue, and 0 to disallow
- *          it. When used with SDL_AddEventWatch, the return value is ignored.
+ * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or
+ *                 SDL_AddEventWatch, etc.
+ * \param event the event that triggered the callback.
+ * \returns 1 to permit event to be added to the queue, and 0 to disallow it.
+ *          When used with SDL_AddEventWatch, the return value is ignored.
  *
  *
  * \sa SDL_SetEventFilter
  * \sa SDL_SetEventFilter
  * \sa SDL_AddEventWatch
  * \sa SDL_AddEventWatch
@@ -964,7 +1027,7 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
  * interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the
  * interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the
  * application at the next event poll.
  * application at the next event poll.
  *
  *
- * There is one caveat when dealing with the ::SDL_QuitEvent event type. The
+ * There is one caveat when dealing with the SDL_QuitEvent event type. The
  * event filter is only called when the window manager desires to close the
  * event filter is only called when the window manager desires to close the
  * application window. If the event filter returns 1, then the window will be
  * application window. If the event filter returns 1, then the window will be
  * closed, otherwise the window will remain open if possible.
  * closed, otherwise the window will remain open if possible.
@@ -979,8 +1042,8 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
  * the event filter, but events pushed onto the queue with SDL_PeepEvents() do
  * the event filter, but events pushed onto the queue with SDL_PeepEvents() do
  * not.
  * not.
  *
  *
- * \param filter An SDL_EventFilter function to call when an event happens
- * \param userdata a pointer that is passed to `filter`
+ * \param filter An SDL_EventFilter function to call when an event happens.
+ * \param userdata a pointer that is passed to `filter`.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -999,9 +1062,9 @@ extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
  * This function can be used to "chain" filters, by saving the existing filter
  * This function can be used to "chain" filters, by saving the existing filter
  * before replacing it with a function that will call that saved filter.
  * before replacing it with a function that will call that saved filter.
  *
  *
- * \param filter the current callback function will be stored here
+ * \param filter the current callback function will be stored here.
  * \param userdata the pointer that is passed to the current event filter will
  * \param userdata the pointer that is passed to the current event filter will
- *                 be stored here
+ *                 be stored here.
  * \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set.
  * \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -1030,7 +1093,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
  * through SDL_PeepEvents().
  * through SDL_PeepEvents().
  *
  *
  * \param filter an SDL_EventFilter function to call when an event happens.
  * \param filter an SDL_EventFilter function to call when an event happens.
- * \param userdata a pointer that is passed to `filter`
+ * \param userdata a pointer that is passed to `filter`.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -1046,8 +1109,8 @@ extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
  * This function takes the same input as SDL_AddEventWatch() to identify and
  * This function takes the same input as SDL_AddEventWatch() to identify and
  * delete the corresponding callback.
  * delete the corresponding callback.
  *
  *
- * \param filter the function originally passed to SDL_AddEventWatch()
- * \param userdata the pointer originally passed to SDL_AddEventWatch()
+ * \param filter the function originally passed to SDL_AddEventWatch().
+ * \param userdata the pointer originally passed to SDL_AddEventWatch().
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -1064,8 +1127,8 @@ extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
  * this function does not change the filter permanently, it only uses the
  * this function does not change the filter permanently, it only uses the
  * supplied filter until this function returns.
  * supplied filter until this function returns.
  *
  *
- * \param filter the SDL_EventFilter function to call when an event happens
- * \param userdata a pointer that is passed to `filter`
+ * \param filter the SDL_EventFilter function to call when an event happens.
+ * \param userdata a pointer that is passed to `filter`.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -1091,8 +1154,8 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
  *   from the event queue and will not be filtered
  *   from the event queue and will not be filtered
  * - `SDL_ENABLE`: the event will be processed normally
  * - `SDL_ENABLE`: the event will be processed normally
  *
  *
- * \param type the type of event; see SDL_EventType for details
- * \param state how to process the event
+ * \param type the type of event; see SDL_EventType for details.
+ * \param state how to process the event.
  * \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state
  * \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state
  *          of the event before this function makes any changes to it.
  *          of the event before this function makes any changes to it.
  *
  *
@@ -1114,7 +1177,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
  * Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or
  * Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or
  * 0xFFFFFFFF), but is clearer to write.
  * 0xFFFFFFFF), but is clearer to write.
  *
  *
- * \param numevents the number of events to be allocated
+ * \param numevents the number of events to be allocated.
  * \returns the beginning event number, or (Uint32)-1 if there are not enough
  * \returns the beginning event number, or (Uint32)-1 if there are not enough
  *          user-defined events left.
  *          user-defined events left.
  *
  *
@@ -1132,4 +1195,4 @@ extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
 
 
 #endif /* SDL_events_h_ */
 #endif /* SDL_events_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 13 - 9
bsp/simulator/SDL2/include/SDL_filesystem.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_filesystem.h
+ * # CategoryFilesystem
  *
  *
- *  \brief Include file for filesystem SDL API functions
+ * Include file for filesystem SDL API functions
  */
  */
 
 
 #ifndef SDL_filesystem_h_
 #ifndef SDL_filesystem_h_
@@ -60,7 +60,11 @@ extern "C" {
  * - `parent`: the containing directory of the bundle. For example:
  * - `parent`: the containing directory of the bundle. For example:
  *   `/Applications/SDLApp/`
  *   `/Applications/SDLApp/`
  *
  *
- * The returned path is guaranteed to end with a path separator ('\' on
+ * **Nintendo 3DS Specific Functionality**: This function returns "romfs"
+ * directory of the application as it is uncommon to store resources outside
+ * the executable. As such it is not a writable directory.
+ *
+ * The returned path is guaranteed to end with a path separator ('\\' on
  * Windows, '/' on most other platforms).
  * Windows, '/' on most other platforms).
  *
  *
  * The pointer returned is owned by the caller. Please call SDL_free() on the
  * The pointer returned is owned by the caller. Please call SDL_free() on the
@@ -92,7 +96,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
  *
  *
  * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
  * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
  *
  *
- * On Linux, the string might look like"
+ * On Linux, the string might look like:
  *
  *
  * `/home/bob/.local/share/My Program Name/`
  * `/home/bob/.local/share/My Program Name/`
  *
  *
@@ -116,14 +120,14 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
  * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game
  * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game
  *   Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
  *   Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
  *
  *
- * The returned path is guaranteed to end with a path separator ('\' on
+ * The returned path is guaranteed to end with a path separator ('\\' on
  * Windows, '/' on most other platforms).
  * Windows, '/' on most other platforms).
  *
  *
  * The pointer returned is owned by the caller. Please call SDL_free() on the
  * The pointer returned is owned by the caller. Please call SDL_free() on the
  * pointer when done with it.
  * pointer when done with it.
  *
  *
- * \param org the name of your organization
- * \param app the name of your application
+ * \param org the name of your organization.
+ * \param app the name of your application.
  * \returns a UTF-8 string of the user directory in platform-dependent
  * \returns a UTF-8 string of the user directory in platform-dependent
  *          notation. NULL if there's a problem (creating directory failed,
  *          notation. NULL if there's a problem (creating directory failed,
  *          etc.).
  *          etc.).
@@ -142,4 +146,4 @@ extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
 
 
 #endif /* SDL_filesystem_h_ */
 #endif /* SDL_filesystem_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 218 - 107
bsp/simulator/SDL2/include/SDL_gamecontroller.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,10 +19,12 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
+/* WIKI CATEGORY: GameController */
+
 /**
 /**
- *  \file SDL_gamecontroller.h
+ * # CategoryGameController
  *
  *
- *  Include file for SDL game controller event handling
+ * Include file for SDL game controller event handling
  */
  */
 
 
 #ifndef SDL_gamecontroller_h_
 #ifndef SDL_gamecontroller_h_
@@ -44,7 +46,7 @@ extern "C" {
  *  \file SDL_gamecontroller.h
  *  \file SDL_gamecontroller.h
  *
  *
  *  In order to use these functions, SDL_Init() must have been called
  *  In order to use these functions, SDL_Init() must have been called
- *  with the ::SDL_INIT_GAMECONTROLLER flag.  This causes SDL to scan the system
+ *  with the SDL_INIT_GAMECONTROLLER flag.  This causes SDL to scan the system
  *  for game controllers, and load appropriate drivers.
  *  for game controllers, and load appropriate drivers.
  *
  *
  *  If you would like to receive controller updates while the application
  *  If you would like to receive controller updates while the application
@@ -58,7 +60,7 @@ extern "C" {
 struct _SDL_GameController;
 struct _SDL_GameController;
 typedef struct _SDL_GameController SDL_GameController;
 typedef struct _SDL_GameController SDL_GameController;
 
 
-typedef enum
+typedef enum SDL_GameControllerType
 {
 {
     SDL_CONTROLLER_TYPE_UNKNOWN = 0,
     SDL_CONTROLLER_TYPE_UNKNOWN = 0,
     SDL_CONTROLLER_TYPE_XBOX360,
     SDL_CONTROLLER_TYPE_XBOX360,
@@ -69,10 +71,15 @@ typedef enum
     SDL_CONTROLLER_TYPE_VIRTUAL,
     SDL_CONTROLLER_TYPE_VIRTUAL,
     SDL_CONTROLLER_TYPE_PS5,
     SDL_CONTROLLER_TYPE_PS5,
     SDL_CONTROLLER_TYPE_AMAZON_LUNA,
     SDL_CONTROLLER_TYPE_AMAZON_LUNA,
-    SDL_CONTROLLER_TYPE_GOOGLE_STADIA
+    SDL_CONTROLLER_TYPE_GOOGLE_STADIA,
+    SDL_CONTROLLER_TYPE_NVIDIA_SHIELD,
+    SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
+    SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
+    SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR,
+    SDL_CONTROLLER_TYPE_MAX
 } SDL_GameControllerType;
 } SDL_GameControllerType;
 
 
-typedef enum
+typedef enum SDL_GameControllerBindType
 {
 {
     SDL_CONTROLLER_BINDTYPE_NONE = 0,
     SDL_CONTROLLER_BINDTYPE_NONE = 0,
     SDL_CONTROLLER_BINDTYPE_BUTTON,
     SDL_CONTROLLER_BINDTYPE_BUTTON,
@@ -81,7 +88,7 @@ typedef enum
 } SDL_GameControllerBindType;
 } SDL_GameControllerBindType;
 
 
 /**
 /**
- *  Get the SDL joystick layer binding for this controller button/axis mapping
+ * Get the SDL joystick layer binding for this controller button/axis mapping
  */
  */
 typedef struct SDL_GameControllerButtonBind
 typedef struct SDL_GameControllerButtonBind
 {
 {
@@ -105,8 +112,10 @@ typedef struct SDL_GameControllerButtonBind
  *  ```c
  *  ```c
  *  int nJoysticks = SDL_NumJoysticks();
  *  int nJoysticks = SDL_NumJoysticks();
  *  int nGameControllers = 0;
  *  int nGameControllers = 0;
- *  for (int i = 0; i < nJoysticks; i++) {
- *      if (SDL_IsGameController(i)) {
+ *  for (int i = 0; i < nJoysticks; i++)
+ {
+ *      if (SDL_IsGameController(i))
+ {
  *          nGameControllers++;
  *          nGameControllers++;
  *      }
  *      }
  *  }
  *  }
@@ -139,6 +148,10 @@ typedef struct SDL_GameControllerButtonBind
  * If a new mapping is loaded for an already known controller GUID, the later
  * If a new mapping is loaded for an already known controller GUID, the later
  * version will overwrite the one currently loaded.
  * version will overwrite the one currently loaded.
  *
  *
+ * If this function is called before SDL_Init, SDL will generate an
+ * SDL_CONTROLLERDEVICEADDED event for matching controllers that are plugged
+ * in at the time that SDL_Init is called.
+ *
  * Mappings not belonging to the current platform or with no platform field
  * Mappings not belonging to the current platform or with no platform field
  * specified will be ignored (i.e. mappings for Linux will be ignored in
  * specified will be ignored (i.e. mappings for Linux will be ignored in
  * Windows, etc).
  * Windows, etc).
@@ -147,8 +160,8 @@ typedef struct SDL_GameControllerButtonBind
  * processing it, so take this into consideration if you are in a memory
  * processing it, so take this into consideration if you are in a memory
  * constrained environment.
  * constrained environment.
  *
  *
- * \param rw the data stream for the mappings to be added
- * \param freerw non-zero to close the stream after being read
+ * \param rw the data stream for the mappings to be added.
+ * \param freerw non-zero to close the stream after being read.
  * \returns the number of mappings added or -1 on error; call SDL_GetError()
  * \returns the number of mappings added or -1 on error; call SDL_GetError()
  *          for more information.
  *          for more information.
  *
  *
@@ -157,13 +170,15 @@ typedef struct SDL_GameControllerButtonBind
  * \sa SDL_GameControllerAddMapping
  * \sa SDL_GameControllerAddMapping
  * \sa SDL_GameControllerAddMappingsFromFile
  * \sa SDL_GameControllerAddMappingsFromFile
  * \sa SDL_GameControllerMappingForGUID
  * \sa SDL_GameControllerMappingForGUID
+ * \sa SDL_CONTROLLERDEVICEADDED
  */
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
 extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
 
 
 /**
 /**
- *  Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
+ * Load a set of mappings from a file, filtered by the current
+ * SDL_GetPlatform()
  *
  *
- *  Convenience macro.
+ * Convenience macro.
  */
  */
 #define SDL_GameControllerAddMappingsFromFile(file)   SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
 #define SDL_GameControllerAddMappingsFromFile(file)   SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
 
 
@@ -185,7 +200,11 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
  * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
  * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
  * ```
  * ```
  *
  *
- * \param mappingString the mapping string
+ * If this function is called before SDL_Init, SDL will generate an
+ * SDL_CONTROLLERDEVICEADDED event for matching controllers that are plugged
+ * in at the time that SDL_Init is called.
+ *
+ * \param mappingString the mapping string.
  * \returns 1 if a new mapping is added, 0 if an existing mapping is updated,
  * \returns 1 if a new mapping is added, 0 if an existing mapping is updated,
  *          -1 on error; call SDL_GetError() for more information.
  *          -1 on error; call SDL_GetError() for more information.
  *
  *
@@ -193,6 +212,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
  *
  *
  * \sa SDL_GameControllerMapping
  * \sa SDL_GameControllerMapping
  * \sa SDL_GameControllerMappingForGUID
  * \sa SDL_GameControllerMappingForGUID
+ * \sa SDL_CONTROLLERDEVICEADDED
  */
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
 extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
 
 
@@ -220,7 +240,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_ind
  *
  *
  * The returned string must be freed with SDL_free().
  * The returned string must be freed with SDL_free().
  *
  *
- * \param guid a structure containing the GUID for which a mapping is desired
+ * \param guid a structure containing the GUID for which a mapping is desired.
  * \returns a mapping string or NULL on error; call SDL_GetError() for more
  * \returns a mapping string or NULL on error; call SDL_GetError() for more
  *          information.
  *          information.
  *
  *
@@ -239,7 +259,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID
  * Details about mappings are discussed with SDL_GameControllerAddMapping().
  * Details about mappings are discussed with SDL_GameControllerAddMapping().
  *
  *
  * \param gamecontroller the game controller you want to get the current
  * \param gamecontroller the game controller you want to get the current
- *                       mapping for
+ *                       mapping for.
  * \returns a string that has the controller's mapping or NULL if no mapping
  * \returns a string that has the controller's mapping or NULL if no mapping
  *          is available; call SDL_GetError() for more information.
  *          is available; call SDL_GetError() for more information.
  *
  *
@@ -257,7 +277,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gam
  * SDL_JoystickOpen().
  * SDL_JoystickOpen().
  *
  *
  * \param joystick_index the device_index of a device, up to
  * \param joystick_index the device_index of a device, up to
- *                       SDL_NumJoysticks()
+ *                       SDL_NumJoysticks().
  * \returns SDL_TRUE if the given joystick is supported by the game controller
  * \returns SDL_TRUE if the given joystick is supported by the game controller
  *          interface, SDL_FALSE if it isn't or it's an invalid index.
  *          interface, SDL_FALSE if it isn't or it's an invalid index.
  *
  *
@@ -277,7 +297,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
  * SDL_JoystickOpen().
  * SDL_JoystickOpen().
  *
  *
  * \param joystick_index the device_index of a device, from zero to
  * \param joystick_index the device_index of a device, from zero to
- *                       SDL_NumJoysticks()-1
+ *                       SDL_NumJoysticks()-1.
  * \returns the implementation-dependent name for the game controller, or NULL
  * \returns the implementation-dependent name for the game controller, or NULL
  *          if there is no name or the index is invalid.
  *          if there is no name or the index is invalid.
  *
  *
@@ -289,13 +309,32 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
  */
  */
 extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
 extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
 
 
+/**
+ * Get the implementation dependent path for the game controller.
+ *
+ * This function can be called before any controllers are opened.
+ *
+ * `joystick_index` is the same as the `device_index` passed to
+ * SDL_JoystickOpen().
+ *
+ * \param joystick_index the device_index of a device, from zero to
+ *                       SDL_NumJoysticks()-1.
+ * \returns the implementation-dependent path for the game controller, or NULL
+ *          if there is no path or the index is invalid.
+ *
+ * \since This function is available since SDL 2.24.0.
+ *
+ * \sa SDL_GameControllerPath
+ */
+extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_index);
+
 /**
 /**
  * Get the type of a game controller.
  * Get the type of a game controller.
  *
  *
  * This can be called before any controllers are opened.
  * This can be called before any controllers are opened.
  *
  *
  * \param joystick_index the device_index of a device, from zero to
  * \param joystick_index the device_index of a device, from zero to
- *                       SDL_NumJoysticks()-1
+ *                       SDL_NumJoysticks()-1.
  * \returns the controller type.
  * \returns the controller type.
  *
  *
  * \since This function is available since SDL 2.0.12.
  * \since This function is available since SDL 2.0.12.
@@ -308,7 +347,7 @@ extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(in
  * This can be called before any controllers are opened.
  * This can be called before any controllers are opened.
  *
  *
  * \param joystick_index the device_index of a device, from zero to
  * \param joystick_index the device_index of a device, from zero to
- *                       SDL_NumJoysticks()-1
+ *                       SDL_NumJoysticks()-1.
  * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
  * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
  *          no mapping is available.
  *          no mapping is available.
  *
  *
@@ -328,7 +367,7 @@ extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joysti
  * be used there instead.
  * be used there instead.
  *
  *
  * \param joystick_index the device_index of a device, up to
  * \param joystick_index the device_index of a device, up to
- *                       SDL_NumJoysticks()
+ *                       SDL_NumJoysticks().
  * \returns a gamecontroller identifier or NULL if an error occurred; call
  * \returns a gamecontroller identifier or NULL if an error occurred; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -343,7 +382,7 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_
 /**
 /**
  * Get the SDL_GameController associated with an instance id.
  * Get the SDL_GameController associated with an instance id.
  *
  *
- * \param joyid the instance id to get the SDL_GameController for
+ * \param joyid the instance id to get the SDL_GameController for.
  * \returns an SDL_GameController on success or NULL on failure; call
  * \returns an SDL_GameController on success or NULL on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -375,7 +414,7 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(in
  * it takes a controller identifier instead of the (unstable) device index.
  * it takes a controller identifier instead of the (unstable) device index.
  *
  *
  * \param gamecontroller a game controller identifier previously returned by
  * \param gamecontroller a game controller identifier previously returned by
- *                       SDL_GameControllerOpen()
+ *                       SDL_GameControllerOpen().
  * \returns the implementation dependent name for the game controller, or NULL
  * \returns the implementation dependent name for the game controller, or NULL
  *          if there is no name or the identifier passed is invalid.
  *          if there is no name or the identifier passed is invalid.
  *
  *
@@ -386,6 +425,23 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(in
  */
  */
 extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
 extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
 
 
+/**
+ * Get the implementation-dependent path for an opened game controller.
+ *
+ * This is the same path as returned by SDL_GameControllerNameForIndex(), but
+ * it takes a controller identifier instead of the (unstable) device index.
+ *
+ * \param gamecontroller a game controller identifier previously returned by
+ *                       SDL_GameControllerOpen().
+ * \returns the implementation dependent path for the game controller, or NULL
+ *          if there is no path or the identifier passed is invalid.
+ *
+ * \since This function is available since SDL 2.24.0.
+ *
+ * \sa SDL_GameControllerPathForIndex
+ */
+extern DECLSPEC const char *SDLCALL SDL_GameControllerPath(SDL_GameController *gamecontroller);
+
 /**
 /**
  * Get the type of this currently opened controller
  * Get the type of this currently opened controller
  *
  *
@@ -415,7 +471,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController
  * Set the player index of an opened game controller.
  * Set the player index of an opened game controller.
  *
  *
  * \param gamecontroller the game controller object to adjust.
  * \param gamecontroller the game controller object to adjust.
- * \param player_index Player index to assign to this controller.
+ * \param player_index Player index to assign to this controller, or -1 to
+ *                     clear the player index and turn off player LEDs.
  *
  *
  * \since This function is available since SDL 2.0.12.
  * \since This function is available since SDL 2.0.12.
  */
  */
@@ -457,6 +514,18 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *
  */
  */
 extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
 extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
 
 
+/**
+ * Get the firmware version of an opened controller, if available.
+ *
+ * If the firmware version isn't available this function returns 0.
+ *
+ * \param gamecontroller the game controller object to query.
+ * \return the controller firmware version, or zero if unavailable.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller);
+
 /**
 /**
  * Get the serial number of an opened controller, if available.
  * Get the serial number of an opened controller, if available.
  *
  *
@@ -470,11 +539,25 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameContr
  */
  */
 extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
 extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
 
 
+/**
+ * Get the Steam Input handle of an opened controller, if available.
+ *
+ * Returns an InputHandle_t for the controller that can be used with Steam
+ * Input API: https://partner.steamgames.com/doc/api/ISteamInput
+ *
+ * \param gamecontroller the game controller object to query.
+ * \returns the gamepad handle, or 0 if unavailable.
+ *
+ * \since This function is available since SDL 2.30.0.
+ */
+extern DECLSPEC Uint64 SDLCALL SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller);
+
+
 /**
 /**
  * Check if a controller has been opened and is currently connected.
  * Check if a controller has been opened and is currently connected.
  *
  *
  * \param gamecontroller a game controller identifier previously returned by
  * \param gamecontroller a game controller identifier previously returned by
- *                       SDL_GameControllerOpen()
+ *                       SDL_GameControllerOpen().
  * \returns SDL_TRUE if the controller has been opened and is currently
  * \returns SDL_TRUE if the controller has been opened and is currently
  *          connected, or SDL_FALSE if not.
  *          connected, or SDL_FALSE if not.
  *
  *
@@ -499,7 +582,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameControlle
  * cause SDL to crash.
  * cause SDL to crash.
  *
  *
  * \param gamecontroller the game controller object that you want to get a
  * \param gamecontroller the game controller object that you want to get a
- *                       joystick from
+ *                       joystick from.
  * \returns a SDL_Joystick object; call SDL_GetError() for more information.
  * \returns a SDL_Joystick object; call SDL_GetError() for more information.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -516,7 +599,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameCont
  * Any number can be passed to SDL_GameControllerEventState(), but only -1, 0,
  * Any number can be passed to SDL_GameControllerEventState(), but only -1, 0,
  * and 1 will have any effect. Other numbers will just be returned.
  * and 1 will have any effect. Other numbers will just be returned.
  *
  *
- * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
+ * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`.
  * \returns the same value passed to the function, with exception to -1
  * \returns the same value passed to the function, with exception to -1
  *          (SDL_QUERY), which will return the current state.
  *          (SDL_QUERY), which will return the current state.
  *
  *
@@ -539,15 +622,19 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
 
 
 
 
 /**
 /**
- *  The list of axes available from a controller
+ * The list of axes available from a controller
  *
  *
- *  Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,
- *  and are centered within ~8000 of zero, though advanced UI will allow users to set
- *  or autodetect the dead zone, which varies between controllers.
+ * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to
+ * SDL_JOYSTICK_AXIS_MAX, and are centered within ~8000 of zero, though
+ * advanced UI will allow users to set or autodetect the dead zone, which
+ * varies between controllers.
  *
  *
- *  Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX.
+ * Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX (fully
+ * pressed) when reported by SDL_GameControllerGetAxis(). Note that this is
+ * not the same range that will be reported by the lower-level
+ * SDL_GetJoystickAxis().
  */
  */
-typedef enum
+typedef enum SDL_GameControllerAxis
 {
 {
     SDL_CONTROLLER_AXIS_INVALID = -1,
     SDL_CONTROLLER_AXIS_INVALID = -1,
     SDL_CONTROLLER_AXIS_LEFTX,
     SDL_CONTROLLER_AXIS_LEFTX,
@@ -571,7 +658,7 @@ typedef enum
  * `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`,
  * `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`,
  * respectively.
  * respectively.
  *
  *
- * \param str string representing a SDL_GameController axis
+ * \param str string representing a SDL_GameController axis.
  * \returns the SDL_GameControllerAxis enum corresponding to the input string,
  * \returns the SDL_GameControllerAxis enum corresponding to the input string,
  *          or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
  *          or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
  *
  *
@@ -586,7 +673,7 @@ extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromStri
  *
  *
  * The caller should not SDL_free() the returned string.
  * The caller should not SDL_free() the returned string.
  *
  *
- * \param axis an enum value for a given SDL_GameControllerAxis
+ * \param axis an enum value for a given SDL_GameControllerAxis.
  * \returns a string for the given axis, or NULL if an invalid axis is
  * \returns a string for the given axis, or NULL if an invalid axis is
  *          specified. The string returned is of the format used by
  *          specified. The string returned is of the format used by
  *          SDL_GameController mapping strings.
  *          SDL_GameController mapping strings.
@@ -600,8 +687,8 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameC
 /**
 /**
  * Get the SDL joystick layer binding for a controller axis mapping.
  * Get the SDL joystick layer binding for a controller axis mapping.
  *
  *
- * \param gamecontroller a game controller
- * \param axis an axis enum value (one of the SDL_GameControllerAxis values)
+ * \param gamecontroller a game controller.
+ * \param axis an axis enum value (one of the SDL_GameControllerAxis values).
  * \returns a SDL_GameControllerButtonBind describing the bind. On failure
  * \returns a SDL_GameControllerButtonBind describing the bind. On failure
  *          (like the given Controller axis doesn't exist on the device), its
  *          (like the given Controller axis doesn't exist on the device), its
  *          `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
  *          `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
@@ -620,8 +707,8 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
  * This merely reports whether the controller's mapping defined this axis, as
  * This merely reports whether the controller's mapping defined this axis, as
  * that is all the information SDL has about the physical device.
  * that is all the information SDL has about the physical device.
  *
  *
- * \param gamecontroller a game controller
- * \param axis an axis enum value (an SDL_GameControllerAxis value)
+ * \param gamecontroller a game controller.
+ * \param axis an axis enum value (an SDL_GameControllerAxis value).
  * \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise.
  * \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -634,11 +721,15 @@ SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameController
  *
  *
  * The axis indices start at index 0.
  * The axis indices start at index 0.
  *
  *
- * The state is a value ranging from -32768 to 32767. Triggers, however, range
- * from 0 to 32767 (they never return a negative value).
+ * For thumbsticks, the state is a value ranging from -32768 (up/left) to
+ * 32767 (down/right).
+ *
+ * Triggers range from 0 when released to 32767 when fully pressed, and never
+ * return a negative value. Note that this differs from the value reported by
+ * the lower-level SDL_JoystickGetAxis(), which normally uses the full range.
  *
  *
- * \param gamecontroller a game controller
- * \param axis an axis index (one of the SDL_GameControllerAxis values)
+ * \param gamecontroller a game controller.
+ * \param axis an axis index (one of the SDL_GameControllerAxis values).
  * \returns axis state (including 0) on success or 0 (also) on failure; call
  * \returns axis state (including 0) on success or 0 (also) on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -650,9 +741,9 @@ extern DECLSPEC Sint16 SDLCALL
 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
 
 
 /**
 /**
- *  The list of buttons available from a controller
+ * The list of buttons available from a controller
  */
  */
-typedef enum
+typedef enum SDL_GameControllerButton
 {
 {
     SDL_CONTROLLER_BUTTON_INVALID = -1,
     SDL_CONTROLLER_BUTTON_INVALID = -1,
     SDL_CONTROLLER_BUTTON_A,
     SDL_CONTROLLER_BUTTON_A,
@@ -671,10 +762,10 @@ typedef enum
     SDL_CONTROLLER_BUTTON_DPAD_LEFT,
     SDL_CONTROLLER_BUTTON_DPAD_LEFT,
     SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
     SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
     SDL_CONTROLLER_BUTTON_MISC1,    /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
     SDL_CONTROLLER_BUTTON_MISC1,    /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
-    SDL_CONTROLLER_BUTTON_PADDLE1,  /* Xbox Elite paddle P1 */
-    SDL_CONTROLLER_BUTTON_PADDLE2,  /* Xbox Elite paddle P3 */
-    SDL_CONTROLLER_BUTTON_PADDLE3,  /* Xbox Elite paddle P2 */
-    SDL_CONTROLLER_BUTTON_PADDLE4,  /* Xbox Elite paddle P4 */
+    SDL_CONTROLLER_BUTTON_PADDLE1,  /* Xbox Elite paddle P1 (upper left, facing the back) */
+    SDL_CONTROLLER_BUTTON_PADDLE2,  /* Xbox Elite paddle P3 (upper right, facing the back) */
+    SDL_CONTROLLER_BUTTON_PADDLE3,  /* Xbox Elite paddle P2 (lower left, facing the back) */
+    SDL_CONTROLLER_BUTTON_PADDLE4,  /* Xbox Elite paddle P4 (lower right, facing the back) */
     SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
     SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
     SDL_CONTROLLER_BUTTON_MAX
     SDL_CONTROLLER_BUTTON_MAX
 } SDL_GameControllerButton;
 } SDL_GameControllerButton;
@@ -687,7 +778,7 @@ typedef enum
  * SDL_GameController mapping. You do not normally need to call this function
  * SDL_GameController mapping. You do not normally need to call this function
  * unless you are parsing SDL_GameController mappings in your own code.
  * unless you are parsing SDL_GameController mappings in your own code.
  *
  *
- * \param str string representing a SDL_GameController axis
+ * \param str string representing a SDL_GameController axis.
  * \returns the SDL_GameControllerButton enum corresponding to the input
  * \returns the SDL_GameControllerButton enum corresponding to the input
  *          string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
  *          string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
  *
  *
@@ -700,8 +791,8 @@ extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFrom
  *
  *
  * The caller should not SDL_free() the returned string.
  * The caller should not SDL_free() the returned string.
  *
  *
- * \param button an enum value for a given SDL_GameControllerButton
- * \returns a string for the given button, or NULL if an invalid axis is
+ * \param button an enum value for a given SDL_GameControllerButton.
+ * \returns a string for the given button, or NULL if an invalid button is
  *          specified. The string returned is of the format used by
  *          specified. The string returned is of the format used by
  *          SDL_GameController mapping strings.
  *          SDL_GameController mapping strings.
  *
  *
@@ -714,8 +805,8 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_Gam
 /**
 /**
  * Get the SDL joystick layer binding for a controller button mapping.
  * Get the SDL joystick layer binding for a controller button mapping.
  *
  *
- * \param gamecontroller a game controller
- * \param button an button enum value (an SDL_GameControllerButton value)
+ * \param gamecontroller a game controller.
+ * \param button an button enum value (an SDL_GameControllerButton value).
  * \returns a SDL_GameControllerButtonBind describing the bind. On failure
  * \returns a SDL_GameControllerButtonBind describing the bind. On failure
  *          (like the given Controller button doesn't exist on the device),
  *          (like the given Controller button doesn't exist on the device),
  *          its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
  *          its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
@@ -734,8 +825,8 @@ SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
  * This merely reports whether the controller's mapping defined this button,
  * This merely reports whether the controller's mapping defined this button,
  * as that is all the information SDL has about the physical device.
  * as that is all the information SDL has about the physical device.
  *
  *
- * \param gamecontroller a game controller
- * \param button a button enum value (an SDL_GameControllerButton value)
+ * \param gamecontroller a game controller.
+ * \param button a button enum value (an SDL_GameControllerButton value).
  * \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise.
  * \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -746,8 +837,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController
 /**
 /**
  * Get the current state of a button on a game controller.
  * Get the current state of a button on a game controller.
  *
  *
- * \param gamecontroller a game controller
- * \param button a button index (one of the SDL_GameControllerButton values)
+ * \param gamecontroller a game controller.
+ * \param button a button index (one of the SDL_GameControllerButton values).
  * \returns 1 for pressed state or 0 for not pressed state or error; call
  * \returns 1 for pressed state or 0 for not pressed state or error; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -783,8 +874,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameControll
 /**
 /**
  * Return whether a game controller has a particular sensor.
  * Return whether a game controller has a particular sensor.
  *
  *
- * \param gamecontroller The controller to query
- * \param type The type of sensor to query
+ * \param gamecontroller The controller to query.
+ * \param type The type of sensor to query.
  * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
  * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -794,9 +885,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController
 /**
 /**
  * Set whether data reporting for a game controller sensor is enabled.
  * Set whether data reporting for a game controller sensor is enabled.
  *
  *
- * \param gamecontroller The controller to update
- * \param type The type of sensor to enable/disable
- * \param enabled Whether data reporting should be enabled
+ * \param gamecontroller The controller to update.
+ * \param type The type of sensor to enable/disable.
+ * \param enabled Whether data reporting should be enabled.
  * \returns 0 or -1 if an error occurred.
  * \returns 0 or -1 if an error occurred.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -806,8 +897,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameControlle
 /**
 /**
  * Query whether sensor data reporting is enabled for a game controller.
  * Query whether sensor data reporting is enabled for a game controller.
  *
  *
- * \param gamecontroller The controller to query
- * \param type The type of sensor to query
+ * \param gamecontroller The controller to query.
+ * \param type The type of sensor to query.
  * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
  * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -818,8 +909,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameContr
  * Get the data rate (number of events per second) of a game controller
  * Get the data rate (number of events per second) of a game controller
  * sensor.
  * sensor.
  *
  *
- * \param gamecontroller The controller to query
- * \param type The type of sensor to query
+ * \param gamecontroller The controller to query.
+ * \param type The type of sensor to query.
  * \return the data rate, or 0.0f if the data rate is not available.
  * \return the data rate, or 0.0f if the data rate is not available.
  *
  *
  * \since This function is available since SDL 2.0.16.
  * \since This function is available since SDL 2.0.16.
@@ -832,29 +923,48 @@ extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameContro
  * The number of values and interpretation of the data is sensor dependent.
  * The number of values and interpretation of the data is sensor dependent.
  * See SDL_sensor.h for the details for each type of sensor.
  * See SDL_sensor.h for the details for each type of sensor.
  *
  *
- * \param gamecontroller The controller to query
- * \param type The type of sensor to query
- * \param data A pointer filled with the current sensor state
- * \param num_values The number of values to write to data
+ * \param gamecontroller The controller to query.
+ * \param type The type of sensor to query.
+ * \param data A pointer filled with the current sensor state.
+ * \param num_values The number of values to write to data.
  * \return 0 or -1 if an error occurred.
  * \return 0 or -1 if an error occurred.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  */
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
 extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
 
 
+/**
+ * Get the current state of a game controller sensor with the timestamp of the
+ * last update.
+ *
+ * The number of values and interpretation of the data is sensor dependent.
+ * See SDL_sensor.h for the details for each type of sensor.
+ *
+ * \param gamecontroller The controller to query.
+ * \param type The type of sensor to query.
+ * \param timestamp A pointer filled with the timestamp in microseconds of the
+ *                  current sensor reading if available, or 0 if not.
+ * \param data A pointer filled with the current sensor state.
+ * \param num_values The number of values to write to data.
+ * \return 0 or -1 if an error occurred.
+ *
+ * \since This function is available since SDL 2.26.0.
+ */
+extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values);
+
 /**
 /**
  * Start a rumble effect on a game controller.
  * Start a rumble effect on a game controller.
  *
  *
  * Each call to this function cancels any previous rumble effect, and calling
  * Each call to this function cancels any previous rumble effect, and calling
  * it with 0 intensity stops any rumbling.
  * it with 0 intensity stops any rumbling.
  *
  *
- * \param gamecontroller The controller to vibrate
+ * \param gamecontroller The controller to vibrate.
  * \param low_frequency_rumble The intensity of the low frequency (left)
  * \param low_frequency_rumble The intensity of the low frequency (left)
- *                             rumble motor, from 0 to 0xFFFF
+ *                             rumble motor, from 0 to 0xFFFF.
  * \param high_frequency_rumble The intensity of the high frequency (right)
  * \param high_frequency_rumble The intensity of the high frequency (right)
- *                              rumble motor, from 0 to 0xFFFF
- * \param duration_ms The duration of the rumble effect, in milliseconds
- * \returns 0, or -1 if rumble isn't supported on this controller
+ *                              rumble motor, from 0 to 0xFFFF.
+ * \param duration_ms The duration of the rumble effect, in milliseconds.
+ * \returns 0, or -1 if rumble isn't supported on this controller.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
  *
  *
@@ -869,16 +979,17 @@ extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecon
  * calling it with 0 intensity stops any rumbling.
  * calling it with 0 intensity stops any rumbling.
  *
  *
  * Note that this is rumbling of the _triggers_ and not the game controller as
  * Note that this is rumbling of the _triggers_ and not the game controller as
- * a whole. The first controller to offer this feature was the PlayStation 5's
- * DualShock 5.
+ * a whole. This is currently only supported on Xbox One controllers. If you
+ * want the (more common) whole-controller rumble, use
+ * SDL_GameControllerRumble() instead.
  *
  *
- * \param gamecontroller The controller to vibrate
+ * \param gamecontroller The controller to vibrate.
  * \param left_rumble The intensity of the left trigger rumble motor, from 0
  * \param left_rumble The intensity of the left trigger rumble motor, from 0
- *                    to 0xFFFF
+ *                    to 0xFFFF.
  * \param right_rumble The intensity of the right trigger rumble motor, from 0
  * \param right_rumble The intensity of the right trigger rumble motor, from 0
- *                     to 0xFFFF
- * \param duration_ms The duration of the rumble effect, in milliseconds
- * \returns 0, or -1 if trigger rumble isn't supported on this controller
+ *                     to 0xFFFF.
+ * \param duration_ms The duration of the rumble effect, in milliseconds.
+ * \returns 0, or -1 if trigger rumble isn't supported on this controller.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  *
  *
@@ -889,9 +1000,9 @@ extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController
 /**
 /**
  * Query whether a game controller has an LED.
  * Query whether a game controller has an LED.
  *
  *
- * \param gamecontroller The controller to query
+ * \param gamecontroller The controller to query.
  * \returns SDL_TRUE, or SDL_FALSE if this controller does not have a
  * \returns SDL_TRUE, or SDL_FALSE if this controller does not have a
- *          modifiable LED
+ *          modifiable LED.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  */
  */
@@ -900,9 +1011,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *ga
 /**
 /**
  * Query whether a game controller has rumble support.
  * Query whether a game controller has rumble support.
  *
  *
- * \param gamecontroller The controller to query
+ * \param gamecontroller The controller to query.
  * \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble
  * \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble
- *          support
+ *          support.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
  *
  *
@@ -913,9 +1024,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController
 /**
 /**
  * Query whether a game controller has rumble support on triggers.
  * Query whether a game controller has rumble support on triggers.
  *
  *
- * \param gamecontroller The controller to query
+ * \param gamecontroller The controller to query.
  * \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger
  * \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger
- *          rumble support
+ *          rumble support.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
  *
  *
@@ -926,11 +1037,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameCon
 /**
 /**
  * Update a game controller's LED color.
  * Update a game controller's LED color.
  *
  *
- * \param gamecontroller The controller to update
- * \param red The intensity of the red LED
- * \param green The intensity of the green LED
- * \param blue The intensity of the blue LED
- * \returns 0, or -1 if this controller does not have a modifiable LED
+ * \param gamecontroller The controller to update.
+ * \param red The intensity of the red LED.
+ * \param green The intensity of the green LED.
+ * \param blue The intensity of the blue LED.
+ * \returns 0, or -1 if this controller does not have a modifiable LED.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  */
  */
@@ -939,11 +1050,11 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecon
 /**
 /**
  * Send a controller specific effect packet
  * Send a controller specific effect packet
  *
  *
- * \param gamecontroller The controller to affect
- * \param data The data to send to the controller
- * \param size The size of the data to send to the controller
+ * \param gamecontroller The controller to affect.
+ * \param data The data to send to the controller.
+ * \param size The size of the data to send to the controller.
  * \returns 0, or -1 if this controller or driver doesn't support effect
  * \returns 0, or -1 if this controller or driver doesn't support effect
- *          packets
+ *          packets.
  *
  *
  * \since This function is available since SDL 2.0.16.
  * \since This function is available since SDL 2.0.16.
  */
  */
@@ -953,7 +1064,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gam
  * Close a game controller previously opened with SDL_GameControllerOpen().
  * Close a game controller previously opened with SDL_GameControllerOpen().
  *
  *
  * \param gamecontroller a game controller identifier previously returned by
  * \param gamecontroller a game controller identifier previously returned by
- *                       SDL_GameControllerOpen()
+ *                       SDL_GameControllerOpen().
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -965,9 +1076,9 @@ extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecon
  * Return the sfSymbolsName for a given button on a game controller on Apple
  * Return the sfSymbolsName for a given button on a game controller on Apple
  * platforms.
  * platforms.
  *
  *
- * \param gamecontroller the controller to query
- * \param button a button on the game controller
- * \returns the sfSymbolsName or NULL if the name can't be found
+ * \param gamecontroller the controller to query.
+ * \param button a button on the game controller.
+ * \returns the sfSymbolsName or NULL if the name can't be found.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
  *
  *
@@ -979,9 +1090,9 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForBu
  * Return the sfSymbolsName for a given axis on a game controller on Apple
  * Return the sfSymbolsName for a given axis on a game controller on Apple
  * platforms.
  * platforms.
  *
  *
- * \param gamecontroller the controller to query
- * \param axis an axis on the game controller
- * \returns the sfSymbolsName or NULL if the name can't be found
+ * \param gamecontroller the controller to query.
+ * \param axis an axis on the game controller.
+ * \returns the sfSymbolsName or NULL if the name can't be found.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
  *
  *
@@ -998,4 +1109,4 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForAx
 
 
 #endif /* SDL_gamecontroller_h_ */
 #endif /* SDL_gamecontroller_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 10 - 10
bsp/simulator/SDL2/include/SDL_gesture.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_gesture.h
+ * # CategoryGesture
  *
  *
- *  Include file for SDL gesture event handling.
+ * Include file for SDL gesture event handling.
  */
  */
 
 
 #ifndef SDL_gesture_h_
 #ifndef SDL_gesture_h_
@@ -51,7 +51,7 @@ typedef Sint64 SDL_GestureID;
  * If the parameter `touchId` is -1 (i.e., all devices), this function will
  * If the parameter `touchId` is -1 (i.e., all devices), this function will
  * always return 1, regardless of whether there actually are any devices.
  * always return 1, regardless of whether there actually are any devices.
  *
  *
- * \param touchId the touch device id, or -1 for all touch devices
+ * \param touchId the touch device id, or -1 for all touch devices.
  * \returns 1 on success or 0 if the specified device could not be found.
  * \returns 1 on success or 0 if the specified device could not be found.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -64,7 +64,7 @@ extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
 /**
 /**
  * Save all currently loaded Dollar Gesture templates.
  * Save all currently loaded Dollar Gesture templates.
  *
  *
- * \param dst a SDL_RWops to save to
+ * \param dst a SDL_RWops to save to.
  * \returns the number of saved templates on success or 0 on failure; call
  * \returns the number of saved templates on success or 0 on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -78,8 +78,8 @@ extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
 /**
 /**
  * Save a currently loaded Dollar Gesture template.
  * Save a currently loaded Dollar Gesture template.
  *
  *
- * \param gestureId a gesture id
- * \param dst a SDL_RWops to save to
+ * \param gestureId a gesture id.
+ * \param dst a SDL_RWops to save to.
  * \returns 1 on success or 0 on failure; call SDL_GetError() for more
  * \returns 1 on success or 0 on failure; call SDL_GetError() for more
  *          information.
  *          information.
  *
  *
@@ -94,8 +94,8 @@ extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_R
 /**
 /**
  * Load Dollar Gesture templates from a file.
  * Load Dollar Gesture templates from a file.
  *
  *
- * \param touchId a touch id
- * \param src a SDL_RWops to load from
+ * \param touchId a touch id.
+ * \param src a SDL_RWops to load from.
  * \returns the number of loaded templates on success or a negative error code
  * \returns the number of loaded templates on success or a negative error code
  *          (or 0) on failure; call SDL_GetError() for more information.
  *          (or 0) on failure; call SDL_GetError() for more information.
  *
  *
@@ -114,4 +114,4 @@ extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWo
 
 
 #endif /* SDL_gesture_h_ */
 #endif /* SDL_gesture_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 107 - 0
bsp/simulator/SDL2/include/SDL_guid.h

@@ -0,0 +1,107 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+/* WIKI CATEGORY: GUID */
+
+/**
+ * # CategoryGUID
+ *
+ * A GUID is a 128-bit value that represents something that is uniquely
+ * identifiable by this value: "globally unique."
+ */
+
+#ifndef SDL_guid_h_
+#define SDL_guid_h_
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * An SDL_GUID is a 128-bit identifier.
+ *
+ * This is an acronym for "Globally Unique ID."
+ *
+ * While a GUID can be used to assign a unique value to almost anything, in
+ * SDL these are largely used to identify input devices across runs of SDL
+ * programs on the same platform.If the device is detached and then
+ * re-attached to a different port, or if the base system is rebooted, the
+ * device should still report the same GUID.
+ *
+ * GUIDs are as precise as possible but are not guaranteed to distinguish
+ * physically distinct but equivalent devices. For example, two game
+ * controllers from the same vendor with the same product ID and revision may
+ * have the same GUID.
+ *
+ * GUIDs may be platform-dependent (i.e., the same device may report different
+ * GUIDs on different operating systems).
+ */
+typedef struct SDL_GUID {
+    Uint8 data[16];
+} SDL_GUID;
+
+/* Function prototypes */
+
+/**
+ * Get an ASCII string representation for a given SDL_GUID.
+ *
+ * You should supply at least 33 bytes for pszGUID.
+ *
+ * \param guid the SDL_GUID you wish to convert to string.
+ * \param pszGUID buffer in which to write the ASCII string.
+ * \param cbGUID the size of pszGUID.
+ *
+ * \since This function is available since SDL 2.24.0.
+ *
+ * \sa SDL_GUIDFromString
+ */
+extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
+
+/**
+ * Convert a GUID string into a SDL_GUID structure.
+ *
+ * Performs no error checking. If this function is given a string containing
+ * an invalid GUID, the function will silently succeed, but the GUID generated
+ * will not be useful.
+ *
+ * \param pchGUID string containing an ASCII representation of a GUID.
+ * \returns a SDL_GUID structure.
+ *
+ * \since This function is available since SDL 2.24.0.
+ *
+ * \sa SDL_GUIDToString
+ */
+extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* SDL_guid_h_ */
+
+/* vi: set ts=4 sw=4 expandtab: */

File diff suppressed because it is too large
+ 342 - 328
bsp/simulator/SDL2/include/SDL_haptic.h


+ 34 - 42
bsp/simulator/SDL2/include/SDL_hidapi.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,44 +19,35 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
+/* WIKI CATEGORY: HIDAPI */
+
 /**
 /**
- *  \file SDL_hidapi.h
- *
- *  Header file for SDL HIDAPI functions.
- *
- *  This is an adaptation of the original HIDAPI interface by Alan Ott,
- *  and includes source code licensed under the following BSD license:
- *
-    Copyright (c) 2010, Alan Ott, Signal 11 Software
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of Signal 11 Software nor the names of its
-      contributors may be used to endorse or promote products derived from
-      this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-    POSSIBILITY OF SUCH DAMAGE.
+ * # CategoryHIDAPI
+ *
+ * Header file for SDL HIDAPI functions.
+ *
+ * This is an adaptation of the original HIDAPI interface by Alan Ott, and
+ * includes source code licensed under the following license:
+ *
+ * ```
+ * HIDAPI - Multi-Platform library for
+ * communication with HID devices.
+ *
+ * Copyright 2009, Alan Ott, Signal 11 Software.
+ * All Rights Reserved.
+ *
+ * This software may be used by anyone for any reason so
+ * long as the copyright notice in the source files
+ * remains intact.
+ * ```
+ *
+ * (Note that this license is the same as item three of SDL's zlib license, so
+ * it adds no new requirements on the user.)
  *
  *
  * If you would like a version of SDL without this code, you can build SDL
  * If you would like a version of SDL without this code, you can build SDL
- * with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example
- * on iOS or tvOS to avoid a dependency on the CoreBluetooth framework.
+ * with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for
+ * example on iOS or tvOS to avoid a dependency on the CoreBluetooth
+ * framework.
  */
  */
 
 
 #ifndef SDL_hidapi_h_
 #ifndef SDL_hidapi_h_
@@ -71,14 +62,15 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  \brief  A handle representing an open HID device
+ * A handle representing an open HID device
  */
  */
 struct SDL_hid_device_;
 struct SDL_hid_device_;
 typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */
 typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */
 
 
 /** hidapi info structure */
 /** hidapi info structure */
+
 /**
 /**
- *  \brief  Information about a connected HID device
+ * Information about a connected HID device
  */
  */
 typedef struct SDL_hid_device_info
 typedef struct SDL_hid_device_info
 {
 {
@@ -234,13 +226,13 @@ extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id,
  * The path name be determined by calling SDL_hid_enumerate(), or a
  * The path name be determined by calling SDL_hid_enumerate(), or a
  * platform-specific path name can be used (eg: /dev/hidraw0 on Linux).
  * platform-specific path name can be used (eg: /dev/hidraw0 on Linux).
  *
  *
- * \param path The path name of the device to open
+ * \param path The path name of the device to open.
  * \returns a pointer to a SDL_hid_device object on success or NULL on
  * \returns a pointer to a SDL_hid_device object on success or NULL on
  *          failure.
  *          failure.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
  */
  */
-extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
+extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive);
 
 
 /**
 /**
  * Write an Output report to a HID device.
  * Write an Output report to a HID device.
@@ -434,7 +426,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int
 /**
 /**
  * Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers
  * Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers
  *
  *
- * \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan
+ * \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
  */
  */
@@ -448,4 +440,4 @@ extern DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active);
 
 
 #endif /* SDL_hidapi_h_ */
 #endif /* SDL_hidapi_h_ */
 
 
-/* vi: set sts=4 ts=4 sw=4 expandtab: */
+/* vi: set sts=4 ts=4 sw=4 expandtab: */

File diff suppressed because it is too large
+ 2042 - 928
bsp/simulator/SDL2/include/SDL_hints.h


+ 249 - 107
bsp/simulator/SDL2/include/SDL_joystick.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,22 +20,26 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_joystick.h
+ * # CategoryJoystick
  *
  *
- *  Include file for SDL joystick event handling
+ * Include file for SDL joystick event handling
  *
  *
- * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick
- *   behind a device_index changing as joysticks are plugged and unplugged.
+ * The term "device_index" identifies currently plugged in joystick devices
+ * between 0 and SDL_NumJoysticks(), with the exact joystick behind a
+ * device_index changing as joysticks are plugged and unplugged.
  *
  *
- * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
- *   then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
+ * The term "instance_id" is the current instantiation of a joystick device in
+ * the system, if the joystick is removed and then re-inserted then it will
+ * get a new instance_id, instance_id's are monotonically increasing
+ * identifiers of a joystick plugged in.
  *
  *
  * The term "player_index" is the number assigned to a player on a specific
  * The term "player_index" is the number assigned to a player on a specific
- *   controller. For XInput controllers this returns the XInput user index.
- *   Many joysticks will not be able to supply this information.
+ * controller. For XInput controllers this returns the XInput user index. Many
+ * joysticks will not be able to supply this information.
  *
  *
- * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
- *   the device (a X360 wired controller for example). This identifier is platform dependent.
+ * The term JoystickGUID is a stable 128-bit identifier for a joystick device
+ * that does not change over time, it identifies class of the device (a X360
+ * wired controller for example). This identifier is platform dependent.
  */
  */
 
 
 #ifndef SDL_joystick_h_
 #ifndef SDL_joystick_h_
@@ -43,6 +47,8 @@
 
 
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
 #include "SDL_error.h"
 #include "SDL_error.h"
+#include "SDL_guid.h"
+#include "SDL_mutex.h"
 
 
 #include "begin_code.h"
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
 /* Set up for C function definitions, even when using C++ */
@@ -54,7 +60,7 @@ extern "C" {
  *  \file SDL_joystick.h
  *  \file SDL_joystick.h
  *
  *
  *  In order to use these functions, SDL_Init() must have been called
  *  In order to use these functions, SDL_Init() must have been called
- *  with the ::SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
+ *  with the SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
  *  for joysticks, and load appropriate drivers.
  *  for joysticks, and load appropriate drivers.
  *
  *
  *  If you would like to receive joystick updates while the application
  *  If you would like to receive joystick updates while the application
@@ -65,20 +71,27 @@ extern "C" {
 /**
 /**
  * The joystick structure used to identify an SDL joystick
  * The joystick structure used to identify an SDL joystick
  */
  */
+#ifdef SDL_THREAD_SAFETY_ANALYSIS
+extern SDL_mutex *SDL_joystick_lock;
+#endif
 struct _SDL_Joystick;
 struct _SDL_Joystick;
 typedef struct _SDL_Joystick SDL_Joystick;
 typedef struct _SDL_Joystick SDL_Joystick;
 
 
-/* A structure that encodes the stable unique id for a joystick device */
-typedef struct {
-    Uint8 data[16];
-} SDL_JoystickGUID;
+/**
+ * A structure that encodes the stable unique id for a joystick device.
+ *
+ * This is just a standard SDL_GUID by a different name.
+ */
+typedef SDL_GUID SDL_JoystickGUID;
 
 
 /**
 /**
- * This is a unique ID for a joystick for the time it is connected to the system,
- * and is never reused for the lifetime of the application. If the joystick is
- * disconnected and reconnected, it will get a new ID.
+ * This is a unique ID for a joystick for the time it is connected to the
+ * system, and is never reused for the lifetime of the application.
+ *
+ * If the joystick is disconnected and reconnected, it will get a new ID.
  *
  *
- * The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
+ * The ID value starts at 0 and increments from there. The value -1 is an
+ * invalid ID.
  */
  */
 typedef Sint32 SDL_JoystickID;
 typedef Sint32 SDL_JoystickID;
 
 
@@ -125,9 +138,14 @@ typedef enum
  * the API functions that take a joystick index will be valid, and joystick
  * the API functions that take a joystick index will be valid, and joystick
  * and game controller events will not be delivered.
  * and game controller events will not be delivered.
  *
  *
+ * As of SDL 2.26.0, you can take the joystick lock around reinitializing the
+ * joystick subsystem, to prevent other threads from seeing joysticks in an
+ * uninitialized state. However, all open joysticks will be closed and SDL
+ * functions called with them will fail.
+ *
  * \since This function is available since SDL 2.0.7.
  * \since This function is available since SDL 2.0.7.
  */
  */
-extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
+extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
 
 
 
 
 /**
 /**
@@ -142,7 +160,7 @@ extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
  *
  *
  * \since This function is available since SDL 2.0.7.
  * \since This function is available since SDL 2.0.7.
  */
  */
-extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
+extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
 
 
 /**
 /**
  * Count the number of joysticks attached to the system.
  * Count the number of joysticks attached to the system.
@@ -153,6 +171,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
  * \sa SDL_JoystickName
  * \sa SDL_JoystickName
+ * \sa SDL_JoystickPath
  * \sa SDL_JoystickOpen
  * \sa SDL_JoystickOpen
  */
  */
 extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
 extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
@@ -163,7 +182,7 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
  * This can be called before any joysticks are opened.
  * This can be called before any joysticks are opened.
  *
  *
  * \param device_index the index of the joystick to query (the N'th joystick
  * \param device_index the index of the joystick to query (the N'th joystick
- *                     on the system)
+ *                     on the system).
  * \returns the name of the selected joystick. If no name can be found, this
  * \returns the name of the selected joystick. If no name can be found, this
  *          function returns NULL; call SDL_GetError() for more information.
  *          function returns NULL; call SDL_GetError() for more information.
  *
  *
@@ -174,6 +193,23 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
  */
  */
 extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
 extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
 
 
+/**
+ * Get the implementation dependent path of a joystick.
+ *
+ * This can be called before any joysticks are opened.
+ *
+ * \param device_index the index of the joystick to query (the N'th joystick
+ *                     on the system).
+ * \returns the path of the selected joystick. If no path can be found, this
+ *          function returns NULL; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.24.0.
+ *
+ * \sa SDL_JoystickPath
+ * \sa SDL_JoystickOpen
+ */
+extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index);
+
 /**
 /**
  * Get the player index of a joystick, or -1 if it's not available This can be
  * Get the player index of a joystick, or -1 if it's not available This can be
  * called before any joysticks are opened.
  * called before any joysticks are opened.
@@ -189,9 +225,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
  * This function can be called before any joysticks are opened.
  * This function can be called before any joysticks are opened.
  *
  *
  * \param device_index the index of the joystick to query (the N'th joystick
  * \param device_index the index of the joystick to query (the N'th joystick
- *                     on the system
+ *                     on the system.
  * \returns the GUID of the selected joystick. If called on an invalid index,
  * \returns the GUID of the selected joystick. If called on an invalid index,
- *          this function returns a zero GUID
+ *          this function returns a zero GUID.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -207,9 +243,9 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_in
  * available this function returns 0.
  * available this function returns 0.
  *
  *
  * \param device_index the index of the joystick to query (the N'th joystick
  * \param device_index the index of the joystick to query (the N'th joystick
- *                     on the system
+ *                     on the system.
  * \returns the USB vendor ID of the selected joystick. If called on an
  * \returns the USB vendor ID of the selected joystick. If called on an
- *          invalid index, this function returns zero
+ *          invalid index, this function returns zero.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
  */
  */
@@ -222,9 +258,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
  * available this function returns 0.
  * available this function returns 0.
  *
  *
  * \param device_index the index of the joystick to query (the N'th joystick
  * \param device_index the index of the joystick to query (the N'th joystick
- *                     on the system
+ *                     on the system.
  * \returns the USB product ID of the selected joystick. If called on an
  * \returns the USB product ID of the selected joystick. If called on an
- *          invalid index, this function returns zero
+ *          invalid index, this function returns zero.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
  */
  */
@@ -237,9 +273,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
  * isn't available this function returns 0.
  * isn't available this function returns 0.
  *
  *
  * \param device_index the index of the joystick to query (the N'th joystick
  * \param device_index the index of the joystick to query (the N'th joystick
- *                     on the system
+ *                     on the system.
  * \returns the product version of the selected joystick. If called on an
  * \returns the product version of the selected joystick. If called on an
- *          invalid index, this function returns zero
+ *          invalid index, this function returns zero.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
  */
  */
@@ -251,9 +287,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_in
  * This can be called before any joysticks are opened.
  * This can be called before any joysticks are opened.
  *
  *
  * \param device_index the index of the joystick to query (the N'th joystick
  * \param device_index the index of the joystick to query (the N'th joystick
- *                     on the system
+ *                     on the system.
  * \returns the SDL_JoystickType of the selected joystick. If called on an
  * \returns the SDL_JoystickType of the selected joystick. If called on an
- *          invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`
+ *          invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
  */
  */
@@ -262,13 +298,12 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in
 /**
 /**
  * Get the instance ID of a joystick.
  * Get the instance ID of a joystick.
  *
  *
- * This can be called before any joysticks are opened. If the index is out of
- * range, this function will return -1.
+ * This can be called before any joysticks are opened.
  *
  *
  * \param device_index the index of the joystick to query (the N'th joystick
  * \param device_index the index of the joystick to query (the N'th joystick
- *                     on the system
+ *                     on the system.
  * \returns the instance id of the selected joystick. If called on an invalid
  * \returns the instance id of the selected joystick. If called on an invalid
- *          index, this function returns zero
+ *          index, this function returns -1.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
  */
  */
@@ -285,7 +320,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int devic
  * The joystick subsystem must be initialized before a joystick can be opened
  * The joystick subsystem must be initialized before a joystick can be opened
  * for use.
  * for use.
  *
  *
- * \param device_index the index of the joystick to query
+ * \param device_index the index of the joystick to query.
  * \returns a joystick identifier or NULL if an error occurred; call
  * \returns a joystick identifier or NULL if an error occurred; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -299,7 +334,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
 /**
 /**
  * Get the SDL_Joystick associated with an instance id.
  * Get the SDL_Joystick associated with an instance id.
  *
  *
- * \param instance_id the instance id to get the SDL_Joystick for
+ * \param instance_id the instance id to get the SDL_Joystick for.
  * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
  * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
  *          for more information.
  *          for more information.
  *
  *
@@ -310,7 +345,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID
 /**
 /**
  * Get the SDL_Joystick associated with a player index.
  * Get the SDL_Joystick associated with a player index.
  *
  *
- * \param player_index the player index to get the SDL_Joystick for
+ * \param player_index the player index to get the SDL_Joystick for.
  * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
  * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
  *          for more information.
  *          for more information.
  *
  *
@@ -330,11 +365,61 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
                                                       int nbuttons,
                                                       int nbuttons,
                                                       int nhats);
                                                       int nhats);
 
 
+/**
+ * The structure that defines an extended virtual joystick description
+ *
+ * The caller must zero the structure and then initialize the version with
+ * `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to
+ * SDL_JoystickAttachVirtualEx() All other elements of this structure are
+ * optional and can be left 0.
+ *
+ * \sa SDL_JoystickAttachVirtualEx
+ */
+typedef struct SDL_VirtualJoystickDesc
+{
+    Uint16 version;     /**< `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` */
+    Uint16 type;        /**< `SDL_JoystickType` */
+    Uint16 naxes;       /**< the number of axes on this joystick */
+    Uint16 nbuttons;    /**< the number of buttons on this joystick */
+    Uint16 nhats;       /**< the number of hats on this joystick */
+    Uint16 vendor_id;   /**< the USB vendor ID of this joystick */
+    Uint16 product_id;  /**< the USB product ID of this joystick */
+    Uint16 padding;     /**< unused */
+    Uint32 button_mask; /**< A mask of which buttons are valid for this controller
+                             e.g. (1 << SDL_CONTROLLER_BUTTON_A) */
+    Uint32 axis_mask;   /**< A mask of which axes are valid for this controller
+                             e.g. (1 << SDL_CONTROLLER_AXIS_LEFTX) */
+    const char *name;   /**< the name of the joystick */
+
+    void *userdata;     /**< User data pointer passed to callbacks */
+    void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
+    void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
+    int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_JoystickRumble() */
+    int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_JoystickRumbleTriggers() */
+    int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_JoystickSetLED() */
+    int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_JoystickSendEffect() */
+
+} SDL_VirtualJoystickDesc;
+
+/**
+ * The current version of the SDL_VirtualJoystickDesc structure
+ */
+#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION   1
+
+/**
+ * Attach a new virtual joystick with extended properties.
+ *
+ * \returns the joystick's device index, or -1 if an error occurred.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc);
+
 /**
 /**
  * Detach a virtual joystick.
  * Detach a virtual joystick.
  *
  *
  * \param device_index a value previously returned from
  * \param device_index a value previously returned from
- *                     SDL_JoystickAttachVirtual()
+ *                     SDL_JoystickAttachVirtual().
  * \returns 0 on success, or -1 if an error occurred.
  * \returns 0 on success, or -1 if an error occurred.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -360,6 +445,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
  * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
  * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
  * SDL_WaitEvent.
  * SDL_WaitEvent.
  *
  *
+ * Note that when sending trigger axes, you should scale the value to the full
+ * range of Sint16. For example, a trigger at rest would have the value of
+ * `SDL_JOYSTICK_AXIS_MIN`.
+ *
  * \param joystick the virtual joystick on which to set state.
  * \param joystick the virtual joystick on which to set state.
  * \param axis the specific axis on the virtual joystick to set.
  * \param axis the specific axis on the virtual joystick to set.
  * \param value the new value for the specified axis.
  * \param value the new value for the specified axis.
@@ -408,7 +497,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, in
 /**
 /**
  * Get the implementation dependent name of a joystick.
  * Get the implementation dependent name of a joystick.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
  * \returns the name of the selected joystick. If no name can be found, this
  * \returns the name of the selected joystick. If no name can be found, this
  *          function returns NULL; call SDL_GetError() for more information.
  *          function returns NULL; call SDL_GetError() for more information.
  *
  *
@@ -419,13 +508,26 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, in
  */
  */
 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
 
 
+/**
+ * Get the implementation dependent path of a joystick.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
+ * \returns the path of the selected joystick. If no path can be found, this
+ *          function returns NULL; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.24.0.
+ *
+ * \sa SDL_JoystickPathForIndex
+ */
+extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick);
+
 /**
 /**
  * Get the player index of an opened joystick.
  * Get the player index of an opened joystick.
  *
  *
  * For XInput controllers this returns the XInput user index. Many joysticks
  * For XInput controllers this returns the XInput user index. Many joysticks
  * will not be able to supply this information.
  * will not be able to supply this information.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
  * \returns the player index, or -1 if it's not available.
  * \returns the player index, or -1 if it's not available.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -435,8 +537,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
 /**
 /**
  * Set the player index of an opened joystick.
  * Set the player index of an opened joystick.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
- * \param player_index the player index to set.
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
+ * \param player_index Player index to assign to this joystick, or -1 to clear
+ *                     the player index and turn off player LEDs.
  *
  *
  * \since This function is available since SDL 2.0.12.
  * \since This function is available since SDL 2.0.12.
  */
  */
@@ -447,7 +550,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick,
  *
  *
  * This function requires an open joystick.
  * This function requires an open joystick.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
  * \returns the GUID of the given joystick. If called on an invalid index,
  * \returns the GUID of the given joystick. If called on an invalid index,
  *          this function returns a zero GUID; call SDL_GetError() for more
  *          this function returns a zero GUID; call SDL_GetError() for more
  *          information.
  *          information.
@@ -464,7 +567,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joyst
  *
  *
  * If the vendor ID isn't available this function returns 0.
  * If the vendor ID isn't available this function returns 0.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
  * \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
  * \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
@@ -476,7 +579,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick);
  *
  *
  * If the product ID isn't available this function returns 0.
  * If the product ID isn't available this function returns 0.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
  * \returns the USB product ID of the selected joystick, or 0 if unavailable.
  * \returns the USB product ID of the selected joystick, or 0 if unavailable.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
@@ -488,19 +591,32 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
  *
  *
  * If the product version isn't available this function returns 0.
  * If the product version isn't available this function returns 0.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
  * \returns the product version of the selected joystick, or 0 if unavailable.
  * \returns the product version of the selected joystick, or 0 if unavailable.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
  */
  */
 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
 
 
+/**
+ * Get the firmware version of an opened joystick, if available.
+ *
+ * If the firmware version isn't available this function returns 0.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
+ * \returns the firmware version of the selected joystick, or 0 if
+ *          unavailable.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick);
+
 /**
 /**
  * Get the serial number of an opened joystick, if available.
  * Get the serial number of an opened joystick, if available.
  *
  *
  * Returns the serial number of the joystick, or NULL if it is not available.
  * Returns the serial number of the joystick, or NULL if it is not available.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
  * \returns the serial number of the selected joystick, or NULL if
  * \returns the serial number of the selected joystick, or NULL if
  *          unavailable.
  *          unavailable.
  *
  *
@@ -511,7 +627,7 @@ extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystic
 /**
 /**
  * Get the type of an opened joystick.
  * Get the type of an opened joystick.
  *
  *
- * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen().
  * \returns the SDL_JoystickType of the selected joystick.
  * \returns the SDL_JoystickType of the selected joystick.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
@@ -523,9 +639,9 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joyst
  *
  *
  * You should supply at least 33 bytes for pszGUID.
  * You should supply at least 33 bytes for pszGUID.
  *
  *
- * \param guid the SDL_JoystickGUID you wish to convert to string
- * \param pszGUID buffer in which to write the ASCII string
- * \param cbGUID the size of pszGUID
+ * \param guid the SDL_JoystickGUID you wish to convert to string.
+ * \param pszGUID buffer in which to write the ASCII string.
+ * \param cbGUID the size of pszGUID.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -542,7 +658,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, ch
  * an invalid GUID, the function will silently succeed, but the GUID generated
  * an invalid GUID, the function will silently succeed, but the GUID generated
  * will not be useful.
  * will not be useful.
  *
  *
- * \param pchGUID string containing an ASCII representation of a GUID
+ * \param pchGUID string containing an ASCII representation of a GUID.
  * \returns a SDL_JoystickGUID structure.
  * \returns a SDL_JoystickGUID structure.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -551,10 +667,29 @@ extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, ch
  */
  */
 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
 
 
+/**
+ * Get the device information encoded in a SDL_JoystickGUID structure
+ *
+ * \param guid the SDL_JoystickGUID you wish to get info about.
+ * \param vendor A pointer filled in with the device VID, or 0 if not
+ *               available.
+ * \param product A pointer filled in with the device PID, or 0 if not
+ *                available.
+ * \param version A pointer filled in with the device version, or 0 if not
+ *                available.
+ * \param crc16 A pointer filled in with a CRC used to distinguish different
+ *              products with the same VID/PID, or 0 if not available.
+ *
+ * \since This function is available since SDL 2.26.0.
+ *
+ * \sa SDL_JoystickGetDeviceGUID
+ */
+extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
+
 /**
 /**
  * Get the status of a specified joystick.
  * Get the status of a specified joystick.
  *
  *
- * \param joystick the joystick to query
+ * \param joystick the joystick to query.
  * \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
  * \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
  *
  *
@@ -568,7 +703,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick)
 /**
 /**
  * Get the instance ID of an opened joystick.
  * Get the instance ID of an opened joystick.
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
+ * \param joystick an SDL_Joystick structure containing joystick information.
  * \returns the instance ID of the specified joystick on success or a negative
  * \returns the instance ID of the specified joystick on success or a negative
  *          error code on failure; call SDL_GetError() for more information.
  *          error code on failure; call SDL_GetError() for more information.
  *
  *
@@ -585,7 +720,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joys
  * separate buttons or a POV hat, and not axes, but all of this is up to the
  * separate buttons or a POV hat, and not axes, but all of this is up to the
  * device and platform.
  * device and platform.
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
+ * \param joystick an SDL_Joystick structure containing joystick information.
  * \returns the number of axis controls/number of axes on success or a
  * \returns the number of axis controls/number of axes on success or a
  *          negative error code on failure; call SDL_GetError() for more
  *          negative error code on failure; call SDL_GetError() for more
  *          information.
  *          information.
@@ -605,7 +740,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
  *
  *
  * Most joysticks do not have trackballs.
  * Most joysticks do not have trackballs.
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
+ * \param joystick an SDL_Joystick structure containing joystick information.
  * \returns the number of trackballs on success or a negative error code on
  * \returns the number of trackballs on success or a negative error code on
  *          failure; call SDL_GetError() for more information.
  *          failure; call SDL_GetError() for more information.
  *
  *
@@ -618,7 +753,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
 /**
 /**
  * Get the number of POV hats on a joystick.
  * Get the number of POV hats on a joystick.
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
+ * \param joystick an SDL_Joystick structure containing joystick information.
  * \returns the number of POV hats on success or a negative error code on
  * \returns the number of POV hats on success or a negative error code on
  *          failure; call SDL_GetError() for more information.
  *          failure; call SDL_GetError() for more information.
  *
  *
@@ -632,7 +767,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
 /**
 /**
  * Get the number of buttons on a joystick.
  * Get the number of buttons on a joystick.
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
+ * \param joystick an SDL_Joystick structure containing joystick information.
  * \returns the number of buttons on success or a negative error code on
  * \returns the number of buttons on success or a negative error code on
  *          failure; call SDL_GetError() for more information.
  *          failure; call SDL_GetError() for more information.
  *
  *
@@ -667,12 +802,17 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
  * **WARNING**: Calling this function may delete all events currently in SDL's
  * **WARNING**: Calling this function may delete all events currently in SDL's
  * event queue.
  * event queue.
  *
  *
- * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
- * \returns 1 if enabled, 0 if disabled, or a negative error code on failure;
- *          call SDL_GetError() for more information.
+ * While `param` is meant to be one of `SDL_QUERY`, `SDL_IGNORE`, or
+ * `SDL_ENABLE`, this function accepts any value, with any non-zero value that
+ * isn't `SDL_QUERY` being treated as `SDL_ENABLE`.
+ *
+ * If SDL was built with events disabled (extremely uncommon!), this will do
+ * nothing and always return `SDL_IGNORE`.
  *
  *
- *          If `state` is `SDL_QUERY` then the current state is returned,
- *          otherwise the new processing state is returned.
+ * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`.
+ * \returns If `state` is `SDL_QUERY` then the current state is returned,
+ *          otherwise `state` is returned (even if it was not one of the
+ *          allowed values).
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -680,6 +820,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
  */
  */
 extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
 extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
 
 
+/* Limits for joystick axes... */
 #define SDL_JOYSTICK_AXIS_MAX   32767
 #define SDL_JOYSTICK_AXIS_MAX   32767
 #define SDL_JOYSTICK_AXIS_MIN   -32768
 #define SDL_JOYSTICK_AXIS_MIN   -32768
 
 
@@ -696,8 +837,8 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
  * 32767) representing the current position of the axis. It may be necessary
  * 32767) representing the current position of the axis. It may be necessary
  * to impose certain tolerances on these values to account for jitter.
  * to impose certain tolerances on these values to account for jitter.
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
- * \param axis the axis to query; the axis indices start at index 0
+ * \param joystick an SDL_Joystick structure containing joystick information.
+ * \param axis the axis to query; the axis indices start at index 0.
  * \returns a 16-bit signed integer representing the current position of the
  * \returns a 16-bit signed integer representing the current position of the
  *          axis or 0 on failure; call SDL_GetError() for more information.
  *          axis or 0 on failure; call SDL_GetError() for more information.
  *
  *
@@ -715,8 +856,8 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
  *
  *
  * The axis indices start at index 0.
  * The axis indices start at index 0.
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
- * \param axis the axis to query; the axis indices start at index 0
+ * \param joystick an SDL_Joystick structure containing joystick information.
+ * \param axis the axis to query; the axis indices start at index 0.
  * \param state Upon return, the initial value is supplied here.
  * \param state Upon return, the initial value is supplied here.
  * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
  * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
  *
  *
@@ -755,8 +896,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *j
  * - `SDL_HAT_LEFTUP`
  * - `SDL_HAT_LEFTUP`
  * - `SDL_HAT_LEFTDOWN`
  * - `SDL_HAT_LEFTDOWN`
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
- * \param hat the hat index to get the state from; indices start at index 0
+ * \param joystick an SDL_Joystick structure containing joystick information.
+ * \param hat the hat index to get the state from; indices start at index 0.
  * \returns the current hat position.
  * \returns the current hat position.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -774,10 +915,10 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
  *
  *
  * Most joysticks do not have trackballs.
  * Most joysticks do not have trackballs.
  *
  *
- * \param joystick the SDL_Joystick to query
- * \param ball the ball index to query; ball indices start at index 0
- * \param dx stores the difference in the x axis position since the last poll
- * \param dy stores the difference in the y axis position since the last poll
+ * \param joystick the SDL_Joystick to query.
+ * \param ball the ball index to query; ball indices start at index 0.
+ * \param dx stores the difference in the x axis position since the last poll.
+ * \param dy stores the difference in the y axis position since the last poll.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -791,9 +932,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick,
 /**
 /**
  * Get the current state of a button on a joystick.
  * Get the current state of a button on a joystick.
  *
  *
- * \param joystick an SDL_Joystick structure containing joystick information
+ * \param joystick an SDL_Joystick structure containing joystick information.
  * \param button the button index to get the state from; indices start at
  * \param button the button index to get the state from; indices start at
- *               index 0
+ *               index 0.
  * \returns 1 if the specified button is pressed, 0 otherwise.
  * \returns 1 if the specified button is pressed, 0 otherwise.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -809,13 +950,13 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
  * Each call to this function cancels any previous rumble effect, and calling
  * Each call to this function cancels any previous rumble effect, and calling
  * it with 0 intensity stops any rumbling.
  * it with 0 intensity stops any rumbling.
  *
  *
- * \param joystick The joystick to vibrate
+ * \param joystick The joystick to vibrate.
  * \param low_frequency_rumble The intensity of the low frequency (left)
  * \param low_frequency_rumble The intensity of the low frequency (left)
- *                             rumble motor, from 0 to 0xFFFF
+ *                             rumble motor, from 0 to 0xFFFF.
  * \param high_frequency_rumble The intensity of the high frequency (right)
  * \param high_frequency_rumble The intensity of the high frequency (right)
- *                              rumble motor, from 0 to 0xFFFF
- * \param duration_ms The duration of the rumble effect, in milliseconds
- * \returns 0, or -1 if rumble isn't supported on this joystick
+ *                              rumble motor, from 0 to 0xFFFF.
+ * \param duration_ms The duration of the rumble effect, in milliseconds.
+ * \returns 0, or -1 if rumble isn't supported on this joystick.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
  *
  *
@@ -829,18 +970,18 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 lo
  * Each call to this function cancels any previous trigger rumble effect, and
  * Each call to this function cancels any previous trigger rumble effect, and
  * calling it with 0 intensity stops any rumbling.
  * calling it with 0 intensity stops any rumbling.
  *
  *
- * Note that this function is for _trigger_ rumble; the first joystick to
- * support this was the PlayStation 5's DualShock 5 controller. If you want
- * the (more common) whole-controller rumble, use SDL_JoystickRumble()
+ * Note that this is rumbling of the _triggers_ and not the game controller as
+ * a whole. This is currently only supported on Xbox One controllers. If you
+ * want the (more common) whole-controller rumble, use SDL_JoystickRumble()
  * instead.
  * instead.
  *
  *
- * \param joystick The joystick to vibrate
+ * \param joystick The joystick to vibrate.
  * \param left_rumble The intensity of the left trigger rumble motor, from 0
  * \param left_rumble The intensity of the left trigger rumble motor, from 0
- *                    to 0xFFFF
+ *                    to 0xFFFF.
  * \param right_rumble The intensity of the right trigger rumble motor, from 0
  * \param right_rumble The intensity of the right trigger rumble motor, from 0
- *                     to 0xFFFF
- * \param duration_ms The duration of the rumble effect, in milliseconds
- * \returns 0, or -1 if trigger rumble isn't supported on this joystick
+ *                     to 0xFFFF.
+ * \param duration_ms The duration of the rumble effect, in milliseconds.
+ * \returns 0, or -1 if trigger rumble isn't supported on this joystick.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  *
  *
@@ -854,7 +995,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, U
  * An example of a joystick LED is the light on the back of a PlayStation 4's
  * An example of a joystick LED is the light on the back of a PlayStation 4's
  * DualShock 4 controller.
  * DualShock 4 controller.
  *
  *
- * \param joystick The joystick to query
+ * \param joystick The joystick to query.
  * \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise.
  * \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -864,7 +1005,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
 /**
 /**
  * Query whether a joystick has rumble support.
  * Query whether a joystick has rumble support.
  *
  *
- * \param joystick The joystick to query
+ * \param joystick The joystick to query.
  * \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise.
  * \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
@@ -876,7 +1017,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
 /**
 /**
  * Query whether a joystick has rumble support on triggers.
  * Query whether a joystick has rumble support on triggers.
  *
  *
- * \param joystick The joystick to query
+ * \param joystick The joystick to query.
  * \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise.
  * \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
@@ -891,11 +1032,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joy
  * An example of a joystick LED is the light on the back of a PlayStation 4's
  * An example of a joystick LED is the light on the back of a PlayStation 4's
  * DualShock 4 controller.
  * DualShock 4 controller.
  *
  *
- * \param joystick The joystick to update
- * \param red The intensity of the red LED
- * \param green The intensity of the green LED
- * \param blue The intensity of the blue LED
- * \returns 0 on success, -1 if this joystick does not have a modifiable LED
+ * \param joystick The joystick to update.
+ * \param red The intensity of the red LED.
+ * \param green The intensity of the green LED.
+ * \param blue The intensity of the blue LED.
+ * \returns 0 on success, -1 if this joystick does not have a modifiable LED.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  */
  */
@@ -904,10 +1045,11 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red
 /**
 /**
  * Send a joystick specific effect packet
  * Send a joystick specific effect packet
  *
  *
- * \param joystick The joystick to affect
- * \param data The data to send to the joystick
- * \param size The size of the data to send to the joystick
- * \returns 0, or -1 if this joystick or driver doesn't support effect packets
+ * \param joystick The joystick to affect.
+ * \param data The data to send to the joystick.
+ * \param size The size of the data to send to the joystick.
+ * \returns 0, or -1 if this joystick or driver doesn't support effect
+ *          packets.
  *
  *
  * \since This function is available since SDL 2.0.16.
  * \since This function is available since SDL 2.0.16.
  */
  */
@@ -916,7 +1058,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const
 /**
 /**
  * Close a joystick previously opened with SDL_JoystickOpen().
  * Close a joystick previously opened with SDL_JoystickOpen().
  *
  *
- * \param joystick The joystick device to close
+ * \param joystick The joystick device to close.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -927,9 +1069,9 @@ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
 /**
 /**
  * Get the battery level of a joystick as SDL_JoystickPowerLevel.
  * Get the battery level of a joystick as SDL_JoystickPowerLevel.
  *
  *
- * \param joystick the SDL_Joystick to query
+ * \param joystick the SDL_Joystick to query.
  * \returns the current battery level as SDL_JoystickPowerLevel on success or
  * \returns the current battery level as SDL_JoystickPowerLevel on success or
- *          `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown
+ *          `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown.
  *
  *
  * \since This function is available since SDL 2.0.4.
  * \since This function is available since SDL 2.0.4.
  */
  */
@@ -943,4 +1085,4 @@ extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL
 
 
 #endif /* SDL_joystick_h_ */
 #endif /* SDL_joystick_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 64 - 19
bsp/simulator/SDL2/include/SDL_keyboard.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_keyboard.h
+ * # CategoryKeyboard
  *
  *
- *  Include file for SDL keyboard event handling
+ * Include file for SDL keyboard event handling
  */
  */
 
 
 #ifndef SDL_keyboard_h_
 #ifndef SDL_keyboard_h_
@@ -40,14 +40,15 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  \brief The SDL keysym structure, used in key events.
+ * The SDL keysym structure, used in key events.
  *
  *
- *  \note  If you are looking for translated character input, see the ::SDL_TEXTINPUT event.
+ * If you are looking for translated character input, see the SDL_TEXTINPUT
+ * event.
  */
  */
 typedef struct SDL_Keysym
 typedef struct SDL_Keysym
 {
 {
-    SDL_Scancode scancode;      /**< SDL physical key code - see ::SDL_Scancode for details */
-    SDL_Keycode sym;            /**< SDL virtual key code - see ::SDL_Keycode for details */
+    SDL_Scancode scancode;      /**< SDL physical key code - see SDL_Scancode for details */
+    SDL_Keycode sym;            /**< SDL virtual key code - see SDL_Keycode for details */
     Uint16 mod;                 /**< current key modifiers */
     Uint16 mod;                 /**< current key modifiers */
     Uint32 unused;
     Uint32 unused;
 } SDL_Keysym;
 } SDL_Keysym;
@@ -84,15 +85,27 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
  * Note: This function doesn't take into account whether shift has been
  * Note: This function doesn't take into account whether shift has been
  * pressed or not.
  * pressed or not.
  *
  *
- * \param numkeys if non-NULL, receives the length of the returned array
+ * \param numkeys if non-NULL, receives the length of the returned array.
  * \returns a pointer to an array of key states.
  * \returns a pointer to an array of key states.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
  * \sa SDL_PumpEvents
  * \sa SDL_PumpEvents
+ * \sa SDL_ResetKeyboard
  */
  */
 extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
 extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
 
 
+/**
+ * Clear the state of the keyboard
+ *
+ * This function will generate key up events for all pressed keys.
+ *
+ * \since This function is available since SDL 2.24.0.
+ *
+ * \sa SDL_GetKeyboardState
+ */
+extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
+
 /**
 /**
  * Get the current key modifier state for the keyboard.
  * Get the current key modifier state for the keyboard.
  *
  *
@@ -117,7 +130,7 @@ extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
  * This does not change the keyboard state, only the key modifier flags that
  * This does not change the keyboard state, only the key modifier flags that
  * SDL reports.
  * SDL reports.
  *
  *
- * \param modstate the desired SDL_Keymod for the keyboard
+ * \param modstate the desired SDL_Keymod for the keyboard.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -131,7 +144,7 @@ extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
  *
  *
  * See SDL_Keycode for details.
  * See SDL_Keycode for details.
  *
  *
- * \param scancode the desired SDL_Scancode to query
+ * \param scancode the desired SDL_Scancode to query.
  * \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
  * \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -147,7 +160,7 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode
  *
  *
  * See SDL_Scancode for details.
  * See SDL_Scancode for details.
  *
  *
- * \param key the desired SDL_Keycode to query
+ * \param key the desired SDL_Keycode to query.
  * \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
  * \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -171,7 +184,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
  * unsuitable for creating a stable cross-platform two-way mapping between
  * unsuitable for creating a stable cross-platform two-way mapping between
  * strings and scancodes.
  * strings and scancodes.
  *
  *
- * \param scancode the desired SDL_Scancode to query
+ * \param scancode the desired SDL_Scancode to query.
  * \returns a pointer to the name for the scancode. If the scancode doesn't
  * \returns a pointer to the name for the scancode. If the scancode doesn't
  *          have a name this function returns an empty string ("").
  *          have a name this function returns an empty string ("").
  *
  *
@@ -185,7 +198,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
 /**
 /**
  * Get a scancode from a human-readable name.
  * Get a scancode from a human-readable name.
  *
  *
- * \param name the human-readable scancode name
+ * \param name the human-readable scancode name.
  * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
  * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
  *          recognized; call SDL_GetError() for more information.
  *          recognized; call SDL_GetError() for more information.
  *
  *
@@ -202,7 +215,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
  *
  *
  * See SDL_Scancode and SDL_Keycode for details.
  * See SDL_Scancode and SDL_Keycode for details.
  *
  *
- * \param key the desired SDL_Keycode to query
+ * \param key the desired SDL_Keycode to query.
  * \returns a pointer to a UTF-8 string that stays valid at least until the
  * \returns a pointer to a UTF-8 string that stays valid at least until the
  *          next call to this function. If you need it around any longer, you
  *          next call to this function. If you need it around any longer, you
  *          must copy it. If the key doesn't have a name, this function
  *          must copy it. If the key doesn't have a name, this function
@@ -219,7 +232,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
 /**
 /**
  * Get a key code from a human-readable name.
  * Get a key code from a human-readable name.
  *
  *
- * \param name the human-readable key name
+ * \param name the human-readable key name.
  * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
  * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -241,6 +254,10 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
  *
  *
  * On some platforms using this function activates the screen keyboard.
  * On some platforms using this function activates the screen keyboard.
  *
  *
+ * On desktop platforms, SDL_StartTextInput() is implicitly called on SDL
+ * video subsystem initialization which will cause SDL_TextInputEvent and
+ * SDL_TextEditingEvent to begin emitting.
+ *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
  * \sa SDL_SetTextInputRect
  * \sa SDL_SetTextInputRect
@@ -268,17 +285,45 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
  */
  */
 extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
 extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
 
 
+/**
+ * Dismiss the composition window/IME without disabling the subsystem.
+ *
+ * \since This function is available since SDL 2.0.22.
+ *
+ * \sa SDL_StartTextInput
+ * \sa SDL_StopTextInput
+ */
+extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
+
+/**
+ * Returns if an IME Composite or Candidate window is currently shown.
+ *
+ * \since This function is available since SDL 2.0.22.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
+
 /**
 /**
  * Set the rectangle used to type Unicode text inputs.
  * Set the rectangle used to type Unicode text inputs.
  *
  *
+ * Native input methods will place a window with word suggestions near it,
+ * without covering the text being inputted.
+ *
+ * To start text input in a given location, this function is intended to be
+ * called before SDL_StartTextInput, although some platforms support moving
+ * the rectangle even while text input (and a composition) is active.
+ *
+ * Note: If you want to use the system native IME window, try setting hint
+ * **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you
+ * any feedback.
+ *
  * \param rect the SDL_Rect structure representing the rectangle to receive
  * \param rect the SDL_Rect structure representing the rectangle to receive
- *             text (ignored if NULL)
+ *             text (ignored if NULL).
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
  * \sa SDL_StartTextInput
  * \sa SDL_StartTextInput
  */
  */
-extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
+extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
 
 
 /**
 /**
  * Check whether the platform has screen keyboard support.
  * Check whether the platform has screen keyboard support.
@@ -296,7 +341,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
 /**
 /**
  * Check whether the screen keyboard is shown for given window.
  * Check whether the screen keyboard is shown for given window.
  *
  *
- * \param window the window for which screen keyboard should be queried
+ * \param window the window for which screen keyboard should be queried.
  * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
  * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -313,4 +358,4 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
 
 
 #endif /* SDL_keyboard_h_ */
 #endif /* SDL_keyboard_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 20 - 15
bsp/simulator/SDL2/include/SDL_keycode.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_keycode.h
+ * # CategoryKeycode
  *
  *
- *  Defines constants which identify keyboard keys and modifiers.
+ * Defines constants which identify keyboard keys and modifiers.
  */
  */
 
 
 #ifndef SDL_keycode_h_
 #ifndef SDL_keycode_h_
@@ -32,22 +32,22 @@
 #include "SDL_scancode.h"
 #include "SDL_scancode.h"
 
 
 /**
 /**
- *  \brief The SDL virtual key representation.
+ * The SDL virtual key representation.
  *
  *
- *  Values of this type are used to represent keyboard keys using the current
- *  layout of the keyboard.  These values include Unicode values representing
- *  the unmodified character that would be generated by pressing the key, or
- *  an SDLK_* constant for those keys that do not generate characters.
+ * Values of this type are used to represent keyboard keys using the current
+ * layout of the keyboard. These values include Unicode values representing
+ * the unmodified character that would be generated by pressing the key, or an
+ * SDLK_* constant for those keys that do not generate characters.
  *
  *
- *  A special exception is the number keys at the top of the keyboard which
- *  always map to SDLK_0...SDLK_9, regardless of layout.
+ * A special exception is the number keys at the top of the keyboard which map
+ * to SDLK_0...SDLK_9 on AZERTY layouts.
  */
  */
 typedef Sint32 SDL_Keycode;
 typedef Sint32 SDL_Keycode;
 
 
 #define SDLK_SCANCODE_MASK (1<<30)
 #define SDLK_SCANCODE_MASK (1<<30)
 #define SDL_SCANCODE_TO_KEYCODE(X)  (X | SDLK_SCANCODE_MASK)
 #define SDL_SCANCODE_TO_KEYCODE(X)  (X | SDLK_SCANCODE_MASK)
 
 
-typedef enum
+typedef enum SDL_KeyCode
 {
 {
     SDLK_UNKNOWN = 0,
     SDLK_UNKNOWN = 0,
 
 
@@ -318,13 +318,18 @@ typedef enum
     SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
     SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
 
 
     SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
     SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
-    SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
+    SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD),
+
+    SDLK_SOFTLEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT),
+    SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT),
+    SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL),
+    SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL)
 } SDL_KeyCode;
 } SDL_KeyCode;
 
 
 /**
 /**
- * \brief Enumeration of valid key mods (possibly OR'd together).
+ * Enumeration of valid key mods (possibly OR'd together).
  */
  */
-typedef enum
+typedef enum SDL_Keymod
 {
 {
     KMOD_NONE = 0x0000,
     KMOD_NONE = 0x0000,
     KMOD_LSHIFT = 0x0001,
     KMOD_LSHIFT = 0x0001,
@@ -350,4 +355,4 @@ typedef enum
 
 
 #endif /* SDL_keycode_h_ */
 #endif /* SDL_keycode_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 24 - 22
bsp/simulator/SDL2/include/SDL_loadso.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,23 +19,25 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
+/* WIKI CATEGORY: LoadSO */
+
 /**
 /**
- *  \file SDL_loadso.h
- *
- *  System dependent library loading routines
- *
- *  Some things to keep in mind:
- *  \li These functions only work on C function names.  Other languages may
- *      have name mangling and intrinsic language support that varies from
- *      compiler to compiler.
- *  \li Make sure you declare your function pointers with the same calling
- *      convention as the actual library function.  Your code will crash
- *      mysteriously if you do not do this.
- *  \li Avoid namespace collisions.  If you load a symbol from the library,
- *      it is not defined whether or not it goes into the global symbol
- *      namespace for the application.  If it does and it conflicts with
- *      symbols in your code or other shared libraries, you will not get
- *      the results you expect. :)
+ * # CategoryLoadSO
+ *
+ * System-dependent library loading routines.
+ *
+ * Some things to keep in mind:
+ *
+ * - These functions only work on C function names. Other languages may have
+ *   name mangling and intrinsic language support that varies from compiler to
+ *   compiler.
+ * - Make sure you declare your function pointers with the same calling
+ *   convention as the actual library function. Your code will crash
+ *   mysteriously if you do not do this.
+ * - Avoid namespace collisions. If you load a symbol from the library, it is
+ *   not defined whether or not it goes into the global symbol namespace for
+ *   the application. If it does and it conflicts with symbols in your code or
+ *   other shared libraries, you will not get the results you expect. :)
  */
  */
 
 
 #ifndef SDL_loadso_h_
 #ifndef SDL_loadso_h_
@@ -53,7 +55,7 @@ extern "C" {
 /**
 /**
  * Dynamically load a shared object.
  * Dynamically load a shared object.
  *
  *
- * \param sofile a system-dependent name of the object file
+ * \param sofile a system-dependent name of the object file.
  * \returns an opaque pointer to the object handle or NULL if there was an
  * \returns an opaque pointer to the object handle or NULL if there was an
  *          error; call SDL_GetError() for more information.
  *          error; call SDL_GetError() for more information.
  *
  *
@@ -79,8 +81,8 @@ extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
  *
  *
  * If the requested function doesn't exist, NULL is returned.
  * If the requested function doesn't exist, NULL is returned.
  *
  *
- * \param handle a valid shared object handle returned by SDL_LoadObject()
- * \param name the name of the function to look up
+ * \param handle a valid shared object handle returned by SDL_LoadObject().
+ * \param name the name of the function to look up.
  * \returns a pointer to the function or NULL if there was an error; call
  * \returns a pointer to the function or NULL if there was an error; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -95,7 +97,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
 /**
 /**
  * Unload a shared object from memory.
  * Unload a shared object from memory.
  *
  *
- * \param handle a valid shared object handle returned by SDL_LoadObject()
+ * \param handle a valid shared object handle returned by SDL_LoadObject().
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -112,4 +114,4 @@ extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
 
 
 #endif /* SDL_loadso_h_ */
 #endif /* SDL_loadso_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 6 - 5
bsp/simulator/SDL2/include/SDL_locale.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_locale.h
+ * # CategoryLocale
  *
  *
- *  Include file for SDL locale services
+ * Include file for SDL locale services
  */
  */
 
 
 #ifndef _SDL_locale_h
 #ifndef _SDL_locale_h
@@ -70,7 +70,8 @@ typedef struct SDL_Locale
  * example, a German citizen that is fluent in US English and knows enough
  * example, a German citizen that is fluent in US English and knows enough
  * Japanese to navigate around Tokyo might have a list like: { "de", "en_US",
  * Japanese to navigate around Tokyo might have a list like: { "de", "en_US",
  * "jp", NULL }. Someone from England might prefer British English (where
  * "jp", NULL }. Someone from England might prefer British English (where
- * "color" is spelled "colour", etc), but will settle for anything like it: {
+ * "color" is spelled "colour", etc), but will settle for anything like it:
+ {
  * "en_GB", "en", NULL }.
  * "en_GB", "en", NULL }.
  *
  *
  * This function returns NULL on error, including when the platform does not
  * This function returns NULL on error, including when the platform does not
@@ -100,4 +101,4 @@ extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);
 
 
 #endif /* _SDL_locale_h */
 #endif /* _SDL_locale_h */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 62 - 61
bsp/simulator/SDL2/include/SDL_log.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,18 +20,19 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_log.h
+ * # CategoryLog
  *
  *
- *  Simple log messages with categories and priorities.
+ * Simple log messages with categories and priorities.
  *
  *
- *  By default logs are quiet, but if you're debugging SDL you might want:
+ * By default logs are quiet, but if you're debugging SDL you might want:
  *
  *
- *      SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
+ * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
  *
  *
- *  Here's where the messages go on different platforms:
- *      Windows: debug output stream
- *      Android: log output
- *      Others: standard error output (stderr)
+ * Here's where the messages go on different platforms:
+ *
+ * - Windows: debug output stream
+ * - Android: log output
+ * - Others: standard error output (stderr)
  */
  */
 
 
 #ifndef SDL_log_h_
 #ifndef SDL_log_h_
@@ -47,21 +48,20 @@ extern "C" {
 
 
 
 
 /**
 /**
- *  \brief The maximum size of a log message
+ * The maximum size of a log message prior to SDL 2.0.24
  *
  *
- *  Messages longer than the maximum size will be truncated
+ * As of 2.0.24 there is no limit to the length of SDL log messages.
  */
  */
 #define SDL_MAX_LOG_MESSAGE 4096
 #define SDL_MAX_LOG_MESSAGE 4096
 
 
 /**
 /**
- *  \brief The predefined log categories
+ * The predefined log categories
  *
  *
- *  By default the application category is enabled at the INFO level,
- *  the assert category is enabled at the WARN level, test is enabled
- *  at the VERBOSE level and all other categories are enabled at the
- *  CRITICAL level.
+ * By default the application category is enabled at the INFO level, the
+ * assert category is enabled at the WARN level, test is enabled at the
+ * VERBOSE level and all other categories are enabled at the ERROR level.
  */
  */
-typedef enum
+typedef enum SDL_LogCategory
 {
 {
     SDL_LOG_CATEGORY_APPLICATION,
     SDL_LOG_CATEGORY_APPLICATION,
     SDL_LOG_CATEGORY_ERROR,
     SDL_LOG_CATEGORY_ERROR,
@@ -97,9 +97,9 @@ typedef enum
 } SDL_LogCategory;
 } SDL_LogCategory;
 
 
 /**
 /**
- *  \brief The predefined log priorities
+ * The predefined log priorities
  */
  */
-typedef enum
+typedef enum SDL_LogPriority
 {
 {
     SDL_LOG_PRIORITY_VERBOSE = 1,
     SDL_LOG_PRIORITY_VERBOSE = 1,
     SDL_LOG_PRIORITY_DEBUG,
     SDL_LOG_PRIORITY_DEBUG,
@@ -114,7 +114,7 @@ typedef enum
 /**
 /**
  * Set the priority of all log categories.
  * Set the priority of all log categories.
  *
  *
- * \param priority the SDL_LogPriority to assign
+ * \param priority the SDL_LogPriority to assign.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -125,8 +125,8 @@ extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
 /**
 /**
  * Set the priority of a particular log category.
  * Set the priority of a particular log category.
  *
  *
- * \param category the category to assign a priority to
- * \param priority the SDL_LogPriority to assign
+ * \param category the category to assign a priority to.
+ * \param priority the SDL_LogPriority to assign.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -139,8 +139,8 @@ extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
 /**
 /**
  * Get the priority of a particular log category.
  * Get the priority of a particular log category.
  *
  *
- * \param category the category to query
- * \returns the SDL_LogPriority for the requested category
+ * \param category the category to query.
+ * \returns the SDL_LogPriority for the requested category.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -166,7 +166,7 @@ extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
  * = * \param fmt a printf() style message format string
  * = * \param fmt a printf() style message format string
  *
  *
  * \param ... additional parameters matching % tokens in the `fmt` string, if
  * \param ... additional parameters matching % tokens in the `fmt` string, if
- *            any
+ *            any.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -184,10 +184,10 @@ extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, .
 /**
 /**
  * Log a message with SDL_LOG_PRIORITY_VERBOSE.
  * Log a message with SDL_LOG_PRIORITY_VERBOSE.
  *
  *
- * \param category the category of the message
- * \param fmt a printf() style message format string
+ * \param category the category of the message.
+ * \param fmt a printf() style message format string.
  * \param ... additional parameters matching % tokens in the **fmt** string,
  * \param ... additional parameters matching % tokens in the **fmt** string,
- *            if any
+ *            if any.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -205,10 +205,10 @@ extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRI
 /**
 /**
  * Log a message with SDL_LOG_PRIORITY_DEBUG.
  * Log a message with SDL_LOG_PRIORITY_DEBUG.
  *
  *
- * \param category the category of the message
- * \param fmt a printf() style message format string
+ * \param category the category of the message.
+ * \param fmt a printf() style message format string.
  * \param ... additional parameters matching % tokens in the **fmt** string,
  * \param ... additional parameters matching % tokens in the **fmt** string,
- *            if any
+ *            if any.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -226,10 +226,10 @@ extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING
 /**
 /**
  * Log a message with SDL_LOG_PRIORITY_INFO.
  * Log a message with SDL_LOG_PRIORITY_INFO.
  *
  *
- * \param category the category of the message
- * \param fmt a printf() style message format string
+ * \param category the category of the message.
+ * \param fmt a printf() style message format string.
  * \param ... additional parameters matching % tokens in the **fmt** string,
  * \param ... additional parameters matching % tokens in the **fmt** string,
- *            if any
+ *            if any.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -247,10 +247,10 @@ extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING
 /**
 /**
  * Log a message with SDL_LOG_PRIORITY_WARN.
  * Log a message with SDL_LOG_PRIORITY_WARN.
  *
  *
- * \param category the category of the message
- * \param fmt a printf() style message format string
+ * \param category the category of the message.
+ * \param fmt a printf() style message format string.
  * \param ... additional parameters matching % tokens in the **fmt** string,
  * \param ... additional parameters matching % tokens in the **fmt** string,
- *            if any
+ *            if any.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -268,10 +268,10 @@ extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING
 /**
 /**
  * Log a message with SDL_LOG_PRIORITY_ERROR.
  * Log a message with SDL_LOG_PRIORITY_ERROR.
  *
  *
- * \param category the category of the message
- * \param fmt a printf() style message format string
+ * \param category the category of the message.
+ * \param fmt a printf() style message format string.
  * \param ... additional parameters matching % tokens in the **fmt** string,
  * \param ... additional parameters matching % tokens in the **fmt** string,
- *            if any
+ *            if any.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -289,10 +289,10 @@ extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING
 /**
 /**
  * Log a message with SDL_LOG_PRIORITY_CRITICAL.
  * Log a message with SDL_LOG_PRIORITY_CRITICAL.
  *
  *
- * \param category the category of the message
- * \param fmt a printf() style message format string
+ * \param category the category of the message.
+ * \param fmt a printf() style message format string.
  * \param ... additional parameters matching % tokens in the **fmt** string,
  * \param ... additional parameters matching % tokens in the **fmt** string,
- *            if any
+ *            if any.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -310,11 +310,11 @@ extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STR
 /**
 /**
  * Log a message with the specified category and priority.
  * Log a message with the specified category and priority.
  *
  *
- * \param category the category of the message
- * \param priority the priority of the message
- * \param fmt a printf() style message format string
+ * \param category the category of the message.
+ * \param priority the priority of the message.
+ * \param fmt a printf() style message format string.
  * \param ... additional parameters matching % tokens in the **fmt** string,
  * \param ... additional parameters matching % tokens in the **fmt** string,
- *            if any
+ *            if any.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -334,10 +334,10 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
 /**
 /**
  * Log a message with the specified category and priority.
  * Log a message with the specified category and priority.
  *
  *
- * \param category the category of the message
- * \param priority the priority of the message
- * \param fmt a printf() style message format string
- * \param ap a variable argument list
+ * \param category the category of the message.
+ * \param priority the priority of the message.
+ * \param fmt a printf() style message format string.
+ * \param ap a variable argument list.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -352,17 +352,18 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
  */
  */
 extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
 extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
                                              SDL_LogPriority priority,
                                              SDL_LogPriority priority,
-                                             const char *fmt, va_list ap);
+                                             SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3);
 
 
 /**
 /**
  * The prototype for the log output callback function.
  * The prototype for the log output callback function.
  *
  *
  * This function is called by SDL when there is new text to be logged.
  * This function is called by SDL when there is new text to be logged.
  *
  *
- * \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction()
- * \param category the category of the message
- * \param priority the priority of the message
- * \param message the message being output
+ * \param userdata what was passed as `userdata` to
+ *                 SDL_LogSetOutputFunction().
+ * \param category the category of the message.
+ * \param priority the priority of the message.
+ * \param message the message being output.
  */
  */
 typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
 typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
 
 
@@ -370,9 +371,9 @@ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_
  * Get the current log output function.
  * Get the current log output function.
  *
  *
  * \param callback an SDL_LogOutputFunction filled in with the current log
  * \param callback an SDL_LogOutputFunction filled in with the current log
- *                 callback
+ *                 callback.
  * \param userdata a pointer filled in with the pointer that is passed to
  * \param userdata a pointer filled in with the pointer that is passed to
- *                 `callback`
+ *                 `callback`.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -383,8 +384,8 @@ extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *cal
 /**
 /**
  * Replace the default log output function with one of your own.
  * Replace the default log output function with one of your own.
  *
  *
- * \param callback an SDL_LogOutputFunction to call instead of the default
- * \param userdata a pointer that is passed to `callback`
+ * \param callback an SDL_LogOutputFunction to call instead of the default.
+ * \param userdata a pointer that is passed to `callback`.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -401,4 +402,4 @@ extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction call
 
 
 #endif /* SDL_log_h_ */
 #endif /* SDL_log_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 63 - 15
bsp/simulator/SDL2/include/SDL_main.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -25,9 +25,9 @@
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
 
 
 /**
 /**
- *  \file SDL_main.h
+ * # CategoryMain
  *
  *
- *  Redefine main() on some platforms so that it is called by SDL.
+ * Redefine main() on some platforms so that it is called by SDL.
  */
  */
 
 
 #ifndef SDL_MAIN_HANDLED
 #ifndef SDL_MAIN_HANDLED
@@ -51,6 +51,15 @@
 */
 */
 #define SDL_MAIN_NEEDED
 #define SDL_MAIN_NEEDED
 
 
+#elif defined(__GDK__)
+/* On GDK, SDL provides a main function that initializes the game runtime.
+
+   Please note that #include'ing SDL_main.h is not enough to get a main()
+   function working. You must either link against SDL2main or, if not possible,
+   call the SDL_GDKRunApp function from your entry point.
+*/
+#define SDL_MAIN_NEEDED
+
 #elif defined(__IPHONEOS__)
 #elif defined(__IPHONEOS__)
 /* On iOS SDL provides a main function that creates an application delegate
 /* On iOS SDL provides a main function that creates an application delegate
    and starts the iOS application run loop.
    and starts the iOS application run loop.
@@ -92,6 +101,23 @@
  */
  */
 #define SDL_MAIN_AVAILABLE
 #define SDL_MAIN_AVAILABLE
 
 
+#elif defined(__PS2__)
+#define SDL_MAIN_AVAILABLE
+
+#define SDL_PS2_SKIP_IOP_RESET() \
+   void reset_IOP(); \
+   void reset_IOP()
+   {}
+
+#elif defined(__3DS__)
+/*
+  On N3DS, SDL provides a main function that sets up the screens
+  and storage.
+
+  If you provide this yourself, you may define SDL_MAIN_HANDLED
+*/
+#define SDL_MAIN_AVAILABLE
+
 #endif
 #endif
 #endif /* SDL_MAIN_HANDLED */
 #endif /* SDL_MAIN_HANDLED */
 
 
@@ -104,14 +130,14 @@
  *
  *
  *  The application's main() function must be called with C linkage,
  *  The application's main() function must be called with C linkage,
  *  and should be declared like this:
  *  and should be declared like this:
- *  \code
+ *  ```c
  *  #ifdef __cplusplus
  *  #ifdef __cplusplus
  *  extern "C"
  *  extern "C"
  *  #endif
  *  #endif
  *  int main(int argc, char *argv[])
  *  int main(int argc, char *argv[])
  *  {
  *  {
  *  }
  *  }
- *  \endcode
+ *  ```
  */
  */
 
 
 #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
 #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
@@ -124,7 +150,7 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  The prototype for the application's main() function
+ * The prototype for the application's main() function
  */
  */
 typedef int (*SDL_main_func)(int argc, char *argv[]);
 typedef int (*SDL_main_func)(int argc, char *argv[]);
 extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
 extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
@@ -145,7 +171,7 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
  */
  */
 extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
 extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
 
 
-#ifdef __WIN32__
+#if defined(__WIN32__) || defined(__GDK__)
 
 
 /**
 /**
  * Register a win32 window class for SDL's use.
  * Register a win32 window class for SDL's use.
@@ -189,7 +215,7 @@ extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void
  */
  */
 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
 
 
-#endif /* __WIN32__ */
+#endif /* defined(__WIN32__) || defined(__GDK__) */
 
 
 
 
 #ifdef __WINRT__
 #ifdef __WINRT__
@@ -197,8 +223,8 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
 /**
 /**
  * Initialize and launch an SDL/WinRT application.
  * Initialize and launch an SDL/WinRT application.
  *
  *
- * \param mainFunction the SDL app's C-style main(), an SDL_main_func
- * \param reserved reserved for future use; should be NULL
+ * \param mainFunction the SDL app's C-style main(), an SDL_main_func.
+ * \param reserved reserved for future use; should be NULL.
  * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
  * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
  *          more information on the failure.
  *          more information on the failure.
  *
  *
@@ -213,10 +239,10 @@ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * r
 /**
 /**
  * Initializes and launches an SDL application.
  * Initializes and launches an SDL application.
  *
  *
- * \param argc The argc parameter from the application's main() function
- * \param argv The argv parameter from the application's main() function
- * \param mainFunction The SDL app's C-style main(), an SDL_main_func
- * \return the return value from mainFunction
+ * \param argc The argc parameter from the application's main() function.
+ * \param argv The argv parameter from the application's main() function.
+ * \param mainFunction The SDL app's C-style main(), an SDL_main_func.
+ * \return the return value from mainFunction.
  *
  *
  * \since This function is available since SDL 2.0.10.
  * \since This function is available since SDL 2.0.10.
  */
  */
@@ -224,6 +250,28 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun
 
 
 #endif /* __IPHONEOS__ */
 #endif /* __IPHONEOS__ */
 
 
+#ifdef __GDK__
+
+/**
+ * Initialize and launch an SDL GDK application.
+ *
+ * \param mainFunction the SDL app's C-style main(), an SDL_main_func.
+ * \param reserved reserved for future use; should be NULL.
+ * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
+ *          more information on the failure.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved);
+
+/**
+ * Callback from the application to let the suspend continue.
+ *
+ * \since This function is available since SDL 2.28.0.
+ */
+extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
+
+#endif /* __GDK__ */
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
@@ -232,4 +280,4 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun
 
 
 #endif /* SDL_main_h_ */
 #endif /* SDL_main_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 22 - 19
bsp/simulator/SDL2/include/SDL_messagebox.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -32,9 +32,11 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- * SDL_MessageBox flags. If supported will display warning icon, etc.
+ * SDL_MessageBox flags.
+ *
+ * If supported will display warning icon, etc.
  */
  */
-typedef enum
+typedef enum SDL_MessageBoxFlags
 {
 {
     SDL_MESSAGEBOX_ERROR                 = 0x00000010,   /**< error dialog */
     SDL_MESSAGEBOX_ERROR                 = 0x00000010,   /**< error dialog */
     SDL_MESSAGEBOX_WARNING               = 0x00000020,   /**< warning dialog */
     SDL_MESSAGEBOX_WARNING               = 0x00000020,   /**< warning dialog */
@@ -46,7 +48,7 @@ typedef enum
 /**
 /**
  * Flags for SDL_MessageBoxButtonData.
  * Flags for SDL_MessageBoxButtonData.
  */
  */
-typedef enum
+typedef enum SDL_MessageBoxButtonFlags
 {
 {
     SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001,  /**< Marks the default button when return is hit */
     SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001,  /**< Marks the default button when return is hit */
     SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002   /**< Marks the default button when escape is hit */
     SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002   /**< Marks the default button when escape is hit */
@@ -55,9 +57,9 @@ typedef enum
 /**
 /**
  * Individual button data.
  * Individual button data.
  */
  */
-typedef struct
+typedef struct SDL_MessageBoxButtonData
 {
 {
-    Uint32 flags;       /**< ::SDL_MessageBoxButtonFlags */
+    Uint32 flags;       /**< SDL_MessageBoxButtonFlags */
     int buttonid;       /**< User defined button id (value returned via SDL_ShowMessageBox) */
     int buttonid;       /**< User defined button id (value returned via SDL_ShowMessageBox) */
     const char * text;  /**< The UTF-8 button text */
     const char * text;  /**< The UTF-8 button text */
 } SDL_MessageBoxButtonData;
 } SDL_MessageBoxButtonData;
@@ -65,12 +67,12 @@ typedef struct
 /**
 /**
  * RGB value used in a message box color scheme
  * RGB value used in a message box color scheme
  */
  */
-typedef struct
+typedef struct SDL_MessageBoxColor
 {
 {
     Uint8 r, g, b;
     Uint8 r, g, b;
 } SDL_MessageBoxColor;
 } SDL_MessageBoxColor;
 
 
-typedef enum
+typedef enum SDL_MessageBoxColorType
 {
 {
     SDL_MESSAGEBOX_COLOR_BACKGROUND,
     SDL_MESSAGEBOX_COLOR_BACKGROUND,
     SDL_MESSAGEBOX_COLOR_TEXT,
     SDL_MESSAGEBOX_COLOR_TEXT,
@@ -83,7 +85,7 @@ typedef enum
 /**
 /**
  * A set of colors to use for message box dialogs
  * A set of colors to use for message box dialogs
  */
  */
-typedef struct
+typedef struct SDL_MessageBoxColorScheme
 {
 {
     SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
     SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
 } SDL_MessageBoxColorScheme;
 } SDL_MessageBoxColorScheme;
@@ -91,9 +93,9 @@ typedef struct
 /**
 /**
  * MessageBox structure containing title, text, window, etc.
  * MessageBox structure containing title, text, window, etc.
  */
  */
-typedef struct
+typedef struct SDL_MessageBoxData
 {
 {
-    Uint32 flags;                       /**< ::SDL_MessageBoxFlags */
+    Uint32 flags;                       /**< SDL_MessageBoxFlags */
     SDL_Window *window;                 /**< Parent window, can be NULL */
     SDL_Window *window;                 /**< Parent window, can be NULL */
     const char *title;                  /**< UTF-8 title */
     const char *title;                  /**< UTF-8 title */
     const char *message;                /**< UTF-8 message text */
     const char *message;                /**< UTF-8 message text */
@@ -101,7 +103,7 @@ typedef struct
     int numbuttons;
     int numbuttons;
     const SDL_MessageBoxButtonData *buttons;
     const SDL_MessageBoxButtonData *buttons;
 
 
-    const SDL_MessageBoxColorScheme *colorScheme;   /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
+    const SDL_MessageBoxColorScheme *colorScheme;   /**< SDL_MessageBoxColorScheme, can be NULL to use system settings */
 } SDL_MessageBoxData;
 } SDL_MessageBoxData;
 
 
 /**
 /**
@@ -128,8 +130,9 @@ typedef struct
  * to stderr if you can.
  * to stderr if you can.
  *
  *
  * \param messageboxdata the SDL_MessageBoxData structure with title, text and
  * \param messageboxdata the SDL_MessageBoxData structure with title, text and
- *                       other options
- * \param buttonid the pointer to which user id of hit button should be copied
+ *                       other options.
+ * \param buttonid the pointer to which user id of hit button should be
+ *                 copied.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -168,10 +171,10 @@ extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *message
  * concern, check the return value from this function and fall back to writing
  * concern, check the return value from this function and fall back to writing
  * to stderr if you can.
  * to stderr if you can.
  *
  *
- * \param flags an SDL_MessageBoxFlags value
- * \param title UTF-8 title text
- * \param message UTF-8 message text
- * \param window the parent window, or NULL for no parent
+ * \param flags an SDL_MessageBoxFlags value.
+ * \param title UTF-8 title text.
+ * \param message UTF-8 message text.
+ * \param window the parent window, or NULL for no parent.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -190,4 +193,4 @@ extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *t
 
 
 #endif /* SDL_messagebox_h_ */
 #endif /* SDL_messagebox_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 11 - 9
bsp/simulator/SDL2/include/SDL_metal.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,10 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_metal.h
+ * # CategoryMetal
  *
  *
- *  Header file for functions to creating Metal layers and views on SDL windows.
+ * Header file for functions to creating Metal layers and views on SDL
+ * windows.
  */
  */
 
 
 #ifndef SDL_metal_h_
 #ifndef SDL_metal_h_
@@ -37,9 +38,9 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
+ * A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
  *
  *
- *  \note This can be cast directly to an NSView or UIView.
+ * This can be cast directly to an NSView or UIView.
  */
  */
 typedef void *SDL_MetalView;
 typedef void *SDL_MetalView;
 
 
@@ -82,7 +83,7 @@ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  *
  *
- * \sa SDL_MetalCreateView
+ * \sa SDL_Metal_CreateView
  */
  */
 extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
 extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
 
 
@@ -90,8 +91,9 @@ extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
  * Get the size of a window's underlying drawable in pixels (for use with
  * Get the size of a window's underlying drawable in pixels (for use with
  * setting viewport, scissor & etc).
  * setting viewport, scissor & etc).
  *
  *
- * \param window SDL_Window from which the drawable size should be queried
- * \param w Pointer to variable for storing the width in pixels, may be NULL
+ * \param window SDL_Window from which the drawable size should be queried.
+ * \param w Pointer to variable for storing the width in pixels, may be NULL.
+ * \param h Pointer to variable for storing the height in pixels, may be NULL.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
  *
  *
@@ -109,4 +111,4 @@ extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *
 #endif
 #endif
 #include "close_code.h"
 #include "close_code.h"
 
 
-#endif /* SDL_metal_h_ */
+#endif /* SDL_metal_h_ */

+ 4 - 4
bsp/simulator/SDL2/include/SDL_misc.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_misc.h
+ * # CategoryMisc
  *
  *
- *  \brief Include file for SDL API functions that don't fit elsewhere.
+ * Include file for SDL API functions that don't fit elsewhere.
  */
  */
 
 
 #ifndef SDL_misc_h_
 #ifndef SDL_misc_h_
@@ -76,4 +76,4 @@ extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url);
 
 
 #endif /* SDL_misc_h_ */
 #endif /* SDL_misc_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 52 - 42
bsp/simulator/SDL2/include/SDL_mouse.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_mouse.h
+ * # CategoryMouse
  *
  *
- *  Include file for SDL mouse event handling.
+ * Include file for SDL mouse event handling.
  */
  */
 
 
 #ifndef SDL_mouse_h_
 #ifndef SDL_mouse_h_
@@ -41,9 +41,9 @@ extern "C" {
 typedef struct SDL_Cursor SDL_Cursor;   /**< Implementation dependent */
 typedef struct SDL_Cursor SDL_Cursor;   /**< Implementation dependent */
 
 
 /**
 /**
- * \brief Cursor types for SDL_CreateSystemCursor().
+ * Cursor types for SDL_CreateSystemCursor().
  */
  */
-typedef enum
+typedef enum SDL_SystemCursor
 {
 {
     SDL_SYSTEM_CURSOR_ARROW,     /**< Arrow */
     SDL_SYSTEM_CURSOR_ARROW,     /**< Arrow */
     SDL_SYSTEM_CURSOR_IBEAM,     /**< I-beam */
     SDL_SYSTEM_CURSOR_IBEAM,     /**< I-beam */
@@ -61,9 +61,9 @@ typedef enum
 } SDL_SystemCursor;
 } SDL_SystemCursor;
 
 
 /**
 /**
- * \brief Scroll direction types for the Scroll event
+ * Scroll direction types for the Scroll event
  */
  */
-typedef enum
+typedef enum SDL_MouseWheelDirection
 {
 {
     SDL_MOUSEWHEEL_NORMAL,    /**< The scroll direction is normal */
     SDL_MOUSEWHEEL_NORMAL,    /**< The scroll direction is normal */
     SDL_MOUSEWHEEL_FLIPPED    /**< The scroll direction is flipped / natural */
     SDL_MOUSEWHEEL_FLIPPED    /**< The scroll direction is flipped / natural */
@@ -90,9 +90,9 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
  * either `x` or `y`.
  * either `x` or `y`.
  *
  *
  * \param x the x coordinate of the mouse cursor position relative to the
  * \param x the x coordinate of the mouse cursor position relative to the
- *          focus window
+ *          focus window.
  * \param y the y coordinate of the mouse cursor position relative to the
  * \param y the y coordinate of the mouse cursor position relative to the
- *          focus window
+ *          focus window.
  * \returns a 32-bit button bitmask of the current button state.
  * \returns a 32-bit button bitmask of the current button state.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -120,9 +120,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
  * reason to use this function, you probably want SDL_GetMouseState() instead.
  * reason to use this function, you probably want SDL_GetMouseState() instead.
  *
  *
  * \param x filled in with the current X coord relative to the desktop; can be
  * \param x filled in with the current X coord relative to the desktop; can be
- *          NULL
+ *          NULL.
  * \param y filled in with the current Y coord relative to the desktop; can be
  * \param y filled in with the current Y coord relative to the desktop; can be
- *          NULL
+ *          NULL.
  * \returns the current button state as a bitmask which can be tested using
  * \returns the current button state as a bitmask which can be tested using
  *          the SDL_BUTTON(X) macros.
  *          the SDL_BUTTON(X) macros.
  *
  *
@@ -141,8 +141,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
  * mouse deltas since the last call to SDL_GetRelativeMouseState() or since
  * mouse deltas since the last call to SDL_GetRelativeMouseState() or since
  * event initialization. You can pass NULL for either `x` or `y`.
  * event initialization. You can pass NULL for either `x` or `y`.
  *
  *
- * \param x a pointer filled with the last recorded x coordinate of the mouse
- * \param y a pointer filled with the last recorded y coordinate of the mouse
+ * \param x a pointer filled with the last recorded x coordinate of the mouse.
+ * \param y a pointer filled with the last recorded y coordinate of the mouse.
  * \returns a 32-bit button bitmask of the relative button state.
  * \returns a 32-bit button bitmask of the relative button state.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -154,15 +154,17 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
 /**
 /**
  * Move the mouse cursor to the given position within the window.
  * Move the mouse cursor to the given position within the window.
  *
  *
- * This function generates a mouse motion event.
+ * This function generates a mouse motion event if relative mode is not
+ * enabled. If relative mode is enabled, you can force mouse events for the
+ * warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint.
  *
  *
  * Note that this function will appear to succeed, but not actually move the
  * Note that this function will appear to succeed, but not actually move the
  * mouse when used over Microsoft Remote Desktop.
  * mouse when used over Microsoft Remote Desktop.
  *
  *
  * \param window the window to move the mouse into, or NULL for the current
  * \param window the window to move the mouse into, or NULL for the current
- *               mouse focus
- * \param x the x coordinate within the window
- * \param y the y coordinate within the window
+ *               mouse focus.
+ * \param x the x coordinate within the window.
+ * \param y the y coordinate within the window.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -182,8 +184,8 @@ extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
  * Note that this function will appear to succeed, but not actually move the
  * Note that this function will appear to succeed, but not actually move the
  * mouse when used over Microsoft Remote Desktop.
  * mouse when used over Microsoft Remote Desktop.
  *
  *
- * \param x the x coordinate
- * \param y the y coordinate
+ * \param x the x coordinate.
+ * \param y the y coordinate.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -196,13 +198,9 @@ extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
 /**
 /**
  * Set relative mouse mode.
  * Set relative mouse mode.
  *
  *
- * While the mouse is in relative mode, the cursor is hidden, and the driver
- * will try to report continuous motion in the current window. Only relative
- * motion events will be delivered, the mouse position will not change.
- *
- * Note that this function will not be able to provide continuous relative
- * motion when used over Microsoft Remote Desktop, instead motion is limited
- * to the bounds of the screen.
+ * While the mouse is in relative mode, the cursor is hidden, the mouse
+ * position is constrained to the window, and SDL will report continuous
+ * relative mouse motion even if the mouse is at the edge of the window.
  *
  *
  * This function will flush any pending mouse motion.
  * This function will flush any pending mouse motion.
  *
  *
@@ -245,6 +243,15 @@ extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
  * While capturing is enabled, the current window will have the
  * While capturing is enabled, the current window will have the
  * `SDL_WINDOW_MOUSE_CAPTURE` flag set.
  * `SDL_WINDOW_MOUSE_CAPTURE` flag set.
  *
  *
+ * Please note that as of SDL 2.0.22, SDL will attempt to "auto capture" the
+ * mouse while the user is pressing a button; this is to try and make mouse
+ * behavior more consistent between platforms, and deal with the common case
+ * of a user dragging the mouse outside of the window. This means that if you
+ * are calling SDL_CaptureMouse() only to deal with this situation, you no
+ * longer have to (although it is safe to do so). If this causes problems for
+ * your app, you can disable auto capture by setting the
+ * `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
+ *
  * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
  * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
  * \returns 0 on success or -1 if not supported; call SDL_GetError() for more
  * \returns 0 on success or -1 if not supported; call SDL_GetError() for more
  *          information.
  *          information.
@@ -290,14 +297,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
  * Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which
  * Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which
  * provides twelve readily available system cursors to pick from.
  * provides twelve readily available system cursors to pick from.
  *
  *
- * \param data the color value for each pixel of the cursor
- * \param mask the mask value for each pixel of the cursor
- * \param w the width of the cursor
- * \param h the height of the cursor
+ * \param data the color value for each pixel of the cursor.
+ * \param mask the mask value for each pixel of the cursor.
+ * \param w the width of the cursor.
+ * \param h the height of the cursor.
  * \param hot_x the X-axis location of the upper left corner of the cursor
  * \param hot_x the X-axis location of the upper left corner of the cursor
- *              relative to the actual mouse position
+ *              relative to the actual mouse position.
  * \param hot_y the Y-axis location of the upper left corner of the cursor
  * \param hot_y the Y-axis location of the upper left corner of the cursor
- *              relative to the actual mouse position
+ *              relative to the actual mouse position.
  * \returns a new cursor with the specified parameters on success or NULL on
  * \returns a new cursor with the specified parameters on success or NULL on
  *          failure; call SDL_GetError() for more information.
  *          failure; call SDL_GetError() for more information.
  *
  *
@@ -315,9 +322,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
 /**
 /**
  * Create a color cursor.
  * Create a color cursor.
  *
  *
- * \param surface an SDL_Surface structure representing the cursor image
- * \param hot_x the x position of the cursor hot spot
- * \param hot_y the y position of the cursor hot spot
+ * \param surface an SDL_Surface structure representing the cursor image.
+ * \param hot_x the x position of the cursor hot spot.
+ * \param hot_y the y position of the cursor hot spot.
  * \returns the new cursor on success or NULL on failure; call SDL_GetError()
  * \returns the new cursor on success or NULL on failure; call SDL_GetError()
  *          for more information.
  *          for more information.
  *
  *
@@ -333,7 +340,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
 /**
 /**
  * Create a system cursor.
  * Create a system cursor.
  *
  *
- * \param id an SDL_SystemCursor enum value
+ * \param id an SDL_SystemCursor enum value.
  * \returns a cursor on success or NULL on failure; call SDL_GetError() for
  * \returns a cursor on success or NULL on failure; call SDL_GetError() for
  *          more information.
  *          more information.
  *
  *
@@ -351,7 +358,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
  * the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if
  * the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if
  * this is desired for any reason.
  * this is desired for any reason.
  *
  *
- * \param cursor a cursor to make active
+ * \param cursor a cursor to make active.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -378,6 +385,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
 /**
 /**
  * Get the default cursor.
  * Get the default cursor.
  *
  *
+ * You do not have to call SDL_FreeCursor() on the return value, but it is
+ * safe to do so.
+ *
  * \returns the default cursor on success or NULL on failure.
  * \returns the default cursor on success or NULL on failure.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -392,7 +402,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
  * Use this function to free cursor resources created with SDL_CreateCursor(),
  * Use this function to free cursor resources created with SDL_CreateCursor(),
  * SDL_CreateColorCursor() or SDL_CreateSystemCursor().
  * SDL_CreateColorCursor() or SDL_CreateSystemCursor().
  *
  *
- * \param cursor the cursor to free
+ * \param cursor the cursor to free.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -427,9 +437,9 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
 /**
 /**
  * Used as a mask when testing buttons in buttonstate.
  * Used as a mask when testing buttons in buttonstate.
  *
  *
- * - Button 1:  Left mouse button
- * - Button 2:  Middle mouse button
- * - Button 3:  Right mouse button
+ * - Button 1: Left mouse button
+ * - Button 2: Middle mouse button
+ * - Button 3: Right mouse button
  */
  */
 #define SDL_BUTTON(X)       (1 << ((X)-1))
 #define SDL_BUTTON(X)       (1 << ((X)-1))
 #define SDL_BUTTON_LEFT     1
 #define SDL_BUTTON_LEFT     1
@@ -451,4 +461,4 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
 
 
 #endif /* SDL_mouse_h_ */
 #endif /* SDL_mouse_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 104 - 30
bsp/simulator/SDL2/include/SDL_mutex.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -23,14 +23,88 @@
 #define SDL_mutex_h_
 #define SDL_mutex_h_
 
 
 /**
 /**
- *  \file SDL_mutex.h
+ * # CategoryMutex
  *
  *
- *  Functions to provide thread synchronization primitives.
+ * Functions to provide thread synchronization primitives.
  */
  */
 
 
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
 #include "SDL_error.h"
 #include "SDL_error.h"
 
 
+/******************************************************************************/
+/* Enable thread safety attributes only with clang.
+ * The attributes can be safely erased when compiling with other compilers.
+ */
+#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \
+    defined(__clang__) && (!defined(SWIG))
+#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x)   __attribute__((x))
+#else
+#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x)   /* no-op */
+#endif
+
+#define SDL_CAPABILITY(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
+
+#define SDL_SCOPED_CAPABILITY \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
+
+#define SDL_GUARDED_BY(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
+
+#define SDL_PT_GUARDED_BY(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
+
+#define SDL_ACQUIRED_BEFORE(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x))
+
+#define SDL_ACQUIRED_AFTER(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x))
+
+#define SDL_REQUIRES(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(x))
+
+#define SDL_REQUIRES_SHARED(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(x))
+
+#define SDL_ACQUIRE(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(x))
+
+#define SDL_ACQUIRE_SHARED(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(x))
+
+#define SDL_RELEASE(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(x))
+
+#define SDL_RELEASE_SHARED(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(x))
+
+#define SDL_RELEASE_GENERIC(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_generic_capability(x))
+
+#define SDL_TRY_ACQUIRE(x, y) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(x, y))
+
+#define SDL_TRY_ACQUIRE_SHARED(x, y) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(x, y))
+
+#define SDL_EXCLUDES(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(x))
+
+#define SDL_ASSERT_CAPABILITY(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
+
+#define SDL_ASSERT_SHARED_CAPABILITY(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
+
+#define SDL_RETURN_CAPABILITY(x) \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
+
+#define SDL_NO_THREAD_SAFETY_ANALYSIS \
+  SDL_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
+
+/******************************************************************************/
+
+
 #include "begin_code.h"
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
 /* Set up for C function definitions, even when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
@@ -38,13 +112,13 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  Synchronization functions which can time out return this value
- *  if they time out.
+ * Synchronization functions which can time out return this value if they time
+ * out.
  */
  */
 #define SDL_MUTEX_TIMEDOUT  1
 #define SDL_MUTEX_TIMEDOUT  1
 
 
 /**
 /**
- *  This is the timeout value which corresponds to never time out.
+ * This is the timeout value which corresponds to never time out.
  */
  */
 #define SDL_MUTEX_MAXWAIT   (~(Uint32)0)
 #define SDL_MUTEX_MAXWAIT   (~(Uint32)0)
 
 
@@ -91,12 +165,12 @@ extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
  * unlock it the same number of times before it is actually made available for
  * unlock it the same number of times before it is actually made available for
  * other threads in the system (this is known as a "recursive mutex").
  * other threads in the system (this is known as a "recursive mutex").
  *
  *
- * \param mutex the mutex to lock
+ * \param mutex the mutex to lock.
  * \return 0, or -1 on error.
  * \return 0, or -1 on error.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  */
  */
-extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
+extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex) SDL_ACQUIRE(mutex);
 #define SDL_mutexP(m)   SDL_LockMutex(m)
 #define SDL_mutexP(m)   SDL_LockMutex(m)
 
 
 /**
 /**
@@ -108,7 +182,7 @@ extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
  * This technique is useful if you need exclusive access to a resource but
  * This technique is useful if you need exclusive access to a resource but
  * don't want to wait for it, and will return to it to try again later.
  * don't want to wait for it, and will return to it to try again later.
  *
  *
- * \param mutex the mutex to try to lock
+ * \param mutex the mutex to try to lock.
  * \returns 0, `SDL_MUTEX_TIMEDOUT`, or -1 on error; call SDL_GetError() for
  * \returns 0, `SDL_MUTEX_TIMEDOUT`, or -1 on error; call SDL_GetError() for
  *          more information.
  *          more information.
  *
  *
@@ -119,7 +193,7 @@ extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
  * \sa SDL_LockMutex
  * \sa SDL_LockMutex
  * \sa SDL_UnlockMutex
  * \sa SDL_UnlockMutex
  */
  */
-extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
+extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex) SDL_TRY_ACQUIRE(0, mutex);
 
 
 /**
 /**
  * Unlock the mutex.
  * Unlock the mutex.
@@ -138,7 +212,7 @@ extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  */
  */
-extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
+extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex) SDL_RELEASE(mutex);
 #define SDL_mutexV(m)   SDL_UnlockMutex(m)
 #define SDL_mutexV(m)   SDL_UnlockMutex(m)
 
 
 /**
 /**
@@ -150,7 +224,7 @@ extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
  * to destroy a locked mutex, and may result in undefined behavior depending
  * to destroy a locked mutex, and may result in undefined behavior depending
  * on the platform.
  * on the platform.
  *
  *
- * \param mutex the mutex to destroy
+ * \param mutex the mutex to destroy.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -182,7 +256,7 @@ typedef struct SDL_semaphore SDL_sem;
  * is 0. Each post operation will atomically increment the semaphore value and
  * is 0. Each post operation will atomically increment the semaphore value and
  * wake waiting threads and allow them to retry the wait operation.
  * wake waiting threads and allow them to retry the wait operation.
  *
  *
- * \param initial_value the starting value of the semaphore
+ * \param initial_value the starting value of the semaphore.
  * \returns a new semaphore or NULL on failure; call SDL_GetError() for more
  * \returns a new semaphore or NULL on failure; call SDL_GetError() for more
  *          information.
  *          information.
  *
  *
@@ -203,7 +277,7 @@ extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
  * It is not safe to destroy a semaphore if there are threads currently
  * It is not safe to destroy a semaphore if there are threads currently
  * waiting on it.
  * waiting on it.
  *
  *
- * \param sem the semaphore to destroy
+ * \param sem the semaphore to destroy.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -227,7 +301,7 @@ extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem);
  * This function is the equivalent of calling SDL_SemWaitTimeout() with a time
  * This function is the equivalent of calling SDL_SemWaitTimeout() with a time
  * length of `SDL_MUTEX_MAXWAIT`.
  * length of `SDL_MUTEX_MAXWAIT`.
  *
  *
- * \param sem the semaphore wait on
+ * \param sem the semaphore wait on.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -251,7 +325,7 @@ extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem);
  * the semaphore doesn't have a positive value, the function immediately
  * the semaphore doesn't have a positive value, the function immediately
  * returns SDL_MUTEX_TIMEDOUT.
  * returns SDL_MUTEX_TIMEDOUT.
  *
  *
- * \param sem the semaphore to wait on
+ * \param sem the semaphore to wait on.
  * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait would
  * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait would
  *          block, or a negative error code on failure; call SDL_GetError()
  *          block, or a negative error code on failure; call SDL_GetError()
  *          for more information.
  *          for more information.
@@ -275,8 +349,8 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
  * signal or error, or the specified time has elapsed. If the call is
  * signal or error, or the specified time has elapsed. If the call is
  * successful it will atomically decrement the semaphore value.
  * successful it will atomically decrement the semaphore value.
  *
  *
- * \param sem the semaphore to wait on
- * \param ms the length of the timeout, in milliseconds
+ * \param sem the semaphore to wait on.
+ * \param timeout the length of the timeout, in milliseconds.
  * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
  * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
  *          succeed in the allotted time, or a negative error code on failure;
  *          succeed in the allotted time, or a negative error code on failure;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
@@ -290,12 +364,12 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
  * \sa SDL_SemValue
  * \sa SDL_SemValue
  * \sa SDL_SemWait
  * \sa SDL_SemWait
  */
  */
-extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
+extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);
 
 
 /**
 /**
  * Atomically increment a semaphore's value and wake waiting threads.
  * Atomically increment a semaphore's value and wake waiting threads.
  *
  *
- * \param sem the semaphore to increment
+ * \param sem the semaphore to increment.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -313,7 +387,7 @@ extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
 /**
 /**
  * Get the current value of a semaphore.
  * Get the current value of a semaphore.
  *
  *
- * \param sem the semaphore to query
+ * \param sem the semaphore to query.
  * \returns the current value of the semaphore.
  * \returns the current value of the semaphore.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -353,7 +427,7 @@ extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
 /**
 /**
  * Destroy a condition variable.
  * Destroy a condition variable.
  *
  *
- * \param cond the condition variable to destroy
+ * \param cond the condition variable to destroy.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -368,7 +442,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond);
 /**
 /**
  * Restart one of the threads that are waiting on the condition variable.
  * Restart one of the threads that are waiting on the condition variable.
  *
  *
- * \param cond the condition variable to signal
+ * \param cond the condition variable to signal.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -385,7 +459,7 @@ extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
 /**
 /**
  * Restart all threads that are waiting on the condition variable.
  * Restart all threads that are waiting on the condition variable.
  *
  *
- * \param cond the condition variable to signal
+ * \param cond the condition variable to signal.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -412,8 +486,8 @@ extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
  * This function is the equivalent of calling SDL_CondWaitTimeout() with a
  * This function is the equivalent of calling SDL_CondWaitTimeout() with a
  * time length of `SDL_MUTEX_MAXWAIT`.
  * time length of `SDL_MUTEX_MAXWAIT`.
  *
  *
- * \param cond the condition variable to wait on
- * \param mutex the mutex used to coordinate thread access
+ * \param cond the condition variable to wait on.
+ * \param mutex the mutex used to coordinate thread access.
  * \returns 0 when it is signaled or a negative error code on failure; call
  * \returns 0 when it is signaled or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -438,10 +512,10 @@ extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
  *
  *
  * The mutex must be locked before calling this function.
  * The mutex must be locked before calling this function.
  *
  *
- * \param cond the condition variable to wait on
- * \param mutex the mutex used to coordinate thread access
+ * \param cond the condition variable to wait on.
+ * \param mutex the mutex used to coordinate thread access.
  * \param ms the maximum time to wait, in milliseconds, or `SDL_MUTEX_MAXWAIT`
  * \param ms the maximum time to wait, in milliseconds, or `SDL_MUTEX_MAXWAIT`
- *           to wait indefinitely
+ *           to wait indefinitely.
  * \returns 0 if the condition variable is signaled, `SDL_MUTEX_TIMEDOUT` if
  * \returns 0 if the condition variable is signaled, `SDL_MUTEX_TIMEDOUT` if
  *          the condition is not signaled in the allotted time, or a negative
  *          the condition is not signaled in the allotted time, or a negative
  *          error code on failure; call SDL_GetError() for more information.
  *          error code on failure; call SDL_GetError() for more information.
@@ -468,4 +542,4 @@ extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
 
 
 #endif /* SDL_mutex_h_ */
 #endif /* SDL_mutex_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 2 - 2
bsp/simulator/SDL2/include/SDL_name.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -30,4 +30,4 @@
 
 
 #endif /* SDLname_h_ */
 #endif /* SDLname_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 6 - 63
bsp/simulator/SDL2/include/SDL_opengl.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,17 +19,11 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
- *  \file SDL_opengl.h
- *
- *  This is a simple file to encapsulate the OpenGL API headers.
- */
-
-/**
- *  \def NO_SDL_GLEXT
+/*
+ * This is a simple file to encapsulate the OpenGL API headers.
  *
  *
- *  Define this if you have your own version of glext.h and want to disable the
- *  version included in SDL_opengl.h.
+ * Define NO_SDL_GLEXT if you have your own version of glext.h and want
+ * to disable the version included in SDL_opengl.h.
  */
  */
 
 
 #ifndef SDL_opengl_h_
 #ifndef SDL_opengl_h_
@@ -2107,57 +2101,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
 
 
 
 
 
 
-/*
- * ???. GL_MESA_packed_depth_stencil
- * XXX obsolete
- */
-#ifndef GL_MESA_packed_depth_stencil
-#define GL_MESA_packed_depth_stencil 1
-
-#define GL_DEPTH_STENCIL_MESA           0x8750
-#define GL_UNSIGNED_INT_24_8_MESA       0x8751
-#define GL_UNSIGNED_INT_8_24_REV_MESA       0x8752
-#define GL_UNSIGNED_SHORT_15_1_MESA     0x8753
-#define GL_UNSIGNED_SHORT_1_15_REV_MESA     0x8754
-
-#endif /* GL_MESA_packed_depth_stencil */
-
-
-#ifndef GL_ATI_blend_equation_separate
-#define GL_ATI_blend_equation_separate 1
-
-#define GL_ALPHA_BLEND_EQUATION_ATI         0x883D
-
-GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
-
-#endif /* GL_ATI_blend_equation_separate */
-
-
-/* GL_OES_EGL_image */
-#ifndef GL_OES_EGL_image
-typedef void* GLeglImageOES;
-#endif
-
-#ifndef GL_OES_EGL_image
-#define GL_OES_EGL_image 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
-GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
-#endif
-typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
-typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
-#endif
-
-
-/**
- ** NOTE!!!!!  If you add new functions to this file, or update
- ** glext.h be sure to regenerate the gl_mangle.h file.  See comments
- ** in that file for details.
- **/
-
-
-
 /**********************************************************************
 /**********************************************************************
  * Begin system-specific stuff
  * Begin system-specific stuff
  */
  */
@@ -2180,4 +2123,4 @@ typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum t
 
 
 #endif /* SDL_opengl_h_ */
 #endif /* SDL_opengl_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

File diff suppressed because it is too large
+ 706 - 91
bsp/simulator/SDL2/include/SDL_opengl_glext.h


+ 5 - 6
bsp/simulator/SDL2/include/SDL_opengles.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,11 +19,10 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
- *  \file SDL_opengles.h
- *
- *  This is a simple file to encapsulate the OpenGL ES 1.X API headers.
+/*
+ * This is a simple file to encapsulate the OpenGL ES 1.X API headers.
  */
  */
+
 #include "SDL_config.h"
 #include "SDL_config.h"
 
 
 #ifdef __IPHONEOS__
 #ifdef __IPHONEOS__
@@ -36,4 +35,4 @@
 
 
 #ifndef APIENTRY
 #ifndef APIENTRY
 #define APIENTRY
 #define APIENTRY
-#endif
+#endif

+ 5 - 6
bsp/simulator/SDL2/include/SDL_opengles2.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,11 +19,10 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
- *  \file SDL_opengles2.h
- *
- *  This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
+/*
+ * This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
  */
  */
+
 #include "SDL_config.h"
 #include "SDL_config.h"
 
 
 #if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
 #if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
@@ -49,4 +48,4 @@
 
 
 #ifndef APIENTRY
 #ifndef APIENTRY
 #define APIENTRY GL_APIENTRY
 #define APIENTRY GL_APIENTRY
-#endif
+#endif

+ 374 - 339
bsp/simulator/SDL2/include/SDL_opengles2_gl2.h

@@ -1,56 +1,70 @@
-#ifndef __gl2_h_
-#define __gl2_h_
-
-/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
-
-/*#include <GLES2/gl2platform.h>*/
+#ifndef __gles2_gl2_h_
+#define __gles2_gl2_h_ 1
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
 /*
 /*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
+** Copyright 2013-2020 The Khronos Group Inc.
+** SPDX-License-Identifier: MIT
+**
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   https://github.com/KhronosGroup/OpenGL-Registry
+*/
 
 
-/*-------------------------------------------------------------------------
- * Data type definitions
- *-----------------------------------------------------------------------*/
+/*#include <GLES2/gl2platform.h>*/
 
 
-typedef void             GLvoid;
-typedef char             GLchar;
-typedef unsigned int     GLenum;
-typedef unsigned char    GLboolean;
-typedef unsigned int     GLbitfield;
-typedef khronos_int8_t   GLbyte;
-typedef short            GLshort;
-typedef int              GLint;
-typedef int              GLsizei;
-typedef khronos_uint8_t  GLubyte;
-typedef unsigned short   GLushort;
-typedef unsigned int     GLuint;
-typedef khronos_float_t  GLfloat;
-typedef khronos_float_t  GLclampf;
-typedef khronos_int32_t  GLfixed;
+#ifndef GL_APIENTRYP
+#define GL_APIENTRYP GL_APIENTRY*
+#endif
 
 
-/* GL types for handling large vertex buffer objects */
-typedef khronos_intptr_t GLintptr;
-typedef khronos_ssize_t  GLsizeiptr;
+#ifndef GL_GLES_PROTOTYPES
+#define GL_GLES_PROTOTYPES 1
+#endif
 
 
-/* OpenGL ES core versions */
-#define GL_ES_VERSION_2_0                 1
+/* Generated on date 20220530 */
 
 
-/* ClearBufferMask */
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+/*#include <KHR/khrplatform.h>*/
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef khronos_int16_t GLshort;
+typedef khronos_uint16_t GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
 #define GL_DEPTH_BUFFER_BIT               0x00000100
 #define GL_DEPTH_BUFFER_BIT               0x00000100
 #define GL_STENCIL_BUFFER_BIT             0x00000400
 #define GL_STENCIL_BUFFER_BIT             0x00000400
 #define GL_COLOR_BUFFER_BIT               0x00004000
 #define GL_COLOR_BUFFER_BIT               0x00004000
-
-/* Boolean */
 #define GL_FALSE                          0
 #define GL_FALSE                          0
 #define GL_TRUE                           1
 #define GL_TRUE                           1
-
-/* BeginMode */
 #define GL_POINTS                         0x0000
 #define GL_POINTS                         0x0000
 #define GL_LINES                          0x0001
 #define GL_LINES                          0x0001
 #define GL_LINE_LOOP                      0x0002
 #define GL_LINE_LOOP                      0x0002
@@ -58,18 +72,6 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_TRIANGLES                      0x0004
 #define GL_TRIANGLES                      0x0004
 #define GL_TRIANGLE_STRIP                 0x0005
 #define GL_TRIANGLE_STRIP                 0x0005
 #define GL_TRIANGLE_FAN                   0x0006
 #define GL_TRIANGLE_FAN                   0x0006
-
-/* AlphaFunction (not supported in ES20) */
-/*      GL_NEVER */
-/*      GL_LESS */
-/*      GL_EQUAL */
-/*      GL_LEQUAL */
-/*      GL_GREATER */
-/*      GL_NOTEQUAL */
-/*      GL_GEQUAL */
-/*      GL_ALWAYS */
-
-/* BlendingFactorDest */
 #define GL_ZERO                           0
 #define GL_ZERO                           0
 #define GL_ONE                            1
 #define GL_ONE                            1
 #define GL_SRC_COLOR                      0x0300
 #define GL_SRC_COLOR                      0x0300
@@ -78,29 +80,15 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_ONE_MINUS_SRC_ALPHA            0x0303
 #define GL_ONE_MINUS_SRC_ALPHA            0x0303
 #define GL_DST_ALPHA                      0x0304
 #define GL_DST_ALPHA                      0x0304
 #define GL_ONE_MINUS_DST_ALPHA            0x0305
 #define GL_ONE_MINUS_DST_ALPHA            0x0305
-
-/* BlendingFactorSrc */
-/*      GL_ZERO */
-/*      GL_ONE */
 #define GL_DST_COLOR                      0x0306
 #define GL_DST_COLOR                      0x0306
 #define GL_ONE_MINUS_DST_COLOR            0x0307
 #define GL_ONE_MINUS_DST_COLOR            0x0307
 #define GL_SRC_ALPHA_SATURATE             0x0308
 #define GL_SRC_ALPHA_SATURATE             0x0308
-/*      GL_SRC_ALPHA */
-/*      GL_ONE_MINUS_SRC_ALPHA */
-/*      GL_DST_ALPHA */
-/*      GL_ONE_MINUS_DST_ALPHA */
-
-/* BlendEquationSeparate */
 #define GL_FUNC_ADD                       0x8006
 #define GL_FUNC_ADD                       0x8006
 #define GL_BLEND_EQUATION                 0x8009
 #define GL_BLEND_EQUATION                 0x8009
-#define GL_BLEND_EQUATION_RGB             0x8009    /* same as BLEND_EQUATION */
+#define GL_BLEND_EQUATION_RGB             0x8009
 #define GL_BLEND_EQUATION_ALPHA           0x883D
 #define GL_BLEND_EQUATION_ALPHA           0x883D
-
-/* BlendSubtract */
 #define GL_FUNC_SUBTRACT                  0x800A
 #define GL_FUNC_SUBTRACT                  0x800A
 #define GL_FUNC_REVERSE_SUBTRACT          0x800B
 #define GL_FUNC_REVERSE_SUBTRACT          0x800B
-
-/* Separate Blend Functions */
 #define GL_BLEND_DST_RGB                  0x80C8
 #define GL_BLEND_DST_RGB                  0x80C8
 #define GL_BLEND_SRC_RGB                  0x80C9
 #define GL_BLEND_SRC_RGB                  0x80C9
 #define GL_BLEND_DST_ALPHA                0x80CA
 #define GL_BLEND_DST_ALPHA                0x80CA
@@ -110,38 +98,19 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_CONSTANT_ALPHA                 0x8003
 #define GL_CONSTANT_ALPHA                 0x8003
 #define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
 #define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
 #define GL_BLEND_COLOR                    0x8005
 #define GL_BLEND_COLOR                    0x8005
-
-/* Buffer Objects */
 #define GL_ARRAY_BUFFER                   0x8892
 #define GL_ARRAY_BUFFER                   0x8892
 #define GL_ELEMENT_ARRAY_BUFFER           0x8893
 #define GL_ELEMENT_ARRAY_BUFFER           0x8893
 #define GL_ARRAY_BUFFER_BINDING           0x8894
 #define GL_ARRAY_BUFFER_BINDING           0x8894
 #define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
 #define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
-
 #define GL_STREAM_DRAW                    0x88E0
 #define GL_STREAM_DRAW                    0x88E0
 #define GL_STATIC_DRAW                    0x88E4
 #define GL_STATIC_DRAW                    0x88E4
 #define GL_DYNAMIC_DRAW                   0x88E8
 #define GL_DYNAMIC_DRAW                   0x88E8
-
 #define GL_BUFFER_SIZE                    0x8764
 #define GL_BUFFER_SIZE                    0x8764
 #define GL_BUFFER_USAGE                   0x8765
 #define GL_BUFFER_USAGE                   0x8765
-
 #define GL_CURRENT_VERTEX_ATTRIB          0x8626
 #define GL_CURRENT_VERTEX_ATTRIB          0x8626
-
-/* CullFaceMode */
 #define GL_FRONT                          0x0404
 #define GL_FRONT                          0x0404
 #define GL_BACK                           0x0405
 #define GL_BACK                           0x0405
 #define GL_FRONT_AND_BACK                 0x0408
 #define GL_FRONT_AND_BACK                 0x0408
-
-/* DepthFunction */
-/*      GL_NEVER */
-/*      GL_LESS */
-/*      GL_EQUAL */
-/*      GL_LEQUAL */
-/*      GL_GREATER */
-/*      GL_NOTEQUAL */
-/*      GL_GEQUAL */
-/*      GL_ALWAYS */
-
-/* EnableCap */
 #define GL_TEXTURE_2D                     0x0DE1
 #define GL_TEXTURE_2D                     0x0DE1
 #define GL_CULL_FACE                      0x0B44
 #define GL_CULL_FACE                      0x0B44
 #define GL_BLEND                          0x0BE2
 #define GL_BLEND                          0x0BE2
@@ -152,19 +121,13 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_POLYGON_OFFSET_FILL            0x8037
 #define GL_POLYGON_OFFSET_FILL            0x8037
 #define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
 #define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
 #define GL_SAMPLE_COVERAGE                0x80A0
 #define GL_SAMPLE_COVERAGE                0x80A0
-
-/* ErrorCode */
 #define GL_NO_ERROR                       0
 #define GL_NO_ERROR                       0
 #define GL_INVALID_ENUM                   0x0500
 #define GL_INVALID_ENUM                   0x0500
 #define GL_INVALID_VALUE                  0x0501
 #define GL_INVALID_VALUE                  0x0501
 #define GL_INVALID_OPERATION              0x0502
 #define GL_INVALID_OPERATION              0x0502
 #define GL_OUT_OF_MEMORY                  0x0505
 #define GL_OUT_OF_MEMORY                  0x0505
-
-/* FrontFaceDirection */
 #define GL_CW                             0x0900
 #define GL_CW                             0x0900
 #define GL_CCW                            0x0901
 #define GL_CCW                            0x0901
-
-/* GetPName */
 #define GL_LINE_WIDTH                     0x0B21
 #define GL_LINE_WIDTH                     0x0B21
 #define GL_ALIASED_POINT_SIZE_RANGE       0x846D
 #define GL_ALIASED_POINT_SIZE_RANGE       0x846D
 #define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
 #define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
@@ -191,7 +154,6 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_STENCIL_BACK_WRITEMASK         0x8CA5
 #define GL_STENCIL_BACK_WRITEMASK         0x8CA5
 #define GL_VIEWPORT                       0x0BA2
 #define GL_VIEWPORT                       0x0BA2
 #define GL_SCISSOR_BOX                    0x0C10
 #define GL_SCISSOR_BOX                    0x0C10
-/*      GL_SCISSOR_TEST */
 #define GL_COLOR_CLEAR_VALUE              0x0C22
 #define GL_COLOR_CLEAR_VALUE              0x0C22
 #define GL_COLOR_WRITEMASK                0x0C23
 #define GL_COLOR_WRITEMASK                0x0C23
 #define GL_UNPACK_ALIGNMENT               0x0CF5
 #define GL_UNPACK_ALIGNMENT               0x0CF5
@@ -206,32 +168,18 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_DEPTH_BITS                     0x0D56
 #define GL_DEPTH_BITS                     0x0D56
 #define GL_STENCIL_BITS                   0x0D57
 #define GL_STENCIL_BITS                   0x0D57
 #define GL_POLYGON_OFFSET_UNITS           0x2A00
 #define GL_POLYGON_OFFSET_UNITS           0x2A00
-/*      GL_POLYGON_OFFSET_FILL */
 #define GL_POLYGON_OFFSET_FACTOR          0x8038
 #define GL_POLYGON_OFFSET_FACTOR          0x8038
 #define GL_TEXTURE_BINDING_2D             0x8069
 #define GL_TEXTURE_BINDING_2D             0x8069
 #define GL_SAMPLE_BUFFERS                 0x80A8
 #define GL_SAMPLE_BUFFERS                 0x80A8
 #define GL_SAMPLES                        0x80A9
 #define GL_SAMPLES                        0x80A9
 #define GL_SAMPLE_COVERAGE_VALUE          0x80AA
 #define GL_SAMPLE_COVERAGE_VALUE          0x80AA
 #define GL_SAMPLE_COVERAGE_INVERT         0x80AB
 #define GL_SAMPLE_COVERAGE_INVERT         0x80AB
-
-/* GetTextureParameter */
-/*      GL_TEXTURE_MAG_FILTER */
-/*      GL_TEXTURE_MIN_FILTER */
-/*      GL_TEXTURE_WRAP_S */
-/*      GL_TEXTURE_WRAP_T */
-
 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
 #define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
 #define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
-
-/* HintMode */
 #define GL_DONT_CARE                      0x1100
 #define GL_DONT_CARE                      0x1100
 #define GL_FASTEST                        0x1101
 #define GL_FASTEST                        0x1101
 #define GL_NICEST                         0x1102
 #define GL_NICEST                         0x1102
-
-/* HintTarget */
-#define GL_GENERATE_MIPMAP_HINT            0x8192
-
-/* DataType */
+#define GL_GENERATE_MIPMAP_HINT           0x8192
 #define GL_BYTE                           0x1400
 #define GL_BYTE                           0x1400
 #define GL_UNSIGNED_BYTE                  0x1401
 #define GL_UNSIGNED_BYTE                  0x1401
 #define GL_SHORT                          0x1402
 #define GL_SHORT                          0x1402
@@ -240,44 +188,35 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_UNSIGNED_INT                   0x1405
 #define GL_UNSIGNED_INT                   0x1405
 #define GL_FLOAT                          0x1406
 #define GL_FLOAT                          0x1406
 #define GL_FIXED                          0x140C
 #define GL_FIXED                          0x140C
-
-/* PixelFormat */
 #define GL_DEPTH_COMPONENT                0x1902
 #define GL_DEPTH_COMPONENT                0x1902
 #define GL_ALPHA                          0x1906
 #define GL_ALPHA                          0x1906
 #define GL_RGB                            0x1907
 #define GL_RGB                            0x1907
 #define GL_RGBA                           0x1908
 #define GL_RGBA                           0x1908
 #define GL_LUMINANCE                      0x1909
 #define GL_LUMINANCE                      0x1909
 #define GL_LUMINANCE_ALPHA                0x190A
 #define GL_LUMINANCE_ALPHA                0x190A
-
-/* PixelType */
-/*      GL_UNSIGNED_BYTE */
 #define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
 #define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
 #define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
 #define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
 #define GL_UNSIGNED_SHORT_5_6_5           0x8363
 #define GL_UNSIGNED_SHORT_5_6_5           0x8363
-
-/* Shaders */
-#define GL_FRAGMENT_SHADER                  0x8B30
-#define GL_VERTEX_SHADER                    0x8B31
-#define GL_MAX_VERTEX_ATTRIBS               0x8869
-#define GL_MAX_VERTEX_UNIFORM_VECTORS       0x8DFB
-#define GL_MAX_VARYING_VECTORS              0x8DFC
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
+#define GL_MAX_VARYING_VECTORS            0x8DFC
 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS   0x8B4C
-#define GL_MAX_TEXTURE_IMAGE_UNITS          0x8872
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS     0x8DFD
-#define GL_SHADER_TYPE                      0x8B4F
-#define GL_DELETE_STATUS                    0x8B80
-#define GL_LINK_STATUS                      0x8B82
-#define GL_VALIDATE_STATUS                  0x8B83
-#define GL_ATTACHED_SHADERS                 0x8B85
-#define GL_ACTIVE_UNIFORMS                  0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH        0x8B87
-#define GL_ACTIVE_ATTRIBUTES                0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH      0x8B8A
-#define GL_SHADING_LANGUAGE_VERSION         0x8B8C
-#define GL_CURRENT_PROGRAM                  0x8B8D
-
-/* StencilFunction */
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
 #define GL_NEVER                          0x0200
 #define GL_NEVER                          0x0200
 #define GL_LESS                           0x0201
 #define GL_LESS                           0x0201
 #define GL_EQUAL                          0x0202
 #define GL_EQUAL                          0x0202
@@ -286,9 +225,6 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_NOTEQUAL                       0x0205
 #define GL_NOTEQUAL                       0x0205
 #define GL_GEQUAL                         0x0206
 #define GL_GEQUAL                         0x0206
 #define GL_ALWAYS                         0x0207
 #define GL_ALWAYS                         0x0207
-
-/* StencilOp */
-/*      GL_ZERO */
 #define GL_KEEP                           0x1E00
 #define GL_KEEP                           0x1E00
 #define GL_REPLACE                        0x1E01
 #define GL_REPLACE                        0x1E01
 #define GL_INCR                           0x1E02
 #define GL_INCR                           0x1E02
@@ -296,35 +232,21 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_INVERT                         0x150A
 #define GL_INVERT                         0x150A
 #define GL_INCR_WRAP                      0x8507
 #define GL_INCR_WRAP                      0x8507
 #define GL_DECR_WRAP                      0x8508
 #define GL_DECR_WRAP                      0x8508
-
-/* StringName */
 #define GL_VENDOR                         0x1F00
 #define GL_VENDOR                         0x1F00
 #define GL_RENDERER                       0x1F01
 #define GL_RENDERER                       0x1F01
 #define GL_VERSION                        0x1F02
 #define GL_VERSION                        0x1F02
 #define GL_EXTENSIONS                     0x1F03
 #define GL_EXTENSIONS                     0x1F03
-
-/* TextureMagFilter */
 #define GL_NEAREST                        0x2600
 #define GL_NEAREST                        0x2600
 #define GL_LINEAR                         0x2601
 #define GL_LINEAR                         0x2601
-
-/* TextureMinFilter */
-/*      GL_NEAREST */
-/*      GL_LINEAR */
 #define GL_NEAREST_MIPMAP_NEAREST         0x2700
 #define GL_NEAREST_MIPMAP_NEAREST         0x2700
 #define GL_LINEAR_MIPMAP_NEAREST          0x2701
 #define GL_LINEAR_MIPMAP_NEAREST          0x2701
 #define GL_NEAREST_MIPMAP_LINEAR          0x2702
 #define GL_NEAREST_MIPMAP_LINEAR          0x2702
 #define GL_LINEAR_MIPMAP_LINEAR           0x2703
 #define GL_LINEAR_MIPMAP_LINEAR           0x2703
-
-/* TextureParameterName */
 #define GL_TEXTURE_MAG_FILTER             0x2800
 #define GL_TEXTURE_MAG_FILTER             0x2800
 #define GL_TEXTURE_MIN_FILTER             0x2801
 #define GL_TEXTURE_MIN_FILTER             0x2801
 #define GL_TEXTURE_WRAP_S                 0x2802
 #define GL_TEXTURE_WRAP_S                 0x2802
 #define GL_TEXTURE_WRAP_T                 0x2803
 #define GL_TEXTURE_WRAP_T                 0x2803
-
-/* TextureTarget */
-/*      GL_TEXTURE_2D */
 #define GL_TEXTURE                        0x1702
 #define GL_TEXTURE                        0x1702
-
 #define GL_TEXTURE_CUBE_MAP               0x8513
 #define GL_TEXTURE_CUBE_MAP               0x8513
 #define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
 #define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
@@ -334,8 +256,6 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
-
-/* TextureUnit */
 #define GL_TEXTURE0                       0x84C0
 #define GL_TEXTURE0                       0x84C0
 #define GL_TEXTURE1                       0x84C1
 #define GL_TEXTURE1                       0x84C1
 #define GL_TEXTURE2                       0x84C2
 #define GL_TEXTURE2                       0x84C2
@@ -369,13 +289,9 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_TEXTURE30                      0x84DE
 #define GL_TEXTURE30                      0x84DE
 #define GL_TEXTURE31                      0x84DF
 #define GL_TEXTURE31                      0x84DF
 #define GL_ACTIVE_TEXTURE                 0x84E0
 #define GL_ACTIVE_TEXTURE                 0x84E0
-
-/* TextureWrapMode */
 #define GL_REPEAT                         0x2901
 #define GL_REPEAT                         0x2901
 #define GL_CLAMP_TO_EDGE                  0x812F
 #define GL_CLAMP_TO_EDGE                  0x812F
 #define GL_MIRRORED_REPEAT                0x8370
 #define GL_MIRRORED_REPEAT                0x8370
-
-/* Uniform Types */
 #define GL_FLOAT_VEC2                     0x8B50
 #define GL_FLOAT_VEC2                     0x8B50
 #define GL_FLOAT_VEC3                     0x8B51
 #define GL_FLOAT_VEC3                     0x8B51
 #define GL_FLOAT_VEC4                     0x8B52
 #define GL_FLOAT_VEC4                     0x8B52
@@ -391,48 +307,34 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_FLOAT_MAT4                     0x8B5C
 #define GL_FLOAT_MAT4                     0x8B5C
 #define GL_SAMPLER_2D                     0x8B5E
 #define GL_SAMPLER_2D                     0x8B5E
 #define GL_SAMPLER_CUBE                   0x8B60
 #define GL_SAMPLER_CUBE                   0x8B60
-
-/* Vertex Arrays */
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED        0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE           0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE         0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE           0x8625
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED     0x886A
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER        0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-
-/* Read Format */
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE   0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-
-/* Shader Source */
 #define GL_COMPILE_STATUS                 0x8B81
 #define GL_COMPILE_STATUS                 0x8B81
 #define GL_INFO_LOG_LENGTH                0x8B84
 #define GL_INFO_LOG_LENGTH                0x8B84
 #define GL_SHADER_SOURCE_LENGTH           0x8B88
 #define GL_SHADER_SOURCE_LENGTH           0x8B88
 #define GL_SHADER_COMPILER                0x8DFA
 #define GL_SHADER_COMPILER                0x8DFA
-
-/* Shader Binary */
 #define GL_SHADER_BINARY_FORMATS          0x8DF8
 #define GL_SHADER_BINARY_FORMATS          0x8DF8
 #define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
 #define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
-
-/* Shader Precision-Specified Types */
 #define GL_LOW_FLOAT                      0x8DF0
 #define GL_LOW_FLOAT                      0x8DF0
 #define GL_MEDIUM_FLOAT                   0x8DF1
 #define GL_MEDIUM_FLOAT                   0x8DF1
 #define GL_HIGH_FLOAT                     0x8DF2
 #define GL_HIGH_FLOAT                     0x8DF2
 #define GL_LOW_INT                        0x8DF3
 #define GL_LOW_INT                        0x8DF3
 #define GL_MEDIUM_INT                     0x8DF4
 #define GL_MEDIUM_INT                     0x8DF4
 #define GL_HIGH_INT                       0x8DF5
 #define GL_HIGH_INT                       0x8DF5
-
-/* Framebuffer Object. */
 #define GL_FRAMEBUFFER                    0x8D40
 #define GL_FRAMEBUFFER                    0x8D40
 #define GL_RENDERBUFFER                   0x8D41
 #define GL_RENDERBUFFER                   0x8D41
-
 #define GL_RGBA4                          0x8056
 #define GL_RGBA4                          0x8056
 #define GL_RGB5_A1                        0x8057
 #define GL_RGB5_A1                        0x8057
 #define GL_RGB565                         0x8D62
 #define GL_RGB565                         0x8D62
 #define GL_DEPTH_COMPONENT16              0x81A5
 #define GL_DEPTH_COMPONENT16              0x81A5
 #define GL_STENCIL_INDEX8                 0x8D48
 #define GL_STENCIL_INDEX8                 0x8D48
-
 #define GL_RENDERBUFFER_WIDTH             0x8D42
 #define GL_RENDERBUFFER_WIDTH             0x8D42
 #define GL_RENDERBUFFER_HEIGHT            0x8D43
 #define GL_RENDERBUFFER_HEIGHT            0x8D43
 #define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
 #define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
@@ -442,180 +344,313 @@ typedef khronos_ssize_t  GLsizeiptr;
 #define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
 #define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
 #define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
 #define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
 #define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
 #define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
-
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE           0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME           0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-
 #define GL_COLOR_ATTACHMENT0              0x8CE0
 #define GL_COLOR_ATTACHMENT0              0x8CE0
 #define GL_DEPTH_ATTACHMENT               0x8D00
 #define GL_DEPTH_ATTACHMENT               0x8D00
 #define GL_STENCIL_ATTACHMENT             0x8D20
 #define GL_STENCIL_ATTACHMENT             0x8D20
-
 #define GL_NONE                           0
 #define GL_NONE                           0
-
-#define GL_FRAMEBUFFER_COMPLETE                      0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT         0x8CD6
+#define GL_FRAMEBUFFER_COMPLETE           0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS         0x8CD9
-#define GL_FRAMEBUFFER_UNSUPPORTED                   0x8CDD
-
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD
 #define GL_FRAMEBUFFER_BINDING            0x8CA6
 #define GL_FRAMEBUFFER_BINDING            0x8CA6
 #define GL_RENDERBUFFER_BINDING           0x8CA7
 #define GL_RENDERBUFFER_BINDING           0x8CA7
 #define GL_MAX_RENDERBUFFER_SIZE          0x84E8
 #define GL_MAX_RENDERBUFFER_SIZE          0x84E8
-
 #define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
 #define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
-
-/*-------------------------------------------------------------------------
- * GL core functions.
- *-----------------------------------------------------------------------*/
-
-GL_APICALL void         GL_APIENTRY glActiveTexture (GLenum texture);
-GL_APICALL void         GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
-GL_APICALL void         GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
-GL_APICALL void         GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
-GL_APICALL void         GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
-GL_APICALL void         GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
-GL_APICALL void         GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
-GL_APICALL void         GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GL_APICALL void         GL_APIENTRY glBlendEquation ( GLenum mode );
-GL_APICALL void         GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
-GL_APICALL void         GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GL_APICALL void         GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-GL_APICALL void         GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
-GL_APICALL void         GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
-GL_APICALL GLenum       GL_APIENTRY glCheckFramebufferStatus (GLenum target);
-GL_APICALL void         GL_APIENTRY glClear (GLbitfield mask);
-GL_APICALL void         GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GL_APICALL void         GL_APIENTRY glClearDepthf (GLclampf depth);
-GL_APICALL void         GL_APIENTRY glClearStencil (GLint s);
-GL_APICALL void         GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GL_APICALL void         GL_APIENTRY glCompileShader (GLuint shader);
-GL_APICALL void         GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
-GL_APICALL void         GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
-GL_APICALL void         GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GL_APICALL void         GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL GLuint       GL_APIENTRY glCreateProgram (void);
-GL_APICALL GLuint       GL_APIENTRY glCreateShader (GLenum type);
-GL_APICALL void         GL_APIENTRY glCullFace (GLenum mode);
-GL_APICALL void         GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
-GL_APICALL void         GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
-GL_APICALL void         GL_APIENTRY glDeleteProgram (GLuint program);
-GL_APICALL void         GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
-GL_APICALL void         GL_APIENTRY glDeleteShader (GLuint shader);
-GL_APICALL void         GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
-GL_APICALL void         GL_APIENTRY glDepthFunc (GLenum func);
-GL_APICALL void         GL_APIENTRY glDepthMask (GLboolean flag);
-GL_APICALL void         GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
-GL_APICALL void         GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
-GL_APICALL void         GL_APIENTRY glDisable (GLenum cap);
-GL_APICALL void         GL_APIENTRY glDisableVertexAttribArray (GLuint index);
-GL_APICALL void         GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GL_APICALL void         GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
-GL_APICALL void         GL_APIENTRY glEnable (GLenum cap);
-GL_APICALL void         GL_APIENTRY glEnableVertexAttribArray (GLuint index);
-GL_APICALL void         GL_APIENTRY glFinish (void);
-GL_APICALL void         GL_APIENTRY glFlush (void);
-GL_APICALL void         GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-GL_APICALL void         GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-GL_APICALL void         GL_APIENTRY glFrontFace (GLenum mode);
-GL_APICALL void         GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
-GL_APICALL void         GL_APIENTRY glGenerateMipmap (GLenum target);
-GL_APICALL void         GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
-GL_APICALL void         GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
-GL_APICALL void         GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
-GL_APICALL void         GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-GL_APICALL void         GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-GL_APICALL void         GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
-GL_APICALL GLint        GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
-GL_APICALL void         GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
-GL_APICALL void         GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
-GL_APICALL GLenum       GL_APIENTRY glGetError (void);
-GL_APICALL void         GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
-GL_APICALL void         GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-GL_APICALL void         GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
-GL_APICALL void         GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
-GL_APICALL void         GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-GL_APICALL void         GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
-GL_APICALL void         GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
-GL_APICALL void         GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
-GL_APICALL void         GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-GL_APICALL void         GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
-GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
-GL_APICALL void         GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
-GL_APICALL void         GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
-GL_APICALL void         GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
-GL_APICALL void         GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
-GL_APICALL GLint        GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
-GL_APICALL void         GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
-GL_APICALL void         GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
-GL_APICALL void         GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
-GL_APICALL void         GL_APIENTRY glHint (GLenum target, GLenum mode);
-GL_APICALL GLboolean    GL_APIENTRY glIsBuffer (GLuint buffer);
-GL_APICALL GLboolean    GL_APIENTRY glIsEnabled (GLenum cap);
-GL_APICALL GLboolean    GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
-GL_APICALL GLboolean    GL_APIENTRY glIsProgram (GLuint program);
-GL_APICALL GLboolean    GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
-GL_APICALL GLboolean    GL_APIENTRY glIsShader (GLuint shader);
-GL_APICALL GLboolean    GL_APIENTRY glIsTexture (GLuint texture);
-GL_APICALL void         GL_APIENTRY glLineWidth (GLfloat width);
-GL_APICALL void         GL_APIENTRY glLinkProgram (GLuint program);
-GL_APICALL void         GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
-GL_APICALL void         GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GL_APICALL void         GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
-GL_APICALL void         GL_APIENTRY glReleaseShaderCompiler (void);
-GL_APICALL void         GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-GL_APICALL void         GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
-GL_APICALL void         GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GL_APICALL void         GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
-GL_APICALL void         GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
-GL_APICALL void         GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GL_APICALL void         GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
-GL_APICALL void         GL_APIENTRY glStencilMask (GLuint mask);
-GL_APICALL void         GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
-GL_APICALL void         GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void         GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
-GL_APICALL void         GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
-GL_APICALL void         GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GL_APICALL void         GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
-GL_APICALL void         GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GL_APICALL void         GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
-GL_APICALL void         GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
-GL_APICALL void         GL_APIENTRY glUniform1f (GLint location, GLfloat x);
-GL_APICALL void         GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void         GL_APIENTRY glUniform1i (GLint location, GLint x);
-GL_APICALL void         GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void         GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
-GL_APICALL void         GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void         GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
-GL_APICALL void         GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void         GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void         GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void         GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
-GL_APICALL void         GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void         GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void         GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
-GL_APICALL void         GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
-GL_APICALL void         GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
-GL_APICALL void         GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void         GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void         GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-GL_APICALL void         GL_APIENTRY glUseProgram (GLuint program);
-GL_APICALL void         GL_APIENTRY glValidateProgram (GLuint program);
-GL_APICALL void         GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
-GL_APICALL void         GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
-GL_APICALL void         GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
-GL_APICALL void         GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
-GL_APICALL void         GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
-GL_APICALL void         GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
-GL_APICALL void         GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GL_APICALL void         GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
-GL_APICALL void         GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
-GL_APICALL void         GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
+typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
+typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
+typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
+typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
+typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
+typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
+typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
+typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
+typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
+typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
+typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
+typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
+typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
+typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
+typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
+typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
+typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
+typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
+typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
+typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
+typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
+typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
+typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
+typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
+typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+#if GL_GLES_PROTOTYPES
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_ES_VERSION_2_0 */
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif
 
 
-#endif /* __gl2_h_ */
-
+#endif

File diff suppressed because it is too large
+ 817 - 1199
bsp/simulator/SDL2/include/SDL_opengles2_gl2ext.h


+ 7 - 10
bsp/simulator/SDL2/include/SDL_opengles2_gl2platform.h

@@ -1,20 +1,17 @@
 #ifndef __gl2platform_h_
 #ifndef __gl2platform_h_
 #define __gl2platform_h_
 #define __gl2platform_h_
 
 
-/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
-
 /*
 /*
- * This document is licensed under the SGI Free Software B License Version
- * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
- */
+** Copyright 2017-2020 The Khronos Group Inc.
+** SPDX-License-Identifier: Apache-2.0
+*/
 
 
 /* Platform-specific types and definitions for OpenGL ES 2.X  gl2.h
 /* Platform-specific types and definitions for OpenGL ES 2.X  gl2.h
  *
  *
  * Adopters may modify khrplatform.h and this file to suit their platform.
  * Adopters may modify khrplatform.h and this file to suit their platform.
- * You are encouraged to submit all modifications to the Khronos group so that
- * they can be included in future versions of this file.  Please submit changes
- * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
- * by filing a bug against product "OpenGL-ES" component "Registry".
+ * Please contribute modifications back to Khronos as pull requests on the
+ * public github repository:
+ *      https://github.com/KhronosGroup/OpenGL-Registry
  */
  */
 
 
 /*#include <KHR/khrplatform.h>*/
 /*#include <KHR/khrplatform.h>*/
@@ -27,4 +24,4 @@
 #define GL_APIENTRY KHRONOS_APIENTRY
 #define GL_APIENTRY KHRONOS_APIENTRY
 #endif
 #endif
 
 
-#endif /* __gl2platform_h_ */
+#endif /* __gl2platform_h_ */

+ 43 - 14
bsp/simulator/SDL2/include/SDL_opengles2_khrplatform.h

@@ -2,7 +2,7 @@
 #define __khrplatform_h_
 #define __khrplatform_h_
 
 
 /*
 /*
-** Copyright (c) 2008-2009 The Khronos Group Inc.
+** Copyright (c) 2008-2018 The Khronos Group Inc.
 **
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
 ** copy of this software and/or associated documentation files (the
@@ -26,18 +26,16 @@
 
 
 /* Khronos platform-specific types and definitions.
 /* Khronos platform-specific types and definitions.
  *
  *
- * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
+ * The master copy of khrplatform.h is maintained in the Khronos EGL
+ * Registry repository at https://github.com/KhronosGroup/EGL-Registry
+ * The last semantic modification to khrplatform.h was at commit ID:
+ *      67a3e0864c2d75ea5287b9f3d2eb74a745936692
  *
  *
  * Adopters may modify this file to suit their platform. Adopters are
  * Adopters may modify this file to suit their platform. Adopters are
  * encouraged to submit platform specific modifications to the Khronos
  * encouraged to submit platform specific modifications to the Khronos
  * group so that they can be included in future versions of this file.
  * group so that they can be included in future versions of this file.
- * Please submit changes by sending them to the public Khronos Bugzilla
- * (http://khronos.org/bugzilla) by filing a bug against product
- * "Khronos (general)" component "Registry".
- *
- * A predefined template which fills in some of the bug fields can be
- * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
- * must create a Bugzilla login first.
+ * Please submit changes by filing pull requests or issues on
+ * the EGL Registry repository linked above.
  *
  *
  *
  *
  * See the Implementer's Guidelines for information about where this file
  * See the Implementer's Guidelines for information about where this file
@@ -92,15 +90,25 @@
  *                                  int arg2) KHRONOS_APIATTRIBUTES;
  *                                  int arg2) KHRONOS_APIATTRIBUTES;
  */
  */
 
 
+#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
+#   define KHRONOS_STATIC 1
+#endif
+
 /*-------------------------------------------------------------------------
 /*-------------------------------------------------------------------------
  * Definition of KHRONOS_APICALL
  * Definition of KHRONOS_APICALL
  *-------------------------------------------------------------------------
  *-------------------------------------------------------------------------
  * This precedes the return type of the function in the function prototype.
  * This precedes the return type of the function in the function prototype.
  */
  */
-#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
+#if defined(KHRONOS_STATIC)
+    /* If the preprocessor constant KHRONOS_STATIC is defined, make the
+     * header compatible with static linking. */
+#   define KHRONOS_APICALL
+#elif defined(_WIN32)
 #   define KHRONOS_APICALL __declspec(dllimport)
 #   define KHRONOS_APICALL __declspec(dllimport)
 #elif defined (__SYMBIAN32__)
 #elif defined (__SYMBIAN32__)
 #   define KHRONOS_APICALL IMPORT_C
 #   define KHRONOS_APICALL IMPORT_C
+#elif defined(__ANDROID__)
+#   define KHRONOS_APICALL __attribute__((visibility("default")))
 #else
 #else
 #   define KHRONOS_APICALL
 #   define KHRONOS_APICALL
 #endif
 #endif
@@ -145,6 +153,20 @@ typedef int64_t                 khronos_int64_t;
 typedef uint64_t                khronos_uint64_t;
 typedef uint64_t                khronos_uint64_t;
 #define KHRONOS_SUPPORT_INT64   1
 #define KHRONOS_SUPPORT_INT64   1
 #define KHRONOS_SUPPORT_FLOAT   1
 #define KHRONOS_SUPPORT_FLOAT   1
+/*
+ * To support platform where unsigned long cannot be used interchangeably with
+ * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
+ * Ideally, we could just use (u)intptr_t everywhere, but this could result in
+ * ABI breakage if khronos_uintptr_t is changed from unsigned long to
+ * unsigned long long or similar (this results in different C++ name mangling).
+ * To avoid changes for existing platforms, we restrict usage of intptr_t to
+ * platforms where the size of a pointer is larger than the size of long.
+ */
+#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
+#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
+#define KHRONOS_USE_INTPTR_T
+#endif
+#endif
 
 
 #elif defined(__VMS ) || defined(__sgi)
 #elif defined(__VMS ) || defined(__sgi)
 
 
@@ -227,14 +249,21 @@ typedef unsigned short int     khronos_uint16_t;
  * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
  * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
  * to be the only LLP64 architecture in current use.
  * to be the only LLP64 architecture in current use.
  */
  */
-#ifdef _WIN64
+#ifdef KHRONOS_USE_INTPTR_T
+typedef intptr_t               khronos_intptr_t;
+typedef uintptr_t              khronos_uintptr_t;
+#elif defined(_WIN64)
 typedef signed   long long int khronos_intptr_t;
 typedef signed   long long int khronos_intptr_t;
 typedef unsigned long long int khronos_uintptr_t;
 typedef unsigned long long int khronos_uintptr_t;
-typedef signed   long long int khronos_ssize_t;
-typedef unsigned long long int khronos_usize_t;
 #else
 #else
 typedef signed   long  int     khronos_intptr_t;
 typedef signed   long  int     khronos_intptr_t;
 typedef unsigned long  int     khronos_uintptr_t;
 typedef unsigned long  int     khronos_uintptr_t;
+#endif
+
+#if defined(_WIN64)
+typedef signed   long long int khronos_ssize_t;
+typedef unsigned long long int khronos_usize_t;
+#else
 typedef signed   long  int     khronos_ssize_t;
 typedef signed   long  int     khronos_ssize_t;
 typedef unsigned long  int     khronos_usize_t;
 typedef unsigned long  int     khronos_usize_t;
 #endif
 #endif
@@ -279,4 +308,4 @@ typedef enum {
     KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
     KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
 } khronos_boolean_enum_t;
 } khronos_boolean_enum_t;
 
 
-#endif /* __khrplatform_h_ */
+#endif /* __khrplatform_h_ */

+ 98 - 56
bsp/simulator/SDL2/include/SDL_pixels.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_pixels.h
+ * # CategoryPixels
  *
  *
- *  Header for the enumerated pixel format definitions.
+ * Header for the enumerated pixel format definitions.
  */
  */
 
 
 #ifndef SDL_pixels_h_
 #ifndef SDL_pixels_h_
@@ -61,7 +61,10 @@ typedef enum
     SDL_PIXELTYPE_ARRAYU16,
     SDL_PIXELTYPE_ARRAYU16,
     SDL_PIXELTYPE_ARRAYU32,
     SDL_PIXELTYPE_ARRAYU32,
     SDL_PIXELTYPE_ARRAYF16,
     SDL_PIXELTYPE_ARRAYF16,
-    SDL_PIXELTYPE_ARRAYF32
+    SDL_PIXELTYPE_ARRAYF32,
+
+    /* This must be at the end of the list to avoid breaking the existing ABI */
+    SDL_PIXELTYPE_INDEX2
 } SDL_PixelType;
 } SDL_PixelType;
 
 
 /** Bitmap pixel order, high bit -> low bit. */
 /** Bitmap pixel order, high bit -> low bit. */
@@ -134,6 +137,7 @@ typedef enum
 #define SDL_ISPIXELFORMAT_INDEXED(format)   \
 #define SDL_ISPIXELFORMAT_INDEXED(format)   \
     (!SDL_ISPIXELFORMAT_FOURCC(format) && \
     (!SDL_ISPIXELFORMAT_FOURCC(format) && \
      ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
      ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
+      (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) || \
       (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
       (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
       (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
       (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
 
 
@@ -177,6 +181,12 @@ typedef enum
     SDL_PIXELFORMAT_INDEX1MSB =
     SDL_PIXELFORMAT_INDEX1MSB =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
                                1, 0),
                                1, 0),
+    SDL_PIXELFORMAT_INDEX2LSB =
+        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0,
+                               2, 0),
+    SDL_PIXELFORMAT_INDEX2MSB =
+        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0,
+                               2, 0),
     SDL_PIXELFORMAT_INDEX4LSB =
     SDL_PIXELFORMAT_INDEX4LSB =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
                                4, 0),
                                4, 0),
@@ -276,11 +286,19 @@ typedef enum
     SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
     SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
     SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
     SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
     SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
     SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
+    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
+    SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888,
+    SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888,
+    SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888,
 #else
 #else
     SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
     SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
     SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
     SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
     SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
     SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
     SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
     SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
+    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
+    SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888,
+    SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888,
+    SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888,
 #endif
 #endif
 
 
     SDL_PIXELFORMAT_YV12 =      /**< Planar mode: Y + V + U  (3 planes) */
     SDL_PIXELFORMAT_YV12 =      /**< Planar mode: Y + V + U  (3 planes) */
@@ -302,9 +320,10 @@ typedef enum
 } SDL_PixelFormatEnum;
 } SDL_PixelFormatEnum;
 
 
 /**
 /**
- * The bits of this structure can be directly reinterpreted as an integer-packed
- * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888
- * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
+ * The bits of this structure can be directly reinterpreted as an
+ * integer-packed color which uses the SDL_PIXELFORMAT_RGBA32 format
+ * (SDL_PIXELFORMAT_ABGR8888 on little-endian systems and
+ * SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
  */
  */
 typedef struct SDL_Color
 typedef struct SDL_Color
 {
 {
@@ -324,7 +343,30 @@ typedef struct SDL_Palette
 } SDL_Palette;
 } SDL_Palette;
 
 
 /**
 /**
- *  \note Everything in the pixel format structure is read-only.
+ * A structure that contains pixel format information.
+ *
+ * Everything in the pixel format structure is read-only.
+ *
+ * A pixel format has either a palette or masks. If a palette is used `Rmask`,
+ * `Gmask`, `Bmask`, and `Amask` will be 0.
+ *
+ * An SDL_PixelFormat describes the format of the pixel data stored at the
+ * `pixels` field of an SDL_Surface. Every surface stores an SDL_PixelFormat
+ * in the `format` field.
+ *
+ * If you wish to do pixel level modifications on a surface, then
+ * understanding how SDL stores its color information is essential.
+ *
+ * For information on modern pixel color spaces, see the following Wikipedia
+ * article: http://en.wikipedia.org/wiki/RGBA_color_space
+ *
+ * \sa SDL_ConvertSurface
+ * \sa SDL_GetRGB
+ * \sa SDL_GetRGBA
+ * \sa SDL_MapRGB
+ * \sa SDL_MapRGBA
+ * \sa SDL_AllocFormat
+ * \sa SDL_FreeFormat
  */
  */
 typedef struct SDL_PixelFormat
 typedef struct SDL_PixelFormat
 {
 {
@@ -352,7 +394,7 @@ typedef struct SDL_PixelFormat
 /**
 /**
  * Get the human readable name of a pixel format.
  * Get the human readable name of a pixel format.
  *
  *
- * \param format the pixel format to query
+ * \param format the pixel format to query.
  * \returns the human readable name of the specified pixel format or
  * \returns the human readable name of the specified pixel format or
  *          `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
  *          `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
  *
  *
@@ -363,12 +405,12 @@ extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
 /**
 /**
  * Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
  * Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
  *
  *
- * \param format one of the SDL_PixelFormatEnum values
- * \param bpp a bits per pixel value; usually 15, 16, or 32
- * \param Rmask a pointer filled in with the red mask for the format
- * \param Gmask a pointer filled in with the green mask for the format
- * \param Bmask a pointer filled in with the blue mask for the format
- * \param Amask a pointer filled in with the alpha mask for the format
+ * \param format one of the SDL_PixelFormatEnum values.
+ * \param bpp a bits per pixel value; usually 15, 16, or 32.
+ * \param Rmask a pointer filled in with the red mask for the format.
+ * \param Gmask a pointer filled in with the green mask for the format.
+ * \param Bmask a pointer filled in with the blue mask for the format.
+ * \param Amask a pointer filled in with the alpha mask for the format.
  * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
  * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
  *          possible; call SDL_GetError() for more information.
  *          possible; call SDL_GetError() for more information.
  *
  *
@@ -389,12 +431,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
  * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
  * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
  * possible.
  * possible.
  *
  *
- * \param bpp a bits per pixel value; usually 15, 16, or 32
- * \param Rmask the red mask for the format
- * \param Gmask the green mask for the format
- * \param Bmask the blue mask for the format
- * \param Amask the alpha mask for the format
- * \returns one of the SDL_PixelFormatEnum values
+ * \param bpp a bits per pixel value; usually 15, 16, or 32.
+ * \param Rmask the red mask for the format.
+ * \param Gmask the green mask for the format.
+ * \param Bmask the blue mask for the format.
+ * \param Amask the alpha mask for the format.
+ * \returns one of the SDL_PixelFormatEnum values.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -413,7 +455,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
  * allocated), and hence should not be modified, especially the palette. Weird
  * allocated), and hence should not be modified, especially the palette. Weird
  * errors such as `Blit combination not supported` may occur.
  * errors such as `Blit combination not supported` may occur.
  *
  *
- * \param pixel_format one of the SDL_PixelFormatEnum values
+ * \param pixel_format one of the SDL_PixelFormatEnum values.
  * \returns the new SDL_PixelFormat structure or NULL on failure; call
  * \returns the new SDL_PixelFormat structure or NULL on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -426,7 +468,7 @@ extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
 /**
 /**
  * Free an SDL_PixelFormat structure allocated by SDL_AllocFormat().
  * Free an SDL_PixelFormat structure allocated by SDL_AllocFormat().
  *
  *
- * \param format the SDL_PixelFormat structure to free
+ * \param format the SDL_PixelFormat structure to free.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -439,7 +481,7 @@ extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
  *
  *
  * The palette entries are initialized to white.
  * The palette entries are initialized to white.
  *
  *
- * \param ncolors represents the number of color entries in the color palette
+ * \param ncolors represents the number of color entries in the color palette.
  * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
  * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
  *          there wasn't enough memory); call SDL_GetError() for more
  *          there wasn't enough memory); call SDL_GetError() for more
  *          information.
  *          information.
@@ -453,8 +495,8 @@ extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
 /**
 /**
  * Set the palette for a pixel format structure.
  * Set the palette for a pixel format structure.
  *
  *
- * \param format the SDL_PixelFormat structure that will use the palette
- * \param palette the SDL_Palette structure that will be used
+ * \param format the SDL_PixelFormat structure that will use the palette.
+ * \param palette the SDL_Palette structure that will be used.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -469,10 +511,10 @@ extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
 /**
 /**
  * Set a range of colors in a palette.
  * Set a range of colors in a palette.
  *
  *
- * \param palette the SDL_Palette structure to modify
- * \param colors an array of SDL_Color structures to copy into the palette
- * \param firstcolor the index of the first palette entry to modify
- * \param ncolors the number of entries to modify
+ * \param palette the SDL_Palette structure to modify.
+ * \param colors an array of SDL_Color structures to copy into the palette.
+ * \param firstcolor the index of the first palette entry to modify.
+ * \param ncolors the number of entries to modify.
  * \returns 0 on success or a negative error code if not all of the colors
  * \returns 0 on success or a negative error code if not all of the colors
  *          could be set; call SDL_GetError() for more information.
  *          could be set; call SDL_GetError() for more information.
  *
  *
@@ -488,7 +530,7 @@ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
 /**
 /**
  * Free a palette created with SDL_AllocPalette().
  * Free a palette created with SDL_AllocPalette().
  *
  *
- * \param palette the SDL_Palette structure to be freed
+ * \param palette the SDL_Palette structure to be freed.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -514,11 +556,11 @@ extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
  * format the return value can be assigned to a Uint16, and similarly a Uint8
  * format the return value can be assigned to a Uint16, and similarly a Uint8
  * for an 8-bpp format).
  * for an 8-bpp format).
  *
  *
- * \param format an SDL_PixelFormat structure describing the pixel format
- * \param r the red component of the pixel in the range 0-255
- * \param g the green component of the pixel in the range 0-255
- * \param b the blue component of the pixel in the range 0-255
- * \returns a pixel value
+ * \param format an SDL_PixelFormat structure describing the pixel format.
+ * \param r the red component of the pixel in the range 0-255.
+ * \param g the green component of the pixel in the range 0-255.
+ * \param b the blue component of the pixel in the range 0-255.
+ * \returns a pixel value.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -548,12 +590,12 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
  * for an 8-bpp format).
  * for an 8-bpp format).
  *
  *
  * \param format an SDL_PixelFormat structure describing the format of the
  * \param format an SDL_PixelFormat structure describing the format of the
- *               pixel
- * \param r the red component of the pixel in the range 0-255
- * \param g the green component of the pixel in the range 0-255
- * \param b the blue component of the pixel in the range 0-255
- * \param a the alpha component of the pixel in the range 0-255
- * \returns a pixel value
+ *               pixel.
+ * \param r the red component of the pixel in the range 0-255.
+ * \param g the green component of the pixel in the range 0-255.
+ * \param b the blue component of the pixel in the range 0-255.
+ * \param a the alpha component of the pixel in the range 0-255.
+ * \returns a pixel value.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -573,12 +615,12 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
  * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
  * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
  * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
  * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
  *
  *
- * \param pixel a pixel value
+ * \param pixel a pixel value.
  * \param format an SDL_PixelFormat structure describing the format of the
  * \param format an SDL_PixelFormat structure describing the format of the
- *               pixel
- * \param r a pointer filled in with the red component
- * \param g a pointer filled in with the green component
- * \param b a pointer filled in with the blue component
+ *               pixel.
+ * \param r a pointer filled in with the red component.
+ * \param g a pointer filled in with the green component.
+ * \param b a pointer filled in with the blue component.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -601,13 +643,13 @@ extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
  * If the surface has no alpha component, the alpha will be returned as 0xff
  * If the surface has no alpha component, the alpha will be returned as 0xff
  * (100% opaque).
  * (100% opaque).
  *
  *
- * \param pixel a pixel value
+ * \param pixel a pixel value.
  * \param format an SDL_PixelFormat structure describing the format of the
  * \param format an SDL_PixelFormat structure describing the format of the
- *               pixel
- * \param r a pointer filled in with the red component
- * \param g a pointer filled in with the green component
- * \param b a pointer filled in with the blue component
- * \param a a pointer filled in with the alpha component
+ *               pixel.
+ * \param r a pointer filled in with the red component.
+ * \param g a pointer filled in with the green component.
+ * \param b a pointer filled in with the blue component.
+ * \param a a pointer filled in with the alpha component.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -623,8 +665,8 @@ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
 /**
 /**
  * Calculate a 256 entry gamma ramp for a gamma value.
  * Calculate a 256 entry gamma ramp for a gamma value.
  *
  *
- * \param gamma a gamma value where 0.0 is black and 1.0 is identity
- * \param ramp an array of 256 values filled in with the gamma ramp
+ * \param gamma a gamma value where 0.0 is black and 1.0 is identity.
+ * \param ramp an array of 256 values filled in with the gamma ramp.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -641,4 +683,4 @@ extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
 
 
 #endif /* SDL_pixels_h_ */
 #endif /* SDL_pixels_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 51 - 11
bsp/simulator/SDL2/include/SDL_platform.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_platform.h
+ * # CategoryPlatform
  *
  *
- *  Try to get a standard set of platform defines.
+ * Try to get a standard set of platform defines.
  */
  */
 
 
 #ifndef SDL_platform_h_
 #ifndef SDL_platform_h_
@@ -65,11 +65,21 @@
 #undef __LINUX__ /* do we need to do this? */
 #undef __LINUX__ /* do we need to do this? */
 #define __ANDROID__ 1
 #define __ANDROID__ 1
 #endif
 #endif
+#if defined(__NGAGE__)
+#undef __NGAGE__
+#define __NGAGE__ 1
+#endif
 
 
 #if defined(__APPLE__)
 #if defined(__APPLE__)
 /* lets us know what version of Mac OS X we're compiling on */
 /* lets us know what version of Mac OS X we're compiling on */
-#include "AvailabilityMacros.h"
-#include "TargetConditionals.h"
+#include <AvailabilityMacros.h>
+#ifndef __has_extension /* Older compilers don't support this */
+#define __has_extension(x) 0
+#include <TargetConditionals.h>
+#undef __has_extension
+#else
+#include <TargetConditionals.h>
+#endif
 
 
 /* Fix building with older SDKs that don't define these
 /* Fix building with older SDKs that don't define these
    See this for more information:
    See this for more information:
@@ -104,9 +114,9 @@
 /* if not compiling for iOS */
 /* if not compiling for iOS */
 #undef __MACOSX__
 #undef __MACOSX__
 #define __MACOSX__  1
 #define __MACOSX__  1
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-# error SDL for Mac OS X only supports deploying on 10.6 and above.
-#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+# error SDL for Mac OS X only supports deploying on 10.7 and above.
+#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1070 */
 #endif /* TARGET_OS_IPHONE */
 #endif /* TARGET_OS_IPHONE */
 #endif /* defined(__APPLE__) */
 #endif /* defined(__APPLE__) */
 
 
@@ -140,7 +150,7 @@
 #endif
 #endif
 
 
 #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
 #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
-/* Try to find out if we're compiling for WinRT or non-WinRT */
+/* Try to find out if we're compiling for WinRT, GDK or non-WinRT/GDK */
 #if defined(_MSC_VER) && defined(__has_include)
 #if defined(_MSC_VER) && defined(__has_include)
 #if __has_include(<winapifamily.h>)
 #if __has_include(<winapifamily.h>)
 #define HAVE_WINAPIFAMILY_H 1
 #define HAVE_WINAPIFAMILY_H 1
@@ -162,9 +172,24 @@
 #define WINAPI_FAMILY_WINRT 0
 #define WINAPI_FAMILY_WINRT 0
 #endif /* HAVE_WINAPIFAMILY_H */
 #endif /* HAVE_WINAPIFAMILY_H */
 
 
+#if (HAVE_WINAPIFAMILY_H) && defined(WINAPI_FAMILY_PHONE_APP)
+#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+#else
+#define SDL_WINAPI_FAMILY_PHONE 0
+#endif
+
 #if WINAPI_FAMILY_WINRT
 #if WINAPI_FAMILY_WINRT
 #undef __WINRT__
 #undef __WINRT__
 #define __WINRT__ 1
 #define __WINRT__ 1
+#elif defined(_GAMING_DESKTOP) /* GDK project configuration always defines _GAMING_XXX */
+#undef __WINGDK__
+#define __WINGDK__ 1
+#elif defined(_GAMING_XBOX_XBOXONE)
+#undef __XBOXONE__
+#define __XBOXONE__ 1
+#elif defined(_GAMING_XBOX_SCARLETT)
+#undef __XBOXSERIES__
+#define __XBOXSERIES__ 1
 #else
 #else
 #undef __WINDOWS__
 #undef __WINDOWS__
 #define __WINDOWS__ 1
 #define __WINDOWS__ 1
@@ -175,10 +200,20 @@
 #undef __WIN32__
 #undef __WIN32__
 #define __WIN32__ 1
 #define __WIN32__ 1
 #endif
 #endif
-#if defined(__PSP__)
+/* This is to support generic "any GDK" separate from a platform-specific GDK */
+#if defined(__WINGDK__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
+#undef __GDK__
+#define __GDK__ 1
+#endif
+#if defined(__PSP__) || defined(__psp__)
+#ifdef __PSP__
 #undef __PSP__
 #undef __PSP__
+#endif
 #define __PSP__ 1
 #define __PSP__ 1
 #endif
 #endif
+#if defined(PS2)
+#define __PS2__ 1
+#endif
 
 
 /* The NACL compiler defines __native_client__ and __pnacl__
 /* The NACL compiler defines __native_client__ and __pnacl__
  * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
  * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
@@ -200,6 +235,11 @@
 #define __VITA__ 1
 #define __VITA__ 1
 #endif
 #endif
 
 
+#if defined(__3DS__)
+#undef __3DS__
+#define __3DS__ 1
+#endif
+
 #include "begin_code.h"
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
 /* Set up for C function definitions, even when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
@@ -232,4 +272,4 @@ extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
 
 
 #endif /* SDL_platform_h_ */
 #endif /* SDL_platform_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 13 - 14
bsp/simulator/SDL2/include/SDL_power.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -23,9 +23,9 @@
 #define SDL_power_h_
 #define SDL_power_h_
 
 
 /**
 /**
- *  \file SDL_power.h
+ * # CategoryPower
  *
  *
- *  Header for the SDL power management routines.
+ * Header for the SDL power management routines.
  */
  */
 
 
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
@@ -37,9 +37,9 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  The basic state for the system's power supply.
+ * The basic state for the system's power supply.
  */
  */
-typedef enum
+typedef enum SDL_PowerState
 {
 {
     SDL_POWERSTATE_UNKNOWN,      /**< cannot determine power status */
     SDL_POWERSTATE_UNKNOWN,      /**< cannot determine power status */
     SDL_POWERSTATE_ON_BATTERY,   /**< Not plugged in, running on the battery */
     SDL_POWERSTATE_ON_BATTERY,   /**< Not plugged in, running on the battery */
@@ -48,7 +48,6 @@ typedef enum
     SDL_POWERSTATE_CHARGED       /**< Plugged in, battery charged */
     SDL_POWERSTATE_CHARGED       /**< Plugged in, battery charged */
 } SDL_PowerState;
 } SDL_PowerState;
 
 
-
 /**
 /**
  * Get the current power supply details.
  * Get the current power supply details.
  *
  *
@@ -65,17 +64,17 @@ typedef enum
  * It's possible a platform can only report battery percentage or time left
  * It's possible a platform can only report battery percentage or time left
  * but not both.
  * but not both.
  *
  *
- * \param secs seconds of battery life left, you can pass a NULL here if you
- *             don't care, will return -1 if we can't determine a value, or
- *             we're not running on a battery
- * \param pct percentage of battery life left, between 0 and 100, you can pass
- *            a NULL here if you don't care, will return -1 if we can't
- *            determine a value, or we're not running on a battery
+ * \param seconds seconds of battery life left, you can pass a NULL here if
+ *                you don't care, will return -1 if we can't determine a
+ *                value, or we're not running on a battery.
+ * \param percent percentage of battery life left, between 0 and 100, you can
+ *                pass a NULL here if you don't care, will return -1 if we
+ *                can't determine a value, or we're not running on a battery.
  * \returns an SDL_PowerState enum representing the current battery state.
  * \returns an SDL_PowerState enum representing the current battery state.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  */
  */
-extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
+extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent);
 
 
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
@@ -85,4 +84,4 @@ extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
 
 
 #endif /* SDL_power_h_ */
 #endif /* SDL_power_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 15 - 23
bsp/simulator/SDL2/include/SDL_quit.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,20 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_quit.h
+ * # CategoryQuit
  *
  *
- *  Include file for SDL quit event handling.
+ * An SDL_QUIT event is generated when the user tries to close the application
+ * window. If it is ignored or filtered out, the window will remain open. If
+ * it is not ignored or filtered, it is queued normally and the window is
+ * allowed to close. When the window is closed, screen updates will complete,
+ * but have no effect.
+ *
+ * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) and
+ * SIGTERM (system termination request), if handlers do not already exist,
+ * that generate SDL_QUIT events as well. There is no way to determine the
+ * cause of an SDL_QUIT event, but setting a signal handler in your
+ * application will override the default generation of quit events for that
+ * signal.
  */
  */
 
 
 #ifndef SDL_quit_h_
 #ifndef SDL_quit_h_
@@ -31,28 +42,9 @@
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
 #include "SDL_error.h"
 #include "SDL_error.h"
 
 
-/**
- *  \file SDL_quit.h
- *
- *  An ::SDL_QUIT event is generated when the user tries to close the application
- *  window.  If it is ignored or filtered out, the window will remain open.
- *  If it is not ignored or filtered, it is queued normally and the window
- *  is allowed to close.  When the window is closed, screen updates will
- *  complete, but have no effect.
- *
- *  SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
- *  and SIGTERM (system termination request), if handlers do not already
- *  exist, that generate ::SDL_QUIT events as well.  There is no way
- *  to determine the cause of an ::SDL_QUIT event, but setting a signal
- *  handler in your application will override the default generation of
- *  quit events for that signal.
- *
- *  \sa SDL_Quit()
- */
-
 /* There are no functions directly affecting the quit event */
 /* There are no functions directly affecting the quit event */
 
 
 #define SDL_QuitRequested() \
 #define SDL_QuitRequested() \
         (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
         (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
 
 
-#endif /* SDL_quit_h_ */
+#endif /* SDL_quit_h_ */

+ 175 - 23
bsp/simulator/SDL2/include/SDL_rect.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_rect.h
+ * # CategoryRect
  *
  *
- *  Header file for SDL_rect definition and management functions.
+ * Header file for SDL_rect definition and management functions.
  */
  */
 
 
 #ifndef SDL_rect_h_
 #ifndef SDL_rect_h_
@@ -54,8 +54,8 @@ typedef struct SDL_Point
 /**
 /**
  * The structure that defines a point (floating point)
  * The structure that defines a point (floating point)
  *
  *
- * \sa SDL_EnclosePoints
- * \sa SDL_PointInRect
+ * \sa SDL_EncloseFPoints
+ * \sa SDL_PointInFRect
  */
  */
 typedef struct SDL_FPoint
 typedef struct SDL_FPoint
 {
 {
@@ -71,6 +71,7 @@ typedef struct SDL_FPoint
  * \sa SDL_RectEquals
  * \sa SDL_RectEquals
  * \sa SDL_HasIntersection
  * \sa SDL_HasIntersection
  * \sa SDL_IntersectRect
  * \sa SDL_IntersectRect
+ * \sa SDL_IntersectRectAndLine
  * \sa SDL_UnionRect
  * \sa SDL_UnionRect
  * \sa SDL_EnclosePoints
  * \sa SDL_EnclosePoints
  */
  */
@@ -83,6 +84,16 @@ typedef struct SDL_Rect
 
 
 /**
 /**
  * A rectangle, with the origin at the upper left (floating point).
  * A rectangle, with the origin at the upper left (floating point).
+ *
+ * \sa SDL_FRectEmpty
+ * \sa SDL_FRectEquals
+ * \sa SDL_FRectEqualsEpsilon
+ * \sa SDL_HasIntersectionF
+ * \sa SDL_IntersectFRect
+ * \sa SDL_IntersectFRectAndLine
+ * \sa SDL_UnionFRect
+ * \sa SDL_EncloseFPoints
+ * \sa SDL_PointInFRect
  */
  */
 typedef struct SDL_FRect
 typedef struct SDL_FRect
 {
 {
@@ -124,8 +135,8 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
  *
  *
  * If either pointer is NULL the function will return SDL_FALSE.
  * If either pointer is NULL the function will return SDL_FALSE.
  *
  *
- * \param A an SDL_Rect structure representing the first rectangle
- * \param B an SDL_Rect structure representing the second rectangle
+ * \param A an SDL_Rect structure representing the first rectangle.
+ * \param B an SDL_Rect structure representing the second rectangle.
  * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -140,10 +151,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
  *
  *
  * If `result` is NULL then this function will return SDL_FALSE.
  * If `result` is NULL then this function will return SDL_FALSE.
  *
  *
- * \param A an SDL_Rect structure representing the first rectangle
- * \param B an SDL_Rect structure representing the second rectangle
+ * \param A an SDL_Rect structure representing the first rectangle.
+ * \param B an SDL_Rect structure representing the second rectangle.
  * \param result an SDL_Rect structure filled in with the intersection of
  * \param result an SDL_Rect structure filled in with the intersection of
- *               rectangles `A` and `B`
+ *               rectangles `A` and `B`.
  * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -157,10 +168,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
 /**
 /**
  * Calculate the union of two rectangles.
  * Calculate the union of two rectangles.
  *
  *
- * \param A an SDL_Rect structure representing the first rectangle
- * \param B an SDL_Rect structure representing the second rectangle
+ * \param A an SDL_Rect structure representing the first rectangle.
+ * \param B an SDL_Rect structure representing the second rectangle.
  * \param result an SDL_Rect structure filled in with the union of rectangles
  * \param result an SDL_Rect structure filled in with the union of rectangles
- *               `A` and `B`
+ *               `A` and `B`.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  */
  */
@@ -175,11 +186,11 @@ extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
  * considered.
  * considered.
  *
  *
  * \param points an array of SDL_Point structures representing points to be
  * \param points an array of SDL_Point structures representing points to be
- *               enclosed
- * \param count the number of structures in the `points` array
- * \param clip an SDL_Rect used for clipping or NULL to enclose all points
+ *               enclosed.
+ * \param count the number of structures in the `points` array.
+ * \param clip an SDL_Rect used for clipping or NULL to enclose all points.
  * \param result an SDL_Rect structure filled in with the minimal enclosing
  * \param result an SDL_Rect structure filled in with the minimal enclosing
- *               rectangle
+ *               rectangle.
  * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
  * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
  *          points were outside of the clipping rectangle.
  *          points were outside of the clipping rectangle.
  *
  *
@@ -199,11 +210,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
  * both ends will be clipped to the boundary of the rectangle and the new
  * both ends will be clipped to the boundary of the rectangle and the new
  * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
  * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
  *
  *
- * \param rect an SDL_Rect structure representing the rectangle to intersect
- * \param X1 a pointer to the starting X-coordinate of the line
- * \param Y1 a pointer to the starting Y-coordinate of the line
- * \param X2 a pointer to the ending X-coordinate of the line
- * \param Y2 a pointer to the ending Y-coordinate of the line
+ * \param rect an SDL_Rect structure representing the rectangle to intersect.
+ * \param X1 a pointer to the starting X-coordinate of the line.
+ * \param Y1 a pointer to the starting Y-coordinate of the line.
+ * \param X2 a pointer to the ending X-coordinate of the line.
+ * \param Y2 a pointer to the ending Y-coordinate of the line.
  * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -213,6 +224,147 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
                                                           int *Y1, int *X2,
                                                           int *Y1, int *X2,
                                                           int *Y2);
                                                           int *Y2);
 
 
+
+/* SDL_FRect versions... */
+
+/**
+ * Returns true if point resides inside a rectangle.
+ */
+SDL_FORCE_INLINE SDL_bool SDL_PointInFRect(const SDL_FPoint *p, const SDL_FRect *r)
+{
+    return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
+             (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
+}
+
+/**
+ * Returns true if the rectangle has no area.
+ */
+SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r)
+{
+    return ((!r) || (r->w <= 0.0f) || (r->h <= 0.0f)) ? SDL_TRUE : SDL_FALSE;
+}
+
+/**
+ * Returns true if the two rectangles are equal, within some given epsilon.
+ *
+ * \since This function is available since SDL 2.0.22.
+ */
+SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
+{
+    return (a && b && ((a == b) ||
+            ((SDL_fabsf(a->x - b->x) <= epsilon) &&
+            (SDL_fabsf(a->y - b->y) <= epsilon) &&
+            (SDL_fabsf(a->w - b->w) <= epsilon) &&
+            (SDL_fabsf(a->h - b->h) <= epsilon))))
+            ? SDL_TRUE : SDL_FALSE;
+}
+
+/**
+ * Returns true if the two rectangles are equal, using a default epsilon.
+ *
+ * \since This function is available since SDL 2.0.22.
+ */
+SDL_FORCE_INLINE SDL_bool SDL_FRectEquals(const SDL_FRect *a, const SDL_FRect *b)
+{
+    return SDL_FRectEqualsEpsilon(a, b, SDL_FLT_EPSILON);
+}
+
+/**
+ * Determine whether two rectangles intersect with float precision.
+ *
+ * If either pointer is NULL the function will return SDL_FALSE.
+ *
+ * \param A an SDL_FRect structure representing the first rectangle.
+ * \param B an SDL_FRect structure representing the second rectangle.
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.22.
+ *
+ * \sa SDL_IntersectRect
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersectionF(const SDL_FRect * A,
+                                                      const SDL_FRect * B);
+
+/**
+ * Calculate the intersection of two rectangles with float precision.
+ *
+ * If `result` is NULL then this function will return SDL_FALSE.
+ *
+ * \param A an SDL_FRect structure representing the first rectangle.
+ * \param B an SDL_FRect structure representing the second rectangle.
+ * \param result an SDL_FRect structure filled in with the intersection of
+ *               rectangles `A` and `B`.
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.22.
+ *
+ * \sa SDL_HasIntersectionF
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRect(const SDL_FRect * A,
+                                                    const SDL_FRect * B,
+                                                    SDL_FRect * result);
+
+/**
+ * Calculate the union of two rectangles with float precision.
+ *
+ * \param A an SDL_FRect structure representing the first rectangle.
+ * \param B an SDL_FRect structure representing the second rectangle.
+ * \param result an SDL_FRect structure filled in with the union of rectangles
+ *               `A` and `B`.
+ *
+ * \since This function is available since SDL 2.0.22.
+ */
+extern DECLSPEC void SDLCALL SDL_UnionFRect(const SDL_FRect * A,
+                                            const SDL_FRect * B,
+                                            SDL_FRect * result);
+
+/**
+ * Calculate a minimal rectangle enclosing a set of points with float
+ * precision.
+ *
+ * If `clip` is not NULL then only points inside of the clipping rectangle are
+ * considered.
+ *
+ * \param points an array of SDL_FPoint structures representing points to be
+ *               enclosed.
+ * \param count the number of structures in the `points` array.
+ * \param clip an SDL_FRect used for clipping or NULL to enclose all points.
+ * \param result an SDL_FRect structure filled in with the minimal enclosing
+ *               rectangle.
+ * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
+ *          points were outside of the clipping rectangle.
+ *
+ * \since This function is available since SDL 2.0.22.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_EncloseFPoints(const SDL_FPoint * points,
+                                                    int count,
+                                                    const SDL_FRect * clip,
+                                                    SDL_FRect * result);
+
+/**
+ * Calculate the intersection of a rectangle and line segment with float
+ * precision.
+ *
+ * This function is used to clip a line segment to a rectangle. A line segment
+ * contained entirely within the rectangle or that does not intersect will
+ * remain unchanged. A line segment that crosses the rectangle at either or
+ * both ends will be clipped to the boundary of the rectangle and the new
+ * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
+ *
+ * \param rect an SDL_FRect structure representing the rectangle to intersect.
+ * \param X1 a pointer to the starting X-coordinate of the line.
+ * \param Y1 a pointer to the starting Y-coordinate of the line.
+ * \param X2 a pointer to the ending X-coordinate of the line.
+ * \param Y2 a pointer to the ending Y-coordinate of the line.
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.22.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRectAndLine(const SDL_FRect *
+                                                           rect, float *X1,
+                                                           float *Y1, float *X2,
+                                                           float *Y2);
+
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
@@ -221,4 +373,4 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
 
 
 #endif /* SDL_rect_h_ */
 #endif /* SDL_rect_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

File diff suppressed because it is too large
+ 234 - 205
bsp/simulator/SDL2/include/SDL_render.h


+ 6 - 2
bsp/simulator/SDL2/include/SDL_revision.h

@@ -1,2 +1,6 @@
-#define SDL_REVISION "https://github.com/libsdl-org/SDL.git@b424665e0899769b200231ba943353a5fee1b6b6"
-#define SDL_REVISION_NUMBER 0
+#ifdef SDL_VENDOR_INFO
+#define SDL_REVISION SDL_VENDOR_INFO
+#else
+#define SDL_REVISION ""
+#endif
+#define SDL_REVISION_NUMBER 0

+ 62 - 73
bsp/simulator/SDL2/include/SDL_rwops.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,11 +19,13 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
+/* WIKI CATEGORY: RWOPS */
+
 /**
 /**
- *  \file SDL_rwops.h
+ * # CategoryRWOPS
  *
  *
- *  This file provides a general interface for SDL to read and write
- *  data streams.  It can easily be extended to files, memory, etc.
+ * This file provides a general interface for SDL to read and write data
+ * streams. It can easily be extended to files, memory, etc.
  */
  */
 
 
 #ifndef SDL_rwops_h_
 #ifndef SDL_rwops_h_
@@ -45,9 +47,6 @@ extern "C" {
 #define SDL_RWOPS_JNIFILE   3U  /**< Android asset */
 #define SDL_RWOPS_JNIFILE   3U  /**< Android asset */
 #define SDL_RWOPS_MEMORY    4U  /**< Memory stream */
 #define SDL_RWOPS_MEMORY    4U  /**< Memory stream */
 #define SDL_RWOPS_MEMORY_RO 5U  /**< Read-Only memory stream */
 #define SDL_RWOPS_MEMORY_RO 5U  /**< Read-Only memory stream */
-#if defined(__VITA__)
-#define SDL_RWOPS_VITAFILE  6U  /**< Vita file */
-#endif
 
 
 /**
 /**
  * This is the read/write operation structure -- very basic.
  * This is the read/write operation structure -- very basic.
@@ -60,7 +59,7 @@ typedef struct SDL_RWops
     Sint64 (SDLCALL * size) (struct SDL_RWops * context);
     Sint64 (SDLCALL * size) (struct SDL_RWops * context);
 
 
     /**
     /**
-     *  Seek to \c offset relative to \c whence, one of stdio's whence values:
+     *  Seek to `offset` relative to `whence`, one of stdio's whence values:
      *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
      *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
      *
      *
      *  \return the final offset in the data stream, or -1 on error.
      *  \return the final offset in the data stream, or -1 on error.
@@ -69,8 +68,8 @@ typedef struct SDL_RWops
                              int whence);
                              int whence);
 
 
     /**
     /**
-     *  Read up to \c maxnum objects each of size \c size from the data
-     *  stream to the area pointed at by \c ptr.
+     *  Read up to `maxnum` objects each of size `size` from the data
+     *  stream to the area pointed at by `ptr`.
      *
      *
      *  \return the number of objects read, or 0 at error or end of file.
      *  \return the number of objects read, or 0 at error or end of file.
      */
      */
@@ -78,8 +77,8 @@ typedef struct SDL_RWops
                              size_t size, size_t maxnum);
                              size_t size, size_t maxnum);
 
 
     /**
     /**
-     *  Write exactly \c num objects each of size \c size from the area
-     *  pointed at by \c ptr to data stream.
+     *  Write exactly `num` objects each of size `size` from the area
+     *  pointed at by `ptr` to data stream.
      *
      *
      *  \return the number of objects written, or 0 at error or end of file.
      *  \return the number of objects written, or 0 at error or end of file.
      */
      */
@@ -101,7 +100,7 @@ typedef struct SDL_RWops
         {
         {
             void *asset;
             void *asset;
         } androidio;
         } androidio;
-#elif defined(__WIN32__)
+#elif defined(__WIN32__) || defined(__GDK__)
         struct
         struct
         {
         {
             SDL_bool append;
             SDL_bool append;
@@ -113,17 +112,6 @@ typedef struct SDL_RWops
                 size_t left;
                 size_t left;
             } buffer;
             } buffer;
         } windowsio;
         } windowsio;
-#elif defined(__VITA__)
-        struct
-        {
-            int h;
-            struct
-            {
-                void *data;
-                size_t size;
-                size_t left;
-            } buffer;
-        } vitaio;
 #endif
 #endif
 
 
 #ifdef HAVE_STDIO_H
 #ifdef HAVE_STDIO_H
@@ -200,7 +188,7 @@ typedef struct SDL_RWops
  *
  *
  * Closing the SDL_RWops will close the file handle SDL is holding internally.
  * Closing the SDL_RWops will close the file handle SDL is holding internally.
  *
  *
- * \param file a UTF-8 string representing the filename to open
+ * \param file a UTF-8 string representing the filename to open.
  * \param mode an ASCII string representing the mode to be used for opening
  * \param mode an ASCII string representing the mode to be used for opening
  *             the file.
  *             the file.
  * \returns a pointer to the SDL_RWops structure that is created, or NULL on
  * \returns a pointer to the SDL_RWops structure that is created, or NULL on
@@ -238,10 +226,10 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose);
  * `FILE*`, depending on what system headers are available to SDL. It is
  * `FILE*`, depending on what system headers are available to SDL. It is
  * always intended to be the `FILE*` type from the C runtime's stdio.h.
  * always intended to be the `FILE*` type from the C runtime's stdio.h.
  *
  *
- * \param fp the `FILE*` that feeds the SDL_RWops stream
+ * \param fp the `FILE*` that feeds the SDL_RWops stream.
  * \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops,
  * \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops,
  *                  SDL_FALSE to leave the `FILE*` open when the RWops is
  *                  SDL_FALSE to leave the `FILE*` open when the RWops is
- *                  closed
+ *                  closed.
  * \returns a pointer to the SDL_RWops structure that is created, or NULL on
  * \returns a pointer to the SDL_RWops structure that is created, or NULL on
  *          failure; call SDL_GetError() for more information.
  *          failure; call SDL_GetError() for more information.
  *
  *
@@ -274,8 +262,8 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
  * If you need to make sure the RWops never writes to the memory buffer, you
  * If you need to make sure the RWops never writes to the memory buffer, you
  * should use SDL_RWFromConstMem() with a read-only buffer of memory instead.
  * should use SDL_RWFromConstMem() with a read-only buffer of memory instead.
  *
  *
- * \param mem a pointer to a buffer to feed an SDL_RWops stream
- * \param size the buffer size, in bytes
+ * \param mem a pointer to a buffer to feed an SDL_RWops stream.
+ * \param size the buffer size, in bytes.
  * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
  * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -309,8 +297,8 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
  * If you need to write to a memory buffer, you should use SDL_RWFromMem()
  * If you need to write to a memory buffer, you should use SDL_RWFromMem()
  * with a writable buffer of memory instead.
  * with a writable buffer of memory instead.
  *
  *
- * \param mem a pointer to a read-only buffer to feed an SDL_RWops stream
- * \param size the buffer size, in bytes
+ * \param mem a pointer to a read-only buffer to feed an SDL_RWops stream.
+ * \param size the buffer size, in bytes.
  * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
  * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -372,7 +360,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
  * creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must
  * creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must
  * be responsible for managing that memory in their **close** method.
  * be responsible for managing that memory in their **close** method.
  *
  *
- * \param area the SDL_RWops structure to be freed
+ * \param area the SDL_RWops structure to be freed.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -380,6 +368,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
  */
  */
 extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
 extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
 
 
+/* Possible `whence` values for SDL_RWops seeking... */
 #define RW_SEEK_SET 0       /**< Seek from the beginning of data */
 #define RW_SEEK_SET 0       /**< Seek from the beginning of data */
 #define RW_SEEK_CUR 1       /**< Seek relative to current read point */
 #define RW_SEEK_CUR 1       /**< Seek relative to current read point */
 #define RW_SEEK_END 2       /**< Seek relative to the end of data */
 #define RW_SEEK_END 2       /**< Seek relative to the end of data */
@@ -389,7 +378,7 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
  *
  *
  * Prior to SDL 2.0.10, this function was a macro.
  * Prior to SDL 2.0.10, this function was a macro.
  *
  *
- * \param context the SDL_RWops to get the size of the data stream from
+ * \param context the SDL_RWops to get the size of the data stream from.
  * \returns the size of the data stream in the SDL_RWops on success, -1 if
  * \returns the size of the data stream in the SDL_RWops on success, -1 if
  *          unknown or a negative error code on failure; call SDL_GetError()
  *          unknown or a negative error code on failure; call SDL_GetError()
  *          for more information.
  *          for more information.
@@ -416,10 +405,10 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
  *
  *
  * Prior to SDL 2.0.10, this function was a macro.
  * Prior to SDL 2.0.10, this function was a macro.
  *
  *
- * \param context a pointer to an SDL_RWops structure
+ * \param context a pointer to an SDL_RWops structure.
  * \param offset an offset in bytes, relative to **whence** location; can be
  * \param offset an offset in bytes, relative to **whence** location; can be
- *               negative
- * \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END`
+ *               negative.
+ * \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END`.
  * \returns the final offset in the data stream after the seek or -1 on error.
  * \returns the final offset in the data stream after the seek or -1 on error.
  *
  *
  * \since This function is available since SDL 2.0.10.
  * \since This function is available since SDL 2.0.10.
@@ -446,7 +435,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
  * Prior to SDL 2.0.10, this function was a macro.
  * Prior to SDL 2.0.10, this function was a macro.
  *
  *
  * \param context a SDL_RWops data stream object from which to get the current
  * \param context a SDL_RWops data stream object from which to get the current
- *                offset
+ *                offset.
  * \returns the current offset in the stream, or -1 if the information can not
  * \returns the current offset in the stream, or -1 if the information can not
  *          be determined.
  *          be determined.
  *
  *
@@ -476,10 +465,10 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
  *
  *
  * Prior to SDL 2.0.10, this function was a macro.
  * Prior to SDL 2.0.10, this function was a macro.
  *
  *
- * \param context a pointer to an SDL_RWops structure
- * \param ptr a pointer to a buffer to read data into
- * \param size the size of each object to read, in bytes
- * \param maxnum the maximum number of objects to be read
+ * \param context a pointer to an SDL_RWops structure.
+ * \param ptr a pointer to a buffer to read data into.
+ * \param size the size of each object to read, in bytes.
+ * \param maxnum the maximum number of objects to be read.
  * \returns the number of objects read, or 0 at error or end of file; call
  * \returns the number of objects read, or 0 at error or end of file; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -510,10 +499,10 @@ extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
  *
  *
  * Prior to SDL 2.0.10, this function was a macro.
  * Prior to SDL 2.0.10, this function was a macro.
  *
  *
- * \param context a pointer to an SDL_RWops structure
- * \param ptr a pointer to a buffer containing data to write
- * \param size the size of an object to write, in bytes
- * \param num the number of objects to write
+ * \param context a pointer to an SDL_RWops structure.
+ * \param ptr a pointer to a buffer containing data to write.
+ * \param size the size of an object to write, in bytes.
+ * \param num the number of objects to write.
  * \returns the number of objects written, which will be less than **num** on
  * \returns the number of objects written, which will be less than **num** on
  *          error; call SDL_GetError() for more information.
  *          error; call SDL_GetError() for more information.
  *
  *
@@ -544,7 +533,7 @@ extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
  *
  *
  * Prior to SDL 2.0.10, this function was a macro.
  * Prior to SDL 2.0.10, this function was a macro.
  *
  *
- * \param context SDL_RWops structure to close
+ * \param context SDL_RWops structure to close.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -569,9 +558,9 @@ extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
  *
  *
  * The data should be freed with SDL_free().
  * The data should be freed with SDL_free().
  *
  *
- * \param src the SDL_RWops to read all available data from
- * \param datasize if not NULL, will store the number of bytes read
- * \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning
+ * \param src the SDL_RWops to read all available data from.
+ * \param datasize if not NULL, will store the number of bytes read.
+ * \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning.
  * \returns the data, or NULL if there was an error.
  * \returns the data, or NULL if there was an error.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
@@ -592,8 +581,8 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src,
  * Prior to SDL 2.0.10, this function was a macro wrapping around
  * Prior to SDL 2.0.10, this function was a macro wrapping around
  * SDL_LoadFile_RW.
  * SDL_LoadFile_RW.
  *
  *
- * \param file the path to read all available data from
- * \param datasize if not NULL, will store the number of bytes read
+ * \param file the path to read all available data from.
+ * \param datasize if not NULL, will store the number of bytes read.
  * \returns the data, or NULL if there was an error.
  * \returns the data, or NULL if there was an error.
  *
  *
  * \since This function is available since SDL 2.0.10.
  * \since This function is available since SDL 2.0.10.
@@ -610,7 +599,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
 /**
 /**
  * Use this function to read a byte from an SDL_RWops.
  * Use this function to read a byte from an SDL_RWops.
  *
  *
- * \param src the SDL_RWops to read from
+ * \param src the SDL_RWops to read from.
  * \returns the read byte on success or 0 on failure; call SDL_GetError() for
  * \returns the read byte on success or 0 on failure; call SDL_GetError() for
  *          more information.
  *          more information.
  *
  *
@@ -627,7 +616,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * the native byte order.
  * the native byte order.
  *
  *
- * \param src the stream from which to read data
+ * \param src the stream from which to read data.
  * \returns 16 bits of data in the native byte order of the platform.
  * \returns 16 bits of data in the native byte order of the platform.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -643,7 +632,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * the native byte order.
  * the native byte order.
  *
  *
- * \param src the stream from which to read data
+ * \param src the stream from which to read data.
  * \returns 16 bits of data in the native byte order of the platform.
  * \returns 16 bits of data in the native byte order of the platform.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -659,7 +648,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * the native byte order.
  * the native byte order.
  *
  *
- * \param src the stream from which to read data
+ * \param src the stream from which to read data.
  * \returns 32 bits of data in the native byte order of the platform.
  * \returns 32 bits of data in the native byte order of the platform.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -675,7 +664,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * the native byte order.
  * the native byte order.
  *
  *
- * \param src the stream from which to read data
+ * \param src the stream from which to read data.
  * \returns 32 bits of data in the native byte order of the platform.
  * \returns 32 bits of data in the native byte order of the platform.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -691,7 +680,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * the native byte order.
  * the native byte order.
  *
  *
- * \param src the stream from which to read data
+ * \param src the stream from which to read data.
  * \returns 64 bits of data in the native byte order of the platform.
  * \returns 64 bits of data in the native byte order of the platform.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -707,7 +696,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * SDL byteswaps the data only if necessary, so the data returned will be in
  * the native byte order.
  * the native byte order.
  *
  *
- * \param src the stream from which to read data
+ * \param src the stream from which to read data.
  * \returns 64 bits of data in the native byte order of the platform.
  * \returns 64 bits of data in the native byte order of the platform.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -727,8 +716,8 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
 /**
 /**
  * Use this function to write a byte to an SDL_RWops.
  * Use this function to write a byte to an SDL_RWops.
  *
  *
- * \param dst the SDL_RWops to write to
- * \param value the byte value to write
+ * \param dst the SDL_RWops to write to.
+ * \param value the byte value to write.
  * \returns 1 on success or 0 on failure; call SDL_GetError() for more
  * \returns 1 on success or 0 on failure; call SDL_GetError() for more
  *          information.
  *          information.
  *
  *
@@ -746,8 +735,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
  * specifies native format, and the data written will be in little-endian
  * specifies native format, and the data written will be in little-endian
  * format.
  * format.
  *
  *
- * \param dst the stream to which data will be written
- * \param value the data to be written, in native format
+ * \param dst the stream to which data will be written.
+ * \param value the data to be written, in native format.
  * \returns 1 on successful write, 0 on error.
  * \returns 1 on successful write, 0 on error.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -763,8 +752,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
  * SDL byteswaps the data only if necessary, so the application always
  * SDL byteswaps the data only if necessary, so the application always
  * specifies native format, and the data written will be in big-endian format.
  * specifies native format, and the data written will be in big-endian format.
  *
  *
- * \param dst the stream to which data will be written
- * \param value the data to be written, in native format
+ * \param dst the stream to which data will be written.
+ * \param value the data to be written, in native format.
  * \returns 1 on successful write, 0 on error.
  * \returns 1 on successful write, 0 on error.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -781,8 +770,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
  * specifies native format, and the data written will be in little-endian
  * specifies native format, and the data written will be in little-endian
  * format.
  * format.
  *
  *
- * \param dst the stream to which data will be written
- * \param value the data to be written, in native format
+ * \param dst the stream to which data will be written.
+ * \param value the data to be written, in native format.
  * \returns 1 on successful write, 0 on error.
  * \returns 1 on successful write, 0 on error.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -798,8 +787,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
  * SDL byteswaps the data only if necessary, so the application always
  * SDL byteswaps the data only if necessary, so the application always
  * specifies native format, and the data written will be in big-endian format.
  * specifies native format, and the data written will be in big-endian format.
  *
  *
- * \param dst the stream to which data will be written
- * \param value the data to be written, in native format
+ * \param dst the stream to which data will be written.
+ * \param value the data to be written, in native format.
  * \returns 1 on successful write, 0 on error.
  * \returns 1 on successful write, 0 on error.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -816,8 +805,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
  * specifies native format, and the data written will be in little-endian
  * specifies native format, and the data written will be in little-endian
  * format.
  * format.
  *
  *
- * \param dst the stream to which data will be written
- * \param value the data to be written, in native format
+ * \param dst the stream to which data will be written.
+ * \param value the data to be written, in native format.
  * \returns 1 on successful write, 0 on error.
  * \returns 1 on successful write, 0 on error.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -833,8 +822,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
  * SDL byteswaps the data only if necessary, so the application always
  * SDL byteswaps the data only if necessary, so the application always
  * specifies native format, and the data written will be in big-endian format.
  * specifies native format, and the data written will be in big-endian format.
  *
  *
- * \param dst the stream to which data will be written
- * \param value the data to be written, in native format
+ * \param dst the stream to which data will be written.
+ * \param value the data to be written, in native format.
  * \returns 1 on successful write, 0 on error.
  * \returns 1 on successful write, 0 on error.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -852,4 +841,4 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
 
 
 #endif /* SDL_rwops_h_ */
 #endif /* SDL_rwops_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 57 - 32
bsp/simulator/SDL2/include/SDL_scancode.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_scancode.h
+ * # CategoryScancode
  *
  *
- *  Defines keyboard scancodes.
+ * Defines keyboard scancodes.
  */
  */
 
 
 #ifndef SDL_scancode_h_
 #ifndef SDL_scancode_h_
@@ -31,16 +31,16 @@
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
 
 
 /**
 /**
- *  \brief The SDL keyboard scancode representation.
+ * The SDL keyboard scancode representation.
  *
  *
- *  Values of this type are used to represent keyboard keys, among other places
- *  in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
- *  SDL_Event structure.
+ * Values of this type are used to represent keyboard keys, among other places
+ * in the SDL_Keysym::scancode key.keysym.scancode field of the SDL_Event
+ * structure.
  *
  *
- *  The values in this enumeration are based on the USB usage page standard:
- *  https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
+ * The values in this enumeration are based on the USB usage page standard:
+ * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
  */
  */
-typedef enum
+typedef enum SDL_Scancode
 {
 {
     SDL_SCANCODE_UNKNOWN = 0,
     SDL_SCANCODE_UNKNOWN = 0,
 
 
@@ -225,16 +225,16 @@ typedef enum
     SDL_SCANCODE_F23 = 114,
     SDL_SCANCODE_F23 = 114,
     SDL_SCANCODE_F24 = 115,
     SDL_SCANCODE_F24 = 115,
     SDL_SCANCODE_EXECUTE = 116,
     SDL_SCANCODE_EXECUTE = 116,
-    SDL_SCANCODE_HELP = 117,
-    SDL_SCANCODE_MENU = 118,
+    SDL_SCANCODE_HELP = 117,    /**< AL Integrated Help Center */
+    SDL_SCANCODE_MENU = 118,    /**< Menu (show menu) */
     SDL_SCANCODE_SELECT = 119,
     SDL_SCANCODE_SELECT = 119,
-    SDL_SCANCODE_STOP = 120,
-    SDL_SCANCODE_AGAIN = 121,   /**< redo */
-    SDL_SCANCODE_UNDO = 122,
-    SDL_SCANCODE_CUT = 123,
-    SDL_SCANCODE_COPY = 124,
-    SDL_SCANCODE_PASTE = 125,
-    SDL_SCANCODE_FIND = 126,
+    SDL_SCANCODE_STOP = 120,    /**< AC Stop */
+    SDL_SCANCODE_AGAIN = 121,   /**< AC Redo/Repeat */
+    SDL_SCANCODE_UNDO = 122,    /**< AC Undo */
+    SDL_SCANCODE_CUT = 123,     /**< AC Cut */
+    SDL_SCANCODE_COPY = 124,    /**< AC Copy */
+    SDL_SCANCODE_PASTE = 125,   /**< AC Paste */
+    SDL_SCANCODE_FIND = 126,    /**< AC Find */
     SDL_SCANCODE_MUTE = 127,
     SDL_SCANCODE_MUTE = 127,
     SDL_SCANCODE_VOLUMEUP = 128,
     SDL_SCANCODE_VOLUMEUP = 128,
     SDL_SCANCODE_VOLUMEDOWN = 129,
     SDL_SCANCODE_VOLUMEDOWN = 129,
@@ -265,9 +265,9 @@ typedef enum
     SDL_SCANCODE_LANG8 = 151, /**< reserved */
     SDL_SCANCODE_LANG8 = 151, /**< reserved */
     SDL_SCANCODE_LANG9 = 152, /**< reserved */
     SDL_SCANCODE_LANG9 = 152, /**< reserved */
 
 
-    SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
+    SDL_SCANCODE_ALTERASE = 153,    /**< Erase-Eaze */
     SDL_SCANCODE_SYSREQ = 154,
     SDL_SCANCODE_SYSREQ = 154,
-    SDL_SCANCODE_CANCEL = 155,
+    SDL_SCANCODE_CANCEL = 155,      /**< AC Cancel */
     SDL_SCANCODE_CLEAR = 156,
     SDL_SCANCODE_CLEAR = 156,
     SDL_SCANCODE_PRIOR = 157,
     SDL_SCANCODE_PRIOR = 157,
     SDL_SCANCODE_RETURN2 = 158,
     SDL_SCANCODE_RETURN2 = 158,
@@ -345,6 +345,11 @@ typedef enum
      *  \name Usage page 0x0C
      *  \name Usage page 0x0C
      *
      *
      *  These values are mapped from usage page 0x0C (USB consumer page).
      *  These values are mapped from usage page 0x0C (USB consumer page).
+     *  See https://usb.org/sites/default/files/hut1_2.pdf
+     *
+     *  There are way more keys in the spec than we can represent in the
+     *  current scancode range, so pick the ones that commonly come up in
+     *  real world usage.
      */
      */
     /* @{ */
     /* @{ */
 
 
@@ -354,17 +359,17 @@ typedef enum
     SDL_SCANCODE_AUDIOPLAY = 261,
     SDL_SCANCODE_AUDIOPLAY = 261,
     SDL_SCANCODE_AUDIOMUTE = 262,
     SDL_SCANCODE_AUDIOMUTE = 262,
     SDL_SCANCODE_MEDIASELECT = 263,
     SDL_SCANCODE_MEDIASELECT = 263,
-    SDL_SCANCODE_WWW = 264,
+    SDL_SCANCODE_WWW = 264,             /**< AL Internet Browser */
     SDL_SCANCODE_MAIL = 265,
     SDL_SCANCODE_MAIL = 265,
-    SDL_SCANCODE_CALCULATOR = 266,
+    SDL_SCANCODE_CALCULATOR = 266,      /**< AL Calculator */
     SDL_SCANCODE_COMPUTER = 267,
     SDL_SCANCODE_COMPUTER = 267,
-    SDL_SCANCODE_AC_SEARCH = 268,
-    SDL_SCANCODE_AC_HOME = 269,
-    SDL_SCANCODE_AC_BACK = 270,
-    SDL_SCANCODE_AC_FORWARD = 271,
-    SDL_SCANCODE_AC_STOP = 272,
-    SDL_SCANCODE_AC_REFRESH = 273,
-    SDL_SCANCODE_AC_BOOKMARKS = 274,
+    SDL_SCANCODE_AC_SEARCH = 268,       /**< AC Search */
+    SDL_SCANCODE_AC_HOME = 269,         /**< AC Home */
+    SDL_SCANCODE_AC_BACK = 270,         /**< AC Back */
+    SDL_SCANCODE_AC_FORWARD = 271,      /**< AC Forward */
+    SDL_SCANCODE_AC_STOP = 272,         /**< AC Stop */
+    SDL_SCANCODE_AC_REFRESH = 273,      /**< AC Refresh */
+    SDL_SCANCODE_AC_BOOKMARKS = 274,    /**< AC Bookmarks */
 
 
     /* @} *//* Usage page 0x0C */
     /* @} *//* Usage page 0x0C */
 
 
@@ -383,7 +388,7 @@ typedef enum
     SDL_SCANCODE_KBDILLUMDOWN = 279,
     SDL_SCANCODE_KBDILLUMDOWN = 279,
     SDL_SCANCODE_KBDILLUMUP = 280,
     SDL_SCANCODE_KBDILLUMUP = 280,
     SDL_SCANCODE_EJECT = 281,
     SDL_SCANCODE_EJECT = 281,
-    SDL_SCANCODE_SLEEP = 282,
+    SDL_SCANCODE_SLEEP = 282,           /**< SC System Sleep */
 
 
     SDL_SCANCODE_APP1 = 283,
     SDL_SCANCODE_APP1 = 283,
     SDL_SCANCODE_APP2 = 284,
     SDL_SCANCODE_APP2 = 284,
@@ -402,6 +407,26 @@ typedef enum
 
 
     /* @} *//* Usage page 0x0C (additional media keys) */
     /* @} *//* Usage page 0x0C (additional media keys) */
 
 
+    /**
+     *  \name Mobile keys
+     *
+     *  These are values that are often used on mobile phones.
+     */
+    /* @{ */
+
+    SDL_SCANCODE_SOFTLEFT = 287, /**< Usually situated below the display on phones and
+                                      used as a multi-function feature key for selecting
+                                      a software defined function shown on the bottom left
+                                      of the display. */
+    SDL_SCANCODE_SOFTRIGHT = 288, /**< Usually situated below the display on phones and
+                                       used as a multi-function feature key for selecting
+                                       a software defined function shown on the bottom right
+                                       of the display. */
+    SDL_SCANCODE_CALL = 289, /**< Used for accepting phone calls. */
+    SDL_SCANCODE_ENDCALL = 290, /**< Used for rejecting phone calls. */
+
+    /* @} *//* Mobile keys */
+
     /* Add any other keys here. */
     /* Add any other keys here. */
 
 
     SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
     SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
@@ -410,4 +435,4 @@ typedef enum
 
 
 #endif /* SDL_scancode_h_ */
 #endif /* SDL_scancode_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 98 - 70
bsp/simulator/SDL2/include/SDL_sensor.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,10 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_sensor.h
- *
- *  Include file for SDL sensor event handling
+ * # CategorySensor
  *
  *
+ * Include file for SDL sensor event handling
  */
  */
 
 
 #ifndef SDL_sensor_h_
 #ifndef SDL_sensor_h_
@@ -44,7 +43,7 @@ extern "C" {
  *  \brief SDL_sensor.h
  *  \brief SDL_sensor.h
  *
  *
  *  In order to use these functions, SDL_Init() must have been called
  *  In order to use these functions, SDL_Init() must have been called
- *  with the ::SDL_INIT_SENSOR flag.  This causes SDL to scan the system
+ *  with the SDL_INIT_SENSOR flag.  This causes SDL to scan the system
  *  for sensors, and load appropriate drivers.
  *  for sensors, and load appropriate drivers.
  */
  */
 
 
@@ -52,75 +51,87 @@ struct _SDL_Sensor;
 typedef struct _SDL_Sensor SDL_Sensor;
 typedef struct _SDL_Sensor SDL_Sensor;
 
 
 /**
 /**
- * This is a unique ID for a sensor for the time it is connected to the system,
- * and is never reused for the lifetime of the application.
+ * This is a unique ID for a sensor for the time it is connected to the
+ * system, and is never reused for the lifetime of the application.
  *
  *
- * The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
+ * The ID value starts at 0 and increments from there. The value -1 is an
+ * invalid ID.
  */
  */
 typedef Sint32 SDL_SensorID;
 typedef Sint32 SDL_SensorID;
 
 
-/* The different sensors defined by SDL
+/**
+ * The different sensors defined by SDL.
  *
  *
  * Additional sensors may be available, using platform dependent semantics.
  * Additional sensors may be available, using platform dependent semantics.
  *
  *
- * Hare are the additional Android sensors:
+ * Here are the additional Android sensors:
+ *
  * https://developer.android.com/reference/android/hardware/SensorEvent.html#values
  * https://developer.android.com/reference/android/hardware/SensorEvent.html#values
- */
-typedef enum
-{
-    SDL_SENSOR_INVALID = -1,    /**< Returned for an invalid sensor */
-    SDL_SENSOR_UNKNOWN,         /**< Unknown sensor type */
-    SDL_SENSOR_ACCEL,           /**< Accelerometer */
-    SDL_SENSOR_GYRO             /**< Gyroscope */
-} SDL_SensorType;
-
-/**
- * Accelerometer sensor
  *
  *
- * The accelerometer returns the current acceleration in SI meters per
- * second squared. This measurement includes the force of gravity, so
- * a device at rest will have an value of SDL_STANDARD_GRAVITY away
- * from the center of the earth.
+ * Accelerometer sensor notes:
  *
  *
- * values[0]: Acceleration on the x axis
- * values[1]: Acceleration on the y axis
- * values[2]: Acceleration on the z axis
+ * The accelerometer returns the current acceleration in SI meters per second
+ * squared. This measurement includes the force of gravity, so a device at
+ * rest will have an value of SDL_STANDARD_GRAVITY away from the center of the
+ * earth, which is a positive Y value.
  *
  *
- * For phones held in portrait mode and game controllers held in front of you,
- * the axes are defined as follows:
- * -X ... +X : left ... right
- * -Y ... +Y : bottom ... top
- * -Z ... +Z : farther ... closer
+ * - `values[0]`: Acceleration on the x axis
+ * - `values[1]`: Acceleration on the y axis
+ * - `values[2]`: Acceleration on the z axis
  *
  *
- * The axis data is not changed when the phone is rotated.
+ * For phones and tablets held in natural orientation and game controllers
+ * held in front of you, the axes are defined as follows:
  *
  *
- * \sa SDL_GetDisplayOrientation()
- */
-#define SDL_STANDARD_GRAVITY    9.80665f
-
-/**
- * Gyroscope sensor
+ * - -X ... +X : left ... right
+ * - -Y ... +Y : bottom ... top
+ * - -Z ... +Z : farther ... closer
+ *
+ * The accelerometer axis data is not changed when the device is rotated.
+ *
+ * Gyroscope sensor notes:
  *
  *
  * The gyroscope returns the current rate of rotation in radians per second.
  * The gyroscope returns the current rate of rotation in radians per second.
- * The rotation is positive in the counter-clockwise direction. That is,
- * an observer looking from a positive location on one of the axes would
- * see positive rotation on that axis when it appeared to be rotating
+ * The rotation is positive in the counter-clockwise direction. That is, an
+ * observer looking from a positive location on one of the axes would see
+ * positive rotation on that axis when it appeared to be rotating
  * counter-clockwise.
  * counter-clockwise.
  *
  *
- * values[0]: Angular speed around the x axis (pitch)
- * values[1]: Angular speed around the y axis (yaw)
- * values[2]: Angular speed around the z axis (roll)
+ * - `values[0]`: Angular speed around the x axis (pitch)
+ * - `values[1]`: Angular speed around the y axis (yaw)
+ * - `values[2]`: Angular speed around the z axis (roll)
+ *
+ * For phones and tablets held in natural orientation and game controllers
+ * held in front of you, the axes are defined as follows:
  *
  *
- * For phones held in portrait mode and game controllers held in front of you,
- * the axes are defined as follows:
- * -X ... +X : left ... right
- * -Y ... +Y : bottom ... top
- * -Z ... +Z : farther ... closer
+ * - -X ... +X : left ... right
+ * - -Y ... +Y : bottom ... top
+ * - -Z ... +Z : farther ... closer
  *
  *
- * The axis data is not changed when the phone or controller is rotated.
+ * The gyroscope axis data is not changed when the device is rotated.
  *
  *
- * \sa SDL_GetDisplayOrientation()
+ * \sa SDL_GetDisplayOrientation
  */
  */
+typedef enum SDL_SensorType
+{
+    SDL_SENSOR_INVALID = -1,    /**< Returned for an invalid sensor */
+    SDL_SENSOR_UNKNOWN,         /**< Unknown sensor type */
+    SDL_SENSOR_ACCEL,           /**< Accelerometer */
+    SDL_SENSOR_GYRO,            /**< Gyroscope */
+    SDL_SENSOR_ACCEL_L,         /**< Accelerometer for left Joy-Con controller and Wii nunchuk */
+    SDL_SENSOR_GYRO_L,          /**< Gyroscope for left Joy-Con controller */
+    SDL_SENSOR_ACCEL_R,         /**< Accelerometer for right Joy-Con controller */
+    SDL_SENSOR_GYRO_R           /**< Gyroscope for right Joy-Con controller */
+} SDL_SensorType;
+
+/**
+ * A constant to represent standard gravity for accelerometer sensors.
+ *
+ * The accelerometer returns the current acceleration in SI meters per second
+ * squared. This measurement includes the force of gravity, so a device at
+ * rest will have an value of SDL_STANDARD_GRAVITY away from the center of the
+ * earth, which is a positive Y value.
+ */
+#define SDL_STANDARD_GRAVITY    9.80665f
 
 
 /* Function prototypes */
 /* Function prototypes */
 
 
@@ -151,7 +162,7 @@ extern DECLSPEC int SDLCALL SDL_NumSensors(void);
 /**
 /**
  * Get the implementation dependent name of a sensor.
  * Get the implementation dependent name of a sensor.
  *
  *
- * \param device_index The sensor to obtain name from
+ * \param device_index The sensor to obtain name from.
  * \returns the sensor name, or NULL if `device_index` is out of range.
  * \returns the sensor name, or NULL if `device_index` is out of range.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -161,7 +172,7 @@ extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
 /**
 /**
  * Get the type of a sensor.
  * Get the type of a sensor.
  *
  *
- * \param device_index The sensor to get the type from
+ * \param device_index The sensor to get the type from.
  * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is
  * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is
  *          out of range.
  *          out of range.
  *
  *
@@ -172,7 +183,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index)
 /**
 /**
  * Get the platform dependent type of a sensor.
  * Get the platform dependent type of a sensor.
  *
  *
- * \param device_index The sensor to check
+ * \param device_index The sensor to check.
  * \returns the sensor platform dependent type, or -1 if `device_index` is out
  * \returns the sensor platform dependent type, or -1 if `device_index` is out
  *          of range.
  *          of range.
  *
  *
@@ -183,7 +194,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index)
 /**
 /**
  * Get the instance ID of a sensor.
  * Get the instance ID of a sensor.
  *
  *
- * \param device_index The sensor to get instance id from
+ * \param device_index The sensor to get instance id from.
  * \returns the sensor instance ID, or -1 if `device_index` is out of range.
  * \returns the sensor instance ID, or -1 if `device_index` is out of range.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -193,7 +204,7 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_in
 /**
 /**
  * Open a sensor for use.
  * Open a sensor for use.
  *
  *
- * \param device_index The sensor to open
+ * \param device_index The sensor to open.
  * \returns an SDL_Sensor sensor object, or NULL if an error occurred.
  * \returns an SDL_Sensor sensor object, or NULL if an error occurred.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -203,7 +214,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
 /**
 /**
  * Return the SDL_Sensor associated with an instance id.
  * Return the SDL_Sensor associated with an instance id.
  *
  *
- * \param instance_id The sensor from instance id
+ * \param instance_id The sensor from instance id.
  * \returns an SDL_Sensor object.
  * \returns an SDL_Sensor object.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -213,7 +224,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instan
 /**
 /**
  * Get the implementation dependent name of a sensor
  * Get the implementation dependent name of a sensor
  *
  *
- * \param sensor The SDL_Sensor object
+ * \param sensor The SDL_Sensor object.
  * \returns the sensor name, or NULL if `sensor` is NULL.
  * \returns the sensor name, or NULL if `sensor` is NULL.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -223,7 +234,7 @@ extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
 /**
 /**
  * Get the type of a sensor.
  * Get the type of a sensor.
  *
  *
- * \param sensor The SDL_Sensor object to inspect
+ * \param sensor The SDL_Sensor object to inspect.
  * \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is
  * \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is
  *          NULL.
  *          NULL.
  *
  *
@@ -234,7 +245,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
 /**
 /**
  * Get the platform dependent type of a sensor.
  * Get the platform dependent type of a sensor.
  *
  *
- * \param sensor The SDL_Sensor object to inspect
+ * \param sensor The SDL_Sensor object to inspect.
  * \returns the sensor platform dependent type, or -1 if `sensor` is NULL.
  * \returns the sensor platform dependent type, or -1 if `sensor` is NULL.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -244,7 +255,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
 /**
 /**
  * Get the instance ID of a sensor.
  * Get the instance ID of a sensor.
  *
  *
- * \param sensor The SDL_Sensor object to inspect
+ * \param sensor The SDL_Sensor object to inspect.
  * \returns the sensor instance ID, or -1 if `sensor` is NULL.
  * \returns the sensor instance ID, or -1 if `sensor` is NULL.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -256,23 +267,40 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor)
  *
  *
  * The number of values and interpretation of the data is sensor dependent.
  * The number of values and interpretation of the data is sensor dependent.
  *
  *
- * \param sensor The SDL_Sensor object to query
- * \param data A pointer filled with the current sensor state
- * \param num_values The number of values to write to data
+ * \param sensor The SDL_Sensor object to query.
+ * \param data A pointer filled with the current sensor state.
+ * \param num_values The number of values to write to data.
  * \returns 0 or -1 if an error occurred.
  * \returns 0 or -1 if an error occurred.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
  */
  */
-extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
+extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values);
+
+/**
+ * Get the current state of an opened sensor with the timestamp of the last
+ * update.
+ *
+ * The number of values and interpretation of the data is sensor dependent.
+ *
+ * \param sensor The SDL_Sensor object to query.
+ * \param timestamp A pointer filled with the timestamp in microseconds of the
+ *                  current sensor reading if available, or 0 if not.
+ * \param data A pointer filled with the current sensor state.
+ * \param num_values The number of values to write to data.
+ * \returns 0 or -1 if an error occurred.
+ *
+ * \since This function is available since SDL 2.26.0.
+ */
+extern DECLSPEC int SDLCALL SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, Uint64 *timestamp, float *data, int num_values);
 
 
 /**
 /**
  * Close a sensor previously opened with SDL_SensorOpen().
  * Close a sensor previously opened with SDL_SensorOpen().
  *
  *
- * \param sensor The SDL_Sensor object to close
+ * \param sensor The SDL_Sensor object to close.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
  */
  */
-extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor);
+extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor *sensor);
 
 
 /**
 /**
  * Update the current state of the open sensors.
  * Update the current state of the open sensors.
@@ -298,4 +326,4 @@ extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);
 
 
 #endif /* SDL_sensor_h_ */
 #endif /* SDL_sensor_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 11 - 11
bsp/simulator/SDL2/include/SDL_shape.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -48,18 +48,18 @@ extern "C" {
  * and flags.
  * and flags.
  *
  *
  * \param title The title of the window, in UTF-8 encoding.
  * \param title The title of the window, in UTF-8 encoding.
- * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *          ::SDL_WINDOWPOS_UNDEFINED.
- * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *          ::SDL_WINDOWPOS_UNDEFINED.
+ * \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or
+ *          SDL_WINDOWPOS_UNDEFINED.
+ * \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or
+ *          SDL_WINDOWPOS_UNDEFINED.
  * \param w The width of the window.
  * \param w The width of the window.
  * \param h The height of the window.
  * \param h The height of the window.
  * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with
  * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with
- *              any of the following: ::SDL_WINDOW_OPENGL,
- *              ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN,
- *              ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
- *              ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set,
- *              and ::SDL_WINDOW_FULLSCREEN is always unset.
+ *              any of the following: SDL_WINDOW_OPENGL,
+ *              SDL_WINDOW_INPUT_GRABBED, SDL_WINDOW_HIDDEN,
+ *              SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED,
+ *              SDL_WINDOW_MINIMIZED, SDL_WINDOW_BORDERLESS is always set, and
+ *              SDL_WINDOW_FULLSCREEN is always unset.
  * \return the window created, or NULL if window creation failed.
  * \return the window created, or NULL if window creation failed.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
@@ -152,4 +152,4 @@ extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_Windo
 #endif
 #endif
 #include "close_code.h"
 #include "close_code.h"
 
 
-#endif /* SDL_shape_h_ */
+#endif /* SDL_shape_h_ */

+ 218 - 64
bsp/simulator/SDL2/include/SDL_stdinc.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,10 +19,12 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
+/* WIKI CATEGORY: StdInc */
+
 /**
 /**
- *  \file SDL_stdinc.h
+ * # CategoryStdInc
  *
  *
- *  This is a general header that includes C language support.
+ * This is a general header that includes C language support.
  */
  */
 
 
 #ifndef SDL_stdinc_h_
 #ifndef SDL_stdinc_h_
@@ -30,12 +32,6 @@
 
 
 #include "SDL_config.h"
 #include "SDL_config.h"
 
 
-#ifdef __APPLE__
-#ifndef _DARWIN_C_SOURCE
-#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */
-#endif
-#endif
-
 #ifdef HAVE_SYS_TYPES_H
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
 #endif
 #endif
@@ -80,12 +76,14 @@
 # include <ctype.h>
 # include <ctype.h>
 #endif
 #endif
 #ifdef HAVE_MATH_H
 #ifdef HAVE_MATH_H
-# if defined(__WINRT__)
+# if defined(_MSC_VER)
 /* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
 /* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
-   WinRT.  See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
+   Visual Studio.  See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
    for more information.
    for more information.
 */
 */
-#  define _USE_MATH_DEFINES
+#  ifndef _USE_MATH_DEFINES
+#    define _USE_MATH_DEFINES
+#  endif
 # endif
 # endif
 # include <math.h>
 # include <math.h>
 #endif
 #endif
@@ -111,10 +109,16 @@
 # elif defined(__MRC__)
 # elif defined(__MRC__)
 void *alloca(unsigned);
 void *alloca(unsigned);
 # else
 # else
-char *alloca();
+void *alloca(size_t);
 # endif
 # endif
 #endif
 #endif
 
 
+#ifdef SIZE_MAX
+# define SDL_SIZE_MAX SIZE_MAX
+#else
+# define SDL_SIZE_MAX ((size_t) -1)
+#endif
+
 /**
 /**
  * Check if the compiler supports a given builtin.
  * Check if the compiler supports a given builtin.
  * Supported by virtually all clang versions and recent gcc. Use this
  * Supported by virtually all clang versions and recent gcc. Use this
@@ -127,15 +131,19 @@ char *alloca();
 #endif
 #endif
 
 
 /**
 /**
- *  The number of elements in an array.
+ * The number of elements in an array.
  */
  */
 #define SDL_arraysize(array)    (sizeof(array)/sizeof(array[0]))
 #define SDL_arraysize(array)    (sizeof(array)/sizeof(array[0]))
 #define SDL_TABLESIZE(table)    SDL_arraysize(table)
 #define SDL_TABLESIZE(table)    SDL_arraysize(table)
 
 
 /**
 /**
- *  Macro useful for building other macros with strings in them
+ * Macro useful for building other macros with strings in them
+ *
+ * e.g:
  *
  *
- *  e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
+ * ```c
+ * #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
+ * ```
  */
  */
 #define SDL_STRINGIFY_ARG(arg)  #arg
 #define SDL_STRINGIFY_ARG(arg)  #arg
 
 
@@ -183,99 +191,119 @@ typedef enum
 #endif
 #endif
 
 
 /**
 /**
- * \brief A signed 8-bit integer type.
+ * A signed 8-bit integer type.
  */
  */
+typedef int8_t Sint8;
 #define SDL_MAX_SINT8   ((Sint8)0x7F)           /* 127 */
 #define SDL_MAX_SINT8   ((Sint8)0x7F)           /* 127 */
 #define SDL_MIN_SINT8   ((Sint8)(~0x7F))        /* -128 */
 #define SDL_MIN_SINT8   ((Sint8)(~0x7F))        /* -128 */
-typedef int8_t Sint8;
+
 /**
 /**
- * \brief An unsigned 8-bit integer type.
+ * An unsigned 8-bit integer type.
  */
  */
+typedef uint8_t Uint8;
 #define SDL_MAX_UINT8   ((Uint8)0xFF)           /* 255 */
 #define SDL_MAX_UINT8   ((Uint8)0xFF)           /* 255 */
 #define SDL_MIN_UINT8   ((Uint8)0x00)           /* 0 */
 #define SDL_MIN_UINT8   ((Uint8)0x00)           /* 0 */
-typedef uint8_t Uint8;
+
 /**
 /**
- * \brief A signed 16-bit integer type.
+ * A signed 16-bit integer type.
  */
  */
+typedef int16_t Sint16;
 #define SDL_MAX_SINT16  ((Sint16)0x7FFF)        /* 32767 */
 #define SDL_MAX_SINT16  ((Sint16)0x7FFF)        /* 32767 */
 #define SDL_MIN_SINT16  ((Sint16)(~0x7FFF))     /* -32768 */
 #define SDL_MIN_SINT16  ((Sint16)(~0x7FFF))     /* -32768 */
-typedef int16_t Sint16;
+
 /**
 /**
- * \brief An unsigned 16-bit integer type.
+ * An unsigned 16-bit integer type.
  */
  */
+typedef uint16_t Uint16;
 #define SDL_MAX_UINT16  ((Uint16)0xFFFF)        /* 65535 */
 #define SDL_MAX_UINT16  ((Uint16)0xFFFF)        /* 65535 */
 #define SDL_MIN_UINT16  ((Uint16)0x0000)        /* 0 */
 #define SDL_MIN_UINT16  ((Uint16)0x0000)        /* 0 */
-typedef uint16_t Uint16;
+
 /**
 /**
- * \brief A signed 32-bit integer type.
+ * A signed 32-bit integer type.
  */
  */
+typedef int32_t Sint32;
 #define SDL_MAX_SINT32  ((Sint32)0x7FFFFFFF)    /* 2147483647 */
 #define SDL_MAX_SINT32  ((Sint32)0x7FFFFFFF)    /* 2147483647 */
 #define SDL_MIN_SINT32  ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
 #define SDL_MIN_SINT32  ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
-typedef int32_t Sint32;
+
 /**
 /**
- * \brief An unsigned 32-bit integer type.
+ * An unsigned 32-bit integer type.
  */
  */
+typedef uint32_t Uint32;
 #define SDL_MAX_UINT32  ((Uint32)0xFFFFFFFFu)   /* 4294967295 */
 #define SDL_MAX_UINT32  ((Uint32)0xFFFFFFFFu)   /* 4294967295 */
 #define SDL_MIN_UINT32  ((Uint32)0x00000000)    /* 0 */
 #define SDL_MIN_UINT32  ((Uint32)0x00000000)    /* 0 */
-typedef uint32_t Uint32;
 
 
 /**
 /**
- * \brief A signed 64-bit integer type.
+ * A signed 64-bit integer type.
  */
  */
+typedef int64_t Sint64;
 #define SDL_MAX_SINT64  ((Sint64)0x7FFFFFFFFFFFFFFFll)      /* 9223372036854775807 */
 #define SDL_MAX_SINT64  ((Sint64)0x7FFFFFFFFFFFFFFFll)      /* 9223372036854775807 */
 #define SDL_MIN_SINT64  ((Sint64)(~0x7FFFFFFFFFFFFFFFll))   /* -9223372036854775808 */
 #define SDL_MIN_SINT64  ((Sint64)(~0x7FFFFFFFFFFFFFFFll))   /* -9223372036854775808 */
-typedef int64_t Sint64;
+
 /**
 /**
- * \brief An unsigned 64-bit integer type.
+ * An unsigned 64-bit integer type.
  */
  */
+typedef uint64_t Uint64;
 #define SDL_MAX_UINT64  ((Uint64)0xFFFFFFFFFFFFFFFFull)     /* 18446744073709551615 */
 #define SDL_MAX_UINT64  ((Uint64)0xFFFFFFFFFFFFFFFFull)     /* 18446744073709551615 */
 #define SDL_MIN_UINT64  ((Uint64)(0x0000000000000000ull))   /* 0 */
 #define SDL_MIN_UINT64  ((Uint64)(0x0000000000000000ull))   /* 0 */
-typedef uint64_t Uint64;
+
 
 
 /* @} *//* Basic data types */
 /* @} *//* Basic data types */
 
 
+/**
+ *  \name Floating-point constants
+ */
+/* @{ */
+
+#ifdef FLT_EPSILON
+#define SDL_FLT_EPSILON FLT_EPSILON
+#else
+#define SDL_FLT_EPSILON 1.1920928955078125e-07F /* 0x0.000002p0 */
+#endif
+
+/* @} *//* Floating-point constants */
+
 /* Make sure we have macros for printing width-based integers.
 /* Make sure we have macros for printing width-based integers.
  * <stdint.h> should define these but this is not true all platforms.
  * <stdint.h> should define these but this is not true all platforms.
  * (for example win32) */
  * (for example win32) */
 #ifndef SDL_PRIs64
 #ifndef SDL_PRIs64
-#ifdef PRIs64
-#define SDL_PRIs64 PRIs64
-#elif defined(__WIN32__)
+#if defined(__WIN32__) || defined(__GDK__)
 #define SDL_PRIs64 "I64d"
 #define SDL_PRIs64 "I64d"
-#elif defined(__LINUX__) && defined(__LP64__)
+#elif defined(PRId64)
+#define SDL_PRIs64 PRId64
+#elif defined(__LP64__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__)
 #define SDL_PRIs64 "ld"
 #define SDL_PRIs64 "ld"
 #else
 #else
 #define SDL_PRIs64 "lld"
 #define SDL_PRIs64 "lld"
 #endif
 #endif
 #endif
 #endif
 #ifndef SDL_PRIu64
 #ifndef SDL_PRIu64
-#ifdef PRIu64
-#define SDL_PRIu64 PRIu64
-#elif defined(__WIN32__)
+#if defined(__WIN32__) || defined(__GDK__)
 #define SDL_PRIu64 "I64u"
 #define SDL_PRIu64 "I64u"
-#elif defined(__LINUX__) && defined(__LP64__)
+#elif defined(PRIu64)
+#define SDL_PRIu64 PRIu64
+#elif defined(__LP64__) && !defined(__APPLE__)
 #define SDL_PRIu64 "lu"
 #define SDL_PRIu64 "lu"
 #else
 #else
 #define SDL_PRIu64 "llu"
 #define SDL_PRIu64 "llu"
 #endif
 #endif
 #endif
 #endif
 #ifndef SDL_PRIx64
 #ifndef SDL_PRIx64
-#ifdef PRIx64
-#define SDL_PRIx64 PRIx64
-#elif defined(__WIN32__)
+#if defined(__WIN32__) || defined(__GDK__)
 #define SDL_PRIx64 "I64x"
 #define SDL_PRIx64 "I64x"
-#elif defined(__LINUX__) && defined(__LP64__)
+#elif defined(PRIx64)
+#define SDL_PRIx64 PRIx64
+#elif defined(__LP64__) && !defined(__APPLE__)
 #define SDL_PRIx64 "lx"
 #define SDL_PRIx64 "lx"
 #else
 #else
 #define SDL_PRIx64 "llx"
 #define SDL_PRIx64 "llx"
 #endif
 #endif
 #endif
 #endif
 #ifndef SDL_PRIX64
 #ifndef SDL_PRIX64
-#ifdef PRIX64
-#define SDL_PRIX64 PRIX64
-#elif defined(__WIN32__)
+#if defined(__WIN32__) || defined(__GDK__)
 #define SDL_PRIX64 "I64X"
 #define SDL_PRIX64 "I64X"
-#elif defined(__LINUX__) && defined(__LP64__)
+#elif defined(PRIX64)
+#define SDL_PRIX64 PRIX64
+#elif defined(__LP64__) && !defined(__APPLE__)
 #define SDL_PRIX64 "lX"
 #define SDL_PRIX64 "lX"
 #else
 #else
 #define SDL_PRIX64 "llX"
 #define SDL_PRIX64 "llX"
@@ -321,7 +349,9 @@ typedef uint64_t Uint64;
 #define SDL_PRINTF_FORMAT_STRING
 #define SDL_PRINTF_FORMAT_STRING
 #define SDL_SCANF_FORMAT_STRING
 #define SDL_SCANF_FORMAT_STRING
 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
+#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber )
 #define SDL_SCANF_VARARG_FUNC( fmtargnumber )
 #define SDL_SCANF_VARARG_FUNC( fmtargnumber )
+#define SDL_SCANF_VARARG_FUNCV( fmtargnumber )
 #else
 #else
 #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
 #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
 #include <sal.h>
 #include <sal.h>
@@ -347,15 +377,36 @@ typedef uint64_t Uint64;
 #endif
 #endif
 #if defined(__GNUC__)
 #if defined(__GNUC__)
 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 )))
 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 )))
+#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __printf__, fmtargnumber, 0 )))
 #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 )))
 #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 )))
+#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __scanf__, fmtargnumber, 0 )))
 #else
 #else
 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
+#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber )
 #define SDL_SCANF_VARARG_FUNC( fmtargnumber )
 #define SDL_SCANF_VARARG_FUNC( fmtargnumber )
+#define SDL_SCANF_VARARG_FUNCV( fmtargnumber )
 #endif
 #endif
 #endif /* SDL_DISABLE_ANALYZE_MACROS */
 #endif /* SDL_DISABLE_ANALYZE_MACROS */
 
 
+#ifndef SDL_COMPILE_TIME_ASSERT
+#if defined(__cplusplus)
+/* Keep C++ case alone: Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode. */
+#if (__cplusplus >= 201103L)
+#define SDL_COMPILE_TIME_ASSERT(name, x)  static_assert(x, #x)
+#endif
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
+#define SDL_COMPILE_TIME_ASSERT(name, x)  static_assert(x, #x)
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
+#define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x)
+#endif
+#endif /* !SDL_COMPILE_TIME_ASSERT */
+
+#ifndef SDL_COMPILE_TIME_ASSERT
+/* universal, but may trigger -Wunused-local-typedefs */
 #define SDL_COMPILE_TIME_ASSERT(name, x)               \
 #define SDL_COMPILE_TIME_ASSERT(name, x)               \
        typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
        typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
+#endif
+
 /** \cond */
 /** \cond */
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
 SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
 SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
@@ -377,8 +428,8 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
 
 
 /** \cond */
 /** \cond */
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
-#if !defined(__ANDROID__) && !defined(__VITA__)
-   /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
+#if !defined(__VITA__) && !defined(__3DS__)
+/* TODO: include/SDL_stdinc.h:422: error: size of array 'SDL_dummy_enum' is negative */
 typedef enum
 typedef enum
 {
 {
     DUMMY_ENUM_VALUE
     DUMMY_ENUM_VALUE
@@ -413,6 +464,16 @@ typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size);
 typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
 typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
 typedef void (SDLCALL *SDL_free_func)(void *mem);
 typedef void (SDLCALL *SDL_free_func)(void *mem);
 
 
+/**
+ * Get the original set of SDL memory functions
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func,
+                                                            SDL_calloc_func *calloc_func,
+                                                            SDL_realloc_func *realloc_func,
+                                                            SDL_free_func *free_func);
+
 /**
 /**
  * Get the current set of SDL memory functions
  * Get the current set of SDL memory functions
  *
  *
@@ -443,7 +504,9 @@ extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
 extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
 extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
 extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
 extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
 
 
-extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
+typedef int (SDLCALL *SDL_CompareCallback)(const void *, const void *);
+extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, SDL_CompareCallback compare);
+extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, SDL_CompareCallback compare);
 
 
 extern DECLSPEC int SDLCALL SDL_abs(int x);
 extern DECLSPEC int SDLCALL SDL_abs(int x);
 
 
@@ -467,20 +530,25 @@ extern DECLSPEC int SDLCALL SDL_isgraph(int x);
 extern DECLSPEC int SDLCALL SDL_toupper(int x);
 extern DECLSPEC int SDLCALL SDL_toupper(int x);
 extern DECLSPEC int SDLCALL SDL_tolower(int x);
 extern DECLSPEC int SDLCALL SDL_tolower(int x);
 
 
+extern DECLSPEC Uint16 SDLCALL SDL_crc16(Uint16 crc, const void *data, size_t len);
 extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
 extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
 
 
 extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
 extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
 
 
+/* Some safe(r) macros for zero'ing structures... */
 #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
 #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
 #define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
 #define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
 #define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
 #define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
 
 
+#define SDL_copyp(dst, src)                                                                 \
+    { SDL_COMPILE_TIME_ASSERT(SDL_copyp, sizeof (*(dst)) == sizeof (*(src))); }             \
+    SDL_memcpy((dst), (src), sizeof (*(src)))
+
+
 /* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
 /* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
 SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
 SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
 {
 {
-#ifdef __APPLE__
-    memset_pattern4(dst, &val, dwords * 4);
-#elif defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && defined(__i386__)
     int u0, u1, u2;
     int u0, u1, u2;
     __asm__ __volatile__ (
     __asm__ __volatile__ (
         "cld \n\t"
         "cld \n\t"
@@ -493,10 +561,12 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
     size_t _n = (dwords + 3) / 4;
     size_t _n = (dwords + 3) / 4;
     Uint32 *_p = SDL_static_cast(Uint32 *, dst);
     Uint32 *_p = SDL_static_cast(Uint32 *, dst);
     Uint32 _val = (val);
     Uint32 _val = (val);
-    if (dwords == 0) {
+    if (dwords == 0)
+    {
         return;
         return;
     }
     }
-    switch (dwords % 4) {
+    switch (dwords % 4)
+    {
         case 0: do {    *_p++ = _val;   SDL_FALLTHROUGH;
         case 0: do {    *_p++ = _val;   SDL_FALLTHROUGH;
         case 3:         *_p++ = _val;   SDL_FALLTHROUGH;
         case 3:         *_p++ = _val;   SDL_FALLTHROUGH;
         case 2:         *_p++ = _val;   SDL_FALLTHROUGH;
         case 2:         *_p++ = _val;   SDL_FALLTHROUGH;
@@ -533,8 +603,10 @@ extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
 extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
 extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
 extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
 extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
 extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
 extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
+extern DECLSPEC char *SDLCALL SDL_strcasestr(const char *haystack, const char *needle);
 extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
 extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
 extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
 extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
+extern DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes);
 
 
 extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
 extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
 extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
 extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
@@ -557,11 +629,11 @@ extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
 extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len);
 extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len);
 
 
 extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2);
 extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2);
-extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap);
+extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2);
 extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
 extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
-extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap);
+extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3);
 extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
 extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
-extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap);
+extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2);
 
 
 #ifndef HAVE_M_PI
 #ifndef HAVE_M_PI
 #ifndef M_PI
 #ifndef M_PI
@@ -642,8 +714,8 @@ extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
                                          size_t * outbytesleft);
                                          size_t * outbytesleft);
 
 
 /**
 /**
- * This function converts a string between encodings in one pass, returning a
- * string that must be freed with SDL_free() or NULL on error.
+ * This function converts a buffer or string between encodings in one pass,
+ * returning a string that must be freed with SDL_free() or NULL on error.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  */
  */
@@ -651,9 +723,11 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
                                                const char *fromcode,
                                                const char *fromcode,
                                                const char *inbuf,
                                                const char *inbuf,
                                                size_t inbytesleft);
                                                size_t inbytesleft);
+
+/* Some helper macros for common cases... */
 #define SDL_iconv_utf8_locale(S)    SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
 #define SDL_iconv_utf8_locale(S)    SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
-#define SDL_iconv_utf8_ucs2(S)      (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
-#define SDL_iconv_utf8_ucs4(S)      (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs2(S)      (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs4(S)      (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
 #define SDL_iconv_wchar_utf8(S)     SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t))
 #define SDL_iconv_wchar_utf8(S)     SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t))
 
 
 /* force builds using Clang's static analysis tools to use literal C runtime
 /* force builds using Clang's static analysis tools to use literal C runtime
@@ -670,6 +744,23 @@ size_t strlcpy(char* dst, const char* src, size_t size);
 size_t strlcat(char* dst, const char* src, size_t size);
 size_t strlcat(char* dst, const char* src, size_t size);
 #endif
 #endif
 
 
+#ifndef HAVE_WCSLCPY
+size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
+#endif
+
+#ifndef HAVE_WCSLCAT
+size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
+#endif
+
+/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
+char *strdup(const char *str);
+
+/* Starting LLVM 16, the analyser errors out if these functions do not have
+   their prototype defined (clang-diagnostic-implicit-function-declaration) */
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
 #define SDL_malloc malloc
 #define SDL_malloc malloc
 #define SDL_calloc calloc
 #define SDL_calloc calloc
 #define SDL_realloc realloc
 #define SDL_realloc realloc
@@ -708,6 +799,69 @@ SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_B
     return SDL_memcpy(dst, src, dwords * 4);
     return SDL_memcpy(dst, src, dwords * 4);
 }
 }
 
 
+/**
+ * If a * b would overflow, return -1.
+ *
+ * Otherwise store a * b via ret and return 0.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+SDL_FORCE_INLINE int SDL_size_mul_overflow (size_t a,
+                                            size_t b,
+                                            size_t *ret)
+{
+    if (a != 0 && b > SDL_SIZE_MAX / a)
+    {
+        return -1;
+    }
+    *ret = a * b;
+    return 0;
+}
+
+#if _SDL_HAS_BUILTIN(__builtin_mul_overflow)
+/* This needs to be wrapped in an inline rather than being a direct #define,
+ * because __builtin_mul_overflow() is type-generic, but we want to be
+ * consistent about interpreting a and b as size_t. */
+SDL_FORCE_INLINE int _SDL_size_mul_overflow_builtin (size_t a,
+                                                     size_t b,
+                                                     size_t *ret)
+{
+    return __builtin_mul_overflow(a, b, ret) == 0 ? 0 : -1;
+}
+#define SDL_size_mul_overflow(a, b, ret) (_SDL_size_mul_overflow_builtin(a, b, ret))
+#endif
+
+/**
+ * If a + b would overflow, return -1.
+ *
+ * Otherwise store a + b via ret and return 0.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+SDL_FORCE_INLINE int SDL_size_add_overflow (size_t a,
+                                            size_t b,
+                                            size_t *ret)
+{
+    if (b > SDL_SIZE_MAX - a)
+    {
+        return -1;
+    }
+    *ret = a + b;
+    return 0;
+}
+
+#if _SDL_HAS_BUILTIN(__builtin_add_overflow)
+/* This needs to be wrapped in an inline rather than being a direct #define,
+ * the same as the call to __builtin_mul_overflow() above. */
+SDL_FORCE_INLINE int _SDL_size_add_overflow_builtin (size_t a,
+                                                     size_t b,
+                                                     size_t *ret)
+{
+    return __builtin_add_overflow(a, b, ret) == 0 ? 0 : -1;
+}
+#define SDL_size_add_overflow(a, b, ret) (_SDL_size_add_overflow_builtin(a, b, ret))
+#endif
+
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
@@ -716,4 +870,4 @@ SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_B
 
 
 #endif /* SDL_stdinc_h_ */
 #endif /* SDL_stdinc_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 180 - 174
bsp/simulator/SDL2/include/SDL_surface.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_surface.h
+ * # CategorySurface
  *
  *
- *  Header file for ::SDL_Surface definition and management functions.
+ * Header file for SDL_Surface definition and management functions.
  */
  */
 
 
 #ifndef SDL_surface_h_
 #ifndef SDL_surface_h_
@@ -43,7 +43,7 @@ extern "C" {
 /**
 /**
  *  \name Surface flags
  *  \name Surface flags
  *
  *
- *  These are the currently supported flags for the ::SDL_Surface.
+ *  These are the currently supported flags for the SDL_Surface.
  *
  *
  *  \internal
  *  \internal
  *  Used internally (read-only).
  *  Used internally (read-only).
@@ -57,15 +57,17 @@ extern "C" {
 /* @} *//* Surface flags */
 /* @} *//* Surface flags */
 
 
 /**
 /**
- *  Evaluates to true if the surface needs to be locked before access.
+ * Evaluates to true if the surface needs to be locked before access.
  */
  */
 #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
 #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
 
 
+typedef struct SDL_BlitMap SDL_BlitMap;  /* this is an opaque type. */
+
 /**
 /**
- * \brief A collection of pixels used in software blitting.
+ * A collection of pixels used in software blitting.
  *
  *
- * \note  This structure should be treated as read-only, except for \c pixels,
- *        which, if not NULL, contains the raw pixel data for the surface.
+ * This structure should be treated as read-only, except for `pixels`, which,
+ * if not NULL, contains the raw pixel data for the surface.
  */
  */
 typedef struct SDL_Surface
 typedef struct SDL_Surface
 {
 {
@@ -88,22 +90,22 @@ typedef struct SDL_Surface
     SDL_Rect clip_rect;         /**< Read-only */
     SDL_Rect clip_rect;         /**< Read-only */
 
 
     /** info for fast blit mapping to other surfaces */
     /** info for fast blit mapping to other surfaces */
-    struct SDL_BlitMap *map;    /**< Private */
+    SDL_BlitMap *map;           /**< Private */
 
 
     /** Reference count -- used when freeing surface */
     /** Reference count -- used when freeing surface */
     int refcount;               /**< Read-mostly */
     int refcount;               /**< Read-mostly */
 } SDL_Surface;
 } SDL_Surface;
 
 
 /**
 /**
- * \brief The type of function used for surface blitting functions.
+ * The type of function used for surface blitting functions.
  */
  */
 typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
 typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
                                  struct SDL_Surface * dst, SDL_Rect * dstrect);
                                  struct SDL_Surface * dst, SDL_Rect * dstrect);
 
 
 /**
 /**
- * \brief The formula used for converting between YUV and RGB
+ * The formula used for converting between YUV and RGB
  */
  */
-typedef enum
+typedef enum SDL_YUV_CONVERSION_MODE
 {
 {
     SDL_YUV_CONVERSION_JPEG,        /**< Full range JPEG */
     SDL_YUV_CONVERSION_JPEG,        /**< Full range JPEG */
     SDL_YUV_CONVERSION_BT601,       /**< BT.601 (the default) */
     SDL_YUV_CONVERSION_BT601,       /**< BT.601 (the default) */
@@ -138,14 +140,14 @@ typedef enum
  * You can change this by calling SDL_SetSurfaceBlendMode() and selecting a
  * You can change this by calling SDL_SetSurfaceBlendMode() and selecting a
  * different `blendMode`.
  * different `blendMode`.
  *
  *
- * \param flags the flags are unused and should be set to 0
- * \param width the width of the surface
- * \param height the height of the surface
- * \param depth the depth of the surface in bits
- * \param Rmask the red mask for the pixels
- * \param Gmask the green mask for the pixels
- * \param Bmask the blue mask for the pixels
- * \param Amask the alpha mask for the pixels
+ * \param flags the flags are unused and should be set to 0.
+ * \param width the width of the surface.
+ * \param height the height of the surface.
+ * \param depth the depth of the surface in bits.
+ * \param Rmask the red mask for the pixels.
+ * \param Gmask the green mask for the pixels.
+ * \param Bmask the blue mask for the pixels.
+ * \param Amask the alpha mask for the pixels.
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
  *
  *
@@ -169,10 +171,10 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
  * of providing pixel color masks, you provide it with a predefined format
  * of providing pixel color masks, you provide it with a predefined format
  * from SDL_PixelFormatEnum.
  * from SDL_PixelFormatEnum.
  *
  *
- * \param flags the flags are unused and should be set to 0
- * \param width the width of the surface
- * \param height the height of the surface
- * \param depth the depth of the surface in bits
+ * \param flags the flags are unused and should be set to 0.
+ * \param width the width of the surface.
+ * \param height the height of the surface.
+ * \param depth the depth of the surface in bits.
  * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
  * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
@@ -196,15 +198,15 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
  * No copy is made of the pixel data. Pixel data is not managed automatically;
  * No copy is made of the pixel data. Pixel data is not managed automatically;
  * you must free the surface before you free the pixel data.
  * you must free the surface before you free the pixel data.
  *
  *
- * \param pixels a pointer to existing pixel data
- * \param width the width of the surface
- * \param height the height of the surface
- * \param depth the depth of the surface in bits
- * \param pitch the pitch of the surface in bytes
- * \param Rmask the red mask for the pixels
- * \param Gmask the green mask for the pixels
- * \param Bmask the blue mask for the pixels
- * \param Amask the alpha mask for the pixels
+ * \param pixels a pointer to existing pixel data.
+ * \param width the width of the surface.
+ * \param height the height of the surface.
+ * \param depth the depth of the surface in bits.
+ * \param pitch the pitch of the surface in bytes.
+ * \param Rmask the red mask for the pixels.
+ * \param Gmask the green mask for the pixels.
+ * \param Bmask the blue mask for the pixels.
+ * \param Amask the alpha mask for the pixels.
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
  *
  *
@@ -212,6 +214,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
  *
  *
  * \sa SDL_CreateRGBSurface
  * \sa SDL_CreateRGBSurface
  * \sa SDL_CreateRGBSurfaceWithFormat
  * \sa SDL_CreateRGBSurfaceWithFormat
+ * \sa SDL_CreateRGBSurfaceWithFormatFrom
  * \sa SDL_FreeSurface
  * \sa SDL_FreeSurface
  */
  */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
@@ -237,11 +240,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
  * No copy is made of the pixel data. Pixel data is not managed automatically;
  * No copy is made of the pixel data. Pixel data is not managed automatically;
  * you must free the surface before you free the pixel data.
  * you must free the surface before you free the pixel data.
  *
  *
- * \param pixels a pointer to existing pixel data
- * \param width the width of the surface
- * \param height the height of the surface
- * \param depth the depth of the surface in bits
- * \param pitch the pitch of the surface in bytes
+ * \param pixels a pointer to existing pixel data.
+ * \param width the width of the surface.
+ * \param height the height of the surface.
+ * \param depth the depth of the surface in bits.
+ * \param pitch the pitch of the surface in bytes.
  * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
  * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
@@ -276,8 +279,8 @@ extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
  *
  *
  * A single palette can be shared with many surfaces.
  * A single palette can be shared with many surfaces.
  *
  *
- * \param surface the SDL_Surface structure to update
- * \param palette the SDL_Palette structure to use
+ * \param surface the SDL_Surface structure to update.
+ * \param palette the SDL_Palette structure to use.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -298,7 +301,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
  * 0, then you can read and write to the surface at any time, and the pixel
  * 0, then you can read and write to the surface at any time, and the pixel
  * format of the surface will not change.
  * format of the surface will not change.
  *
  *
- * \param surface the SDL_Surface structure to be locked
+ * \param surface the SDL_Surface structure to be locked.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -312,7 +315,7 @@ extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
 /**
 /**
  * Release a surface after directly accessing the pixels.
  * Release a surface after directly accessing the pixels.
  *
  *
- * \param surface the SDL_Surface structure to be unlocked
+ * \param surface the SDL_Surface structure to be unlocked.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -327,11 +330,11 @@ extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
  * result in a memory leak.
  * result in a memory leak.
  *
  *
  * src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile.
  * src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile.
- * Alternitavely, you might also use the macro SDL_LoadBMP to load a bitmap
+ * Alternatively, you might also use the macro SDL_LoadBMP to load a bitmap
  * from a file, convert it to an SDL_Surface and then close the file.
  * from a file, convert it to an SDL_Surface and then close the file.
  *
  *
- * \param src the data stream for the surface
- * \param freesrc non-zero to close the stream after being read
+ * \param src the data stream for the surface.
+ * \param freesrc non-zero to close the stream after being read.
  * \returns a pointer to a new SDL_Surface structure or NULL if there was an
  * \returns a pointer to a new SDL_Surface structure or NULL if there was an
  *          error; call SDL_GetError() for more information.
  *          error; call SDL_GetError() for more information.
  *
  *
@@ -361,9 +364,9 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
  * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
  * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
  * not supported.
  * not supported.
  *
  *
- * \param surface the SDL_Surface structure containing the image to be saved
- * \param dst a data stream to save to
- * \param freedst non-zero to close the stream after being written
+ * \param surface the SDL_Surface structure containing the image to be saved.
+ * \param dst a data stream to save to.
+ * \param freedst non-zero to close the stream after being written.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -376,9 +379,9 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
     (SDL_Surface * surface, SDL_RWops * dst, int freedst);
     (SDL_Surface * surface, SDL_RWops * dst, int freedst);
 
 
 /**
 /**
- *  Save a surface to a file.
+ * Save a surface to a file.
  *
  *
- *  Convenience macro.
+ * Convenience macro.
  */
  */
 #define SDL_SaveBMP(surface, file) \
 #define SDL_SaveBMP(surface, file) \
         SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
         SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
@@ -389,8 +392,8 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
  * If RLE is enabled, color key and alpha blending blits are much faster, but
  * If RLE is enabled, color key and alpha blending blits are much faster, but
  * the surface must be locked before directly accessing the pixels.
  * the surface must be locked before directly accessing the pixels.
  *
  *
- * \param surface the SDL_Surface structure to optimize
- * \param flag 0 to disable, non-zero to enable RLE acceleration
+ * \param surface the SDL_Surface structure to optimize.
+ * \param flag 0 to disable, non-zero to enable RLE acceleration.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -408,7 +411,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
  *
  *
  * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
  * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
  *
  *
- * \param surface the SDL_Surface structure to query
+ * \param surface the SDL_Surface structure to query.
  * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
  * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.14.
  * \since This function is available since SDL 2.0.14.
@@ -430,9 +433,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface);
  * RLE acceleration can substantially speed up blitting of images with large
  * RLE acceleration can substantially speed up blitting of images with large
  * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details.
  * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details.
  *
  *
- * \param surface the SDL_Surface structure to update
- * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key
- * \param key the transparent pixel
+ * \param surface the SDL_Surface structure to update.
+ * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key.
+ * \param key the transparent pixel.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -449,7 +452,7 @@ extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
  *
  *
  * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
  * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
  *
  *
- * \param surface the SDL_Surface structure to query
+ * \param surface the SDL_Surface structure to query.
  * \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
  * \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
  *
  *
  * \since This function is available since SDL 2.0.9.
  * \since This function is available since SDL 2.0.9.
@@ -467,8 +470,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
  *
  *
  * If the surface doesn't have color key enabled this function returns -1.
  * If the surface doesn't have color key enabled this function returns -1.
  *
  *
- * \param surface the SDL_Surface structure to query
- * \param key a pointer filled in with the transparent pixel
+ * \param surface the SDL_Surface structure to query.
+ * \param key a pointer filled in with the transparent pixel.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -489,10 +492,10 @@ extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
  *
  *
  * `srcC = srcC * (color / 255)`
  * `srcC = srcC * (color / 255)`
  *
  *
- * \param surface the SDL_Surface structure to update
- * \param r the red color value multiplied into blit operations
- * \param g the green color value multiplied into blit operations
- * \param b the blue color value multiplied into blit operations
+ * \param surface the SDL_Surface structure to update.
+ * \param r the red color value multiplied into blit operations.
+ * \param g the green color value multiplied into blit operations.
+ * \param b the blue color value multiplied into blit operations.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -508,10 +511,10 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
 /**
 /**
  * Get the additional color value multiplied into blit operations.
  * Get the additional color value multiplied into blit operations.
  *
  *
- * \param surface the SDL_Surface structure to query
- * \param r a pointer filled in with the current red color value
- * \param g a pointer filled in with the current green color value
- * \param b a pointer filled in with the current blue color value
+ * \param surface the SDL_Surface structure to query.
+ * \param r a pointer filled in with the current red color value.
+ * \param g a pointer filled in with the current green color value.
+ * \param b a pointer filled in with the current blue color value.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -532,8 +535,8 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
  *
  *
  * `srcA = srcA * (alpha / 255)`
  * `srcA = srcA * (alpha / 255)`
  *
  *
- * \param surface the SDL_Surface structure to update
- * \param alpha the alpha value multiplied into blit operations
+ * \param surface the SDL_Surface structure to update.
+ * \param alpha the alpha value multiplied into blit operations.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -548,8 +551,8 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
 /**
 /**
  * Get the additional alpha value used in blit operations.
  * Get the additional alpha value used in blit operations.
  *
  *
- * \param surface the SDL_Surface structure to query
- * \param alpha a pointer filled in with the current alpha value
+ * \param surface the SDL_Surface structure to query.
+ * \param alpha a pointer filled in with the current alpha value.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -568,8 +571,8 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
  * existing data, the blendmode of the SOURCE surface should be set to
  * existing data, the blendmode of the SOURCE surface should be set to
  * `SDL_BLENDMODE_NONE`.
  * `SDL_BLENDMODE_NONE`.
  *
  *
- * \param surface the SDL_Surface structure to update
- * \param blendMode the SDL_BlendMode to use for blit blending
+ * \param surface the SDL_Surface structure to update.
+ * \param blendMode the SDL_BlendMode to use for blit blending.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -583,8 +586,8 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
 /**
 /**
  * Get the blend mode used for blit operations.
  * Get the blend mode used for blit operations.
  *
  *
- * \param surface the SDL_Surface structure to query
- * \param blendMode a pointer filled in with the current SDL_BlendMode
+ * \param surface the SDL_Surface structure to query.
+ * \param blendMode a pointer filled in with the current SDL_BlendMode.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -604,9 +607,9 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
  * Note that blits are automatically clipped to the edges of the source and
  * Note that blits are automatically clipped to the edges of the source and
  * destination surfaces.
  * destination surfaces.
  *
  *
- * \param surface the SDL_Surface structure to be clipped
+ * \param surface the SDL_Surface structure to be clipped.
  * \param rect the SDL_Rect structure representing the clipping rectangle, or
  * \param rect the SDL_Rect structure representing the clipping rectangle, or
- *             NULL to disable clipping
+ *             NULL to disable clipping.
  * \returns SDL_TRUE if the rectangle intersects the surface, otherwise
  * \returns SDL_TRUE if the rectangle intersects the surface, otherwise
  *          SDL_FALSE and blits will be completely clipped.
  *          SDL_FALSE and blits will be completely clipped.
  *
  *
@@ -625,9 +628,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
  * rectangle is drawn into.
  * rectangle is drawn into.
  *
  *
  * \param surface the SDL_Surface structure representing the surface to be
  * \param surface the SDL_Surface structure representing the surface to be
- *                clipped
+ *                clipped.
  * \param rect an SDL_Rect structure filled in with the clipping rectangle for
  * \param rect an SDL_Rect structure filled in with the clipping rectangle for
- *             the surface
+ *             the surface.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -656,11 +659,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface)
  * surface. The new, optimized surface can then be used as the source for
  * surface. The new, optimized surface can then be used as the source for
  * future blits, making them faster.
  * future blits, making them faster.
  *
  *
- * \param src the existing SDL_Surface structure to convert
+ * \param src the existing SDL_Surface structure to convert.
  * \param fmt the SDL_PixelFormat structure that the new surface is optimized
  * \param fmt the SDL_PixelFormat structure that the new surface is optimized
- *            for
+ *            for.
  * \param flags the flags are unused and should be set to 0; this is a
  * \param flags the flags are unused and should be set to 0; this is a
- *              leftover from SDL 1.2's API
+ *              leftover from SDL 1.2's API.
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
  *
  *
@@ -681,11 +684,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
  * it might be easier to call but it doesn't have access to palette
  * it might be easier to call but it doesn't have access to palette
  * information for the destination surface, in case that would be important.
  * information for the destination surface, in case that would be important.
  *
  *
- * \param src the existing SDL_Surface structure to convert
+ * \param src the existing SDL_Surface structure to convert.
  * \param pixel_format the SDL_PixelFormatEnum that the new surface is
  * \param pixel_format the SDL_PixelFormatEnum that the new surface is
- *                     optimized for
+ *                     optimized for.
  * \param flags the flags are unused and should be set to 0; this is a
  * \param flags the flags are unused and should be set to 0; this is a
- *              leftover from SDL 1.2's API
+ *              leftover from SDL 1.2's API.
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  * \returns the new SDL_Surface structure that is created or NULL if it fails;
  *          call SDL_GetError() for more information.
  *          call SDL_GetError() for more information.
  *
  *
@@ -701,14 +704,14 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
 /**
 /**
  * Copy a block of pixels of one format to another format.
  * Copy a block of pixels of one format to another format.
  *
  *
- * \param width the width of the block to copy, in pixels
- * \param height the height of the block to copy, in pixels
- * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
- * \param src a pointer to the source pixels
- * \param src_pitch the pitch of the source pixels, in bytes
- * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
- * \param dst a pointer to be filled in with new pixel data
- * \param dst_pitch the pitch of the destination pixels, in bytes
+ * \param width the width of the block to copy, in pixels.
+ * \param height the height of the block to copy, in pixels.
+ * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format.
+ * \param src a pointer to the source pixels.
+ * \param src_pitch the pitch of the source pixels, in bytes.
+ * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format.
+ * \param dst a pointer to be filled in with new pixel data.
+ * \param dst_pitch the pitch of the destination pixels, in bytes.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -727,14 +730,14 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
  *
  *
  * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.
  * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.
  *
  *
- * \param width the width of the block to convert, in pixels
- * \param height the height of the block to convert, in pixels
- * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
- * \param src a pointer to the source pixels
- * \param src_pitch the pitch of the source pixels, in bytes
- * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
- * \param dst a pointer to be filled in with premultiplied pixel data
- * \param dst_pitch the pitch of the destination pixels, in bytes
+ * \param width the width of the block to convert, in pixels.
+ * \param height the height of the block to convert, in pixels.
+ * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format.
+ * \param src a pointer to the source pixels.
+ * \param src_pitch the pitch of the source pixels, in bytes.
+ * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format.
+ * \param dst a pointer to be filled in with premultiplied pixel data.
+ * \param dst_pitch the pitch of the destination pixels, in bytes.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -758,10 +761,10 @@ extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height,
  * SDL_SetClipRect()), then this function will fill based on the intersection
  * SDL_SetClipRect()), then this function will fill based on the intersection
  * of the clip rectangle and `rect`.
  * of the clip rectangle and `rect`.
  *
  *
- * \param dst the SDL_Surface structure that is the drawing target
+ * \param dst the SDL_Surface structure that is the drawing target.
  * \param rect the SDL_Rect structure representing the rectangle to fill, or
  * \param rect the SDL_Rect structure representing the rectangle to fill, or
- *             NULL to fill the entire surface
- * \param color the color to fill with
+ *             NULL to fill the entire surface.
+ * \param color the color to fill with.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -784,10 +787,10 @@ extern DECLSPEC int SDLCALL SDL_FillRect
  * SDL_SetClipRect()), then this function will fill based on the intersection
  * SDL_SetClipRect()), then this function will fill based on the intersection
  * of the clip rectangle and `rect`.
  * of the clip rectangle and `rect`.
  *
  *
- * \param dst the SDL_Surface structure that is the drawing target
- * \param rects an array of SDL_Rects representing the rectangles to fill.
- * \param count the number of rectangles in the array
- * \param color the color to fill with
+ * \param dst the SDL_Surface structure that is the drawing target.
+ * \param rects an array of SDL_Rect representing the rectangles to fill.
+ * \param count the number of rectangles in the array.
+ * \param color the color to fill with.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -799,62 +802,64 @@ extern DECLSPEC int SDLCALL SDL_FillRects
     (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
     (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
 
 
 /* !!! FIXME: merge this documentation with the wiki */
 /* !!! FIXME: merge this documentation with the wiki */
+
 /**
 /**
- *  Performs a fast blit from the source surface to the destination surface.
- *
- *  This assumes that the source and destination rectangles are
- *  the same size.  If either \c srcrect or \c dstrect are NULL, the entire
- *  surface (\c src or \c dst) is copied.  The final blit rectangles are saved
- *  in \c srcrect and \c dstrect after all clipping is performed.
- *
- *  \returns 0 if the blit is successful, otherwise it returns -1.
- *
- *  The blit function should not be called on a locked surface.
- *
- *  The blit semantics for surfaces with and without blending and colorkey
- *  are defined as follows:
- *  \verbatim
-    RGBA->RGB:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source alpha-channel and per-surface alpha)
-        SDL_SRCCOLORKEY ignored.
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB.
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        RGB values of the source color key, ignoring alpha in the
-        comparison.
-
-    RGB->RGBA:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source per-surface alpha)
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB, set destination alpha to source per-surface alpha value.
-      both:
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        source color key.
-
-    RGBA->RGBA:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source alpha-channel and per-surface alpha)
-        SDL_SRCCOLORKEY ignored.
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy all of RGBA to the destination.
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        RGB values of the source color key, ignoring alpha in the
-        comparison.
-
-    RGB->RGB:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source per-surface alpha)
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB.
-      both:
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        source color key.
-    \endverbatim
- *
- *  You should call SDL_BlitSurface() unless you know exactly how SDL
- *  blitting works internally and how to use the other blit functions.
+ * Performs a fast blit from the source surface to the destination surface.
+ *
+ * This assumes that the source and destination rectangles are the same size.
+ * If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
+ * `dst`) is copied. The final blit rectangle is saved in `dstrect` after
+ * all clipping is performed.
+ *
+ * The blit function should not be called on a locked surface.
+ *
+ * The blit semantics for surfaces with and without blending and colorkey are
+ * defined as follows:
+ *
+ * ```
+ *   RGBA->RGB:
+ *     Source surface blend mode set to SDL_BLENDMODE_BLEND:
+ *       alpha-blend (using the source alpha-channel and per-surface alpha)
+ *       SDL_SRCCOLORKEY ignored.
+ *     Source surface blend mode set to SDL_BLENDMODE_NONE:
+ *       copy RGB.
+ *       if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *       RGB values of the source color key, ignoring alpha in the
+ *       comparison.
+ *
+ *   RGB->RGBA:
+ *     Source surface blend mode set to SDL_BLENDMODE_BLEND:
+ *       alpha-blend (using the source per-surface alpha)
+ *     Source surface blend mode set to SDL_BLENDMODE_NONE:
+ *       copy RGB, set destination alpha to source per-surface alpha value.
+ *     both:
+ *       if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *       source color key.
+ *
+ *   RGBA->RGBA:
+ *     Source surface blend mode set to SDL_BLENDMODE_BLEND:
+ *       alpha-blend (using the source alpha-channel and per-surface alpha)
+ *       SDL_SRCCOLORKEY ignored.
+ *     Source surface blend mode set to SDL_BLENDMODE_NONE:
+ *       copy all of RGBA to the destination.
+ *       if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *       RGB values of the source color key, ignoring alpha in the
+ *       comparison.
+ *
+ *   RGB->RGB:
+ *     Source surface blend mode set to SDL_BLENDMODE_BLEND:
+ *       alpha-blend (using the source per-surface alpha)
+ *     Source surface blend mode set to SDL_BLENDMODE_NONE:
+ *       copy RGB.
+ *     both:
+ *       if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *       source color key.
+ * ```
+ *
+ * You should call SDL_BlitSurface() unless you know exactly how SDL blitting
+ * works internally and how to use the other blit functions.
+ *
+ * \returns 0 if the blit is successful, otherwise it returns -1.
  */
  */
 #define SDL_BlitSurface SDL_UpperBlit
 #define SDL_BlitSurface SDL_UpperBlit
 
 
@@ -881,12 +886,12 @@ extern DECLSPEC int SDLCALL SDL_UpperBlit
  * Unless you know what you're doing, you should be using SDL_BlitSurface()
  * Unless you know what you're doing, you should be using SDL_BlitSurface()
  * instead.
  * instead.
  *
  *
- * \param src the SDL_Surface structure to be copied from
+ * \param src the SDL_Surface structure to be copied from.
  * \param srcrect the SDL_Rect structure representing the rectangle to be
  * \param srcrect the SDL_Rect structure representing the rectangle to be
- *                copied, or NULL to copy the entire surface
- * \param dst the SDL_Surface structure that is the blit target
+ *                copied, or NULL to copy the entire surface.
+ * \param dst the SDL_Surface structure that is the blit target.
  * \param dstrect the SDL_Rect structure representing the rectangle that is
  * \param dstrect the SDL_Rect structure representing the rectangle that is
- *                copied into
+ *                copied into.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -923,8 +928,6 @@ extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src,
                                             const SDL_Rect * dstrect);
                                             const SDL_Rect * dstrect);
 
 
 
 
-#define SDL_BlitScaled SDL_UpperBlitScaled
-
 /**
 /**
  * Perform a scaled surface copy to a destination surface.
  * Perform a scaled surface copy to a destination surface.
  *
  *
@@ -939,18 +942,21 @@ extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
     (SDL_Surface * src, const SDL_Rect * srcrect,
     (SDL_Surface * src, const SDL_Rect * srcrect,
     SDL_Surface * dst, SDL_Rect * dstrect);
     SDL_Surface * dst, SDL_Rect * dstrect);
 
 
+#define SDL_BlitScaled SDL_UpperBlitScaled
+
+
 /**
 /**
  * Perform low-level surface scaled blitting only.
  * Perform low-level surface scaled blitting only.
  *
  *
  * This is a semi-private function and it performs low-level surface blitting,
  * This is a semi-private function and it performs low-level surface blitting,
  * assuming the input rectangles have already been clipped.
  * assuming the input rectangles have already been clipped.
  *
  *
- * \param src the SDL_Surface structure to be copied from
+ * \param src the SDL_Surface structure to be copied from.
  * \param srcrect the SDL_Rect structure representing the rectangle to be
  * \param srcrect the SDL_Rect structure representing the rectangle to be
- *                copied
- * \param dst the SDL_Surface structure that is the blit target
+ *                copied.
+ * \param dst the SDL_Surface structure that is the blit target.
  * \param dstrect the SDL_Rect structure representing the rectangle that is
  * \param dstrect the SDL_Rect structure representing the rectangle that is
- *                copied into
+ *                copied into.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -992,4 +998,4 @@ extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResol
 
 
 #endif /* SDL_surface_h_ */
 #endif /* SDL_surface_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 115 - 36
bsp/simulator/SDL2/include/SDL_system.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_system.h
+ * # CategorySystem
  *
  *
- *  Include file for platform specific SDL API functions
+ * Include file for platform specific SDL API functions
  */
  */
 
 
 #ifndef SDL_system_h_
 #ifndef SDL_system_h_
@@ -41,7 +41,7 @@ extern "C" {
 
 
 
 
 /* Platform specific functions for Windows */
 /* Platform specific functions for Windows */
-#ifdef __WIN32__
+#if defined(__WIN32__) || defined(__GDK__)
 
 
 typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
 typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
 
 
@@ -49,12 +49,16 @@ typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsi
  * Set a callback for every Windows message, run before TranslateMessage().
  * Set a callback for every Windows message, run before TranslateMessage().
  *
  *
  * \param callback The SDL_WindowsMessageHook function to call.
  * \param callback The SDL_WindowsMessageHook function to call.
- * \param userdata a pointer to pass to every iteration of `callback`
+ * \param userdata a pointer to pass to every iteration of `callback`.
  *
  *
  * \since This function is available since SDL 2.0.4.
  * \since This function is available since SDL 2.0.4.
  */
  */
 extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
 extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
 
 
+#endif /* defined(__WIN32__) || defined(__GDK__) */
+
+#if defined(__WIN32__) || defined(__WINGDK__)
+
 /**
 /**
  * Get the D3D9 adapter index that matches the specified display index.
  * Get the D3D9 adapter index that matches the specified display index.
  *
  *
@@ -62,7 +66,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook ca
  * controls on which monitor a full screen application will appear.
  * controls on which monitor a full screen application will appear.
  *
  *
  * \param displayIndex the display index for which to get the D3D9 adapter
  * \param displayIndex the display index for which to get the D3D9 adapter
- *                     index
+ *                     index.
  * \returns the D3D9 adapter index on success or a negative error code on
  * \returns the D3D9 adapter index on success or a negative error code on
  *          failure; call SDL_GetError() for more information.
  *          failure; call SDL_GetError() for more information.
  *
  *
@@ -78,7 +82,7 @@ typedef struct IDirect3DDevice9 IDirect3DDevice9;
  * Once you are done using the device, you should release it to avoid a
  * Once you are done using the device, you should release it to avoid a
  * resource leak.
  * resource leak.
  *
  *
- * \param renderer the renderer from which to get the associated D3D device
+ * \param renderer the renderer from which to get the associated D3D device.
  * \returns the D3D9 device associated with given renderer or NULL if it is
  * \returns the D3D9 device associated with given renderer or NULL if it is
  *          not a D3D9 renderer; call SDL_GetError() for more information.
  *          not a D3D9 renderer; call SDL_GetError() for more information.
  *
  *
@@ -94,7 +98,7 @@ typedef struct ID3D11Device ID3D11Device;
  * Once you are done using the device, you should release it to avoid a
  * Once you are done using the device, you should release it to avoid a
  * resource leak.
  * resource leak.
  *
  *
- * \param renderer the renderer from which to get the associated D3D11 device
+ * \param renderer the renderer from which to get the associated D3D11 device.
  * \returns the D3D11 device associated with given renderer or NULL if it is
  * \returns the D3D11 device associated with given renderer or NULL if it is
  *          not a D3D11 renderer; call SDL_GetError() for more information.
  *          not a D3D11 renderer; call SDL_GetError() for more information.
  *
  *
@@ -102,6 +106,30 @@ typedef struct ID3D11Device ID3D11Device;
  */
  */
 extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
 extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
 
 
+#endif /* defined(__WIN32__) || defined(__WINGDK__) */
+
+#if defined(__WIN32__) || defined(__GDK__)
+
+typedef struct ID3D12Device ID3D12Device;
+
+/**
+ * Get the D3D12 device associated with a renderer.
+ *
+ * Once you are done using the device, you should release it to avoid a
+ * resource leak.
+ *
+ * \param renderer the renderer from which to get the associated D3D12 device.
+ * \returns the D3D12 device associated with given renderer or NULL if it is
+ *          not a D3D12 renderer; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer);
+
+#endif /* defined(__WIN32__) || defined(__GDK__) */
+
+#if defined(__WIN32__) || defined(__WINGDK__)
+
 /**
 /**
  * Get the DXGI Adapter and Output indices for the specified display index.
  * Get the DXGI Adapter and Output indices for the specified display index.
  *
  *
@@ -112,9 +140,9 @@ extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * re
  * Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it
  * Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it
  * returns an SDL_bool.
  * returns an SDL_bool.
  *
  *
- * \param displayIndex the display index for which to get both indices
- * \param adapterIndex a pointer to be filled in with the adapter index
- * \param outputIndex a pointer to be filled in with the output index
+ * \param displayIndex the display index for which to get both indices.
+ * \param adapterIndex a pointer to be filled in with the adapter index.
+ * \param outputIndex a pointer to be filled in with the output index.
  * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
  * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
  *          for more information.
  *          for more information.
  *
  *
@@ -122,8 +150,7 @@ extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * re
  */
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
 extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
 
 
-#endif /* __WIN32__ */
-
+#endif /* defined(__WIN32__) || defined(__WINGDK__) */
 
 
 /* Platform specific functions for Linux */
 /* Platform specific functions for Linux */
 #ifdef __LINUX__
 #ifdef __LINUX__
@@ -149,7 +176,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio
  * \param threadID The Unix thread ID to change priority of.
  * \param threadID The Unix thread ID to change priority of.
  * \param sdlPriority The new SDL_ThreadPriority value.
  * \param sdlPriority The new SDL_ThreadPriority value.
  * \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR,
  * \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR,
- *                    SCHED_OTHER, etc...)
+ *                    SCHED_OTHER, etc...).
  * \returns 0 on success, or -1 on error.
  * \returns 0 on success, or -1 on error.
  *
  *
  * \since This function is available since SDL 2.0.18.
  * \since This function is available since SDL 2.0.18.
@@ -161,7 +188,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
 /* Platform specific functions for iOS */
 /* Platform specific functions for iOS */
 #ifdef __IPHONEOS__
 #ifdef __IPHONEOS__
 
 
-#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
+typedef void (SDLCALL *SDL_iOSAnimationCallback)(void*);
 
 
 /**
 /**
  * Use this function to set the animation callback on Apple iOS.
  * Use this function to set the animation callback on Apple iOS.
@@ -178,14 +205,14 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
  * This function is only available on Apple iOS.
  * This function is only available on Apple iOS.
  *
  *
  * For more information see:
  * For more information see:
- * [README-ios.md](https://hg.libsdl.org/SDL/file/default/docs/README-ios.md)
+ * https://github.com/libsdl-org/SDL/blob/main/docs/README-ios.md
  *
  *
  * This functions is also accessible using the macro
  * This functions is also accessible using the macro
  * SDL_iOSSetAnimationCallback() since SDL 2.0.4.
  * SDL_iOSSetAnimationCallback() since SDL 2.0.4.
  *
  *
- * \param window the window for which the animation callback should be set
+ * \param window the window for which the animation callback should be set.
  * \param interval the number of frames after which **callback** will be
  * \param interval the number of frames after which **callback** will be
- *                 called
+ *                 called.
  * \param callback the function to call for every frame.
  * \param callback the function to call for every frame.
  * \param callbackParam a pointer that is passed to `callback`.
  * \param callbackParam a pointer that is passed to `callback`.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
@@ -195,9 +222,10 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
  *
  *
  * \sa SDL_iPhoneSetEventPump
  * \sa SDL_iPhoneSetEventPump
  */
  */
-extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
+extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
+
+#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
 
 
-#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
 
 
 /**
 /**
  * Use this function to enable or disable the SDL event pump on Apple iOS.
  * Use this function to enable or disable the SDL event pump on Apple iOS.
@@ -207,7 +235,7 @@ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window,
  * This functions is also accessible using the macro SDL_iOSSetEventPump()
  * This functions is also accessible using the macro SDL_iOSSetEventPump()
  * since SDL 2.0.4.
  * since SDL 2.0.4.
  *
  *
- * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it
+ * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -215,6 +243,9 @@ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window,
  */
  */
 extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
 extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
 
 
+#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
+
+/* end of iOS-specific functions. */
 #endif /* __IPHONEOS__ */
 #endif /* __IPHONEOS__ */
 
 
 
 
@@ -329,9 +360,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
 extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
 extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
 
 
 /**
 /**
-   See the official Android developer guide for more information:
-   http://developer.android.com/guide/topics/data/data-storage.html
-*/
+ * See the official Android developer guide for more information:
+ * http://developer.android.com/guide/topics/data/data-storage.html
+ */
 #define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
 #define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
 
 
@@ -414,26 +445,38 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permis
  *
  *
  * https://developer.android.com/reference/android/view/Gravity
  * https://developer.android.com/reference/android/view/Gravity
  *
  *
- * \param message text message to be shown
- * \param duration 0=short, 1=long
+ * \param message text message to be shown.
+ * \param duration 0=short, 1=long.
  * \param gravity where the notification should appear on the screen.
  * \param gravity where the notification should appear on the screen.
- * \param xoffset set this parameter only when gravity >=0
- * \param yoffset set this parameter only when gravity >=0
+ * \param xoffset set this parameter only when gravity >=0.
+ * \param yoffset set this parameter only when gravity >=0.
  * \returns 0 if success, -1 if any error occurs.
  * \returns 0 if success, -1 if any error occurs.
  *
  *
  * \since This function is available since SDL 2.0.16.
  * \since This function is available since SDL 2.0.16.
  */
  */
 extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
 extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
 
 
+/**
+ * Send a user command to SDLActivity.
+ *
+ * Override "boolean onUnhandledMessage(Message msg)" to handle the message.
+ *
+ * \param command user command that must be greater or equal to 0x8000.
+ * \param param user parameter.
+ *
+ * \since This function is available since SDL 2.0.22.
+ */
+extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
+
 #endif /* __ANDROID__ */
 #endif /* __ANDROID__ */
 
 
 /* Platform specific functions for WinRT */
 /* Platform specific functions for WinRT */
 #ifdef __WINRT__
 #ifdef __WINRT__
 
 
 /**
 /**
- *  \brief WinRT / Windows Phone path types
+ * WinRT / Windows Phone path types
  */
  */
-typedef enum
+typedef enum SDL_WinRT_Path
 {
 {
     /** \brief The installed app's root directory.
     /** \brief The installed app's root directory.
         Files here are likely to be read-only. */
         Files here are likely to be read-only. */
@@ -455,9 +498,9 @@ typedef enum
 
 
 
 
 /**
 /**
- *  \brief WinRT Device Family
+ * WinRT Device Family
  */
  */
-typedef enum
+typedef enum SDL_WinRT_DeviceFamily
 {
 {
     /** \brief Unknown family  */
     /** \brief Unknown family  */
     SDL_WINRT_DEVICEFAMILY_UNKNOWN,
     SDL_WINRT_DEVICEFAMILY_UNKNOWN,
@@ -485,7 +528,7 @@ typedef enum
  *
  *
  * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
  * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
  *
  *
- * \param pathType the type of path to retrieve, one of SDL_WinRT_Path
+ * \param pathType the type of path to retrieve, one of SDL_WinRT_Path.
  * \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if
  * \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if
  *          the path is not available for any reason; call SDL_GetError() for
  *          the path is not available for any reason; call SDL_GetError() for
  *          more information.
  *          more information.
@@ -508,7 +551,7 @@ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path
  *
  *
  * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
  * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
  *
  *
- * \param pathType the type of path to retrieve, one of SDL_WinRT_Path
+ * \param pathType the type of path to retrieve, one of SDL_WinRT_Path.
  * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
  * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
  *          the path is not available for any reason; call SDL_GetError() for
  *          the path is not available for any reason; call SDL_GetError() for
  *          more information.
  *          more information.
@@ -520,7 +563,7 @@ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path
 extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
 extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
 
 
 /**
 /**
- * Detects the device family of WinRT plattform at runtime.
+ * Detects the device family of WinRT platform at runtime.
  *
  *
  * \returns a value from the SDL_WinRT_DeviceFamily enum.
  * \returns a value from the SDL_WinRT_DeviceFamily enum.
  *
  *
@@ -552,6 +595,42 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
 extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
 extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
 #endif
 #endif
 
 
+/* Functions used only by GDK */
+#if defined(__GDK__)
+typedef struct XTaskQueueObject *XTaskQueueHandle;
+typedef struct XUser *XUserHandle;
+
+/**
+ * Gets a reference to the global async task queue handle for GDK,
+ * initializing if needed.
+ *
+ * Once you are done with the task queue, you should call
+ * XTaskQueueCloseHandle to reduce the reference count to avoid a resource
+ * leak.
+ *
+ * \param outTaskQueue a pointer to be filled in with task queue handle.
+ * \returns 0 if success, -1 if any error occurs.
+ *
+ * \since This function is available since SDL 2.24.0.
+ */
+extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue);
+
+/**
+ * Gets a reference to the default user handle for GDK.
+ *
+ * This is effectively a synchronous version of XUserAddAsync, which always
+ * prefers the default user and allows a sign-in UI.
+ *
+ * \param outUserHandle a pointer to be filled in with the default user
+ *                      handle.
+ * \returns 0 if success, -1 if any error occurs.
+ *
+ * \since This function is available since SDL 2.28.0.
+ */
+extern DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle);
+
+#endif
+
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
@@ -560,4 +639,4 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void
 
 
 #endif /* SDL_system_h_ */
 #endif /* SDL_system_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 23 - 21
bsp/simulator/SDL2/include/SDL_syswm.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,10 +19,17 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
- *  \file SDL_syswm.h
+/* WIKI CATEGORY: SYSWM */
+
+/*
+ * # CategorySYSWM
+ *
+ * Include file for SDL custom system window manager hooks.
  *
  *
- *  Include file for SDL custom system window manager hooks.
+ * Your application has access to a special type of event SDL_SYSWMEVENT,
+ * which contains window-manager specific information and arrives whenever
+ * an unhandled window event occurs.  This event is ignored by default, but
+ * you can enable it with SDL_EventState().
  */
  */
 
 
 #ifndef SDL_syswm_h_
 #ifndef SDL_syswm_h_
@@ -33,14 +40,6 @@
 #include "SDL_video.h"
 #include "SDL_video.h"
 #include "SDL_version.h"
 #include "SDL_version.h"
 
 
-/**
- *  \brief SDL_syswm.h
- *
- *  Your application has access to a special type of event ::SDL_SYSWMEVENT,
- *  which contains window-manager specific information and arrives whenever
- *  an unhandled window event occurs.  This event is ignored by default, but
- *  you can enable it with SDL_EventState().
- */
 struct SDL_SysWMinfo;
 struct SDL_SysWMinfo;
 
 
 #if !defined(SDL_PROTOTYPES_ONLY)
 #if !defined(SDL_PROTOTYPES_ONLY)
@@ -129,10 +128,11 @@ extern "C" {
 #endif
 #endif
 
 
 #if !defined(SDL_PROTOTYPES_ONLY)
 #if !defined(SDL_PROTOTYPES_ONLY)
+
 /**
 /**
- *  These are the various supported windowing subsystems
+ * These are the various supported windowing subsystems
  */
  */
-typedef enum
+typedef enum SDL_SYSWM_TYPE
 {
 {
     SDL_SYSWM_UNKNOWN,
     SDL_SYSWM_UNKNOWN,
     SDL_SYSWM_WINDOWS,
     SDL_SYSWM_WINDOWS,
@@ -152,7 +152,7 @@ typedef enum
 } SDL_SYSWM_TYPE;
 } SDL_SYSWM_TYPE;
 
 
 /**
 /**
- *  The custom event structure.
+ * The custom event structure.
  */
  */
 struct SDL_SysWMmsg
 struct SDL_SysWMmsg
 {
 {
@@ -218,10 +218,10 @@ struct SDL_SysWMmsg
 };
 };
 
 
 /**
 /**
- *  The custom window manager information structure.
+ * The custom window manager information structure.
  *
  *
- *  When this structure is returned, it holds information about which
- *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
+ * When this structure is returned, it holds information about which low level
+ * system it is using, and will be one of SDL_SYSWM_TYPE.
  */
  */
 struct SDL_SysWMinfo
 struct SDL_SysWMinfo
 {
 {
@@ -298,6 +298,8 @@ struct SDL_SysWMinfo
             struct wl_egl_window *egl_window;       /**< Wayland EGL window (native window) */
             struct wl_egl_window *egl_window;       /**< Wayland EGL window (native window) */
             struct xdg_surface *xdg_surface;        /**< Wayland xdg surface (window manager handle) */
             struct xdg_surface *xdg_surface;        /**< Wayland xdg surface (window manager handle) */
             struct xdg_toplevel *xdg_toplevel;      /**< Wayland xdg toplevel role */
             struct xdg_toplevel *xdg_toplevel;      /**< Wayland xdg toplevel role */
+            struct xdg_popup *xdg_popup;            /**< Wayland xdg popup role */
+            struct xdg_positioner *xdg_positioner;  /**< Wayland xdg positioner, for popup */
         } wl;
         } wl;
 #endif
 #endif
 #if defined(SDL_VIDEO_DRIVER_MIR)  /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
 #if defined(SDL_VIDEO_DRIVER_MIR)  /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
@@ -361,8 +363,8 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo;
  * `SDL_VERSION(&info.version)`, and then this function will fill in the rest
  * `SDL_VERSION(&info.version)`, and then this function will fill in the rest
  * of the structure with information about the given window.
  * of the structure with information about the given window.
  *
  *
- * \param window the window about which information is being requested
- * \param info an SDL_SysWMinfo structure filled in with window information
+ * \param window the window about which information is being requested.
+ * \param info an SDL_SysWMinfo structure filled in with window information.
  * \returns SDL_TRUE if the function is implemented and the `version` member
  * \returns SDL_TRUE if the function is implemented and the `version` member
  *          of the `info` struct is valid, or SDL_FALSE if the information
  *          of the `info` struct is valid, or SDL_FALSE if the information
  *          could not be retrieved; call SDL_GetError() for more information.
  *          could not be retrieved; call SDL_GetError() for more information.
@@ -381,4 +383,4 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
 
 
 #endif /* SDL_syswm_h_ */
 #endif /* SDL_syswm_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 3 - 3
bsp/simulator/SDL2/include/SDL_test.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test.h
  *  \file SDL_test.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -66,4 +66,4 @@ extern "C" {
 
 
 #endif /* SDL_test_h_ */
 #endif /* SDL_test_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 11 - 11
bsp/simulator/SDL2/include/SDL_test_assert.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_assert.h
  *  \file SDL_test_assert.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -42,17 +42,17 @@
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
-/**
+/*
  * \brief Fails the assert.
  * \brief Fails the assert.
  */
  */
 #define ASSERT_FAIL     0
 #define ASSERT_FAIL     0
 
 
-/**
+/*
  * \brief Passes the assert.
  * \brief Passes the assert.
  */
  */
 #define ASSERT_PASS     1
 #define ASSERT_PASS     1
 
 
-/**
+/*
  * \brief Assert that logs and break execution flow on failures.
  * \brief Assert that logs and break execution flow on failures.
  *
  *
  * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
  * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
@@ -60,7 +60,7 @@ extern "C" {
  */
  */
 void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
 void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
 
 
-/**
+/*
  * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
  * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
  *
  *
  * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
  * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
@@ -70,25 +70,25 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as
  */
  */
 int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
 int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
 
 
-/**
+/*
  * \brief Explicitly pass without checking an assertion condition. Updates assertion counter.
  * \brief Explicitly pass without checking an assertion condition. Updates assertion counter.
  *
  *
  * \param assertDescription Message to log with the assert describing it.
  * \param assertDescription Message to log with the assert describing it.
  */
  */
 void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
 void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
 
 
-/**
+/*
  * \brief Resets the assert summary counters to zero.
  * \brief Resets the assert summary counters to zero.
  */
  */
 void SDLTest_ResetAssertSummary(void);
 void SDLTest_ResetAssertSummary(void);
 
 
-/**
+/*
  * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
  * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
  */
  */
 void SDLTest_LogAssertSummary(void);
 void SDLTest_LogAssertSummary(void);
 
 
 
 
-/**
+/*
  * \brief Converts the current assert summary state to a test result.
  * \brief Converts the current assert summary state to a test result.
  *
  *
  * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
  * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
@@ -102,4 +102,4 @@ int SDLTest_AssertSummaryToTestResult(void);
 
 
 #endif /* SDL_test_assert_h_ */
 #endif /* SDL_test_assert_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 13 - 12
bsp/simulator/SDL2/include/SDL_test_common.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_common.h
  *  \file SDL_test_common.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -50,6 +50,7 @@
 #define VERBOSE_RENDER  0x00000004
 #define VERBOSE_RENDER  0x00000004
 #define VERBOSE_EVENT   0x00000008
 #define VERBOSE_EVENT   0x00000008
 #define VERBOSE_AUDIO   0x00000010
 #define VERBOSE_AUDIO   0x00000010
+#define VERBOSE_MOTION  0x00000020
 
 
 typedef struct
 typedef struct
 {
 {
@@ -128,7 +129,7 @@ extern "C" {
 
 
 /* Function prototypes */
 /* Function prototypes */
 
 
-/**
+/*
  * \brief Parse command line parameters and create common state.
  * \brief Parse command line parameters and create common state.
  *
  *
  * \param argv Array of command line parameters
  * \param argv Array of command line parameters
@@ -138,7 +139,7 @@ extern "C" {
  */
  */
 SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
 SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
 
 
-/**
+/*
  * \brief Process one common argument.
  * \brief Process one common argument.
  *
  *
  * \param state The common state describing the test window to create.
  * \param state The common state describing the test window to create.
@@ -149,7 +150,7 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
 int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
 int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
 
 
 
 
-/**
+/*
  * \brief Logs command line usage info.
  * \brief Logs command line usage info.
  *
  *
  * This logs the appropriate command line options for the subsystems in use
  * This logs the appropriate command line options for the subsystems in use
@@ -163,7 +164,7 @@ int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
  */
  */
 void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
 void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
 
 
-/**
+/*
  * \brief Returns common usage information
  * \brief Returns common usage information
  *
  *
  * You should (probably) be using SDLTest_CommonLogUsage() instead, but this
  * You should (probably) be using SDLTest_CommonLogUsage() instead, but this
@@ -176,7 +177,7 @@ void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, cons
  */
  */
 const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
 const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
 
 
-/**
+/*
  * \brief Open test window.
  * \brief Open test window.
  *
  *
  * \param state The common state describing the test window to create.
  * \param state The common state describing the test window to create.
@@ -185,7 +186,7 @@ const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
  */
  */
 SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
 SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
 
 
-/**
+/*
  * \brief Easy argument handling when test app doesn't need any custom args.
  * \brief Easy argument handling when test app doesn't need any custom args.
  *
  *
  * \param state The common state describing the test window to create.
  * \param state The common state describing the test window to create.
@@ -196,7 +197,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
  */
  */
 SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv);
 SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv);
 
 
-/**
+/*
  * \brief Common event handler for test windows.
  * \brief Common event handler for test windows.
  *
  *
  * \param state The common state used to create test window.
  * \param state The common state used to create test window.
@@ -206,7 +207,7 @@ SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc,
  */
  */
 void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done);
 void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done);
 
 
-/**
+/*
  * \brief Close test window.
  * \brief Close test window.
  *
  *
  * \param state The common state used to create test window.
  * \param state The common state used to create test window.
@@ -214,7 +215,7 @@ void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *do
  */
  */
 void SDLTest_CommonQuit(SDLTest_CommonState * state);
 void SDLTest_CommonQuit(SDLTest_CommonState * state);
 
 
-/**
+/*
  * \brief Draws various window information (position, size, etc.) to the renderer.
  * \brief Draws various window information (position, size, etc.) to the renderer.
  *
  *
  * \param renderer The renderer to draw to.
  * \param renderer The renderer to draw to.
@@ -232,4 +233,4 @@ void SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window,
 
 
 #endif /* SDL_test_common_h_ */
 #endif /* SDL_test_common_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 4 - 4
bsp/simulator/SDL2/include/SDL_test_compare.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_compare.h
  *  \file SDL_test_compare.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -46,7 +46,7 @@
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
-/**
+/*
  * \brief Compares a surface and with reference image data for equality
  * \brief Compares a surface and with reference image data for equality
  *
  *
  * \param surface Surface used in comparison
  * \param surface Surface used in comparison
@@ -66,4 +66,4 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface,
 
 
 #endif /* SDL_test_compare_h_ */
 #endif /* SDL_test_compare_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 7 - 7
bsp/simulator/SDL2/include/SDL_test_crc32.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_crc32.h
  *  \file SDL_test_crc32.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -60,7 +60,7 @@ extern "C" {
  #define CRC32_POLY 0xEDB88320   /* Perl String::CRC32 compatible */
  #define CRC32_POLY 0xEDB88320   /* Perl String::CRC32 compatible */
 #endif
 #endif
 
 
-/**
+/*
  * Data structure for CRC32 (checksum) computation
  * Data structure for CRC32 (checksum) computation
  */
  */
   typedef struct {
   typedef struct {
@@ -69,7 +69,7 @@ extern "C" {
 
 
 /* ---------- Function Prototypes ------------- */
 /* ---------- Function Prototypes ------------- */
 
 
-/**
+/*
  * \brief Initialize the CRC context
  * \brief Initialize the CRC context
  *
  *
  * Note: The function initializes the crc table required for all crc calculations.
  * Note: The function initializes the crc table required for all crc calculations.
@@ -82,7 +82,7 @@ extern "C" {
  int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
  int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
 
 
 
 
-/**
+/*
  * \brief calculate a crc32 from a data block
  * \brief calculate a crc32 from a data block
  *
  *
  * \param crcContext         pointer to context variable
  * \param crcContext         pointer to context variable
@@ -101,7 +101,7 @@ int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
 int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
 int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
 
 
 
 
-/**
+/*
  * \brief clean up CRC context
  * \brief clean up CRC context
  *
  *
  * \param crcContext        pointer to context variable
  * \param crcContext        pointer to context variable
@@ -121,4 +121,4 @@ int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext);
 
 
 #endif /* SDL_test_crc32_h_ */
 #endif /* SDL_test_crc32_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 96 - 9
bsp/simulator/SDL2/include/SDL_test_font.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_font.h
  *  \file SDL_test_font.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -38,9 +38,10 @@ extern "C" {
 
 
 /* Function prototypes */
 /* Function prototypes */
 
 
-#define FONT_CHARACTER_SIZE  8
+#define FONT_CHARACTER_SIZE 8
+#define FONT_LINE_HEIGHT    (FONT_CHARACTER_SIZE + 2)
 
 
-/**
+/*
  *  \brief Draw a string in the currently set font.
  *  \brief Draw a string in the currently set font.
  *
  *
  *  \param renderer The renderer to draw on.
  *  \param renderer The renderer to draw on.
@@ -50,10 +51,12 @@ extern "C" {
  *
  *
  *  \returns 0 on success, -1 on failure.
  *  \returns 0 on success, -1 on failure.
  */
  */
-int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c);
+int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c);
 
 
-/**
- *  \brief Draw a string in the currently set font.
+/*
+ *  \brief Draw a UTF-8 string in the currently set font.
+ *
+ *  The font currently only supports characters in the Basic Latin and Latin-1 Supplement sets.
  *
  *
  *  \param renderer The renderer to draw on.
  *  \param renderer The renderer to draw on.
  *  \param x The X coordinate of the upper left corner of the string.
  *  \param x The X coordinate of the upper left corner of the string.
@@ -64,8 +67,92 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c);
  */
  */
 int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);
 int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);
 
 
+/*
+ *  \brief Data used for multi-line text output
+ */
+typedef struct SDLTest_TextWindow
+{
+    SDL_Rect rect;
+    int current;
+    int numlines;
+    char **lines;
+} SDLTest_TextWindow;
+
+/*
+ *  \brief Create a multi-line text output window
+ *
+ *  \param x The X coordinate of the upper left corner of the window.
+ *  \param y The Y coordinate of the upper left corner of the window.
+ *  \param w The width of the window (currently ignored)
+ *  \param h The height of the window (currently ignored)
+ *
+ *  \returns the new window, or NULL on failure.
+ *
+ *  \since This function is available since SDL 2.24.0
+ */
+SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h);
+
+/*
+ *  \brief Display a multi-line text output window
+ *
+ *  This function should be called every frame to display the text
+ *
+ *  \param textwin The text output window
+ *  \param renderer The renderer to use for display
+ *
+ *  \since This function is available since SDL 2.24.0
+ */
+void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer);
+
+/*
+ *  \brief Add text to a multi-line text output window
+ *
+ *  Adds UTF-8 text to the end of the current text. The newline character starts a
+ *  new line of text. The backspace character deletes the last character or, if the
+ *  line is empty, deletes the line and goes to the end of the previous line.
+ *
+ *  \param textwin The text output window
+ *  \param fmt A printf() style format string
+ *  \param ...  additional parameters matching % tokens in the `fmt` string, if any
+ *
+ *  \since This function is available since SDL 2.24.0
+ */
+void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
+
+/*
+ *  \brief Add text to a multi-line text output window
+ *
+ *  Adds UTF-8 text to the end of the current text. The newline character starts a
+ *  new line of text. The backspace character deletes the last character or, if the
+ *  line is empty, deletes the line and goes to the end of the previous line.
+ *
+ *  \param textwin The text output window
+ *  \param text The text to add to the window
+ *  \param len The length, in bytes, of the text to add to the window
+ *
+ *  \since This function is available since SDL 2.24.0
+ */
+void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len);
 
 
-/**
+/*
+ *  \brief Clear the text in a multi-line text output window
+ *
+ *  \param textwin The text output window
+ *
+ *  \since This function is available since SDL 2.24.0
+ */
+void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
+
+/*
+ *  \brief Free the storage associated with a multi-line text output window
+ *
+ *  \param textwin The text output window
+ *
+ *  \since This function is available since SDL 2.24.0
+ */
+void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin);
+
+/*
  *  \brief Cleanup textures used by font drawing functions.
  *  \brief Cleanup textures used by font drawing functions.
  */
  */
 void SDLTest_CleanupTextDrawing(void);
 void SDLTest_CleanupTextDrawing(void);
@@ -78,4 +165,4 @@ void SDLTest_CleanupTextDrawing(void);
 
 
 #endif /* SDL_test_font_h_ */
 #endif /* SDL_test_font_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 31 - 30
bsp/simulator/SDL2/include/SDL_test_fuzzer.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_fuzzer.h
  *  \file SDL_test_fuzzer.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -48,13 +48,13 @@ extern "C" {
 */
 */
 
 
 
 
-/**
+/*
  * \file
  * \file
  * Note: The fuzzer implementation uses a static instance of random context
  * Note: The fuzzer implementation uses a static instance of random context
  * internally which makes it thread-UNsafe.
  * internally which makes it thread-UNsafe.
  */
  */
 
 
-/**
+/*
  * Initializes the fuzzer for a test
  * Initializes the fuzzer for a test
  *
  *
  * \param execKey Execution "Key" that initializes the random number generator uniquely for the test.
  * \param execKey Execution "Key" that initializes the random number generator uniquely for the test.
@@ -63,14 +63,14 @@ extern "C" {
 void SDLTest_FuzzerInit(Uint64 execKey);
 void SDLTest_FuzzerInit(Uint64 execKey);
 
 
 
 
-/**
+/*
  * Returns a random Uint8
  * Returns a random Uint8
  *
  *
  * \returns a generated integer
  * \returns a generated integer
  */
  */
 Uint8 SDLTest_RandomUint8(void);
 Uint8 SDLTest_RandomUint8(void);
 
 
-/**
+/*
  * Returns a random Sint8
  * Returns a random Sint8
  *
  *
  * \returns a generated signed integer
  * \returns a generated signed integer
@@ -78,14 +78,14 @@ Uint8 SDLTest_RandomUint8(void);
 Sint8 SDLTest_RandomSint8(void);
 Sint8 SDLTest_RandomSint8(void);
 
 
 
 
-/**
+/*
  * Returns a random Uint16
  * Returns a random Uint16
  *
  *
  * \returns a generated integer
  * \returns a generated integer
  */
  */
 Uint16 SDLTest_RandomUint16(void);
 Uint16 SDLTest_RandomUint16(void);
 
 
-/**
+/*
  * Returns a random Sint16
  * Returns a random Sint16
  *
  *
  * \returns a generated signed integer
  * \returns a generated signed integer
@@ -93,7 +93,7 @@ Uint16 SDLTest_RandomUint16(void);
 Sint16 SDLTest_RandomSint16(void);
 Sint16 SDLTest_RandomSint16(void);
 
 
 
 
-/**
+/*
  * Returns a random integer
  * Returns a random integer
  *
  *
  * \returns a generated integer
  * \returns a generated integer
@@ -101,14 +101,14 @@ Sint16 SDLTest_RandomSint16(void);
 Sint32 SDLTest_RandomSint32(void);
 Sint32 SDLTest_RandomSint32(void);
 
 
 
 
-/**
+/*
  * Returns a random positive integer
  * Returns a random positive integer
  *
  *
  * \returns a generated integer
  * \returns a generated integer
  */
  */
 Uint32 SDLTest_RandomUint32(void);
 Uint32 SDLTest_RandomUint32(void);
 
 
-/**
+/*
  * Returns random Uint64.
  * Returns random Uint64.
  *
  *
  * \returns a generated integer
  * \returns a generated integer
@@ -116,36 +116,36 @@ Uint32 SDLTest_RandomUint32(void);
 Uint64 SDLTest_RandomUint64(void);
 Uint64 SDLTest_RandomUint64(void);
 
 
 
 
-/**
+/*
  * Returns random Sint64.
  * Returns random Sint64.
  *
  *
  * \returns a generated signed integer
  * \returns a generated signed integer
  */
  */
 Sint64 SDLTest_RandomSint64(void);
 Sint64 SDLTest_RandomSint64(void);
 
 
-/**
+/*
  * \returns a random float in range [0.0 - 1.0]
  * \returns a random float in range [0.0 - 1.0]
  */
  */
 float SDLTest_RandomUnitFloat(void);
 float SDLTest_RandomUnitFloat(void);
 
 
-/**
+/*
  * \returns a random double in range [0.0 - 1.0]
  * \returns a random double in range [0.0 - 1.0]
  */
  */
 double SDLTest_RandomUnitDouble(void);
 double SDLTest_RandomUnitDouble(void);
 
 
-/**
+/*
  * \returns a random float.
  * \returns a random float.
  *
  *
  */
  */
 float SDLTest_RandomFloat(void);
 float SDLTest_RandomFloat(void);
 
 
-/**
+/*
  * \returns a random double.
  * \returns a random double.
  *
  *
  */
  */
 double SDLTest_RandomDouble(void);
 double SDLTest_RandomDouble(void);
 
 
-/**
+/*
  * Returns a random boundary value for Uint8 within the given boundaries.
  * Returns a random boundary value for Uint8 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -166,7 +166,7 @@ double SDLTest_RandomDouble(void);
  */
  */
 Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
 Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
 
 
-/**
+/*
  * Returns a random boundary value for Uint16 within the given boundaries.
  * Returns a random boundary value for Uint16 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -187,7 +187,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo
  */
  */
 Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
 Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
 
 
-/**
+/*
  * Returns a random boundary value for Uint32 within the given boundaries.
  * Returns a random boundary value for Uint32 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -208,7 +208,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL
  */
  */
 Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
 Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
 
 
-/**
+/*
  * Returns a random boundary value for Uint64 within the given boundaries.
  * Returns a random boundary value for Uint64 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -229,7 +229,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL
  */
  */
 Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
 Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
 
 
-/**
+/*
  * Returns a random boundary value for Sint8 within the given boundaries.
  * Returns a random boundary value for Sint8 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -251,7 +251,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL
 Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
 Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
 
 
 
 
-/**
+/*
  * Returns a random boundary value for Sint16 within the given boundaries.
  * Returns a random boundary value for Sint16 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -272,7 +272,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo
  */
  */
 Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
 Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
 
 
-/**
+/*
  * Returns a random boundary value for Sint32 within the given boundaries.
  * Returns a random boundary value for Sint32 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -293,7 +293,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL
  */
  */
 Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
 Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
 
 
-/**
+/*
  * Returns a random boundary value for Sint64 within the given boundaries.
  * Returns a random boundary value for Sint64 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -315,7 +315,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL
 Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
 Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
 
 
 
 
-/**
+/*
  * Returns integer in range [min, max] (inclusive).
  * Returns integer in range [min, max] (inclusive).
  * Min and max values can be negative values.
  * Min and max values can be negative values.
  * If Max in smaller than min, then the values are swapped.
  * If Max in smaller than min, then the values are swapped.
@@ -329,7 +329,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL
 Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
 Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
 
 
 
 
-/**
+/*
  * Generates random null-terminated string. The minimum length for
  * Generates random null-terminated string. The minimum length for
  * the string is 1 character, maximum length for the string is 255
  * the string is 1 character, maximum length for the string is 255
  * characters and it can contain ASCII characters from 32 to 126.
  * characters and it can contain ASCII characters from 32 to 126.
@@ -341,7 +341,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
 char * SDLTest_RandomAsciiString(void);
 char * SDLTest_RandomAsciiString(void);
 
 
 
 
-/**
+/*
  * Generates random null-terminated string. The maximum length for
  * Generates random null-terminated string. The maximum length for
  * the string is defined by the maxLength parameter.
  * the string is defined by the maxLength parameter.
  * String can contain ASCII characters from 32 to 126.
  * String can contain ASCII characters from 32 to 126.
@@ -355,7 +355,7 @@ char * SDLTest_RandomAsciiString(void);
 char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
 char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
 
 
 
 
-/**
+/*
  * Generates random null-terminated string. The length for
  * Generates random null-terminated string. The length for
  * the string is defined by the size parameter.
  * the string is defined by the size parameter.
  * String can contain ASCII characters from 32 to 126.
  * String can contain ASCII characters from 32 to 126.
@@ -368,7 +368,8 @@ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
  */
  */
 char * SDLTest_RandomAsciiStringOfSize(int size);
 char * SDLTest_RandomAsciiStringOfSize(int size);
 
 
-/**
+
+/*
  * Get the invocation count for the fuzzer since last ...FuzzerInit.
  * Get the invocation count for the fuzzer since last ...FuzzerInit.
  *
  *
  * \returns the invocation count.
  * \returns the invocation count.
@@ -383,4 +384,4 @@ int SDLTest_GetFuzzerInvocationCount(void);
 
 
 #endif /* SDL_test_fuzzer_h_ */
 #endif /* SDL_test_fuzzer_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 7 - 7
bsp/simulator/SDL2/include/SDL_test_harness.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_harness.h
  *  \file SDL_test_harness.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -69,7 +69,7 @@ typedef int (*SDLTest_TestCaseFp)(void *arg);
 /* !< Function pointer to a test case teardown function (run after every test) */
 /* !< Function pointer to a test case teardown function (run after every test) */
 typedef void  (*SDLTest_TestCaseTearDownFp)(void *arg);
 typedef void  (*SDLTest_TestCaseTearDownFp)(void *arg);
 
 
-/**
+/*
  * Holds information about a single test case.
  * Holds information about a single test case.
  */
  */
 typedef struct SDLTest_TestCaseReference {
 typedef struct SDLTest_TestCaseReference {
@@ -83,7 +83,7 @@ typedef struct SDLTest_TestCaseReference {
     int enabled;
     int enabled;
 } SDLTest_TestCaseReference;
 } SDLTest_TestCaseReference;
 
 
-/**
+/*
  * Holds information about a test suite (multiple test cases).
  * Holds information about a test suite (multiple test cases).
  */
  */
 typedef struct SDLTest_TestSuiteReference {
 typedef struct SDLTest_TestSuiteReference {
@@ -98,7 +98,7 @@ typedef struct SDLTest_TestSuiteReference {
 } SDLTest_TestSuiteReference;
 } SDLTest_TestSuiteReference;
 
 
 
 
-/**
+/*
  * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
  * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
  *
  *
  * Note: The returned string needs to be deallocated by the caller.
  * Note: The returned string needs to be deallocated by the caller.
@@ -109,7 +109,7 @@ typedef struct SDLTest_TestSuiteReference {
  */
  */
 char *SDLTest_GenerateRunSeed(const int length);
 char *SDLTest_GenerateRunSeed(const int length);
 
 
-/**
+/*
  * \brief Execute a test suite using the given run seed and execution key.
  * \brief Execute a test suite using the given run seed and execution key.
  *
  *
  * \param testSuites Suites containing the test case.
  * \param testSuites Suites containing the test case.
@@ -131,4 +131,4 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
 
 
 #endif /* SDL_test_h_arness_h */
 #endif /* SDL_test_h_arness_h */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 4 - 4
bsp/simulator/SDL2/include/SDL_test_images.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_images.h
  *  \file SDL_test_images.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -44,7 +44,7 @@
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
-/**
+/*
  *Type for test images.
  *Type for test images.
  */
  */
 typedef struct SDLTest_SurfaceImage_s {
 typedef struct SDLTest_SurfaceImage_s {
@@ -75,4 +75,4 @@ SDL_Surface *SDLTest_ImagePrimitivesBlend(void);
 
 
 #endif /* SDL_test_images_h_ */
 #endif /* SDL_test_images_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 5 - 5
bsp/simulator/SDL2/include/SDL_test_log.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_log.h
  *  \file SDL_test_log.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -42,14 +42,14 @@
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
-/**
+/*
  * \brief Prints given message with a timestamp in the TEST category and INFO priority.
  * \brief Prints given message with a timestamp in the TEST category and INFO priority.
  *
  *
  * \param fmt Message to be logged
  * \param fmt Message to be logged
  */
  */
 void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
 void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
 
 
-/**
+/*
  * \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
  * \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
  *
  *
  * \param fmt Message to be logged
  * \param fmt Message to be logged
@@ -64,4 +64,4 @@ void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_
 
 
 #endif /* SDL_test_log_h_ */
 #endif /* SDL_test_log_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 6 - 6
bsp/simulator/SDL2/include/SDL_test_md5.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_md5.h
  *  \file SDL_test_md5.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -77,7 +77,7 @@ extern "C" {
 
 
 /* ---------- Function Prototypes ------------- */
 /* ---------- Function Prototypes ------------- */
 
 
-/**
+/*
  * \brief initialize the context
  * \brief initialize the context
  *
  *
  * \param  mdContext        pointer to context variable
  * \param  mdContext        pointer to context variable
@@ -89,7 +89,7 @@ extern "C" {
  void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
  void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
 
 
 
 
-/**
+/*
  * \brief update digest from variable length data
  * \brief update digest from variable length data
  *
  *
  * \param  mdContext       pointer to context variable
  * \param  mdContext       pointer to context variable
@@ -105,7 +105,7 @@ extern "C" {
                  unsigned int inLen);
                  unsigned int inLen);
 
 
 
 
-/**
+/*
  * \brief complete digest computation
  * \brief complete digest computation
  *
  *
  * \param mdContext     pointer to context variable
  * \param mdContext     pointer to context variable
@@ -126,4 +126,4 @@ extern "C" {
 
 
 #endif /* SDL_test_md5_h_ */
 #endif /* SDL_test_md5_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 5 - 5
bsp/simulator/SDL2/include/SDL_test_memory.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_memory.h
  *  \file SDL_test_memory.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -37,14 +37,14 @@ extern "C" {
 #endif
 #endif
 
 
 
 
-/**
+/*
  * \brief Start tracking SDL memory allocations
  * \brief Start tracking SDL memory allocations
  *
  *
  * \note This should be called before any other SDL functions for complete tracking coverage
  * \note This should be called before any other SDL functions for complete tracking coverage
  */
  */
 int SDLTest_TrackAllocations(void);
 int SDLTest_TrackAllocations(void);
 
 
-/**
+/*
  * \brief Print a log of any outstanding allocations
  * \brief Print a log of any outstanding allocations
  *
  *
  * \note This can be called after SDL_Quit()
  * \note This can be called after SDL_Quit()
@@ -60,4 +60,4 @@ void SDLTest_LogAllocations(void);
 
 
 #endif /* SDL_test_memory_h_ */
 #endif /* SDL_test_memory_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 6 - 6
bsp/simulator/SDL2/include/SDL_test_random.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
+/*
  *  \file SDL_test_random.h
  *  \file SDL_test_random.h
  *
  *
  *  Include file for SDL test framework.
  *  Include file for SDL test framework.
@@ -67,7 +67,7 @@ extern "C" {
 
 
 /* --- Function prototypes */
 /* --- Function prototypes */
 
 
-/**
+/*
  *  \brief Initialize random number generator with two integers.
  *  \brief Initialize random number generator with two integers.
  *
  *
  *  Note: The random sequence of numbers returned by ...Random() is the
  *  Note: The random sequence of numbers returned by ...Random() is the
@@ -81,7 +81,7 @@ extern "C" {
  void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
  void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
                   unsigned int ci);
                   unsigned int ci);
 
 
-/**
+/*
  *  \brief Initialize random number generator based on current system time.
  *  \brief Initialize random number generator based on current system time.
  *
  *
  *  \param rndContext     pointer to context structure
  *  \param rndContext     pointer to context structure
@@ -90,7 +90,7 @@ extern "C" {
  void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
  void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
 
 
 
 
-/**
+/*
  *  \brief Initialize random number generator based on current system time.
  *  \brief Initialize random number generator based on current system time.
  *
  *
  *  Note: ...RandomInit() or ...RandomInitTime() must have been called
  *  Note: ...RandomInit() or ...RandomInitTime() must have been called
@@ -112,4 +112,4 @@ extern "C" {
 
 
 #endif /* SDL_test_random_h_ */
 #endif /* SDL_test_random_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 37 - 33
bsp/simulator/SDL2/include/SDL_thread.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -23,9 +23,9 @@
 #define SDL_thread_h_
 #define SDL_thread_h_
 
 
 /**
 /**
- *  \file SDL_thread.h
+ * # CategoryThread
  *
  *
- *  Header for the SDL thread management routines.
+ * Header for the SDL thread management routines.
  */
  */
 
 
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
@@ -35,7 +35,7 @@
 #include "SDL_atomic.h"
 #include "SDL_atomic.h"
 #include "SDL_mutex.h"
 #include "SDL_mutex.h"
 
 
-#if defined(__WIN32__)
+#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__)
 #include <process.h> /* _beginthreadex() and _endthreadex() */
 #include <process.h> /* _beginthreadex() and _endthreadex() */
 #endif
 #endif
 #if defined(__OS2__) /* for _beginthread() and _endthread() */
 #if defined(__OS2__) /* for _beginthread() and _endthread() */
@@ -63,16 +63,18 @@ typedef unsigned long SDL_threadID;
 typedef unsigned int SDL_TLSID;
 typedef unsigned int SDL_TLSID;
 
 
 /**
 /**
- *  The SDL thread priority.
+ * The SDL thread priority.
  *
  *
- *  SDL will make system changes as necessary in order to apply the thread priority.
- *  Code which attempts to control thread state related to priority should be aware
- *  that calling SDL_SetThreadPriority may alter such state.
- *  SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior.
+ * SDL will make system changes as necessary in order to apply the thread
+ * priority. Code which attempts to control thread state related to priority
+ * should be aware that calling SDL_SetThreadPriority may alter such state.
+ * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this
+ * behavior.
  *
  *
- *  \note On many systems you require special privileges to set high or time critical priority.
+ * On many systems you require special privileges to set high or time critical
+ * priority.
  */
  */
-typedef enum {
+typedef enum SDL_ThreadPriority {
     SDL_THREAD_PRIORITY_LOW,
     SDL_THREAD_PRIORITY_LOW,
     SDL_THREAD_PRIORITY_NORMAL,
     SDL_THREAD_PRIORITY_NORMAL,
     SDL_THREAD_PRIORITY_HIGH,
     SDL_THREAD_PRIORITY_HIGH,
@@ -82,13 +84,13 @@ typedef enum {
 /**
 /**
  * The function passed to SDL_CreateThread().
  * The function passed to SDL_CreateThread().
  *
  *
- * \param data what was passed as `data` to SDL_CreateThread()
+ * \param data what was passed as `data` to SDL_CreateThread().
  * \returns a value that can be reported through SDL_WaitThread().
  * \returns a value that can be reported through SDL_WaitThread().
  */
  */
 typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
 typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
 
 
 
 
-#if defined(__WIN32__)
+#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__)
 /**
 /**
  *  \file SDL_thread.h
  *  \file SDL_thread.h
  *
  *
@@ -129,7 +131,7 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
                  pfnSDL_CurrentEndThread pfnEndThread);
                  pfnSDL_CurrentEndThread pfnEndThread);
 
 
 extern DECLSPEC SDL_Thread *SDLCALL
 extern DECLSPEC SDL_Thread *SDLCALL
-SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
+SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
                  const char *name, const size_t stacksize, void *data,
                  const char *name, const size_t stacksize, void *data,
                  pfnSDL_CurrentBeginThread pfnBeginThread,
                  pfnSDL_CurrentBeginThread pfnBeginThread,
                  pfnSDL_CurrentEndThread pfnEndThread);
                  pfnSDL_CurrentEndThread pfnEndThread);
@@ -142,7 +144,7 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #else
 #else
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
-#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread)
+#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #endif
 #endif
 
 
 #elif defined(__OS2__)
 #elif defined(__OS2__)
@@ -175,7 +177,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
 #undef SDL_CreateThread
 #undef SDL_CreateThread
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #undef SDL_CreateThreadWithStackSize
 #undef SDL_CreateThreadWithStackSize
-#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
+#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #else
 #else
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
@@ -192,9 +194,9 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
  * SDL_CreateThreadWithStackSize(fn, name, 0, data);
  * SDL_CreateThreadWithStackSize(fn, name, 0, data);
  * ```
  * ```
  *
  *
- * \param fn the SDL_ThreadFunction function to call in the new thread
- * \param name the name of the thread
- * \param data a pointer that is passed to `fn`
+ * \param fn the SDL_ThreadFunction function to call in the new thread.
+ * \param name the name of the thread.
+ * \param data a pointer that is passed to `fn`.
  * \returns an opaque pointer to the new thread object on success, NULL if the
  * \returns an opaque pointer to the new thread object on success, NULL if the
  *          new thread could not be created; call SDL_GetError() for more
  *          new thread could not be created; call SDL_GetError() for more
  *          information.
  *          information.
@@ -238,10 +240,10 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
  * function, but for backwards compatibility, this is currently a separate
  * function, but for backwards compatibility, this is currently a separate
  * function.
  * function.
  *
  *
- * \param fn the SDL_ThreadFunction function to call in the new thread
- * \param name the name of the thread
+ * \param fn the SDL_ThreadFunction function to call in the new thread.
+ * \param name the name of the thread.
  * \param stacksize the size, in bytes, to allocate for the new thread stack.
  * \param stacksize the size, in bytes, to allocate for the new thread stack.
- * \param data a pointer that is passed to `fn`
+ * \param data a pointer that is passed to `fn`.
  * \returns an opaque pointer to the new thread object on success, NULL if the
  * \returns an opaque pointer to the new thread object on success, NULL if the
  *          new thread could not be created; call SDL_GetError() for more
  *          new thread could not be created; call SDL_GetError() for more
  *          information.
  *          information.
@@ -261,7 +263,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
  * This is internal memory, not to be freed by the caller, and remains valid
  * This is internal memory, not to be freed by the caller, and remains valid
  * until the specified thread is cleaned up by SDL_WaitThread().
  * until the specified thread is cleaned up by SDL_WaitThread().
  *
  *
- * \param thread the thread to query
+ * \param thread the thread to query.
  * \returns a pointer to a UTF-8 string that names the specified thread, or
  * \returns a pointer to a UTF-8 string that names the specified thread, or
  *          NULL if it doesn't have a name.
  *          NULL if it doesn't have a name.
  *
  *
@@ -296,7 +298,7 @@ extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
  * If SDL is running on a platform that does not support threads the return
  * If SDL is running on a platform that does not support threads the return
  * value will always be zero.
  * value will always be zero.
  *
  *
- * \param thread the thread to query
+ * \param thread the thread to query.
  * \returns the ID of the specified thread, or the ID of the current thread if
  * \returns the ID of the specified thread, or the ID of the current thread if
  *          `thread` is NULL.
  *          `thread` is NULL.
  *
  *
@@ -313,7 +315,7 @@ extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
  * promote the thread to a higher priority) at all, and some require you to be
  * promote the thread to a higher priority) at all, and some require you to be
  * an administrator account. Be prepared for this to fail.
  * an administrator account. Be prepared for this to fail.
  *
  *
- * \param priority the SDL_ThreadPriority to set
+ * \param priority the SDL_ThreadPriority to set.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -344,7 +346,7 @@ extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
  * afterward.
  * afterward.
  *
  *
  * \param thread the SDL_Thread pointer that was returned from the
  * \param thread the SDL_Thread pointer that was returned from the
- *               SDL_CreateThread() call that started this thread
+ *               SDL_CreateThread() call that started this thread.
  * \param status pointer to an integer that will receive the value returned
  * \param status pointer to an integer that will receive the value returned
  *               from the thread function by its 'return', or NULL to not
  *               from the thread function by its 'return', or NULL to not
  *               receive such value back.
  *               receive such value back.
@@ -383,7 +385,7 @@ extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
  * It is safe to pass NULL to this function; it is a no-op.
  * It is safe to pass NULL to this function; it is a no-op.
  *
  *
  * \param thread the SDL_Thread pointer that was returned from the
  * \param thread the SDL_Thread pointer that was returned from the
- *               SDL_CreateThread() call that started this thread
+ *               SDL_CreateThread() call that started this thread.
  *
  *
  * \since This function is available since SDL 2.0.2.
  * \since This function is available since SDL 2.0.2.
  *
  *
@@ -410,7 +412,7 @@ extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
 /**
 /**
  * Get the current thread's value associated with a thread local storage ID.
  * Get the current thread's value associated with a thread local storage ID.
  *
  *
- * \param id the thread local storage ID
+ * \param id the thread local storage ID.
  * \returns the value associated with the ID for the current thread or NULL if
  * \returns the value associated with the ID for the current thread or NULL if
  *          no value has been set; call SDL_GetError() for more information.
  *          no value has been set; call SDL_GetError() for more information.
  *
  *
@@ -421,6 +423,8 @@ extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
  */
  */
 extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
 extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
 
 
+typedef void (SDLCALL *SDL_TLSDestructorCallback)(void*);
+
 /**
 /**
  * Set the current thread's value associated with a thread local storage ID.
  * Set the current thread's value associated with a thread local storage ID.
  *
  *
@@ -432,10 +436,10 @@ extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
  *
  *
  * where its parameter `value` is what was passed as `value` to SDL_TLSSet().
  * where its parameter `value` is what was passed as `value` to SDL_TLSSet().
  *
  *
- * \param id the thread local storage ID
- * \param value the value to associate with the ID for the current thread
+ * \param id the thread local storage ID.
+ * \param value the value to associate with the ID for the current thread.
  * \param destructor a function called when the thread exits, to free the
  * \param destructor a function called when the thread exits, to free the
- *                   value
+ *                   value.
  * \returns 0 on success or a negative error code on failure; call
  * \returns 0 on success or a negative error code on failure; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
@@ -444,7 +448,7 @@ extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
  * \sa SDL_TLSCreate
  * \sa SDL_TLSCreate
  * \sa SDL_TLSGet
  * \sa SDL_TLSGet
  */
  */
-extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
+extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destructor);
 
 
 /**
 /**
  * Cleanup all TLS data for this thread.
  * Cleanup all TLS data for this thread.
@@ -461,4 +465,4 @@ extern DECLSPEC void SDLCALL SDL_TLSCleanup(void);
 
 
 #endif /* SDL_thread_h_ */
 #endif /* SDL_thread_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 22 - 20
bsp/simulator/SDL2/include/SDL_timer.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -23,9 +23,9 @@
 #define SDL_timer_h_
 #define SDL_timer_h_
 
 
 /**
 /**
- *  \file SDL_timer.h
+ * # CategoryTimer
  *
  *
- *  Header for the SDL time management routines.
+ * Header for the SDL time management routines.
  */
  */
 
 
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
@@ -69,7 +69,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
  *
  *
  * ```c
  * ```c
  * const Uint64 timeout = SDL_GetTicks64() + 100;
  * const Uint64 timeout = SDL_GetTicks64() + 100;
- * while (SDL_GetTicks64() < timeout) {
+ * while (SDL_GetTicks64() < timeout)
+ {
  *     // ... do work until timeout has elapsed
  *     // ... do work until timeout has elapsed
  * }
  * }
  * ```
  * ```
@@ -89,19 +90,20 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void);
  * days, but should _not_ be used with SDL_GetTicks64(), which does not have
  * days, but should _not_ be used with SDL_GetTicks64(), which does not have
  * that problem.
  * that problem.
  *
  *
- * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could
- * do this:
+ * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could do
+ * this:
  *
  *
  * ```c
  * ```c
  * const Uint32 timeout = SDL_GetTicks() + 100;
  * const Uint32 timeout = SDL_GetTicks() + 100;
- * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
+ * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout))
+ {
  *     // ... do work until timeout has elapsed
  *     // ... do work until timeout has elapsed
  * }
  * }
  * ```
  * ```
  *
  *
- * Note that this does not handle tick differences greater
- * than 2^31 so take care when using the above kind of code
- * with large timeout delays (tens of days).
+ * Note that this does not handle tick differences greater than 2^31 so take
+ * care when using the above kind of code with large timeout delays (tens of
+ * days).
  */
  */
 #define SDL_TICKS_PASSED(A, B)  ((Sint32)((B) - (A)) <= 0)
 #define SDL_TICKS_PASSED(A, B)  ((Sint32)((B) - (A)) <= 0)
 
 
@@ -140,7 +142,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
  * waits at least the specified time, but possibly longer due to OS
  * waits at least the specified time, but possibly longer due to OS
  * scheduling.
  * scheduling.
  *
  *
- * \param ms the number of milliseconds to delay
+ * \param ms the number of milliseconds to delay.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  */
  */
@@ -149,10 +151,10 @@ extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
 /**
 /**
  * Function prototype for the timer callback function.
  * Function prototype for the timer callback function.
  *
  *
- * The callback function is passed the current timer interval and returns
- * the next timer interval. If the returned value is the same as the one
- * passed in, the periodic alarm continues, otherwise a new alarm is
- * scheduled. If the callback returns 0, the periodic alarm is cancelled.
+ * The callback function is passed the current timer interval and returns the
+ * next timer interval. If the returned value is the same as the one passed
+ * in, the periodic alarm continues, otherwise a new alarm is scheduled. If
+ * the callback returns 0, the periodic alarm is cancelled.
  */
  */
 typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
 typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
 
 
@@ -182,10 +184,10 @@ typedef int SDL_TimerID;
  * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your
  * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your
  * callback needs to adjust for variances.
  * callback needs to adjust for variances.
  *
  *
- * \param interval the timer delay, in milliseconds, passed to `callback`
+ * \param interval the timer delay, in milliseconds, passed to `callback`.
  * \param callback the SDL_TimerCallback function to call when the specified
  * \param callback the SDL_TimerCallback function to call when the specified
- *                 `interval` elapses
- * \param param a pointer that is passed to `callback`
+ *                 `interval` elapses.
+ * \param param a pointer that is passed to `callback`.
  * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more
  * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more
  *          information.
  *          information.
  *
  *
@@ -200,7 +202,7 @@ extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
 /**
 /**
  * Remove a timer created with SDL_AddTimer().
  * Remove a timer created with SDL_AddTimer().
  *
  *
- * \param id the ID of the timer to remove
+ * \param id the ID of the timer to remove.
  * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't
  * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't
  *          found.
  *          found.
  *
  *
@@ -219,4 +221,4 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
 
 
 #endif /* SDL_timer_h_ */
 #endif /* SDL_timer_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 16 - 8
bsp/simulator/SDL2/include/SDL_touch.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_touch.h
+ * # CategoryTouch
  *
  *
- *  Include file for SDL touch event handling.
+ * Include file for SDL touch event handling.
  */
  */
 
 
 #ifndef SDL_touch_h_
 #ifndef SDL_touch_h_
@@ -85,7 +85,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
 /**
 /**
  * Get the touch ID with the given index.
  * Get the touch ID with the given index.
  *
  *
- * \param index the touch device index
+ * \param index the touch device index.
  * \returns the touch ID with the given index on success or 0 if the index is
  * \returns the touch ID with the given index on success or 0 if the index is
  *          invalid; call SDL_GetError() for more information.
  *          invalid; call SDL_GetError() for more information.
  *
  *
@@ -95,6 +95,14 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
  */
  */
 extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
 extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
 
 
+/**
+ * Get the touch device name as reported from the driver or NULL if the index
+ * is invalid.
+ *
+ * \since This function is available since SDL 2.0.22.
+ */
+extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index);
+
 /**
 /**
  * Get the type of the given touch device.
  * Get the type of the given touch device.
  *
  *
@@ -105,7 +113,7 @@ extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID t
 /**
 /**
  * Get the number of active fingers for a given touch device.
  * Get the number of active fingers for a given touch device.
  *
  *
- * \param touchID the ID of a touch device
+ * \param touchID the ID of a touch device.
  * \returns the number of active fingers for a given touch device on success
  * \returns the number of active fingers for a given touch device on success
  *          or 0 on failure; call SDL_GetError() for more information.
  *          or 0 on failure; call SDL_GetError() for more information.
  *
  *
@@ -120,8 +128,8 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
  *
  *
  * The returned resource is owned by SDL and should not be deallocated.
  * The returned resource is owned by SDL and should not be deallocated.
  *
  *
- * \param touchID the ID of the requested touch device
- * \param index the index of the requested finger
+ * \param touchID the ID of the requested touch device.
+ * \param index the index of the requested finger.
  * \returns a pointer to the SDL_Finger object or NULL if no object at the
  * \returns a pointer to the SDL_Finger object or NULL if no object at the
  *          given ID and index could be found.
  *          given ID and index could be found.
  *
  *
@@ -139,4 +147,4 @@ extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int
 
 
 #endif /* SDL_touch_h_ */
 #endif /* SDL_touch_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

+ 3 - 8
bsp/simulator/SDL2/include/SDL_types.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,11 +19,6 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
-/**
- *  \file SDL_types.h
- *
- *  \deprecated
- */
-
 /* DEPRECATED */
 /* DEPRECATED */
-#include "SDL_stdinc.h"
+
+#include "SDL_stdinc.h"

+ 42 - 25
bsp/simulator/SDL2/include/SDL_version.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_version.h
+ * # CategoryVersion
  *
  *
- *  This header defines the current SDL version.
+ * This header defines the current SDL version.
  */
  */
 
 
 #ifndef SDL_version_h_
 #ifndef SDL_version_h_
@@ -40,10 +40,9 @@ extern "C" {
  * Information about the version of SDL in use.
  * Information about the version of SDL in use.
  *
  *
  * Represents the library's version as three levels: major revision
  * Represents the library's version as three levels: major revision
- * (increments with massive changes, additions, and enhancements),
- * minor revision (increments with backwards-compatible changes to the
- * major revision), and patchlevel (increments with fixes to the minor
- * revision).
+ * (increments with massive changes, additions, and enhancements), minor
+ * revision (increments with backwards-compatible changes to the major
+ * revision), and patchlevel (increments with fixes to the minor revision).
  *
  *
  * \sa SDL_VERSION
  * \sa SDL_VERSION
  * \sa SDL_GetVersion
  * \sa SDL_GetVersion
@@ -58,18 +57,17 @@ typedef struct SDL_version
 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
 */
 */
 #define SDL_MAJOR_VERSION   2
 #define SDL_MAJOR_VERSION   2
-#define SDL_MINOR_VERSION   0
-#define SDL_PATCHLEVEL      20
+#define SDL_MINOR_VERSION   32
+#define SDL_PATCHLEVEL      6
 
 
 /**
 /**
  * Macro to determine SDL version program was compiled against.
  * Macro to determine SDL version program was compiled against.
  *
  *
- * This macro fills in a SDL_version structure with the version of the
- * library you compiled against. This is determined by what header the
- * compiler uses. Note that if you dynamically linked the library, you might
- * have a slightly newer or older version at runtime. That version can be
- * determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
- * is not a macro.
+ * This macro fills in a SDL_version structure with the version of the library
+ * you compiled against. This is determined by what header the compiler uses.
+ * Note that if you dynamically linked the library, you might have a slightly
+ * newer or older version at runtime. That version can be determined with
+ * SDL_GetVersion(), which, unlike SDL_VERSION(), is not a macro.
  *
  *
  * \param x A pointer to a SDL_version struct to initialize.
  * \param x A pointer to a SDL_version struct to initialize.
  *
  *
@@ -83,28 +81,47 @@ typedef struct SDL_version
     (x)->patch = SDL_PATCHLEVEL;                    \
     (x)->patch = SDL_PATCHLEVEL;                    \
 }
 }
 
 
+/* TODO: Remove this whole block in SDL 3 */
+#if SDL_MAJOR_VERSION < 3
+
 /**
 /**
- *  This macro turns the version numbers into a numeric value:
- *  \verbatim
-    (1,2,3) -> (1203)
-    \endverbatim
+ * This macro turns the version numbers into a numeric value:
+ *
+ * ```
+ * (1,2,3) -> (1203)
+ * ```
+ *
+ * This assumes that there will never be more than 100 patchlevels.
  *
  *
- *  This assumes that there will never be more than 100 patchlevels.
+ * In versions higher than 2.9.0, the minor version overflows into the
+ * thousands digit: for example, 2.23.0 is encoded as 4300, and 2.255.99 would
+ * be encoded as 25799.
+ *
+ * This macro will not be available in SDL 3.x.
  */
  */
 #define SDL_VERSIONNUM(X, Y, Z)                     \
 #define SDL_VERSIONNUM(X, Y, Z)                     \
     ((X)*1000 + (Y)*100 + (Z))
     ((X)*1000 + (Y)*100 + (Z))
 
 
 /**
 /**
- *  This is the version number macro for the current SDL version.
+ * This is the version number macro for the current SDL version.
+ *
+ * In versions higher than 2.9.0, the minor version overflows into the
+ * thousands digit: for example, 2.23.0 is encoded as 4300. This macro will
+ * not be available in SDL 3.x.
+ *
+ * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead.
  */
  */
 #define SDL_COMPILEDVERSION \
 #define SDL_COMPILEDVERSION \
     SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
     SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
+#endif /* SDL_MAJOR_VERSION < 3 */
 
 
 /**
 /**
- *  This macro will evaluate to true if compiled with SDL at least X.Y.Z.
+ * This macro will evaluate to true if compiled with SDL at least X.Y.Z.
  */
  */
 #define SDL_VERSION_ATLEAST(X, Y, Z) \
 #define SDL_VERSION_ATLEAST(X, Y, Z) \
-    (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
+    ((SDL_MAJOR_VERSION >= X) && \
+     (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION >= Y) && \
+     (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION > Y || SDL_PATCHLEVEL >= Z))
 
 
 /**
 /**
  * Get the version of SDL that is linked against your program.
  * Get the version of SDL that is linked against your program.
@@ -116,7 +133,7 @@ typedef struct SDL_version
  *
  *
  * This function may be called safely at any time, even before SDL_Init().
  * This function may be called safely at any time, even before SDL_Init().
  *
  *
- * \param ver the SDL_version structure that contains the version information
+ * \param ver the SDL_version structure that contains the version information.
  *
  *
  * \since This function is available since SDL 2.0.0.
  * \since This function is available since SDL 2.0.0.
  *
  *
@@ -185,4 +202,4 @@ extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
 
 
 #endif /* SDL_version_h_ */
 #endif /* SDL_version_h_ */
 
 
-/* vi: set ts=4 sw=4 expandtab: */
+/* vi: set ts=4 sw=4 expandtab: */

File diff suppressed because it is too large
+ 308 - 189
bsp/simulator/SDL2/include/SDL_video.h


+ 18 - 14
bsp/simulator/SDL2/include/SDL_vulkan.h

@@ -20,9 +20,9 @@
 */
 */
 
 
 /**
 /**
- *  \file SDL_vulkan.h
+ * # CategoryVulkan
  *
  *
- *  Header file for functions to creating Vulkan surfaces on SDL windows.
+ * Header file for functions to creating Vulkan surfaces on SDL windows.
  */
  */
 
 
 #ifndef SDL_vulkan_h_
 #ifndef SDL_vulkan_h_
@@ -52,6 +52,10 @@ extern "C" {
 VK_DEFINE_HANDLE(VkInstance)
 VK_DEFINE_HANDLE(VkInstance)
 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
 
 
+/* Make sure to undef to avoid issues in case of later vulkan include */
+#undef VK_DEFINE_HANDLE
+#undef VK_DEFINE_NON_DISPATCHABLE_HANDLE
+
 #endif /* !NO_SDL_VULKAN_TYPEDEFS */
 #endif /* !NO_SDL_VULKAN_TYPEDEFS */
 
 
 typedef VkInstance SDL_vulkanInstance;
 typedef VkInstance SDL_vulkanInstance;
@@ -97,13 +101,13 @@ typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */
  * supported. Either do not link to the Vulkan loader or link to a dynamic
  * supported. Either do not link to the Vulkan loader or link to a dynamic
  * library version.
  * library version.
  *
  *
- * \param path The platform dependent Vulkan loader library name or NULL
+ * \param path The platform dependent Vulkan loader library name or NULL.
  * \returns 0 on success or -1 if the library couldn't be loaded; call
  * \returns 0 on success or -1 if the library couldn't be loaded; call
  *          SDL_GetError() for more information.
  *          SDL_GetError() for more information.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
  *
  *
- * \sa SDL_Vulkan_GetVkInstanceProcAddr
+ * \sa SDL_Vulkan_GetVkGetInstanceProcAddr
  * \sa SDL_Vulkan_UnloadLibrary
  * \sa SDL_Vulkan_UnloadLibrary
  */
  */
 extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
 extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
@@ -146,11 +150,11 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
  * however, this parameter will likely be removed in future releases
  * however, this parameter will likely be removed in future releases
  *
  *
  * \param window A window for which the required Vulkan instance extensions
  * \param window A window for which the required Vulkan instance extensions
- *               should be retrieved (will be deprecated in a future release)
+ *               should be retrieved (will be deprecated in a future release).
  * \param pCount A pointer to an unsigned int corresponding to the number of
  * \param pCount A pointer to an unsigned int corresponding to the number of
- *               extensions to be returned
+ *               extensions to be returned.
  * \param pNames NULL or a pointer to an array to be filled with required
  * \param pNames NULL or a pointer to an array to be filled with required
- *               Vulkan instance extensions
+ *               Vulkan instance extensions.
  * \returns SDL_TRUE on success, SDL_FALSE on error.
  * \returns SDL_TRUE on success, SDL_FALSE on error.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
@@ -168,10 +172,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *wi
  * `instance` must have been created with extensions returned by
  * `instance` must have been created with extensions returned by
  * SDL_Vulkan_GetInstanceExtensions() enabled.
  * SDL_Vulkan_GetInstanceExtensions() enabled.
  *
  *
- * \param window The window to which to attach the Vulkan surface
- * \param instance The Vulkan instance handle
+ * \param window The window to which to attach the Vulkan surface.
+ * \param instance The Vulkan instance handle.
  * \param surface A pointer to a VkSurfaceKHR handle to output the newly
  * \param surface A pointer to a VkSurfaceKHR handle to output the newly
- *                created surface
+ *                created surface.
  * \returns SDL_TRUE on success, SDL_FALSE on error.
  * \returns SDL_TRUE on success, SDL_FALSE on error.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
@@ -191,9 +195,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
  * platform with high-DPI support (Apple calls this "Retina"), and not
  * platform with high-DPI support (Apple calls this "Retina"), and not
  * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint.
  * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint.
  *
  *
- * \param window an SDL_Window for which the size is to be queried
- * \param w Pointer to the variable to write the width to or NULL
- * \param h Pointer to the variable to write the height to or NULL
+ * \param window an SDL_Window for which the size is to be queried.
+ * \param w Pointer to the variable to write the width to or NULL.
+ * \param h Pointer to the variable to write the height to or NULL.
  *
  *
  * \since This function is available since SDL 2.0.6.
  * \since This function is available since SDL 2.0.6.
  *
  *
@@ -212,4 +216,4 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
 #endif
 #endif
 #include "close_code.h"
 #include "close_code.h"
 
 
-#endif /* SDL_vulkan_h_ */
+#endif /* SDL_vulkan_h_ */

+ 21 - 19
bsp/simulator/SDL2/include/begin_code.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -19,23 +19,25 @@
   3. This notice may not be removed or altered from any source distribution.
   3. This notice may not be removed or altered from any source distribution.
 */
 */
 
 
+/* WIKI CATEGORY: BeginCode */
+
 /**
 /**
- *  \file begin_code.h
- *
- *  This file sets things up for C dynamic library function definitions,
- *  static inlined functions, and structures aligned at 4-byte alignment.
- *  If you don't like ugly C preprocessor code, don't look at this file. :)
+ * begin_code.h sets things up for C dynamic library function definitions,
+ * static inlined functions, and structures aligned at 4-byte alignment.
+ * If you don't like ugly C preprocessor code, don't look at this file. :)
  */
  */
 
 
 /* This shouldn't be nested -- included it around code only. */
 /* This shouldn't be nested -- included it around code only. */
-#ifdef _begin_code_h
+#ifdef SDL_begin_code_h
 #error Nested inclusion of begin_code.h
 #error Nested inclusion of begin_code.h
 #endif
 #endif
-#define _begin_code_h
+#define SDL_begin_code_h
 
 
 #ifndef SDL_DEPRECATED
 #ifndef SDL_DEPRECATED
-#  if (__GNUC__ >= 4)  /* technically, this arrived in gcc 3.1, but oh well. */
+#  if defined(__GNUC__) && (__GNUC__ >= 4)  /* technically, this arrived in gcc 3.1, but oh well. */
 #    define SDL_DEPRECATED __attribute__((deprecated))
 #    define SDL_DEPRECATED __attribute__((deprecated))
+#  elif defined(_MSC_VER)
+#    define SDL_DEPRECATED __declspec(deprecated)
 #  else
 #  else
 #    define SDL_DEPRECATED
 #    define SDL_DEPRECATED
 #  endif
 #  endif
@@ -51,7 +53,7 @@
 
 
 /* Some compilers use a special export keyword */
 /* Some compilers use a special export keyword */
 #ifndef DECLSPEC
 #ifndef DECLSPEC
-# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__)
+# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__)
 #  ifdef DLL_EXPORT
 #  ifdef DLL_EXPORT
 #   define DECLSPEC __declspec(dllexport)
 #   define DECLSPEC __declspec(dllexport)
 #  else
 #  else
@@ -74,7 +76,7 @@
 
 
 /* By default SDL uses the C calling convention */
 /* By default SDL uses the C calling convention */
 #ifndef SDLCALL
 #ifndef SDLCALL
-#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
+#if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
 #define SDLCALL __cdecl
 #define SDLCALL __cdecl
 #elif defined(__OS2__) || defined(__EMX__)
 #elif defined(__OS2__) || defined(__EMX__)
 #define SDLCALL _System
 #define SDLCALL _System
@@ -107,7 +109,7 @@
 #ifdef __BORLANDC__
 #ifdef __BORLANDC__
 #pragma nopackwarning
 #pragma nopackwarning
 #endif
 #endif
-#ifdef _M_X64
+#ifdef _WIN64
 /* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
 /* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
 #pragma pack(push,8)
 #pragma pack(push,8)
 #else
 #else
@@ -170,18 +172,18 @@
     (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
     (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
 #define SDL_FALLTHROUGH [[fallthrough]]
 #define SDL_FALLTHROUGH [[fallthrough]]
 #else
 #else
-#if defined(__has_attribute)
-#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__)
+#if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC)
+#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
 #else
 #else
-#define _HAS_FALLTHROUGH 0
+#define SDL_HAS_FALLTHROUGH 0
 #endif /* __has_attribute */
 #endif /* __has_attribute */
-#if _HAS_FALLTHROUGH && \
+#if SDL_HAS_FALLTHROUGH && \
    ((defined(__GNUC__) && __GNUC__ >= 7) || \
    ((defined(__GNUC__) && __GNUC__ >= 7) || \
     (defined(__clang_major__) && __clang_major__ >= 10))
     (defined(__clang_major__) && __clang_major__ >= 10))
 #define SDL_FALLTHROUGH __attribute__((__fallthrough__))
 #define SDL_FALLTHROUGH __attribute__((__fallthrough__))
 #else
 #else
 #define SDL_FALLTHROUGH do {} while (0) /* fallthrough */
 #define SDL_FALLTHROUGH do {} while (0) /* fallthrough */
-#endif /* _HAS_FALLTHROUGH */
-#undef _HAS_FALLTHROUGH
+#endif /* SDL_HAS_FALLTHROUGH */
+#undef SDL_HAS_FALLTHROUGH
 #endif /* C++17 or C2x */
 #endif /* C++17 or C2x */
-#endif /* SDL_FALLTHROUGH not defined */
+#endif /* SDL_FALLTHROUGH not defined */

+ 4 - 4
bsp/simulator/SDL2/include/close_code.h

@@ -1,6 +1,6 @@
 /*
 /*
   Simple DirectMedia Layer
   Simple DirectMedia Layer
-  Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
+  Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
 
 
   This software is provided 'as-is', without any express or implied
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   warranty.  In no event will the authors be held liable for any damages
@@ -26,10 +26,10 @@
  *  after you finish any function and structure declarations in your headers
  *  after you finish any function and structure declarations in your headers
  */
  */
 
 
-#ifndef _begin_code_h
+#ifndef SDL_begin_code_h
 #error close_code.h included without matching begin_code.h
 #error close_code.h included without matching begin_code.h
 #endif
 #endif
-#undef _begin_code_h
+#undef SDL_begin_code_h
 
 
 /* Reset structure packing at previous byte alignment */
 /* Reset structure packing at previous byte alignment */
 #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
 #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
@@ -37,4 +37,4 @@
 #pragma nopackwarning
 #pragma nopackwarning
 #endif
 #endif
 #pragma pack(pop)
 #pragma pack(pop)
-#endif /* Compiler needs structure packing set */
+#endif /* Compiler needs structure packing set */

BIN
bsp/simulator/SDL2/lib/x64/SDL2.dll


BIN
bsp/simulator/SDL2/lib/x64/SDL2.lib


BIN
bsp/simulator/SDL2/lib/x64/SDL2.pdb


BIN
bsp/simulator/SDL2/lib/x64/SDL2main.lib


BIN
bsp/simulator/SDL2/lib/x64/SDL2test.lib


Some files were not shown because too many files changed in this diff