home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
amos
/
amos-monitor.amos
/
amos-monitor.amosSourceCode
Wrap
AMOS Source Code
|
1995-03-16
|
14KB
|
591 lines
'
' Amiga Monitor v1.0
' ==================
'
' Written by Ben Ashley, ODYSSEY SOFTWARE 1992
'
' Easy to install, just make the varibles BN,FR,OPEN,CAL,XN,YN,IN,DATE$,TIME$
' global, and just call the procedure when you want!
' If you do not want to include, just replace the paremeters, with
' zero's!
'
Global FR,OPEN,CAL,BN,XN,YN,IN,DATES$,TIME$
'
' Calls the monitor for the first time, thus making the menu's, e.t.c.
'
MONITOR[1,2,3,4,5,6,7,8]
'
Repeat
A=X Screen(X Mouse)
B=Y Screen(Y Mouse)
F=X Mouse
G=Y Mouse
'
' Simply checks to see if the monitor is there. OPEN gets a value of
' 2 if the user shuts it down!
'
If OPEN<2
MONITOR[A,B,C,D,E,F,G,H]
Screen 0
End If
'
' Simple check to bring the monitor in to view!
' It's IMPORTANT to default back to the screen on which operations
' are currently being executed, to prevent errors!
'
If Key State(69)
CAL=1
Screen 0
End If
'
Until QUIT=True
'
' Below, is the procedure you install on your program.
' Install it whilst working and remove it when you have finished.
' Use similar calls, as above to get to it!
'
Procedure MONITOR[V1,V2,V3,V4,V5,V6,V7,V8]
On Error Goto ERRO
Screen 7
If OPEN=0
FR=10
Screen Open 7,640,40,2,Hires
Curs Off : Flash Off : Cls 0
Colour 1,$FFF
Menu$(1)="System "
Menu$(2)=" Program"
Menu$(3)=" Misc "
Menu$(4)=" 3D "
Menu$(5)=" Tome "
Menu$(6)=" Control "
Menu$(7)=" Machine Code "
Menu$(8)=" Misc "
'
Menu$(1,1)="Free Memory"
Menu$(1,2)="Disk Info"
Menu$(1,3)="Utilities"
'
Menu$(2,1)="Varible Contents"
Menu$(2,2)="Output to RAM DISK:"
Menu$(2,3)="Co-Ordinates"
'
Menu$(3,1)="Hide Monitor"
Menu$(3,2)="Close Monitor"
Menu$(3,3)="About Monitor"
'
Menu$(4,1)="Colour Combinations"
Menu$(4,2)="Adjust Pragma"
Menu$(4,3)="Object Priority"
'
Menu$(5,1)="Map Information"
Menu$(5,2)="Tile Value at Mouse"
'
Menu$(6,1)="Break On"
Menu$(6,2)="Break Off"
Menu$(6,3)="Back to AMOS"
'
Menu$(7,1)="Areg Values"
Menu$(7,2)="Dreg Values"
'
Menu$(8,1)="Date & Time"
Menu$(8,2)="RAM save Frames"
'
Menu On
Screen Display 7,130,-50,640,40
Gosub DRA
Pen 1 : Paper 0 : Ink 1,0
Centre At(,1)+"A m o s - M o n i t o r"
Centre At(,3)+"v1.0"
OPEN=1
End If
'
If CAL>0
Screen Display 7,130,43,640,40
Screen To Front 7
End If
'
If CAL=2
If Mouse Screen<=7 and Mouse Screen>=0
Screen Mouse Screen
End If
X1=X Mouse : Y1=Y Mouse
X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse)
Screen 7
Locate 2,1
Print "X Mouse:";X1;" "
Locate 17,1
Print "Y Mouse:";Y1;" "
Locate 32,1
Print "Mouse Screen:";Mouse Screen;" "
Locate 2,2
Print "X Screen";X2;" "
Locate 17,2
Print "Y Screen";Y2;" "
End If
'
If CAL=3
If Mouse Screen=7
M=Mouse Key : Z=Mouse Zone
If M=1 and Z=1
Bob Update Off
Bob Clear
Gosub DRA
Locate 2,1 : Input "Bob No:";A : Locate 20,1 : Input "to:";B
Del Bob A To B
Bob Update On
Gosub UTILS
End If
If M=1 and Z=2
Gosub DRA
Locate 2,1 : Input "Icon:";A : Locate 20,1 : Input "to:";B
Del Icon A To B
Gosub UTILS
End If
If M=1 and Z=3
Gosub DRA
Locate 2,1 : Input "Bob Number:";N
Repeat
Until Mouse Key=1 and Not Mouse Screen=7
Paste Bob X Screen(X Mouse),Y Screen(Y Mouse),N
Gosub UTILS
End If
If M=1 and Z=4
Gosub DRA
Locate 2,1 : Input "Icon Number:";I
Repeat
Until Mouse Key=1 and Not Mouse Screen=7
Paste Icon X Screen(X Mouse),Y Screen(Y Mouse),I
Gosub UTILS
End If
If M=1 and Z=5
Gosub DRA
Bob Update Off : Bob Clear
Locate 2,1 : Input "Position to Insert:";POS
Ins Bob POS
Bob Update On
Gosub UTILS
End If
If M=1 and Z=6
Gosub DRA
Locate 2,1 : Input "Position to Insert:";POS
Ins Icon POS
Gosub UTILS
End If
If M=1 and Z=7
Gosub GTBOB
Gosub _BOB
End If
End If
End If
'
If CAL=4
If Mouse Screen<7 and Mouse Screen>=0
Locate 2,1
Print "Tile Value:"; Extension_7_0142((MX+X Screen(X Mouse))/16+1,(MY+Y Screen(Y Mouse))/16+1,0);" "
End If
End If
'
If CAL=5
Locate 2,1 : Print "Var1:";V1;" "
Locate 20,1 : Print "Var2:";V2;" "
Locate 40,1 : Print "Var3:";V3;" "
Locate 60,1 : Print "Var4:";V4;" "
Locate 2,2 : Print "Var5:";V5;" "
Locate 20,2 : Print "Var6:";V6;" "
Locate 40,2 : Print "Var7:";V7;" "
Locate 60,2 : Print "Var8:";V8;" "
'
End If
'
If Exist("RAM:Monitor.Dat") and CAL>=6 and CAL<=FR
Add CAL,1
End If
If CAL=6+FR
CAL=6
Print #1,"New Frame..."
Print #1," "
Print #1,"Bob Definitions:"
Print #1,"----------------"
If Length(1)>0
For F=0 To 63
Print #1,"Bob ";F;",";X Bob(F);",";Y Bob(F);",";I Bob(F)
Next F
End If
Print #1," "
Print #1,"Varible List"
Print #1,"------------"
Print #1,"Var1:";V1;" Var2:";V2;" Var3:";V3;" Var4:";V4
Print #1,"Var5:";V5;" Var6:";V6;" Var7:";V7;" Var8:";V8
Print #1," "
Print #1,"Chip:";Chip Free;" Fast:";Fast Free
Print #1," "
Gosub TIME
Print #1,"Time:";TIME$
Print #1," "
Print #1,"End Of Frame.."
Print #1," "
Print #1,"---------------------------------------------------------------"
Print #1," "
End If
'
If CAL=17
Locate 2,1 : Print "Areg 0=";Areg(0);" Areg 1=";Areg(1);" Areg 2=";Areg(2);" Areg 3=";Areg(3);" Areg 4=";Areg(4)
Locate 2,2 : Print "Areg 5=";Areg(5);" Areg 6=";Areg(6)
End If
'
If CAL=18
Locate 2,1 : Print "Dreg 0=";Dreg(0);" Dreg 1=";Dreg(1);" Dreg 2=";Dreg(2);" Dreg 3=";Dreg(3);" Dreg 4=";Dreg(4)
Locate 2,2 : Print "Dreg 5=";Dreg(5);" Dreg 6=";Dreg(6);" Dreg 7=";Dreg(7)
End If
'
If CAL=19
Gosub DATE : Gosub TIME
Locate 2,1 : Print "Date:";DATE$
Locate 2,2 : Print "Time:";TIME$+" "
End If
'
If CAL=20
Locate 2,1
Print "Free Chip:";Chip Free
Locate 30,1
Print "Free Fast:";Fast Free
Locate 50,1
Print "Total:";Chip Free+Fast Free
Locate 2,2 : Print "Free TEXT Buffer:";Free
End If
'
If CAL=21
XN=X Bob(BN) : YN=Y Bob(BN) : IN=I Bob(BN)
M=Mouse Key : Z=Mouse Zone
Locate 2,3 : Print "Bob:";BN;" "
Locate 20,3 : Print "X Bob:";XN;" "
Locate 40,3 : Print "Y Bob:";YN;" "
Locate 60,3 : Print "I Bob:";IN;" "
If Mouse Screen=7
If M=1
If Z=2
Bob BN,999,1,I Bob(BN)
End If
If Z=1
Bob BN,XN,YN,IN
End If
If Z=3
Gosub DRA
If Not Mouse Screen=7
Repeat
Bob BN,X Screen(X Mouse),Y Screen(Y Mouse),IN
Until Mouse Key=1
End If
End If
If Z=4
Gosub DRA
Locate 2,1
Input "New Image:";IN
Bob BN,XN,YN,IN
Gosub _BOB
End If
If Z=5
Gosub GTBOB
End If
End If
End If
End If
'
Curs Off
'
If Mouse Screen=7
If Choice
If Choice(1)=1 and Choice(2)=1
Gosub MEM
End If
If Choice(1)=1 and Choice(2)=2
Gosub INFO
End If
If Choice(1)=1 and Choice(2)=3
Gosub UTILS
End If
If Choice(1)=2 and Choice(2)=1
Gosub VAR
End If
If Choice(1)=2 and Choice(2)=2
Gosub RAM
End If
If Choice(1)=2 and Choice(2)=3
Gosub COORD
End If
If Choice(1)=3 and Choice(2)=1
Gosub HID
End If
If Choice(1)=3 and Choice(2)=2
Gosub CLO
End If
If Choice(1)=3 and Choice(2)=3
Gosub ABOUT
End If
If Choice(1)=4 and Choice(2)=1
Gosub COMB
End If
If Choice(1)=4 and Choice(2)=2
Gosub PRAGMA
End If
If Choice(1)=4 and Choice(2)=3
Gosub PRIOR
End If
If Choice(1)=5 and Choice(2)=1
Gosub MAPINFO
End If
If Choice(1)=5 and Choice(2)=2
Gosub VACOORD
End If
If Choice(1)=6 and Choice(2)=1
Break On
End If
If Choice(1)=6 and Choice(2)=2
Break Off
End If
If Choice(1)=6 and Choice(2)=3
Kill "RAM:Monitor.Dat"
Edit
End If
If Choice(1)=7 and Choice(2)=1
Gosub _AREG
End If
If Choice(1)=7 and Choice(2)=2
Gosub _DREG
End If
If Choice(1)=8 and Choice(2)=1
Gosub DATETIME
End If
If Choice(1)=8 and Choice(2)=2
Gosub RAMFRAMES
End If
End If
End If
'
Pop Proc
'
MEM:
Gosub DRA
CAL=20
Return
'
INFO:
Gosub DRA
Locate 2,1
Print "Disk Space:";Dfree
CAL=1
Return
'
UTILS:
Gosub DRA
Reserve Zone 7
CAL=3
O1$="Delete Bobs"
O2$="Delete Icons"
O3$="Paste Bob"
O4$="Paste Icon"
O5$="Insert Bob"
O6$="Insert Icon"
O7$="Bob Options"
Locate 2,1 : Print Zone$(O1$,1)
Locate 20,1 : Print Zone$(O2$,2)
Locate 40,1 : Print Zone$(O3$,3)
Locate 60,1 : Print Zone$(O4$,4)
Locate 2,2 : Print Zone$(O5$,5)
Locate 20,2 : Print Zone$(O6$,6)
Locate 40,2 : Print Zone$(O7$,7)
Return
'
VAR:
Gosub DRA
CAL=5
Return
'
RAM:
If CAL>=6 and CAL<=FR
Close 1
Gosub DRA
Locate 2,1 : Input "Save to Df0:?";A$
A$=Lower$(A$)
If A$="y"
Open In 1,"RAM:Monitor.Dat"
L=Lof(1)
Close 1
Reserve As Work 16,L
Bload "RAM:Monitor.Dat",Start(16)
Bsave "Df0:Monitor.Dat",Start(16) To Start(16)+Length(16)
Erase 16
End If
Kill "RAM:Monitor.Dat"
CAL=1
Return
Else
Gosub DRA
Open Out 1,"RAM:Monitor.Dat"
Centre At(,1)+"Sending data to RAM...."
CAL=6
End If
Return
'
COORD:
Gosub DRA
CAL=2
Return
'
HID:
Screen Display 7,130,-50,640,40
Gosub DRA
CAL=0
Return
'
CLO:
Screen Close 7
CAL=0 : OPEN=0
Return
'
ABOUT:
Gosub DRA
Locate 2,1 : Print "AMOS Monitor. V1.0 : Written by Ben Ashley, 1992"
Locate 2,2 : Print "- - - - - - - - - - - - - - - - - - - - - - - - -"
Locate 2,3 : Print "Use Menu's to control monitor. See Docs for more info!"
CAL=1
Return
'
COMB:
Gosub DRA
Locate 2,1 : Input "Object Number:";OB
Gosub DRA
Locate 2,1 : Input "Block Number:";BL
Gosub DRA
Locate 2,1 : Input "Colour Combination:";COM
Gosub DRA
Extension_4_05E2 OB,BL,COM
Return
'
PRAGMA:
Gosub DRA
Locate 2,1 : Input "Object:";OB
Gosub DRA
Locate 2,1 : Input "Pragma:";PRAG
Gosub DRA
Extension_4_05B8 OB,PRAG
Return
'
PRIOR:
Gosub DRA
Locate 2,1 : Input "Object:";OB
Gosub DRA
Locate 2,1 : Input "Priority:";PRI
Gosub DRA
Extension_4_058A OB,PRI
Return
'
MAPINFO:
Gosub DRA
Locate 2,1 : Print "X Size:"; Extension_7_00BC
Locate 20,1 : Print "Y Size:"; Extension_7_00C8
CAL=1
Return
'
VACOORD:
Gosub DRA
If CAL=1
CAL=4
End If
Return
'
DRA:
Cls 0
Box 0,0 To 639,39
Return
'
_AREG:
Gosub DRA
CAL=17
Return
'
_DREG:
Gosub DRA
CAL=18
Return
'
DATETIME:
Gosub DRA
CAL=19
Return
'
RAMFRAMES:
Gosub DRA
Locate 2,1
Input "Update RAM DISK every:";FR
If FR>9
FR=9
End If
CAL=1
Return
'
_BOB:
CAL=21
Gosub DRA
Reserve Zone 5
K$="Bob On"
K2$="Bob Off"
K3$="Set X & Y"
K4$="Set Image"
K5$="Chg Number"
Locate 2,1 : Print Zone$(K$,1)
Locate 20,1 : Print Zone$(K2$,2)
Locate 40,1 : Print Zone$(K3$,3)
Locate 60,1 : Print Zone$(K4$,4)
Locate 2,2 : Print Zone$(K5$,5)
Return
'
GTBOB:
Gosub DRA : Locate 2,1
Input "Bob Number:";BN
CAL=21 : Gosub _BOB
Return
'
ERRO:
Resume Next
'
DATE:
T$=Space$(12)
Dreg(1)=Varptr(T$)
RIEN=Doscall(-192)
NJ=Leek(Varptr(T$))
A=1978 : JOUR=7
Do
BIS=0 : If(A and 3)=0 : BIS=1 : End If
Exit If NJ-365-BIS<0
Add JOUR,1+BIS : If JOUR>7 : Add JOUR,-7 : End If
Add NJ,-365-BIS
Inc A
Loop
M=1
Do
Read N
Exit If NJ-N<0
Add NJ,-N : Inc M
Loop
Inc NJ
J$=Mid$(Str$(NJ),2) : If Len(J$)<2 : J$="0"+J$ : End If
M$=Mid$(Str$(M),2) : If Len(M$)<2 : M$="0"+M$ : End If
A$=Mid$(Str$(A),2)
DATE$=J$+"-"+M$+"-"+A$
Data 31,28+BIS,31,30,31,30,31,31,30,31,30,31
Return
'
TIME:
T$=Space$(12)
Dreg(1)=Varptr(T$)
RIEN=Doscall(-192)
MN=Leek(Varptr(T$)+4)
SEC=Leek(Varptr(T$)+8)
H=MN/60 : H$=Mid$(Str$(H),2) : If Len(H$)<2 : H$="0"+H$ : End If
M=MN mod 60 : M$=Mid$(Str$(M),2) : If Len(M$)<2 : M$="0"+M$ : End If
S=SEC/50 : S$=Mid$(Str$(S),2) : If Len(S$)<2 : S$="0"+S$ : End If
TIME$=H$+":"+M$+":"+S$
Return
'
End Proc