Advertisement
rgammans

Bars

Oct 4th, 2014
3,371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     1 ON ERROR PRINTREPORT$;" at line ";ERL:END
  2.     2
  3.     3 REM OLD Colours of historic interest only
  4.     4 DIM BarsLU%(16)
  5.     5   BarsLU%(0)=7
  6.     6   BarsLU%(1)=3
  7.     7   BarsLU%(2)=6
  8.     8   BarsLU%(3)=2
  9.     9   BarsLU%(4)=5
  10.    10   BarsLU%(5)=1
  11.    11   BarsLU%(6)=4
  12.    12   BarsLU%(7)=0
  13.    13   BarsLU%(8)=1
  14.    14   BarsLU%(9)=1
  15.    15   BarsLU%(10)=1
  16.    16   BarsLU%(11)=1
  17.    17   BarsLU%(12)=1
  18.    18   BarsLU%(13)=1
  19.    19   BarsLU%(14)=1
  20.    20   BarsLU%(15)=1
  21.    21
  22.    22
  23.    23 REM MODE MODE   :REM Reset Screen display. but leave in current mode.
  24.    24 CLG
  25.    25 OFF         :REM Turn off text cursor
  26.    26 :
  27.    27 REM The following four line read the current screen size co-ords.
  28.    28 SYS "OS_ReadModeVariable",-1,4 TO ,,XEigFactor%
  29.    29 SYS "OS_ReadModeVariable",-1,5 TO ,,YEigFactor%
  30.    30 SYS "OS_ReadModeVariable",-1,11 TO ,,XSize%:XSize%+=1
  31.    31 SYS "OS_ReadModeVariable",-1,12 TO ,,YSize%:YSize%+=1
  32.    32 :
  33.    33 REM Now calculate the satrting point and step size for 8x10 grid
  34.    34 endX%=XSize%<<XEigFactor%
  35.    35 XStep%=(XSize%/8)<<XEigFactor%
  36.    36 halfY%=(YSize%/3 )<<YEigFactor%
  37.    37 :
  38.    38 endY%=YSize%<<YEigFactor%
  39.    39 REM Draw BARS
  40.    40 Step%=0
  41.    41 FOR X%= XStep% TO endX% STEP XStep%
  42.    42   REM GCOL0,BarsLU%(Step%)
  43.    43
  44.    44   PROCSetColour(Step%)
  45.    45
  46.    46   RECTANGLEFILL X%-XStep%,halfY%,X%,endY%
  47.    47   GCOL 255,0,0
  48.    48   RECTANGLEFILL X%-XStep%,0,X%,halfY%
  49.    49   Step% +=1
  50.    50 NEXT
  51.    51 REM OSCLI("<MonitorTest$Dir>.!Runimage")
  52.    52
  53.    53       PRINT XSize%,YSize%
  54.    52 END
  55.    53
  56.    54 DEF PROCSetColour(step)
  57.    55
  58.    56   RESTORE 72
  59.    57   READ col,r,g,b
  60.    58
  61.    59   WHILE (col<>step) AND (col <> -1)
  62.    60
  63.    61         READ col,r,g,b
  64.    62   ENDWHILE
  65.    63
  66.    64   IF col <> -1 THEN
  67.    65     GCOL r,g,b
  68.    66   ENDIF
  69.    67
  70.    68 ENDPROC
  71.    69
  72.    70
  73.    71
  74.    72 DATA 0,255,255,255
  75.    73 DATA 1,255,255,0
  76.    74 DATA 2,0,255,255
  77.    75 DATA 3,0,255,0
  78.    76 DATA 4,255,0,255
  79.    77 DATA 5,255,0,0
  80.    78 DATA 6,0,0,255
  81.    79 DATA 7,0,0,0
  82.    80 DATA -1,-1,-1,-1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement