home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1994-01-01 | 4.8 KB | 172 lines |
- '
- '
- ' Programmed By Gary Shilvock 1990
- '
- '
- DRAGONS
- '
- '
- '
- Procedure DRAGONS
- Gosub SETUP : Rem do all the setup routines
- Gosub SCR0LL : Rem do the scroll
- Goto DEMO_END : Rem finish off
- '
- SETUP:
- Rem check for memory expansion or a 1meg agnus
- '
- ' if you have expansion ram available the variable 'MEG' is set to TRUE
- MEG=False
- If((Fast Free+Chip Free)/1024)>512
- MEG=True
- End If
- Load "df0:full demos/demo2.pic",6
- If MEG=True
- Load "df0:full demos/demo2.music",3
- End If
- Close Editor
- Close Workbench : Rem free some memory
- Rem open the window on which the scrolling will take place
- WIDTH=640
- M0DE=Hires
- Screen Open 3,WIDTH,16,2,M0DE : Curs Off : Palette $0,$FFF
- Rem position it
- Screen Display 3,130,0,,
- Curs Off : Hide
- Rem turn up the volume to full
- If MEG=True
- Mvolume 63
- End If
- Rem turn off the filter
- Led Off
- Rem unpack and display the bitmap
- Unpack 6 To 0
- Screen 3
- FIND_A_FONT:
- Rem load font data from disk
- Get Disc Fonts
- For TEMP=1 To 100
- A$=Font$(TEMP)
- If Mid$(A$,0,11)="garnet.font" : Rem is it the one i want
- If Mid$(A$,31,1)="9" : Rem and the size i want ?
- F0NT=TEMP : Rem yep, so set the variable F0nt to the font number
- Goto SETFNT : Rem and set the font
- End If
- End If
- Rem this happens if i cant find a garnet font on your
- Rem amos disk
- If A$=""
- Screen 3 : Palette $0,$FFF
- Screen Display 3,130,130,,
- Bell
- Centre "Problem Locating Font. Defaulting To Topaz."
- Wait 100
- Rem set font to bold,italic topaz
- F0NT=0 : Set Text 6
- Exit
- End If
- Next
- SETFNT:
- Set Font F0NT : Rem set font
- If MEG=True
- Music 1
- End If
- Screen Show 0 : Screen 0
- Screen 3
- Return
- '
- '
- SCR0LL:
- Screen To Front 3 : Screen 3
- Restore TXT : Rem point to our text
- COUNT=0 : Rem temp label
- DIZZY:
- PRESSED=False : Rem 'no mouse button pressed yet' flag
- Read DAT$ : Rem get a line of text
- If DAT$="End Of Scroll" : Rem is it a special command?
- Restore TXT : Rem if it was,point to the begining of our text again
- Read DAT$ : Rem you need this otherwise it will print 'End Of Scroll'
- Rem and we dont want that to appear
- End If
- If DAT$="Fade Music Down" : Rem another special command?
- If MEG=True
- For A=63 To 0 Step -1
- Mvolume A : Wait 1 : Rem fade music to volume 0
- Next
- End If
- Read DAT$ : Rem get next line of text
- End If
- If DAT$="Filter On" : Rem another special command ?
- Bclr %1,$BFE001 : Rem set the filter (Led on would have worked just as well)
- Read DAT$ : Rem get next line
- End If
- If DAT$="Filter Off" : Rem special command ?
- Bset %1,$BFE001 : Rem led off would also work
- Read DAT$ : Rem get next line of text
- End If
- If DAT$="Fade Music Up" : Rem speocal command ?
- If MEG=True
- For A=0 To 63
- Mvolume A : Wait 1 : Rem Increase from Volume 0 To Volume 63
- Next
- End If
- Read DAT$ : Rem get next line of text
- End If
- Cls 0 : Rem at this point the screen is not visible, so its ok to clear it
- L=Text Length(DAT$) : Rem find length of text to be printed
- XPOS=WIDTH-L : Rem take length from screen width
- XPOS=XPOS/2 : Rem and divide by 2 - this roughly centres the text
- Text XPOS,12,DAT$ : Rem on the screen
- For A=0 To 60
- Screen Display 3,,A,, : Rem move the screen down into view
- Wait Vbl
- Next
- For PAWS=0 To 100
- If Mouse Click=1 : Rem wait, checking for a mouse click
- Goto OUT
- End If
- Wait Vbl
- Next
- For A=60 To 0 Step -1
- Screen Display 3,,A,, : Rem scroll the screen out of view
- Wait Vbl
- Next
- Goto DIZZY : Rem and get the next piece of text and repeat the above
- Rem procedure until someone hits a mouse button
- OUT:
- Return
- Rem the data for the scroll
- TXT:
- Data "Welcome To "
- Data "The Dragon Demo"
- Data "If you only have 521k there is no music....."
- Data " "
- Data "You Can Also Use Imbedded Commands...."
- Data "For Example...Fade The Music Down"
- Rem a special command
- Data "Fade Music Down"
- Data "And Back Up Again"
- Rem a special command
- Data "Fade Music Up"
- Data "Turn Filter On"
- Rem a special command
- Data "Filter On"
- Data "And Turn The Filter Off Again"
- Rem a special command
- Data "Filter Off"
- Data "Those Are The Only Ones I've Programmed As Yet"
- Data "But The Possibilities Are Endless......"
- Data "Thats All Folks........"
- Rem a special command
- Data "End Of Scroll"
- DEMO_END:
- Screen 3 :
- Fade 1 : Wait 15
- Screen 0
- Fade 1
- If MEG=True
- For A=63 To 0 Step -1
- Mvolume A : Wait 1
- Next : Music Off
- End If
- End Proc