home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / gfaxpert.lzh / GFAXPERT.LIB / SCROLL.LST < prev    next >
Encoding:
File List  |  1986-10-19  |  5.8 KB  |  209 lines

  1. ' ******************
  2. ' *** SCROLL.LST ***
  3. ' ******************
  4. '
  5. DEFWRD "a-z"
  6. '
  7. > PROCEDURE initio.scroll
  8.   ' *** install second screen as logical screen for scrolling
  9.   ' *** prepare (invisible) logical screen
  10.   ' *** then call any of the following scroll-Procedures
  11.   ' *** Procedures use Standard Global physbase%
  12.   ' *** global :   SCROLL.SCREEN%   SCROLL!
  13.   IF NOT scroll!                          ! create logical screen if necessary
  14.     scroll!=TRUE
  15.     DIM scroll.screen|(32256)
  16.     scroll.screen%=V:scroll.screen|(0)
  17.     scroll.screen%=scroll.screen%+256-(scroll.screen% MOD 256)
  18.   ENDIF
  19.   ~XBIOS(5,L:scroll.screen%,L:-1,-1)      ! scroll-screen is now logical screen
  20. RETURN
  21. ' *****
  22. > PROCEDURE up.scroll(scroll.lines)
  23.   ' *** scroll-screen scrolled upwards
  24.   ' *** slow scroll   : 1 or 2 lines (interference on 1/3 and 2/3 of height ??)
  25.   ' *** fast scroll   : 8 (Low) or 16 (High/Med) lines
  26.   ' *** after actual scroll, a dummy scroll follows for constant scroll-speed
  27.   ' *** uses Standard Globals
  28.   LOCAL bytes,n,end%,offset%
  29.   IF high.res!
  30.     LET bytes=80*scroll.lines
  31.   ELSE
  32.     LET bytes=160*scroll.lines
  33.   ENDIF
  34.   end%=physbase%+32000
  35.   offset%=32000+bytes
  36.   FOR n=1 TO scrn.y.max/scroll.lines
  37.     n.bytes%=MUL(n,bytes)
  38.     BMOVE scroll.screen%,SUB(end%,n.bytes%),n.bytes%
  39.     BMOVE scroll.screen%,scroll.screen%,SUB(offset%,n.bytes%)
  40.   NEXT n
  41.   BMOVE scroll.screen%,physbase%,32000          ! tidy up
  42.   ~XBIOS(5,L:physical.screen%,L:-1,-1)          ! back to normal
  43. RETURN
  44. ' *****
  45. > PROCEDURE slider.scroll
  46.   ' *** fade-over with slider-effect
  47.   ' *** High resolution only
  48.   LOCAL y,y2
  49.   FOR y=4 TO 400 STEP 2
  50.     y2=SUB(400,y)
  51.     RC_COPY scroll.screen%,0,y2,160,y TO physbase%,0,0
  52.     RC_COPY scroll.screen%,160,0,160,y TO physbase%,160,y2
  53.     RC_COPY scroll.screen%,320,y2,160,y TO physbase%,320,0
  54.     RC_COPY scroll.screen%,480,0,160,y TO physbase%,480,y2
  55.   NEXT y
  56.   ~XBIOS(5,L:physbase%,L:-1,-1)                 ! back to normal
  57. RETURN
  58. ' *****
  59. > PROCEDURE stripes.scroll(n)
  60.   ' *** fade-over with luxaflex-effect
  61.   ' *** High resolution only
  62.   ' *** try n=3
  63.   LOCAL i,j,x,y
  64.   FOR i=0 TO 39
  65.     x=MUL(i,80)
  66.     FOR j=0 TO 9
  67.       y=ADD(MUL(j,3200),x)
  68.       BMOVE ADD(scroll.screen%,y),ADD(physbase%,y),80
  69.     NEXT j
  70.     PAUSE n
  71.   NEXT i
  72.   ~XBIOS(5,L:physbase%,L:-1,-1)                 ! back to normal
  73. RETURN
  74. ' *****
  75. > PROCEDURE random.scroll(n)
  76.   ' *** fade-over with random lines
  77.   ' *** High resolution only
  78.   ' *** try n=0 or n=1
  79.   LOCAL i,j,z
  80.   DIM ran.scroll(399)
  81.   FOR i=0 TO 399
  82.     ran.scroll(i)=i
  83.   NEXT i
  84.   FOR i=399 DOWNTO 0
  85.     j=RAND(SUCC(i))                             ! integer 0-i
  86.     SWAP ran.scroll(i),ran.scroll(j)
  87.   NEXT i
  88.   FOR i=0 TO 399
  89.     z=ran.scroll(i)*80
  90.     BMOVE ADD(scroll.screen%,z),ADD(physbase%,z),80
  91.     PAUSE n
  92.   NEXT i
  93.   ERASE ran.scroll()
  94.   ~XBIOS(5,L:physbase%,L:-1,-1)                 ! back to normal
  95. RETURN
  96. ' *****
  97. > PROCEDURE middle.scroll(n)
  98.   ' *** fade-over with zoom from center
  99.   ' *** High resolution only
  100.   ' *** try n=1
  101.   LOCAL x,y,xp,yp
  102.   FOR y=5 TO 400 STEP 5
  103.     x=y*1.6
  104.     xp=SHR(SUB(640,x),1)
  105.     yp=SHR(SUB(400,y),1)
  106.     RC_COPY scroll.screen%,xp,yp,x,y TO physbase%,xp,yp
  107.     PAUSE n
  108.   NEXT y
  109.   ~XBIOS(5,L:physbase%,L:-1,-1)                 ! back to normal
  110. RETURN
  111. ' *****
  112. > PROCEDURE dropline.scroll(n)
  113.   ' *** fade-over with dropping lines           *** BUG ***
  114.   ' *** High resolution only
  115.   ' *** try n=1
  116.   LOCAL i,j,adr2%
  117.   FOR i=396 TO 0 STEP -4
  118.     adr2%=ADD(scroll.screen%,MUL(i,80))
  119.     PAUSE n
  120.     FOR j=0 TO i STEP 4
  121.       BMOVE adr2%,ADD(physbase%,MUL(j,80)),320
  122.     NEXT j
  123.   NEXT i
  124.   ~XBIOS(5,L:physbase%,L:-1,-1)                 ! back to normal
  125. RETURN
  126. ' *****
  127. > PROCEDURE spiral.scroll(n)
  128.   ' *** fade-over with spirals
  129.   ' *** High resolution only
  130.   ' *** try n=1
  131.   LOCAL x,y,c,m,i
  132.   x=320
  133.   y=200
  134.   c=0
  135.   m=1
  136.   REPEAT
  137.     FOR i=1 TO m
  138.       RC_COPY scroll.screen%,x,y,64,40 TO physbase%,x,y
  139.       PAUSE n
  140.       SELECT c MOD 4
  141.       CASE 0
  142.         SUB x,64
  143.       CASE 1
  144.         SUB y,40
  145.       CASE 2
  146.         ADD x,64
  147.       CASE 3
  148.         ADD y,40
  149.       ENDSELECT
  150.     NEXT i
  151.     INC c
  152.     IF EVEN(c)
  153.       INC m
  154.     ENDIF
  155.   UNTIL c=19
  156.   ~XBIOS(5,L:physbase%,L:-1,-1)    ! back to normal
  157. RETURN
  158. ' **********
  159. '
  160. > PROCEDURE scroll.up(scroll.lines,scroll.color)
  161.   ' *** scroll screen upwards
  162.   ' *** for reasonably smooth scrolling, use 2 or 3 lines
  163.   ' *** for fast scroll, use 8 (Low rez) or 16 (High/Med rez) lines
  164.   ' *** uses Standard Globals
  165.   LOCAL n,bytes,move.bytes,source%
  166.   IF high.res!
  167.     LET bytes=80*scroll.lines
  168.   ELSE
  169.     LET bytes=160*scroll.lines
  170.   ENDIF
  171.   move.bytes=32000-bytes
  172.   source%=physbase%+bytes
  173.   VSYNC
  174.   BMOVE source%,physbase%,move.bytes                       ! 1st scroll
  175.   DEFFILL scroll.color
  176.   PBOX 0,scrn.y.max-scroll.lines+1,scrn.x.max,scrn.y.max   ! clear bottom,
  177.   FOR n=1 TO DIV(scrn.y.max,scroll.lines)                  ! here we go
  178.     VSYNC
  179.     BMOVE source%,physbase%,move.bytes
  180.   NEXT n
  181. RETURN
  182. ' **********
  183. '
  184. > PROCEDURE scroll.down(scroll.lines,scroll.color)
  185.   ' *** scroll screen downwards
  186.   ' *** for reasonably smooth scrolling, use 2 or 3 lines
  187.   ' *** for fast scroll, use 8 (Low rez) or 16 (High/Med rez) lines
  188.   ' *** (interference line on 1/3 and 2/3 of screenheight, why ??)
  189.   ' *** uses Standard Globals
  190.   LOCAL n,bytes,move.bytes,dest%
  191.   IF high.res!
  192.     LET bytes=80*scroll.lines
  193.   ELSE
  194.     LET bytes=160*scroll.lines
  195.   ENDIF
  196.   move.bytes=32000-bytes
  197.   dest%=physbase%+bytes
  198.   VSYNC
  199.   BMOVE physbase%,dest%,move.bytes             ! 1st scroll
  200.   DEFFILL scroll.color
  201.   PBOX 0,0,scrn.x.max,scroll.lines-1           ! clear top,
  202.   FOR n=1 TO DIV(scrn.y.max,scroll.lines)      ! here we go
  203.     VSYNC
  204.     BMOVE physbase%,dest%,move.bytes
  205.   NEXT n
  206. RETURN
  207. ' **********
  208. '
  209.