procedure |
SetGraphicsMode |
procedure SetGraphicsMode(Mode : global byte); |
Sets graphics mode. GRAPHICS_2: 512x240 2 color mode (code: 0) GRAPHICS_4: 256x240 4 color mode (code: 1) GRAPHICS_16: 128x240 16 color mode (code: 2). Example: SetGraphicsMode(TVC::GRAPHICS_16); Uses the System ROM (firmware) function. |
function |
GetGraphicsMode |
function GetGraphicsMode() : byte; |
Gets graphics mode. Result: 0: GRAPHICS 2 1: GRAPHICS 4 2: GRAPHICS 16 Example: if (TVC::GetGraphicsMode() <> TVC::GRAPHICS_4) then TVC::SetGraphicsMode(TVC::GRAPHICS_4); |
procedure |
ClearScreen |
procedure ClearScreen(); |
Clear screen using the background color Example: TVC::TextBackground(0); TVC::ClearScreen(); |
procedure |
Cls |
procedure Cls(); |
Clear screen by BASIC CLS routin Uses the System ROM (firmware) function. |
procedure |
SetPalette |
procedure SetPalette(Nr, Color : global byte); |
Sets 2-color or 4-color palette using hardware ports. Params: Nr: Palette index (Graph.2: 0 - 1 or Graph.4: 0 - 3) Color: Color code Example: SetPalette(1, TVC::BORDER_RED); Color codes (decimal code: Crt const): 0: PALETTE_BLACK 1: PALETTE_DARKBLUE 4: PALETTE_DARKRED 5: PALETTE_DARKMAGENTA 16: PALETTE_DARKGREEN 17: PALETTE_DARKCYAN 20: PALETTE_DARKYELLOW 21: PALETTE_GRAY 64: PALETTE_BLACK2 65: PALETTE_BLUE 68: PALETTE_RED 69: PALETTE_MAGENTA 80: PALETTE_GREEN 81: PALETTE_CYAN 84: PALETTE_YELLOW 85: PALETTE_WHITE Uses the System ROM (firmware) function. |
procedure |
SetBorder |
procedure SetBorder(Color : global byte); |
Sets the border color Example: TVC::SetBorder(TVC::BORDER_BLUE); Border colors: BORDER_BLACK BORDER_DARKBLUE BORDER_DARKRED BORDER_DARKMAGENTA BORDER_DARKGREEN BORDER_DARKCYAN BORDER_DARKYELLOW BORDER_GRAY BORDER_BLACK2 BORDER_BLUE BORDER_RED BORDER_MAGENTA BORDER_GREEN BORDER_CYAN BORDER_YELLOW BORDER_WHITE Uses the System ROM (firmware) function. |
procedure |
WaitForSync |
procedure WaitForSync(); |
Waits until a vertical sync (raster-interrupt) has been performed. |
procedure |
SetRasterInterruptPos |
procedure SetRasterInterruptPos(LineNr : global byte); |
Set the raster-interrupt position on the screen Params: LineNr: 0-239 Example: SetRasterInterruptPos(200); |
procedure |
SetMemory |
procedure SetMemory(Mode : global byte); |
Set memory mapping Params: MEM_DEFAULT (0): U0, U1, U2, SYS MEM_VID_ON (1): U0, U1, VID, SYS MEM_64K (2): U0, U1, U2, U3 MEM_32K_VID_16K (3): U0, U1, VID, U3 16K pages: U0-U3: user memory; VID: video RAM; SYS: sysem ROM Example: SetMemory(TVC::MEM_VID_ON); |
procedure |
MemCopy |
procedure MemCopy(SourcePtr, DestPtr: global pointer; Size: global integer); |
Copy data from the source memory address to the destination memory address. SourcePtr: pointer to the source memory address DestPtr: pointer to destination memory address Size: number of bytes to copy Example: TVC::MemCopy(#TitlePicture, $8000, 15360); |
procedure |
GotoXY |
procedure GotoXY(X, Y : global byte); |
Sets text X (horizontal) and Y (vertical) position. X: 1 - 64 in Graphics 2 mode X: 1 - 32 in Graphics 4 mode X: 1 - 16 in Graphics 16 mode Y: 1 - 24 in all graphics modes Left top position: 1, 1 Example: TVC::GotoXY(1, 23); Uses the System ROM (firmware) function. |
procedure |
Write |
procedure Write(Text : global ^byte); |
Writes the text specified in the param to the current position. Example: Write("TRSE CRT Tutorial"); Uses the System ROM (firmware) function. |
procedure |
WriteAt |
procedure WriteAt(X, Y : global byte; Text : global ^byte); |
Writes the Text param to the specified character position. Params: X: horizontal character pos. 1 - 16 / 32 / 64 Y: vertical character pos. 1 - 24 Text: text to write. Text length: 1 - 254 Left top position: 1, 1 Example: WriteAt(10, 7, "TRSE Tutorial"); Uses the System ROM (firmware) function. |
procedure |
SetColor |
procedure SetColor(Color : global byte); |
Sets text or line ink color. Params: Graphics2: 0 - 1 Graphics2: 0 - 3 Graphics16: 1 - 15 Example: SetColor(1); Uses the System ROM (firmware) variable. |
procedure |
TextBackground |
procedure TextBackground(Color : global byte); |
Sets text background color Params: Graphics2: 0 - 1 Graphics2: 0 - 3 Graphics16: 1 - 15 Example: TextBackground(3); Uses the System ROM (firmware) variable. |
procedure |
TextStyle |
procedure TextStyle(Style : global byte); |
Sets text overwrite style. Params: 0: TEXT_STYLE_DEFAULT - overwrite 1: TEXT_STYLE_NO_INK - no ink 2: TEXT_STYLE_TRANSPARENT - transparent background 3: TEXT_STYLE_INVISIBLE - transparent background and no ink Example: TVC::TextStyle(TVC::TEXT_STYLE_TRANSPARENT); Uses the System ROM (firmware) variable. |
procedure |
DefChar |
procedure DefChar(CharCode : global byte; CharDataPtr : global pointer); |
(Re)Define character Params: CharCode: the code of the character to be redefined (128 - 223) CharDataPtr: pointer to 10 bytes of character - 1 byte/char-line, 1 bit/pixel Example: TVC::DefChar(128, #ChrData); var ChrData: array[10] of byte = (85,254,103,202,79,206,75,230,127,170); Uses the System ROM (firmware) function. |
procedure |
CreateCharImage |
procedure CreateCharImage(CharCode, Count, Background, Color : global byte); |
Create an image from a redefined character. The created images can be used by the FastPutChar procedure. It currently only works in Graphics 4 mode. Params: CharCode: the redefined character code(154 - 223) Count: the number of characters to convert to an image (1 - 80) Background: the image background color Graphics2: 0-1 Graphics4: 0-3 Graphics2: 0-15 Color: the image ink color Graphics2: 0-1 Graphics4: 0-3 Graphics2: 0-15 Example: TVC::CreateCharImage(158, 0, 1); |
procedure |
PutCharImage |
procedure PutCharImage(X, Y, CharCode, Count : global byte); |
Put created image from defined character to the specified position. Before using it, call the CreateCharImage procudure to create the char-image. Params: X: horizontal char. pos. (0 - 63) Y: vertical char. pos. (0 - 240) CharCode: first char image code (154 - 223) Count: number of characters to display (1 - 80) Example: TVC::PutCharImage(0, 0, 154, 1); |
procedure |
PutTransparentCharImage |
procedure PutTransparentCharImage(X, Y, CharCode, Count : global byte); |
Put created image from defined character to the specified position. The character background is transparent Before using it, call the CreateCharImage procudure to create the char-image. Params: X: horizontal char. pos. (0 - 63) Y: vertical char. pos. (0 - 240) CharCode: first char image code (154 - 223) Count: number of characters to display (1 - 80) Example: TVC::PutCharImage(0, 0, 154, 1); |
procedure |
PutPixel |
procedure PutPixel(X1, Y1 : global integer); |
Put a pixel to the X1 and Y1 coordinates. The left bottom corner coordinates are X: 0, Y: 0, and the right top is X: 1023, Y: 959. X1 - point horizontal position: 0 - 1023 Y1 - point vertical position: 0 - 959 Example: TVC::PutPixel(512, 480); Uses the System ROM (firmware) function. |
procedure |
Line |
procedure Line(X1, Y1, X2, Y2 : global integer); |
Draw a line between two points. The X and Y coordinates of the two points passed in params. The left bottom corner coordinates are X: 0, Y: 0, and the right top is X: 1023, Y: 959. Params: X1 - point #1 horizontal position: 0 - 1023 Y1 - point #1 vertical position: 0 - 959 X2 - point #2 horizontal position: 0 - 1023 Y2 - point #2 vertical position: 0 - 959 Example: TVC::Line(0, 0, 1023, 959); Uses the System ROM (firmware) function. |
procedure |
LineRel |
procedure LineRel(X1, Y1 : global integer); |
Draw a line from the current pen position to reletive position. Params: X1: horizontal displacement Y1: vertical displacement Example: TVC::LineRel(200, 100); Uses the System ROM (firmware) function. |
procedure |
MoveTo |
procedure MoveTo(X1, Y1 : global integer); |
Move pen to X1, Y1 position. The left bottom corner coordinates are X: 0, Y: 0, and the right top is X: 1023, Y: 959. Params: X1 - horizontal position: 0 - 1023 Y1 - vertical position: 0 - 959 Example: TVC::MoveTo(512, 480); Uses the System ROM (firmware) function. |
procedure |
MoveRel |
procedure MoveRel(X1, Y1 : global integer); |
Move pen to relative position. Params: X1: horizontal displacement Y1: vertical displacement Example: TVC::MoveTo(100, 50); Uses the System ROM (firmware) function. |
procedure |
Rectangle |
procedure Rectangle(X1, Y1, X2, Y2 : global integer); |
Draw a rectangle. The opposite corners coordinates passed in the params. The screen left bottom coordinates are X: 0, Y: 0, and the right top is X: 1023, Y: 959. Params: X1 - left top corner X position: 0 - 1023 Y1 - left top corner Y position: 0 - 959 X2 - right bottom corner X position: 0 - 1023 Y2 - right bottom corner Y position: 0 - 959 Example: TVC::Rectangle (10, 280, 160, 130); Uses the System ROM (firmware) functions (BABS: move to pos., and BON: pen ON). |
procedure |
VerticalBytes |
procedure VerticalBytes(X, Y, Count, Pattern : global byte); |
Drawing a vertical line to the byte border. Use the color set by SetColor procedure Coordinates of the upper left corner x: 0, y: 0, and the right lower X: 64, Y: 239. Params: X: horizontal line start position (0 - 64) Y: vertical line start position (0 - 239) Count: 1-240 Pattern: byte pattern for put Example: TVC::VerticalBytes(20, 100, 100, 128); |
procedure |
Fill |
procedure Fill(); |
Fill area from the current pen position. Uses the System ROM (firmware) function. |
procedure |
SetLineStyle |
procedure SetLineStyle(Style : global byte); |
Sets line style to specified param. Uses the System ROM (firmware) variable. Allowed values: 1 - 14 Example: TVC::SetLineStyle(4); |
procedure |
SetLineMode |
procedure SetLineMode(Mode : global byte); |
Sets line mode by param Param: LINE_MODE_DEFAULT (0) - overwrite LINE_MODE_OR (1) - OR LINE_MODE_AND (2) - AND LINE_MODE_XOR (3) - XOR Example: TVC::SetLineMode(TVC::LINE_MODE_XOR); Uses the System ROM (firmware) function. |
procedure |
FillRect |
procedure FillRect(X, Y, Width, Height : global byte); |
Draw a filed rectangle uses the current TextBackground color Screen width is 64 characters and screen height is 240 pixels Left top corner: 0, 0; right bottom corner: 63, 239 Params: X: left position: 0 - 63 Y: top position: 0 - 239 Width : 1- 64 Height: 1-240 Example: TVC::FillRect(10, 100, 30, 80); |
function |
ReadKey |
function ReadKey() : byte; |
Waiting for any key pressing. Return to pressed key code. Example: if (TVC::ReadKey() = 13) then Start(); Uses the System ROM (firmware) function. |
function |
IsPressed |
function IsPressed() : byte; |
Returns whether any key has been pressed. Result: TRUE: any key is pressed; False: not Uses the Keyboard matrix system variables. |
function |
SpacePressed |
function SpacePressed() : boolean; |
Returns whether the "Space" button is pressed. Result: TRUE: Space key is pressed; False: not Uses the Keyboard matrix system variables. |
function |
ReturnPressed |
function ReturnPressed() : boolean; |
Returns whether the "Return" button is pressed. Result: TRUE: Return key is pressed; False: not Uses the Keyboard matrix system variables. |
function |
EscPressed |
function EscPressed() : boolean; |
Returns whether the "Esc" button is pressed. Result: TRUE: Esc key is pressed; False: not Uses the Keyboard matrix system variables. |
function |
CtrlPressed |
function CtrlPressed() : boolean; |
Returns whether the "Ctrl" button is pressed. Result: TRUE: Ctrl key is pressed; False: not Uses the Keyboard matrix system variables. |
function |
AltPressed |
function AltPressed() : boolean; |
Returns whether the "Alt" button is pressed. Result: TRUE: Alt key is pressed; False: not Uses the Keyboard matrix system variables. |
function |
ShiftPressed |
function ShiftPressed() : boolean; |
Returns whether the "Shift" button is pressed. Result: TRUE: Shift key is pressed; False: not Uses the Keyboard matrix system variables. |
function |
Joystick |
function Joystick(Nr, KeyCode : global byte) : boolean; |
Get the status of joystick directions or fire button. Params: 1. JoyNr: 1: joystick #1 or internal 2: joystick #2 2. KeyCode: JOY_LEFT JOY_RIGHT JOY_UP JOY_DOWN JOY_FIRE Result true: the specified direction or fire button is pressed false: not pressed Example: if (TVC::Joystick(1, TVC::JOY_FIRE)) then PlayerFire(); WARNING! It only works if you have not changed the system Interrupt Handler (default) or you set the Keyboard Matrix in your program. |
function |
In |
function In(PortNr : global byte) : byte; |
Input value from a hardware port Params: PortNr: the hardware port number (0 - 255) Example: Value := TVC::In(0); |
procedure |
Out |
procedure Out(PortNr, Value : global byte); |
Output a value to a hardware port Params: PortNr: the hardware port number (0 - 255) Value: the value to send to the port (0 - 255) Example: TVC::Out(0, 130); |
function |
Rnd |
function Rnd() : byte; |
Get random number between 0-255 |
procedure |
Delay |
procedure Delay(DelayTicks : global integer); |
Waiting for param DelayTicks * 20 ms The accurate value: 20.096 ms - the default Raster-interrupt frequency Example: TVC::Delay(10); WARNING! The delay duration changes by the Sound-interrupt frequency when Sound-interrupt is set. |
procedure |
IntToStr |
procedure IntToStr(X1 : global integer); |
Convert an integer to a string The result is placed in the NumStr variable. Example: TVC::IntToStr(Number); TVC::Write(#TVC_NumStr); |
procedure |
ByteToStr |
procedure ByteToStr(Nr : global byte); |
Convert a byte to a string The result is placed in the NumStr variable. Example: TVC::IntToStr(Number); TVC::Write(#TVC_NumStr); |
function |
Odd |
function Odd (Nr : global byte) : boolean; |
— |
procedure |
Volume |
procedure Volume(SoundVolume : global byte); |
Sets sound volume to specified value Params: Volume: 0 - 15 Example: TVC::Volume(15); |
procedure |
SoundOn |
procedure SoundOn(); |
Firmware sound sign initialization. Example: TVC::SoundOn(); Not necessary to use before calls Sound or SoundEx procedures. You are only used if you have previously called SoundOff and want to turn the sound on again. |
procedure |
SoundOff |
procedure SoundOff(); |
Disable firmware sound sign. Example: TVC::SoundOff(); |
procedure |
Sound |
procedure Sound(Pitch : global integer); |
Plays the sound specified in Pitch param. Params: Pitch (sound value): 0 - 4095 (4095: silent) Example: TVC::Sound(3677); The sound plays until calls NoSound() procedure. Calculation sound Hz: 195312.5 / (4096 - Pitch) For example, the octave 4, #A sound (466.16 Hz) value is $E5D (decimal: 3677) |
procedure |
SoundEx |
procedure SoundEx(Pitch : global integer, Duration, SoundVolume : global byte); |
Play sound for a specified duration and volume. Params: Pitch (sound value): 0 - 4095 (4095: silent) Duration: in 20 ms; values: 1-255 Volume: 0 - 15 (0: silent) Example: TVC::SoundEx(3377, 10, 15); Calculation sound Hz -> 195312.5 / (4096 - sound value) For example, the octave 4, #A sound (466.16 Hz) value is $E5D (decimal: 3677) Uses the System ROM (firmware) function. |
procedure |
NoSound |
procedure NoSound(); |
Stops the currently played sound. |
procedure |
CreateFile |
procedure CreateFile(FileName : global ^byte); |
Create file or open file for writing Params: FileName: name of the file (max length: 16 chars) Example: CreateFile("NewFile.txt"); Uses the System ROM (firmware) function. |
function |
OpenFile |
function OpenFile(FileName : global ^byte) : boolean; |
Open file for reading Params: FileName: name of the file (max length: 16 chars) Result: true: success false: failed Example: OpenFile("Picture.bin"); Uses the System ROM (firmware) function. |
procedure |
CloseFile |
procedure CloseFile(); |
Close file Example: CloseFile(); Uses the System ROM (firmware) function. |
function |
ByteRead |
function ByteRead() : byte; |
Read a byte from the opened file Example: DataByte := ReadByte(); Uses the System ROM (firmware) function. |
function |
BlockRead |
function BlockRead(BlockData : global ^byte; BlockLength : global integer) : integer; |
Read a data block from file Params: BlockData: buffer for reading data BlockLength: number of bytes to read Result: 0: success otherwise: the number of bytes not readed from the file, in case of any error Example: BlockRead(#Data, 16384); Uses the System ROM (firmware) function. |
function |
BlockWrite |
function BlockWrite(BlockData : global ^byte; BlockLength : global integer) : integer; |
Write a data block to created file Params: BlockData: data address BlockLength: number of bytes to write Result: 0: success otherwise: the number of bytes not written to the file, in case of any error Example: BlockWrite(#Data, 16384); ATTENTION! It can only be called once to write the data to a file; it is impossible to save the data in several parts with several calls. Uses the System ROM (firmware) function. |