home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 351-375 / apd375 / progs / trans_scroll.amos / trans_scroll.amosSourceCode < prev   
AMOS Source Code  |  1991-07-30  |  9KB  |  263 lines

  1. '=================================================================== 
  2. '
  3. 'DATE: 06/01/92    
  4. 'TIME: 21:55   
  5. 'NAME: TRANS_SCROLL.AMOS 
  6. 'CODE: UNCLE SIME
  7. 'NOTE: YOU NEED THE C-TEXT EXTENSIONS TO RUN THIS UN-COMPILED! 
  8. '
  9. '=================================================================== 
  10. '
  11. ' Here's A Quickie By Uncle Sime For Those Of You Who Can Already    
  12. ' Code. If You Are A Beginner Then Try Following The Code As It's  
  13. ' Well commented and structured. 
  14. '
  15. ' "Firey The Angels Fell, Deep Thunder Rode Around Their Shores,   
  16. ' Burning With The Fires Of Ork......" 
  17. '
  18. ' If Anyone Needs Some Help With AMOS etc Drop Me A Line And I'll  
  19. ' Try To Help. 
  20. '
  21. ' If YOU WANT A REPLY INCLUDE POSTAGE ETC OTHERWISE I'LL KEEP YOUR DISKS 
  22. '
  23. ' ETC (AND GRIN) AND DO NOTHING.....YOU HAVE BEEN WARNED!  ALSO CHECK YOUR 
  24. '
  25. ' DISKS FOR VIRUSES PLEASE!  
  26. '
  27. '
  28. ' The Address:       Uncle Simes 
  29. '                    The Warehouse,  
  30. '                    118 Hiltingbury Rd, 
  31. '                    Chandlers Ford, 
  32. '                    Eastleigh,  
  33. '                    Hants,  
  34. '                    S05 1NT 
  35. '
  36. '
  37. ' Here Francois, When is AMOS going to be available on the Silicon 
  38. ' Graphics Power Series Then??????  Just a thought.  
  39. '  
  40. '===================================================================   
  41. '                       * MODULE LEVEL CODE *
  42. '=================================================================== 
  43. '
  44. Screen Close 0
  45. Dir$="SIMES_PROGS1:"
  46. MUZAK_UP
  47. INITIALISE
  48. MAIN
  49. End 
  50. '
  51. '=================================================================== 
  52. '                      * PROCEDURE LEVEL CODE *
  53. '=================================================================== 
  54. '
  55. Procedure MAIN
  56.    '
  57.    ' This procedure moves the mountains in the background and scrolls the 
  58.    ' transparent font over the top of them in the reverse direction. Note 
  59.    ' the call to the CTEXT instruction to put the text on the screen. If you
  60.    ' don't have CTEXT then I would recomend getting it from Sandra as it's
  61.    ' very good. Should you not have a copy of CTEXT then you will have to 
  62.    ' change the routine to paste icons at the same position (you will also
  63.    ' need to change the scroll text routine so you can get the correct character  
  64.    ' from the icon bank. Note the icons are stored in bank 10.
  65.    '
  66.    TTEXT$="                           "
  67.    TTEXT$=TTEXT$+"HONK! QUACK! TOOT! CHUG! CLANG! BONK! TINKLE! PING! WHIZZZ!       I SAW A SYNTEX DEMO (THE BEST OF THE BEST) "
  68.    TTEXT$=TTEXT$+"  AND THOUGHT - OOH ER I LIKE THAT LETS DO IT "
  69.    TTEXT$=TTEXT$+"SO HERE WE GO               10 - 9 - 8 - 7 - 6 - 5 - 4 - 3 - 2 - 1 - 0            "
  70.    TTEXT$=TTEXT$+" ---- UNCLE SIMES ON LINE ----  WOTCHER ALL YOU AMOS CODERS OUT THERE! ---- WHAT DO YOU THINK "
  71.    TTEXT$=TTEXT$+"OF THIS TRANSPARENT SCROLL TEXT THEN: ITS ACTUALLY VERY SIMPLE TO "
  72.    TTEXT$=TTEXT$+"DO ---- STUDY THE CODE TO FIND OUT JUST HOW SIMPLE! ----  GREETINGS GO TO: - DAVE THE RAVE - JUST MUH - BIG AL FRANCIS - "
  73.    TTEXT$=TTEXT$+"SKID - SWEET CHEEKS - KIMBERLY (YUM! YUM!) - PACIFIC - JIM - MAJIC MUSHROOM - RICK - STING - COLIN - MUPPET - BOXY VOLVO - "
  74.    TTEXT$=TTEXT$+"- MUM - HUUUUGGGE GREETINGS TO:  FRANCOIS (WHO) - CAPTAIN HICKMAN - AARON - SANDRA  - LEN & ANNE TUCKER ---- TO GET OUT OF "
  75.    TTEXT$=TTEXT$+"HERE SQUEEZE YOUR LEFT BUTTOCK ---- REMEMBER FOR TOTALLY AWESOME CODE! - GET A SUBSCRIPTION TO TOTALLY AMOS! ------ HAVE FUN WITH "
  76.    TTEXT$=TTEXT$+"THE CODE! ---- AS YOU WILL NOTICE THERE IS A SLIGH FLICKER! SO NOW YOU HAVE SOMETHING TO DO  ---- WHO WILL BE THE IMPROVER OF THIS "
  77.    TTEXT$=TTEXT$+"ROUTINE ---- DONT DELAY GET A SUBSCRIPTION TO TOTALLY AMOS TODAY - WRITE TO ANNE & LEN TUCKER 1 PENMYNYDD RD PENLAN SWANSEA "
  78.    TTEXT$=TTEXT$+"WEST GLAMORGAN WALES SA5 7EH          "
  79.    TTEXT$=TTEXT$+"   ---- SIMES OUT ----              ---- REPEATING ----              "
  80.    '
  81.    ' Kill multitasking
  82.    '
  83.    Dreg(0)=Execall(-132)
  84.    Screen 1
  85.    LOCATION=0
  86.    SCRCOUNT=0
  87.    SCRSPEED=8
  88.    COUNT=0
  89.    Def Scroll 1,0,0 To 382,65,-SCRSPEED,0
  90.    FONT_SET
  91.    RBOW
  92.    Wait Vbl 
  93.    Screen Show 0
  94.    Repeat 
  95.       Scroll 1
  96.       Add SCRCOUNT,SCRSPEED
  97.       If SCRCOUNT>30
  98.          Inc LOCATION
  99.          SCRCOUNT=0
  100.          If LOCATION>Len(TTEXT$)
  101.             LOCATION=1
  102.          End If 
  103.           Extension_8_0006 349,66,Mid$(TTEXT$,LOCATION,1)
  104.       End If 
  105.       Inc COUNT
  106.       If COUNT>319 Then COUNT=0
  107.       Screen Offset 0,320-COUNT,0
  108.       Wait 1
  109.       Screen Offset 1,1,0
  110.    Until Mouse Key
  111.    Rainbow Del 
  112.    Screen Close 0
  113.    Screen Close 1
  114.    Erase 10
  115.    MUZAK_DOWN
  116.    Wait 100
  117.    '
  118.    ' Restore multitasking 
  119.    '
  120.    Dreg(0)=Execall(-138)
  121. End Proc
  122. '
  123. Procedure INITIALISE
  124.    '
  125.    ' This procedure initialises the dual playfield used to create the     
  126.    ' effect. Screen 0 holds the mountains and screen 1 the scroll text. 
  127.    ' The priority of the screens are swapped so that the text appears 
  128.    ' infront of the mountains. The palette statement sets the palette of
  129.    ' screen 1 to all colours = black ($0), as colour 0 of a dual playfield
  130.    ' is treated as transpatent you can see through the parts of the font
  131.    ' that are in colour 0. See your amos manual pages 127 and 128 for 
  132.    ' a complete explination.
  133.    '  
  134.    Screen Open 0,640,66,8,Lowres
  135.    Screen Hide 0
  136.    SET_SCREEN
  137.    Screen Open 1,384,66,4,Lowres
  138.    SET_SCREEN
  139.    Screen Display 0,,145,,
  140.    Screen Display 1,,145,,
  141.    Wait Vbl 
  142.    Dual Playfield 0,1
  143.    Dual Priority 1,0
  144.    LANDSCAPE
  145.    Screen 0
  146.    Palette ,,,,,,,,$0,$0,$0,$0
  147. End Proc
  148. '
  149. Procedure LANDSCAPE
  150.    '
  151.    ' This procedure generates the mountain landscape. The picture is
  152.    ' loaded in the form of an abk file into memory bank 15 and unpacked 
  153.    ' to screen 2 (you don't need to open this screen it is don by AMOS) 
  154.    ' the image data on screen 2 is then Screen copied twice to screen 0 
  155.    ' (the first screen of our Dual Playfield) which is 640 pixels wide.   
  156.    ' Note that I changed to screen 0 prior to getting the palette of  
  157.    ' the picture if I had not done so the colours would not be correct. 
  158.    '
  159.    Load Dir$+"PICS/MOUNTAINS.ABK",15
  160.    Unpack 15 To 2
  161.    Screen Hide 2
  162.    Screen 0
  163.    Get Palette(2)
  164.    Screen Copy 2,0,0,320,56 To 0,0,10
  165.    Screen Copy 2,0,0,320,56 To 0,320,10
  166.    Erase 15
  167.    Screen Close 2
  168. End Proc
  169. '
  170. Procedure RBOW
  171.    '
  172.    ' Yes its another rainbow! this time created with rainbow warrior a  
  173.    ' really, really, really usefull PD utility available from AMOS PD Library 
  174.    ' C/O Sandra Sharkey. The program is on disk APD 77 along with other goodies.  
  175.    '
  176.    ' Nice One Spage! By the way did any lonely blonds with outrageous assets
  177.    ' respond to your pleadings?   
  178.    '
  179.    Set Rainbow 0,0,57,"","",""
  180.    Rainbow 0,0,145,57
  181.    Colour Back 0
  182.    Restore RDATA
  183.    For C=0 To 56
  184.       Read CVA
  185.       Rain(0,C)=CVA
  186.    Next C
  187.    View 
  188.    RDATA:
  189.    Data $22F,$22F,$22F
  190.    Data $22F,$33F,$33F,$33F,$33F,$44F,$44F,$44F
  191.    Data $44F,$55F,$55F,$55F,$55F,$66F,$66F,$66F
  192.    Data $66F,$77F,$77F,$77F,$77F,$88F,$88F,$88F
  193.    Data $88F,$99F,$99F,$99F,$99F,$AAF,$AAF,$BBF
  194.    Data $BBF,$CCF,$CCF,$DDF,$DDF,$EEF,$EEF,$EEF
  195.    Data $EEF,$EEF,$EEF,$EEF,$EEF,$EEF,$EEF,$EEF
  196.    Data $EEF,$EEF,$EEF,$EEF,$EEF,$EEF,$0,$0
  197.    Data $0,$0,$0,$0,$0,$0,$0,$0
  198. End Proc
  199. '
  200. Procedure FONT_SET
  201.    '
  202.    ' This procedure sets up the system so it can use CTEXT fonts. If you
  203.    ' want to know more about CTEXT get a copy of Feburary 1992's Amiga  
  204.    ' Shopper, turn to page 109 and read Phil South's AMOS ACTION collum.
  205.    ' If you have a copy of CTEXT then you know how to do this as it's all 
  206.    ' documented in the instructions on your disk. 
  207.    '
  208.    Load Dir$+"FONTS/TRANS_FNT.ABK"
  209.    No Icon Mask 
  210.    Wait 1
  211.    Bank Swap 2,10
  212.    Wait 1
  213.    Bload Dir$+"FONTS/TRANS_FNT.ABK.CFNT", Extension_8_0044 
  214.     Extension_8_0016 0,0
  215.    Erase 2
  216.    Wait 1
  217. End Proc
  218. '
  219. Procedure SET_SCREEN
  220.    '
  221.    ' Simple procedure to setup an amos screen.
  222.    '
  223.    Curs Off 
  224.    Flash Off 
  225.    Hide On 
  226.    Cls 0
  227. End Proc
  228. '
  229. Procedure MUZAK_UP
  230.    '
  231.    ' This procedure gradually fades in the music see manual pages 
  232.    ' 238 - 239
  233.    '
  234.    Led Off 
  235.    Mvolume 0
  236.    Music 1
  237.    For M=0 To 63
  238.       Wait 5
  239.       Mvolume M
  240.    Next M
  241. End Proc
  242. '
  243. Procedure MUZAK_DOWN
  244.    '
  245.    ' Usefull procedure to save as an ascii file on a separate disk this one 
  246.    ' you can then merge it into your programs at a suitable point. This (they     
  247.    ' tell us at Polytechnic) is basis of modular programming.... Rubbish! 
  248.    ' The correct term is COMMON SENCE why type the same thing every time    
  249.    ' you write a program when you can just shove a disk in DF1: and merge   
  250.    ' all of your most frequently used procedures into the editor, apart   
  251.    ' from anything else you get 5 hours extra debugging time or better still,     
  252.    ' drinking time. 
  253.    '
  254.    ' This is a simple procedure to fade out music. If you reversed the FOR      
  255.    ' LOOP (For M=0 To 63) it would fade the music in see above. 
  256.    '
  257.    '  
  258.    For M=63 To 0 Step -1
  259.       Wait 5
  260.       Mvolume M
  261.    Next M
  262.    Music Off 
  263. End Proc