-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
base: main
Are you sure you want to change the base?
Conversation
cmake/nokia_ngage.cmake
Outdated
target_compile_options( | ||
ngage_test | ||
PUBLIC | ||
-O3 | ||
) |
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.
Configuring with -DCMAKE_BUILD_TYPE=Release
will add -O3
automatically.
target_compile_options( | |
ngage_test | |
PUBLIC | |
-O3 | |
) |
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.
I removed it from my demo application and I believe this is not the case. I used -DCMAKE_BUILD_TYPE=Release
, but my performance dropped slightly (5-10 FPS). Where does this information come from?
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 is added to CMAKE_C_FLAGS_RELEASE
when using a GNU toolchain.
But since I posted the message above, I have used your toolchain file where I'm not sure the compiler is detected as GNU.
I have a fix for this, but am seeing a link error.
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.
Symbian requires a multi-step linking procedure. Have a look at build_exe
. I try to replicate your problem ASAP.
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.
I added a minimal exe-application to the toolchain: minimal
Does that help?
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.
I'll try that. I'll also try to get it working with a pure add_executable
.
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 is definitely one of the topics that should be resolved before the PR is closed. Optimisation obviously makes a big difference here.
@@ -0,0 +1,133 @@ | |||
cmake_minimum_required(VERSION 3.16) |
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.
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
|
source = dest; | ||
} | ||
|
||
Mem::Copy(phdata->bitmap->DataAddress(), source, pitch * h); |
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 looks like something that should be done during texture update/unlock, rather than each time the texture is rendered.
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.
It probably doesn't matter. NGAGE_UpdateTexture()
is called before each call to this function internally.
return SDL_GetScancodeFromKey(keycode, NULL); | ||
} | ||
|
||
void CRenderer::HandleEvent(const TWsEvent& aWsEvent) |
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.
Would it be possible to separate event handling from the rendering code?
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.
In SDL2 it was exactly where it should be, in the video driver implementation, but since all the window management is now handled by the dedicated renderer, I moved it there. I wanted to keep it as simple as possible.
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.
Speaking of code placement: In my example application I also pointed out that SDLs audio sub-system should be initialised, even when it is not needed. This ensures that all resources are properly released when the application is closed.
Why? Because the rendering and audio backends are initialised early in E32Main()
before the active scheduler is activated. There may be other ways to do this, but it's not easy to find good example code for such an old platform.
break; | ||
} | ||
|
||
return SDL_GetScancodeFromKey(keycode, NULL); |
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.
I'd suggest directly using the SDL_SCANCODE_
values here rather than converting from a fixed set of SDLK_
values.
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.
How do you mean that? I am currently translating the scan codes from the Symbian API into the identifiers used by SDL.
What's the status on this? Are we ready to merge? (Tweaks and additional fixes/improvements can come later, but I'd rather this not have to live in a branch if it's Good Enough at this point.) |
I can't comment on the N-Gage C/C++ code, which seems to be in ok state. Short term, I can live with this but long term this needs to be fixed. |
Let's try to get the CMake stuff up to standards and merge this, so @mupfdev doesn't have to keep working out of a branch. |
@madebr started working on a compile wrapper to streamline CMake support. AFAIK it's in this branch: https://github.com/madebr/SDL/tree/cmake-ngage-extra-support If there's anything I could do to help, just let me know. I can also modify the toolchain if necessary. |
I'm currently cleaning up the compiler wrapper by @madebr (which is now part of the toolchain). |
I separated the Nokia N-Gage specific part from the rest to avoid bloating the already very complex CMakeLists.txt.
…alidate that there are no undefined references when building with the N-Gage SDK since SDL can only be linked statically.
…ecific va_copy declaration to SDL_vacopy.h
[sdl-ci-filter ngage]
…ild configuration.
…on for the platform.
…eButtonFlags typedef to be associated
… for key repeats. The 32-bit millisecond timer can roll over after about 49 days, so this needs to be accounted for.
[ci skip]
[ci skip]
…to the client Wayland compositors may send recursive clipboard offers to the client, which need to be filtered out to avoid clearing local data. Previously this was worked around with a hack, but this caused the ownership flag to be set incorrectly, which broke some clients. This introduces a metadata MIME type of application/x-sdl3-source-id to be sent with SDL3 selection offers, which contains a string that is a unique identifier for the instance, and can be used to detect if a received selection offer is originating from the same instance that generated it. If DBus is available, the unique identifier string is the unique name of the connection, otherwise, the process ID is used.
This matches the Wayland backend and what apps originally written for SDL2 are expecting.
…g stored in srcrect and dstrect
[ci skip]
…PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER Typically we will name the property with the function that is used to set it, and document the range of values.
Reproduction case for libsdl-org#12844
[ci skip]
[ci skip]
Fix root-cause of CVE-2021-45340 : dereference of NULL ptr. Patch authored by Henner Zeller <h.zeller@acm.org> Mainstream pull request: nothings/stb#1736
Better handle some very rare, but possible edge cases if the system has been running for many days.
As described in #11243 and #6691, support for the Nokia N-Gage has been dropped due to technical limitations that have now been resolved. The custom-built C-Compiler now supports C99. The C++ compiler is still outdated and has only been retained for compatibility reasons.
Description
#
.SDL_Log()
.Existing Issue(s)
It is currently not possible to put the application that has been launched into the background. It continues to run and can then no longer be closed. This is a bug in the new rendering backend.If the application is put in the background while sound is playing, some of the audio is looped until the app is back in focus.
It is recommended initialising SDLs audio sub-system even when it is not required. The backend is started at a higher level. Initialising SDLs audio sub-system ensures that the backend is properly deinitialised.