MorphOS lowlevel.library
The lowlevel.library offers timer and keyboard/joystick support functions to game and demo programmers.
The original library was designed by Commodore and is the perfect example of a braindead API:
- Input functions are polling based while AmigaOS/MorphOS is event driven.
- Input functions are system wide, not application based. If left is pressed, it is expected only the active applications detects it. With lowlevel, the others also detect it.
- Some features can only be used by one application at a time. Really a bad idea in a multitasking environement.
- Some other timer function only works for 16 hours. Then it returns wrong results.
- Programmers are invited to use software interruption instead of high priority thread.
And, of course, the previous issues all come from the API, not from its current implementation. So, it is not possible to fix everything.
The original library was also directly accessing the Amiga hardware and doing so many nasty things it could not work on modern MorphOS systems.
About MorphOS reimplementation:
- Most of the original API (including all known undocumented functions) should be working. Although everything is probably implemented in a very different, much cleaner and more system/multitasking friendly way. No interrupt is ever used: everything is reimplemented using tasks, input handlers and so on...
- Joysticks
- bplan's Pegasos "game port" is supported
- USB joysticks are supported through the Poseidon USB stack
- there is an emulation using keyboard.device to help programmers with no game hardware.
- Some automagic stuff like:
- gamepads self-calibration
- gamepads hotplug (attention: the gameport hardware does NOT support it!)
- ReadJoyPort() resets MorphOS 1.5+ blankers timeout on joystick input
Limitations:
- ReadJoyPort() only reports mouse button events on the port 0
- ReadJoyPort() does not report mouse movement
- Poseidon does not use the keyboard.device so USB keyboards are not supported
- some features are not implemented on purpose:
- SystemControlA()/SCON_CDReboot (to reboot on CD eject)
- SystemCOntrolA()/SCON_StopInput (to kill input...)
The v50 library is part of MorphOS and was released in 2002. Many thanks to Sigbjørn Skjæret, Frank Mariak, Piru Sintonen and others for their help.
Download lowlevel.library v51 public beta for MorphOS 1.4+.
Please do not contact the MorphOS team about it. If you have any bug-report, suggestion or comment then contact me exclusively.