home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1988-01-20 | 5.5 KB | 256 lines |
- Set Buffer 35
- Rem
- Rem Start up Program for Amoner02 - Gal-on Broner.
- Rem
- Screen Open 0,640,200,8,Hires
- Bank Swap 2,3
- Load "Amoner002:Icons.abk",2
- Get Icon Palette
- Curs Off : Flash Off : Cls 0
- Dim ARTICLE$(2,150)
- Dim LASTLINE(2)
- TEXREAD[1,"Amoner002:Editorial.txt"]
- TEXREAD[2,"Amoner002:Policy.txt"]
- Rem
- Rem Reserve some zones.
- Rem
- HANDLE_ZONE:
- BUILD_SCREEN_FACE
- Reserve Zone
- Reserve Zone 8
- Set Zone 1,10,10 To 300,27
- Set Zone 2,10,10 To 100,100
- Set Zone 3,300,10 To 590,27
- Set Zone 4,500,10 To 590,100
- Set Zone 5,10,100 To 100,190
- Set Zone 6,10,173 To 300,190
- Set Zone 7,500,100 To 590,190
- Set Zone 8,300,173 To 590,190
- Paste Icon 101,28,2
- Rem
- Rem Check mouse, here we use three vers.
- Rem Past_zone - privous zone
- Rem now_zone - The zone which the mouse is currntly in.
- Rem curr_zone - the zone we currently act on...
- Rem
- CHECKMOUSE:
- NOW_ZONE=0
- PAST_ZONE=0
- Repeat
- If Mouse Zone<>NOW_ZONE
- PAST_ZONE=NOW_ZONE
- NOW_ZONE=Mouse Zone
- Gosub REDRAW_ZONE
- End If
- Until Mouse Click
- Rem
- Rem moused clicked, Act according to zone.
- Rem
- Rem Editorial/policy, new icon
- Rem create new zones
- Rem
- If((NOW_ZONE<>1) and(NOW_ZONE<>2)) Then Goto 6
- Ink 0
- Bar 101,28 To 499,172
- 4
- Reserve Zone
- Reserve Zone 3
- Set Zone 1,142,88 To 233,112 : Rem Policy
- Set Zone 2,355,48 To 482,76 : Rem Editorial
- Set Zone 3,290,137 To 399,168 : Rem Forget it
- Paste Icon 101,28,3
- 5
- Repeat : Until Mouse Click
- If Mouse Zone=0 Then Goto 5
- If Mouse Zone=1
- DISPLAY[2]
- Goto 4
- End If
- If Mouse Zone=2
- DISPLAY[1]
- Goto 4
- End If
- If Mouse Zone=3 Then Goto HANDLE_ZONE
- Rem
- Rem Agraph. Create Agraph temp file and exit.
- Rem
- 6
- If NOW_ZONE=3 or NOW_ZONE=4
- Open Out 1,"Amoner002:s/Agraph.tmp"
- Print #1,"This is a tmp file."
- Close 1
- End
- End If
- If((NOW_ZONE<>5) and(NOW_ZONE<>6)) Then Goto 9
- Ink 0
- Bar 101,28 To 499,172
- 7
- Reserve Zone
- Reserve Zone 3
- Set Zone 1,142,88 To 233,112 : Rem Explode
- Set Zone 2,355,48 To 482,76 : Rem Loan_Calc
- Set Zone 3,290,137 To 399,168 : Rem Forget it
- Paste Icon 101,28,4
- 8
- Repeat : Until Mouse Click
- If Mouse Zone=0 Then Goto 8
- If Mouse Zone=1
- Run "Amoner002:Explode.Amos"
- End If
- If Mouse Zone=2
- Run "Amoner002:LoanCalc.Amos"
- End If
- If Mouse Zone=3 Then Goto HANDLE_ZONE
- 9
- If NOW_ZONE=7 or NOW_ZONE=8
- Run "Amoner002:Gunner.Amos"
- End If
- End
- REDRAW_ZONE:
- If(((NOW_ZONE/2=NOW_ZONE/2.0) and(NOW_ZONE-1=PAST_ZONE)) or((NOW_ZONE/2<>NOW_ZONE/2.0) and(NOW_ZONE+1=PAST_ZONE))) Then Return
- Rem
- Rem Erase middle icon if entring or leaving Agraph area.
- Rem
- If NOW_ZONE=3 or NOW_ZONE=4 or PAST_ZONE=3 or PAST_ZONE=4
- Ink 0
- Bar 101,28 To 499,172 : Wait Vbl
- End If
- If NOW_ZONE=0
- Paste Icon 101,28,2
- Locate 27,19 : Print " Quit "
- End If
- CURR_ZONE=PAST_ZONE
- Ink 7
- Gosub PA_ZONE
- CURR_ZONE=NOW_ZONE
- Ink 6
- Gosub PA_ZONE
- Return
- PA_ZONE:
- If(CURR_ZONE=1 or CURR_ZONE=2)
- Paint 20,20
- If CURR_ZONE=NOW_ZONE
- Paste Icon 101,28,2
- Locate 27,19 : Print "Editorial / Policy"
- End If
- End If
- If(CURR_ZONE=3 or CURR_ZONE=4)
- Paint 580,15
- If CURR_ZONE=NOW_ZONE
- Paste Icon 101,28,1
- End If
- End If
- If(CURR_ZONE=5 or CURR_ZONE=6)
- Paint 20,180
- If CURR_ZONE=NOW_ZONE
- Paste Icon 101,28,2
- Locate 27,19 : Print " Tiny Hacks "
- End If
- End If
- If(CURR_ZONE=7 or CURR_ZONE=8)
- Paint 580,170
- If CURR_ZONE=NOW_ZONE
- Paste Icon 101,28,2
- Locate 27,19 : Print " Gunner "
- End If
- End If
- Return
- Procedure BUILD_SCREEN_FACE
- Ink 7
- Bar 10,10 To 590,190
- Ink 1
- Box 10,10 To 590,190
- Draw 300,10 To 300,190
- Draw 10,100 To 590,100
- Ink 0
- Bar 100,27 To 500,173
- Ink 1
- Box 100,27 To 500,173
- Paper 7
- Locate 2,2 : Print "Click"
- Locate 68,2 : Print "Click"
- Locate 2,22 : Print "Click"
- Locate 68,22 : Print "Click"
- Paper 1
- End Proc
- Procedure TEXREAD[ARTICLE,FILENAME$]
- Shared ARTICLE$(),LASTLINE()
- LINE=1
- Set Input 10,-1
- Open In 1,FILENAME$
- SEREAD:
- Line Input #1,ARTICLE$(ARTICLE,LINE)
- If Left$(ARTICLE$(ARTICLE,LINE),6)="end..." Then Goto CLFILE
- LINE=LINE+1
- Goto SEREAD
- CLFILE:
- Close 1
- ARTICLE$(ARTICLE,LINE)=""
- LASTLINE(ARTICLE)=LINE-1
- End Proc
- Procedure DISPLAY[ARTICLE]
- Shared ARTICLE$(),LASTLINE()
- Bank Swap 2,3
- Screen Open 1,620,140,16,Hires
- Get Icon Palette
- Screen Display 1,130,100,,
- Cls 2 : Paper 2 : Pen 0 : Ink 0,2 : Cls 2
- LINE=1
- Rem
- Rem design display screen
- Rem
- Reserve Zone : Wait Vbl
- Reserve Zone 3
- Set Zone 1,0,102 To 74,139
- Set Zone 2,75,102 To 148,139
- Set Zone 3,160,115 To 218,122
- Draw 0,100 To 640,100
- Draw 230,100 To 230,140
- Text 240,116," Text-Reader "
- Text 240,130," By Gal-on Broner, Barbarian Minds 1991."
- Rem
- Rem display text on screen
- Rem
- TXTDISPLAY:
- Locate 1,1
- For LINECLEAN=1 To 9
- Print Space$(74)
- Next LINECLEAN
- Locate 1,1
- For LINETEXT=LINE To LINE+8
- Print ARTICLE$(ARTICLE,LINETEXT)
- Next LINETEXT
- Rem
- Rem Display icons
- Rem
- Paste Icon 0,102,1
- Paste Icon 160,115,4
- Rem
- Rem Detect mouse on icons.
- Rem
- CLICKER:
- Repeat : Until Mouse Click
- If Mouse Zone=1
- Paste Icon 0,102,2
- LINE=LINE+9
- If LINE>LASTLINE(ARTICLE)
- LINE=LINE-9
- End If
- Goto TXTDISPLAY
- End If
- If Mouse Zone=2
- Paste Icon 90,102,3
- LINE=LINE-9
- If LINE<1
- LINE=LINE+9
- End If
- Goto TXTDISPLAY
- End If
- If Mouse Zone=3
- Screen Close 1
- Get Palette 0
- Bank Swap 2,3
- Pop Proc
- End If
- Goto CLICKER
- End Proc