-
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
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 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.
… debugging/logging purposes
This is the output format of stb_image for image decoding, so let's avoid a texture format conversion where possible. Also standardized SDL_PIXELFORMAT_ARGB8888 as the default texture format for all renderers.
A similar change was made for Vulkan in libsdl-org@a036aed
Code used wcslen that return number of characters, but D3D12 debug layer uses bytes + wide chars
It turns out the mapping we include doesn't work for real controllers, and they're using a generic chipset and generic name and can't be generally distinguished from other controllers. See libsdl-org#8644 for details.
Use the modifier state supplied with key events to track the system modifier state instead of relying on the state returned by XQueryPointer(), which can be racy when used with automated text entry.
Preferred driver entries have special conditions for initializing, which aren't relevant when a specific driver was explicitly requested.
_GetWinID() doesn't work with keyboard-related BMessages, because Haiku assumes you know what window has keyboard focus at the time, so these events don't have a `window-id` property. So when this call failed, the key event handler would return early. This was probably a copy/paste error that snuck in at some point, as SDL2 doesn't have this issue.
[ci skip]
[ci skip]
…lative mouse mode is disabled
This happens using hand tracking on a VR headset, and should be treated like normal touch interaction.
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.