home *** CD-ROM | disk | FTP | other *** search
- FASTDRAW
- Author : Eugene Nelson
- Date : 10/5/1985
- Version: 1.0
-
-
- DESCRIPTION:
- Fastdraw is an assembly language line drawing subroutine that
- is faster than the standard draw procedure of TURBO pascal 2.0.
- Fastdraw is faster for the following reasons:
- 1. A fast point setting scheme.
- 2. Points outside the screen are not set, intercepts are computed
- if necessary.
- 3. Fastdraw assumes the 320 X 200 graphics mode and does
- not need to determine the current graphics mode.
- 4. The actual line drawing procedure is only given points in the
- screen, and can make assumptions based on this.
-
-
- LIMITATIONS:
- Fastdraw only works in the 320 X 200 graphics mode.
- |delta x| and |delta y| must be less than 32767.
-
- USAGE:
- For fastdraw to work, it must intercept the division by zero
- intercept and thus requires the following procedures and variables.
- procedure setup sets up division by zero to point to handler.
- procedure handler handles division by zero (mov ax,32767).
- procedure restor restores original division by zero interupt.
- var oldseg,oldofs hold the original segment and offset of divison
- by zero interupt.
- Any divison by zero after setup has been called will not cause a
- runtime error. If detection of division by zero is necessary restore
- should be called only when it is needed. As the sequence
- setup
- fastdraw
- restor
- only defeats the purpose. Setup, handler and restor are not dependant
- on fastdraw, and can be used for a graceful result on division by zero.
- A typical program using fastdraw would follow the outline:
- program;
- ...
- var
- ...
- {$I fastdraw} <<--- (before first procedure)
- ...
- begin
- graphcolormode;
- palette(?);
- setup(cseg,ofs(handler),oldseg,oldofs);
- ...
- restore(oldseg,oldofs);
- end.
-
- The files fastdraw.pas
- setup.bin
- handler.bin
- restore.bin
- fastdraw.bin should be on the logged drive.
- Global integers oldofs and oldseg are declared and should not
- be assigned.
-
- Fastdraw follows the same syntax as draw and can replace all
- occurences of draw (in 320 X 200 mode).
-
- BENCHMARKS:
- draw (sec) fastdraw (sec) draw/fastdraw
- _____________________________________________________
-
- 1000 lines 73 8.0 9.1
- inscreen
-
- 1000 lines 140 2.1 66.7
- rnd(2000) - 1000
-
- 1000 lines
- rnd(2000) - 10000 1270 1.0 1270
-
-
- ETC:
- If you have a need for Fastdraw and use it in any applications, I would
- appreciate a mention in the application, and a notice. I would also
- appreciate a report of any known bugs.
-
- Eugene Nelson
- 955 E. Gorham st.
- Madison Wi. 53703
- (608) 255-5437
-
-