home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / HPSOURCE / HPSRC_01.MSA / DATA_BARREL.DAT < prev    next >
Text File  |  1987-04-21  |  3KB  |  90 lines

  1.  
  2.                               BARREL
  3.                               ¯¯¯¯¯¯
  4. Not another article by Eddie, yes it is,first of all I must 
  5. thank Runrig for taking control of this mega disc magazine, so I 
  6. have more time to do my other stuff, cheers.
  7.      below all this bullshit is the 68000 source code for a mega 
  8. fast barrel scroll for STOS, this is a lot better than the one that was 
  9. on a previous issue of Disc Maggie, mainly because it doesn't use 
  10. the crappy STOS basic scroll and copy commands.Don't worry if you 
  11. don't have DEVPAC 2, I have included the assembled code in the 
  12. STOS folder called BARREL.PRG.
  13.      To use the routine you need to load the file into a STOS 
  14. memory bank using LOAD"PROG.PRG",bank, and to run the routine you 
  15. have to access the address/data registers using AREG(), and 
  16. DREG(),(see top of source code!)
  17.      the routine only copies single planes, so if you want to 
  18. barrel scroll a 16 colour image you will need to use the routine 
  19. on each of the 4 planes, this is of course a lot slower than 
  20. copying a single plane. for example if I want to take a screen in 
  21. bank 15 and barrel scroll it onto physical screen, I would use 
  22. the following code (assuming that the mcode routine is in bank 
  23. 1!).
  24.  
  25. AREG(1)=PHYSIC    
  26. AREG(0)=START(15)
  27. DREG(0)=0
  28. DREG(1)=16000
  29. CALL 1
  30.  
  31. This routine copies plane 1 to plane one, if I want to copy plane 
  32. 2 then I would add 2 to the source and dest address, so 
  33. AREG(0)=start(15)+2, and so on
  34.  
  35.  
  36. **************************************************************
  37. *ROUTINES BY EDDIE BRYAN OF THE HAPPENING BOIZ               *
  38. **************************************************************
  39.  
  40. *EDDIES BARREL SCROLL ROUTINE -
  41. *A1-DESTINATION
  42. *A0 SOURCE
  43. *D0-SOURCE POS (160'S)
  44. *D1-DEST POS   (160'S)
  45.  
  46. BARREL_SCROLL   ADD.L   D1,A1                   
  47.                 ADD.L   D0,A0
  48.                 MOVE.L #ADDTAB,A2       
  49.                 MOVE.W #67,D0           
  50. CONLOOP         MOVE.W (A0),(A1)        
  51.                 MOVE.W 8(A0),8(A1)
  52.                 MOVE.W 16(A0),16(A1)
  53.                 MOVE.W 24(A0),24(A1)
  54.                 MOVE.W 32(A0),32(A1)
  55.                 MOVE.W 40(A0),40(A1)
  56.                 MOVE.W 48(A0),48(A1)
  57.                 MOVE.W 56(A0),56(A1)
  58.                 MOVE.W 64(A0),64(A1)
  59.                 MOVE.W 72(A0),72(A1)
  60.                 MOVE.W 80(A0),80(A1)
  61.                 MOVE.W 88(A0),88(A1)
  62.                 MOVE.W 96(A0),96(A1)
  63.                 MOVE.W 104(A0),104(A1)
  64.                 MOVE.W 112(A0),112(A1)
  65.                 MOVE.W 120(A0),120(A1)
  66.                 MOVE.W 128(A0),128(A1)
  67.                 MOVE.W 136(A0),136(A1)
  68.                 MOVE.W 144(A0),144(A1)
  69.                 MOVE.W 152(A0),152(A1)
  70.  
  71.  
  72.                 ADD.L #160,A1           
  73.                 MOVE.W (A2)+,D1         
  74.                 ADD.W D1,A0             
  75.                 DBF D0,CONLOOP
  76.                 RTS
  77.  
  78. ADDTAB          DC.W 800,640,480,320,320,320,320,160,320,160,320,160,160,160,0,160,160,0
  79.                 DC.W    160,160,0,160,160,0,160,0,160,0,160,0,160,0,160,0
  80.                 DC.W 0,160,0,160,0,160,0,160,0,160,0,160,160,0,160,160
  81.                 DC.W    0,160,160,0,160,160,160,320,160,320,160,320,320,320,480,320,640,800
  82.  
  83. Well that's it, I hope this simple routine has proved a great 
  84. read, and inspired you to produce mega cool demos etc.
  85.  
  86.                Eddie Bryan (THB, and TPS) 28 October 1991      
  87.  
  88.  
  89.  
  90.