home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-05-17 | 30.8 KB | 1,497 lines |
- Unicorn 1 Documentation 3.1 page 79
-
- __________________________________________________________________________
-
-
- prtbs
-
-
- Sends a backspace character to the printer.
-
-
-
-
- Call: prtbs();
-
-
-
-
-
- Example: main()
- {
- prtbs(); /* send a back space to the printer */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 80
-
- __________________________________________________________________________
-
-
- prtbuzz
-
-
- Sounds the printers alarm buzzer.
-
-
-
- Call: prtbuzz();
-
-
-
-
- Example: main()
- {
- prtbuzz(); /* sound the printer buzzer */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 81
-
- __________________________________________________________________________
-
-
- prtcan
-
-
- Sends a cancel character to the printer and stops the print.
-
-
-
-
- Call: prtcan();
-
-
-
-
-
- Example: main()
- {
- prtcan(); /* send a cancel to the printer */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 82
-
- __________________________________________________________________________
-
-
- prtcomof
-
-
-
- Turns off the printers compressed print mode.
-
-
-
-
- Call: prtcomof();
-
-
-
-
-
- Example: main()
- {
- prtcomof(); /* Turn off compressed print */
-
-
-
- Unicorn 1 Documentation 3.1 page 83
-
- __________________________________________________________________________
-
-
- prtcomon
-
-
-
- Turns on the printers compressed print mode.
-
-
-
-
- Call: prtcomon();
-
-
-
-
- Example: main()
- {
- prtcomon(); /* turn on the compressed mode */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 84
-
- __________________________________________________________________________
-
-
- prtcr
-
-
-
- Sends a carriage return character to the printer.
-
-
-
-
- Call: prtcr();
-
-
-
-
-
- Example: main()
- {
- prtcr(); /* send a carriage return to the printer */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 85
-
- __________________________________________________________________________
-
-
- prtduboff
-
-
- This function turns off the double strike character mode. Each character is
- struck twice by the print head.
-
-
-
-
- Call: prtduboff();
-
-
-
-
- Example: main()
- {
- prtduboff(); /* turn off the double struck characters */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 86
-
- __________________________________________________________________________
-
-
- prtdubon
-
-
-
- This function turns on the double strike character mode. Each character is
- struck twice by the print head.
-
-
-
-
- Call: prtdubon();
-
-
-
-
- Example: main()
- {
- prtdubon(); /* turn on the double struck characters */
- }
-
-
-
-
- Unicorn 1 Documentation 3.1 page 87
-
- __________________________________________________________________________
-
-
- prtempof
-
-
- This function turns off the emphasized print mode.
-
-
-
-
-
- Call: prtempof();
-
-
-
-
- Example: main()
- {
- prtempof(); /* turn off the emphasized print mode */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 88
-
- __________________________________________________________________________
-
-
- prtempon
-
-
- Turns on the emphasized print mode.
-
-
-
-
- Call: prtempon();
-
-
-
-
- Example: main()
- {
- prtempon(); /* Turn on the emphasized print mode */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 89
-
- __________________________________________________________________________
-
-
- prtesc
-
-
- Sends an escape character to the printer.
-
-
-
-
- Call: prtesc();
-
-
-
-
-
- Example: main()
- {
- prtesc(); /* send an escape to the printer */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 90
-
- __________________________________________________________________________
-
-
- prtff
-
-
- Sends a form feed character to the printer.
-
-
-
-
- Call: prtff();
-
-
-
-
-
- Example: main()
- {
- prtff(); /* send a form feed to the printer */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 91
-
- __________________________________________________________________________
-
-
- prtlf
-
-
- Sends a line feed character to the printer.
-
-
-
-
- Call: prtlf();
-
-
-
-
-
- Example: main()
- {
- prtlf(); /* send a line feed to the printer */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 92
-
- __________________________________________________________________________
-
-
- prttab
-
-
- Sends a tab character to the printer.
-
-
-
-
- Call: prttab();
-
-
-
-
-
- Example: main()
- {
- prttab(); /* send a tab to the printer */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 93
-
- __________________________________________________________________________
-
-
- prtwidoff
-
-
- This function turns of the wide or double width character mode.
-
-
-
- Call: prtwidoff();
-
-
-
- Example: main()
- {
- prtwidoff(); /* turn off the double width characters */
- }
-
-
-
- Unicorn 1 Documentation 3.1 page 94
-
- __________________________________________________________________________
-
-
- prtwidon
-
-
- Turns on the printer wide or double width character mode. This mode is
- automatically canceled at the next new line sent to the printer.
-
-
-
- Call: prtwidon();
-
-
-
-
- Example: main()
- {
- prtwidon(); /* turn on the wide mode */
- }
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 95
-
- __________________________________________________________________
-
- rad2deg
- F
- Converts angles expressed in radians to the equivalent angle
- expressed in degrees. Both the angle and the return are
- doubles.
-
-
-
-
-
- Call: rad2deg(angle);
-
- angle = angle expressed in radians
-
-
-
-
-
-
- Example: main()
- {
- double a, rad2deg();
-
- a = rad2deg(3.45);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 96
-
- __________________________________________________________________
-
- raschar
-
- F Prints a single large character on the graphics screen using the
- internal ROM character descriptions.
-
-
-
-
- Call: raschar(char, ulc, ulr, hmag, vmag, color);
-
- char = character to print
- ulc = upper left corner column
- ulr = upper left corner row
- hmag = horizontal magnification factor
- vmag = vertical magnification factor
- color = color of the character
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
- /* print a large 'A' in color 3 */
- raschar('A', 50, 50, 4, 4, 3);
- }
-
-
- Unicorn 1 Documentation 3.1 page 97
-
- __________________________________________________________________________
-
-
- readkey
-
-
- Returns a key for both ascii and scan codes. Scan code is in high byte of
- integer return and ascii code is in low byte. This is a destructive read.
-
-
-
-
- Call: readkey();
-
-
-
-
-
-
- Example: main()
- {
- int a;
- a = readkey(); /* get a key */
- }
-
-
- Unicorn 1 Documentation 3.1 page 98
-
- __________________________________________________________________________
-
-
- redalert
-
-
- Sounds a series of 4 rapid upward glissandos forming a red alert signal.
-
-
-
-
-
- Call: redalert();
-
-
-
-
-
- Example: main()
- {
- redalert(); /* Sound the red alert */
- }
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 99
-
- __________________________________________________________________
-
- replacech
-
- F Replaces all occurances of a character in a string with a new
- character.
-
-
-
-
-
-
- Call: replacech(str, old, new);
-
- str = string to be searched
- old = original character to be replaced
- new = the new replacement character for string
-
-
-
-
- Example: main()
- {
- char *a = "This is a test";
- /* replace all lower case t's with upper case T's */
- replacech(a, 't', 'T');
- }
-
-
- Unicorn 1 Documentation 3.1 page 100
-
- __________________________________________________________________________
-
-
- scankey
-
-
- This function returns 0 if no key is avialable. If the return is non 0
- then the key is read non-destructively and the scan code is returned in
- the high byte of an integer and the ascii code is returned in the low byte.
-
-
-
-
-
- Call: scankey();
-
-
-
-
-
- Example: main()
- {
- int a;
- a = scankey(); /* get values if a key is available */
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 101
-
- __________________________________________________________________
-
- setatten
-
- F Tandy 1000 only
-
- Sound primative function to allow setting the attenuation of any
- of the 3 sound channels.
-
-
-
-
- Call: setatten(voice, level);
-
- voice = 1, 2, or 3
- level = 1 to 15 with 15 being the maximum attenuation or
- soundoff.
-
-
-
- Example: main()
- {
- /* set the sound level in voice 1 to very loud and
- voice 2 to off */
- setatten(1, 1);
- setatten(2, 15);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 102
-
- __________________________________________________________________
-
- setcurp
-
- F Sets the cursor position to a specified row an column.
-
-
-
-
- Call: setcurp(row, column);
-
- row = row to set cursor in
- column = column to set cursor in
-
-
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
- /* move cursor to row 10, column 43 */
- setcurp(10, 43);
- }
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 103
-
- __________________________________________________________________
-
- setcurt
-
- F Sets the cursor type. (start and stop lines.)
-
-
-
-
-
-
- Call: setcurt(start, stop);
-
- start = the line in character cell where cursor starts
- stop = the line in character cell where cursor stops
-
-
-
-
- Example: main()
- {
- /* set the normal 2 line high cursor */
-
- setcurt(0,1);
- }
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 104
-
- __________________________________________________________________
-
- setfreq
-
- F Tandy 1000 only
-
- Sound function to set a value into a sound register for a specified
- voice. The value to set is calculated by the formula:
-
- value = 111843 / frequency
-
-
-
-
-
- Call: setfreq(voice, frequency);
-
- voice = voice ( 0-3)
- frequency = frequency to set into voice register
-
-
-
-
-
- Example: main()
- {
- /* set a 1000 hz tone into voice 2 */
-
- setfreq(2, 1000);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 105
-
- __________________________________________________________________
-
- setpal
-
- F Tandy 1000 only
-
- Allows the user to set any color into a plalette register.
-
-
-
-
-
-
- Call: setpal(pal_reg, color);
-
- pal_reg = the number of the palette register to change
- color = color to set into palette register
-
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
- /* set palette register 14 to color 4 (red);
- setpal(14, 4);
- /* any reference to color 14 (yellow) will now
- display color 4 (red) instead. */
- }
-
-
- Unicorn 1 Documentation 3.1 page 106
-
- __________________________________________________________________________
-
-
- siren
-
-
- This function sounds a series of up and down glissandos simulating a siren
- sound.
-
-
-
-
-
- Call: siren(number);
-
- number = the number of up/down glissandos to sound */
-
-
-
-
-
- Example: main()
- {
- siren(5); /* sound 5 up/down siren sounds */
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 107
-
- __________________________________________________________________
-
- sm
-
- F Sets the video mode. For this library to work properly all
- graphics must be done in mode 4 for the IBM-PC version and in mode
- 9 for the tandy version. The mode 4 version may be used on a
- Tandy 1000 to create fully compatible IBM-PC programs.
- In addition upon exiting a tandy version (mode 9) program the mode
- must be reset back to mode 3. Failure to do so will probably cause
- the machine to crash.
-
-
-
-
- Call: sm(mode);
-
- mode = video mode desired according to below table
-
- Mode Table
-
- 0 - 40x25 balck and white
- 1 - 40x25 color
- 2 - 80x25 black and white
- 3 - 80x25 color
- 4 - 320x200 4 color graphics
- 5 - 320x200 black and white graphics
- 6 - 640x200 black and white graphics
- 7 - EDo NOT Use!F
- 8 - 160x200 color graphics with 16 colors
- 9 - 320x200 color graphics with 16 colors
- 10 - 640x200 color graphics with 4 colors
-
-
- Example: main()
- {
- sm(9); /* set graphics mode 9 for Tandy 1000 */
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 108
-
- __________________________________________________________________
-
- soundoff
-
- F Tandy 1000 only
-
- Turns off the complex sound generator chip.
-
-
-
-
-
-
-
-
- Call: soundoff();
-
-
-
-
- Example: main()
- {
- /* Turn off the complex sound generator chip */
-
- soundoff();
- }
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 109
-
- __________________________________________________________________
-
- soundon
-
- F Tandy 1000 only
-
- Turns on the complex sound generator chip. Must be called prior to
- any call to other sound functions.
-
-
-
-
-
- Call: soundon();
-
-
-
-
- Example: main()
- {
- /* turn on the sound chip */
- soundon();
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 110
-
- __________________________________________________________________
-
- spalreg
-
- F Tandy 1000 only
-
- Changes the defined color of any palette register from 0 to 15.
-
-
-
-
-
-
-
- Call: spalreg(reg_num, color);
-
- reg_num = register to change
- color = new color fro the register
-
-
-
-
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
- /* set palette register 14 to color 4 (red);
- spalreg(14, 4);
- /* any reference to color 14 (yellow) will now
- display color 4 (red) instead. */
- }
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 111
-
- __________________________________________________________________
-
- sstring
-
- F Print a stroke character string on the graphics screen.
-
-
-
-
-
-
- Call: sstring(string, ulc, ulr, hmag, vmag, colorb, colorf);
-
- string = string to be printed
- ulc = upper left corner column
- ulr = upper left corner row
- hmag = horizontal magnification
- vmag = vertical magnification
- colorb = border outline color
- colorf = color to use in filling characters
-
-
-
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
- /* print the string "test" using stroke characters
- with a red outline and filled with yellow */
- sstring("test", 10, 20, 2, 2, 4, 14);
-
-
-
- E
- Unicorn Library Documentation 3.1 page 112
-
- __________________________________________________________________
-
- stchar
-
- F Prints a single stroke character on the graphics screen
-
-
-
-
-
- Call: stchar(char, ulc, ulr, hmag, vmag, colorb, colorf);
-
- char = character to be printed
- ulc = upper left corner column
- ulr = upper left corner row
- hmag = horizontal magnification
- vmag = vertical magnification
- colorb = border outline color
- colorf = color to use in filling characters
-
-
-
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
- /* print the character 't' using stroke characters
- with a red outline and filled with yellow */
- stchar('t', 10, 20, 2, 2, 4, 14);
-
-
-
- E
- Unicorn Library Documentation 3.1 page 113
-
- __________________________________________________________________
-
- stratt
-
- F Prints a string using an attribute byte.
-
-
-
-
- Call: stratt(attribute, string);
-
- attribute = attribute to use in printing character
- string = string to be printed
-
- attribute byte is formed according to below bit definitions
-
- foreground;
- bit 0 = blue
- bit 1 = green
- bit 2 = red
- bit 3 = intensity
- background;
- bit 4 = blue
- bit 5 = green
- bit 6 = red
- bit 7 = blink
-
-
-
- Example: main()
- {
- /* print the string "test" with a blue background
- using bright red characters. */
- stratt(28, "test");
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 114
-
- __________________________________________________________________
-
- strclr
-
- F Prints a string on the screen in one of 16 colors.
-
-
-
-
-
- Call: strclr(color, string);
-
- color = color to use in printing string
- string = string to print
-
-
-
-
- Example: main()
- {
- /* print the string "test" in red */
- strclr(4, "test");
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 115
-
- __________________________________________________________________
-
- strdel
-
- F Deletes a substring from a given string starting at the character
- numbered 'first' and continuing for 'number' of characters.
-
-
-
-
- Call: strdel(str, first, number);
-
- str = string to be operated upon
- first = character to start the delete operation
- number = number of characters to delete
-
-
-
- Example: main()
- {
- /* delete the word is */
- strdel("This is a test", 5,2);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 116
-
- __________________________________________________________________
-
- strpad
-
- F Pad a string with blanks on the left.
-
-
-
-
-
-
-
- Call: strpad(str, number);
-
- str = string to be padded
- number = number of spaces to be added to the left
-
-
-
- Example: main();
- {
- /* add 5 spaces to left of "This is a test" */
- strpad("This is a test", 5);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 117
-
- __________________________________________________________________
-
- strtolow
-
- F Converts all characters in a string to lower case.
-
-
-
-
-
-
-
- Call: strtolow(str);
-
- str = string to be changed to all lower case.
-
-
-
-
-
-
- Example: main()
- {
- char *a = "Testing";
- strtolow(a);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 118
-
- __________________________________________________________________
-
- strtoup
-
- F Converts all characters in a string to upper case.
-
-
-
-
-
-
-
- Call: strtoup(str);
-
- str = string to be changed to all upper case.
-
-
-
-
-
-
- Example: main()
- {
- char *a = "Testing";
- strtoup(a);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 119
-
- __________________________________________________________________
-
- turnleft
-
- F Turns the turtle's current heading left by a specified number of
- degrees.
-
-
-
-
-
-
- Call: turnleft(angle);
-
- angle = angle to turn through
-
-
-
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
-
- /* turn the turtle's heading left 50 degrees */
-
- turnleft(50);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 120
-
- __________________________________________________________________
-
- turnright
-
- F Turns the turtle's current heading right by a specified number of
- degrees.
-
-
-
-
-
-
- Call: turnright(angle);
-
- angle = angle to turn through
-
-
-
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
-
- /* turn the turtle's heading right 50 degrees */
-
- turnright(50);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 121
-
- __________________________________________________________________
-
- usrfont
-
- F
- Select and print characters in various fonts on the graphics screen.
-
-
-
-
-
-
-
- Call: usrfont(char, ulc, ulr, hmag, vmag, color, font);
-
- char = character to be printed
- ulc = upper left corner column
- ulr = upper left corner row
- hmag = horizontal magnification
- vmag = vertical magnification
- color = color to use in printing character
- font = an integer used to select which font.
-
- Font Table:
-
- 0 - Thin block all capital letters
- 1 - small characters for sub/superscripts. Generally
- defined in upper 4 columns and 4 rows of character cell.
- 2 - NOT YET DEFINED
- 3 - NOT YET DEFINED
- 4 - NOT YET DEFINED
-
-
- Example: main()
- {
- sm(4); /* set graphics mode */
-
- /* print an 'A' from the sub/superscript font at
- twice normal size in color 3 */
- usrfont('A', 10, 20, 2, 2, 3, 1);
- }
-
-
-
- E
- Unicorn Library Documentation 3.1 page 122
-
- __________________________________________________________________
-
- wac
-
- F Prints a character on the screen using an attribute byte.
-
-
-
-
-
- Call: wac(attribute, char);
-
- attribute = attribute to use in printing character
- char = character to be printed
-
- attribute byte is formed according to below bit definitions
-
- foreground;
- bit 0 = blue
- bit 1 = green
- bit 2 = red
- bit 3 = intensity
- background;
- bit 4 = blue
- bit 5 = green
- bit 6 = red
- bit 7 = blink
-
-
-
- Example: main()
- {
- /* print the character 't' with a blue background
- using bright red character color. */
- wac(28, 't');
- }
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 123
-
- __________________________________________________________________
-
- waitkey
-
- F Pauses the computer until a key is pressed. It does NOT return
- the key scan code or ascii value.
-
-
-
-
-
-
- Call: waitkey();
-
-
-
-
-
- Example: main()
- {
- /* wait until a key is pressed */
- waitkey();
- }
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 124
-
- __________________________________________________________________
-
- wco
-
- F Prints a character only on the screen. In the graphics modes a
- color may be specified.
-
-
-
-
- Call: wco(char, color);
-
- char = character to print
- color = color to use, ignored in text modes
-
-
-
-
- Example: main()
- {
- /* prints the character 'W' */
- wco('W', 4);
- waitkey(); /* wait until a key is pressed */
- sm(4); /* set the graphics mode */
- /* print a 'W' in red on the graphics screen */
- wco('W', 4);
- }
-
-
- Unicorn 1 Documentation 3.1 page 125
-
- __________________________________________________________________________
-
-
- wnoise
-
-
-
- Sounds a white noise signal that is between two user selected frequencies.
-
-
-
-
-
- Call: wnoise(low, high, duration);
-
- low = lowest frequency to use
- high = highest frequency to use
- duration = time factor, larger number is longer time
-
-
-
-
- Example: main()
- {
- wnoise(100, 1000, 100); /* white noise between 100 & 1000 */
- }
-
-
-
-
-
- E
- Unicorn Library Documentation 3.1 page 126
-
- __________________________________________________________________
-
- wtty
-
- F Prints a character and attribute on the screen. It advances the
- cursor and responds to control characters.
-
-
-
-
-
-
- Call: wtty(attribute, character);
-
- attribute = attribute to use in printing character
- char = character to be printed
-
- attribute byte is formed according to below bit definitions
-
- foreground;
- bit 0 = blue
- bit 1 = green
- bit 2 = red
- bit 3 = intensity
- background;
- bit 4 = blue
- bit 5 = green
- bit 6 = red
- bit 7 = blink
-
-
-
- Example: main()
- {
- /* print the character 't' with a blue background
- using bright red character color. */
- wtty(28, 't');
- }
-
-