The KERNEL provides the basic operating system for the Retroputer. It consists of several useful subroutines that facilitate communication between the system and external devices. These devices include the keyboard, screen memory, mouse, and more.
- General
- IO
- Low level
- open(device, ch#, mode) where mode is character or block
- recv(device, ch#) → byte
- status(device, ch#) → indicates if open, the mode, and if data is waiting or can be sent
- send(device, ch#, byte)
- close(device, ch#)
- Editor
- getCursorPosition → x, y
- setCursorPosition(x, y)
- setCursorSprite(sprite#); if sprite is #FF then cursor is not visible. Defaults to sprite #0E.
- writeChar(char)
- write(str)
- writeLine(str)
- read(buffer)
- readLine(buffer)
- clearScreen
- setBackgroundColor(color)
- setForegroundColor(color)
- setBorderColor(color)
- setCursorColor(color)
- setCursorBlinkSpeed(frames); $FF indicates no blinking
- Keyboard
- getChar → last key pressed
- waitForChar
- Gamepad
- getControllerButtonState(controller) → 0000yxba
- getControllerXAxis(controller) → -128 to 127 (-1 to 1)
- getControllerYAxis(controller)
- getControllerDirection(controller) →0000udlr
- Mouse
- setPointerSprite(sprite#), if $FF, pointer is hidden. Defaults to $0F (which is defaulted to a pointer)
- getPointerPosition → x, y
- setPointerPosition (x, y)
- getButtonState → 00000rml (right, medium, left)
- getPointerDelta → x, y