'
'          AMOS Utility Help.accessory V1.0                  
'                   by Ivor King 
'
'    Read the DOCS on disk for more information
'
Screen Close 0 : Screen Open 0,640,260,16,Hires
Colour 1,3
Curs Pen 1
Pen 4
Cdown 
Colour 9,3905
Colour 10,1179
Colour 11,1274
Under On 
Pen 10
Centre "AMOS Utility Help.accessory V1.0"
Under Off 
Pen 5
Locate 0,3
Centre "by Ivor King"
Cdown : Cdown : Cdown : Cdown 
Pen 9
Centre "MAIN MENU:"
Pen 2
Locate 0,10
Print "                         1  -  Co-ordinate & Ascii Monitor V1.2"
Cdown 
Print "                         2  -  Colour Monitor V1.1"
Cdown 
Print "                         3  -  Pixel Reader V1.1"
Cdown 
Print "                         4  -  MiniUtils V1.0"
Cdown 
Cdown 
Print "                    RETURN  -  Quit"
Cdown 
Cdown : Cdown : Cdown 
Pen 11
Print "This menu may be activated at any time by simply pressing 'HELP'"
Cdown 
Pen 4
Print "Read the DOCS on disk for more information"
Pen 2
Locate 0,29
Print "Now press the key of your choice..."
STAT:
   Repeat 
      K$=Inkey$
   Until K$<>""
   If K$="1"
      Goto COAMV1_2
   Else 
      If K$="2"
         Goto COMV1_1
      Else 
         If K$="3"
            Goto PIXELREADERV1_1
         Else 
            If K$="4"
               Goto MIUTILSV1_0
            Else 
               If Asc(K$)=13
                  Screen Close 0
                  Edit 
               Else 
                  Goto STAT
               End If 
            End If 
         End If 
      End If 
   End If 
End 
'
'
'
'
MIUTILSV1_0:
'
'
'                MiniUtils V1.0
'                 by Ivor King 
'              
'   Read the DOCS on disk for more information 
'
Global O,CLOS_WORKBENCH
Screen Open 0,640,260,16,Hires
Colour 1,3
Curs Pen 1
CLOS_WORKBENCH=False
STAAT:
   MENU
   BAT:
      If O=1
         LD
         Goto STAAT
      Else 
         If O=2
            CD
            Goto STAAT
         Else 
            If O=3
               RF
               Goto STAAT
            Else 
               If O=4
                  FM
                  Goto STAAT
               Else 
                  If O=5
                     RFDS
                     Goto STAAT
                  Else 
                     If O=6
                        DFFD
                        Goto STAAT
                     Else 
                        If O=7
                           LDP
                           Goto STAAT
                        Else 
                           If O=8 and CLOS_WORKBENCH=False
                              Close Workbench 
                              CLOS_WORKBENCH=True
                              Goto STAAT
                           Else 
                              If O=9
                                 Screen Close 0
                                 Edit 
                              Else 
                                 Goto STAAT
                              End If 
                           End If 
                        End If 
                     End If 
                  End If 
               End If 
            End If 
         End If 
      End If 
'
Procedure MENU
   Cls 
   Under On 
   Cdown 
   Pen 14
   Centre "MiniUtils V1.0"
   Pen 5
   Under Off 
   Cdown 
   Cdown 
   Centre "by Ivor King 13/7/92"
   Pen 2
   Home 
   Locate 0,7
   If CLOS_WORKBENCH=False
      Print "          1 - List directory                 5 - Show free disk space"
      Print "          2 - Create a directory             6 - Delete a file from disk"
      Print "          3 - Rename a file                  7 - List disk info to printer"
      Print "          4 - Show free memory               8 - Close workbench"
      Print "          9 - Quit"
   Else 
      Print "          1 - List directory                 5 - Show free disk space"
      Print "          2 - Create a directory             6 - Delete a file from disk"
      Print "          3 - Rename a file                  7 - List disk info to printer"
      Print "          4 - Show free memory               9 - Quit"
   End If 
   Cdown : Cdown 
   Input "Enter your option: ";O
End Proc
'
Procedure LD
   On Error Goto ABORTED
   Cls 
   Print "Note: press SPACE to halt listing or restart it again"
   Input "Enter path: ";P$
   Dir P$
   Pen 5
   Print "MB to continue..."
   Repeat : Until Mouse Key
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure CD
   On Error Goto ABORTED
   Cls 
   Input "Enter directory to create, and its path: ";D$
   Mkdir D$
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure RF
   On Error Goto ABORTED
   Cls 
   Input "Enter name of old file: ";N1$
   Input "Enter new name for file: ";N2$
   Rename N1$ To N2$
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure RFDS
   On Error Goto ABORTED
   Cls 
   SPACEFREE=Dfree
   Print "Free space on disk (in bytes):";SPACEFREE
   Pen 5
   Print "MB to continue..."
   Repeat : Until Mouse Key
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure DFFD
   On Error Goto ABORTED
   Cls 
   Input "Enter file to be deleted: ";DF$
   Kill DF$
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure LDP
   On Error Goto ABORTED
   Cls 
   Input "Enter path you want listed: ";L$
   Input "Do you want free disk space also listed? (RETURN;yes/n;no): ";SPAC$
   Pen 4
   Print "Make sure your printer is READY, or the computer will FREEZE UP!"
   Pen 2
   Print "Use preferences to alter printer options"
   Pen 5
   Print "MB to continue..."
   Repeat : Until Mouse Key
   Ldir L$
   DF=Dfree
   If SPAC$=""
      Lprint "Free disk space:";DF
   Else 
      If SPAC$="y"
         Lprint "Free disk space:";DF
      Else 
         If SPAC$="yes"
            Lprint "Free disk space:";DF
         Else 
         End If 
      End If 
   End If 
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
Procedure FM
   On Error Goto ABORTED
   Cls 
   CF=Chip Free
   Print "Total chip memory presently free:";CF
   Pen 5
   Print "MB to continue..."
   Repeat : Until Mouse Key
   Goto FINI
   ABORTED:
      Cls 
      Locate 0,12
      Pen 4
      Centre "Error encountered - Task aborted !"
      Cdown : Cdown 
      Pen 5
      Centre "MB to continue..."
      Repeat : Until Mouse Key
      Pen 2
      Resume Next 
   FINI:
End Proc
'
'
'
'
PIXELREADERV1_1:
'
'
'                  Pixel Reader V1.1 
'                    by Ivor King
'
'      Read the DOCS on disk for more information
'
Screen Close 0
Global COOL,F$,DY,MOUSE,LEED
MOUSE=2
LEED=False
DY=289
Change Mouse MOUSE
Screen Open 1,640,20,16,Hires
Colour 1,0 : Curs Pen 0 : Writing 0 : Curs Off 
Screen Display 1,143,DY,640,10
Home 
Pen 4
Print ">> PIXEL READER V1.0 <<"
Locate 27,0
Pen 8
Print "by Ivor King... press HELP for info (MB to continue)"
Repeat : Until Mouse Key : Cls 
LODER
Home 
Pen 5
Print "Colour:"
Locate 15,0
Print "Register:"
Locate 32,0
Print "Total scr cols:"
Locate 57,0
Print "Free:"
Locate 72,0
Pen 6
Print "King\92"
Pen 2
SCR_SETUP
Do 
   Repeat 
      K$=Inkey$
      If K$<>""
         If K$="p"
            Lprint "Colour value: ";C;"       Present register: ";U
         Else 
            Gosub HELPME
         End If 
      End If 
   Until Mouse Key
   Screen 0
   X=X Mouse
   Y=Y Mouse
   XM=X Screen(X)
   YM=Y Screen(Y)
   U=Point(XM,YM)
   C=Colour(U)
   Screen 1
   Home 
   Locate 7,0
   Print C;"   "
   Locate 24,0
   Print U;"   "
Loop 
HELPME:
   If Asc(K$)=0 Then INFO
   If K$="l"
      Screen 0
      LODER
      If F$<>""
         SCR_SETUP
      End If 
   End If 
   If K$="m" Then MOUSE_CHANGE
   If Asc(K$)=31 Then SCR_DOWN
   If Asc(K$)=30 Then SCR_UP
   If K$="q" Then FINALE_ROUTINE
Return 
'  
Procedure LODER
   On Error Goto ROP
   WAL:
      F$=Fsel$("","","Select an IFF picture","(e.g. the type used by Deluxe Paint)")
      If F$="" and LEED=False
         Screen Close 1
         Edit 
      End If 
      If F$="" and LEED=True Then Goto NOB
      Load Iff F$,0
      Limit Mouse 0,0 To 700,600
      Screen 0
      COOL=Screen Colour
      Goto NOB
   ROP:
      Screen 1 : Cls : Pen 2 : Home : Print "Choose an IFF picture!"
      Pen 4 : Locate 62,0 : Print "(MB to try again)"
      Repeat : Until Mouse Key
      Cls 
      Resume WAL
   NOB:
      Screen 1
      Screen To Front 1
      LEED=True
End Proc
'
Procedure SCR_SETUP
   Screen 1
   Locate 8,0
   Print "0    "
   Locate 25,0
   Print "0    "
   Locate 47,0
   Pen 2
   Print COOL;"   "
   Pen 2
   Locate 62,0
   Print Chip Free
End Proc
'
Procedure INFO
   Screen Hide 0
   DY=289
   Screen Display 1,143,DY,640,10
   Screen Open 3,320,200,32,Lowres
   Colour 1,0
   Curs Off 
   Screen To Front 3
   Screen 3
   Wind Open 1,40,40,30,16,1
   Colour 1,3
   Curs Pen 1
   Colour 4,4085
   Colour 5,3618
   Colour 7,3725
   Colour 6,2446
   Colour 11,15
   Pen 4
   Under On 
   Centre "Help and Information"
   Under Off 
   Cdown : Cdown : Cdown 
   Pen 7
   Centre "PIXEL READER V1.0"
   Cdown : Cdown 
   Pen 5
   Centre "by Ivor King" : Cdown 
   Centre "completed 13/7/92"
   Cdown : Cdown 
   Pen 6
   Centre "Please spread this disk"
   Cdown : Centre "around as much as possible"
   Cdown : Centre "It is Public Domain, and was"
   Centre "programmed in"
   Pen 5 : Cdown 
   Centre "AMOS"
   Repeat : Until Mouse Key
   Clw 
   Pen 4
   Under On 
   Home 
   Print "Keypress..."
   Under Off 
   Cdown 
   Pen 6
   Centre "`p' - print colour stats"
   Cdown : Centre "`m' - change mouse type"
   Cdown : Centre "`l' - load another picture"
   Cdown : Centre "HELP - help and info (this)"
   Cdown : Centre "Up Arrow - move info bar up"
   Cdown : Centre "Down Arrow - move it down"
   Cdown : Centre "`q' - to quit"
   Cdown : Cdown 
   Repeat : Wait 2 : Until Mouse Key
   Clw 
   Pen 4
   Cdown : Cdown : Cdown 
   Centre "NOTE: if you press `p', to"
   Cdown : Centre "print a value to the"
   Cdown : Centre "printer, make sure your"
   Cdown : Centre "printer is READY, or the"
   Cdown : Centre "computer will FREEZE UP!"
   Repeat 
      Wait 2
   Until Mouse Key
   Clw 
   Pen 5
   Cdown : Cdown : Cdown 
   Centre "Read the DOCS on disk "
   Cdown : Centre "for more info, and please"
   Cdown : Centre "make sure they STAY on the"
   Cdown : Centre "disk with THIS PROGRAM!"
   Repeat 
      Wait 2
   Until Mouse Key
   Clw 
   Pen 4
   Centre "Contact me at:"
   Cdown : Centre "23 Waterford ave. Waterford"
   Cdown : Centre "W.A. 6152, ph. (09) 4505495"
   Cdown : Cdown 
   Pen 11
   Centre "I hope you find this program"
   Cdown : Centre "very useful!"
   Cdown : Cdown : Cdown : Centre "MB to go on..."
   Repeat 
      Wait 2
   Until Mouse Key
   Wind Close 
   Screen Close 3
   Screen Show 0
End Proc
'
Procedure SCR_UP
   If DY-10>35
      DY=DY-10
      Screen Display 1,143,DY,640,10
   End If 
End Proc
'
Procedure MOUSE_CHANGE
   If MOUSE+1=4
      MOUSE=0
   End If 
   Inc MOUSE
   Change Mouse MOUSE
End Proc
'
Procedure SCR_DOWN
   If DY+10<299
      DY=DY+10
      Screen Display 1,143,DY,640,10
   End If 
End Proc
'
Procedure FINALE_ROUTINE
   Screen Close 1
   If LEED Then Screen Close 0
   Edit 
End Proc
'
'
'
'
COMV1_1:
'
'
'               Colour Monitor V1.1  
'                  by Ivor King  
'
' Read the DOCS on this disk for more information
'
Hide 
Global TIME,REGMODE,GRAND$,R,RREG,C
TIME=70
REGMODE=False
RREG=1
Screen Close 0
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 Screen Close 4 : Screen Close 2 : Screen Close 3 : Screen Close 1 : Edit 
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
'
'
'
'
COAMV1_2:
'
'
'         Co-ordinate and Ascii Monitor V1.2 
'                  by Ivor King  
'
'     Read the DOCS on disk for more information 
'
Screen Close 0
Screen Open 2,640,300,16,Hires
Screen Open 1,640,300,16,Hires
Curs Off 
Colour 1,0
Screen 2
Get Palette 1
Curs Off 
Screen Copy 2,0,0,640,300 To 1,0,0
Screen 1
Screen To Front 1
Colour 1,0
Limit Mouse 0,0 To 700,500
Global NOB,LEG,KSA,RES$,ODE,TE$,COMREG,OPREG,PREG,F$,OVEREG,SUBB,PLOC
COMREG=True
RES$="med"
LEG=False
SCOB=2
PLOC=2
NOB=2
ODE=0
PREG=False
OPREG=2
SUBB=2
Curs Off 
Writing ODE
MENU_INIT
MENU_ACT
On Menu Goto MEBDU
Change Mouse 2
BEGINNING:
   Under On 
   Pen 5
   If RES$="med"
      Centre "Co-ordinate & Ascii Monitor V1.2"
   End If 
   Under Off : Cdown 
   Pen 10
   If RES$="med"
      Centre "by Ivor King"
   End If 
   If RES$="med"
      SETUP_MED
   Else 
      SETUP_LOW
   End If 
   GOGGLE:
      Pen 4
      On Menu On 
      Do 
         XH=X Mouse
         YH=Y Mouse
         XS=X Screen(XH)
         YS=Y Screen(YH)
         XT=X Text(XS)
         YT=Y Text(YS)
         MC=Mouse Key
         K$=Inkey$
         If K$=" " Then Locate XT,YT : Print "          "
         If RES$="med"
            KSA=Asc(K$)
            If K$<>""
               If KSA<>13
                  If KSA<>0
                     If KSA<>9
                        Locate 6,29 : Print K$ : Locate 6,30 : Print KSA;"  "
                     Else 
                        Locate 6,29 : Print "  " : Locate 6,30 : Print KSA;"  "
                     End If 
                  Else 
                     Locate 6,29 : Print "  " : Locate 6,30 : Print KSA;"  "
                  End If 
               Else 
                  Locate 6,29 : Print "  " : Locate 6,30 : Print KSA;"  "
               End If 
            End If 
         End If 
         If XS>631
            OVEREG=True
         Else 
            OVEREG=False
         End If 
         If MC=1
            Writing ODE
            If OPREG=1 and OVEREG=False
               Plot XS,YS,PLOC
               Pen 11
               Locate XT+1,YT
               Print XH;" ";YH
               If LEG
                  Lprint "HARD:  ";XH;" ";YH
               End If 
               Pen 4
            Else 
               If OPREG=2 and OVEREG=False
                  Plot XS,YS,PLOC
                  Pen 12
                  Locate XT+1,YT
                  Print XS;" ";YS
                  If LEG
                     Lprint "SCREEN:  ";XS;" ";YS
                  End If 
                  Pen 4
               Else 
                  If PREG and OVEREG=False
                     Pen PLOC
                     Locate XT,YT
                     Print "#"
                     Pen 14
                     Locate XT+1,YT
                     Print XT;" ";YT
                     If LEG
                           Lprint "TEXT:  ";XT;" ";YT
                     End If 
                     Pen 4
                  Else 
                     If OVEREG=False
                        Plot XS,YS,PLOC
                        Pen 14
                        Locate XT+1,YT
                        Print XT;" ";YT
                        If LEG
                           Lprint "TEXT:  ";XT;" ";YT
                        End If 
                        Pen 4
                     End If 
                  End If 
               End If 
            End If 
         End If 
         Writing 0
         If RES$="med"
            Locate 10,31
            Print XH;" "
            Locate 18,31
            Print YH;" "
            Locate 38,31
            Print XS;" "
            Locate 46,31
            Print YS;" "
            Locate 63,31
            If XT>0
               Print XT;" "
            End If 
            Locate 71,31
            If YT>0
               Print YT;" "
            End If 
         Else 
            Locate 5,31
            Print XH;" "
            Locate 9,31
            Print YH;" "
            Locate 18,31
            Print XS;" "
            Locate 22,31
            Print YS;" "
            Locate 31,31
            If XT>0
               Print XT;" "
            End If 
            Locate 34,31
            If YT>0
               Print YT;" "
            End If 
         End If 
      Loop 
MEBDU:
   Pen 2
   If Choice(2)=10 Then PRNT : Goto GOGGLE
   If Choice(2)=15 Then Screen Close 1 : Screen Close 2 : Edit 
   If Choice(2)=12 Then WB : Goto GOGGLE
   If Choice(2)=14 Then SCR_CHANGE : Goto BEGINNING
   If Choice(2)=9 Then CLEP : Goto BEGINNING
   If Choice(2)=2 Then OPTIONS : Goto GOGGLE
   If Choice(2)=3 Then INFOD : Goto GOGGLE
   If Choice(2)=4 Then Cls : Screen Copy 2,0,0,640,300 To 1,0,0 : Goto BEGINNING
   If Choice(2)=1 Then HAP : Goto GOGGLE
   If Choice(2)=11 Then COMM : Goto GOGGLE
   If Choice(3)=1 or 2 or 3 or 4 or 5 Then Goto LOP
PIX:
   If Choice(3)=1 Then Goto PIX1
   If Choice(3)=2 Then Goto PIX2
PIX2:
   TE$="Low resolution"
   If COMREG
      WIPEOUT
   End If 
   F$=Fsel$("","","Load a Lowres IFF picture","(MUST be medres or lowres only!)")
   If F$<>""
      Cls 
      Screen 2
      Cls 
      If RES$="med"
         COPIER_LOW
         Screen 2
      End If 
      Load Iff F$,2
      Get Palette 1
      Screen Copy 2,0,0,640,300 To 1,0,0
      Screen 1
      Screen To Front 1
      If RES$="med"
         Menu Base 0,0
         Menu$(1,14)="Medres"
      End If 
      RES$="low"
      Goto BEGINNING
   Else 
      Goto GOGGLE
   End If 
PIX1:
   TE$="Medium resolution"
   If COMREG
      WIPEOUT
   End If 
   F$=Fsel$("","","Load a Medres IFF picture","(MUST be medres or lowres only!)")
   If F$<>""
      Cls 
      Screen 2
      Cls 
      If RES$="low"
         COPIER_MED
         Screen 2
      End If 
      Load Iff F$,2
      Get Palette 1
      Screen Copy 2,0,0,640,300 To 1,0,0
      Screen 1
      Screen To Front 1
      If RES$="low"
         Menu Base 0,0
         Menu$(1,14)="Lowres"
         On Menu Goto MEBDU
      End If 
      RES$="med"
      Goto BEGINNING
   Else 
      Screen 1
      Goto GOGGLE
   End If 
LOP:
   If Choice(2)=5 Then LEP1 : Goto GOGGLE
   If Choice(2)=8 Then CLOS : Goto GOGGLE
   If Choice(2)=6 Then Goto PIX
   If Choice(2)=13 Then SCRAP : Goto GOGGLE
   LEP2
   Goto GOGGLE
'
Procedure CLOS
   If Choice(3)=1
      PLOC=4
      Menu Inactive(1,8,1)
      Menu Active(1,8,NOB)
      NOB=1
   Else 
      If Choice(3)=2
         PLOC=2
         Menu Inactive(1,8,2)
         Menu Active(1,8,NOB)
         NOB=2
      Else 
         If Choice(3)=3
            PLOC=0
            Menu Inactive(1,8,3)
            Menu Active(1,8,NOB)
            NOB=3
         Else 
            If Choice(3)=4
               PLOC=6
               Menu Inactive(1,8,4)
               Menu Active(1,8,NOB)
               NOB=4
            Else 
               PLOC=5
               Menu Inactive(1,8,5)
               Menu Active(1,8,NOB)
               NOB=5
            End If 
         End If 
      End If 
   End If 
End Proc
'
Procedure LEP1
   If Choice(3)=1
      Menu Inactive(1,5,1)
      Menu Active(1,5,OPREG)
      OPREG=1
   Else 
      If Choice(3)=2
         Menu Inactive(1,5,2)
         Menu Active(1,5,OPREG)
         OPREG=2
      Else 
         Menu Inactive(1,5,3)
         Menu Active(1,5,OPREG)
         OPREG=3
      End If 
   End If 
End Proc
'
Procedure LEP2
   If Choice(3)=1
      Change Mouse 1
      Menu Inactive(1,7,1)
      Menu Active(1,7,SUBB)
      SUBB=1
   Else 
      If Choice(3)=2
         Change Mouse 2
         Menu Inactive(1,7,2)
         Menu Active(1,7,SUBB)
         SUBB=2
      Else 
         Change Mouse 3
         Menu Inactive(1,7,3)
         Menu Active(1,7,SUBB)
         SUBB=3
      End If 
   End If 
End Proc
'
Procedure SETUP_MED
   Pen 2
   Locate 0,29 : Print "CHAR:"
   Locate 0,30 : Print "ASCII:"
   Locate 0,31 : Pen 11 : Print "<" : Pen 2
   Locate 1,31
   Print "HARD" : Pen 11 : Locate 5,31 : Print ">" : Pen 2
   Locate 8,31
   Print "X:"
   Locate 16,31
   Print "Y:"
   Locate 26,31 : Pen 12 : Print "<" : Pen 2
   Locate 27,31
   Print "SCREEN" : Pen 12 : Locate 33,31 : Print ">" : Pen 2
   Locate 36,31
   Print "X:"
   Locate 44,31
   Print "Y:"
   Locate 53,31 : Pen 13 : Print "<" : Pen 2
   Locate 54,31
   Print "TEXT" : Pen 13 : Locate 58,31 : Print ">" : Pen 2
   Locate 61,31
   Print "X:"
   Locate 69,31
   Print "Y:"
End Proc
'
Procedure SETUP_LOW
   Pen 2
   Locate 2,31 : Pen 11 : Print "<" : Pen 2
   Locate 3,31 : Print "H" : Locate 4,31 : Pen 11 : Print ">"
   Locate 15,31 : Pen 12 : Print "<" : Pen 2
   Locate 16,31 : Print "S" : Locate 17,31 : Pen 12 : Print ">"
   Locate 28,31 : Pen 13 : Print "<" : Pen 2 : Locate 29,31 : Print "T"
   Locate 30,31 : Pen 13 : Print ">" : Pen 2
End Proc
'
Procedure COPIER_LOW
   Screen Close 2
   Screen Close 1
   Screen Open 2,320,270,64,Lowres
   Colour 1,0
   Curs Off 
   Screen Open 1,320,270,64,Lowres
   Colour 1,0
   Curs Off 
End Proc
'
Procedure COPIER_MED
   Screen Close 2
   Screen Close 1
   Screen Open 2,640,300,16,Hires
   Colour 1,0
   Curs Off 
   Screen Open 1,640,300,16,Hires
   Colour 1,0
   Curs Off 
End Proc
'
Procedure WIPEOUT
   If RES$="low"
      Screen Open 3,600,300,16,Hires
      Screen To Front 3
      Colour 1,0
   Else 
      Wind Save 
   End If 
   Wind Open 3,70,70,60,16,1
   Curs Off 
   Pen 11
   Print " You have chosen to load a ";TE$;" screen." : Cdown 
   Cdown : Centre "Note: if you choose something that IS NOT a medres or"
   Cdown : Centre "lowres screen with the correct co-ords, it will NOT be"
   Cdown : Centre "Loaded!" : Cdown 
   Centre "This option deletes EVERYTHING on the screen !"
   Cdown : Centre "Your picture will be loaded into the current"
   Cdown : Centre "screen colours."
   Cdown : Centre "It's O.K. to load a lowres picture into a medres"
   Cdown : Centre "screen or vice versa, but its appearance will change"
   Cdown : Centre "Select quit to abort loading. MB to continue."
   Repeat : Until Mouse Key
   Wind Close 
   If RES$="low"
      Screen 1
      Screen To Front 1
      Screen Close 3
   End If 
End Proc
'
Procedure MENU_INIT
   Menu$(1)="Options"
   Menu$(1,2)="Help"
   Menu$(1,3)="Credits"
   Menu$(1,6)="Load iff         =>"
   Menu$(1,7)="Mouse type       =>"
   Menu$(1,14)="Lowres"
   Menu$(1,15)="Quit"
   Menu$(1,1)="Plot hash"
   Menu$(1,4)="Clear"
   Menu$(1,13)="Screen output    =>"
   Menu$(1,13,1)="REPLACE"
   Menu$(1,13,2)="OR"
   Menu$(1,13,3)="XOR"
   Menu$(1,13,4)="AND"
   Menu$(1,5)="Co-ord type      =>"
   Menu$(1,5,1)="Hard"
   Menu$(1,12)="Close Workbench"
   Menu$(1,10)="Printer output  OFF"
   Menu$(1,11)="Comm screens     ON"
   Menu$(1,5,2)="Screen"
   Menu$(1,5,3)="Text"
   Menu$(1,8)="Point colour     =>"
   Menu$(1,7,1)="Pointer"
   Menu$(1,7,2)="Crosshair"
   Menu$(1,7,3)="Clock"
   Menu$(1,8,1)="Red"
   Menu$(1,8,2)="White"
   Menu$(1,8,3)="Black"
   Menu$(1,9)="Clear All/New"
   Menu$(1,8,4)="Blue"
   Menu$(1,8,5)="Green"
   Menu$(1,6,1)="Medres"
   Menu$(1,6,2)="Lowres"
   Menu Static(1)
   Menu Static(1,1)
   Menu Static(1,8,1)
   Menu Static(1,6,1)
   Menu Static(1,5,1)
   Menu Static(1,7,1)
   Menu Static(1,13,1)
   Menu On 
End Proc
'
Procedure MENU_ACT
   Menu Inactive(1,5,2)
   Menu Inactive(1,7,2)
   Menu Inactive(1,8,2)
   Menu Inactive(1,13,1)
End Proc
'
Procedure OPTIONS
   If RES$="low"
      Screen Open 3,600,300,16,Hires
      Screen To Front 3
      Colour 1,0
   Else 
      Wind Save 
   End If 
   Wind Open 2,70,70,60,16,1
   Curs Off 
   Pen 6
   Centre "Help"
   Cdown : Pen 11
   Centre "SPACE to delete individual co-ordinates" : Cdown 
   Centre "Select 'Close Workbench' to save memory" : Cdown 
   Centre "Select 'plot hash' from the menu to plot # symbols" : Cdown 
   Centre "instead of points (in text co-ord mode only)" : Cdown 
   Centre "Select 'Lowres' to go switch to Lowres mode" : Cdown 
   Centre "'Comm screens' toggles communications screens ON/OFF" : Cdown 
   Centre "'Clear' clears text, 'Clear All/New' clears everything" : Cdown 
   Centre "Left MB to plot a point and co-ords" : Cdown 
   Centre "Press any key to display its ascii code" : Cdown 
   Centre "the colours are as follows:" : Cdown 
   Pen 11 : Centre "dark green=> hardware co-ordinates " : Cdown 
   Pen 12 : Centre "beigey/brown=> screen/graphic co-ordinates" : Cdown 
   Pen 13 : Centre "dark blue/purple=> text co-ordinates "
   Repeat : Until Mouse Key
   Wind Close 
   If RES$="low"
      Screen 1
      Screen To Front 1
      Screen Close 3
   End If 
End Proc
'
Procedure INFOD
   If RES$="low"
      Screen Open 3,600,300,16,Hires
      Screen To Front 3
      Colour 1,0
   Else 
      Wind Save 
   End If 
   Wind Open 1,70,70,60,16,1
   Curs Off 
   Pen 6
   Centre "Weclome to COAMV1.2"
   Cdown 
   Centre "programmed in AMOS by Ivor King, completed 13/7/92"
   Cdown : Cdown : Pen 11
   Centre "This is public domain and can be freely distributed" : Cdown 
   Centre "and used by anyone." : Cdown 
   Centre "This program is mainly designed as a programming" : Cdown 
   Centre "aid for all those AMOSites out there, I hope" : Cdown 
   Centre "you find it useful !" : Cdown 
   Centre "you can contact me at:" : Cdown 
   Centre "23 Waterford avenue Waterford Perth W.A" : Cdown 
   Centre "6152 Australia" : Cdown 
   Centre "PLEASE, if you copy this program, copy the DOCS" : Cdown 
   Centre "WITH IT!.. Please spread it around!"
   Repeat : Until Mouse Key
   Wind Close 
   If RES$="low"
      Screen 1
      Screen To Front 1
      Screen Close 3
   End If 
End Proc
'
Procedure CLEP
   Screen 2
   Cls 
   Screen 1
   Cls 
End Proc
'
Procedure PRNT
   If LEG=False
      LEG=True
      Menu$(1,10)="Printer output   ON"
      If COMREG
         If RES$="low"
            Screen Open 3,600,300,16,Hires
            Screen To Front 3
            Colour 1,0
         Else 
            Wind Save 
         End If 
         Wind Open 3,70,70,60,16,1
         Curs Off 
         Cdown : Cdown : Cdown 
         Pen 3
         Centre "Make sure printer is READY "
         Pen 4
         Cdown : Centre "(or the computer will freeze up!)"
         Pen 2
         Cdown : Cdown 
         Centre "If it won't print properly, or the computer crashes," : Cdown 
         Centre "just alter the preferences to suit your printer"
         Cdown : Cdown 
         Centre "MB to continue"
         Repeat : Until Mouse Key
         Wind Close 
         If RES$="low"
            Screen 1
            Screen To Front 1
            Screen Close 3
         End If 
      End If 
   Else 
      LEG=False
      Menu$(1,10)="Printer output  OFF"
   End If 
End Proc
'
Procedure COMM
   If COMREG
      COMREG=False
      Menu$(1,11)="Comm Screens    OFF"
   Else 
      COMREG=True
      Menu$(1,11)="Comm Screens     ON"
   End If 
End Proc
'
Procedure HAP
   If PREG
      PREG=False
      Menu$(1,1)="Plot hash" : On Menu On 
   Else 
      PREG=True
      Menu$(1,1)="Plot points" : On Menu On 
   End If 
End Proc
'
Procedure WB
   Close Workbench 
   Menu$(1,12)="Workbench closed"
   Menu Inactive(1,12)
End Proc
'
Procedure SCR_CHANGE
   If RES$="med"
      COPIER_LOW
      Screen 1
      Screen To Front 1
      Menu Base 0,0
      Menu$(1,14)="Medres"
      RES$="low"
   Else 
      COPIER_MED
      Screen 1
      Screen To Front 1
      Menu Base 0,0
      Menu$(1,14)="Lowres"
      RES$="med"
   End If 
End Proc
'
Procedure SCRAP
   If Choice(3)=1
      Menu Active(1,13,ODE+1)
      Menu Inactive(1,13,1)
      ODE=0
   Else 
      If Choice(3)=2
         Menu Active(1,13,ODE+1)
         Menu Inactive(1,13,2)
         ODE=1
      Else 
         If Choice(3)=3
            Menu Active(1,13,ODE+1)
            Menu Inactive(1,13,3)
            ODE=2
         Else 
            Menu Active(1,13,ODE+1)
            Menu Inactive(1,13,4)
            ODE=3
         End If 
      End If 
   End If 
End Proc
'
End 
'
'
'(C) 1992 KING Software
