- Home
- Documentation
- Quick OS
- Components
- QuickScreen
QuickScreen
Support to control output on multiple text screens of varying heights. The widths supported are all of the possible Atari text screen widths possible: 48, 40, 32, 24, 20, and 16.
NOTE: Screen indices as well as X and Y positions are all 0-based, starting from 0 and going up. On a 40x25 screen, the valid X positions are 0 to 39 and the valid Y positions are 0 to 24. With support for 8 screen entries, the valid indices used will be 0 to 7.
Functions
Screen Selection
Wipes out all screens, sets a new display list with 40x25 text in ANTIC mode 2, and adds a single screen for the 40x25 screen area.
Sets the active screen by its index.
Removes a screen entry by its index.
Removes every screen. No valid screens are available afterwards.
Creates a new screen entry, which will become the active screen with an X and Y of 0.
Updates the details for the current screen.
Display
All of these target the active screen.
Sets the cursor position.
Sets just the cursor's X position.
Sets just the cursor's Y position.
Acts as if a new line character was output, adjusting X and Y position as appropriate, as well as auto-scrolling if necessary and enabled.
Wipes all or part of the screen.
Outputs a PString to the screen.
Outputs a PString in QuickOS::ZP_Dest.
Outputs a PString in QuickOS::ZP_Source.
Outputs a single character to the screen.
Zero Page Values
QuickScreen::ZP_ActiveLine
Address, The address for the current line on the active screen.
QuickScreen::ZP_ActiveX
Byte, The active screen X position.
This gets saved back to the screen when switching active screens.
QuickScreen::ZP_ActiveY
Byte, The active screen Y position.
This gets saved back to the screen when switching active screens.
QuickScreen::ZP_ActiveWidth
Byte, The width of the current screen.
QuickScreen::ZP_ActiveHeight
Byte, The number of lines in the current screen.
Values
Active Screen
The details for the active screen. Also see QuickScreen::ZP_Active* for other values.
QuickScreen::ActiveIndex
Byte, The active screen index. QuickScreen::INVALIDINDEX ($FF) if there are no screens.
QuickScreen::ActiveFlags
Byte, The active screen flags.
This gets saved back to the screen when switching active screens.
-
QUICKSCREEN_FLAGS::Highlight
-
Automatically sets the high bit on every value being displayed.
-
QUICKSCREEN_FLAGS::Literal
-
Output to this screen is literal so that new lines do not move to a new line.
-
QUICKSCREEN_FLAGS::AutoScroll
-
Auto scrolls text if the cursor goes beyond the last line, moving the Y position to the last line in that case.
QuickScreen::ActiveAddress
Address, The address of the active screen.
QuickScreen::ActiveSize
Word, The size of the active screen, in bytes. This is just width * height.
General Screen
These are configuration details for the general screen to use if SetGeneral is called. They should always be set to a readable font with a valid address, with a legible text color and background color. It is used to report errors/failures, but can also be used for general text I/O.
QuickScreen::GeneralFont
Address, The address to use for the general font.
Default: QuickScreen_Config::GeneralFont
QuickScreen::GeneralAddress
Address, The address of the general screen.
Default: QuickScreen_Config::GeneralAddress
QuickScreen::GeneralFlags
Byte, The flags to use for the general screen.
Default: See QuickScreen_Config::GENERALFLAGS_*
QuickScreen::GeneralBGColor
Byte, The background color to use for the general screen.
Default: QuickScreen_Config::GENERALBGCOLOR
QuickScreen::GeneralTextColor
Byte, The text color to use for the general screen.
Default: QuickScreen_Config::GENERALTEXTCOLOR
Internal Values
QuickScreen::NumScreen
Byte, The number of screens in use.
QuickScreen::ActiveState
Byte, Keeps basic state information about the current screen.
This gets saved back to the screen when switching active screens.
-
QUICKSCREEN_STATE::XOffScreen
-
Set if X is off screen, to jump to a new line on next character.
This will always be $40 so BIT QuickScreen::ActiveState can be used with BVC/BVS.
-
QUICKSCREEN_STATE::YOffScreen
-
Set if Y is off screen, to cause scrolling on output or prevent output.
This will always be $80 so BIT QuickScreen::ActiveState can be used with BPL/BMI.
QuickScreen::ActiveScrollSize
Word, The number of bytes to move when scrolling the screen. This is pre-calculated to save a few cycles every scroll.
Error Codes
QUICKOS_ERRORCODE::Screen_InvalidIndex ($20)
An invalid index was used.
QUICKOS_ERRORCODE::Screen_InvalidNumScreen ($21)
QuickScreen::NumScreen was invalid.
QUICKOS_ERRORCODE::Screen_NoneAvailable ($22)
There are no free screens available.
QUICKOS_ERRORCODE::Screen_InvalidWidth ($23)
The width used in Add or Update was invalid.
-
X
-
Byte, The width.
QUICKOS_ERRORCODE::Screen_InvalidHeight ($24)
The height used in Add or Update was invalid.
-
Y
-
Byte, The height.
QUICKOS_ERRORCODE::Screen_InvalidAddress ($25)
The address used in Add or Update was invalid.
-
X & Y
-
Address (X High), The address.
Configuration
QuickScreen_Config::MAXNUMSCREEN
Byte, The maximum number of screens allowed. It is recommended to keep this small since each ; potential screen occupies 8 bytes of memory to track its details.
Don't ever use more than 32 as that will cause a byte overflow on indexing the screen table!
This greatly changes the size of the resulting OS.
Default: 4
QuickScreen_Config::NEWLINE
Byte, The code to use for new line. $0A ("\n") or $0D ("\r") are expected.
Default: QuickOS_Config::NEWLINE
General Screen Defaults
QuickScreen_Config::GeneralFont
Address, The default address for the general screen's font.
Default: QuickOS_Config::ScreenAddress
QuickScreen_Config::GeneralAddress
Address, The default address for the general screen.
Default: QuickScreen_Config::GeneralFont + $0400
QuickScreen_Config::GENERALBGCOLOR
Byte, The default background color to use for the general screen.
Default: $00
QuickScreen_Config::GENERALTEXTCOLOR
Byte, The default text color to use for the general screen.
Default: $0E
QuickScreen_Config::GENERALFLAGS_HIGHLIGHT
Boolean, Default the general screen to using highlighted output.
Default: 0
QuickScreen_Config::GENERALFLAGS_LITERAL
Boolean, Default the general screen to using literal output.
Default: 0
QuickScreen_Config::GENERALFLAGS_AUTOSCROLL
Boolean, Default the general screen to using auto scroll.
Default: 1