Dec 052017
C toolbox v1.00. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
BDRDEF.H | 1492 | 377 | deflated |
BORDER.H | 1371 | 281 | deflated |
COLORS.H | 798 | 297 | deflated |
CTB.H | 2176 | 758 | deflated |
CTB100.LIB | 62464 | 21691 | deflated |
CTB100.LST | 14583 | 2899 | deflated |
CTDEMO.C | 31355 | 8150 | deflated |
CTDEMO.EXE | 87264 | 34212 | deflated |
CTDEMO.PRJ | 21 | 21 | stored |
DECK.C | 1040 | 212 | deflated |
LABLE.C | 1444 | 473 | deflated |
LABLE.EXE | 2514 | 1442 | deflated |
LABLE.PRJ | 22 | 22 | stored |
MANUAL.ASC | 39552 | 12189 | deflated |
MANUAL.DOC | 40192 | 13396 | deflated |
READ.ME | 1854 | 867 | deflated |
README.1ST | 2469 | 1161 | deflated |
REGISTER.FRM | 2188 | 901 | deflated |
SONGS.C | 2187 | 728 | deflated |
SONGS.EXE | 13842 | 6624 | deflated |
SONGS.PRJ | 49 | 49 | stored |
SPF.C | 1138 | 270 | deflated |
WINDOWS.H | 1649 | 388 | deflated |
WWXMAS.C | 992 | 254 | deflated |
Download File CTB100T.ZIP Here
Contents of the READ.ME file
C Tool Box
This disk contains a variety of files including the C Tool Box Library. It
is the successor to the previous Unicorn Library containing many new
functions. Future enhancements are presently planned and some are in the
implementation stage.
There is a partial manual on the disk in the file MANUAL.DOC. The entire
manual is too large to fit in a convienent file size for general distribution.
The entire manual will be sent, on disk, to all registered owners. All
registered owners will also receive the complete source code to the
Tool Box. This consists of two disks containing over 500K of commented
source code. The manual is availabel in either Wordstar or ASCII format.
To see a part of what the library can do run the file CTBDEMO.EXE. The
source for this is in the file CTBDEMO.C and may be useful in understanding
some of the library functions although the partial manual covers all the
libraries functions in a brief format.
The partial manual on this disk is in wordstar format. If you do not have
wordstar it may be run through any of the public domain filters and printed
using the DOS print command. This section of the manual is a very trimmed
version of the full manual to make the ARC file size reasonable. The full
manual contains complete listings for all functions similar to the 'atsay'
listing included with this file. The front section is also greatly expanded
over this trimmed version. Much of this information was removed as it
refers directly to the full distribution disks. IN NO WAY HAS THE LIBRARY
ITSELF BEEN REDUCED OR TRIMMED IN ANY WAY. THIS DISK CONTAINS THE FULL
DISTRIBUTION VERSION OF THE LIBRARY.
David A. Miller
8 September 1987
This disk contains a variety of files including the C Tool Box Library. It
is the successor to the previous Unicorn Library containing many new
functions. Future enhancements are presently planned and some are in the
implementation stage.
There is a partial manual on the disk in the file MANUAL.DOC. The entire
manual is too large to fit in a convienent file size for general distribution.
The entire manual will be sent, on disk, to all registered owners. All
registered owners will also receive the complete source code to the
Tool Box. This consists of two disks containing over 500K of commented
source code. The manual is availabel in either Wordstar or ASCII format.
To see a part of what the library can do run the file CTBDEMO.EXE. The
source for this is in the file CTBDEMO.C and may be useful in understanding
some of the library functions although the partial manual covers all the
libraries functions in a brief format.
The partial manual on this disk is in wordstar format. If you do not have
wordstar it may be run through any of the public domain filters and printed
using the DOS print command. This section of the manual is a very trimmed
version of the full manual to make the ARC file size reasonable. The full
manual contains complete listings for all functions similar to the 'atsay'
listing included with this file. The front section is also greatly expanded
over this trimmed version. Much of this information was removed as it
refers directly to the full distribution disks. IN NO WAY HAS THE LIBRARY
ITSELF BEEN REDUCED OR TRIMMED IN ANY WAY. THIS DISK CONTAINS THE FULL
DISTRIBUTION VERSION OF THE LIBRARY.
David A. Miller
8 September 1987
Contents of the MANUAL.DOC file
C Tool Box
This disk contains a variety of files including the C Tool Box Library. It
is the successor to the previous Unicorn Library containing many new
functions. Future enhancements are presently planned and some are in the
implementation stage.
There is a partial manual on the disk in the file MANUAL.DOC. The entire
manual is too large to fit in a convienent file size for general distribution.
The entire manual will be sent, on disk, to all registered owners. All
registered owners will also receive the complete source code to the
Tool Box. This consists of two disks containing over 500K of commented
source code. The manual is availabel in either Wordstar or ASCII format.
To see a part of what the library can do run the file CTBDEMO.EXE. The
source for this is in the file CTBDEMO.C and may be useful in understanding
some of the library functions although the partial manual covers all the
libraries functions in a brief format.
The partial manual on this disk is in wordstar format. If you do not have
wordstar it may be run through any of the public domain filters and printed
using the DOS print command. This section of the manual is a very trimmed
version of the full manual to make the ARC file size reasonable. The full
manual contains complete listings for all functions similar to the 'atsay'
listing included with this file. The front section is also greatly expanded
over this trimmed version. Much of this information was removed as it
refers directly to the full distribution disks. IN NO WAY HAS THE LIBRARY
ITSELF BEEN REDUCED OR TRIMMED IN ANY WAY. THIS DISK CONTAINS THE FULL
DISTRIBUTION VERSION OF THE LIBRARY.
David A. Miller
8 September 1987
.mt 8
.he
.op
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)
Welcom t th real o th mystica Unicorn I ha bee a
enjoyabl proces creatin thi librar an th autho hope yo
find it equally enjoyable to use.
Disclaimer
Th autho ha take du car i th preparatio o thi manua
an th associate program t insur tha al informatio
presente i correc an functiona a stated N warrant i
mad regardin th suitabilit o thi produc fo an specifi
purpose. Consisten wit th requiremen o spee i muc o
th librar an th genera philosoph o i allowin th
programme complet freedom th amoun o erro checkin ha
bee hel t minimum.
Th autho hereb grant permissio t al user t transfe
copie o th librar t thir partie subjec t th condition
tha th entir librar an al file includin copyright b
transferre i ful fo n fe execep i th cas o user group
whic ma charg copyin fe no t excee $7.00.
Whil yo ma us th librar fo persona program withou
registration thos wh creat program fo sal o distributio
ar requeste t registe thei copy Th sourc cod ma NO b
distribute t thir part i an for withou th writte
permissio o th author.
Turb i trademar o Borlan International Microsof C
MAS an MSDO ar trademark o Microsof Corp IBM IB PC
P XT AT DO an PCDO ar trademark o Internationa Busines
Machine Corp. Epso i trademar o Epso Corp Tandy Tand
1000 A and DMP 130 are trademarks of Tandy Corp.
.pa
.he C_Tool_Box_______________________________________________Page_#
Background
Thi librar i th successo t th origina Unicor Librar
whic ha undergon severa revision an essentiall ha becom
ne entity Som o th curren revision concer simpl
orderin o th parameter i call t mak th librar mor
consistent User o th Unicor librar shoul tak particula
not o thi point Function hav bee develope fo whic th
autho ha n specifi nee bu foun interestin t implement
Man o th function ar resul o use suggestion fo whic
w than th user involved Th autho invite user t mak
furthe suggestions a worthwil challeng i alway a
interestin learnin experience.
Thi librar contain function t perfor wid variet o
task Th function ma b divide roughl int th followin
categories:
1 Genera vide includin window an fas strin writes.
2 Graphics includin variet o norma an rotate fonts
3 Soun includin backgroun soun function simila t BASIC
4 Genera function servin wid variet o purposes
5 Printe control bot graphic an dais wheel
6 Mous control
7 Joystic control
Eac o thes grouping overlap t som exten bu i genera
all excep th graphic i grou 2 ma b use wit
monochrom system Th genera librar i designe t b use
wit Turb fro Borlan an program writte usin th smal
memor model Othe compiler ar supporte an librarie ma b
requeste fro th autho upo registration I additio t thi
basi library thos availabl includ th larg mode fo Turb
an bot model fo Microsof Curren versio ) Th
autho wil als mak Lattic versio 3. librar availabl
i ther ar enoug requests Whil thes ar th basi
compiler th autho ha acces to other ma b supporte i
th numbe o request warrant.
Th entir manua i no supplie wit th Bulleti Boar
versio o th librar du t space Enoug o th manua i
include t mak th librar usabl includin brie descriptio
o eac functio an cal i for simila t functio
prototyping Th entir manua i availabl o dis i Wordsta
o ASCI tex forma an wil b sen t al registere owner
(pleas specif whic format) Preprinte manual ar availabl
fo thos wh don' wis t prin ove 20 pages Se th
registratio for fo details
.pa
First Things First
I yo hav registere you librar an hav th ful sourc
distributio disks yo shoul hav on dis o sourc cod an
headers on o AS sourc cod an eithe dis containin th
manua o th preprinte manua.
Chec you disk t insur tha al file ar readable Ther
shoul b 1 sourc files 1 AS sourc file an heade
file a o thi writing Thi amount t ove 500 o sourc
code
Ther i n particula installatio proces fo thi library I
i read t us a is Simpl plac th librar i th director
with the other libraries you use with your compiler.
Man o th critica function hav bee code i assemble fo
speed Som o th presen function code i (th font
remainin i an rotate font i particular wil b code i
assemble i futur revisions Ther ar fe instance wher
function perfor simila task bu ar code differently Fo
example ther i bot a assemble an functio t se th
vide mode Som o thes hav bee lef a learnin tool fo
th use a the illustrat bot approache t solutio o
particula task Sinc thi librar wa begu a learnin
project i i fel th use ma benefi fro suc material
Mak backu cop befor yo d anythin else Th disk ar
no copy-protected i an manner Also i woul b helpfu i
yo rea th fil READ.M a i contain th lates informatio
concernin th library Wher thi manua an READ.M conflict
pleas regar th READ.M fil a bein th mos curren
information
Ther ar dem program o th disk th larges bein CTDEMO.EX
an CTDEMO.C Thi wa compile wit th librar o th
distributio disk an illustrate th capabilit o th librar
itsel althoug i b n mean use o illustrate ever functio
i th library.
Th library a delivere normally i th smal memor mode o
Turb C an al references unles otherwis stated wil refe
t tha configuration.
Ther ar ove 20 functions containe withi th Too Bo an
ther i shor referenc sectio givin brie sampl cal an
descriptio o eac functio late i th manual Th
comprehensiv sectio followin tha give complet call
paramete description sampl progra o cod fragmen illustratin th fuction usage return an an caveat tha ma
occu wit tha function.
Al o th function wil perfor correctl wit IB PC' o
clos compatibles bu b awar tha fo severa o th critica
timin function direc scree writin i use t improv
performance Unles you machin addresse vide memor i th
sam manne a th IBM proble ma exist Th librar wa
writte o Tand 100 an ha bee ru o severa othe
machine wit complet success.
Al function beginnin wit d ar designe t suppor dais
whee printer The wer develope o Epso printe tha i
compatibl wit th DW-630 Al function beginin wit g ar
designe t suppor th IB graphic printe o compatible
Thes wer develope o TAND DM 130
Thos wh ar registere owner an hav th sourc cod wil
fin tha onl fou function nee t b altere t suppor othe
graphic systems Thes ar th tw do routine (interna an
external an th tw function t retur th colo o pixe
(interna an external) Al othe function ar base o thes
t mak conversio easier Th autho doe no hav acces t
Hercule syste fo thi conversion conversio t th EG i
currentl underwa althoug acces t a EG syste i ver
limite fo testin purposes.
Update Policy
I i th polic o Unicor Softwar t provid on fre updat
fo th librar itsel (no th sourc cod whic ma b update
fo smal fee an notificatio o on updat beyon that I
th ne librar i registere fo th updat fee the w wil
star th proces ove agai an yo wil agai receiv on fre
updat an on notificatio beyon tha point Thi insure
user wh registe wil alway hav acces t th lates versio
o th Too Box Mino release wil b place o bulleti
board, bu registere user wil no b notifie directl unles
the s request (I i fel tha mos woul prefe t us th
fre updat fo majo release) Currentl th autho place
copie o th Too Bo (majo an mino releases directl o th
followin board i th Seattl 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
Th autho log o wit th nam 'Dav Miller o eac o thes
boards.
Th mos likel spo t fin th autho fo feedbac woul b
Journey to Mars or Nightshift.
Programming Style
Th sourc cod i writte i standar wit on deviation
Th autho prefer th openin an closin brace t lin u s
instea 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
Mos function ar eithe voi o retur int I i no strictl
require t declar the prio t use I i GOO PROGRAMMIN
PRACTICE t declar al function prio t use Thi practic
wil avoi problem wit th fe function whic d retur
differen value suc a pointe t window
.pa
Technical
Thi librar wa create usin th followin tools.
Turb 1.00
Microsof Lin 3.51
MAS 4.0
Microsof Librar Manage 3.02
Th module use an th orde the shoul appea i th librar
ma b foun b usin LI t creat a LS fil o th library
I yo registe an wis t recompil fo differen memor
mode o compile, thi orde shoul b preserved.
A presen, smal bu exist i th endsoun function I wil
b bes i yo le backgroun soun ru it course an no
attemp t sto i wit thi command Thi wil b fixe i th
nex majo releas Ja 198 ) Registere owner wil
automaticall receiv th ne sourc fo thi functio wit thei
fre updat disk.
Revision ar possibl i som function i th nex release
Ever possibl effor wil b use t maintai FUL
compatibility bu b awar tha th call t som windo
function an t th backgroun soun function ma b altere
somewhat Whe usin th Too Bo pleas kee thi i min i
yo pla t upgrade I i anticipate th change wil no b
extensiv an additiona function wil b adde whereve
possibl rathe tha alterin th existin functions Th autho
wil preserv al curren functio call intac i al release
beyon thi point.
.pa
Your First Program
Usin th Too Box i essentiall quit simple Wit Turb
yo mus specif an module t b linke i you projec file
I the ar no file the th complet extensio mus b used
Fo exampl suppos yo wis t buil fil 'mytest.exe fro
mytest. an th Too Box library You projec fil shoul b
i for simila t th below:
mytest
CTB100.LIB
Whe yo ar withi th Turb environmen, simply us Al t
indicat th projec fil nam an the Al t buil an ru
you program Yo ma als buil you progra fro th comman
lin b typing:
TC mytes CTB100.lib
Eithe approac wil buil you progra an lin i wit th
Too Box librar.
Th dem progra wa buil usin th command:
TC CTDEM CTB100.LIB
Ther i projec fil o th dis i yo prefe t wor withi
th Turb environment Th dem ma b buil b specifyin
ctdem a th fil an ctdemo.pr a th projec file Us AL
t ru th progra o AL t compil it.
.pa
The Future
Th nex majo releas i planne fo Ja., 1988 Som
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 Additiona soun functions
6 Font - rewrittin thos lef code i i assemble
fo spee an tru strok fon capability Thi wa
containe i th origina Lattic version Th autho
woul lik t restor i wit ful rotation
translatio an scalin fo th nex majo release.
Th autho wishe t continu providin thi librar t user i
th for o sharewar consisten wit use support I ha bee
a enjoyabl spar tim projec ove th las yea an half
Th autho feel sharewar i a importan elemen i today'
compute environment.
Pleas fee fre t expres you opinio o wha yo wis t se
mad available Le u know!
.pa
Interna Globa Variables
The librar contains a serie o globa variables Yo
shoul no us thes name i you program unles yo
specificall wis t referenc tha variable Fo exampl usin
variabl name bdr i you progra wil resul i lin erro
a bes o failur o th windowin function tha us borde
a worst Belo i lis o thes variable an thei interna
meaning t th 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
in ct_color indicate i colo i allowe (1 o no
BORDER bdr1 a single line border for windows
BORDE bdr1 borde wit singl vertica lin an
double horizontal lines.
BORDE bdr2 borde wit doubl vertica line an
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.
BORDE i pointe t borde.
WINDOW is a pointer to a box,
generall indicate b 'bp i
documentation.
Se th heade CTB. fo additiona variable an define tha
ma b useful.
.pa
Registration Form
Thi librar i distribute a sharewar whic simpl mean
yo ar fre t copy us an pas copie o t friend fo
evaluation I yo decid i i useful yo ma registe you
cop wit th author Upo registratio yo wil receiv th
complet sourc cod fo th librar an cop o th manua o
disk Thi wil consis o disks I additio yo wil
receiv th firs updat dis free an notificatio o an
furthe updates Majo releas update ar occurin abou
time year.
Th curren registratio fe i $29.95
Name: ______________________________________________
Computer Type: ______________________________________________
Address: ______________________________________________
______________________________________________
City/State/Zip: _________________________ ____ _____________
Library Version: _CTB_1.00___________________________________
Compiler: (check 1)
Turbo C ___ Microsoft C ___ other __________
Mor tha on versio ma b requested Pleas ad a updat fee
o $12.95 fo eac additiona version.
Preprinte manua page suitabl fo placemen i thre rin
binde wil b supplie fo a additiona $18.00.
User Statement
realiz tha whil th librar ma b freel give awa t
thir partie th sourc cod i no publi domai an agre t
protect the authors code and not to pass it on to third parties.
Signed: ___________________________ Date: ________________
Comment o additiona informatio ma b place o th bac o
this page.
.pa
Functio Descriptions
atsay (row, col, fore, back, *string);
Print a string in color at row, column
bac i fo graphics. It' dumm paramte i tex
mode.
bac16_4 (fore, back)
Set4 colum tex mod t us highlighte backgroun
colors
back16_8 (fore, back)
Set 8 colum tex mod t us highlighte backgroun
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)
Play a undescribabl soun i th speaker Yo hav
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)
Clear tex scree (8 col) set attribute an place
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 ()
Uninstal th soun time interrup an tur backgroun
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
rascha (char ULR ULC hmag vmag color)
Use th interna characte fon description t
display characters at larger sizes
rdhcount ()
Reads current mouse horizontal motion counter
rdvcount ()
Reads current mouse vertical motion counter
readkey ()
Destructiv retur o ASCI an sca code fo ke
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)
Dra flle rectangl bounde b double pixe 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)
Dra simulate handwritte characte o th graphic
screen
scrolld (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 ()
enable th backgroun soun interrup an use note
i arra melod an timin i arra bea t produc
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)
retur digi valu o cosin fo whol degree -
operates faster for graphics plotting
tone (freq, time_in_ms)
play a tone - time assumes 4.77 MHz clock
tsin (angle)
retur digi valu o si fo whol degree -
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#)
Allow use t selec fro predetermine font th
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)
Write char(s t pag (tex mode i colo (graphic
mode)
wchtty (char, fore)
Write characte usin tt BIO mode colo i graphic
mode in use
wco (char, color)
Writ characte onl (colo i activ i 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)
Writ characte i TT mode colo i onl activ i
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
.pa
Appendix A
Thi sectio o th manua i detaile descriptio o th
functions I include descriptio o th function sampl
cal fro C sampl progra o progra fragmen usin th
functio an an return fro th function Include als ar
an limits peculiaritie o othe informatio abou th
function require fo effectiv us i programming.
.pa
.he _C_Tool_Box___________________________________________Appendix_A_
atsay
Thi functio i simila t th dBAS functio o th sam nam
i tha i allow th use t print i color strin 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");
}
Thi progra wil prin th strin "Testing o th
scree i colo 3 startin a ro colum 10 I i
graphic mod (remov th comments th backgroun
colo wil b colo 2 fo tex mod thi paramete i
a dummy parameter.
Return:
None
Caveats:
Backgroun colo i onl activ i graphic modes Fo
tex mode i i dumm parameter Fo writtin wit
backgroun colo i tex mode us th watc
function.
B sur th strin parameter li withi th scree
boundries.
.pa
This ends the Board version of the manual.
Th ful manua wil b sen wit al librar sourc cod t al
registere owner o th Too bo Library Ther simpl i no
enough room in a bulletin board sized file.
Thi sectio o th manua i a earl version Th fina manua
wil contai complet description o al aspect o th too
Box I i availabl i tw dis formats On suitabl fo
printin fro DO an on i WordSta format I i als
availabl i th for o preprinte page suitabl fo thre
ring binder.
Th followin i include sinc th ful manua i no wit thi
file.
BACKGROUND SOUND FUNCTIONS INFORMATION
Th number fo th musica note ar liste belo fo th octav
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.
Plac th note i a arra calle melody[ an th timin coun
i a arra calle beat[] se ctdemo. fo a example Othe
song ma b define wit note an timin i differen array
bu thes wil hav t b copie int th melod an bea array
befor activatio th backgroun soun function futur
release will pass a pointer to the desired array.
This disk contains a variety of files including the C Tool Box Library. It
is the successor to the previous Unicorn Library containing many new
functions. Future enhancements are presently planned and some are in the
implementation stage.
There is a partial manual on the disk in the file MANUAL.DOC. The entire
manual is too large to fit in a convienent file size for general distribution.
The entire manual will be sent, on disk, to all registered owners. All
registered owners will also receive the complete source code to the
Tool Box. This consists of two disks containing over 500K of commented
source code. The manual is availabel in either Wordstar or ASCII format.
To see a part of what the library can do run the file CTBDEMO.EXE. The
source for this is in the file CTBDEMO.C and may be useful in understanding
some of the library functions although the partial manual covers all the
libraries functions in a brief format.
The partial manual on this disk is in wordstar format. If you do not have
wordstar it may be run through any of the public domain filters and printed
using the DOS print command. This section of the manual is a very trimmed
version of the full manual to make the ARC file size reasonable. The full
manual contains complete listings for all functions similar to the 'atsay'
listing included with this file. The front section is also greatly expanded
over this trimmed version. Much of this information was removed as it
refers directly to the full distribution disks. IN NO WAY HAS THE LIBRARY
ITSELF BEEN REDUCED OR TRIMMED IN ANY WAY. THIS DISK CONTAINS THE FULL
DISTRIBUTION VERSION OF THE LIBRARY.
David A. Miller
8 September 1987
.mt 8
.he
.op
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)
Welcom t th real o th mystica Unicorn I ha bee a
enjoyabl proces creatin thi librar an th autho hope yo
find it equally enjoyable to use.
Disclaimer
Th autho ha take du car i th preparatio o thi manua
an th associate program t insur tha al informatio
presente i correc an functiona a stated N warrant i
mad regardin th suitabilit o thi produc fo an specifi
purpose. Consisten wit th requiremen o spee i muc o
th librar an th genera philosoph o i allowin th
programme complet freedom th amoun o erro checkin ha
bee hel t minimum.
Th autho hereb grant permissio t al user t transfe
copie o th librar t thir partie subjec t th condition
tha th entir librar an al file includin copyright b
transferre i ful fo n fe execep i th cas o user group
whic ma charg copyin fe no t excee $7.00.
Whil yo ma us th librar fo persona program withou
registration thos wh creat program fo sal o distributio
ar requeste t registe thei copy Th sourc cod ma NO b
distribute t thir part i an for withou th writte
permissio o th author.
Turb i trademar o Borlan International Microsof C
MAS an MSDO ar trademark o Microsof Corp IBM IB PC
P XT AT DO an PCDO ar trademark o Internationa Busines
Machine Corp. Epso i trademar o Epso Corp Tandy Tand
1000 A and DMP 130 are trademarks of Tandy Corp.
.pa
.he C_Tool_Box_______________________________________________Page_#
Background
Thi librar i th successo t th origina Unicor Librar
whic ha undergon severa revision an essentiall ha becom
ne entity Som o th curren revision concer simpl
orderin o th parameter i call t mak th librar mor
consistent User o th Unicor librar shoul tak particula
not o thi point Function hav bee develope fo whic th
autho ha n specifi nee bu foun interestin t implement
Man o th function ar resul o use suggestion fo whic
w than th user involved Th autho invite user t mak
furthe suggestions a worthwil challeng i alway a
interestin learnin experience.
Thi librar contain function t perfor wid variet o
task Th function ma b divide roughl int th followin
categories:
1 Genera vide includin window an fas strin writes.
2 Graphics includin variet o norma an rotate fonts
3 Soun includin backgroun soun function simila t BASIC
4 Genera function servin wid variet o purposes
5 Printe control bot graphic an dais wheel
6 Mous control
7 Joystic control
Eac o thes grouping overlap t som exten bu i genera
all excep th graphic i grou 2 ma b use wit
monochrom system Th genera librar i designe t b use
wit Turb fro Borlan an program writte usin th smal
memor model Othe compiler ar supporte an librarie ma b
requeste fro th autho upo registration I additio t thi
basi library thos availabl includ th larg mode fo Turb
an bot model fo Microsof Curren versio ) Th
autho wil als mak Lattic versio 3. librar availabl
i ther ar enoug requests Whil thes ar th basi
compiler th autho ha acces to other ma b supporte i
th numbe o request warrant.
Th entir manua i no supplie wit th Bulleti Boar
versio o th librar du t space Enoug o th manua i
include t mak th librar usabl includin brie descriptio
o eac functio an cal i for simila t functio
prototyping Th entir manua i availabl o dis i Wordsta
o ASCI tex forma an wil b sen t al registere owner
(pleas specif whic format) Preprinte manual ar availabl
fo thos wh don' wis t prin ove 20 pages Se th
registratio for fo details
.pa
First Things First
I yo hav registere you librar an hav th ful sourc
distributio disks yo shoul hav on dis o sourc cod an
headers on o AS sourc cod an eithe dis containin th
manua o th preprinte manua.
Chec you disk t insur tha al file ar readable Ther
shoul b 1 sourc files 1 AS sourc file an heade
file a o thi writing Thi amount t ove 500 o sourc
code
Ther i n particula installatio proces fo thi library I
i read t us a is Simpl plac th librar i th director
with the other libraries you use with your compiler.
Man o th critica function hav bee code i assemble fo
speed Som o th presen function code i (th font
remainin i an rotate font i particular wil b code i
assemble i futur revisions Ther ar fe instance wher
function perfor simila task bu ar code differently Fo
example ther i bot a assemble an functio t se th
vide mode Som o thes hav bee lef a learnin tool fo
th use a the illustrat bot approache t solutio o
particula task Sinc thi librar wa begu a learnin
project i i fel th use ma benefi fro suc material
Mak backu cop befor yo d anythin else Th disk ar
no copy-protected i an manner Also i woul b helpfu i
yo rea th fil READ.M a i contain th lates informatio
concernin th library Wher thi manua an READ.M conflict
pleas regar th READ.M fil a bein th mos curren
information
Ther ar dem program o th disk th larges bein CTDEMO.EX
an CTDEMO.C Thi wa compile wit th librar o th
distributio disk an illustrate th capabilit o th librar
itsel althoug i b n mean use o illustrate ever functio
i th library.
Th library a delivere normally i th smal memor mode o
Turb C an al references unles otherwis stated wil refe
t tha configuration.
Ther ar ove 20 functions containe withi th Too Bo an
ther i shor referenc sectio givin brie sampl cal an
descriptio o eac functio late i th manual Th
comprehensiv sectio followin tha give complet call
paramete description sampl progra o cod fragmen illustratin th fuction usage return an an caveat tha ma
occu wit tha function.
Al o th function wil perfor correctl wit IB PC' o
clos compatibles bu b awar tha fo severa o th critica
timin function direc scree writin i use t improv
performance Unles you machin addresse vide memor i th
sam manne a th IBM proble ma exist Th librar wa
writte o Tand 100 an ha bee ru o severa othe
machine wit complet success.
Al function beginnin wit d ar designe t suppor dais
whee printer The wer develope o Epso printe tha i
compatibl wit th DW-630 Al function beginin wit g ar
designe t suppor th IB graphic printe o compatible
Thes wer develope o TAND DM 130
Thos wh ar registere owner an hav th sourc cod wil
fin tha onl fou function nee t b altere t suppor othe
graphic systems Thes ar th tw do routine (interna an
external an th tw function t retur th colo o pixe
(interna an external) Al othe function ar base o thes
t mak conversio easier Th autho doe no hav acces t
Hercule syste fo thi conversion conversio t th EG i
currentl underwa althoug acces t a EG syste i ver
limite fo testin purposes.
Update Policy
I i th polic o Unicor Softwar t provid on fre updat
fo th librar itsel (no th sourc cod whic ma b update
fo smal fee an notificatio o on updat beyon that I
th ne librar i registere fo th updat fee the w wil
star th proces ove agai an yo wil agai receiv on fre
updat an on notificatio beyon tha point Thi insure
user wh registe wil alway hav acces t th lates versio
o th Too Box Mino release wil b place o bulleti
board, bu registere user wil no b notifie directl unles
the s request (I i fel tha mos woul prefe t us th
fre updat fo majo release) Currentl th autho place
copie o th Too Bo (majo an mino releases directl o th
followin board i th Seattl 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
Th autho log o wit th nam 'Dav Miller o eac o thes
boards.
Th mos likel spo t fin th autho fo feedbac woul b
Journey to Mars or Nightshift.
Programming Style
Th sourc cod i writte i standar wit on deviation
Th autho prefer th openin an closin brace t lin u s
instea 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
Mos function ar eithe voi o retur int I i no strictl
require t declar the prio t use I i GOO PROGRAMMIN
PRACTICE t declar al function prio t use Thi practic
wil avoi problem wit th fe function whic d retur
differen value suc a pointe t window
.pa
Technical
Thi librar wa create usin th followin tools.
Turb 1.00
Microsof Lin 3.51
MAS 4.0
Microsof Librar Manage 3.02
Th module use an th orde the shoul appea i th librar
ma b foun b usin LI t creat a LS fil o th library
I yo registe an wis t recompil fo differen memor
mode o compile, thi orde shoul b preserved.
A presen, smal bu exist i th endsoun function I wil
b bes i yo le backgroun soun ru it course an no
attemp t sto i wit thi command Thi wil b fixe i th
nex majo releas Ja 198 ) Registere owner wil
automaticall receiv th ne sourc fo thi functio wit thei
fre updat disk.
Revision ar possibl i som function i th nex release
Ever possibl effor wil b use t maintai FUL
compatibility bu b awar tha th call t som windo
function an t th backgroun soun function ma b altere
somewhat Whe usin th Too Bo pleas kee thi i min i
yo pla t upgrade I i anticipate th change wil no b
extensiv an additiona function wil b adde whereve
possibl rathe tha alterin th existin functions Th autho
wil preserv al curren functio call intac i al release
beyon thi point.
.pa
Your First Program
Usin th Too Box i essentiall quit simple Wit Turb
yo mus specif an module t b linke i you projec file
I the ar no file the th complet extensio mus b used
Fo exampl suppos yo wis t buil fil 'mytest.exe fro
mytest. an th Too Box library You projec fil shoul b
i for simila t th below:
mytest
CTB100.LIB
Whe yo ar withi th Turb environmen, simply us Al t
indicat th projec fil nam an the Al t buil an ru
you program Yo ma als buil you progra fro th comman
lin b typing:
TC mytes CTB100.lib
Eithe approac wil buil you progra an lin i wit th
Too Box librar.
Th dem progra wa buil usin th command:
TC CTDEM CTB100.LIB
Ther i projec fil o th dis i yo prefe t wor withi
th Turb environment Th dem ma b buil b specifyin
ctdem a th fil an ctdemo.pr a th projec file Us AL
t ru th progra o AL t compil it.
.pa
The Future
Th nex majo releas i planne fo Ja., 1988 Som
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 Additiona soun functions
6 Font - rewrittin thos lef code i i assemble
fo spee an tru strok fon capability Thi wa
containe i th origina Lattic version Th autho
woul lik t restor i wit ful rotation
translatio an scalin fo th nex majo release.
Th autho wishe t continu providin thi librar t user i
th for o sharewar consisten wit use support I ha bee
a enjoyabl spar tim projec ove th las yea an half
Th autho feel sharewar i a importan elemen i today'
compute environment.
Pleas fee fre t expres you opinio o wha yo wis t se
mad available Le u know!
.pa
Interna Globa Variables
The librar contains a serie o globa variables Yo
shoul no us thes name i you program unles yo
specificall wis t referenc tha variable Fo exampl usin
variabl name bdr i you progra wil resul i lin erro
a bes o failur o th windowin function tha us borde
a worst Belo i lis o thes variable an thei interna
meaning t th 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
in ct_color indicate i colo i allowe (1 o no
BORDER bdr1 a single line border for windows
BORDE bdr1 borde wit singl vertica lin an
double horizontal lines.
BORDE bdr2 borde wit doubl vertica line an
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.
BORDE i pointe t borde.
WINDOW is a pointer to a box,
generall indicate b 'bp i
documentation.
Se th heade CTB. fo additiona variable an define tha
ma b useful.
.pa
Registration Form
Thi librar i distribute a sharewar whic simpl mean
yo ar fre t copy us an pas copie o t friend fo
evaluation I yo decid i i useful yo ma registe you
cop wit th author Upo registratio yo wil receiv th
complet sourc cod fo th librar an cop o th manua o
disk Thi wil consis o disks I additio yo wil
receiv th firs updat dis free an notificatio o an
furthe updates Majo releas update ar occurin abou
time year.
Th curren registratio fe i $29.95
Name: ______________________________________________
Computer Type: ______________________________________________
Address: ______________________________________________
______________________________________________
City/State/Zip: _________________________ ____ _____________
Library Version: _CTB_1.00___________________________________
Compiler: (check 1)
Turbo C ___ Microsoft C ___ other __________
Mor tha on versio ma b requested Pleas ad a updat fee
o $12.95 fo eac additiona version.
Preprinte manua page suitabl fo placemen i thre rin
binde wil b supplie fo a additiona $18.00.
User Statement
realiz tha whil th librar ma b freel give awa t
thir partie th sourc cod i no publi domai an agre t
protect the authors code and not to pass it on to third parties.
Signed: ___________________________ Date: ________________
Comment o additiona informatio ma b place o th bac o
this page.
.pa
Functio Descriptions
atsay (row, col, fore, back, *string);
Print a string in color at row, column
bac i fo graphics. It' dumm paramte i tex
mode.
bac16_4 (fore, back)
Set4 colum tex mod t us highlighte backgroun
colors
back16_8 (fore, back)
Set 8 colum tex mod t us highlighte backgroun
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)
Play a undescribabl soun i th speaker Yo hav
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)
Clear tex scree (8 col) set attribute an place
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 ()
Uninstal th soun time interrup an tur backgroun
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
rascha (char ULR ULC hmag vmag color)
Use th interna characte fon description t
display characters at larger sizes
rdhcount ()
Reads current mouse horizontal motion counter
rdvcount ()
Reads current mouse vertical motion counter
readkey ()
Destructiv retur o ASCI an sca code fo ke
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)
Dra flle rectangl bounde b double pixe 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)
Dra simulate handwritte characte o th graphic
screen
scrolld (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 ()
enable th backgroun soun interrup an use note
i arra melod an timin i arra bea t produc
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)
retur digi valu o cosin fo whol degree -
operates faster for graphics plotting
tone (freq, time_in_ms)
play a tone - time assumes 4.77 MHz clock
tsin (angle)
retur digi valu o si fo whol degree -
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#)
Allow use t selec fro predetermine font th
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)
Write char(s t pag (tex mode i colo (graphic
mode)
wchtty (char, fore)
Write characte usin tt BIO mode colo i graphic
mode in use
wco (char, color)
Writ characte onl (colo i activ i 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)
Writ characte i TT mode colo i onl activ i
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
.pa
Appendix A
Thi sectio o th manua i detaile descriptio o th
functions I include descriptio o th function sampl
cal fro C sampl progra o progra fragmen usin th
functio an an return fro th function Include als ar
an limits peculiaritie o othe informatio abou th
function require fo effectiv us i programming.
.pa
.he _C_Tool_Box___________________________________________Appendix_A_
atsay
Thi functio i simila t th dBAS functio o th sam nam
i tha i allow th use t print i color strin 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");
}
Thi progra wil prin th strin "Testing o th
scree i colo 3 startin a ro colum 10 I i
graphic mod (remov th comments th backgroun
colo wil b colo 2 fo tex mod thi paramete i
a dummy parameter.
Return:
None
Caveats:
Backgroun colo i onl activ i graphic modes Fo
tex mode i i dumm parameter Fo writtin wit
backgroun colo i tex mode us th watc
function.
B sur th strin parameter li withi th scree
boundries.
.pa
This ends the Board version of the manual.
Th ful manua wil b sen wit al librar sourc cod t al
registere owner o th Too bo Library Ther simpl i no
enough room in a bulletin board sized file.
Thi sectio o th manua i a earl version Th fina manua
wil contai complet description o al aspect o th too
Box I i availabl i tw dis formats On suitabl fo
printin fro DO an on i WordSta format I i als
availabl i th for o preprinte page suitabl fo thre
ring binder.
Th followin i include sinc th ful manua i no wit thi
file.
BACKGROUND SOUND FUNCTIONS INFORMATION
Th number fo th musica note ar liste belo fo th octav
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.
Plac th note i a arra calle melody[ an th timin coun
i a arra calle beat[] se ctdemo. fo a example Othe
song ma b define wit note an timin i differen array
bu thes wil hav t b copie int th melod an bea array
befor activatio th backgroun soun function futur
release will pass a pointer to the desired array.
Contents of the README.1ST file
C Tool Box
This disk contains a variety of files including the C Tool Box Library. It
is the successor to the previous Unicorn Library containing many new
functions. Future enhancements are presently planned and some are in the
implementation stage.
There is a partial manual on the disk in the file MANUAL.DOC. The entire
manual is too large to fit in a convienent file size for general distribution.
The entire manual will be sent, on disk, to all registered owners. All
registered owners will also receive the complete source code to the
Tool Box. This consists of two disks containing over 500K of commented
source code. The manual is availabel in either Wordstar or ASCII format.
To see a part of what the library can do run the file CTBDEMO.EXE. The
source for this is in the file CTBDEMO.C and may be useful in understanding
some of the library functions although the partial manual covers all the
libraries functions in a brief format.
The partial manual on this disk is in wordstar format. If you do not have
wordstar it may be run through any of the public domain filters and printed
using the DOS print command. This section of the manual is a very trimmed
version of the full manual to make the ARC file size reasonable. The full
manual contains complete listings for all functions similar to the 'atsay'
listing included with this file. The front section is also greatly expanded
over this trimmed version. Much of this information was removed as it
refers directly to the full distribution disks. IN NO WAY HAS THE LIBRARY
ITSELF BEEN REDUCED OR TRIMMED IN ANY WAY. THIS DISK CONTAINS THE FULL
DISTRIBUTION VERSION OF THE LIBRARY.
David A. Miller
8 September 1987
.mt 8
.he
.op
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)
Welcom t th real o th mystica Unicorn I ha bee a
enjoyabl proces creatin thi librar an th autho hope yo
find it equally enjoyable to use.
Disclaimer
Th autho ha take du car i th preparatio o thi manua
an th associate program t insur tha al informatio
presente i correc an functiona a stated N warrant i
mad regardin th suitabilit o thi produc fo an specifi
purpose. Consisten wit th requiremen o spee i muc o
th librar an th genera philosoph o i allowin th
programme complet freedom th amoun o erro checkin ha
bee hel t minimum.
Th autho hereb grant permissio t al user t transfe
copie o th librar t thir partie subjec t th condition
tha th entir librar an al file includin copyright b
transferre i ful fo n fe execep i th cas o user group
whic ma charg copyin fe no t excee $7.00.
Whil yo ma us th librar fo persona program withou
registration thos wh creat program fo sal o distributio
ar requeste t registe thei copy Th sourc cod ma NO b
distribute t thir part i an for withou th writte
permissio o th author.
Turb i trademar o Borlan International Microsof C
MAS an MSDO ar trademark o Microsof Corp IBM IB PC
P XT AT DO an PCDO ar trademark o Internationa Busines
Machine Corp. Epso i trademar o Epso Corp Tandy Tand
1000 A and DMP 130 are trademarks of Tandy Corp.
.pa
.he C_Tool_Box_______________________________________________Page_#
Background
Thi librar i th successo t th origina Unicor Librar
whic ha undergon severa revision an essentiall ha becom
ne entity Som o th curren revision concer simpl
orderin o th parameter i call t mak th librar mor
consistent User o th Unicor librar shoul tak particula
not o thi point Function hav bee develope fo whic th
autho ha n specifi nee bu foun interestin t implement
Man o th function ar resul o use suggestion fo whic
w than th user involved Th autho invite user t mak
furthe suggestions a worthwil challeng i alway a
interestin learnin experience.
Thi librar contain function t perfor wid variet o
task Th function ma b divide roughl int th followin
categories:
1 Genera vide includin window an fas strin writes.
2 Graphics includin variet o norma an rotate fonts
3 Soun includin backgroun soun function simila t BASIC
4 Genera function servin wid variet o purposes
5 Printe control bot graphic an dais wheel
6 Mous control
7 Joystic control
Eac o thes grouping overlap t som exten bu i genera
all excep th graphic i grou 2 ma b use wit
monochrom system Th genera librar i designe t b use
wit Turb fro Borlan an program writte usin th smal
memor model Othe compiler ar supporte an librarie ma b
requeste fro th autho upo registration I additio t thi
basi library thos availabl includ th larg mode fo Turb
an bot model fo Microsof Curren versio ) Th
autho wil als mak Lattic versio 3. librar availabl
i ther ar enoug requests Whil thes ar th basi
compiler th autho ha acces to other ma b supporte i
th numbe o request warrant.
Th entir manua i no supplie wit th Bulleti Boar
versio o th librar du t space Enoug o th manua i
include t mak th librar usabl includin brie descriptio
o eac functio an cal i for simila t functio
prototyping Th entir manua i availabl o dis i Wordsta
o ASCI tex forma an wil b sen t al registere owner
(pleas specif whic format) Preprinte manual ar availabl
fo thos wh don' wis t prin ove 20 pages Se th
registratio for fo details
.pa
First Things First
I yo hav registere you librar an hav th ful sourc
distributio disks yo shoul hav on dis o sourc cod an
headers on o AS sourc cod an eithe dis containin th
manua o th preprinte manua.
Chec you disk t insur tha al file ar readable Ther
shoul b 1 sourc files 1 AS sourc file an heade
file a o thi writing Thi amount t ove 500 o sourc
code
Ther i n particula installatio proces fo thi library I
i read t us a is Simpl plac th librar i th director
with the other libraries you use with your compiler.
Man o th critica function hav bee code i assemble fo
speed Som o th presen function code i (th font
remainin i an rotate font i particular wil b code i
assemble i futur revisions Ther ar fe instance wher
function perfor simila task bu ar code differently Fo
example ther i bot a assemble an functio t se th
vide mode Som o thes hav bee lef a learnin tool fo
th use a the illustrat bot approache t solutio o
particula task Sinc thi librar wa begu a learnin
project i i fel th use ma benefi fro suc material
Mak backu cop befor yo d anythin else Th disk ar
no copy-protected i an manner Also i woul b helpfu i
yo rea th fil READ.M a i contain th lates informatio
concernin th library Wher thi manua an READ.M conflict
pleas regar th READ.M fil a bein th mos curren
information
Ther ar dem program o th disk th larges bein CTDEMO.EX
an CTDEMO.C Thi wa compile wit th librar o th
distributio disk an illustrate th capabilit o th librar
itsel althoug i b n mean use o illustrate ever functio
i th library.
Th library a delivere normally i th smal memor mode o
Turb C an al references unles otherwis stated wil refe
t tha configuration.
Ther ar ove 20 functions containe withi th Too Bo an
ther i shor referenc sectio givin brie sampl cal an
descriptio o eac functio late i th manual Th
comprehensiv sectio followin tha give complet call
paramete description sampl progra o cod fragmen illustratin th fuction usage return an an caveat tha ma
occu wit tha function.
Al o th function wil perfor correctl wit IB PC' o
clos compatibles bu b awar tha fo severa o th critica
timin function direc scree writin i use t improv
performance Unles you machin addresse vide memor i th
sam manne a th IBM proble ma exist Th librar wa
writte o Tand 100 an ha bee ru o severa othe
machine wit complet success.
Al function beginnin wit d ar designe t suppor dais
whee printer The wer develope o Epso printe tha i
compatibl wit th DW-630 Al function beginin wit g ar
designe t suppor th IB graphic printe o compatible
Thes wer develope o TAND DM 130
Thos wh ar registere owner an hav th sourc cod wil
fin tha onl fou function nee t b altere t suppor othe
graphic systems Thes ar th tw do routine (interna an
external an th tw function t retur th colo o pixe
(interna an external) Al othe function ar base o thes
t mak conversio easier Th autho doe no hav acces t
Hercule syste fo thi conversion conversio t th EG i
currentl underwa althoug acces t a EG syste i ver
limite fo testin purposes.
Update Policy
I i th polic o Unicor Softwar t provid on fre updat
fo th librar itsel (no th sourc cod whic ma b update
fo smal fee an notificatio o on updat beyon that I
th ne librar i registere fo th updat fee the w wil
star th proces ove agai an yo wil agai receiv on fre
updat an on notificatio beyon tha point Thi insure
user wh registe wil alway hav acces t th lates versio
o th Too Box Mino release wil b place o bulleti
board, bu registere user wil no b notifie directl unles
the s request (I i fel tha mos woul prefe t us th
fre updat fo majo release) Currentl th autho place
copie o th Too Bo (majo an mino releases directl o th
followin board i th Seattl 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
Th autho log o wit th nam 'Dav Miller o eac o thes
boards.
Th mos likel spo t fin th autho fo feedbac woul b
Journey to Mars or Nightshift.
Programming Style
Th sourc cod i writte i standar wit on deviation
Th autho prefer th openin an closin brace t lin u s
instea 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
Mos function ar eithe voi o retur int I i no strictl
require t declar the prio t use I i GOO PROGRAMMIN
PRACTICE t declar al function prio t use Thi practic
wil avoi problem wit th fe function whic d retur
differen value suc a pointe t window
.pa
Technical
Thi librar wa create usin th followin tools.
Turb 1.00
Microsof Lin 3.51
MAS 4.0
Microsof Librar Manage 3.02
Th module use an th orde the shoul appea i th librar
ma b foun b usin LI t creat a LS fil o th library
I yo registe an wis t recompil fo differen memor
mode o compile, thi orde shoul b preserved.
A presen, smal bu exist i th endsoun function I wil
b bes i yo le backgroun soun ru it course an no
attemp t sto i wit thi command Thi wil b fixe i th
nex majo releas Ja 198 ) Registere owner wil
automaticall receiv th ne sourc fo thi functio wit thei
fre updat disk.
Revision ar possibl i som function i th nex release
Ever possibl effor wil b use t maintai FUL
compatibility bu b awar tha th call t som windo
function an t th backgroun soun function ma b altere
somewhat Whe usin th Too Bo pleas kee thi i min i
yo pla t upgrade I i anticipate th change wil no b
extensiv an additiona function wil b adde whereve
possibl rathe tha alterin th existin functions Th autho
wil preserv al curren functio call intac i al release
beyon thi point.
.pa
Your First Program
Usin th Too Box i essentiall quit simple Wit Turb
yo mus specif an module t b linke i you projec file
I the ar no file the th complet extensio mus b used
Fo exampl suppos yo wis t buil fil 'mytest.exe fro
mytest. an th Too Box library You projec fil shoul b
i for simila t th below:
mytest
CTB100.LIB
Whe yo ar withi th Turb environmen, simply us Al t
indicat th projec fil nam an the Al t buil an ru
you program Yo ma als buil you progra fro th comman
lin b typing:
TC mytes CTB100.lib
Eithe approac wil buil you progra an lin i wit th
Too Box librar.
Th dem progra wa buil usin th command:
TC CTDEM CTB100.LIB
Ther i projec fil o th dis i yo prefe t wor withi
th Turb environment Th dem ma b buil b specifyin
ctdem a th fil an ctdemo.pr a th projec file Us AL
t ru th progra o AL t compil it.
.pa
The Future
Th nex majo releas i planne fo Ja., 1988 Som
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 Additiona soun functions
6 Font - rewrittin thos lef code i i assemble
fo spee an tru strok fon capability Thi wa
containe i th origina Lattic version Th autho
woul lik t restor i wit ful rotation
translatio an scalin fo th nex majo release.
Th autho wishe t continu providin thi librar t user i
th for o sharewar consisten wit use support I ha bee
a enjoyabl spar tim projec ove th las yea an half
Th autho feel sharewar i a importan elemen i today'
compute environment.
Pleas fee fre t expres you opinio o wha yo wis t se
mad available Le u know!
.pa
Interna Globa Variables
The librar contains a serie o globa variables Yo
shoul no us thes name i you program unles yo
specificall wis t referenc tha variable Fo exampl usin
variabl name bdr i you progra wil resul i lin erro
a bes o failur o th windowin function tha us borde
a worst Belo i lis o thes variable an thei interna
meaning t th 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
in ct_color indicate i colo i allowe (1 o no
BORDER bdr1 a single line border for windows
BORDE bdr1 borde wit singl vertica lin an
double horizontal lines.
BORDE bdr2 borde wit doubl vertica line an
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.
BORDE i pointe t borde.
WINDOW is a pointer to a box,
generall indicate b 'bp i
documentation.
Se th heade CTB. fo additiona variable an define tha
ma b useful.
.pa
Registration Form
Thi librar i distribute a sharewar whic simpl mean
yo ar fre t copy us an pas copie o t friend fo
evaluation I yo decid i i useful yo ma registe you
cop wit th author Upo registratio yo wil receiv th
complet sourc cod fo th librar an cop o th manua o
disk Thi wil consis o disks I additio yo wil
receiv th firs updat dis free an notificatio o an
furthe updates Majo releas update ar occurin abou
time year.
Th curren registratio fe i $29.95
Name: ______________________________________________
Computer Type: ______________________________________________
Address: ______________________________________________
______________________________________________
City/State/Zip: _________________________ ____ _____________
Library Version: _CTB_1.00___________________________________
Compiler: (check 1)
Turbo C ___ Microsoft C ___ other __________
Mor tha on versio ma b requested Pleas ad a updat fee
o $12.95 fo eac additiona version.
Preprinte manua page suitabl fo placemen i thre rin
binde wil b supplie fo a additiona $18.00.
User Statement
realiz tha whil th librar ma b freel give awa t
thir partie th sourc cod i no publi domai an agre t
protect the authors code and not to pass it on to third parties.
Signed: ___________________________ Date: ________________
Comment o additiona informatio ma b place o th bac o
this page.
.pa
Functio Descriptions
atsay (row, col, fore, back, *string);
Print a string in color at row, column
bac i fo graphics. It' dumm paramte i tex
mode.
bac16_4 (fore, back)
Set4 colum tex mod t us highlighte backgroun
colors
back16_8 (fore, back)
Set 8 colum tex mod t us highlighte backgroun
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)
Play a undescribabl soun i th speaker Yo hav
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)
Clear tex scree (8 col) set attribute an place
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 ()
Uninstal th soun time interrup an tur backgroun
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
rascha (char ULR ULC hmag vmag color)
Use th interna characte fon description t
display characters at larger sizes
rdhcount ()
Reads current mouse horizontal motion counter
rdvcount ()
Reads current mouse vertical motion counter
readkey ()
Destructiv retur o ASCI an sca code fo ke
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)
Dra flle rectangl bounde b double pixe 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)
Dra simulate handwritte characte o th graphic
screen
scrolld (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 ()
enable th backgroun soun interrup an use note
i arra melod an timin i arra bea t produc
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)
retur digi valu o cosin fo whol degree -
operates faster for graphics plotting
tone (freq, time_in_ms)
play a tone - time assumes 4.77 MHz clock
tsin (angle)
retur digi valu o si fo whol degree -
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#)
Allow use t selec fro predetermine font th
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)
Write char(s t pag (tex mode i colo (graphic
mode)
wchtty (char, fore)
Write characte usin tt BIO mode colo i graphic
mode in use
wco (char, color)
Writ characte onl (colo i activ i 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)
Writ characte i TT mode colo i onl activ i
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
.pa
Appendix A
Thi sectio o th manua i detaile descriptio o th
functions I include descriptio o th function sampl
cal fro C sampl progra o progra fragmen usin th
functio an an return fro th function Include als ar
an limits peculiaritie o othe informatio abou th
function require fo effectiv us i programming.
.pa
.he _C_Tool_Box___________________________________________Appendix_A_
atsay
Thi functio i simila t th dBAS functio o th sam nam
i tha i allow th use t print i color strin 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");
}
Thi progra wil prin th strin "Testing o th
scree i colo 3 startin a ro colum 10 I i
graphic mod (remov th comments th backgroun
colo wil b colo 2 fo tex mod thi paramete i
a dummy parameter.
Return:
None
Caveats:
Backgroun colo i onl activ i graphic modes Fo
tex mode i i dumm parameter Fo writtin wit
backgroun colo i tex mode us th watc
function.
B sur th strin parameter li withi th scree
boundries.
.pa
This ends the Board version of the manual.
Th ful manua wil b sen wit al librar sourc cod t al
registere owner o th Too bo Library Ther simpl i no
enough room in a bulletin board sized file.
Thi sectio o th manua i a earl version Th fina manua
wil contai complet description o al aspect o th too
Box I i availabl i tw dis formats On suitabl fo
printin fro DO an on i WordSta format I i als
availabl i th for o preprinte page suitabl fo thre
ring binder.
Th followin i include sinc th ful manua i no wit thi
file.
BACKGROUND SOUND FUNCTIONS INFORMATION
Th number fo th musica note ar liste belo fo th octav
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.
Plac th note i a arra calle melody[ an th timin coun
i a arra calle beat[] se ctdemo. fo a example Othe
song ma b define wit note an timin i differen array
bu thes wil hav t b copie int th melod an bea array
befor activatio th backgroun soun function futur
release will pass a pointer to the desired array.
Dave Miller
8018 NE 123rd St
Kirkland, WA
90034
Please look at the read.me file and the manual.doc file for information
relating directly to this library and its use.
The original release date was set for 1 Oct 87 for this library but it is
being released early while still in the Beta test stage in order to
prepare for the imminent release of Microsoft C version 5.0 and Quick C.
This means that some of the planned functions ( such as menus and data
entry) have been postponed until a later release ( probably about Jan 88 )
There also remains a slight bug in the background sound routines that will
be corrected in the next release. This release is version 1.00. The next
release will be 1.xx and will be found on boards under the name CTB1xx.ARC
just as this is labled CTB100.ARC. A full update to version 2.00 is
planned for sometime in 1988 and will contain a wide variety of new
functions. Further updates of version 1 are planned in the meantime.
Future releases will identify the target compiler in the last letter. The
next minor release of this version will actually be called CTB1xxT.ARC where
the 'T' is for Turbo C. There will also be an 'M' for Microsoft C and
possibly an 'L' for Lattice if enough users request it. While we feel these
versions will be the most requested we are willing to port the library to
other compilers is the demand is high enough.
We will always support the latest release of the target compiler in the case
of Turbo and Microsoft C. The latest release of this library should follow
within a week the release of a new compiler release.
There are two versions of the manual on this disk. Manual.doc is in
Wordstar format and manual.asc is in ASCII format. The manual.asc file was
created by running the Wordstar version through a conversion program and
consequently has lost all the page formatting etc. No attempt has been made
to restore this in the board version of this manual.
Pass copies of this library to your friends. We hope you enjoy using this
library, it has been an interesting project to date for the author.
The author places updates drectly on the following boards in the Seattle
area:
Journey to Mars (RBBS) 206 486-3136 log name Dave Miller
PNW IBM User Group (RBBS) 206 343-7843 log name David Miller
Dave Miller
29 Aug 1987
This disk contains a variety of files including the C Tool Box Library. It
is the successor to the previous Unicorn Library containing many new
functions. Future enhancements are presently planned and some are in the
implementation stage.
There is a partial manual on the disk in the file MANUAL.DOC. The entire
manual is too large to fit in a convienent file size for general distribution.
The entire manual will be sent, on disk, to all registered owners. All
registered owners will also receive the complete source code to the
Tool Box. This consists of two disks containing over 500K of commented
source code. The manual is availabel in either Wordstar or ASCII format.
To see a part of what the library can do run the file CTBDEMO.EXE. The
source for this is in the file CTBDEMO.C and may be useful in understanding
some of the library functions although the partial manual covers all the
libraries functions in a brief format.
The partial manual on this disk is in wordstar format. If you do not have
wordstar it may be run through any of the public domain filters and printed
using the DOS print command. This section of the manual is a very trimmed
version of the full manual to make the ARC file size reasonable. The full
manual contains complete listings for all functions similar to the 'atsay'
listing included with this file. The front section is also greatly expanded
over this trimmed version. Much of this information was removed as it
refers directly to the full distribution disks. IN NO WAY HAS THE LIBRARY
ITSELF BEEN REDUCED OR TRIMMED IN ANY WAY. THIS DISK CONTAINS THE FULL
DISTRIBUTION VERSION OF THE LIBRARY.
David A. Miller
8 September 1987
.mt 8
.he
.op
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)
Welcom t th real o th mystica Unicorn I ha bee a
enjoyabl proces creatin thi librar an th autho hope yo
find it equally enjoyable to use.
Disclaimer
Th autho ha take du car i th preparatio o thi manua
an th associate program t insur tha al informatio
presente i correc an functiona a stated N warrant i
mad regardin th suitabilit o thi produc fo an specifi
purpose. Consisten wit th requiremen o spee i muc o
th librar an th genera philosoph o i allowin th
programme complet freedom th amoun o erro checkin ha
bee hel t minimum.
Th autho hereb grant permissio t al user t transfe
copie o th librar t thir partie subjec t th condition
tha th entir librar an al file includin copyright b
transferre i ful fo n fe execep i th cas o user group
whic ma charg copyin fe no t excee $7.00.
Whil yo ma us th librar fo persona program withou
registration thos wh creat program fo sal o distributio
ar requeste t registe thei copy Th sourc cod ma NO b
distribute t thir part i an for withou th writte
permissio o th author.
Turb i trademar o Borlan International Microsof C
MAS an MSDO ar trademark o Microsof Corp IBM IB PC
P XT AT DO an PCDO ar trademark o Internationa Busines
Machine Corp. Epso i trademar o Epso Corp Tandy Tand
1000 A and DMP 130 are trademarks of Tandy Corp.
.pa
.he C_Tool_Box_______________________________________________Page_#
Background
Thi librar i th successo t th origina Unicor Librar
whic ha undergon severa revision an essentiall ha becom
ne entity Som o th curren revision concer simpl
orderin o th parameter i call t mak th librar mor
consistent User o th Unicor librar shoul tak particula
not o thi point Function hav bee develope fo whic th
autho ha n specifi nee bu foun interestin t implement
Man o th function ar resul o use suggestion fo whic
w than th user involved Th autho invite user t mak
furthe suggestions a worthwil challeng i alway a
interestin learnin experience.
Thi librar contain function t perfor wid variet o
task Th function ma b divide roughl int th followin
categories:
1 Genera vide includin window an fas strin writes.
2 Graphics includin variet o norma an rotate fonts
3 Soun includin backgroun soun function simila t BASIC
4 Genera function servin wid variet o purposes
5 Printe control bot graphic an dais wheel
6 Mous control
7 Joystic control
Eac o thes grouping overlap t som exten bu i genera
all excep th graphic i grou 2 ma b use wit
monochrom system Th genera librar i designe t b use
wit Turb fro Borlan an program writte usin th smal
memor model Othe compiler ar supporte an librarie ma b
requeste fro th autho upo registration I additio t thi
basi library thos availabl includ th larg mode fo Turb
an bot model fo Microsof Curren versio ) Th
autho wil als mak Lattic versio 3. librar availabl
i ther ar enoug requests Whil thes ar th basi
compiler th autho ha acces to other ma b supporte i
th numbe o request warrant.
Th entir manua i no supplie wit th Bulleti Boar
versio o th librar du t space Enoug o th manua i
include t mak th librar usabl includin brie descriptio
o eac functio an cal i for simila t functio
prototyping Th entir manua i availabl o dis i Wordsta
o ASCI tex forma an wil b sen t al registere owner
(pleas specif whic format) Preprinte manual ar availabl
fo thos wh don' wis t prin ove 20 pages Se th
registratio for fo details
.pa
First Things First
I yo hav registere you librar an hav th ful sourc
distributio disks yo shoul hav on dis o sourc cod an
headers on o AS sourc cod an eithe dis containin th
manua o th preprinte manua.
Chec you disk t insur tha al file ar readable Ther
shoul b 1 sourc files 1 AS sourc file an heade
file a o thi writing Thi amount t ove 500 o sourc
code
Ther i n particula installatio proces fo thi library I
i read t us a is Simpl plac th librar i th director
with the other libraries you use with your compiler.
Man o th critica function hav bee code i assemble fo
speed Som o th presen function code i (th font
remainin i an rotate font i particular wil b code i
assemble i futur revisions Ther ar fe instance wher
function perfor simila task bu ar code differently Fo
example ther i bot a assemble an functio t se th
vide mode Som o thes hav bee lef a learnin tool fo
th use a the illustrat bot approache t solutio o
particula task Sinc thi librar wa begu a learnin
project i i fel th use ma benefi fro suc material
Mak backu cop befor yo d anythin else Th disk ar
no copy-protected i an manner Also i woul b helpfu i
yo rea th fil READ.M a i contain th lates informatio
concernin th library Wher thi manua an READ.M conflict
pleas regar th READ.M fil a bein th mos curren
information
Ther ar dem program o th disk th larges bein CTDEMO.EX
an CTDEMO.C Thi wa compile wit th librar o th
distributio disk an illustrate th capabilit o th librar
itsel althoug i b n mean use o illustrate ever functio
i th library.
Th library a delivere normally i th smal memor mode o
Turb C an al references unles otherwis stated wil refe
t tha configuration.
Ther ar ove 20 functions containe withi th Too Bo an
ther i shor referenc sectio givin brie sampl cal an
descriptio o eac functio late i th manual Th
comprehensiv sectio followin tha give complet call
paramete description sampl progra o cod fragmen illustratin th fuction usage return an an caveat tha ma
occu wit tha function.
Al o th function wil perfor correctl wit IB PC' o
clos compatibles bu b awar tha fo severa o th critica
timin function direc scree writin i use t improv
performance Unles you machin addresse vide memor i th
sam manne a th IBM proble ma exist Th librar wa
writte o Tand 100 an ha bee ru o severa othe
machine wit complet success.
Al function beginnin wit d ar designe t suppor dais
whee printer The wer develope o Epso printe tha i
compatibl wit th DW-630 Al function beginin wit g ar
designe t suppor th IB graphic printe o compatible
Thes wer develope o TAND DM 130
Thos wh ar registere owner an hav th sourc cod wil
fin tha onl fou function nee t b altere t suppor othe
graphic systems Thes ar th tw do routine (interna an
external an th tw function t retur th colo o pixe
(interna an external) Al othe function ar base o thes
t mak conversio easier Th autho doe no hav acces t
Hercule syste fo thi conversion conversio t th EG i
currentl underwa althoug acces t a EG syste i ver
limite fo testin purposes.
Update Policy
I i th polic o Unicor Softwar t provid on fre updat
fo th librar itsel (no th sourc cod whic ma b update
fo smal fee an notificatio o on updat beyon that I
th ne librar i registere fo th updat fee the w wil
star th proces ove agai an yo wil agai receiv on fre
updat an on notificatio beyon tha point Thi insure
user wh registe wil alway hav acces t th lates versio
o th Too Box Mino release wil b place o bulleti
board, bu registere user wil no b notifie directl unles
the s request (I i fel tha mos woul prefe t us th
fre updat fo majo release) Currentl th autho place
copie o th Too Bo (majo an mino releases directl o th
followin board i th Seattl 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
Th autho log o wit th nam 'Dav Miller o eac o thes
boards.
Th mos likel spo t fin th autho fo feedbac woul b
Journey to Mars or Nightshift.
Programming Style
Th sourc cod i writte i standar wit on deviation
Th autho prefer th openin an closin brace t lin u s
instea 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
Mos function ar eithe voi o retur int I i no strictl
require t declar the prio t use I i GOO PROGRAMMIN
PRACTICE t declar al function prio t use Thi practic
wil avoi problem wit th fe function whic d retur
differen value suc a pointe t window
.pa
Technical
Thi librar wa create usin th followin tools.
Turb 1.00
Microsof Lin 3.51
MAS 4.0
Microsof Librar Manage 3.02
Th module use an th orde the shoul appea i th librar
ma b foun b usin LI t creat a LS fil o th library
I yo registe an wis t recompil fo differen memor
mode o compile, thi orde shoul b preserved.
A presen, smal bu exist i th endsoun function I wil
b bes i yo le backgroun soun ru it course an no
attemp t sto i wit thi command Thi wil b fixe i th
nex majo releas Ja 198 ) Registere owner wil
automaticall receiv th ne sourc fo thi functio wit thei
fre updat disk.
Revision ar possibl i som function i th nex release
Ever possibl effor wil b use t maintai FUL
compatibility bu b awar tha th call t som windo
function an t th backgroun soun function ma b altere
somewhat Whe usin th Too Bo pleas kee thi i min i
yo pla t upgrade I i anticipate th change wil no b
extensiv an additiona function wil b adde whereve
possibl rathe tha alterin th existin functions Th autho
wil preserv al curren functio call intac i al release
beyon thi point.
.pa
Your First Program
Usin th Too Box i essentiall quit simple Wit Turb
yo mus specif an module t b linke i you projec file
I the ar no file the th complet extensio mus b used
Fo exampl suppos yo wis t buil fil 'mytest.exe fro
mytest. an th Too Box library You projec fil shoul b
i for simila t th below:
mytest
CTB100.LIB
Whe yo ar withi th Turb environmen, simply us Al t
indicat th projec fil nam an the Al t buil an ru
you program Yo ma als buil you progra fro th comman
lin b typing:
TC mytes CTB100.lib
Eithe approac wil buil you progra an lin i wit th
Too Box librar.
Th dem progra wa buil usin th command:
TC CTDEM CTB100.LIB
Ther i projec fil o th dis i yo prefe t wor withi
th Turb environment Th dem ma b buil b specifyin
ctdem a th fil an ctdemo.pr a th projec file Us AL
t ru th progra o AL t compil it.
.pa
The Future
Th nex majo releas i planne fo Ja., 1988 Som
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 Additiona soun functions
6 Font - rewrittin thos lef code i i assemble
fo spee an tru strok fon capability Thi wa
containe i th origina Lattic version Th autho
woul lik t restor i wit ful rotation
translatio an scalin fo th nex majo release.
Th autho wishe t continu providin thi librar t user i
th for o sharewar consisten wit use support I ha bee
a enjoyabl spar tim projec ove th las yea an half
Th autho feel sharewar i a importan elemen i today'
compute environment.
Pleas fee fre t expres you opinio o wha yo wis t se
mad available Le u know!
.pa
Interna Globa Variables
The librar contains a serie o globa variables Yo
shoul no us thes name i you program unles yo
specificall wis t referenc tha variable Fo exampl usin
variabl name bdr i you progra wil resul i lin erro
a bes o failur o th windowin function tha us borde
a worst Belo i lis o thes variable an thei interna
meaning t th 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
in ct_color indicate i colo i allowe (1 o no
BORDER bdr1 a single line border for windows
BORDE bdr1 borde wit singl vertica lin an
double horizontal lines.
BORDE bdr2 borde wit doubl vertica line an
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.
BORDE i pointe t borde.
WINDOW is a pointer to a box,
generall indicate b 'bp i
documentation.
Se th heade CTB. fo additiona variable an define tha
ma b useful.
.pa
Registration Form
Thi librar i distribute a sharewar whic simpl mean
yo ar fre t copy us an pas copie o t friend fo
evaluation I yo decid i i useful yo ma registe you
cop wit th author Upo registratio yo wil receiv th
complet sourc cod fo th librar an cop o th manua o
disk Thi wil consis o disks I additio yo wil
receiv th firs updat dis free an notificatio o an
furthe updates Majo releas update ar occurin abou
time year.
Th curren registratio fe i $29.95
Name: ______________________________________________
Computer Type: ______________________________________________
Address: ______________________________________________
______________________________________________
City/State/Zip: _________________________ ____ _____________
Library Version: _CTB_1.00___________________________________
Compiler: (check 1)
Turbo C ___ Microsoft C ___ other __________
Mor tha on versio ma b requested Pleas ad a updat fee
o $12.95 fo eac additiona version.
Preprinte manua page suitabl fo placemen i thre rin
binde wil b supplie fo a additiona $18.00.
User Statement
realiz tha whil th librar ma b freel give awa t
thir partie th sourc cod i no publi domai an agre t
protect the authors code and not to pass it on to third parties.
Signed: ___________________________ Date: ________________
Comment o additiona informatio ma b place o th bac o
this page.
.pa
Functio Descriptions
atsay (row, col, fore, back, *string);
Print a string in color at row, column
bac i fo graphics. It' dumm paramte i tex
mode.
bac16_4 (fore, back)
Set4 colum tex mod t us highlighte backgroun
colors
back16_8 (fore, back)
Set 8 colum tex mod t us highlighte backgroun
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)
Play a undescribabl soun i th speaker Yo hav
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)
Clear tex scree (8 col) set attribute an place
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 ()
Uninstal th soun time interrup an tur backgroun
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
rascha (char ULR ULC hmag vmag color)
Use th interna characte fon description t
display characters at larger sizes
rdhcount ()
Reads current mouse horizontal motion counter
rdvcount ()
Reads current mouse vertical motion counter
readkey ()
Destructiv retur o ASCI an sca code fo ke
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)
Dra flle rectangl bounde b double pixe 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)
Dra simulate handwritte characte o th graphic
screen
scrolld (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 ()
enable th backgroun soun interrup an use note
i arra melod an timin i arra bea t produc
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)
retur digi valu o cosin fo whol degree -
operates faster for graphics plotting
tone (freq, time_in_ms)
play a tone - time assumes 4.77 MHz clock
tsin (angle)
retur digi valu o si fo whol degree -
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#)
Allow use t selec fro predetermine font th
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)
Write char(s t pag (tex mode i colo (graphic
mode)
wchtty (char, fore)
Write characte usin tt BIO mode colo i graphic
mode in use
wco (char, color)
Writ characte onl (colo i activ i 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)
Writ characte i TT mode colo i onl activ i
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
.pa
Appendix A
Thi sectio o th manua i detaile descriptio o th
functions I include descriptio o th function sampl
cal fro C sampl progra o progra fragmen usin th
functio an an return fro th function Include als ar
an limits peculiaritie o othe informatio abou th
function require fo effectiv us i programming.
.pa
.he _C_Tool_Box___________________________________________Appendix_A_
atsay
Thi functio i simila t th dBAS functio o th sam nam
i tha i allow th use t print i color strin 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");
}
Thi progra wil prin th strin "Testing o th
scree i colo 3 startin a ro colum 10 I i
graphic mod (remov th comments th backgroun
colo wil b colo 2 fo tex mod thi paramete i
a dummy parameter.
Return:
None
Caveats:
Backgroun colo i onl activ i graphic modes Fo
tex mode i i dumm parameter Fo writtin wit
backgroun colo i tex mode us th watc
function.
B sur th strin parameter li withi th scree
boundries.
.pa
This ends the Board version of the manual.
Th ful manua wil b sen wit al librar sourc cod t al
registere owner o th Too bo Library Ther simpl i no
enough room in a bulletin board sized file.
Thi sectio o th manua i a earl version Th fina manua
wil contai complet description o al aspect o th too
Box I i availabl i tw dis formats On suitabl fo
printin fro DO an on i WordSta format I i als
availabl i th for o preprinte page suitabl fo thre
ring binder.
Th followin i include sinc th ful manua i no wit thi
file.
BACKGROUND SOUND FUNCTIONS INFORMATION
Th number fo th musica note ar liste belo fo th octav
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.
Plac th note i a arra calle melody[ an th timin coun
i a arra calle beat[] se ctdemo. fo a example Othe
song ma b define wit note an timin i differen array
bu thes wil hav t b copie int th melod an bea array
befor activatio th backgroun soun function futur
release will pass a pointer to the desired array.
Dave Miller
8018 NE 123rd St
Kirkland, WA
90034
Please look at the read.me file and the manual.doc file for information
relating directly to this library and its use.
The original release date was set for 1 Oct 87 for this library but it is
being released early while still in the Beta test stage in order to
prepare for the imminent release of Microsoft C version 5.0 and Quick C.
This means that some of the planned functions ( such as menus and data
entry) have been postponed until a later release ( probably about Jan 88 )
There also remains a slight bug in the background sound routines that will
be corrected in the next release. This release is version 1.00. The next
release will be 1.xx and will be found on boards under the name CTB1xx.ARC
just as this is labled CTB100.ARC. A full update to version 2.00 is
planned for sometime in 1988 and will contain a wide variety of new
functions. Further updates of version 1 are planned in the meantime.
Future releases will identify the target compiler in the last letter. The
next minor release of this version will actually be called CTB1xxT.ARC where
the 'T' is for Turbo C. There will also be an 'M' for Microsoft C and
possibly an 'L' for Lattice if enough users request it. While we feel these
versions will be the most requested we are willing to port the library to
other compilers is the demand is high enough.
We will always support the latest release of the target compiler in the case
of Turbo and Microsoft C. The latest release of this library should follow
within a week the release of a new compiler release.
There are two versions of the manual on this disk. Manual.doc is in
Wordstar format and manual.asc is in ASCII format. The manual.asc file was
created by running the Wordstar version through a conversion program and
consequently has lost all the page formatting etc. No attempt has been made
to restore this in the board version of this manual.
Pass copies of this library to your friends. We hope you enjoy using this
library, it has been an interesting project to date for the author.
The author places updates drectly on the following boards in the Seattle
area:
Journey to Mars (RBBS) 206 486-3136 log name Dave Miller
PNW IBM User Group (RBBS) 206 343-7843 log name David Miller
Dave Miller
29 Aug 1987
December 5, 2017
Add comments