Difference between revisions of "OSBYTE &A0"

From BeebWiki
Jump to: navigation, search
m (Some reformatting)
 
m (.)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:OSBYTE]]
 
[[Category:OSBYTE]]
OSBYTE &A0 (160) - Read VDU Variable, called by '''=VDU(n)''' from BASIC
+
{{PageTitle|OSBYTE &A0 (160) - Read VDU Variable}}
 +
This call returns variable number X in registers X and Y. On some implementations
 +
of BASIC it is called by the '''[[VDU|=VDU(n)]]''' function.
  
This call returns variable number X in registers X and Y The VDU variables
+
The VDU variables are stored in a machine-dependant location (&0300 in most 8-bit
are stored in a machine-dependant location (&0300 in most 8-bit OSs), so
+
OSs), so this call should be made to read them. 16-bit values (eg &06/7) can be
this call should be made to read them. 16-bit values (eg &06/7) should be
+
read with one call by reading the low numbered location (eg &06).
read by reading the low numbered location (eg &06).
 
  
 
As the VDU variables number 0 to 127, some platforms translate VDU variable
 
As the VDU variables number 0 to 127, some platforms translate VDU variable
Line 26: Line 27:
 
     &14/5    Old graphics X position in external coordinates
 
     &14/5    Old graphics X position in external coordinates
 
     &16/7    Old graphics Y position in external coordinates
 
     &16/7    Old graphics Y position in external coordinates
     &18      Current text X position (=POS)
+
     &18      Current absolute text X position (=POS+vduvar &08)
     &19      Current text Y position (=VPOS)
+
     &19      Current absolute text Y position (=VPOS+vduvar &0B)
 
     &1A      Line within current graphics cell of graphics cursor
 
     &1A      Line within current graphics cell of graphics cursor
 
     &1B      Graphics workspace/VDU queue
 
     &1B      Graphics workspace/VDU queue
Line 33: Line 34:
 
     &24/5    Current graphics X position in internal coordinates
 
     &24/5    Current graphics X position in internal coordinates
 
     &26/7    Current graphics Y position in internal coordinates
 
     &26/7    Current graphics Y position in internal coordinates
     &28-&2F  Bitmap read from screen by OSBYTE 135
+
     &28-&2F  Bitmap read from screen by [[OSBYTE &87]]
 
     &30-&49  Graphics workspace
 
     &30-&49  Graphics workspace
 
     &4A/B    Text cursor address for 6845
 
     &4A/B    Text cursor address for 6845
 
     &4C/D    Text window width in bytes
 
     &4C/D    Text window width in bytes
     &4E      High byte of bottom of screen memory, readable as
+
     &4E      High byte of bottom of screen memory
              vdu variable &4D AND &FF00
 
 
     &4F      Bytes per character for current mode
 
     &4F      Bytes per character for current mode
 
     &50/&51  Screen display start address for 6845
 
     &50/&51  Screen display start address for 6845
 
     &52/&53  Bytes per screen row
 
     &52/&53  Bytes per screen row
     &54      Screen memory size high byte, readable as vdu
+
     &54      Screen memory size high byte
              variable &53 AND &FF00
+
     &55      Current screen mode read by [[OSBYTE &87]]
     &55      Current screen mode (=MODE)
 
 
     &56      Memory map type
 
     &56      Memory map type
 
                 0 - 20K mode
 
                 0 - 20K mode
Line 51: Line 50:
 
                 3 - 8K mode
 
                 3 - 8K mode
 
                 4 - 1K mode
 
                 4 - 1K mode
     &57      Foreground text colour
+
     &57      Foreground text colour mask
     &58      Background text colour
+
     &58      Background text colour mask
     &59      Foreground graphics colour
+
     &59      Foreground graphics colour mask (BBC/Electron)
     &5A      Background graphics colour
+
     &5A      Background graphics colour mask (BBC/Electron)
     &5B      Foreground plot mode
+
     &5B      Foreground GCOL mode
     &5C      Background plot mode
+
     &5C      Background GCOL mode
 
     &5D/&5E  General VDU jump vector
 
     &5D/&5E  General VDU jump vector
 
     &5F      Cursor start register previous setting
 
     &5F      Cursor start register previous setting
Line 63: Line 62:
 
     &62      Leftmost pixel colour mask
 
     &62      Leftmost pixel colour mask
 
     &63      Rightmost pixel colour mask
 
     &63      Rightmost pixel colour mask
     &64      Text input X position
+
     &64      Text input absolute X position
     &65      Text input Y position
+
     &65      Text input absolute Y position
 
      
 
      
 
               BBC, Electron:                      Master:
 
               BBC, Electron:                      Master:
Line 83: Line 82:
 
      
 
      
 
     &6F-&7E Palette for colours 0 to 15
 
     &6F-&7E Palette for colours 0 to 15
     &7F      Unused
+
     &7F      Unused (used by some shadow RAM systems)
  
 
==See Also==
 
==See Also==
Line 90: Line 89:
  
 
[[User:Jgharston|Jgharston]] 22:15, 26 May 2009 (UTC)
 
[[User:Jgharston|Jgharston]] 22:15, 26 May 2009 (UTC)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 20:05, 25 October 2015 (UTC)

Latest revision as of 23:30, 3 March 2021

OSBYTE &A0 (160) - Read VDU Variable

This call returns variable number X in registers X and Y. On some implementations of BASIC it is called by the =VDU(n) function.

The VDU variables are stored in a machine-dependant location (&0300 in most 8-bit OSs), so this call should be made to read them. 16-bit values (eg &06/7) can be read with one call by reading the low numbered location (eg &06).

As the VDU variables number 0 to 127, some platforms translate VDU variable numbers 128+ to the appropriate RISC OS OS_ReadVduVariables offset.

   VDU Variables
   -------------
   &00/1     Current graphics window left column in pixels
   &02/3     Current graphics window bottom row in pixels
   &04/5     Current graphics window right column in pixels
   &06/7     Current graphics window top row in pixels
   &08       Current text window left hand column
   &09       Current text window bottom row
   &0A       Current text window right hand column
   &0B       Current text window top column
   &0C/D     Current graphics X origin in external coordinates
   &0E/F     Current graphics Y origin in external coordinates
   &10/1     Current graphics X position in external coordinates
   &12/3     Current graphics Y position in external coordinates
   &14/5     Old graphics X position in external coordinates
   &16/7     Old graphics Y position in external coordinates
   &18       Current absolute text X position (=POS+vduvar &08)
   &19       Current absolute text Y position (=VPOS+vduvar &0B)
   &1A       Line within current graphics cell of graphics cursor
   &1B       Graphics workspace/VDU queue
   &1F-&23   VDU queue
   &24/5     Current graphics X position in internal coordinates
   &26/7     Current graphics Y position in internal coordinates
   &28-&2F   Bitmap read from screen by OSBYTE &87
   &30-&49   Graphics workspace
   &4A/B     Text cursor address for 6845
   &4C/D     Text window width in bytes
   &4E       High byte of bottom of screen memory
   &4F       Bytes per character for current mode
   &50/&51   Screen display start address for 6845
   &52/&53   Bytes per screen row
   &54       Screen memory size high byte
   &55       Current screen mode read by OSBYTE &87
   &56       Memory map type
               0 - 20K mode
               1 - 16K mode
               2 - 10K mode
               3 - 8K mode
               4 - 1K mode
   &57       Foreground text colour mask
   &58       Background text colour mask
   &59       Foreground graphics colour mask (BBC/Electron)
   &5A       Background graphics colour mask (BBC/Electron)
   &5B       Foreground GCOL mode
   &5C       Background GCOL mode
   &5D/&5E   General VDU jump vector
   &5F       Cursor start register previous setting
   &60       Number logical colours -1
   &61       Pixels per byte -1 (zero if text only mode)
   &62       Leftmost pixel colour mask
   &63       Rightmost pixel colour mask
   &64       Text input absolute X position
   &65       Text input absolute Y position
   
             BBC, Electron:                      Master:
   &66       Teletext output cursor character    VDU 23,16 setting
   &67       Font explosion flags, b1=224-255    VDU 23,6 dot pattern
             in RAM, b7=32-63 in RAM
   &68       Font location, characters 32-63     Current dot pattern state
   &69       Font location, characters 64-95     Colour plotting ECF pattern
                                                 number or zero
   &6A       Font location, characters 96-127    Graphics foreground ECF
                                                 pattern number or zero
   &6B       Font location, characters 128-159   Graphics background ECF
                                                 pattern number or zero
   &6C       Font location, characters 160-191   b7 set when cursor off
                                                 righthand edge of screen
   &6D       Font location, characters 192-223   Graphics foreground colour
   &6E       Font location, characters 224-225   Graphics background colour
   
   &6F-&7E Palette for colours 0 to 15
   &7F       Unused (used by some shadow RAM systems)

See Also

Jgharston 22:15, 26 May 2009 (UTC) Jgharston (talk) 20:05, 25 October 2015 (UTC)