home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MADTRB16.ZIP / FASTDRAW.DOC < prev    next >
Encoding:
Text File  |  1985-10-23  |  3.1 KB  |  91 lines

  1. FASTDRAW
  2.  Author :  Eugene Nelson
  3.  Date   :  10/5/1985
  4.  Version:  1.0
  5.  
  6.  
  7.  DESCRIPTION:
  8.      Fastdraw is an assembly language line drawing subroutine that
  9.   is faster than the standard draw procedure of TURBO pascal 2.0.
  10.   Fastdraw is faster for the following reasons:
  11.      1.  A fast point setting scheme.
  12.      2.  Points outside the screen are not set, intercepts are computed
  13.          if necessary.
  14.      3.  Fastdraw assumes the 320 X 200 graphics mode and does
  15.          not need to determine the current graphics mode.
  16.      4.  The actual line drawing procedure is only given points in the
  17.          screen, and can make assumptions based on this.
  18.  
  19.  
  20.  LIMITATIONS:
  21.      Fastdraw only works in the 320 X 200 graphics mode.
  22.      |delta x| and |delta y| must be less than 32767.
  23.  
  24. USAGE:
  25.      For fastdraw to work, it must intercept the division by zero
  26.   intercept and thus requires the following procedures and variables.
  27.     procedure  setup       sets up division by zero to point to handler.
  28.     procedure  handler     handles division by zero (mov ax,32767).
  29.     procedure  restor      restores original division by zero interupt.
  30.     var oldseg,oldofs      hold the original segment and offset of divison
  31.                            by zero interupt.
  32.   Any divison by zero after setup has been called will not cause a
  33.   runtime error.  If detection of division by zero is necessary restore
  34.   should be called only when it is needed. As the sequence
  35.         setup
  36.         fastdraw
  37.         restor
  38.   only defeats the purpose.  Setup, handler and restor are not dependant
  39.   on fastdraw, and can be used for a graceful result on division by zero.
  40.      A typical program using fastdraw would follow the outline:
  41.      program;
  42.      ...
  43.      var
  44.      ...
  45.      {$I fastdraw}   <<--- (before first procedure)
  46.      ...
  47.      begin
  48.         graphcolormode;
  49.         palette(?);
  50.         setup(cseg,ofs(handler),oldseg,oldofs);
  51.         ...
  52.         restore(oldseg,oldofs);
  53.      end.
  54.  
  55.      The files fastdraw.pas
  56.                setup.bin
  57.                handler.bin
  58.                restore.bin
  59.                fastdraw.bin  should be on the logged drive.
  60.      Global integers oldofs and oldseg are declared and should not
  61.      be assigned.
  62.  
  63.      Fastdraw follows the same syntax as draw and can replace all
  64.   occurences of draw (in 320 X 200 mode).
  65.  
  66.  BENCHMARKS:
  67.                    draw (sec)        fastdraw (sec)     draw/fastdraw
  68.                   _____________________________________________________
  69.  
  70.  1000 lines              73                 8.0              9.1
  71.  inscreen
  72.  
  73.  1000 lines             140                 2.1             66.7
  74.  rnd(2000) - 1000
  75.  
  76.  1000 lines
  77.  rnd(2000) - 10000     1270                 1.0             1270
  78.  
  79.  
  80.  ETC:
  81.     If you have a need for Fastdraw and use it in any applications, I would
  82.   appreciate a mention in the application, and a notice.  I would also
  83.   appreciate a report of any known bugs.
  84.  
  85.                              Eugene Nelson
  86.                              955 E. Gorham st.
  87.                              Madison  Wi. 53703
  88.                              (608) 255-5437
  89.  
  90.  
  91.