Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

Commander Keen IV. for AROS

Last updated on 13 days ago
A
A500FanJunior Member
Posted 1 month ago
Commander Keen IV was a very popular platformer for MS-DOS in the 1990s.

A port for AROS x64 (ABIv11) is now available:
https://arosarchives.os4depot.net/share/game/platform/keen4.x86_64-aros-v11.lha

i.postimg.cc/FsqPP4Nr/keen4-titelbild.jpg


i.postimg.cc/yNrWRv0j/keen4.jpg


Start
-----
Double-click the Commander_Keen_4 icon.

AHI Unit 0 must be configured for the available audio hardware.
If you use QEMU with an ES1370 device, select the SB128 HiFi 16-bit stereo mode.

Controls
--------
Cursor keys Move
Ctrl Jump
Alt Pogo stick
Space Neural Stunner
Esc Menu
F5 / F9 Quick save / quick load

The controls can be changed in the game menu.
amigamia, retrofaza, sonountaleban, ami-elvis, Argo
R
retrofazaDistro Maintainer
Posted 1 month ago
Thanks for another port for AROS Smile
FYI: The game crashes on AROS Hosted when you close the window with the mouse.
You do not have access to view attachments
A
A500FanJunior Member
Posted 1 month ago
@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?

aros_x64_abiv11_commander_keen /EPISODE 4 /INTEGER /VSYNC /NOAHI
Edited by A500Fan on 17-07-2026 08:15, 1 month ago
AMIGASYSTEMAMIGASYSTEMDistro Maintainer
Posted 1 month ago
No problems on VMware and AROS One 64-bit v11 either Keen 4 closes properly!
R
retrofazaDistro Maintainer
Posted 1 month ago
Yes, with the /NOAHI argument, there is no crash
A
A500FanJunior Member
Posted 1 month ago
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.
D
deadwoodAROS Dev
Posted 1 month ago
@retrofaza

Just to clarify: I assume other software using audion, like SDL games, work for you on hosted and don't produce crash, correct?
A
A500FanJunior Member
Posted 1 month ago
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.
D
deadwoodAROS Dev
Posted 1 month ago
Ok, thanks I got it now. In the past there were problems with ALSA over PipeWire so I also wanted to make sure these problems did not resurface again.
R
retrofazaDistro Maintainer
Posted 1 month ago

deadwood wrote:

@deadwood - @retrofaza

Just to clarify: I assume other software using audion, like SDL games, work for you on hosted and don't produce crash, correct?


Yes, other games work Smile
S
sonountalebanMember
Posted 17 days 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?
A
A500FanJunior Member
Posted 15 days 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:
SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER);
SDL_JoystickEventState(SDL_ENABLE);
SDL_GameControllerEventState(SDL_ENABLE);

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:
  • axes 0 and 1 via SDL_JoystickGetAxis()
  • D-pad/hat via SDL_JoystickGetHat()
  • buttons via SDL_JoystickGetButton()

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:
printf("Joysticks: %dn", SDL_NumJoysticks());

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, 15 days ago
S
sonountalebanMember
Posted 15 days ago
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, 14 days ago
A
A500FanJunior Member
Posted 14 days ago
@sonountaleban:
Keen was built with this revision of SDL 2.32.10:
https://github.com/deadwood2/contrib/tree/a1d7ba2af7fba118b4ee25ead923c455a6016ece/SDL2/main

The required files are:
- SDL2 source archive:
https://www.libsdl.org/release/SDL2-2.32.10.tar.gz
- SDL2-2.32.10-aros.diff
https://github.com/deadwood2/contrib/blob/a1d7ba2af7fba118b4ee25ead923c455a6016ece/SDL2/main/SDL2-2.32.10-aros.diff
- mmakefile.src
https://github.com/deadwood2/contrib/blob/a1d7ba2af7fba118b4ee25ead923c455a6016ece/SDL2/main/mmakefile.src
- SDL2.conf
https://github.com/deadwood2/contrib/blob/a1d7ba2af7fba118b4ee25ead923c455a6016ece/SDL2/main/SDL2.conf

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.
D
deadwoodAROS Dev
Posted 13 days ago
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.
S
sonountalebanMember
Posted 13 days ago
I've updated the include/lib stuff to 2.32.10 - I was using 2.32.8 - and now it works, thanks.
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.
Users who participated in discussion: deadwood, AMIGASYSTEM, retrofaza, sonountaleban, A500Fan