-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Restore support for the Nokia N-Gage #12148
Open
mupfdev
wants to merge
52
commits into
libsdl-org:main
Choose a base branch
from
ngagesdk:nokia_ngage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,171
−6
Open
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
fbc8474
[Nokia N-Gage] Add CMake build configuration.
mupfdev d7fd145
[Nokia N-Gage] Add stub application: The purpose of this file is to v…
mupfdev d6cf0ee
[Nokia N-Gage] Add build configuration and platform-specific defines.
mupfdev 33f00e8
[Nokia N-Gage] Add audio driver implementation.
mupfdev e3ec2d9
[Nokia N-Gage] Add rendering back-end.
mupfdev 1916719
[Nokia N-Gage] Add video driver implementation.
mupfdev 06d0de9
[Nokia N-Gage] Add SDL main application entry point.
mupfdev 9602d85
[Nokia N-Gage] Add platform-specific core functions that are used for…
mupfdev 1712938
[Nokia N-Gage] Add functions related to locales and time.
mupfdev a0f9476
[Nokia N-Gage] Add file system related functions.
mupfdev 236809d
[Nokia N-Gage] Add timer/counter functions.
mupfdev 6928d3b
[Nokia N-Gage] Handle platform-specific edge cases.
mupfdev 06914b1
Add missing include guard
mupfdev d56d7c2
[Nokia N-Gage] Add logging support.
mupfdev 3717b12
[Nokia N-Gage] Add platform to SDL.c
mupfdev f5eec31
[Nokia N-Gage] Add missing SDL_TriggerBreakpoint() implementation to …
mupfdev 9edf435
[Nokia N-Gage] Move compile definitions to the SDK's toolchain file.
mupfdev 40daf52
[Nokia N-Gage] Remove redundant nullptr definition.
mupfdev 8c6b85a
[Nokia N-Gage] Update configuration after adding stdbool.h, stdint.h …
mupfdev 58ae08a
[Nokia N-Gage] Update guard as suggested by @madebr, this should fix CI
mupfdev f482ff5
[Nokia N-Gage] Remove redundant guard after adding minimal stdbool.h …
mupfdev 4b467d0
[Nokia N-Gage] Remove redundant guard after adding minimal inttypes.h…
mupfdev 373f457
Remove redundant guard
mupfdev 85db4ac
[Nokia N-Gage] Fix audio deinit which caused an error message on exit…
mupfdev 3bea42e
[Nokia N-Gage] Simplify/Fix focus handling; it is now possible to put…
mupfdev 07c5e11
[Nokia N-Gage] Set initial focus to ETrue; this is not required on re…
mupfdev 3de2957
Fix platform name in comment.
mupfdev ab7c774
Fixed decoding 4-bit RLE encoded BMP files
slouken ee1fab1
bmp: Removed debug printf call.
icculus a137dcf
Fixed memory leak looking up pen tool names
slouken e5fe53b
Fixed potential double-free
slouken d88c459
[Nokia N-Gage] Add build configuration and platform-specific defines.
mupfdev 3d12187
[Nokia N-Gage] Remove toolchain setting from CMakeLists.txt; this sho…
mupfdev 1d74372
[Nokia N-Gage] Remove redundant guard.
mupfdev a6626c3
[Nokia N-Gage] As suggested by @ccawley2011, SDL_EnableScreenSaver() …
mupfdev b13ed6d
[Nokia N-Gage] Add external declaration to avoid compiler warning
mupfdev 5835f07
[Nokia N-Gage] Remove unused NGAGE_QueueNoOp()
mupfdev ab8c2cb
[Nokia N-Gage] Move VideoBootStrap declaration where it belongs
mupfdev b4af6c4
[Nokia N-Gage] Update README-ngage.md
mupfdev 3d6337c
Add missing return value to NGAGE_SuspendScreenSaver().
mupfdev f4e2ee6
[Nokia N-Gage] Remove redundant code after cleaning up the native Sym…
mupfdev 9f5f214
[Nokia N-Gage] Update SDL_sysfilesystem.c as suggested by @ccawley2011
mupfdev ac9e1ac
[Nokia N-Gage] Update NGAGE_LockTexture as suggested in PR code review
mupfdev b88a3f1
[Nokia N-Gage] Use proper locals for HK and Taiwan
mupfdev 86a96ee
[Nokia N-Gage] ELangEnglish -> en_GB
mupfdev 551337c
[Nokia N-Gage] Remove redundant ssize_t definition. It now lives in s…
mupfdev 3fe8eaf
[Nokia N-Gage] Remove redundant external declarations, these had been…
mupfdev 0881747
[Nokia N-Gage] Fix SDL include in ngagetest.c
mupfdev 042c12e
Add missing include
mupfdev 1741765
[Nokia N-Gage] Remove redundant vsnprintf definition, add platform-sp…
mupfdev 5224000
ci: add minimum N-Gage ci
madebr 1d3b4b7
[Nokia N-Gage] Update source list in (temporary) platform-specific bu…
mupfdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
enable_language(CXX) | ||
|
||
file(GLOB SDL3_sources | ||
"${SDL3_SOURCE_DIR}/src/*.c" | ||
"${SDL3_SOURCE_DIR}/src/atomic/*.c" | ||
"${SDL3_SOURCE_DIR}/src/audio/*.c" | ||
"${SDL3_SOURCE_DIR}/src/audio/ngage/*.c" | ||
"${SDL3_SOURCE_DIR}/src/audio/ngage/*.cpp" | ||
"${SDL3_SOURCE_DIR}/src/core/*.c" | ||
"${SDL3_SOURCE_DIR}/src/core/ngage/*.c" | ||
"${SDL3_SOURCE_DIR}/src/core/ngage/*.cpp" | ||
"${SDL3_SOURCE_DIR}/src/cpuinfo/*.c" | ||
"${SDL3_SOURCE_DIR}/src/dynapi/*.c" | ||
"${SDL3_SOURCE_DIR}/src/events/*.c" | ||
"${SDL3_SOURCE_DIR}/src/file/*.c" | ||
"${SDL3_SOURCE_DIR}/src/file/generic/*.c" | ||
"${SDL3_SOURCE_DIR}/src/filesystem/*.c" | ||
"${SDL3_SOURCE_DIR}/src/filesystem/ngage/*.c" | ||
"${SDL3_SOURCE_DIR}/src/filesystem/ngage/*.cpp" | ||
"${SDL3_SOURCE_DIR}/src/filesystem/posix/*.c" | ||
"${SDL3_SOURCE_DIR}/src/hidapi/*.c" | ||
"${SDL3_SOURCE_DIR}/src/io/*.c" | ||
"${SDL3_SOURCE_DIR}/src/io/generic/*.c" | ||
"${SDL3_SOURCE_DIR}/src/joystick/*.c" | ||
"${SDL3_SOURCE_DIR}/src/joystick/dummy/*.c" | ||
"${SDL3_SOURCE_DIR}/src/libm/s_isinff.c" | ||
"${SDL3_SOURCE_DIR}/src/libm/s_isnanf.c" | ||
"${SDL3_SOURCE_DIR}/src/locale/*.c" | ||
"${SDL3_SOURCE_DIR}/src/locale/ngage/*.cpp" | ||
"${SDL3_SOURCE_DIR}/src/main/*.c" | ||
"${SDL3_SOURCE_DIR}/src/main/ngage/*.c" | ||
"${SDL3_SOURCE_DIR}/src/main/ngage/*.cpp" | ||
"${SDL3_SOURCE_DIR}/src/misc/*.c" | ||
"${SDL3_SOURCE_DIR}/src/misc/dummy/*.c" | ||
"${SDL3_SOURCE_DIR}/src/power/*.c" | ||
"${SDL3_SOURCE_DIR}/src/render/*.c" | ||
"${SDL3_SOURCE_DIR}/src/render/ngage/*.c" | ||
"${SDL3_SOURCE_DIR}/src/render/ngage/*.cpp" | ||
"${SDL3_SOURCE_DIR}/src/sensor/*.c" | ||
"${SDL3_SOURCE_DIR}/src/sensor/dummy/*.c" | ||
"${SDL3_SOURCE_DIR}/src/stdlib/*.c" | ||
"${SDL3_SOURCE_DIR}/src/storage/*.c" | ||
"${SDL3_SOURCE_DIR}/src/storage/generic/*.c" | ||
"${SDL3_SOURCE_DIR}/src/thread/*.c" | ||
"${SDL3_SOURCE_DIR}/src/thread/generic/*.c" | ||
"${SDL3_SOURCE_DIR}/src/time/*.c" | ||
"${SDL3_SOURCE_DIR}/src/time/ngage/*.cpp" | ||
"${SDL3_SOURCE_DIR}/src/time/unix/*.c" | ||
"${SDL3_SOURCE_DIR}/src/timer/*.c" | ||
"${SDL3_SOURCE_DIR}/src/timer/ngage/*.cpp" | ||
"${SDL3_SOURCE_DIR}/src/tray/*.c" | ||
"${SDL3_SOURCE_DIR}/src/tray/dummy/*.c" | ||
"${SDL3_SOURCE_DIR}/src/video/*.c" | ||
"${SDL3_SOURCE_DIR}/src/video/ngage/*.c" | ||
"${SDL3_SOURCE_DIR}/src/video/yuv2rgb/*.c") | ||
|
||
add_library(${PROJECT_NAME} STATIC ${SDL3_sources}) | ||
|
||
target_include_directories( | ||
${PROJECT_NAME} | ||
PUBLIC | ||
"${SDL3_SOURCE_DIR}/include" | ||
PRIVATE | ||
"${SDL3_SOURCE_DIR}/src" | ||
"${SDL3_SOURCE_DIR}/include/build_config") | ||
|
||
target_compile_definitions( | ||
${PROJECT_NAME} | ||
PUBLIC | ||
SDL_STATIC_LIB) | ||
|
||
set(test_static_libs | ||
${CMAKE_CURRENT_BINARY_DIR}/libSDL3.a) | ||
|
||
set(test_libs | ||
${CMAKE_CURRENT_BINARY_DIR}/libSDL3.a | ||
${EPOC_LIB}/NRenderer.lib | ||
${EPOC_LIB}/3dtypes.a | ||
${EPOC_LIB}/cone.lib | ||
${EPOC_PLATFORM}/gcc/lib/gcc-lib/arm-epoc-pe/2.9-psion-98r2/libgcc.a | ||
${EPOC_PLATFORM}/ngagesdk/lib/gcc/arm-epoc-pe/4.6.4/libgcc_ngage.a | ||
mupfdev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
${EPOC_PLATFORM}/ngagesdk/lib/gcc/arm-epoc-pe/4.6.4/libc_ngage.a | ||
${EPOC_LIB}/mediaclientaudiostream.lib | ||
${EPOC_LIB}/charconv.lib | ||
${EPOC_LIB}/bitgdi.lib | ||
${EPOC_LIB}/euser.lib | ||
${EPOC_LIB}/estlib.lib | ||
${EPOC_LIB}/ws32.lib | ||
${EPOC_LIB}/hal.lib | ||
${EPOC_LIB}/fbscli.lib | ||
${EPOC_LIB}/efsrv.lib | ||
${EPOC_LIB}/scdv.lib | ||
${EPOC_LIB}/gdi.lib) | ||
|
||
set(UID1 0x1000007a) # KExecutableImageUidValue, e32uid.h | ||
set(UID2 0x100039ce) # KAppUidValue16, apadef.h | ||
set(UID3 0x10005799) # ngage_test.exe UID | ||
|
||
add_library(ngage_test STATIC "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test/ngagetest.c") | ||
|
||
build_exe_static(ngage_test exe ${UID1} ${UID2} ${UID3} "${test_static_libs}" "${test_libs}") | ||
mupfdev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
add_dependencies( | ||
ngage_test.exe | ||
ngage_test) | ||
|
||
add_dependencies( | ||
ngage_test | ||
${PROJECT_NAME}) | ||
|
||
target_compile_definitions( | ||
ngage_test | ||
PUBLIC | ||
__EXE__ | ||
UID1=${UID1} | ||
UID2=${UID2} | ||
UID3=${UID3}) | ||
|
||
target_include_directories( | ||
ngage_test | ||
PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// The purpose of this test is to validate that there are no undefined references | ||
// when building with the N-Gage SDK since SDL can only be linked statically. | ||
|
||
#define IMPORT_C | ||
#include <SDL3/SDL.h> | ||
|
||
int SDL_main(int argc, char* argv[]) | ||
{ | ||
for (int i = 0; i < argc; i++) { // C99 check. | ||
/* Nothing to do here. */ | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) | ||
{ | ||
return SDL_APP_CONTINUE; | ||
} | ||
|
||
SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event) | ||
{ | ||
return SDL_APP_CONTINUE; | ||
} | ||
|
||
SDL_AppResult SDL_AppIterate(void* appstate) | ||
{ | ||
return SDL_APP_CONTINUE; | ||
} | ||
|
||
void SDL_AppQuit(void* appstate, SDL_AppResult result) | ||
{ | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be integrated into
CMakeLists.txt
, but once you get ci running for the currently supported SDL3 platforms, I'll try to do this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngagesdk/ngage-toolchain#13
Apparently you tried this before. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least native (Windows) CI is now working: https://github.com/ngagesdk/ngage-toolchain/actions/workflows/nokia-ngage.yml