Just for clarity: SLD2 is only available in libSDL2.a linker library form in ABIv11. SDL2.library (shared library) is not being released as it does not support more-then-one-client-at-a-time currently.
@sonountaleban:
Keen was built with this revision of SDL 2.32.10:
[url]https://github.com/deadwood2/contrib/tree/a1d7ba2af7fba118b4ee25ead923c455a6016ece/SDL2/main[/url]
You could make a "libSDL2.a" file and link it directly into your game, instead of replacing the system-wide "SDL2.library", to avoid side effects on other SDL2-apps.
Thank you very much. Indeed, I was reading values from GameController functions, I'll try the ones for Joystick.
UPDATE: I get no joystick found, I don't think there is an issue with lowlevel.library, my joystick is recognised by your game. How can I check whether my SDL2 system is built with joystick support and if not how I can add it?
Edited by sonountaleban on 09-08-2026 07:27, 1 month ago
Hi!
Yes the port uses SDL2. The important detail is that it is linked against the AROS specific SDL2 port from the Deadwood contrib sources.
That SDL2 version has an AROS joystick backend which accesses controllers through lowlevel.library and ReadJoyPort(). I did not implement a separate USB/HID driver in the game.
The game explicitly initializes both input subsystems:
[code]SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER);
SDL_JoystickEventState(SDL_ENABLE);
SDL_GameControllerEventState(SDL_ENABLE);[/code]
It then enumerates all devices with SDL_NumJoysticks() and opens them with SDL_JoystickOpen().
A particularly important point on AROS is that the game does not rely exclusively on the SDL GameController API. The AROS backend may expose a USB pad as a normal SDL_Joystick without providing a standard GameController mapping. Therefore, the port always uses the raw joystick interface as a fallback:
[ulist=disc]axes 0 and 1 via SDL_JoystickGetAxis()
D-pad/hat via SDL_JoystickGetHat()
buttons via SDL_JoystickGetButton()[/ulist]
The SDL event queue is pumped every frame. The code also handles SDL_JOYDEVICEADDED and SDL_JOYDEVICEREMOVED, taking care that the "added" event contains a device index while the "removed" event contains an instance ID.
If your game only uses SDL_GameControllerOpen(), try the raw SDL_Joystick API as well. Also check the result of:
[code]printf("Joysticks: %dn", SDL_NumJoysticks());[/code]
If it returns zero, your SDL2 library may have been built without the AROS joystick backend, or lowlevel.library cannot see the device.
Edited by A500Fan on 08-08-2026 20:17, 1 month ago
Hello,
Have you used SDL2 to make this porting? My USB joypad works well in this game but it doesn't work with my SDL2 game... How did you implement it that support?
I phrased that somewhat clumsily.
I don't suspect the audio driver is faulty. It could be a timing or shutdown issue regarding how the game terminates its asynchronous AHI requests, and that this only manifests in combination with the AROS-Hosted/Linux audio path.
However, since I am still very new to AROS development, I might be completely on the wrong track.
Thanks to both of you for testing!
That narrows down the issue. It’s an ALSA problem that only occurs when hosted on Linux. Maybe I can find a way to work around it.
No problems on VMware and AROS One 64-bit v11 either Keen 4 closes properly!
[url=https://www.arosworld.org/infusions/forum/index.php?viewforum&forum_id=16][b]AROS One All Thread[/b][/url]
[url=https://sites.google.com/view/arosone][b]AROS One Home Site[/b][/url]
[url=https://www.facebook.com/profile.php?id=100095334408019][b]AROS One Facebook[/b][/url]
@retrofaza
Many thanks :-)
Closing the window doesn't cause a crash for me on Aros ONE / QEMU.
My main suspicion regarding the error you're seeing is an AROS-Hosted-specific AHI/ALSA/PipeWire race condition during shutdown.
Does this error also occur if you launch the game as follows - that is, with the additional "/NOAHI" flag?
[b]Commander Keen IV was a very popular platformer for MS-DOS in the 1990s.
[/b]
A port for AROS x64 (ABIv11) is now available:
[url]https://arosarchives.os4depot.net/share/game/platform/keen4.x86_64-aros-v11.lha[/url]
You can view all discussion threads in this forum. You cannot start a new discussion thread in this forum. You cannot reply in this discussion thread. You cannot start on a poll in this forum. You cannot upload attachments in this forum. You cannot download attachments in this forum.