home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
551-575
/
apd571
/
colourmonitorv1_1.amos
/
colourmonitorv1_1.amosSourceCode
Wrap
AMOS Source Code
|
1994-01-01
|
14KB
|
530 lines
'
' Colour Monitor V1.1
' by Ivor King
'
' Read the DOCS on this disk for more information
'
'Screen Close 0
Break Off
Hide
Global TIME,REGMODE,GRAND$,R,RREG,C
TIME=70
REGMODE=False
RREG=1
Screen Open 2,640,50,16,Hires
Colour 1,0
Curs Pen 0
Screen Open 3,640,48,16,Hires
Colour 1,0
Writing 0
Curs Pen 0
Pen 5
Screen Display 3,128,290,640,48
Screen Open 1,320,200,4096,Lowres
Screen Display 1,128,88,320,250
Colour 1,0
Curs Off
Pen 0
Screen Open 4,640,260,16,Hires
Colour 11,3816
Colour 14,191
Writing 0
Colour 1,3
Curs Pen 1
INROD
MENU_SETUP
SCR3_SETUP
CHOSE:
Screen 2
If Param=1
Screen Hide 4
DEMOMODE_A
MENU_SETUP
Goto CHOSE
Else
If Param=2
Screen Hide 4
DEMOMODE_B
MENU_SETUP
Goto CHOSE
Else
If Param=3
Screen Hide 4
MOUSE_MODE
MENU_SETUP
Goto CHOSE
Else
If Param=4
TIME_CHANGE
MENU_SETUP
Goto CHOSE
Else
If Param=5
CHECK_MODE
MENU_SETUP
Goto CHOSE
End If
End If
End If
End If
End If
Screen Hide 4
Screen 1
Screen To Back 4
Screen To Front 1
Screen To Front 2
Screen To Front 3
Screen 2
Cls
Print "You have entered normal mode... simply type in the value/register at the prompt:"
Pen 4 : Centre "hold down MB & press RETURN to return to menu"
Locate 0,4
Pen 2
Do
Screen 2
If REGMODE=False
BEGGER1:
Input "Enter value: ";X
If Mouse Key<>0
MENU_SETUP : Goto CHOSE
End If
If X>4096 or X<0
Print "Keep the value between 0 and 4096"
Goto BEGGER1
End If
R=X
Screen 1
Colour 1,R
Else
BEGGER2:
Input "Enter register: ";X
If Mouse Key<>0
MENU_SETUP : Goto CHOSE
End If
If X>4096 or X<0
Print "Keep the register between 0 and 4096"
Goto BEGGER2
End If
RREG=X
Screen 1
Cls RREG
End If
C=Colour(RREG)
Screen 3
Pen 5
Locate 73,0
Print RREG;" "
Locate 27,0
Print C;" "
GRAND$=Hex$(C)
GRAND$=GRAND$-"$"
LEG=Len(GRAND$)
Locate 13,0
If LEG=1
Print "$00";GRAND$
Else
If LEG=2
Print "$0";GRAND$
Else
Print "$";GRAND$
End If
End If
If LEG=1
Locate 40,0 : Print "$0"
Locate 50,0 : Print "$0"
Locate 59,0 : Print "$";GRAND$
Else
If LEG=2
Locate 40,0 : Print "$0"
Locate 50,0 : Print "$";GRAND$-Right$(GRAND$,1)
Locate 59,0 : Print "$";GRAND$-Left$(GRAND$,1)
Else
Locate 40,0 : Print "$";Left$(GRAND$,1)
Locate 50,0 : Print "$";Mid$(GRAND$,2,1)
Locate 59,0 : Print "$";Right$(GRAND$,1)
End If
End If
Loop
'
Procedure INROD
Under On
Colour 12,3743
Pen 12
Locate 0,1
Centre "COLOUR MONITOR VERSION 1.1 "
Under Off
Cdown : Cdown
Colour 13,3874
Pen 13
Centre "by Ivor King"
Pen 2
Cdown : Cdown : Cdown : Centre "This program is public domain and can be used by anyone."
Cdown : Cdown : Cdown : Centre "This program is designed mainly for AMOS programmers, to allow"
Cdown : Centre "them to test colour values and registers for use in their programs."
Cdown : Cdown : Centre "It was programmed in AMOS and completed on the 13/7/92."
Home : Locate 4,14 : Print "Instructions for use:"
Cdown : Centre "At the prompt 'Enter value' type in the colour's value"
Cdown : Centre "in either;"
Cdown : Cdown : Pen 4 : Centre "HEXADECIMAL or INTEGER form." : Cdown
Pen 2 : Cdown : Centre "(Note: hexadecimal numbers must be preceeded by a '$' sign) "
Cdown : Cdown : Centre "Read the DOCS on disk for more information, and if you copy this program,"
Cdown : Centre "PLEASE include them on your destination disk!"
Cdown : Cdown : Centre "I hope COMV1.1 is of some use to you."
Cdown : Cdown : Cdown : Pen 4 : Centre "MB to continue."
Repeat
Until Mouse Key
End Proc
'
Procedure MENU_SETUP
Screen 4
Screen To Front 4
Screen Show 4
Cls
Under On
Pen 12
Locate 0,1
Centre "M A I N M E N U :"
For Z=1 To 23
Cleft
Next Z
Locate 0,3
Pen 2 : Under Off
Cdown : Cdown : Print " 1 - for demo mode A"
Cdown : Cdown : Print " 2 - for demo mode B"
Cdown : Cdown : Print " 3 - for mouse mode"
Cdown : Cdown : Print " 4 - to change pause time for demo modes A & B"
Cdown : Cdown : Print " 5 - to toggle colour register/value mode"
Pen 11
Cdown : Cdown : Print " RETURN - default mode, as detailed on intro screen"
Pen 2
Cdown : Cdown : Print " 6 - to quit"
Locate 0,27
Pen 4
Print "(In mouse mode, make sure your printer is READY if you intend to print"
Print "or the computer will FREEZE UP!)"
Cdown
Pen 14
If REGMODE
MOOD$="COLOUR REGISTER mode"
Else
MOOD$="COLOUR VALUE mode"
End If
Locate 0,29
Print "You are currently in ";MOOD$
Pen 2
Input "Type your choice: ";CHOOSER
If CHOOSER=6 Then End
End Proc[CHOOSER]
'
Procedure DEMOMODE_A
Screen 1
Screen To Back 4
Screen To Front 1
Screen To Front 2
Screen To Front 3
Screen 2
Cls
Centre "You have entered demo mode A"
Cdown
Locate 0,2 : Print " The computer is randomly generating numbers between 1 and 4096"
Cdown
Pen 4 : Centre "Press any key to return to menu" : Pen 2
Screen 3
Wait TIME
Do
Screen 1
R1=Rnd(4096)
K$=Inkey$
If K$<>"" Then Pop Proc
Colour 1,R1
C=Colour(1)
Screen 3
Pen 5
Locate 27,0
Print C;" "
GRAND$=Hex$(C)
GRAND$=GRAND$-"$"
LEG=Len(GRAND$)
Locate 13,0
If LEG=1
Print "$00";GRAND$
Else
If LEG=2
Print "$0";GRAND$
Else
Print "$";GRAND$
End If
End If
If LEG=1
Locate 40,0 : Print "$0"
Locate 50,0 : Print "$0"
Locate 59,0 : Print "$";GRAND$
Else
If LEG=2
Locate 40,0 : Print "$0"
Locate 50,0 : Print "$";GRAND$-Right$(GRAND$,1)
Locate 59,0 : Print "$";GRAND$-Left$(GRAND$,1)
Else
Locate 40,0 : Print "$";Left$(GRAND$,1)
Locate 50,0 : Print "$";Mid$(GRAND$,2,1)
Locate 59,0 : Print "$";Right$(GRAND$,1)
End If
End If
Wait TIME
Loop
End Proc
'
Procedure DEMOMODE_B
Screen 1
Screen To Back 4
Screen To Front 1
Screen To Front 2
Screen To Front 3
Screen 2
Cls
Centre "You have entered demo mode B"
Cdown : Cdown : Centre "The computer is gradually incrementing the colour value by 1"
Cdown : Cdown
Pen 4 : Centre "Press any key to return to menu"
Pen 2
CREG=0
Do
Wait TIME
Screen 1
K$=Inkey$
If K$<>"" Then Pop Proc
Colour 1,CREG
C=Colour(1)
Screen 3
Pen 5
Locate 27,0
Print C;" "
CREG=CREG+1
If CREG=4096 Then CREG=0
GRAND$=Hex$(C)
GRAND$=GRAND$-"$"
LEG=Len(GRAND$)
Locate 13,0
If LEG=1
Print "$00";GRAND$
Else
If LEG=2
Print "$0";GRAND$
Else
Print "$";GRAND$
End If
End If
If LEG=1
Locate 40,0 : Print "$0"
Locate 50,0 : Print "$0"
Locate 59,0 : Print "$";GRAND$
Else
If LEG=2
Locate 40,0 : Print "$0"
Locate 50,0 : Print "$";GRAND$-Right$(GRAND$,1)
Locate 59,0 : Print "$";GRAND$-Left$(GRAND$,1)
Else
Locate 40,0 : Print "$";Left$(GRAND$,1)
Locate 50,0 : Print "$";Mid$(GRAND$,2,1)
Locate 59,0 : Print "$";Right$(GRAND$,1)
End If
End If
Loop
End Proc
'
Procedure TIME_CHANGE
Screen 4
Cls
Pen 2
Home
STONT:
Input "How long would you like the new pause to be (it is currently 70 computer seconds)? ";TIME
If TIME>300 or TIME<5 Then Print "Try again..." : Goto STONT
End Proc
'
Procedure MOUSE_MODE
Screen 1
Screen To Back 4
Screen To Front 1
Screen To Front 2
Screen To Front 3
Screen 2
Cls
Centre "You have entered mouse mode"
Cdown : Pen 4 : Cdown : Centre "Right MB to increase colour value/register by 1, Left MB to decrease it"
Cdown : Centre "`=' to increase value/register by 100, `-' to decrease it"
Cdown : Centre "`p' to print Hexadecimal, RGB, Integer and Register of the current colour"
Cdown
Pen 6
Centre "press any key to return to menu"
Do
LLOOP:
Repeat
K$=Inkey$
MK=Mouse Key
Until K$<>"" or MK<>0
If K$="p"
GRAND$=Hex$(C)
GRAND$=GRAND$-"$"
LEG=Len(GRAND$)
If LEG=1
Lprint "Hexadecimal: ";"$00";GRAND$;" Red: $0";" Green: $0";" Blue: $";GRAND$;" Integer:";C;" Register: ";RREG
Else
If LEG=2
Lprint "Hexadecimal: ";"$0";GRAND$;" Red: $0";" Green: $";GRAND$-Right$(GRAND$,1);" Blue: $";GRAND$-Left$(GRAND$,1);" Integer:";C;" Register: ";RREG
Else
Lprint "Hexadecimal: ";"$";GRAND$;" Red: $";Left$(GRAND$,1);" Green: $";Mid$(GRAND$,2,1);" Blue: $";Right$(GRAND$,1);" Integer:";C;" Register:";RREG
End If
End If
Goto LLOOP
End If
If REGMODE=False
If K$="-"
R=R-100
Goto LABEL1
Else
If K$="="
R=R+100
Goto LABEL1
Else
If K$<>""
Pop Proc
End If
End If
End If
Else
If K$="-"
If RREG-100>-1
RREG=RREG-100
Goto LABEL1
Else
Goto LLOOP
End If
Else
If K$="="
If RREG+100<4097
RREG=RREG+100
Goto LABEL1
Else
Goto LLOOP
End If
Else
If K$<>""
Pop Proc
End If
End If
End If
End If
LABEL1:
If REGMODE=False
If MK=1
R=R-1
Else
R=R+1
End If
Screen 1
Colour 1,R
Else
If MK=1
If RREG-1>-1
RREG=RREG-1
End If
Else
If RREG+1<4097
RREG=RREG+1
End If
End If
Screen 1
Cls RREG
End If
C=Colour(RREG)
Screen 3
Pen 5
Locate 73,0
Print RREG;" "
Locate 27,0
Print C;" "
GRAND$=Hex$(C)
GRAND$=GRAND$-"$"
LEG=Len(GRAND$)
Locate 13,0
If LEG=1
Print "$00";GRAND$
Else
If LEG=2
Print "$0";GRAND$
Else
Print "$";GRAND$
End If
End If
If LEG=1
Locate 40,0 : Print "$0"
Locate 50,0 : Print "$0"
Locate 59,0 : Print "$";GRAND$
Else
If LEG=2
Locate 40,0 : Print "$0"
Locate 50,0 : Print "$";GRAND$-Right$(GRAND$,1)
Locate 59,0 : Print "$";GRAND$-Left$(GRAND$,1)
Else
Locate 40,0 : Print "$";Left$(GRAND$,1)
Locate 50,0 : Print "$";Mid$(GRAND$,2,1)
Locate 59,0 : Print "$";Right$(GRAND$,1)
End If
End If
Loop
End Proc
'
Procedure CHECK_MODE
Screen 4
If REGMODE=False
Cls
Locate 0,5
Centre "You have now entered into register mode."
Cdown : Centre "This will give you the default colour value corresponding to the register"
Cdown : Centre "you type in at the prompt. These are the default colours"
Cdown : Centre "AMOS assigns to each register when a screen of the currently"
Cdown : Centre "used type is first opened."
Cdown : Cdown : Pen 4 : Centre "MB to continue."
Pen 2
Repeat : Until Mouse Key
REGMODE=True
Else
Cls
Locate 0,10
Centre "You have now exitted the register mode, and are back in normal mode"
Cdown : Cdown : Pen 4 : Centre "MB to continue."
Pen 2
Repeat : Until Mouse Key
REGMODE=False
RREG=1
Screen 1 : Cls 1
End If
End Proc
'
Procedure SCR3_SETUP
Screen 3
Pen 2
Home
Print "Hexadecimal:"
Locate 19,0
Print "Integer:"
Locate 35,0
Print "Red:"
Locate 43,0
Print "Green:"
Locate 53,0
Print "Blue:"
Locate 64,0
Print "Register:"
If REGMODE=False
Locate 74,0
Pen 5
Print "1"
End If
End Proc
'
End
'
'
'(C) 1992 KING Software