Skip to content

Restore support for the Nokia N-Gage #12148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 92 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
4e8f161
[Nokia N-Gage] Add CMake build configuration.
mupfdev Jan 31, 2025
08f480e
[Nokia N-Gage] Add stub application: The purpose of this file is to v…
mupfdev Jan 31, 2025
78b6edb
[Nokia N-Gage] Add build configuration and platform-specific defines.
mupfdev Jan 31, 2025
0b4dc12
[Nokia N-Gage] Add audio driver implementation.
mupfdev Jan 31, 2025
c0cefd7
[Nokia N-Gage] Add rendering back-end.
mupfdev Jan 31, 2025
83086f7
[Nokia N-Gage] Add video driver implementation.
mupfdev Jan 31, 2025
5e8117a
[Nokia N-Gage] Add SDL main application entry point.
mupfdev Jan 31, 2025
4e8ab52
[Nokia N-Gage] Add platform-specific core functions that are used for…
mupfdev Jan 31, 2025
5e59dd2
[Nokia N-Gage] Add functions related to locales and time.
mupfdev Jan 31, 2025
75927bf
[Nokia N-Gage] Add file system related functions.
mupfdev Jan 31, 2025
98f0e0f
[Nokia N-Gage] Add timer/counter functions.
mupfdev Jan 31, 2025
efe84cc
[Nokia N-Gage] Handle platform-specific edge cases.
mupfdev Jan 31, 2025
70a18a5
Add missing include guard
mupfdev Jan 31, 2025
5dc02d4
[Nokia N-Gage] Add logging support.
mupfdev Jan 31, 2025
4f90a7b
[Nokia N-Gage] Add platform to SDL.c
mupfdev Jan 31, 2025
181638b
[Nokia N-Gage] Add missing SDL_TriggerBreakpoint() implementation to …
mupfdev Feb 1, 2025
6cbbece
[Nokia N-Gage] Move compile definitions to the SDK's toolchain file.
mupfdev Feb 1, 2025
c5a8ebf
[Nokia N-Gage] Remove redundant nullptr definition.
mupfdev Feb 1, 2025
c35bfd3
[Nokia N-Gage] Update configuration after adding stdbool.h, stdint.h …
mupfdev Feb 1, 2025
2111458
[Nokia N-Gage] Update guard as suggested by @madebr, this should fix CI
mupfdev Feb 1, 2025
79501c9
[Nokia N-Gage] Remove redundant guard after adding minimal stdbool.h …
mupfdev Feb 1, 2025
c23ab42
[Nokia N-Gage] Remove redundant guard after adding minimal inttypes.h…
mupfdev Feb 1, 2025
c9e936e
Remove redundant guard
mupfdev Feb 1, 2025
0a272b0
[Nokia N-Gage] Fix audio deinit which caused an error message on exit…
mupfdev Feb 1, 2025
704a944
[Nokia N-Gage] Simplify/Fix focus handling; it is now possible to put…
mupfdev Feb 3, 2025
a0d7bd0
[Nokia N-Gage] Set initial focus to ETrue; this is not required on re…
mupfdev Feb 3, 2025
dc8fe3f
Fix platform name in comment.
mupfdev Feb 5, 2025
d7af8f2
[Nokia N-Gage] Add build configuration and platform-specific defines.
mupfdev Jan 31, 2025
cffa5bf
[Nokia N-Gage] Remove toolchain setting from CMakeLists.txt; this sho…
mupfdev Feb 5, 2025
5f362f2
[Nokia N-Gage] Remove redundant guard.
mupfdev Feb 5, 2025
fcc40d8
[Nokia N-Gage] As suggested by @ccawley2011, SDL_EnableScreenSaver() …
mupfdev Feb 5, 2025
d7d111f
[Nokia N-Gage] Add external declaration to avoid compiler warning
mupfdev Feb 5, 2025
34ce85e
[Nokia N-Gage] Remove unused NGAGE_QueueNoOp()
mupfdev Feb 5, 2025
396dfe1
[Nokia N-Gage] Move VideoBootStrap declaration where it belongs
mupfdev Feb 5, 2025
34bd521
[Nokia N-Gage] Update README-ngage.md
mupfdev Feb 5, 2025
40f4f05
Add missing return value to NGAGE_SuspendScreenSaver().
mupfdev Feb 6, 2025
911fb03
[Nokia N-Gage] Remove redundant code after cleaning up the native Sym…
mupfdev Feb 6, 2025
0b611cc
[Nokia N-Gage] Update SDL_sysfilesystem.c as suggested by @ccawley2011
mupfdev Feb 8, 2025
679e00f
[Nokia N-Gage] Update NGAGE_LockTexture as suggested in PR code review
mupfdev Feb 8, 2025
55e247e
[Nokia N-Gage] Use proper locals for HK and Taiwan
mupfdev Feb 8, 2025
8cb7d7f
[Nokia N-Gage] ELangEnglish -> en_GB
mupfdev Feb 8, 2025
4bad389
[Nokia N-Gage] Remove redundant ssize_t definition. It now lives in s…
mupfdev Feb 9, 2025
7e22837
[Nokia N-Gage] Remove redundant external declarations, these had been…
mupfdev Feb 9, 2025
161f7fd
[Nokia N-Gage] Fix SDL include in ngagetest.c
mupfdev Feb 9, 2025
540da7b
Add missing include
mupfdev Feb 9, 2025
e481831
[Nokia N-Gage] Remove redundant vsnprintf definition, add platform-sp…
mupfdev Feb 9, 2025
4e51198
ci: add minimum N-Gage ci
madebr Feb 9, 2025
201f728
[Nokia N-Gage] Update source list in (temporary) platform-specific bu…
mupfdev Mar 2, 2025
44c009b
[Nokia N-Gage] Update main CMakeLists.txt and add preseed configurati…
mupfdev Apr 21, 2025
51f2422
Update create-test-plan.py
mupfdev May 1, 2025
647a106
Update CMakeLists.txt
mupfdev May 1, 2025
135ebe4
Update CMakeLists.txt
mupfdev May 1, 2025
aadd1fb
[Nokia N-Gage] Update build configuration
mupfdev May 1, 2025
f46a237
[Nokia N-Gage] Temporarily comment out callback (has it been removed?)
mupfdev May 2, 2025
e755654
[Nokia N-Gage] Update build configuration.
mupfdev May 2, 2025
30876de
cmake changes for updated ngage sdk toolchain
madebr May 3, 2025
dd15833
ci: debug information is not useful for N-Gage
madebr May 3, 2025
2ef432b
ci: remove continue-on-error
madebr May 3, 2025
68bbb4d
cmake: remove commented sets
madebr May 3, 2025
16aa141
cmake: fix N-Gage sdl3.pc
madebr May 3, 2025
6b62db0
cmake: add UID3 to examples
madebr May 3, 2025
abe126c
Turn add_sdl_test_executable into a function
madebr May 3, 2025
8d49d0d
Use LIBC_HAS_SIGNAL_H in test directory
madebr May 3, 2025
1afb59e
cmake: allow only building/installing a subset of the tests
madebr May 3, 2025
ca267ec
Fix install
madebr May 3, 2025
308cca9
[Nokia N-Gage] Add missing function, SDL_GetCurrentTime()
mupfdev May 4, 2025
a59a18a
[Nokia N-Gage] Disable parallel builds in CI
mupfdev May 4, 2025
33593a5
Add important info to README-ngage.md
mupfdev May 4, 2025
6efeae7
README-ngage.md, update Markdown formatting
mupfdev May 4, 2025
355c8b5
Add dedication to README-ngage.md
mupfdev May 4, 2025
6ecf5bf
README-ngage.md, add issue remark that dependency tracking does not w…
mupfdev May 4, 2025
f194116
remove ngagetest.c
madebr May 4, 2025
2b25fa6
ngage builds SDL3-static.lib
madebr May 4, 2025
ce76a40
use test instead of SDL_TEST_EXECUTABLES
madebr May 4, 2025
3f0adf9
Fix cmake/test
madebr May 4, 2025
1e50069
[Nokia N-Gage] Update locales
mupfdev May 5, 2025
4e86b39
[Nokia N-Gage] Update locales
mupfdev May 5, 2025
0eaea36
[Nokia N-Gage] Update locales
mupfdev May 5, 2025
6839af8
Add missing void, src/render/ngage/SDL_render_ngage_c.h
mupfdev May 5, 2025
f48bed4
Add missing void, src/render/ngage/SDL_render_ngage_c.h
mupfdev May 5, 2025
35ed64b
Update style as suggested, src/render/ngage/SDL_render_ngage.c
mupfdev May 5, 2025
c20c6df
Revert extra newline, src/render/SDL_render.c
mupfdev May 5, 2025
49c4dfd
Update indentation to match SDL style
mupfdev May 5, 2025
c0ae5f1
Add missing include guard.
mupfdev May 5, 2025
d314a22
Minor clean-up as suggested in PR
mupfdev May 5, 2025
c27bf17
Replace va_copy() implementation with a simple define as suggested. R…
mupfdev May 5, 2025
cee0178
Remove redundant defines from build config.
mupfdev May 5, 2025
c7c8a5c
Update formatting using SDLs .clang-format to match the project's cod…
mupfdev May 5, 2025
1ac62af
[Nokia N-Gage] Update README-ngage.md
mupfdev May 14, 2025
a03e620
README-ngage.md, minor re-phrasing
mupfdev May 14, 2025
3aa6b0b
README-ngage.md, fix phrasing.
mupfdev May 14, 2025
f4f55da
Update formatting
mupfdev May 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/actions/setup-ngage-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: 'Setup Nonka N-Gage SDK'
description: 'Download and setup Nokia N-Gage SDK'
inputs:
path:
description: 'Installation path'
default: 'default'
runs:
using: 'composite'
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: 'Verify platform'
id: calc
shell: sh
run: |
case "${{ runner.os }}-${{ runner.arch }}" in
"Windows-X86" | "Windows-X64")
echo "ok!"
echo "cache-key=ngage-sdk-windows" >> ${GITHUB_OUTPUT}
default_install_path="C:/ngagesdk"
;;
*)
echo "Unsupported ${{ runner.os }}-${{ runner.arch }}"
exit 1;
;;
esac
install_path="${{ inputs.path }}"
if [ "x$install_path" = "xdefault" ]; then
install_path="$default_install_path"
fi
echo "install-path=$install_path" >> ${GITHUB_OUTPUT}

toolchain_repo="https://github.com/ngagesdk/ngage-toolchain"
toolchain_branch="main"
echo "toolchain-repo=${toolchain_repo}" >> ${GITHUB_OUTPUT}
echo "toolchain-branch=${toolchain_branch}" >> ${GITHUB_OUTPUT}

sdk_repo="https://github.com/ngagesdk/sdk"
sdk_branch="main"
echo "sdk-repo=${sdk_repo}" >> ${GITHUB_OUTPUT}
echo "sdk-branch=${sdk_branch}" >> ${GITHUB_OUTPUT}

tools_repo="https://github.com/ngagesdk/tools"
tools_branch="main"
echo "tools-repo=${tools_repo}" >> ${GITHUB_OUTPUT}
echo "tools-branch=${tools_branch}" >> ${GITHUB_OUTPUT}

extras_repo="https://github.com/ngagesdk/extras"
extras_branch="main"
echo "extras-repo=${extras_repo}" >> ${GITHUB_OUTPUT}
echo "extras-branch=${extras_branch}" >> ${GITHUB_OUTPUT}
# - name: 'Restore cached ${{ steps.calc.outputs.archive }}'
# id: cache-restore
# uses: actions/cache/restore@v4
# with:
# path: '${{ runner.temp }}'
# key: ${{ steps.calc.outputs.cache-key }}
- name: 'Download N-Gage SDK'
# if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
shell: pwsh
run: |

Invoke-WebRequest "${{ steps.calc.outputs.toolchain-repo }}/archive/refs/heads/${{ steps.calc.outputs.toolchain-branch }}.zip" -OutFile "${{ runner.temp }}/ngage-toolchain.zip"
Invoke-WebRequest "${{ steps.calc.outputs.sdk-repo }}/archive/refs/heads/${{ steps.calc.outputs.sdk-branch }}.zip" -OutFile "${{ runner.temp }}/sdk.zip"
Invoke-WebRequest "${{ steps.calc.outputs.tools-repo }}/archive/refs/heads/${{ steps.calc.outputs.tools-branch }}.zip" -OutFile "${{ runner.temp }}/tools.zip"
Invoke-WebRequest "${{ steps.calc.outputs.extras-repo }}/archive/refs/heads/${{ steps.calc.outputs.extras-branch }}.zip" -OutFile "${{ runner.temp }}/extras.zip"

# - name: 'Cache ${{ steps.calc.outputs.archive }}'
# if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }}
# uses: actions/cache/save@v4
# with:
# path: |
# ${{ runner.temp }}/apps.zip
# ${{ runner.temp }}/sdk.zip
# ${{ runner.temp }}/tools.zip
# key: ${{ steps.calc.outputs.cache-key }}
- name: 'Extract N-Gage SDK'
shell: pwsh
run: |
New-Item -ItemType Directory -Path "${{ steps.calc.outputs.install-path }}" -Force

New-Item -ItemType Directory -Path "${{ runner.temp }}/ngage-toolchain-temp" -Force
7z "-o${{ runner.temp }}/ngage-toolchain-temp" x "${{ runner.temp }}/ngage-toolchain.zip"
Move-Item -Path "${{ runner.temp }}/ngage-toolchain-temp/ngage-toolchain-${{ steps.calc.outputs.toolchain-branch }}/*" -Destination "${{ steps.calc.outputs.install-path }}"

7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/sdk.zip"
Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/sdk-${{ steps.calc.outputs.sdk-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/sdk"

7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/tools.zip"
Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/tools-${{ steps.calc.outputs.tools-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/tools"

7z "-o${{ steps.calc.outputs.install-path }}/sdk" x "${{ runner.temp }}/extras.zip"
Move-Item -Path "${{ steps.calc.outputs.install-path }}/sdk/extras-${{ steps.calc.outputs.extras-branch }}" -Destination "${{ steps.calc.outputs.install-path }}/sdk/extras"
- name: 'Set output variables'
id: final
shell: sh
run: |
echo "${{ steps.calc.outputs.install-path }}/sdk/sdk/6.1/Shared/EPOC32/gcc/bin" >> $GITHUB_PATH
echo "${{ steps.calc.outputs.install-path }}/sdk/sdk/6.1/Shared/EPOC32/ngagesdk/bin" >> $GITHUB_PATH
echo "NGAGESDK=${{ steps.calc.outputs.install-path }}" >> $GITHUB_ENV
echo "CMAKE_TOOLCHAIN_FILE=${{ steps.calc.outputs.install-path }}/cmake/ngage-toolchain.cmake" >> $GITHUB_ENV
21 changes: 19 additions & 2 deletions .github/workflows/create-test-plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class SdlPlatform(Enum):
Riscos = "riscos"
FreeBSD = "freebsd"
NetBSD = "netbsd"
NGage = "ngage"


class Msys2Platform(Enum):
Expand Down Expand Up @@ -139,11 +140,12 @@ class JobSpec:
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
"ngage": JobSpec(name="N-Gage", os=JobOs.WindowsLatest, platform=SdlPlatform.NGage, artifact="SDL-ngage", ),
}


class StaticLibType(Enum):
MSVC = "SDL3-static.lib"
STATIC_LIB = "SDL3-static.lib"
A = "libSDL3.a"


Expand Down Expand Up @@ -223,6 +225,7 @@ class JobDetails:
check_sources: bool = False
setup_python: bool = False
pypi_packages: list[str] = dataclasses.field(default_factory=list)
setup_gage_sdk_path: str = ""

def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
data = {
Expand Down Expand Up @@ -290,6 +293,7 @@ def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]:
"check-sources": self.check_sources,
"setup-python": self.setup_python,
"pypi-packages": my_shlex_join(self.pypi_packages),
"setup-ngage-sdk-path": self.setup_gage_sdk_path,
}
return {k: v for k, v in data.items() if v != ""}

Expand Down Expand Up @@ -365,7 +369,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.msvc_project_flags.append("-p:TreatWarningsAsError=true")
job.test_pkg_config = False
job.shared_lib = SharedLibType.WIN32
job.static_lib = StaticLibType.MSVC
job.static_lib = StaticLibType.STATIC_LIB
job.cmake_arguments.extend((
"-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase",
"-DCMAKE_EXE_LINKER_FLAGS=-DEBUG",
Expand Down Expand Up @@ -740,6 +744,19 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
job.cpactions_arch = "x86-64"
job.cpactions_setup_cmd = "export PATH=\"/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH\"; export PKG_CONFIG_PATH=\"/usr/pkg/lib/pkgconfig\";export PKG_PATH=\"https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f \"1 2\" -d.)/All/\";echo \"PKG_PATH=$PKG_PATH\";echo \"uname -a -> \"$(uname -a)\"\";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update"
job.cpactions_install_cmd = "sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1"
case SdlPlatform.NGage:
build_parallel = False
job.cmake_build_type = "Release"
job.setup_ninja = True
job.static_lib = StaticLibType.STATIC_LIB
job.shared_lib = None
job.clang_tidy = False
job.werror = False # FIXME: enable SDL_WERROR
job.shared = False
job.run_tests = False
job.setup_gage_sdk_path = "C:/ngagesdk"
job.cmake_toolchain_file = "C:/ngagesdk/cmake/ngage-toolchain.cmake"
job.test_pkg_config = False
case _:
raise ValueError(f"Unsupported platform={spec.platform}")

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ jobs:
with:
arch: ${{ matrix.platform.msvc-vcvars-arch }}
sdk: ${{ matrix.platform.msvc-vcvars-sdk }}
- name: 'Set up Nokia N-Gage SDK'
uses: ./.github/actions/setup-ngage-sdk
if: ${{ matrix.platform.setup-ngage-sdk-path != '' }}
with:
path: '${{ matrix.platform.setup-ngage-sdk-path }}'
- name: 'Set up Windows GDK Desktop'
uses: ./.github/actions/setup-gdk-desktop
if: ${{ matrix.platform.setup-gdk-folder != '' }}
Expand Down
94 changes: 90 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ include("${SDL3_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake")
include("${SDL3_SOURCE_DIR}/cmake/3rdparty.cmake")
include("${SDL3_SOURCE_DIR}/cmake/PreseedMSVCCache.cmake")
include("${SDL3_SOURCE_DIR}/cmake/PreseedEmscriptenCache.cmake")
include("${SDL3_SOURCE_DIR}/cmake/PreseedNokiaNGageCache.cmake")

SDL_DetectCompiler()
SDL_DetectTargetCPUArchitectures(SDL_CPUS)
Expand Down Expand Up @@ -155,7 +156,7 @@ endif()
# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
# so we'll just use libusb when it's available. libusb does not support iOS,
# so we default to yes on iOS.
if(IOS OR TVOS OR VISIONOS OR WATCHOS OR ANDROID)
if(IOS OR TVOS OR VISIONOS OR WATCHOS OR ANDROID OR NGAGE)
set(SDL_HIDAPI_LIBUSB_AVAILABLE FALSE)
else()
set(SDL_HIDAPI_LIBUSB_AVAILABLE TRUE)
Expand Down Expand Up @@ -219,7 +220,7 @@ if(EMSCRIPTEN)
set(SDL_SHARED_AVAILABLE OFF)
endif()

if(VITA OR PSP OR PS2 OR N3DS OR RISCOS)
if(VITA OR PSP OR PS2 OR N3DS OR RISCOS OR NGAGE)
set(SDL_SHARED_AVAILABLE OFF)
endif()

Expand Down Expand Up @@ -414,6 +415,24 @@ if(VITA)
set_option(VIDEO_VITA_PVR "Build with PSVita PVR gles/gles2 support" OFF)
endif()

if (NGAGE)
set(SDL_GPU OFF)
set(SDL_CAMERA OFF)
set(SDL_JOYSTICK OFF)
set(SDL_HAPTIC OFF)
set(SDL_HIDAPI OFF)
set(SDL_POWER OFF)
set(SDL_SENSOR OFF)
set(SDL_DIALOG OFF)
set(SDL_DISKAUDIO OFF)
set(SDL_DUMMYAUDIO OFF)
set(SDL_DUMMYCAMERA OFF)
set(SDL_DUMMYVIDEO OFF)
set(SDL_OFFSCREEN OFF)
set(SDL_RENDER_GPU OFF)
set(SDL_VIRTUAL_JOYSTICK OFF)
endif()

if(NOT (SDL_SHARED OR SDL_STATIC))
message(FATAL_ERROR "SDL_SHARED and SDL_STATIC cannot both be disabled")
endif()
Expand Down Expand Up @@ -2931,6 +2950,73 @@ elseif(N3DS)
set(HAVE_SDL_LOCALE TRUE)

sdl_glob_sources("${SDL3_SOURCE_DIR}/src/io/n3ds/*.c")

elseif(NGAGE)

enable_language(CXX)

set(SDL_MAIN_USE_CALLBACKS 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/ngage/*.c")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/ngage/*.cpp")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/ngage/*.cpp")
set(HAVE_SDL_MAIN_CALLBACKS TRUE)

if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_NGAGE 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/ngage/*.c")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/ngage/*.cpp")
set(HAVE_SDL_AUDIO TRUE)
endif()

set(SDL_FILESYSTEM_NGAGE 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/ngage/*.c")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/ngage/*.cpp")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/posix/*.c")
set(HAVE_SDL_FILESYSTEM TRUE)

sdl_glob_sources("${SDL3_SOURCE_DIR}/src/locale/ngage/*.cpp")

if(SDL_RENDER)
set(SDL_VIDEO_RENDER_NGAGE 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/render/ngage/*.c")
endif()

sdl_glob_sources("${SDL3_SOURCE_DIR}/src/time/ngage/*.cpp")
set(SDL_TIME_NGAGE 1)

sdl_glob_sources("${SDL3_SOURCE_DIR}/src/render/ngage/*.cpp")
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/time/unix/*.c")

set(SDL_TIMER_NGAGE 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/timer/ngage/*.cpp")

set(SDL_VIDEO_DRIVER_NGAGE 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/ngage/*.c")
set(HAVE_SDL_TIMERS TRUE)

set(SDL_FSOPS_POSIX 1)
set(SDL_LEAN_AND_MEAN 1)
sdl_link_dependency(ngage
LINK_OPTIONS "SHELL:-s MAIN_COMPAT=0"
PKG_CONFIG_LINK_OPTIONS "-s;MAIN_COMPAT=0"
LIBS
NRenderer
3dtypes
cone
libgcc
libgcc_ngage
mediaclientaudiostream
charconv
bitgdi
euser
estlib
ws32
hal
fbscli
efsrv
scdv
gdi
)
endif()

sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/SDL_dialog.c)
Expand Down Expand Up @@ -3111,8 +3197,8 @@ endif()

# We always need to have threads and timers around
if(NOT HAVE_SDL_THREADS)
# The emscripten platform has been carefully vetted to work without threads
if(EMSCRIPTEN)
# The Emscripten and N-Gage platform has been carefully vetted to work without threads
if(EMSCRIPTEN OR NGAGE)
set(SDL_THREADS_DISABLED 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/thread/generic/*.c")
else()
Expand Down
Loading
Loading