home *** CD-ROM | disk | FTP | other *** search
/ TCE Demo 2 / TCE_DEMO_CD2.iso / demo_cd_.2 / mags / stosser / stoser05.arj / stoser05.msa / A / 5.PNE < prev    next >
Text File  |  1987-04-22  |  2KB  |  90 lines

  1.           
  2.           STOS BITS 'N PIECES
  3.  
  4.                    by
  5.  
  6.         Martin Cubitt July 1993
  7.  
  8.  
  9.          The AUTOBACK command.
  10.  
  11.  
  12.  Do you turn AUTOBACK off in your pro-
  13. grams which do not use sprites? Stephen
  14. Hill wrote an article in the STOS News-
  15. letter issues 5 and 6 which showed the
  16. inefficiency of the command when it is
  17. on.
  18.  
  19.  As you will probably be aware AUTOBACK,
  20. when on, copies the graphics drawn on 
  21. the physical screen to the background
  22. one.
  23.  
  24.  I wrote a test program:
  25.  
  26.  10 mode 0
  27.  20 key off 
  28.  30 hide 
  29.  40 curs off 
  30.  50 flash off 
  31.  60 wait vbl 
  32.  70 timer=0
  33.  80 for LOOP=0 to 100
  34.  90 for C=0 to 15
  35.  100 ink C
  36.  110 draw 0,0 to 319,199
  37.  120 rbar 0,0 to 319,199
  38.  130 ink 15-C
  39.  140 draw 0,0 to 45,199
  40.  150 ink C
  41.  160 paint 0,0
  42.  170 next C
  43.  180 next LOOP
  44.  190 T=timer
  45.  200 default
  46.  210 print T
  47.  
  48.  The result was 17,382. So then I added
  49. the line 
  50.  
  51.  55 auto copy off
  52.  
  53.  (surely, you mean autoback? - Ed.)
  54.  
  55.  and rerun it.
  56.  
  57.  The result was 12,883. So it was quite
  58.  a lot faster.
  59.  
  60.  To simulate the autoback function I
  61. then added the line
  62.  
  63.  165 screen copy physic to back
  64.  
  65.  (yes I could have used fastcopy!)
  66.  
  67.  The result this time was 14,718. So
  68. even if you do plan on using sprites
  69. (just do not move them during the screen 
  70. copy command) you can replace the auto-
  71. back function with a screen copy. Speedy 
  72. processing!
  73.  
  74.  However, the example given was a bit
  75. excessive as far as graphical functions
  76. go. If you are only drawing, say, ten 
  77. lines then the autoback command is
  78. actually faster.
  79.  
  80.  So depending on the extent of the
  81. graphics you are producing you may or
  82. may not choose to use autoback!
  83.  
  84.  Take care as CLS and MODE automatically
  85. set autoback on.
  86.  
  87.  
  88.  CUBITTM/STOS0006/190793
  89.  
  90.