KnightOS supports the TI-84+ Color Silver Edition. This calculator uses a ILI9335 display, which has a resolution of 320x240. KnightOS uses 16-bit colors, in the format 0bRRRRRGGGGGGBBBBB. Due to the size of the screen, and the speed requirements for driving it, KnightOS programs do not use an in-memory buffer. An uncompressed image the full size of the screen takes up more than all addressable memory on the device. Instead, we've provided functions for drawing directly to the LCD. Generally speaking, the color you wish to draw with is provided in the IY register (which is used for the monochrome buffer in non-color applications). The kernel supports both monochrome and color display modes on the same calculator, and even running at the same time. We refer to monochrome mode as "legacy mode", and color mode as "color mode". Your program should tell the kernel which mode you'd like to use, and the kernel will handle the switching semantics to help you coorperate with the rest of the enviornment.

Color

checkLegacyLcdMode View Source

Sets Z if the current thread is in legacy mode.

clearColorLcd View Source

Sets all pixels on the LCD to a specified color in color mode.

Inputs

IY

Color in 0bRRRRRGGGGGGBBBBB format

Notes

Overwrites the current clipping window.

clipColorRectangle View Source

Draws a clipped rectangle of the specified size with the specified color in color mode.

Inputs

IY

color of the rectangle in R5G6B5 format

C

height of the rectangle in pixels

B

Y coordinate in pixels

DE

width of the rectangle in pixels

HL

X coordinate in pixels

Notes

The rectangle will be clipped to any LCD window already in place, and restore it afterwards.

colorLcdOff View Source

Turns off the color LCD and backlight.

colorLcdOn View Source

Initializes and turns on the color LCD in color mode.

colorSupported View Source

Sets Z if color is supported on this device.

Outputs

A

errUnsupported if color is unsupported

Z

Set if supported, reset if unsupported

fullScreenWindow View Source

Sets the clipping window to fit the LCD screen in color mode.

readLcdRegister View Source

Reads a 16-bit value from a color LCD register

Inputs

A

Register

Outputs

HL

Value

Comments

Destroys C

resetLegacyLcdMode View Source

Sets the LCD to color mode. Call this before you call getLcdLock.

setLcdWindow View Source

Sets the LCD's clipping window. Values are inclusive.

Inputs

B

top border

DE

right border

C

bottom border

HL

left border

Notes

Destroys C

setLegacyLcdMode View Source

Sets the LCD to legacy mode.

Notes

Legacy mode simulates a 96x64 monochrome screen with the help of fastCopy. Color graphics are not advised in legacy mode.

writeLcdRegister View Source

Writes a 16-bit value to a color LCD register

Inputs

A

Register

HL

Value

Comments

Destroys C