author: bocianu bocianu@gmail.com
Set of useful constants, registers and methods to cope with text input and output without ATARI OS.
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs
name: | value: | description: |
---|---|---|
CHAR_RETURN | #$9b | Chars returned for special keys in ASCII code |
CHAR_ESCAPE | #$1b | |
CHAR_BACKSPACE | #$7e | |
CHAR_TAB | #$7f | |
CHAR_INVERSE | #$81 | |
CHAR_CAPS | #$82 | |
ICHAR_RETURN | #219 | Chars returned for special keys in Antic code |
ICHAR_ESCAPE | #91 | |
ICHAR_BACKSPACE | #126 | |
ICHAR_TAB | #127 | |
ICHAR_INVERSE | #193 | |
ICHAR_CAPS | #194 |
name: | address: | type: | description: |
---|---|---|---|
kbcode | $d209 | byte | code of last pressed key |
consol | $d01f | byte | console keys status |
name: | type: | description: |
---|---|---|
CRT_vram | word | contains address of video memory |
CRT_size | word | contains size of video memory |
CRT_screenWidth | byte | contains width of screen in bytes |
CRT_screenHeight | byte | contains height of screen in bytes |
CRT_cursor | word | contains cursor position in memory |
name: | description: |
---|---|
CRT_Init | procedure CRT_Init(vram_address: word; width, height: byte); overload;Initializes CRT library with video ram located at specified memory address, using custom values for screen width and height.
parameters: |
CRT_Init | procedure CRT_Init(vram_address: word); overload;Initializes CRT library with video ram located at specified memory address, Screen size is defined as default values (40 x 24).
parameters: |
CRT_Init | procedure CRT_Init; overload;Initializes CRT library with video ram pointed by savmsc register, Screen size is defined as default values (40 x 24).
parameters: |
CRT_Clear | procedure CRT_Clear; overload;Clears screen. |
CRT_Clear | procedure CRT_Clear(filler: byte); overload;Clears screen using specified byte as filling value. |
CRT_ClearRow | procedure CRT_ClearRow(row: byte); overload;Clears specified row of a screen.
parameters: |
CRT_ClearRow | procedure CRT_ClearRow; overload;Clears current row of a screen. |
CRT_GotoXY | procedure CRT_GotoXY(x, y: byte);Moves cursor to specified position on screen. x=0, y=0 is upper left corner.
parameters: |
CRT_WhereY | function CRT_WhereY: byte;Returns current vertical position of cursor (row).
returns: |
CRT_WhereX | function CRT_WhereX: byte;Returns current horizontal position of cursor (column).
returns: |
CRT_GetXY | function CRT_GetXY(x, y: byte): byte;Returns byte located at specified position on screen. x=0, y=0 is upper left corner.
parameters:returns: |
CRT_Write | procedure CRT_Write(s: string); overload;Outputs string at current cursor position. This function outputs text in Antic coding, not ATASCII. Add 'tilda' after finishing quote of your string to use Antic coding. Example: Write('Hello Atari'~); You may also use Atascii2Antic function, to convert strings.
parameters: |
CRT_Write | procedure CRT_Write(num: integer); overload;Outputs integer value at current cursor position.
parameters: |
CRT_Write | procedure CRT_Write(num: real); overload;Outputs real value at current cursor position.
parameters: |
CRT_WriteXY | procedure CRT_WriteXY(x,y: byte; s: string);Outputs string at desired position of the screen. x=0, y=0 is upper left corner.
parameters: |
CRT_WriteCentered | procedure CRT_WriteCentered(row: byte; s:string); overload;Outputs centered string at specified row of the screen.
parameters: |
CRT_WriteCentered | procedure CRT_WriteCentered(s:string); overload;Outputs centered string in current row of cursor.
parameters: |
CRT_WriteRightAligned | procedure CRT_WriteRightAligned(row: byte; s: string); overload;Outputs string right aligned at specified row of the screen.
parameters: |
CRT_WriteRightAligned | procedure CRT_WriteRightAligned(s: string); overload;Outputs string right aligned in current row of cursor.
parameters: |
CRT_Put | procedure CRT_Put(b: byte); overload;Outputs single byte at current position of the cursor.
parameters: |
CRT_Put | procedure CRT_Put(x, y, b: byte); overload;Outputs single byte at desired position of the screen. x=0, y=0 is upper left corner.
parameters: |
CRT_KeyPressed | function CRT_KeyPressed: boolean;Returns true if any key on keyboard is pressed down.
returns: |
CRT_ReadKey | function CRT_ReadKey: byte;Waits for key to be pressed and returns it's keyboard code.
returns: |
CRT_ReadChar | function CRT_ReadChar: byte;Waits for key to be pressed and returns it's value in ATASCII code.
returns: |
CRT_ReadCharI | function CRT_ReadCharI: byte;Waits for key to be pressed and returns it's value in ANTIC code.
returns: |
CRT_ReadStringI | function CRT_ReadStringI(limit: byte): string; overload;Reads string from keyboard, finished with return key, and returns it's value in ANTIC code. You can provide maximum number of chars to be entered.
returns: |
CRT_ReadStringI | function CRT_ReadStringI: string; overload;Reads string from keyboard, finished with return key, and returns it's value in ANTIC code. Maximum length is 255 chars
returns: |
CRT_ReadString | function CRT_ReadString(limit: byte): string; overload;Reads string from keyboard, finished with return key, and returns it's value in ATASCII code. You can provide maximum number of chars to be entered.
returns: |
CRT_ReadString | function CRT_ReadString: string; overload;Reads string from keyboard, finished with return key, and returns it's value in ATASCII code. Maximum length is 255 chars
returns: |
CRT_ReadInt | function CRT_ReadInt: integer;Reads integer value from keyboard, finished with return key,
returns: |
CRT_ReadFloat | function CRT_ReadFloat: real;Reads floating point value from keyboard, finished with return key, Dot symbol '.' is used to separate fractional part.
returns: |
CRT_NewLine | procedure CRT_NewLine; overload;Moves cursor to next line of screen. |
CRT_NewLine | procedure CRT_NewLine(offset: byte); overload;Moves cursor to next line of screen and sets left margin (text offset).
parameters: |
CRT_NewLines | procedure CRT_NewLines(count: byte);Moves cursor down by specifien number of lines.
parameters: |
CRT_CarriageReturn | procedure CRT_CarriageReturn;Moves cursor to the left margin of the screen, |
CRT_Invert | procedure CRT_Invert(x, y, width: byte);Inverts part of the screen. x=0, y=0 is upper left corner.
parameters: |
CRT_InvertRow | procedure CRT_InvertRow(row: byte);Inverts selected row of the screen.
parameters: |
CRT_StartPressed | function CRT_StartPressed: boolean;Returns true if START key is pressed down.
returns: |
CRT_SelectPressed | function CRT_SelectPressed: boolean;Returns true if SELECT key is pressed down.
returns: |
CRT_OptionPressed | function CRT_OptionPressed: boolean;Returns true if OPTION key is pressed down.
returns: |
CRT_HelpPressed | function CRT_HelpPressed:boolean;Returns true if HELP key is pressed down.
returns: |
Atascii2Antic | function Atascii2Antic(c: byte): byte;overload;Converts single byte from ATASCII to ANTIC coding.
parameters: |
Antic2Atascii | function Antic2Atascii(c: byte): byte; overload;Converts single byte from ANTIC to ATASCII coding.
parameters: |
Atascii2Antic | function Atascii2Antic(s: string): string; overload;Converts text string from ATASCII to ANTIC coding.
parameters: |
Antic2Atascii | function Antic2Atascii(s: string): string; overload;Converts text string from ANTIC to ATASCII coding.
parameters: |