From b790760c523cfbaed04d0ec038293488a9cb1bc7 Mon Sep 17 00:00:00 2001 From: Humberto Dias Date: Mon, 7 Sep 2026 16:55:13 -0300 Subject: [PATCH] Build SDL 1.2, SDL2, and SDL3 from upstream tarballs with PPU patches. Replace the old PSL1GHT SDL snapshots and shift later library scripts so the SDL stack occupies 013-029. --- .github/workflows/build.yml | 83 +- archives/archives.txt | 21 +- cmake/ps3dev.toolchain.cmake | 92 + cmake/sdl3.cmake | 57 + depends/check-cmake.sh | 4 + patches/SDL-1.2.15-PPU.patch | 101 + patches/SDL2-2.30.1-PPU.patch | 4476 +++++++++++++++++ patches/SDL3-3.5.0-PPU.patch | 4301 ++++++++++++++++ patches/SDL3_gfx-1.patch | 78 + patches/SDL3_image-1.patch | 13 + patches/SDL3_net-1.patch | 389 ++ patches/SDL3_ttf-1.patch | 13 + patches/SDL_image-1.2.10.patch | 12 + patches/SDL_mixer-1.2.11.patch | 107 + patches/SDL_net-1.2.7.patch | 27 + patches/SDL_ttf-2.0.10.patch | 12 + scripts/013-SDL-1.2.15.sh | 45 + scripts/013-sdl_psl1ght.sh | 21 - scripts/014-SDL_mixer-1.2.11.sh | 46 + scripts/014-sdl2_psl1ght.sh | 21 - scripts/015-SDL_image-1.2.10.sh | 42 + scripts/015-sdl_psl1ght_libs.sh | 26 - scripts/016-SDL_gfx-2.0.27.sh | 41 + scripts/017-SDL_net-1.2.7.sh | 40 + scripts/018-SDL_ttf-2.0.10.sh | 41 + scripts/019-SDL2-2.31.0.sh | 40 + ...mixer-2.0.4.sh => 020-SDL2_mixer-2.8.0.sh} | 16 +- scripts/021-SDL2_image-2.8.2.sh | 46 + scripts/022-SDL2_ttf-2.22.0.sh | 41 + scripts/023-SDL2_gfx-1.0.4.sh | 40 + scripts/024-SDL3-3.5.0.sh | 31 + scripts/025-SDL3_mixer-3.2.4.sh | 27 + scripts/026-SDL3_image-3.4.6.sh | 30 + scripts/027-SDL3_net-3.2.0.sh | 30 + scripts/028-SDL3_ttf-3.2.2.sh | 33 + scripts/029-SDL3_gfx-1.0.1.sh | 31 + ...olarssl-1.3.9.sh => 030-polarssl-1.3.9.sh} | 0 ...dTLS-2.28.10.sh => 031-mbedTLS-2.28.10.sh} | 0 ...ibmad-0.15.1b.sh => 032-libmad-0.15.1b.sh} | 0 .../{020-flac-1.2.1.sh => 033-flac-1.2.1.sh} | 0 .../{021-faad2-2.7.sh => 034-faad2-2.7.sh} | 0 ...theora-1.1.1.sh => 035-libtheora-1.1.1.sh} | 0 scripts/{023-NoRSX.sh => 036-NoRSX.sh} | 0 scripts/{024-libjson.sh => 037-libjson.sh} | 0 scripts/{025-debugnet.sh => 038-debugnet.sh} | 0 ...{026-ps3soundlib.sh => 039-ps3soundlib.sh} | 0 ...iny3d_libfont.sh => 040-tiny3d_libfont.sh} | 0 ...ibcurl-7.64.1.sh => 041-libcurl-7.64.1.sh} | 0 scripts/{029-libunrar.sh => 042-libunrar.sh} | 0 scripts/{030-libnfs.sh => 043-libnfs.sh} | 0 scripts/{031-libsmb2.sh => 044-libsmb2.sh} | 0 ...{032-pthread-emb.sh => 045-pthread-emb.sh} | 0 utils/utils.sh | 23 + 53 files changed, 10394 insertions(+), 103 deletions(-) create mode 100644 cmake/ps3dev.toolchain.cmake create mode 100644 cmake/sdl3.cmake create mode 100755 depends/check-cmake.sh create mode 100644 patches/SDL-1.2.15-PPU.patch create mode 100644 patches/SDL2-2.30.1-PPU.patch create mode 100644 patches/SDL3-3.5.0-PPU.patch create mode 100644 patches/SDL3_gfx-1.patch create mode 100644 patches/SDL3_image-1.patch create mode 100644 patches/SDL3_net-1.patch create mode 100644 patches/SDL3_ttf-1.patch create mode 100644 patches/SDL_image-1.2.10.patch create mode 100644 patches/SDL_mixer-1.2.11.patch create mode 100644 patches/SDL_net-1.2.7.patch create mode 100644 patches/SDL_ttf-2.0.10.patch create mode 100755 scripts/013-SDL-1.2.15.sh delete mode 100755 scripts/013-sdl_psl1ght.sh create mode 100755 scripts/014-SDL_mixer-1.2.11.sh delete mode 100755 scripts/014-sdl2_psl1ght.sh create mode 100755 scripts/015-SDL_image-1.2.10.sh delete mode 100755 scripts/015-sdl_psl1ght_libs.sh create mode 100755 scripts/016-SDL_gfx-2.0.27.sh create mode 100755 scripts/017-SDL_net-1.2.7.sh create mode 100755 scripts/018-SDL_ttf-2.0.10.sh create mode 100755 scripts/019-SDL2-2.31.0.sh rename scripts/{016-SDL2_mixer-2.0.4.sh => 020-SDL2_mixer-2.8.0.sh} (73%) create mode 100755 scripts/021-SDL2_image-2.8.2.sh create mode 100755 scripts/022-SDL2_ttf-2.22.0.sh create mode 100755 scripts/023-SDL2_gfx-1.0.4.sh create mode 100755 scripts/024-SDL3-3.5.0.sh create mode 100755 scripts/025-SDL3_mixer-3.2.4.sh create mode 100755 scripts/026-SDL3_image-3.4.6.sh create mode 100755 scripts/027-SDL3_net-3.2.0.sh create mode 100755 scripts/028-SDL3_ttf-3.2.2.sh create mode 100755 scripts/029-SDL3_gfx-1.0.1.sh rename scripts/{017-polarssl-1.3.9.sh => 030-polarssl-1.3.9.sh} (100%) rename scripts/{018-mbedTLS-2.28.10.sh => 031-mbedTLS-2.28.10.sh} (100%) rename scripts/{019-libmad-0.15.1b.sh => 032-libmad-0.15.1b.sh} (100%) rename scripts/{020-flac-1.2.1.sh => 033-flac-1.2.1.sh} (100%) rename scripts/{021-faad2-2.7.sh => 034-faad2-2.7.sh} (100%) rename scripts/{022-libtheora-1.1.1.sh => 035-libtheora-1.1.1.sh} (100%) rename scripts/{023-NoRSX.sh => 036-NoRSX.sh} (100%) rename scripts/{024-libjson.sh => 037-libjson.sh} (100%) rename scripts/{025-debugnet.sh => 038-debugnet.sh} (100%) rename scripts/{026-ps3soundlib.sh => 039-ps3soundlib.sh} (100%) rename scripts/{027-tiny3d_libfont.sh => 040-tiny3d_libfont.sh} (100%) rename scripts/{028-libcurl-7.64.1.sh => 041-libcurl-7.64.1.sh} (100%) rename scripts/{029-libunrar.sh => 042-libunrar.sh} (100%) rename scripts/{030-libnfs.sh => 043-libnfs.sh} (100%) rename scripts/{031-libsmb2.sh => 044-libsmb2.sh} (100%) rename scripts/{032-pthread-emb.sh => 045-pthread-emb.sh} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f34734d..8c04355c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Install Linux requirements if: matrix.os == 'linux' run: | - sudo apt-get -y install gcc libelf-dev autoconf automake bison flex make texinfo patch wget zlib1g-dev libtool-bin bzip2 pkg-config libssl-dev + sudo apt-get -y install gcc libelf-dev autoconf automake bison flex make cmake texinfo patch wget zlib1g-dev libtool-bin bzip2 pkg-config libssl-dev - name: Install MacOS requirements if: matrix.os == 'macos' @@ -42,7 +42,7 @@ jobs: HOMEBREW_NO_ENV_HINTS: 1 run: | eval "$(brew shellenv)" - brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo + brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo cmake - name: Create build folder run: | @@ -135,66 +135,105 @@ jobs: - name: Build Libxml2 2.7.8 run: ./libraries.sh 012 - - name: Build Sdl_psl1ght + - name: Build SDL 1.2.15 run: ./libraries.sh 013 - - name: Build Sdl2_psl1ght + - name: Build SDL_mixer 1.2.11 run: ./libraries.sh 014 - - name: Build Sdl_psl1ght_libs + - name: Build SDL_image 1.2.10 run: ./libraries.sh 015 - - name: Build SDL2_mixer 2.0.4 + - name: Build SDL_gfx 2.0.27 run: ./libraries.sh 016 - - name: Build Polarssl 1.3.9 + - name: Build SDL_net 1.2.7 run: ./libraries.sh 017 - - name: Build MbedTLS 2.28.10 + - name: Build SDL_ttf 2.0.10 run: ./libraries.sh 018 - - name: Build Libmad 0.15.1b + - name: Build SDL2 2.31.0 run: ./libraries.sh 019 - - name: Build Flac 1.2.1 + - name: Build SDL2_mixer 2.8.0 run: ./libraries.sh 020 - - name: Build Faad2 2.7 + - name: Build SDL2_image 2.8.2 run: ./libraries.sh 021 - - name: Build Libtheora 1.1.1 + - name: Build SDL2_ttf 2.22.0 run: ./libraries.sh 022 - - name: Build NoRSX + - name: Build SDL2_gfx 1.0.4 run: ./libraries.sh 023 - - name: Build Libjson + - name: Build SDL3 3.5.0 run: ./libraries.sh 024 - - name: Build Debugnet + - name: Build SDL3_mixer 3.2.4 run: ./libraries.sh 025 - - name: Build Ps3soundlib + - name: Build SDL3_image 3.4.6 run: ./libraries.sh 026 - - name: Build Tiny3d_libfont + - name: Build SDL3_net 3.2.0 run: ./libraries.sh 027 - - name: Build Libcurl 7.64.1 + - name: Build SDL3_ttf 3.2.2 run: ./libraries.sh 028 - - name: Build Libunrar + - name: Build SDL3_gfx 1.0.1 run: ./libraries.sh 029 - - name: Build Libnfs + - name: Build Polarssl 1.3.9 run: ./libraries.sh 030 - - name: Build Libsmb2 + - name: Build MbedTLS 2.28.10 run: ./libraries.sh 031 - - name: Build Pthread-emb + - name: Build Libmad 0.15.1b run: ./libraries.sh 032 + - name: Build Flac 1.2.1 + run: ./libraries.sh 033 + + - name: Build Faad2 2.7 + run: ./libraries.sh 034 + + - name: Build Libtheora 1.1.1 + run: ./libraries.sh 035 + + - name: Build NoRSX + run: ./libraries.sh 036 + + - name: Build Libjson + run: ./libraries.sh 037 + + - name: Build Debugnet + run: ./libraries.sh 038 + + - name: Build Ps3soundlib + run: ./libraries.sh 039 + + - name: Build Tiny3d_libfont + run: ./libraries.sh 040 + + - name: Build Libcurl 7.64.1 + run: ./libraries.sh 041 + + - name: Build Libunrar + run: ./libraries.sh 042 + + - name: Build Libnfs + run: ./libraries.sh 043 + + - name: Build Libsmb2 + run: ./libraries.sh 044 + + - name: Build Pthread-emb + run: ./libraries.sh 045 + - name: Build Package run: | cd $PSL1GHT diff --git a/archives/archives.txt b/archives/archives.txt index d0f49b9d..b37a6280 100644 --- a/archives/archives.txt +++ b/archives/archives.txt @@ -10,7 +10,17 @@ e63f5dc1b33fd1c02a881d5a819620634a69d1e4ce8637261ca0cb0fbc9f9dca 304965 https: 67b76d075fb74f7cb32e7e4b217701674755fe6cee0f463b259a753fce691da6 1436968 https://download.osgeo.org/libtiff/old/tiff-3.9.4.tar.gz 2d7598cd2a8c61c023f27c9c7c1aca8bbfd92aadbee2f98b7a6d421eae35c929 611590 https://mikmod.raphnet.net/files/libmikmod-3.1.11.tar.gz cda23bc9ebd26474ca8f3d67e7d1c4a1f1e7106364b690d822e009fdc3c417ec 4881808 http://xmlsoft.org/sources/libxml2-2.7.8.tar.gz -b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419 11125077 https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz +dfb15ac5f8ce7a4952dc12d2aed9747518c5e6b335c0e31636d23f93c630f419 1693451 http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-2.0.27.tar.gz +75e05d1e95f6277b44797157d9e25a908ba8d08a393216ffb019b0d74de11876 1332906 https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.tar.gz +86145ac39cac6d2c6169c226f937648dca5e89dcd828751763dd174fa9af9cf9 2690654 https://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.11.tar.gz +2ce7c84e62ff8117b9f205758bcce68ea603e08bc9d6936ded343735b8b77c53 373866 https://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.7.tar.gz +7d38704bcc7c34029c2dcb73b2d4857e8ad76341c6e0faed279eb9f743c66c6a 1326737 https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.10.tar.gz +8f486bbfbcf8464dd58c9e5d93394ab0255ce68b51c5a966a918244820a76ddc 11362515 https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.2/SDL2_image-2.8.2.tar.gz +1cfb34c87b26dbdbc7afd68c4f545c0116ab5f90bbfecc5aebe2a9cb4bb31549 10874471 https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.tar.gz +d48cbd1ce475b9e178206bf3b72d56b66d84d44f64ac05803328396234d67723 14314901 https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-2.22.0.tar.gz +63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262 1230588 http://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.4.tar.gz +5172f97606100080603a48e5279a2b90213905c77e17953ce2a13cff03e10bef 3743019 https://github.com/libsdl-org/SDL-1.2/archive/refs/tags/release-1.2.15.tar.gz -> SDL-1.2.15.tar.gz +01215ffbc8cfc4ad165ba7573750f15ddda1f971d5a66e9dcaffd37c587f473a 7428023 https://github.com/libsdl-org/SDL/releases/download/release-2.30.1/SDL2-2.30.1.tar.gz d3605afc28ed4b7d1d9e3142d72e42855e4a23c07c951bbb0299556b02d36755 1741396 https://mirror2.openwrt.org/sources/polarssl-1.3.9-gpl.tgz 432d3f466644b9416bc5b649d344116a753aeaa520c8beaf024a90cba9d3d35d 4008103 https://curl.haxx.se/download/curl-7.64.1.tar.gz bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690 502379 https://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz @@ -19,9 +29,6 @@ ee26ed1e177c0cd8fa8458a481b14a0b24ca0b51468c8b4c8b676fd3ceccd330 1137407 https: b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc 1903175 https://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 9988283408c71838d8d62e5418e5abb5eb5300bd84c385fdc96143b5e8f10ed5 455089 https://codeload.github.com/json-c/json-c/tar.gz/json-c-0.11-20130402 -> json-c-0.11-20130402.tar.gz 19e5b81fdac0fe22009b9e2bdcd52d7dcafbf62bc67fc59cf0a76b5b5540d149 3489179 https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-2.28.10/mbedtls-2.28.10.tar.bz2 -- - https://github.com/zeldin/SDL_PSL1GHT/tarball/master -> sdl_psl1ght.tar.gz -- - https://github.com/zeldin/SDL_PSL1GHT_Libs/tarball/master -> sdl_psl1ght_libs.tar.gz -- - https://github.com/shagkur/SDL_PSL1GHT/archive/refs/heads/sdl2_master.tar.gz -> sdl2_psl1ght.tar.gz - - https://github.com/wargio/NoRSX/tarball/master -> NoRSX.tar.gz - - https://github.com/sergiou87/ps3debugnet/tarball/master -> ps3debugnet.tar.gz - - https://github.com/wargio/ps3soundlib/tarball/master -> ps3soundlib.tar.gz @@ -31,3 +38,9 @@ b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc 1903175 https: - - https://github.com/sahlberg/libsmb2/tarball/master -> libsmb2.tar.gz - - https://github.com/clienthax/psl1ght/tarball/master -> psl1ght.tar.gz - - https://github.com/bucanero/pthread-emb-ps3/tarball/master -> pthread-emb-ps3.tar.gz +b7eef526854ca06935fa3c235467914c521ef3584c28914820ec6342fcaf9c5a 16502097 https://github.com/libsdl-org/SDL/archive/f2c4ef111d9892f0332f60568b1e646fa51cdf98.tar.gz -> SDL3-3.5.0.tar.gz +d2e4637ae700f72e5196b8fbd749850ed2e5e1e09c5a5be8d06ff55aaccf3b01 8604748 https://github.com/libsdl-org/SDL_image/releases/download/release-3.4.6/SDL3_image-3.4.6.tar.gz +182a07c745375e113dc740d43964ff21b0be29f29f59876c4dbc4db3d32f6901 5161139 https://github.com/libsdl-org/SDL_mixer/releases/download/release-3.2.4/SDL3_mixer-3.2.4.tar.gz +63547d58d0185c833213885b635a2c0548201cc8f301e6587c0be1a67e1e045d 1545950 https://github.com/libsdl-org/SDL_ttf/releases/download/release-3.2.2/SDL3_ttf-3.2.2.tar.gz +098522fc26d4e302ef9348aee6e76e67fe504dfefd7f596236568f8330570c41 1497570 https://github.com/libsdl-org/SDL_net/releases/download/release-3.2.0/SDL3_net-3.2.0.tar.gz +b92e6002825f92b19e10abe8a974f0c38839f6bfb9b065f2d8dd14c51bf12a77 5139685 https://github.com/sabdul-khabir/SDL3_gfx/archive/refs/tags/v1.0.1.tar.gz -> SDL3_gfx-1.0.1.tar.gz diff --git a/cmake/ps3dev.toolchain.cmake b/cmake/ps3dev.toolchain.cmake new file mode 100644 index 00000000..cb9f83fa --- /dev/null +++ b/cmake/ps3dev.toolchain.cmake @@ -0,0 +1,92 @@ +# +# CMake toolchain for the PS3 PPU (powerpc64-ps3-elf). +# +# Use: +# cmake -DCMAKE_TOOLCHAIN_FILE=$PS3DEV/share/cmake/ps3dev.toolchain.cmake ... +# + +cmake_minimum_required(VERSION 3.12) + +if(DEFINED ENV{PS3DEV}) + set(PS3DEV $ENV{PS3DEV}) +else() + message(FATAL_ERROR "The environment variable PS3DEV needs to be defined.") +endif() + +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR powerpc64) +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + +set(CMAKE_C_COMPILER powerpc64-ps3-elf-gcc) +set(CMAKE_CXX_COMPILER powerpc64-ps3-elf-g++) +set(CMAKE_ASM_COMPILER powerpc64-ps3-elf-g++) + +set(PPC_INC + ${PS3DEV}/ppu/include + ${PS3DEV}/ppu/include/simdmath + ${PS3DEV}/portlibs/ppu/include +) +set(PPC_LIB + ${PS3DEV}/ppu/lib + ${PS3DEV}/ppu/ppu/lib + ${PS3DEV}/portlibs/ppu/lib +) + +set(PPC_MACHDEP -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections) +set(PPC_CFLAGS -O2 -Wall -mcpu=cell ${PPC_MACHDEP}) +set(PPC_LDFLAGS -Wl,-zmax-page-size=128) +set(PPC_LIBS -lgcm_sys -lrsx -lsysutil -lio -lm -lz -lrt -llv2 -laudio) + +string(JOIN " " PPC_CFLAGS_STR ${PPC_CFLAGS}) +string(JOIN " " PPC_LDFLAGS_STR ${PPC_LDFLAGS}) +string(JOIN " " PPC_LIBS_STR ${PPC_LIBS}) +list(TRANSFORM PPC_INC PREPEND "-I" OUTPUT_VARIABLE PPC_INC_FLAGS) +string(JOIN " " PPC_INC_STR ${PPC_INC_FLAGS}) +list(TRANSFORM PPC_LIB PREPEND "-L" OUTPUT_VARIABLE PPC_LIB_FLAGS) +string(JOIN " " PPC_LIB_STR ${PPC_LIB_FLAGS}) + +set(CMAKE_C_FLAGS_INIT "${PPC_CFLAGS_STR} ${PPC_INC_STR}") +set(CMAKE_CXX_FLAGS_INIT ${CMAKE_C_FLAGS_INIT}) +set(CMAKE_EXE_LINKER_FLAGS_INIT "${PPC_LDFLAGS_STR} ${PPC_LIB_STR}") +set(CMAKE_SHARED_LINKER_FLAGS "${PPC_LIBS_STR}") + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + +set(CMAKE_INSTALL_PREFIX "${PS3DEV}/portlibs/ppu" CACHE PATH "" FORCE) +set(CMAKE_PREFIX_PATH "${PS3DEV}/portlibs/ppu" CACHE PATH "" FORCE) +set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + +set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) + +add_compile_definitions(PS3 __PS3__) +set(PS3 TRUE) + +macro(ps3_target_setup target) + target_compile_options(${target} PRIVATE ${PPC_CFLAGS}) + target_link_options(${target} PRIVATE ${PPC_LDFLAGS}) + target_link_directories(${target} PRIVATE ${PPC_LIB}) + target_include_directories(${target} PUBLIC ${PPC_INC}) + target_link_libraries(${target} PUBLIC ${PPC_LIBS}) +endmacro() + +function(ps3_build_self target) + set(ELF_FILE $) + set(STRIPPED_ELF ${ELF_FILE}.stripped.elf) + set(SELF_FILE ${ELF_FILE}.self) + set(FSELF_FILE ${ELF_FILE}.fake.self) + + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND echo "Running PS3 post-build steps..." + COMMAND ${PS3DEV}/bin/sprxlinker ${ELF_FILE} + COMMAND ${PS3DEV}/ppu/bin/powerpc64-ps3-elf-strip --strip-debug ${ELF_FILE} -o ${STRIPPED_ELF} + COMMAND ${PS3DEV}/bin/make_self ${STRIPPED_ELF} ${SELF_FILE} + COMMAND ${PS3DEV}/bin/fself ${STRIPPED_ELF} ${FSELF_FILE} + COMMAND echo "Done: ${SELF_FILE}" + ) +endfunction() diff --git a/cmake/sdl3.cmake b/cmake/sdl3.cmake new file mode 100644 index 00000000..03d12c9b --- /dev/null +++ b/cmake/sdl3.cmake @@ -0,0 +1,57 @@ +# Cache preload for SDL3, SDL3_image, SDL3_mixer, SDL3_net, SDL3_ttf, and SDL3_gfx on PS3. +# cmake -C path/to/sdl3.cmake ... + +# SDL3 +set(SDL_TESTS OFF CACHE BOOL "" FORCE) +set(SDL_EXAMPLES OFF CACHE BOOL "" FORCE) +set(SDL_TEST_LIBRARY OFF CACHE BOOL "" FORCE) +set(SDL_STATIC ON CACHE BOOL "" FORCE) +set(SDL_GPU OFF CACHE BOOL "" FORCE) +set(SDL_CAMERA OFF CACHE BOOL "" FORCE) +set(SDL_HAPTIC OFF CACHE BOOL "" FORCE) +set(SDL_HIDAPI OFF CACHE BOOL "" FORCE) +set(SDL_POWER OFF CACHE BOOL "" FORCE) +set(SDL_SENSOR OFF CACHE BOOL "" FORCE) +set(SDL_DIALOG OFF CACHE BOOL "" FORCE) +set(SDL_DISKAUDIO OFF CACHE BOOL "" FORCE) +set(SDL_DUMMYAUDIO OFF CACHE BOOL "" FORCE) +set(SDL_DUMMYCAMERA OFF CACHE BOOL "" FORCE) +set(SDL_DUMMYVIDEO OFF CACHE BOOL "" FORCE) +set(SDL_OFFSCREEN OFF CACHE BOOL "" FORCE) +set(SDL_RENDER_GPU OFF CACHE BOOL "" FORCE) +set(SDL_TRAY OFF CACHE BOOL "" FORCE) +set(SDL_VIRTUAL_JOYSTICK OFF CACHE BOOL "" FORCE) + +# SDL3_image — stb for PNG/JPEG (portlibs libpng 1.4 lacks png_const_structp) +set(SDLIMAGE_SAMPLES OFF CACHE BOOL "" FORCE) +set(SDLIMAGE_TESTS OFF CACHE BOOL "" FORCE) +set(SDLIMAGE_VENDORED OFF CACHE BOOL "" FORCE) +set(SDLIMAGE_BACKEND_STB ON CACHE BOOL "" FORCE) +set(SDLIMAGE_PNG_LIBPNG OFF CACHE BOOL "" FORCE) +set(SDLIMAGE_AVIF OFF CACHE BOOL "" FORCE) +set(SDLIMAGE_JXL OFF CACHE BOOL "" FORCE) +set(SDLIMAGE_TIF OFF CACHE BOOL "" FORCE) +set(SDLIMAGE_WEBP OFF CACHE BOOL "" FORCE) + +# SDL3_mixer +set(SDLMIXER_TESTS OFF CACHE BOOL "" FORCE) +set(SDLMIXER_TESTS_INSTALL OFF CACHE BOOL "" FORCE) +set(SDLMIXER_EXAMPLES OFF CACHE BOOL "" FORCE) +set(SDLMIXER_OPUS OFF CACHE BOOL "" FORCE) +set(SDLMIXER_VORBIS_VORBISFILE OFF CACHE BOOL "" FORCE) +set(SDLMIXER_WAVPACK OFF CACHE BOOL "" FORCE) +set(SDLMIXER_FLAC OFF CACHE BOOL "" FORCE) +set(SDLMIXER_MP3_MPG123 OFF CACHE BOOL "" FORCE) +set(SDLMIXER_GME OFF CACHE BOOL "" FORCE) +set(SDLMIXER_MIDI_TIMIDITY OFF CACHE BOOL "" FORCE) + +# SDL3_net +set(SDLNET_SAMPLES OFF CACHE BOOL "" FORCE) + +# SDL3_ttf +set(SDLTTF_VENDORED ON CACHE BOOL "" FORCE) +set(SDLTTF_HARFBUZZ OFF CACHE BOOL "" FORCE) +set(SDLTTF_SAMPLES OFF CACHE BOOL "" FORCE) + +# SDL3_gfx +set(BUILD_TESTS OFF CACHE BOOL "" FORCE) diff --git a/depends/check-cmake.sh b/depends/check-cmake.sh new file mode 100755 index 00000000..5c6a7c7c --- /dev/null +++ b/depends/check-cmake.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +## Check for cmake. +which cmake 1> /dev/null || { echo "ERROR: Install cmake before continuing."; exit 1; } diff --git a/patches/SDL-1.2.15-PPU.patch b/patches/SDL-1.2.15-PPU.patch new file mode 100644 index 00000000..a24b82d1 --- /dev/null +++ b/patches/SDL-1.2.15-PPU.patch @@ -0,0 +1,101 @@ +diff -Nru SDL-1.2.15/configure.in SDL-1.2.15/configure.in +--- SDL-1.2.15/configure.in 2012-01-20 22:49:48 ++++ SDL-1.2.15/configure.in 2026-09-05 20:25:36 +@@ -2805,6 +2805,19 @@ + have_timers=yes + fi + ;; ++ powerpc64-ps3-elf*) ++ ARCH=psl1ght ++ EXTRA_CFLAGS="$EXTRA_CFLAGS -D__PSL1GHT__ -DHAVE_POW -DHAVE_MMAP=0" ++ EXTRA_CFLAGS="$EXTRA_CFLAGS -I\"$PSL1GHT/ppu/include\" -mcpu=cell" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt -llv2" ++ CheckDummyVideo ++ CheckDummyAudio ++ if test x$enable_timers = xyes; then ++ AC_DEFINE(SDL_TIMER_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/timer/psl1ght/*.c" ++ have_timers=yes ++ fi ++ ;; + *-riscos) + ARCH=riscos + CheckOSS +diff -Nru SDL-1.2.15/include/SDL_config.h.in SDL-1.2.15/include/SDL_config.h.in +--- SDL-1.2.15/include/SDL_config.h.in 2012-01-20 22:49:48 ++++ SDL-1.2.15/include/SDL_config.h.in 2026-09-05 20:25:36 +@@ -249,6 +249,7 @@ + #undef SDL_TIMER_OS2 + #undef SDL_TIMER_RISCOS + #undef SDL_TIMER_UNIX ++#undef SDL_TIMER_PSL1GHT + #undef SDL_TIMER_WIN32 + #undef SDL_TIMER_WINCE + +diff -Nru SDL-1.2.15/include/SDL_platform.h SDL-1.2.15/include/SDL_platform.h +--- SDL-1.2.15/include/SDL_platform.h 2012-01-20 22:49:48 ++++ SDL-1.2.15/include/SDL_platform.h 2026-09-05 20:25:36 +@@ -86,6 +86,10 @@ + #undef __OS2__ + #define __OS2__ 1 + #endif ++#if defined(__PS3__) || defined(__PSL1GHT__) ++#undef __PS3__ ++#define __PS3__ 1 ++#endif + #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) + #undef __OSF__ + #define __OSF__ 1 +diff -Nru SDL-1.2.15/src/timer/psl1ght/SDL_systimer.c SDL-1.2.15/src/timer/psl1ght/SDL_systimer.c +--- SDL-1.2.15/src/timer/psl1ght/SDL_systimer.c 1969-12-31 21:00:00 ++++ SDL-1.2.15/src/timer/psl1ght/SDL_systimer.c 2026-09-05 20:25:36 +@@ -0,0 +1,49 @@ ++#include "SDL_config.h" ++ ++#ifdef SDL_TIMER_PSL1GHT ++ ++#include ++#include ++ ++#include "SDL_timer.h" ++#include "../SDL_timer_c.h" ++ ++static struct timeval start; ++ ++void SDL_StartTicks(void) ++{ ++ gettimeofday(&start, NULL); ++} ++ ++Uint32 SDL_GetTicks(void) ++{ ++ struct timeval now; ++ gettimeofday(&now, NULL); ++ return (Uint32)((now.tv_sec - start.tv_sec) * 1000 + (now.tv_usec - start.tv_usec) / 1000); ++} ++ ++void SDL_Delay(Uint32 ms) ++{ ++ usleep(ms * 1000); ++} ++ ++int SDL_SYS_TimerInit(void) ++{ ++ return 0; ++} ++ ++void SDL_SYS_TimerQuit(void) ++{ ++} ++ ++int SDL_SYS_StartTimer(void) ++{ ++ SDL_SetError("Timers are not supported on this platform"); ++ return -1; ++} ++ ++void SDL_SYS_StopTimer(void) ++{ ++} ++ ++#endif /* SDL_TIMER_PSL1GHT */ diff --git a/patches/SDL2-2.30.1-PPU.patch b/patches/SDL2-2.30.1-PPU.patch new file mode 100644 index 00000000..997711b2 --- /dev/null +++ b/patches/SDL2-2.30.1-PPU.patch @@ -0,0 +1,4476 @@ +diff -Nru SDL2-2.30.1/CMakeLists.txt SDL2-2.30.1/CMakeLists.txt +--- SDL2-2.30.1/CMakeLists.txt 2024-03-05 19:37:32 ++++ SDL2-2.30.1/CMakeLists.txt 2026-09-05 18:29:55 +@@ -6,7 +6,7 @@ + set(CMAKE_POLICY_DEFAULT_CMP0091 NEW) + + cmake_minimum_required(VERSION 3.0.0...3.5) +-project(SDL2 C CXX) ++project(SDL2 C) + + if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) + set(SDL2_SUBPROJECT OFF) +@@ -15,6 +15,7 @@ + endif() + + if (HAIKU) ++ enable_language(CXX) + set(LINKER_LANGUAGE CXX) + endif() + +@@ -86,8 +87,8 @@ + + # See docs/release_checklist.md + set(SDL_MAJOR_VERSION 2) +-set(SDL_MINOR_VERSION 30) +-set(SDL_MICRO_VERSION 1) ++set(SDL_MINOR_VERSION 31) ++set(SDL_MICRO_VERSION 0) + set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") + + # Set defaults preventing destination file conflicts +@@ -1787,6 +1788,7 @@ + list(APPEND SOURCE_FILES ${CORE_SOURCES}) + + if(WINDOWS_STORE) ++ enable_language(CXX) + file(GLOB WINRT_SOURCE_FILES ${SDL2_SOURCE_DIR}/src/core/winrt/*.c ${SDL2_SOURCE_DIR}/src/core/winrt/*.cpp) + list(APPEND SOURCE_FILES ${WINRT_SOURCE_FILES}) + endif() +diff -Nru SDL2-2.30.1/Makefile.os2 SDL2-2.30.1/Makefile.os2 +--- SDL2-2.30.1/Makefile.os2 2024-03-05 19:37:32 ++++ SDL2-2.30.1/Makefile.os2 2026-09-05 18:29:55 +@@ -14,8 +14,8 @@ + + LIBNAME = SDL2 + MAJOR_VERSION = 2 +-MINOR_VERSION = 30 +-MICRO_VERSION = 1 ++MINOR_VERSION = 31 ++MICRO_VERSION = 0 + VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) + DESCRIPTION = Simple DirectMedia Layer 2 + +diff -Nru SDL2-2.30.1/Makefile.w32 SDL2-2.30.1/Makefile.w32 +--- SDL2-2.30.1/Makefile.w32 2024-03-05 19:37:32 ++++ SDL2-2.30.1/Makefile.w32 2026-09-05 18:29:55 +@@ -5,8 +5,8 @@ + + LIBNAME = SDL2 + MAJOR_VERSION = 2 +-MINOR_VERSION = 30 +-MICRO_VERSION = 1 ++MINOR_VERSION = 31 ++MICRO_VERSION = 0 + VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) + + LIBHOME = . +diff -Nru SDL2-2.30.1/SDL2.spec SDL2-2.30.1/SDL2.spec +--- SDL2-2.30.1/SDL2.spec 2024-03-05 19:37:53 ++++ SDL2-2.30.1/SDL2.spec 1969-12-31 21:00:00 +@@ -1,119 +0,0 @@ +-Summary: Simple DirectMedia Layer +-Name: SDL2 +-Version: 2.30.1 +-Release: 2 +-Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz +-URL: http://www.libsdl.org/ +-License: zlib +-Group: System Environment/Libraries +-BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +-Prefix: %{_prefix} +-%ifos linux +-Provides: libSDL2-2.0.so.0 +-%endif +- +-%define __defattr %defattr(-,root,root) +-%define __soext so +- +-%description +-This is the Simple DirectMedia Layer, a generic API that provides low +-level access to audio, keyboard, mouse, and display framebuffer across +-multiple platforms. +- +-%package devel +-Summary: Libraries, includes and more to develop SDL applications. +-Group: Development/Libraries +-Requires: %{name} = %{version} +- +-%description devel +-This is the Simple DirectMedia Layer, a generic API that provides low +-level access to audio, keyboard, mouse, and display framebuffer across +-multiple platforms. +- +-This is the libraries, include files and other resources you can use +-to develop SDL applications. +- +- +-%prep +-%setup -q +- +-%build +-%ifos linux +-CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-directfb +-%else +-%configure +-%endif +-make +- +-%install +-rm -rf $RPM_BUILD_ROOT +-%ifos linux +-make install prefix=$RPM_BUILD_ROOT%{prefix} \ +- bindir=$RPM_BUILD_ROOT%{_bindir} \ +- libdir=$RPM_BUILD_ROOT%{_libdir} \ +- includedir=$RPM_BUILD_ROOT%{_includedir} \ +- datadir=$RPM_BUILD_ROOT%{_datadir} \ +- mandir=$RPM_BUILD_ROOT%{_mandir} +-%else +-%makeinstall +-%endif +- +-%clean +-rm -rf $RPM_BUILD_ROOT +- +-%files +-%{__defattr} +-%doc README*.txt LICENSE.txt CREDITS.txt BUGS.txt +-%{_libdir}/lib*.%{__soext}.* +- +-%files devel +-%{__defattr} +-%doc docs/README*.md +-%{_bindir}/*-config +-%{_libdir}/lib*.a +-%{_libdir}/lib*.la +-%{_libdir}/lib*.%{__soext} +-%{_includedir}/*/*.h +-%{_libdir}/cmake/* +-%{_libdir}/pkgconfig/SDL2/* +-%{_datadir}/aclocal/* +- +-%changelog +-* Thu Jun 04 2015 Ryan C. Gordon +-- Fixed README paths. +- +-* Sun Dec 07 2014 Simone Contini +-- Fixed changelog date issue and docs filenames +- +-* Sun Jan 22 2012 Sam Lantinga +-- Updated for SDL 2.0 +- +-* Tue May 16 2006 Sam Lantinga +-- Removed support for Darwin, due to build problems on ps2linux +- +-* Sat Jan 03 2004 Anders Bjorklund +-- Added support for Darwin, updated spec file +- +-* Wed Jan 19 2000 Sam Lantinga +-- Re-integrated spec file into SDL distribution +-- 'name' and 'version' come from configure +-- Some of the documentation is devel specific +-- Removed SMP support from %build - it doesn't work with libtool anyway +- +-* Tue Jan 18 2000 Hakan Tandogan +-- Hacked Mandrake sdl spec to build 1.1 +- +-* Sun Dec 19 1999 John Buswell +-- Build Release +- +-* Sat Dec 18 1999 John Buswell +-- Add symlink for libSDL-1.0.so.0 required by sdlbomber +-- Added docs +- +-* Thu Dec 09 1999 Lenny Cartier +-- v 1.0.0 +- +-* Mon Nov 1 1999 Chmouel Boudjnah +-- First spec file for Mandrake distribution. +- +-# end of file +diff -Nru SDL2-2.30.1/VERSION.txt SDL2-2.30.1/VERSION.txt +--- SDL2-2.30.1/VERSION.txt 2024-03-05 19:37:54 ++++ SDL2-2.30.1/VERSION.txt 1969-12-31 21:00:00 +@@ -1 +0,0 @@ +-release-2.30.1-0-g5adbf3765 +diff -Nru SDL2-2.30.1/build-scripts/androidbuild.sh SDL2-2.30.1/build-scripts/androidbuild.sh +--- SDL2-2.30.1/build-scripts/androidbuild.sh 2024-03-05 19:37:32 ++++ SDL2-2.30.1/build-scripts/androidbuild.sh 2026-09-05 18:29:55 +@@ -80,7 +80,8 @@ + cd $folder + done + +-ACTIVITY="${folder}Activity" ++# Uppercase the first char in the activity class name because it's Java ++ACTIVITY="$(echo $folder | awk '{$1=toupper(substr($1,0,1))substr($1,2)}1')Activity" + sed -i -e "s|\"SDLActivity\"|\"$ACTIVITY\"|g" $BUILDPATH/app/src/main/AndroidManifest.xml + + # Fill in a default Activity +diff -Nru SDL2-2.30.1/cmake/sdlchecks.cmake SDL2-2.30.1/cmake/sdlchecks.cmake +--- SDL2-2.30.1/cmake/sdlchecks.cmake 2024-03-05 19:37:32 ++++ SDL2-2.30.1/cmake/sdlchecks.cmake 2026-09-05 18:29:55 +@@ -1249,6 +1249,7 @@ + + if(HAVE_HIDAPI) + if(ANDROID) ++ enable_language(CXX) + list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp) + endif() + if(IOS OR TVOS) +diff -Nru SDL2-2.30.1/configure.ac SDL2-2.30.1/configure.ac +--- SDL2-2.30.1/configure.ac 2024-03-05 19:37:32 ++++ SDL2-2.30.1/configure.ac 2026-09-05 18:29:55 +@@ -12,8 +12,8 @@ + dnl Set various version strings - taken gratefully from the GTk sources + # See docs/release_checklist.md + SDL_MAJOR_VERSION=2 +-SDL_MINOR_VERSION=30 +-SDL_MICRO_VERSION=1 ++SDL_MINOR_VERSION=31 ++SDL_MICRO_VERSION=0 + SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION + + SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION` +@@ -2510,6 +2510,20 @@ + fi + } + ++dnl Set up the Null video driver. ++CheckPSL1GHTVideo() ++{ ++ AC_ARG_ENABLE(video-psl1ght, ++AC_HELP_STRING([--enable-video-psl1ght], [use PSL1GHT video driver [[default=yes]]]), ++ , enable_video_psl1ght=yes) ++ if test x$enable_video_psl1ght = xyes; then ++ AC_DEFINE(SDL_VIDEO_DRIVER_PSL1GHT, 1, [ ]) ++ AC_DEFINE(SDL_VIDEO_RENDER_PSL1GHT, 1, [ ]) ++ SOURCES="$SOURCES $srcdir/src/video/psl1ght/*.c $srcdir/src/render/psl1ght/*.c" ++ have_video=yes ++ fi ++} ++ + dnl Set up the QNX video driver if enabled + CheckQNXVideo() + { +@@ -2699,6 +2713,16 @@ + fi + } + ++dnl Check for PSL1GHT OpenGL ++CheckPSL1GHTGL() ++{ ++ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then ++ AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ]) ++ AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ]) ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lEGL -lGL -lstdc++ -lm" ++ fi ++} ++ + dnl Check for MacOS OpenGL + CheckMacGL() + { +@@ -4484,6 +4508,45 @@ + + if test x$enable_video_metal = xyes -o x$enable_video_vulkan = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal" ++ fi ++ ;; ++ powerpc64-ps3-elf) ++ ARCH=psl1ght ++ EXTRA_CFLAGS="$EXTRA_CFLAGS -D__PSL1GHT__ -DHAVE_POW -DHAVE_MMAP=0 -DDEBUG_ERROR" ++ EXTRA_CFLAGS="$EXTRA_CFLAGS -I\"$PSL1GHT/ppu/include\" -mcpu=cell " ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgcm_sys -lrsx -lsysutil -lio -laudio -lrt -llv2" ++ CheckPSL1GHTVideo ++ CheckDummyAudio ++ #CheckPSL1GHTGL ++ ++ # Set up files for the thread library ++ if test x$enable_threads = xyes; then ++ AC_DEFINE(SDL_THREAD_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/thread/psl1ght/*.c" ++ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" ++ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" ++ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_systls.c" ++ have_threads=yes ++ fi ++ # Set up files for the joystick library ++ if test x$enable_joystick = xyes; then ++ AC_DEFINE(SDL_JOYSTICK_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/joystick/psl1ght/*.c" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lio" ++ have_joystick=yes ++ fi ++ # Set up files for the timer library ++ if test x$enable_timers = xyes; then ++ AC_DEFINE(SDL_TIMER_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/timer/psl1ght/*.c" ++ have_timers=yes ++ fi ++ # Set up files for the audio library ++ if test x$enable_audio = xyes; then ++ AC_DEFINE(SDL_AUDIO_DRIVER_PSL1GHT) ++ SOURCES="$SOURCES $srcdir/src/audio/psl1ght/*.c" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio" ++ have_audio=yes + fi + ;; + *-nacl|*-pnacl) +diff -Nru SDL2-2.30.1/include/SDL_config.h SDL2-2.30.1/include/SDL_config.h +--- SDL2-2.30.1/include/SDL_config.h 2024-03-05 19:37:32 ++++ SDL2-2.30.1/include/SDL_config.h 2026-09-05 18:29:55 +@@ -1,3 +1,4 @@ ++/* include/SDL_config.h. Generated from SDL_config.h.in by configure. */ + /* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga +@@ -22,40 +23,483 @@ + #ifndef SDL_config_h_ + #define SDL_config_h_ + +-#include "SDL_platform.h" +- + /** +- * \file SDL_config.h ++ * \file SDL_config.h.in ++ * ++ * This is a set of defines to configure the SDL features + */ + +-/* 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" ++/* 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 git checkout -f include/SDL_config.h ++#endif ++ ++/* C language features */ ++/* #undef const */ ++/* #undef inline */ ++/* #undef volatile */ ++ ++/* C datatypes */ ++#if defined(__LP64__) || defined(_LP64) || defined(_WIN64) ++#define SIZEOF_VOIDP 8 + #else +-/* This is a minimal configuration just to get SDL running on new platforms. */ +-#include "SDL_config_minimal.h" +-#endif /* platform config */ ++#define SIZEOF_VOIDP 4 ++#endif + +-#ifdef USING_GENERATED_CONFIG_H +-#error Wrong SDL_config.h, check your include path? ++#define HAVE_GCC_ATOMICS 1 ++/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */ ++ ++/* Comment this if you want to build without any C library requirements */ ++#define HAVE_LIBC 1 ++#ifdef HAVE_LIBC ++ ++/* Useful headers */ ++#define STDC_HEADERS 1 ++#define HAVE_ALLOCA_H 1 ++#define HAVE_CTYPE_H 1 ++#define HAVE_FLOAT_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 ++/* #undef HAVE_MEMORY_H */ ++#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 ++/* #undef HAVE_LINUX_INPUT_H */ ++/* #undef HAVE_PTHREAD_NP_H */ ++/* #undef HAVE_LIBUNWIND_H */ ++ ++/* C library functions */ ++/* #undef HAVE_DLOPEN */ ++#define HAVE_MALLOC 1 ++#define HAVE_CALLOC 1 ++#define HAVE_REALLOC 1 ++#define HAVE_FREE 1 ++#define HAVE_ALLOCA 1 ++#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ ++#define HAVE_GETENV 1 ++#define HAVE_SETENV 1 ++#define HAVE_PUTENV 1 ++#define HAVE_UNSETENV 1 + #endif ++#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_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_WCSCASECMP 1 ++/* #undef HAVE__WCSICMP */ ++#define HAVE_WCSNCASECMP 1 ++/* #undef HAVE__WCSNICMP */ ++#define HAVE_STRLEN 1 ++#define HAVE_STRLCPY 1 ++#define HAVE_STRLCAT 1 ++/* #undef HAVE__STRREV */ ++/* #undef HAVE__STRUPR */ ++/* #undef HAVE__STRLWR */ ++#define HAVE_INDEX 1 ++#define HAVE_RINDEX 1 ++#define HAVE_STRCHR 1 ++#define HAVE_STRRCHR 1 ++#define HAVE_STRSTR 1 ++#define HAVE_STRTOK_R 1 ++/* #undef HAVE_ITOA */ ++/* #undef HAVE__LTOA */ ++/* #undef HAVE__UITOA */ ++/* #undef HAVE__ULTOA */ ++#define HAVE_STRTOL 1 ++#define HAVE_STRTOUL 1 ++/* #undef HAVE__I64TOA */ ++/* #undef HAVE__UI64TOA */ ++#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 ++/* #undef HAVE__STRICMP */ ++#define HAVE_STRCASECMP 1 ++/* #undef HAVE__STRNICMP */ ++#define HAVE_STRNCASECMP 1 ++#define HAVE_STRCASESTR 1 ++/* #undef HAVE_SSCANF */ ++#define HAVE_VSSCANF 1 ++/* #undef HAVE_SNPRINTF */ ++#define HAVE_VSNPRINTF 1 ++#define HAVE_M_PI /**/ ++#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 ++/* #undef HAVE_FOPEN64 */ ++#define HAVE_FSEEKO 1 ++/* #undef HAVE_FSEEKO64 */ ++/* #undef HAVE_SIGACTION */ ++/* #undef HAVE_SA_SIGACTION */ ++#define HAVE_SETJMP 1 ++/* #undef HAVE_NANOSLEEP */ ++#ifndef __PSL1GHT__ // Yeah PSL1GHT hasn't sysconf ++/* #undef HAVE_SYSCONF */ ++#endif ++/* #undef HAVE_SYSCTLBYNAME */ ++/* #undef HAVE_CLOCK_GETTIME */ ++/* #undef HAVE_GETPAGESIZE */ ++/* #undef HAVE_MPROTECT */ ++/* #undef HAVE_ICONV */ ++/* #undef SDL_USE_LIBICONV */ ++/* #undef HAVE_PTHREAD_SETNAME_NP */ ++/* #undef HAVE_PTHREAD_SET_NAME_NP */ ++/* #undef HAVE_SEM_TIMEDWAIT */ ++/* #undef HAVE_GETAUXVAL */ ++/* #undef HAVE_ELF_AUX_INFO */ ++/* #undef HAVE_POLL */ ++#define HAVE__EXIT 1 ++ ++#else ++#define HAVE_STDARG_H 1 ++#define HAVE_STDDEF_H 1 ++#define HAVE_STDINT_H 1 ++#endif /* HAVE_LIBC */ ++ ++/* #undef HAVE_O_CLOEXEC */ ++#define HAVE_ALTIVEC_H 1 ++/* #undef HAVE_DBUS_DBUS_H */ ++/* #undef HAVE_FCITX */ ++/* #undef HAVE_SYS_INOTIFY_H */ ++/* #undef HAVE_INOTIFY_INIT */ ++/* #undef HAVE_INOTIFY_INIT1 */ ++/* #undef HAVE_INOTIFY */ ++/* #undef HAVE_IBUS_IBUS_H */ ++/* #undef HAVE_IMMINTRIN_H */ ++/* #undef HAVE_LIBUDEV_H */ ++/* #undef HAVE_LIBUSB */ ++/* #undef HAVE_LIBSAMPLERATE_H */ ++/* #undef HAVE_LIBDECOR_H */ ++/* #undef HAVE_LSXINTRIN_H */ ++/* #undef HAVE_LASXINTRIN_H */ ++ ++/* #undef HAVE_DDRAW_H */ ++/* #undef HAVE_DINPUT_H */ ++/* #undef HAVE_DSOUND_H */ ++/* #undef HAVE_DXGI_H */ ++/* #undef HAVE_WINDOWS_GAMING_INPUT_H */ ++/* #undef HAVE_XINPUT_H */ ++ ++/* #undef HAVE_MMDEVICEAPI_H */ ++/* #undef HAVE_AUDIOCLIENT_H */ ++/* #undef HAVE_TPCSHRD_H */ ++/* #undef HAVE_SENSORSAPI_H */ ++/* #undef HAVE_ROAPI_H */ ++/* #undef HAVE_SHELLSCALINGAPI_H */ ++ ++/* 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_HIDAPI_DISABLED */ ++/* #undef SDL_SENSOR_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 */ ++/* #undef SDL_LOCALE_DISABLED */ ++/* #undef SDL_MISC_DISABLED */ ++ ++/* Enable various audio drivers */ ++/* #undef SDL_AUDIO_DRIVER_AAUDIO */ ++/* #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 */ ++#define SDL_AUDIO_DRIVER_DUMMY 1 ++/* #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_OPENSLES */ ++/* #undef SDL_AUDIO_DRIVER_OSS */ ++/* #undef SDL_AUDIO_DRIVER_PAUDIO */ ++/* #undef SDL_AUDIO_DRIVER_PIPEWIRE */ ++/* #undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC */ ++/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO */ ++/* #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */ ++#define SDL_AUDIO_DRIVER_PSL1GHT 1 ++/* #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_OS2 */ ++ ++/* Enable various input drivers */ ++/* #undef SDL_INPUT_LINUXEV */ ++/* #undef SDL_INPUT_FBSDKBIO */ ++/* #undef SDL_INPUT_LINUXKD */ ++/* #undef SDL_INPUT_WSCONS */ ++/* #undef SDL_JOYSTICK_HAIKU */ ++/* #undef SDL_JOYSTICK_DINPUT */ ++/* #undef SDL_JOYSTICK_WGI */ ++/* #undef SDL_JOYSTICK_XINPUT */ ++/* #undef SDL_JOYSTICK_DUMMY */ ++/* #undef SDL_JOYSTICK_IOKIT */ ++/* #undef SDL_JOYSTICK_MFI */ ++/* #undef SDL_JOYSTICK_LINUX */ ++/* #undef SDL_JOYSTICK_ANDROID */ ++/* #undef SDL_JOYSTICK_OS2 */ ++/* #undef SDL_JOYSTICK_USBHID */ ++/* #undef SDL_HAVE_MACHINE_JOYSTICK_H */ ++/* #undef SDL_JOYSTICK_HIDAPI */ ++/* #undef SDL_JOYSTICK_RAWINPUT */ ++/* #undef SDL_JOYSTICK_EMSCRIPTEN */ ++#define SDL_JOYSTICK_VIRTUAL 1 ++#define SDL_JOYSTICK_PSL1GHT 1 ++#define SDL_HAPTIC_DUMMY 1 ++/* #undef SDL_HAPTIC_ANDROID */ ++/* #undef SDL_HAPTIC_LINUX */ ++/* #undef SDL_HAPTIC_IOKIT */ ++/* #undef SDL_HAPTIC_DINPUT */ ++/* #undef SDL_HAPTIC_XINPUT */ ++ ++/* Enable various sensor drivers */ ++/* #undef SDL_SENSOR_ANDROID */ ++/* #undef SDL_SENSOR_COREMOTION */ ++/* #undef SDL_SENSOR_WINDOWS */ ++#define SDL_SENSOR_DUMMY 1 ++ ++/* Enable various shared object loading systems */ ++/* #undef SDL_LOADSO_DLOPEN */ ++#define SDL_LOADSO_DUMMY 1 ++/* #undef SDL_LOADSO_LDG */ ++/* #undef SDL_LOADSO_WINDOWS */ ++/* #undef SDL_LOADSO_OS2 */ ++ ++/* Enable various threading systems */ ++/* #undef SDL_THREAD_GENERIC_COND_SUFFIX */ ++/* #undef SDL_THREAD_PTHREAD */ ++/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX */ ++/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */ ++/* #undef SDL_THREAD_WINDOWS */ ++/* #undef SDL_THREAD_OS2 */ ++#define SDL_THREAD_PSL1GHT 1 ++ ++/* Enable various timer systems */ ++/* #undef SDL_TIMER_HAIKU */ ++/* #undef SDL_TIMER_DUMMY */ ++#define SDL_TIMER_PSL1GHT 1 ++/* #undef SDL_TIMER_UNIX */ ++/* #undef SDL_TIMER_WINDOWS */ ++/* #undef SDL_TIMER_OS2 */ ++ ++/* 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_WAYLAND_DYNAMIC_LIBDECOR */ ++/* #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_OFFSCREEN */ ++/* #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_XINPUT2 */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */ ++/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */ ++/* #undef SDL_VIDEO_DRIVER_X11_XCURSOR */ ++/* #undef SDL_VIDEO_DRIVER_X11_XDBE */ ++/* #undef SDL_VIDEO_DRIVER_X11_XINPUT2 */ ++/* #undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH */ ++/* #undef SDL_VIDEO_DRIVER_X11_XFIXES */ ++/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */ ++/* #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER */ ++/* #undef SDL_VIDEO_DRIVER_X11_XSHAPE */ ++/* #undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */ ++/* #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_OS2 */ ++/* #undef SDL_VIDEO_DRIVER_QNX */ ++/* #undef SDL_VIDEO_DRIVER_RISCOS */ ++#define SDL_VIDEO_DRIVER_PSL1GHT 1 ++ ++/* #undef SDL_VIDEO_RENDER_D3D */ ++/* #undef SDL_VIDEO_RENDER_D3D11 */ ++/* #undef SDL_VIDEO_RENDER_D3D12 */ ++/* #undef SDL_VIDEO_RENDER_OGL */ ++/* #undef SDL_VIDEO_RENDER_OGL_ES */ ++/* #undef SDL_VIDEO_RENDER_OGL_ES2 */ ++/* #undef SDL_VIDEO_RENDER_DIRECTFB */ ++/* #undef SDL_VIDEO_RENDER_METAL */ ++#define SDL_VIDEO_RENDER_PSL1GHT 1 ++ ++/* 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 Metal support */ ++/* #undef SDL_VIDEO_METAL */ ++ ++/* 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_ANDROID */ ++/* #undef SDL_FILESYSTEM_HAIKU */ ++/* #undef SDL_FILESYSTEM_COCOA */ ++#define SDL_FILESYSTEM_DUMMY 1 ++/* #undef SDL_FILESYSTEM_RISCOS */ ++/* #undef SDL_FILESYSTEM_UNIX */ ++/* #undef SDL_FILESYSTEM_WINDOWS */ ++/* #undef SDL_FILESYSTEM_NACL */ ++/* #undef SDL_FILESYSTEM_EMSCRIPTEN */ ++/* #undef SDL_FILESYSTEM_OS2 */ ++/* #undef SDL_FILESYSTEM_VITA */ ++/* #undef SDL_FILESYSTEM_PSP */ ++/* #undef SDL_FILESYSTEM_PS2 */ ++ ++/* Enable misc subsystem */ ++#define SDL_MISC_DUMMY 1 ++ ++/* Enable locale subsystem */ ++#define SDL_LOCALE_DUMMY 1 ++ ++/* Enable assembly routines */ ++#define SDL_ALTIVEC_BLITTERS 1 ++/* #undef SDL_ARM_SIMD_BLITTERS */ ++/* #undef SDL_ARM_NEON_BLITTERS */ ++ ++/* Whether SDL_DYNAMIC_API needs dlopen() */ ++/* #undef DYNAPI_NEEDS_DLOPEN */ ++ ++/* Enable ime support */ ++/* #undef SDL_USE_IME */ ++ ++/* Enable dynamic udev support */ ++/* #undef SDL_UDEV_DYNAMIC */ ++ ++/* Enable dynamic libusb support */ ++/* #undef SDL_LIBUSB_DYNAMIC */ ++ ++/* Enable dynamic libsamplerate support */ ++/* #undef SDL_LIBSAMPLERATE_DYNAMIC */ ++ ++/* Libdecor get min/max content size functions */ ++/* #undef SDL_HAVE_LIBDECOR_GET_MIN_MAX */ + + #endif /* SDL_config_h_ */ +diff -Nru SDL2-2.30.1/include/SDL_config.h.cmake SDL2-2.30.1/include/SDL_config.h.cmake +--- SDL2-2.30.1/include/SDL_config.h.cmake 2024-03-05 19:37:32 ++++ SDL2-2.30.1/include/SDL_config.h.cmake 2026-09-05 18:29:55 +@@ -388,6 +388,7 @@ + #cmakedefine SDL_THREAD_PSP @SDL_THREAD_PSP@ + #cmakedefine SDL_THREAD_PS2 @SDL_THREAD_PS2@ + #cmakedefine SDL_THREAD_N3DS @SDL_THREAD_N3DS@ ++#cmakedefine SDL_THREAD_PSL1GHT @SDL_THREAD_PSL1GHT@ + + /* Enable various timer systems */ + #cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@ +@@ -399,6 +400,7 @@ + #cmakedefine SDL_TIMER_PSP @SDL_TIMER_PSP@ + #cmakedefine SDL_TIMER_PS2 @SDL_TIMER_PS2@ + #cmakedefine SDL_TIMER_N3DS @SDL_TIMER_N3DS@ ++#cmakedefine SDL_TIMER_PSL1GHT @SDL_TIMER_PSL1GHT@ + + /* Enable various video drivers */ + #cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@ +@@ -421,6 +423,7 @@ + #cmakedefine SDL_VIDEO_DRIVER_RISCOS @SDL_VIDEO_DRIVER_RISCOS@ + #cmakedefine SDL_VIDEO_DRIVER_PSP @SDL_VIDEO_DRIVER_PSP@ + #cmakedefine SDL_VIDEO_DRIVER_PS2 @SDL_VIDEO_DRIVER_PS2@ ++#cmakedefine SDL_VIDEO_DRIVER_PSL1GHT @SDL_VIDEO_DRIVER_PSL1GHT@ + + #cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@ + #cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@ +diff -Nru SDL2-2.30.1/include/SDL_config.h.in SDL2-2.30.1/include/SDL_config.h.in +--- SDL2-2.30.1/include/SDL_config.h.in 2024-03-05 19:37:32 ++++ SDL2-2.30.1/include/SDL_config.h.in 2026-09-05 18:29:55 +@@ -198,7 +198,9 @@ + #undef HAVE_SA_SIGACTION + #undef HAVE_SETJMP + #undef HAVE_NANOSLEEP ++#ifndef __PSL1GHT__ // Yeah PSL1GHT hasn't sysconf + #undef HAVE_SYSCONF ++#endif + #undef HAVE_SYSCTLBYNAME + #undef HAVE_CLOCK_GETTIME + #undef HAVE_GETPAGESIZE +@@ -303,6 +305,7 @@ + #undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC + #undef SDL_AUDIO_DRIVER_PULSEAUDIO + #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC ++#undef SDL_AUDIO_DRIVER_PSL1GHT + #undef SDL_AUDIO_DRIVER_QSA + #undef SDL_AUDIO_DRIVER_SNDIO + #undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC +@@ -332,6 +335,7 @@ + #undef SDL_JOYSTICK_RAWINPUT + #undef SDL_JOYSTICK_EMSCRIPTEN + #undef SDL_JOYSTICK_VIRTUAL ++#undef SDL_JOYSTICK_PSL1GHT + #undef SDL_HAPTIC_DUMMY + #undef SDL_HAPTIC_ANDROID + #undef SDL_HAPTIC_LINUX +@@ -359,10 +363,12 @@ + #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP + #undef SDL_THREAD_WINDOWS + #undef SDL_THREAD_OS2 ++#undef SDL_THREAD_PSL1GHT + + /* Enable various timer systems */ + #undef SDL_TIMER_HAIKU + #undef SDL_TIMER_DUMMY ++#undef SDL_TIMER_PSL1GHT + #undef SDL_TIMER_UNIX + #undef SDL_TIMER_WINDOWS + #undef SDL_TIMER_OS2 +@@ -412,6 +418,7 @@ + #undef SDL_VIDEO_DRIVER_OS2 + #undef SDL_VIDEO_DRIVER_QNX + #undef SDL_VIDEO_DRIVER_RISCOS ++#undef SDL_VIDEO_DRIVER_PSL1GHT + + #undef SDL_VIDEO_RENDER_D3D + #undef SDL_VIDEO_RENDER_D3D11 +@@ -421,6 +428,7 @@ + #undef SDL_VIDEO_RENDER_OGL_ES2 + #undef SDL_VIDEO_RENDER_DIRECTFB + #undef SDL_VIDEO_RENDER_METAL ++#undef SDL_VIDEO_RENDER_PSL1GHT + + /* Enable OpenGL support */ + #undef SDL_VIDEO_OPENGL +diff -Nru SDL2-2.30.1/include/SDL_config_psl1ght.h SDL2-2.30.1/include/SDL_config_psl1ght.h +--- SDL2-2.30.1/include/SDL_config_psl1ght.h 1969-12-31 21:00:00 ++++ SDL2-2.30.1/include/SDL_config_psl1ght.h 2026-09-05 18:29:55 +@@ -0,0 +1,89 @@ ++/* ++ Simple DirectMedia Layer ++ Copyright (C) 1997-2024 Sam Lantinga ++ ++ 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_psl1ght_h_ ++#define SDL_config_psl1ght_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/psl1ght/\*.c) */ ++#define SDL_THREAD_PSL1GHT 1 ++ ++/* Enable the N-Gage timer support (src/timer/psl1ght/\*.c) */ ++#define SDL_TIMER_PSL1GHT 1 ++ ++/* Enable the N-Gage video driver (src/video/psl1ght/\*.c) */ ++#define SDL_VIDEO_DRIVER_PSL1GHT 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_psl1ght_h_ */ +diff -Nru SDL2-2.30.1/include/SDL_endian.h SDL2-2.30.1/include/SDL_endian.h +--- SDL2-2.30.1/include/SDL_endian.h 2024-03-05 19:37:32 ++++ SDL2-2.30.1/include/SDL_endian.h 2026-09-05 18:29:55 +@@ -79,7 +79,7 @@ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MIPSEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \ +- defined(__sparc__) ++ defined(__powerpc__) || defined(__sparc__) + #define SDL_BYTEORDER SDL_BIG_ENDIAN + #else + #define SDL_BYTEORDER SDL_LIL_ENDIAN +diff -Nru SDL2-2.30.1/include/SDL_platform.h SDL2-2.30.1/include/SDL_platform.h +--- SDL2-2.30.1/include/SDL_platform.h 2024-03-05 19:37:32 ++++ SDL2-2.30.1/include/SDL_platform.h 2026-09-05 18:29:55 +@@ -223,6 +223,11 @@ + #define __SDL_NOGETPROCADDR__ + #endif + ++#if defined(__PSL1GHT__) ++#undef __PSL1GHT__ ++#define __PSL1GHT__ 1 ++#endif ++ + #if defined(__vita__) + #define __VITA__ 1 + #endif +diff -Nru SDL2-2.30.1/include/SDL_revision.h SDL2-2.30.1/include/SDL_revision.h +--- SDL2-2.30.1/include/SDL_revision.h 2024-03-05 19:37:54 ++++ SDL2-2.30.1/include/SDL_revision.h 2026-09-05 18:29:55 +@@ -1,7 +1,7 @@ + /* Generated by updaterev.sh, do not edit */ + #ifdef SDL_VENDOR_INFO +-#define SDL_REVISION "SDL-release-2.30.1-0-g5adbf3765 (" SDL_VENDOR_INFO ")" ++#define SDL_REVISION "SDL-prerelease-2.29.2-89-gc79c313c7 (" SDL_VENDOR_INFO ")" + #else +-#define SDL_REVISION "SDL-release-2.30.1-0-g5adbf3765" ++#define SDL_REVISION "SDL-prerelease-2.29.2-89-gc79c313c7" + #endif + #define SDL_REVISION_NUMBER 0 +diff -Nru SDL2-2.30.1/include/SDL_version.h SDL2-2.30.1/include/SDL_version.h +--- SDL2-2.30.1/include/SDL_version.h 2024-03-05 19:37:32 ++++ SDL2-2.30.1/include/SDL_version.h 2026-09-05 18:29:55 +@@ -58,8 +58,8 @@ + /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL + */ + #define SDL_MAJOR_VERSION 2 +-#define SDL_MINOR_VERSION 30 +-#define SDL_PATCHLEVEL 1 ++#define SDL_MINOR_VERSION 31 ++#define SDL_PATCHLEVEL 0 + + /** + * Macro to determine SDL version program was compiled against. +diff -Nru SDL2-2.30.1/src/SDL_internal.h SDL2-2.30.1/src/SDL_internal.h +--- SDL2-2.30.1/src/SDL_internal.h 2024-03-05 19:37:32 ++++ SDL2-2.30.1/src/SDL_internal.h 2026-09-05 18:29:55 +@@ -160,6 +160,9 @@ + #ifndef SDL_VIDEO_RENDER_VITA_GXM + #define SDL_VIDEO_RENDER_VITA_GXM 0 + #endif ++#ifndef SDL_VIDEO_DRIVER_PSL1GHT ++#define SDL_VIDEO_DRIVER_PSL1GHT 0 ++#endif + #else /* define all as 0 */ + #undef SDL_VIDEO_RENDER_SW + #define SDL_VIDEO_RENDER_SW 0 +@@ -185,6 +188,8 @@ + #define SDL_VIDEO_RENDER_PSP 0 + #undef SDL_VIDEO_RENDER_VITA_GXM + #define SDL_VIDEO_RENDER_VITA_GXM 0 ++#undef SDL_VIDEO_DRIVER_PSL1GHT ++#define SDL_VIDEO_DRIVER_PSL1GHT 0 + #endif /* SDL_RENDER_DISABLED */ + + #define SDL_HAS_RENDER_DRIVER \ +@@ -199,6 +204,7 @@ + SDL_VIDEO_RENDER_DIRECTFB | \ + SDL_VIDEO_RENDER_PS2 | \ + SDL_VIDEO_RENDER_PSP | \ ++ SDL_VIDEO_DRIVER_PSL1GHT | \ + SDL_VIDEO_RENDER_VITA_GXM) + + #if !defined(SDL_RENDER_DISABLED) && !SDL_HAS_RENDER_DRIVER +diff -Nru SDL2-2.30.1/src/SDL_log.c SDL2-2.30.1/src/SDL_log.c +--- SDL2-2.30.1/src/SDL_log.c 2024-03-05 19:37:32 ++++ SDL2-2.30.1/src/SDL_log.c 2026-09-05 18:29:55 +@@ -582,6 +582,15 @@ + (void)fclose(pFile); + } + } ++#elif defined(__PSL1GHT__) ++ { ++ FILE *pFile; ++ pFile = fopen("SDL_Log.txt", "a"); ++ if (pFile) { ++ (void)fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); ++ (void)fclose(pFile); ++ } ++ } + #endif + #if defined(HAVE_STDIO_H) && \ + !(defined(__APPLE__) && (defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT))) +diff -Nru SDL2-2.30.1/src/audio/SDL_audio.c SDL2-2.30.1/src/audio/SDL_audio.c +--- SDL2-2.30.1/src/audio/SDL_audio.c 2024-03-05 19:37:32 ++++ SDL2-2.30.1/src/audio/SDL_audio.c 2026-09-05 18:29:55 +@@ -135,6 +135,9 @@ + #ifdef SDL_AUDIO_DRIVER_DUMMY + &DUMMYAUDIO_bootstrap, + #endif ++#ifdef SDL_AUDIO_DRIVER_PSL1GHT ++ &PSL1GHTAUDIO_bootstrap, ++#endif + NULL + }; + +diff -Nru SDL2-2.30.1/src/audio/SDL_sysaudio.h SDL2-2.30.1/src/audio/SDL_sysaudio.h +--- SDL2-2.30.1/src/audio/SDL_sysaudio.h 2024-03-05 19:37:32 ++++ SDL2-2.30.1/src/audio/SDL_sysaudio.h 2026-09-05 18:29:55 +@@ -209,6 +209,7 @@ + extern AudioBootStrap N3DSAUDIO_bootstrap; + extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap; + extern AudioBootStrap OS2AUDIO_bootstrap; ++extern AudioBootStrap PSL1GHTAUDIO_bootstrap; + + #endif /* SDL_sysaudio_h_ */ + +diff -Nru SDL2-2.30.1/src/audio/psl1ght/SDL_psl1ghtaudio.c SDL2-2.30.1/src/audio/psl1ght/SDL_psl1ghtaudio.c +--- SDL2-2.30.1/src/audio/psl1ght/SDL_psl1ghtaudio.c 1969-12-31 21:00:00 ++++ SDL2-2.30.1/src/audio/psl1ght/SDL_psl1ghtaudio.c 2026-09-05 18:29:55 +@@ -0,0 +1,216 @@ ++/* ++ SDL - Simple DirectMedia Layer ++ Copyright (C) 1997-2010 Sam Lantinga ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++ Sam Lantinga ++ slouken@libsdl.org ++ ++ This file written by Ryan C. Gordon (icculus@icculus.org) ++*/ ++//#include "SDL_config.h" ++#include "../../SDL_internal.h" ++ ++/* Output audio to PSL1GHT */ ++ ++#include "SDL.h" ++ ++ ++#include "SDL_audio.h" ++#include "../SDL_audio_c.h" ++#include "SDL_psl1ghtaudio.h" ++ ++#define SHW64(X) (u32)(((u64)X)>>32), (u32)(((u64)X)&0xFFFFFFFF) ++ ++#define AUDIO_DEBUG ++ ++#ifdef AUDIO_DEBUG ++#define deprintf(...) printf(__VA_ARGS__) ++#else ++#define deprintf(...) ++#endif ++ ++static int ++PSL1GHT_AUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) ++{ ++ deprintf( "PSL1GHT_AUD_OpenDevice(%08X.%08X, %s, %d)\n", SHW64(this), devname, iscapture); ++ SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); ++ int valid_datatype = 0; ++ ++ this->hidden = SDL_malloc(sizeof(*(this->hidden))); ++ if (!this->hidden) { ++ SDL_OutOfMemory(); ++ return 0; ++ } ++ SDL_memset(this->hidden, 0, (sizeof *this->hidden)); ++ ++ ++ // PS3 Libaudio only handles floats ++ while ((!valid_datatype) && (test_format)) { ++ this->spec.format = test_format; ++ switch (test_format) { ++ case AUDIO_F32MSB: ++ valid_datatype = 1; ++ break; ++ default: ++ test_format = SDL_NextAudioFormat(); ++ break; ++ } ++ } ++ ++ int ret=audioInit(); ++ ++ //set some parameters we want ++ //either 2 or 8 channel ++ _params.numChannels = AUDIO_PORT_2CH; ++ //8 16 or 32 block buffer ++ _params.numBlocks = AUDIO_BLOCK_8; ++ //extended attributes ++ _params.attrib = 0; ++ //sound level (1 is default) ++ _params.level = 1; ++ ++ ret=audioPortOpen(&_params, &_portNum); ++ deprintf("audioPortOpen: %d\n",ret); ++ deprintf(" portNum: %d\n",_portNum); ++ ++ ret=audioGetPortConfig(_portNum, &_config); ++ deprintf("audioGetPortConfig: %d\n",ret); ++ deprintf(" readIndex: 0x%8X\n",_config.readIndex); ++ deprintf(" status: %d\n",_config.status); ++ deprintf(" channelCount: %ld\n",_config.channelCount); ++ deprintf(" numBlocks: %ld\n",_config.numBlocks); ++ deprintf(" portSize: %d\n",_config.portSize); ++ deprintf(" audioDataStart: 0x%8X\n",_config.audioDataStart); ++ ++ // create an event queue that will tell when a block is read ++ ret=audioCreateNotifyEventQueue( &_snd_queue, &_snd_queue_key); ++ printf("audioCreateNotifyEventQueue: %d\n",ret); ++ ++ // Set it to the sprx ++ ret = audioSetNotifyEventQueue(_snd_queue_key); ++ printf("audioSetNotifyEventQueue: %d\n",ret); ++ ++ // clears the event queue ++ ret = sysEventQueueDrain(_snd_queue); ++ printf("sysEentQueueDrain: %d\n",ret); ++ ++ ret=audioPortStart(_portNum); ++ deprintf("audioPortStart: %d\n",ret); ++ ++ _last_filled_buf = _config.numBlocks - 1; ++ ++ this->spec.format = test_format; ++ this->spec.size = sizeof(float) * AUDIO_BLOCK_SAMPLES * _config.channelCount; ++ this->spec.freq = 48000; ++ this->spec.samples = AUDIO_BLOCK_SAMPLES; ++ this->spec.channels = _config.channelCount; ++ ++ return ret == 0; ++} ++ ++static void ++PSL1GHT_AUD_PlayDevice(_THIS) ++{ ++ deprintf( "PSL1GHT_AUD_PlayDevice(%08X.%08X)\n", SHW64(this)); ++ ++ /* ++ while( _config.readIndex == _last_filled_buf) // FIXME this is a mess to remove when queued event will me integrated ++ { ++ deprintf( "\tplaying too fast... waiting a ms\n"); ++ //sleep(1); ++ }*/ ++ /*TransferSoundData *sound = SDL_malloc(sizeof(TransferSoundData)); ++ if (!sound) { ++ SDL_OutOfMemory(); ++ } ++ ++ playGenericSound(this->hidden->mixbuf, this->hidden->mixlen);*/ ++} ++ ++ ++static void ++PSL1GHT_AUD_CloseDevice(_THIS) ++{ ++ deprintf( "PSL1GHT_AUD_CloseDevice(%08X.%08X)\n", SHW64(this)); ++ int ret = 0; ++ ret=audioPortStop(_portNum); ++ deprintf("audioPortStop: %d\n",ret); ++ ret=audioRemoveNotifyEventQueue(_snd_queue_key); ++ deprintf("audioRemoveNotifyEventQueue: %d\n",ret); ++ ret=audioPortClose(_portNum); ++ deprintf("audioPortClose: %d\n",ret); ++ ret=sysEventQueueDestroy(_snd_queue, 0); ++ deprintf("sysEventQueueDestroy: %d\n",ret); ++ ret=audioQuit(); ++ deprintf("audioQuit: %d\n",ret); ++ ++ SDL_free(this->hidden); ++} ++ ++static Uint8 * ++PSL1GHT_AUD_GetDeviceBuf(_THIS) ++{ ++ ++ //deprintf( "PSL1GHT_AUD_GetDeviceBuf(%08X.%08X) at %d ms\n", SHW64(this), SDL_GetTicks()); ++ ++ //int playing = _config.readIndex; ++ // int playing = *((u64*)(u64)_config.readIndex); ++ int filling = (_last_filled_buf + 1) % _config.numBlocks; ++ Uint8 * dma_buf = (Uint8 *)(u64)_config.audioDataStart; ++ //deprintf( "\tWriting to buffer %d \n", filling); ++ // deprintf( "\tbuffer address (%08X.%08X => %08X.%08X)\n", SHW64(_config.audioDataStart), SHW64(dma_buf)); ++ ++ _last_filled_buf = filling; ++ return (dma_buf + (filling * this->spec.size)); ++} ++ ++/* This function waits until it is possible to write a full sound buffer */ ++static void ++PSL1GHT_WaitDevice(_THIS) ++{ ++ /* We're in blocking mode, so there's nothing to do here */ ++ //deprintf( "ALSA_WaitDevice(%08X.%08X)\n", SHW64(this)); ++ ++ sys_event_t event; ++ //s32 ret = ++ sysEventQueueReceive( _snd_queue, &event, 20 * 1000); ++ //deprintf( "sysEventQueueReceive: %08X\n", ret); ++} ++ ++ ++ static int ++PSL1GHT_AUD_Init(SDL_AudioDriverImpl * impl) ++{ ++ deprintf( "PSL1GHT_AUD_Init(%08X.%08X)\n", SHW64(impl)); ++ /* Set the function pointers */ ++ impl->OpenDevice = PSL1GHT_AUD_OpenDevice; ++ //impl->PlayDevice = PSL1GHT_AUD_PlayDevice; ++ impl->WaitDevice = PSL1GHT_WaitDevice; ++ impl->CloseDevice = PSL1GHT_AUD_CloseDevice; ++ impl->GetDeviceBuf = PSL1GHT_AUD_GetDeviceBuf; ++ ++ /* and the capabilities */ ++ impl->OnlyHasDefaultOutputDevice = 1; ++ ++ return 1; /* this audio target is available. */ ++} ++ ++AudioBootStrap PSL1GHTAUDIO_bootstrap = { ++ "psl1ght", "SDL PSL1GHT audio driver", PSL1GHT_AUD_Init, 0 /*1? */ ++}; ++ ++/* vi: set ts=4 sw=4 expandtab: */ +diff -Nru SDL2-2.30.1/src/audio/psl1ght/SDL_psl1ghtaudio.h SDL2-2.30.1/src/audio/psl1ght/SDL_psl1ghtaudio.h +--- SDL2-2.30.1/src/audio/psl1ght/SDL_psl1ghtaudio.h 1969-12-31 21:00:00 ++++ SDL2-2.30.1/src/audio/psl1ght/SDL_psl1ghtaudio.h 2026-09-05 18:29:55 +@@ -0,0 +1,53 @@ ++/* ++ SDL - Simple DirectMedia Layer ++ Copyright (C) 1997-2010 Sam Lantinga ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++ Sam Lantinga ++ slouken@libsdl.org ++*/ ++//#include "SDL_config.h" ++#include "../../SDL_internal.h" ++ ++#pragma once ++ ++#include "../SDL_sysaudio.h" ++ ++#include