The monochrome display is 96x64 pixels. KnightOS programs are expected to allocate a 768-byte buffer of memory, and place the address in IY (allocScreenBuffer does this for you). You may use fastCopy to copy this buffer to the display. This page documents monochrome functions. For the color display, see color.

Display

allocScreenBuffer View Source

Allocates a 768-byte screen buffer.

Outputs

IY

Screen buffer

clearBuffer View Source

Turns off all pixels on a screen buffer.

Inputs

IY

Screen buffer

drawLine View Source

Draws a line on the screen buffer using OR (turns pixels ON) logic.

Inputs

IY

Screen buffer

D, E

X1, Y1

H, L

X2, Y2

Notes

This function does not clip lines to the screen boundaries.

drawVLine View Source

Draws a vertical line on the screen buffer using OR (turns pixels ON) logic. Does clipping.

Inputs

IY

screen buffer

C

height

A, L

X, Y

drawVLineAND View Source

Draws a vertical line on the screen buffer using AND (turns pixels OFF) logic. Does clipping.

Inputs

IY

screen buffer

C

height

A, L

X, Y

fastCopy View Source

Copies the screen buffer to the LCD.

Inputs

IY

Screen buffer

Notes

This routine will return immediately without drawing to the LCD if the calling thead does not have an LCD lock. Acquire one with getLcdLock.

On a TI-84+ CSE, this routine will draw the 96x64 monochrome buffer (the "legacy" buffer) to the LCD. The LCD should be set to legacy mode (see setLegacyLcdMode).

freeScreenBuffer View Source

Deallocates a screen buffer allocated with allocScreenBuffer

Inputs

IY

Screen buffer

getPixel View Source

Finds the address of and mask for a pixel on the screen buffer.

Inputs

IY

Screen buffer

A,L

X, Y

Outputs

A

Mask

HL

Address of pixel

Notes

If the pixel is on, HL & A is nonzero.

invertPixel View Source

Inverts a pixel on the screen buffer.

Inputs

IY

Screen buffer

A,L

X, Y

putSprite16AND View Source

Draws a 16xB sprite on the screen buffer using AND (turns pixels OFF) logic.

Inputs

IY

Screen buffer

D, E

X, Y

B

Height

HL

Sprite pointer

Notes

Each 16-wide group of pixels is represented by two adjacent octets.

putSprite16OR View Source

Draws a 16xB sprite on the screen buffer using OR (turns pixels ON) logic.

Inputs

IY

Screen buffer

D, E

X, Y

B

Height

HL

Sprite pointer

Notes

Each 16-wide group of pixels is represented by two adjacent octets.

putSprite16XOR View Source

Draws a 16xB sprite on the screen buffer using XOR (invert) logic.

Inputs

IY

Screen buffer

D, E

X, Y

B

Height

HL

Sprite pointer

Notes

Each 16-wide group of pixels is represented by two adjacent octets.

putSpriteAND View Source

Draws an 8xB sprite on the screen buffer using AND (turns pixels OFF) logic.

Inputs

IY

Screen buffer

D, E

X, Y

B

Height

HL

Sprite pointer

putSpriteOR View Source

Draws an 8xB sprite on the screen buffer using OR (turns pixels ON) logic.

Inputs

IY

Screen buffer

D, E

X, Y

B

Height

HL

Sprite pointer

putSpriteXOR View Source

Draws an 8xB sprite on the screen buffer using XOR (invert) logic.

Inputs

IY

Screen buffer

D, E

X, Y

B

Height

HL

Sprite pointer

rectAND View Source

Draws a filled rectangle on the screen buffer using AND (turns pixels OFF) logic.

Inputs

IY

Screen buffer

C, B

Width, height

E, L

X, Y

rectOR View Source

Draws a filled rectangle on the screen buffer using OR (turns pixels ON) logic.

Inputs

IY

Screen buffer

C, B

Width, height

E, L

X, Y

rectXOR View Source

Draws a filled rectangle on the screen buffer using XOR (invert) logic.

Inputs

IY

Screen buffer

C, B

Width, height

E, L

X, Y

resetPixel View Source

Resets (turns off) a pixel on the screen buffer.

Inputs

IY

Screen buffer

A,L

X, Y

setPixel View Source

Sets (turns on) a pixel on the screen buffer.

Inputs

IY

Screen buffer

A,L

X, Y