Difference between revisions of "BASIC command extensions"

From BeebWiki
Jump to: navigation, search
(Initial page.)
 
(Added some more.)
 
Line 1: Line 1:
 
[[Category:BASIC commands]]
 
[[Category:BASIC commands]]
  COLOUR n         Select text colour                    VDU 17,n
+
  COLOUR n           Select text colour                    VDU 17,n
  COLOUR l,p       Set colour mapping                    VDU 19,l,p,0,0,0
+
  COLOUR l,p         Set colour mapping                    VDU 19,l,p,0,0,0
  COLOUR r,g,b     Set text colour closest to (r,g,b)
+
  COLOUR r,g,b       Set text colour closest to (r,g,b)
  COLOUR l,r,g,b   Set colour mapping                    VDU 19,l,16,r,g,b
+
  COLOUR l,r,g,b     Set colour mapping                    VDU 19,l,16,r,g,b
  COLOUR l,r,g,b,a Set colour mapping with alpha channel
+
  COLOUR l,r,g,b,a   Set colour mapping with alpha channel
  COLOUR ON ...    Set background text colour
+
  COLOUR ON n        Set background text colour            VDU 17,n+128
  COLOUR ... ON ... Set foreground and background text colour
+
COLOUR ON r,g,b    Set background text colour
 +
  COLOUR n ON m      Set fgd and bgd text colour            VDU 17,n,17,m+128
 +
COLOUR n ON r,g,b      Set fgd and bgd text colour
 +
COLOUR r,g,b ON m      Set fgd and bgd text colour
 +
COLOUR r,g,b ON x,y,z  Set fgd and bgd text colour
 
   
 
   
  GCOL n           Set graphics colour                    VDU 18,0,n
+
  GCOL n             Set graphics colour                    VDU 18,0,n
  GCOL a,n         Set graphics colour                   VDU 18,a,n
+
  GCOL a,n           Set graphics colour and action        VDU 18,a,n
  GCOL r,g,b       Set graphics colour closest to (r,g,b)
+
  GCOL r,g,b         Set graphics colour closest to (r,g,b)
  GCOL a,r,g,b     Set graphics colour closest to (r,g,b)
+
  GCOL a,r,g,b       Set graphics colour closest to (r,g,b)
  GCOL ON ...      Set graphics background colour
+
  GCOL ON n          Set graphics background colour        VDU 18,0,n+128
  GCOL ... ON ...  Set graphics foreground and background colour
+
GCOL ON r,g,b      Set graphics background colour
 +
  GCOL n ON m        Set graphics fgd and bgd colour        VDU 18,0,n,18,0,m+128
 +
GCOL n ON r,g,b        Set graphics fgd and bgd colour
 +
GCOL r,g,b ON m        Set graphics fgd and bgd colour
 +
GCOL r,g,b ON x,y,z    Set graphics fgd and bgd colour
 
   
 
   
  PLOT x,y         Plot a point                          VDU 25,69,x;y;
+
OFF                Turn cursor off                        VDU 23,1,0,0,0,0,0,0,0,0
  PLOT k,x,y       Plot action                            VDU 25,k,x;y;
+
ON                Turn cursor on                        VDU 23,1,1,0,0,0,0,0,0,0
 +
 +
  PLOT x,y           Plot a point                          VDU 25,69,x;y;
 +
  PLOT k,x,y         Plot action                            VDU 25,k,x;y;
 
   
 
   
 
  PROCname[(parameters)]
 
  PROCname[(parameters)]
 
  PROC(address)[(parameters)]
 
  PROC(address)[(parameters)]
 
   
 
   
  BPUT#<num>,<num>
+
  BPUT#num,num       Write byte
  BPUT#<num>,<str>
+
  BPUT#num,str       Write LF-terminated string
  BPUT#<num>,<str>;
+
  BPUT#num,str;     Write unterminated string
 +
 +
SOUND num,num,num,num                                    OSWORD 7
 +
SOUND OFF                                                OSBYTE 210,0
 +
SOUND ON                                                  OSBYTE 210,255
 
   
 
   
  SOUND <num>,<num>,<num>,<num>                            OSWORD 7
+
  ?address=byte      8-bit indirection
  SOUND OFF                                                OSBYTE 210,0
+
  !address=word      32-bit indirection
  SOUND ON                                                OSBYTE 210,255
+
  |address=float    40-bit indirection
 +
var?off=byte      8-bit indirection
 +
var!off=word      32-bit indirection
 +
var|off=float      40-bit indirection

Latest revision as of 18:21, 19 February 2024

COLOUR n           Select text colour                     VDU 17,n
COLOUR l,p         Set colour mapping                     VDU 19,l,p,0,0,0
COLOUR r,g,b       Set text colour closest to (r,g,b)
COLOUR l,r,g,b     Set colour mapping                     VDU 19,l,16,r,g,b
COLOUR l,r,g,b,a   Set colour mapping with alpha channel
COLOUR ON n        Set background text colour             VDU 17,n+128
COLOUR ON r,g,b    Set background text colour
COLOUR n ON m      Set fgd and bgd text colour            VDU 17,n,17,m+128
COLOUR n ON r,g,b      Set fgd and bgd text colour
COLOUR r,g,b ON m      Set fgd and bgd text colour
COLOUR r,g,b ON x,y,z  Set fgd and bgd text colour

GCOL n             Set graphics colour                    VDU 18,0,n
GCOL a,n           Set graphics colour and action         VDU 18,a,n
GCOL r,g,b         Set graphics colour closest to (r,g,b)
GCOL a,r,g,b       Set graphics colour closest to (r,g,b)
GCOL ON n          Set graphics background colour         VDU 18,0,n+128
GCOL ON r,g,b      Set graphics background colour
GCOL n ON m        Set graphics fgd and bgd colour        VDU 18,0,n,18,0,m+128
GCOL n ON r,g,b        Set graphics fgd and bgd colour
GCOL r,g,b ON m        Set graphics fgd and bgd colour
GCOL r,g,b ON x,y,z    Set graphics fgd and bgd colour

OFF                Turn cursor off                        VDU 23,1,0,0,0,0,0,0,0,0
ON                 Turn cursor on                         VDU 23,1,1,0,0,0,0,0,0,0

PLOT x,y           Plot a point                           VDU 25,69,x;y;
PLOT k,x,y         Plot action                            VDU 25,k,x;y;

PROCname[(parameters)]
PROC(address)[(parameters)]

BPUT#num,num       Write byte
BPUT#num,str       Write LF-terminated string
BPUT#num,str;      Write unterminated string

SOUND num,num,num,num                                     OSWORD 7
SOUND OFF                                                 OSBYTE 210,0
SOUND ON                                                  OSBYTE 210,255

?address=byte      8-bit indirection
!address=word      32-bit indirection
|address=float     40-bit indirection
var?off=byte       8-bit indirection
var!off=word       32-bit indirection
var|off=float      40-bit indirection