home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-08-29 | 38.6 KB | 1,312 lines |
-
-
-
- C Tool Box
-
-
-
-
-
-
-
-
-
-
-
-
-
- A Library of Functions for
- Turbo C 1.00
-
- Containing Graphics, Fonts,
- Windows, Sound, Background Sound
- Mouse, Joystick and Printer Controls
- and more
-
-
-
-
- Version 1.00
- release date 22 August 1987
-
-
-
-
-
-
-
-
-
-
- Copyright (c) 1987
- by
- David A. Miller
- Unicorn Software
- 8018 NE 123rd St.
- Kirkland, WA 98034
- (206) 823-4656 after 6:30 PM
- Pacific Time Zone
- (No collect calls Please)
-
-
-
-
-
- Welcome to the realm of the mystical Unicorn. It has been an
- enjoyable process creating this library and the author hopes you
- find it equally enjoyable to use.
-
-
-
-
- Disclaimer
-
- The author has taken due care in the preparation of this manual
- and the associated programs to insure that all information
- presented is correct and functional as stated. No warranty is
- made regarding the suitability of this product for any specific
- purpose. Consistent with the requirement of speed in much of
- the library and the general philosophy of C in allowing the
- programmer complete freedom, the amount of error checking has
- been held to a minimum.
-
- The author hereby grants permission to all users to transfer
- copies of the library to third parties subject to the conditions
- that the entire library and all files including copyrights be
- transferred in full for no fee execept in the case of users groups
- which may charge a copying fee not to exceed $7.00.
-
- While you may use the library for personal programs without
- registration, those who create programs for sale or distribution
- are requested to register their copy. The source code may NOT be
- distributed to a third party in any form without the written
- permission of the author.
-
-
-
-
-
-
- Turbo C is a trademark of Borland International, Microsoft C,
- MASM and MSDOS are trademarks of Microsoft Corp. IBM, IBM PC,
- PC XT, AT, DOS and PCDOS are trademarks of International Business
- Machines Corp., Epson is a trademark of Epson Corp. Tandy, Tandy
- 1000 A and DMP 130 are trademarks of Tandy Corp.
-
- Background
-
-
- This library is the successor to the original Unicorn Library
- which has undergone several revisions and essentially has become
- a new entity. Some of the current revisions concern simple
- ordering of the parameters in calls to make the library more
- consistent. Users of the Unicorn library should take particular
- note of this point. Functions have been developed for which the
- author has no specific need but found interesting to implement.
- Many of the functions are a result of user suggestions for which
- we thank the users involved. The author invites users to make
- further suggestions, as a worthwile challenge is always an
- interesting learning experience.
-
- This library contains functions to perform a wide variety of
- tasks The functions may be divided roughly into the following
- categories:
-
- 1. General video including windows and fast string writes.
- 2. Graphics, including a variety of normal and rotated fonts
- 3. Sound including background sound functions similar to BASIC
- 4. General functions serving a wide variety of purposes
- 5. Printer control, both graphics and daisy wheel
- 6. Mouse control
- 7. Joystick control
-
- Each of these groupings overlaps to some extent but in general
- all, except the graphics in group 2, may be used with a
- monochrome system. The general library is designed to be used
- with Turbo C from Borland and programs written using the small
- memory model. Other compilers are supported and libraries may be
- requested from the author upon registration. In addition to this
- basic library, those available include the large model for Turbo
- C and both models for Microsoft C ( Current version ). The
- author will also make a Lattice C version 3.0 library available
- if there are enough requests. While these are the basic
- compilers the author has access to, others may be supported if
- the number of requests warrant.
-
- The entire manual is not supplied with the Bulletin Board
- version of the library due to space. Enough of the manual is
- included to make the library usable including a brief description
- of each function and a call in a form similar to function
- prototyping. The entire manual is available on disk in Wordstar
- or ASCII text format and will be sent to all registered owners
- (please specify which format). Preprinted manuals are available
- for those who don't wish to print over 200 pages. See the
- registration form for details.
- First Things First
-
-
- If you have registered your library and have the full source
- distribution disks, you should have one disk of C source code and
- headers, one of ASM source code and either a disk containing the
- manual or the preprinted manual.
-
- Check your disks to insure that all files are readable. There
- should be 14 C source files, 14 ASM source files and 3 header
- files as of this writing. This amounts to over 500K of source
- code.
-
- There is no particular installation process for this library. It
- is ready to use as is. Simply place the library in the directory
- with the other libraries you use with your compiler.
-
- Many of the critical functions have been coded in assembler for
- speed. Some of the present functions coded in C (the fonts
- remaining in C and rotated fonts in particular) will be coded in
- assembler in future revisions. There are a few instances where
- functions perform similar tasks but are coded differently. For
- example, there is both an assembler and a C function to set the
- video mode. Some of these have been left as learning tools for
- the user as they illustrate both approaches to solution of a
- particular task. Since this library was begun as a learning
- project, it is felt the user may benefit from such material.
-
- Make a backup copy before you do anything else. The disks are
- not copy-protected in any manner. Also, it would be helpful if
- you read the file READ.ME as it contains the latest information
- concerning the library. Where this manual and READ.ME conflict,
- please regard the READ.ME file as being the most current
- information.
-
- There are demo programs on the disk, the largest being CTDEMO.EXE
- and CTDEMO.C. This was compiled with the library on the
- distribution disks and illustrates the capability of the library
- itself although it by no means uses or illustrates every function
- in the library.
-
- The library, as delivered normally, is the small memory model of
- Turbo C, and all references, unless otherwise stated, will refer
- to that configuration.
-
- There are over 200 functions contained within the C Tool Box and
- there is a short reference section giving a brief sample call and
- description of each function later in the manual. The
- comprehensive section following that gives a complete call,
- parameter description, sample program or code fragment
- illustrating the fuctions usage, returns and any caveats that may
- occur with that function.
-
- All of the functions will perform correctly with IBM PC's or
- close compatibles, but be aware that for several of the critical
- timing functions direct screen writing is used to improve
- performance. Unless your machine addresses video memory in the
- same manner as the IBM, a problem may exist. The library was
- written on a Tandy 1000 A and has been run on several other
- machines with complete success.
-
- All functions beginning with dx are designed to support a daisy
- wheel printer. They were developed on a Epson printer that is
- compatible with the DW-630. All functions begining with gr are
- designed to support the IBM graphics printer or compatible.
- These were developed on a TANDY DMP 130.
-
- Those who are registered owners and have the source code will
- find that only four functions need to be altered to support other
- graphics systems. These are the two dot routines (internal and
- external) and the two functions to return the color of a pixel
- (internal and external). All other functions are based on these
- to make conversion easier. The author does not have access to a
- Hercules system for this conversion. A conversion to the EGA is
- currently underway although access to an EGA system is very
- limited for testing purposes.
-
-
-
- Update Policy
-
- It is the policy of Unicorn Software to provide one free update
- for the library itself (not the source code which may be updated
- for a small fee) and notification of one update beyond that. If
- the new library is registered for the update fee, then we will
- start the process over again and you will again receive one free
- update and one notification beyond that point. This insures
- users who register will always have access to the latest version
- of the Tool Box. Minor releases will be placed on bulletin
- boards, but registered users will not be notified directly unless
- they so request. (It is felt that most would prefer to use the
- free update for a major release). Currently the author places
- copies of the Tool Box (major and minor releases) directly on the
- following boards in the Seattle area.
-
- 1. Journey to Mars (RBBS) 206 486-3136
- 2. Night Shift (RBBS) 206 488-0924
- 3. Planet Claire (RBBS) 206 783-8037
- 4. PNW IBM user group (RBBS) 206 343-7843
-
-
-
- The author logs on with the name 'Dave Miller' on each of these
- boards.
-
- The most likely spot to find the author for feedback would be
- Journey to Mars or Nightshift.
-
-
-
- Programming Style
-
-
- The source code is written in standard K & R with one deviation.
- The author prefers the opening and closing braces to line up so
- instead of:
-
- if (i = 2) {
- printf("I = 2");
- }
-
- you will find:
-
- if (i = 2)
- {
- printf("I = 2");
- }
-
- in the source code for the Tool Box.
-
-
- Declaration of Functions
-
-
- Most functions are either void or return int. It is not strictly
- required to declare them prior to use. It is GOOD PROGRAMMING
- PRACTICE to declare all functions prior to use. This practice
- will avoid problems with the few functions which do return a
- different value, such as a pointer to a window.
-
-
-
-
-
-
- Technical
-
- This library was created using the following tools.
-
- Turbo C 1.00
- Microsoft Link 3.51
- MASM 4.0
- Microsoft Library Manager 3.02
-
-
- The modules used and the order they should appear in the library
- may be found by using LIB to create an LST file of the library.
- If you register and wish to recompile for a different memory
- model or compiler, this order should be preserved.
-
- At present, a small bug exists in the endsound function. It will
- be best if you let background sound run its course, and not
- attempt to stop it with this command. This will be fixed in the
- next major release ( Jan 1988 ). Registered owners will
- automatically receive the new source for this function with their
- free update disk.
-
- Revisions are possible in some functions in the next release.
- Every possible effort will be used to maintain FULL
- compatibility, but be aware that the calls to some window
- functions and to the background sound functions may be altered
- somewhat. When using the Tool Box please keep this in mind if
- you plan to upgrade. It is anticipated the changes will not be
- extensive and additional functions will be added wherever
- possible rather than altering the existing functions. The author
- will preserve all current function calls intact in all releases
- beyond this point.
-
- Your First Program
-
-
- Using the C Tool Box is essentially quite simple. With Turbo C
- you must specify any modules to be linked in your project file.
- If they are not C files then the complete extension must be used.
- For example suppose you wish to build a file 'mytest.exe' from
- mytest.c and the C Tool Box library. Your project file should be
- in a form similar to the below:
-
-
- mytest
- CTB100.LIB
-
-
- When you are within the Turbo C environment, simply use Alt P to
- indicate the project file name and then Alt R to build and run
- your program. You may also build your program from the command
- line by typing:
-
- TCC mytest CTB100.lib
-
-
- Either approach will build your program and link it with the C
- Tool Box library.
-
-
- The demo program was built using the command:
-
- TCC CTDEMO CTB100.LIB
-
- There is a project file on the disk if you prefer to work within
- the Turbo C environment. The demo may be built by specifying
- ctdemo as the file and ctdemo.prj as the project file. Use ALT r
- to run the program or ALT c to compile it.
-
- The Future
-
-
- The next major release is planned for Jan., 1988. Some
- of the ideas being considered and/or worked on are:
-
- 1. Animation functions
- 2. Data entry functions
- 3. Menu functions (including pulldown)
- 4. Additional window functions
- 5. Additional sound functions
- 6. Fonts - rewritting those left coded in C in assembler
- for speed and a true stroke font capability. This was
- contained in the original Lattice C version; The author
- would like to restore it with full rotation,
- translation and scaling for the next major release.
-
-
- The author wishes to continue providing this library to users in
- the form of shareware consistent with user support. It has been
- an enjoyable spare time project over the last year and a half.
- The author feels shareware is an important element in today's
- computer environment.
-
- Please feel free to express your opinion on what you wish to see
- made available. Let us know!
-
- Internal Global Variables
-
-
- The library contains a series of global variables. You
- should not use these names in your programs unless you
- specifically wish to reference that variable. For example using
- a variable named bdr1 in your program will result in a link error
- at best or failure of the windowing functions that use border 1
- at worst. Below is a list of these variables and their internal
- meanings to the library.
-
- int BLACK the color black
- int BLUE the color blue
- int GREEN the color green
- int CYAN the color cyan
- int RED the color red
- int MAGENTA the color magenta
- int BROWN the color brown
- int GRAY the color gray
- int GREY the color gray
- int WHITE the color gray
- int DARK_GRAY the color dark gray
- int DARK_GREY the color dark gray
- int LTBLUE the color light blue
- int LTGREEN the color light green
- int LTCYAN the color light cyan
- int LTRED the color light red
- int LTMAGENTA the colorlight magenta
- int LTBROWN the color yellow
- int YELLOW the color yellow
- int LTWHITE the color light or bright white
-
- int NORMAL the normal monochrome attribute
- int UNDERLINE the underline monochrome attribute
- int REVERSE the reverse video monochrome attribute
- int BRIGHT the highlighted monochrome attribute
- int BLINK monochrome blink bit indicator
-
- int v_start starting address for video memory
- int ct_mode_ current video mode
- int ct_col_ current number of video columns
- int ct_color_ indicates if color is allowed (1) or not
-
- BORDER bdr1 a single line border for windows
- BORDER bdr12 a border with a single vertical line and
- double horizontal lines.
- BORDER bdr21 a border with double vertical lines and
- a single horizontal line
- BORDER star a border of "*" characters
- BORDER dot a border of "." characters
- BORDER solid a border of solid blocks ( char 219)
- BORDER heart a border of heart characters
- BORDER space a blank border of space characters
-
- NOTE - The default border is a double
- line.
- BORDER is a pointer to a border.
- WINDOW is a pointer to a box,
- generally indicated by 'bp' in
- documentation.
-
-
- See the header CTB.H for additional variables and defines that
- may be useful.
-
-
-
- Registration Form
-
- This library is distributed as shareware which simply means
- you are free to copy, use and pass copies on to friends for
- evaluation. If you decide it is useful, you may register your
- copy with the author. Upon registration you will receive the
- complete source code for the library and a copy of the manual on
- disk. This will consist of 3 disks. In addition you will
- receive the first update disk free and notification of any
- further updates. Major release updates are occuring about 3
- times a year.
-
- The current registration fee is $29.95
-
-
- Name: ______________________________________________
-
- Computer Type: ______________________________________________
-
- Address: ______________________________________________
-
- ______________________________________________
-
- City/State/Zip: _________________________ ____ _____________
-
- Library Version: _CTB_1.00___________________________________
-
- Compiler: (check 1)
- Turbo C ___ Microsoft C ___ other __________
-
- More than one version may be requested. Please add an update fee
- of $12.95 for each additional version.
-
- Preprinted manual pages suitable for placement in a three ring
- binder will be supplied for an additional $18.00.
-
- User Statement
-
- I realize that while the library may be freely given away to
- third parties the source code is not public domain and I agree to
- protect the authors code and not to pass it on to third parties.
-
-
- Signed: ___________________________ Date: ________________
-
-
-
- Comments or additional information may be placed on the back of
- this page.
- Function Descriptions
-
- atsay (row, col, fore, back, *string);
- Print a string in color at row, column
- back is for graphics. It's a dummy paramter in text
- mode.
-
- bac16_4 (fore, back)
- Sets 40 column text mode to use highlighted background
- colors
-
- back16_8 (fore, back)
- Sets 80 column text mode to use highlighted background
- colors
-
- backclr (color)
- Set the background color
-
- backsnd ()
- Background sound function
-
- beepsp ()
- Beeps the speaker with a tone similar to the DOS beep
-
- blink16_4 (fore, back)
- Sets 40 column text mode to normal blink attribute
-
- blink16_8 (fore, back)
- Sets 80 column text mode to normal blink attribute
-
- boxfill (x1, y1, x2, y2, color)
- Draws a box and fills it with color (assembler)
-
- boxtitle (bp, position, col, title, fore, back)
- Print a window title in the border
-
- burble (1/pitch, duration)
- Plays an undescribable sound in the speaker. You have
- to try various numbers to see the variety.
-
- button ()
- Returns joy stick button press status
-
- circle (rc, cc, radius, aspect_num, aspect_den, color)
- Draws graphics cicrle with aspect ratio
-
- cls ()
- Clear the screen and return mode and number of columns
-
-
-
-
- cls_clr (fore, back)
- Clears text screen (80 col), sets attributes and places
- the cursor in the 'home' position
-
- CM_INCH (cm)
- Convert cm to inches
-
- countch (*string, char)
- Returns # of times a char occurs in a string
-
- ct_bkclr (color)
- Set background color
-
- ct_char (row, col, fore, back, char)
- Write a character directly to the video buffer
-
- ctinit ()
- Initializes video data for the windowing functions
-
- ctone (freq, duration)
- Sounds a tone of given frequency and duration
-
- ct_peek (row, col)
- Returns the WORD at row, col
-
- ct_poke (row, col, char)
- Pokes a WORD at row, col
-
- ctposit (row, col)
- Returns address of video memory byte at row, col
-
- ct_sm (mode)
- Set the video mode
-
- ct_str (row, col, fore, back, *string)
- Write a string directly to video buffer
-
- ct_vstr (row, col, fore, back, *string)
- Write a string vertically directly to video memory
-
- ct_wstr (row, col, fore, back, *string, bp)
- Write a string to video memory in a window
-
- ct_wvstr (row, col, fore, back, *string, bp)
- Write a vertical string to video memory in a window
-
- DEG_RAD (degrees)
- Convert degrees to radians
-
-
- delay (millisecs)
- Delay a number of ms, assumes 4.77 MHz clock
-
- drawbox (bp)
- Draws a predefined box on the screen
-
- dwarn2 ()
- Issue a warning & exit if not DOS 2.00 or greater
-
- dwarn3 ()
- Issue a warning & exit if not DOS 3.00 or greater
-
- dx120bs ()
- Backspace the DW printer 1/120th inch
-
- dxback ()
- Select backwards printing on the DW printer
-
- dxbi ()
- Select bidirectional printing
-
- dxboldst ()
- Begin bold print
-
- dxbs ()
- Send a backspace
-
- dxbsend ()
- End bold/shadow printing
-
- dxchwide (number)
- Set character width HMI (1/120ths inch)
-
- dxclr1tab ()
- Clear 1 tab
-
- dxclrtab ()
- Clear all tabs
-
- dxcr ()
- Send a carriage return
-
- dxdefwid ()
- Set DW printer to default HMI
-
- dxeject ()
- Eject paper
-
-
-
- dxff ()
- Send a form feed
-
- dxfor ()
- Select forward printing
-
- dxhlf ()
- Send a half line feed
-
- dxht ()
- Horizontal tab
-
- dxinit ()
- Initialize the DW printer
-
- dxlf ()
- Send a line feed
-
- dxlinsp (number)
- Set line spacing in (n-1)/48 inch
-
- dxlmarg ()
- Set left margin
-
- dxpglen (length)
- Set page length
-
- dxrhlf ()
- Send a reverse half line feed
-
- dxrlf ()
- Send a reverse line feed
-
- dxsetht ()
- Set a horizontal tab position
-
- dxshast ()
- Start shadow printing
-
- dxundend ()
- End underlined printing
-
- dxundlst ()
- Begin underlining
-
- dxuni ()
- Select unidirectional printing
-
-
-
- endsound ()
- Uninstall the sound timer interrupt and turn background
- music off
-
- equip ()
- Returns a word indicating installed equipment
-
- flagdec ()
- Decrements mouse cursor flag by one
-
- forward (pixels)
- Move the turtle forward a number of pixels
-
- GAL_LT (gallons)
- Convert gallons to liters
-
- gcomtype ()
- Returns a byte indicating the computer type in use
-
- gcurpos (row, col, page)
- Return current cursor position
-
- getatch (page)
- Returns char and attribute at current cursor position
-
- getbcnt (which_button)
- Returns the count of mouse button presses
-
- getbrcnt (which_button)
- Returns mouse button releases
-
- getbstat ()
- Returns current mouse button status
-
- getchne ()
- Return keyboard character with no echo
-
- getctype (start, end, page)
- Return the current cursor start & end lines and page
-
- getcurp (&row, &col)
- Return cursor position
-
- getcurps (page, &row, &col)
- Returns cursor position on a specified page
-
- getdmaj ()
- Return the DOS major version number
-
-
- getdmin ()
- Return the DOS minor version number
-
- getdver ()
- Return the DOS version number
-
- gethpos ()
- Returns the current mouse horizontal position
-
- getkey ()
- Destructive read of keyboard buffer
-
- getkeycd ()
- Return keycode - waits for key stroke
-
- getmode ()
- Returns the current video mode
-
- getpage ()
- Returns the current video page
-
- getscode ()
- Returns scan code for key stroke, waits for key
-
- getstate ()
- Get video state, mode, width, page into register struct
-
- get_str ()
- Get user string and replace CR with \0
-
- getvpos ()
- Returns the mouse current vertical position
-
- gliss (start_freq, end_freq, rate)
- sounds a glissando through the speaker
-
- GM_OZ (grams)
- Convert grams to ounces
-
- gothic (char, row, col, color)
- Writes a gothic character to the graphics screen
-
- hollow (char, row, col, color)
- Writes an outline character to the graphics screen
-
- INCH_CM (inches)
- Convert inches to cm
-
-
-
- indexch (*string, char)
- Return the first position of a character in a string
-
- indexr (*string, char)
- Return the rightmost position of char in string
-
- iskey ()
- Returns non-0 if key in buffer / 0 if no key
-
- kbstat ()
- Returns the keyboard status byte
-
- keystat ()
- DOS interrupt to return keyboard status byte
-
- KG_LB (kilograms)
- Convert kilograms to pounds
-
- KM_MI (kilometers)
- Convert kilometers to miles
-
- LB_KG (pounds)
- Convert pounds to kilograms
-
- lhjoystk ()
- Return the current horizontal pos, of left joystick
-
- lightpen (&row, &col, &rasline, &ras_col)
- Read the lightpen position
-
- line (x1, y1, x2, y2, color)
- Draw a graphics line
-
- lprintf (*string)
- Print a string to the line printer
-
- lputch (char)
- Send a character to the printer
-
- lrotate (yc, xc, ys, xs, ye, xe, 3, angle)
- Draw a rotated line around a center point
-
- lsthpos (which_button)
- Return last mouse horiz. position when button pressed
-
- lsthrpos (which_button)
- Last mouse horiz. position when button released
-
-
-
- lstvpos (which_button)
- Last mouse vertical pos. when button pressed
-
- lstrvpos (which_button)
- Last mouse vertical pos. when button release
-
- LT_GAL (liters)
- Conver liters to gallons
-
- lvjoystk ()
- Return the current vertical pos. of left joystick
-
- M_YD (meters)
- Convert meters to yards
-
- makebdr (bp, type)
- Sets a border type for a window/box
-
- makebox (row, col, height, width, bfore, bback, ffore, fback)
- Defines a new box/window and returns a pointer to it
-
- memsize ()
- Return memory size using int86 call
-
- mgun ()
- Makes a machine gun tye sound through the speaker
-
- MI_KM (miles)
- Convert miles to kilometers
-
- moveto (row, col)
- Move the turtle to an absolute position
-
- mreset ()
- Checks to see if mouse is installed
-
- msize ()
- Returns the number of K Bytes of memory installed
-
- note (voice, octave, note, volume)
- Set a musical note for TANDY 1000 voice
-
- OZ_GM (ounces)
- Convert ounces to grams
-
- paint (row, col, color, border_color)
- fill a bounded region with color
-
-
-
- palette (a, b, c)
- Change color set for graphics modes
- a = palette (0-3)
- b = 4 for normal colors / 5 for alternate color set
- c = background color
-
- pcurpos (row, col, page)
- Places cursor to location
-
- pencolor (color)
- Defines turtle pen color
-
- pendown ()
- Places trutle pen on screen to draw
-
- penup ()
- Lifts turtle pen off screen
-
- play (note, octave, time)
- plays a foreground tone in the speaker
-
- point (row, col, color)
- Lights a single graphics pixel
-
- prtbs ()
- Send backspace to the graphics printer
-
- prtbuzz ()
- Sound the printer bell
-
- prtcan ()
- Cancel and clear the printer buffer
-
- prtcomof ()
- Turn off compressed print
-
- prtcomon ()
- Turn on compressed print mode
-
- prtcr ()
- Send a carriage return to the graphics printer
-
- prtdubof ()
- Turn off double print mode
-
- prtdubon ()
- Turn on double print mode
-
-
-
- prtempof ()
- Turn off emphasized print mode
-
- prtempon ()
- Turn on emphasized print mode
-
- prtsec ()
- Send an ESC code to the printer
-
- prtff ()
- Send a form feed to the graphics printer
-
- prtlf ()
- Send a line feed
-
- prttab ()
- Send atab to the graphics printer
-
- prtwidof ()
- Turn off the double width character mode
-
- prtwidon ()
- Turn on the double width character mode
-
- RAD_DEG (radians)
- Convert radians to degrees
-
- raschar (char, ULR, ULC, hmag, vmag, color)
- Uses the internal character font descriptions to
- display characters at larger sizes
-
- rdhcount ()
- Reads current mouse horizontal motion counter
-
- rdvcount ()
- Reads current mouse vertical motion counter
-
- readkey ()
- Destructive return of ASCII and scan codes for key
-
- rect (ULR, ULC, LRR, LRC, color)
- Draw a filled rectangle
-
- rect1 (ULR, ULC, LRR, LRC, bdr_clr, rect_clr)
- Draw a flled rectangle bounded by a single pixel border
-
- rect2 (ULR, ULC, LRR, LRC, bdr_clr, rect_clr)
- Draw a flled rectangle bounded by a double pixel border
-
-
- redalert ()
- Plays a red alert sound through the speaker
-
- replacech (*string, old_char, new_char)
- Replaces ALL occurences of char in string
-
- resbox (bp)
- Removes a window/box from the screen and restores video
-
- rhjoystk ()
- Return right joystick horizontal position
-
- rotate (yc, xc, x, y, angle)
- rotate a point around a given center point
-
- rvjoystk ()
- Return right joystick vertical position
-
- savebox (bp)
- Saves the memory where a window/box will be drawn
-
- scankey ()
- Returns scan and ASCII codes (non-destructive)
-
- script (char, row, col, color)
- Draw a simulated handwritten character on the graphics
- screen
-
- scrolldn (up_l_row, up_l_col, low_r_row, low_r_col, fore, back,
- num_rows)
- Scroll a bios window down
-
- scrollup (up_l_row, up_l_col, low_r_row, low_r_col, fore, back,
- num_rows)
- Scroll a bios window up
-
- setatten (voice, level)
- Sets attenuation level on Tandy 1000 sound chip
-
- setcallm (mask, address)
- Define a mouse subroutine mask
-
- setcur (h_hot, v_hot, cursor)
- Define and pass a mouse graphics cursor
-
- setcurp (row, col)
- Sets the cursor to location
-
-
- setcurps (page, row, col)
- Sets position of cursor on the page
-
- setcurt (start, end)
- Sets the cursor type parameters
-
- setcurtp (start, end)
- Sets start and end lines for cursor
-
- setfreq (voice, freq)
- Set Tandy voice frequency
-
- sethor (min, max)
- Sets mouse min and max positions
-
- setpage (page)
- Set the current visual page number
-
- set_pal (color_set)
- Selects either color set 0 or 1 for graphics
-
- setpal (0/1)
- Selects a palette for graphics modes
-
- setpos (hor, ver)
- Set mouse cursor postion
-
- setsound ()
- enables the background sound interrupt and uses notes
- in array melody and timing in array beat to produce
- background sound
-
- settxtc (type,screen_mask/first_line, cur_mask/lst_line)
- Select and define mouse text cursor
-
- setver (min, max)
- Set max and min vertical mouse positions
-
- sm (mode)
- Set the video mode
-
- smode (mode)
- set video moe using int86
-
- soundoff ()
- Turn off Tandy sound chip
-
- soundon ()
- Turn on the Tandy sound chip
-
- spalreg (reg#, color)
- Set the palette register values (Tandy & EGA only)
-
- spratio (hor, ver)
- Set mouse movement ratios
-
- str_cent (*string, *destination, width)
- Center a string within width
-
- strclr (fore, back, *string)
- C function to write a string in color
-
- strdel (*string, start, number)
- Delete a substring from a string
-
- strpad (*string, number)
- Add spaces to the left of a string
-
- strtolow (*string)
- Convert a string to all lower case
-
- strtoup (*string)
- Convert a string to all upper case
-
- tcos (angle)
- return 2 digit value of cosine for whole degrees -
- operates faster for graphics plotting
-
- tone (freq, time_in_ms)
- play a tone - time assumes 4.77 MHz clock
-
- tsin (angle)
- return 2 digit value of sin for whole degrees -
- operates faster for graphics than does the sin function
-
- turnleft (angle)
- Turns the turtle heading left
-
- turnright (angle)
- Turns the turtle heading right
-
- usrfont (char, ULR, ULC, hmag, vmag, color, font#)
- Allows user to select from predetermined fonts the
- style of character to display
-
- vbar3d (base, height, col, width, depth, color, outline_color)
- 3d bar graph plot function
-
-
-
- wac (char, color/attribute, xor_flag)
- Write a character and attribute/color using BIOS call
-
- waitkey ()
- Pauses and waits for key stroke if none in buffer
-
- watch (page, num_chars, char, fore, back)
- Writes character(s) in color using BIOS call
-
- wch (page, num_chars, char, color)
- Writes char(s) to page (text mode) in color (graphics
- mode)
-
- wchtty (char, fore)
- Writes character using tty BIOS mode, color if graphics
- mode in use
-
- wco (char, color)
- Write character only (color is active in graphics,
- dummy parameter in text modes)
-
- wgets (bp, row, col, len)
- Return a string that exists inside a window
-
- w_hline (row, col,fore, back, char, width)
- Draw a horizontal line of character
-
- wnoise (low_freq, high_freq, duration)
- Produces white noise over a specified freq range
-
- wputs (bp, str, row, col)
- Puts s string to a window using BIOS
-
- wtty (char, color)
- Write character in TTY mode, color is only active in
- graphics modes, in text modes it is a dummy parameter
-
- w_hline (row, col, fore, back, ch, width)
- Draw a horizontal line of character
-
- w_vline (row, col, fore, back, char, height)
- Draws a vertical string of character
-
- YD_M (yards)
- Convert yards to meters
-
-
-
-
-
-
-
- Appendix A
-
-
-
-
-
- This section of the manual is a detailed description of the
- functions. It includes a description of the function, a sample
- call from C, a sample program or program fragment using the
- function and any returns from the function. Included also are
- any limits, peculiarities or other information about the
- functions required for effective use in programming.
-
- atsay
-
-
-
- This function is similar to the dBASE function of the same name
- in that it allows the user to print, in color, a string at a
- specified location on the screen.
-
-
- Call:
- atsay(row, col, fore, back, *string)
-
- row = the starting row for the string
- col = the starting column for the string
- fore = the foreground color of the string
- back = the background color of the string
- string = the string to be printed on the screen
-
- Example:
- main()
- {
- /* sm(4); */
- atsay(5, 10, 3, 2, "Testing");
- }
-
- This program will print the string "Testing" on the
- screen in color 3, starting at row 5 column 10. If in
- graphics mode (remove the comments) the background
- color will be color 2, for text mode this parameter is
- a dummy parameter.
-
-
- Return:
- None
-
-
- Caveats:
- Background color is only active in graphics modes. For
- text modes it is a dummy parameter. For writting with
- a background color in text modes use the watch
- function.
- Be sure the string parameters lie within the screen
- boundries.
-
-
-
-
-
-
-
- This ends the Board version of the manual.
-
-
-
-
-
- The full manual will be sent with all library source code to all
- registered owners of the C Tool box Library. There simply is not
- enough room in a bulletin board sized file.
-
- This section of the manual is an early version. The final manual
- will contain complete descriptions of all aspects of the tool
- Box. It is available in two disk formats. One suitable for
- printing from DOS and one in WordStar format. It is also
- available in the form of preprinted pages suitable for a three
- ring binder.
-
-
- The following is included since the full manual is not with this
- file.
-
-
- BACKGROUND SOUND FUNCTIONS INFORMATION
-
- The numbers for the musical notes are listed below for the octave
- starting with middle C:
-
- C C# D D# E F F# G G# A A# B
- 24 25 26 27 28 29 30 31 32 33 34 35
-
- The note 100 may be used for rests.
-
- Timing for the notes is in timer ticks (18.2 per second).
-
- See the full manual for further details.
-
- Place the notes in an array called melody[] and the timing count
- in an array called beat[], see ctdemo.c for an example. Other
- songs may be defined with notes and timing in different arrays
- but these will have to be copied into the melody and beat arrays
- before activation the background sound function. A future
- release will pass a pointer to the desired array.
- eat arrays
- before activation the background sound function. A future
- release will pass a pointer to the desire