Difference between revisions of "VDU 19"

From BeebWiki
Jump to: navigation, search
m (1 revision)
(Rewrote to clarify parameters.)
Line 9: Line 9:
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
| Character stream (hex)
 
| Character stream (hex)
| <code>13</code> <logical> <physical> <red> <green> <blue>
+
| <code>&amp;13</code> <logical> <physical> <red> <green> <blue>
 
|- style="vertical-align:top"
 
|- style="vertical-align:top"
 
| Description
 
| Description
Line 15: Line 15:
 
|}
 
|}
  
== Description ==
+
==Description==
<code>VDU 19</code>, sets the logical colour, used in a GCOL ([[VDU 18]]) or
+
<code>'''VDU 19'''</code> sets the logical colour, used in GCOL ([[VDU 18]])
a COLOUR ([[VDU 17]]) to the provided physical colour. On the 8-bit
+
or COLOUR ([[VDU 17]]) to the provided physical colour. The physical colour
machines, the physical colour list is the same as the default for a 16
+
is set with a [[Physical colour numbers|physical colour]] or, on 32-bit
colour mode, as shown below, and the red, green and blue parameters are
+
platforms and compatible extensions for 8-bit systems, the individual
given as zero. On 32-bit systems and compatible extensions for 8-bit
+
red/green/blue colour levels set with the last three parameters.
systems, the individual red/green/blue colour levels can be set with
 
the last three parameters.
 
  
{| class="wikitable"
+
The logical colour value is MODed by the number of colours in the screen
|+ Default physical colours
+
mode, so in a four colour mode, defining colour 4 will alter colour 0.
! Logical colour !! Physical colour
+
 
|-
+
Some platforms support a logical colour of -1 to set the border colour. Some
| 0 || Black
+
platforms use a physical colour of 16+ to set the border or pointer colours
|-
+
or individual flash colours.
| 1 || Red
 
|-
 
| 2 || Green
 
|-
 
| 3 || Yellow
 
|-
 
| 4 || Blue
 
|-
 
| 5 || Magenta
 
|-
 
| 6 || Cyan
 
|-
 
| 7 || White
 
|-
 
| 8 || Flashing black/white
 
|-
 
| 9 || Flashing red/cyan
 
|-
 
| 10 || Flashing green/magenta
 
|-
 
| 11 || Flashing yellow/blue
 
|-
 
| 12 || Flashing blue/yellow
 
|-
 
| 13 || Flashing magenta/green
 
|-
 
| 14 || Flashing cyan/red
 
|-
 
| 15 || Flashing white/black
 
|}
 
  
The logical colour value is MODed by the number of colours in the mode, so
+
With screen modes with 256 or more logical colours other methods are used to
in a four colour mode, defining colour 4 will alter colour 0.
+
control the palette.
  
On a BBC Micro, this VDU call performs similar to [[OSBYTE &9B]] and will
+
==Parameters==
update the ULA colour registers. It will automatically invert the physical
+
* VDU 19,0-63,p  ,r,g,b - sets logical colour
colour value as required by the ULA.
+
* VDU 19,-1  ,p  ,r,g,b - sets border colour
 +
* VDU 19,l  ,0-15,r,g,b - sets to 4-bit [[Physical colour numbers|physical colour]]
 +
* VDU 19,l  ,16  ,r,g,b - sets to RGB colour
 +
* VDU 19,l  ,17  ,r,g,b - sets first RGB flash colour
 +
* VDU 19,l  ,18  ,r,g,b - sets second RGB flash colour
 +
* VDU 19,l  ,24  ,r,g,b - sets border RGB colour
 +
* VDU 19,l  ,25  ,r,g,b - sets pointer RGB colour
 +
* VDU 19,l  ,0-63,r,g,b - sets to 6-bit [[Physical colour numbers|physical colour]]
  
 
==Calling from BBC BASIC==
 
==Calling from BBC BASIC==
On BASIC V and later:
+
On BASIC V and later, and equivalent:
 
* '''<code>COLOUR l,p</code>''' sends VDU 19,l,p,0,0,0
 
* '''<code>COLOUR l,p</code>''' sends VDU 19,l,p,0,0,0
 
* '''<code>COLOUR l,r,g,b</code>''' sends VDU 19,l,16,r,g,b
 
* '''<code>COLOUR l,r,g,b</code>''' sends VDU 19,l,16,r,g,b
 +
 +
Some implementations support setting the border colour with:
 +
* '''<code>COLOUR l,r,g,b</code>''' sends VDU 19,l,24,r,g,b if l<0
 +
 +
==Implementations==
 +
Programs should use <code>'''VDU 19,-1,24,r,g,b'''</code> to set the border
 +
colour to be compatible across different platforms.
 +
 +
===BBC/Master/Electron===
 +
The native 8-bit Acorn computers only support using 4-bit physical colour
 +
numbers, and do not support setting the border colour. Expansions such as
 +
the Chamelion and the Prisma support using red/green/blue colour components.
 +
 +
===RISC OS===
 +
RISC OS supports 4-bit physical colour numbers and using physical colour
 +
numbers 16-31 to set red/green/blue colour components.
 +
 +
===DOS/Windows===
 +
DOS/Windows supports 4-bit physical colour numbers and using physical colour
 +
numbers 16-31 to set red/green/blue colour components. It also supports
 +
using logical colour -1 to set the border colour.
 +
 +
===Amstrad CPC===
 +
Amstrad CPC supports 4-bit physical colour numbers translated to the Amstrad
 +
3*3*3 colour palette and using logical colour -1 to set the border colour.
 +
It also supports the following to set colours to the native 3*3*3 Amstrad
 +
colour levels:
 +
 +
* VDU 19,l,128+x,y,0,0 - flash between Amstrad colour x and y
 +
 +
==See also==
 +
* [[OSWORD &0B]] - Read palatte entries
 +
* [[OSWORD &0C]] - Write palette entries
 +
 +
On a BBC/Master, VDU 19 performs similar actions to [[OSBYTE &9B]]
 +
and will update the ULA colour registers. It will automatically invert the
 +
physical colour value as required by the ULA.
  
 
--[[User:Tautology|Tautology]] 13:10, 1 May 2011 (UTC)
 
--[[User:Tautology|Tautology]] 13:10, 1 May 2011 (UTC)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 23:10, 16 June 2016 (UTC)

Revision as of 01:10, 17 June 2016

Define Logical Colour.

VDU 19
Syntax VDU 19,<logical>,<physical>,<red>,<green>,<blue>
Character stream (hex) &13 <logical> <physical> <red> <green> <blue>
Description Set the logical colour <logical> to be the physical colour <physical>.

Description

VDU 19 sets the logical colour, used in GCOL (VDU 18) or COLOUR (VDU 17) to the provided physical colour. The physical colour is set with a physical colour or, on 32-bit platforms and compatible extensions for 8-bit systems, the individual red/green/blue colour levels set with the last three parameters.

The logical colour value is MODed by the number of colours in the screen mode, so in a four colour mode, defining colour 4 will alter colour 0.

Some platforms support a logical colour of -1 to set the border colour. Some platforms use a physical colour of 16+ to set the border or pointer colours or individual flash colours.

With screen modes with 256 or more logical colours other methods are used to control the palette.

Parameters

  • VDU 19,0-63,p ,r,g,b - sets logical colour
  • VDU 19,-1 ,p ,r,g,b - sets border colour
  • VDU 19,l ,0-15,r,g,b - sets to 4-bit physical colour
  • VDU 19,l ,16 ,r,g,b - sets to RGB colour
  • VDU 19,l ,17 ,r,g,b - sets first RGB flash colour
  • VDU 19,l ,18 ,r,g,b - sets second RGB flash colour
  • VDU 19,l ,24 ,r,g,b - sets border RGB colour
  • VDU 19,l ,25 ,r,g,b - sets pointer RGB colour
  • VDU 19,l ,0-63,r,g,b - sets to 6-bit physical colour

Calling from BBC BASIC

On BASIC V and later, and equivalent:

  • COLOUR l,p sends VDU 19,l,p,0,0,0
  • COLOUR l,r,g,b sends VDU 19,l,16,r,g,b

Some implementations support setting the border colour with:

  • COLOUR l,r,g,b sends VDU 19,l,24,r,g,b if l<0

Implementations

Programs should use VDU 19,-1,24,r,g,b to set the border colour to be compatible across different platforms.

BBC/Master/Electron

The native 8-bit Acorn computers only support using 4-bit physical colour numbers, and do not support setting the border colour. Expansions such as the Chamelion and the Prisma support using red/green/blue colour components.

RISC OS

RISC OS supports 4-bit physical colour numbers and using physical colour numbers 16-31 to set red/green/blue colour components.

DOS/Windows

DOS/Windows supports 4-bit physical colour numbers and using physical colour numbers 16-31 to set red/green/blue colour components. It also supports using logical colour -1 to set the border colour.

Amstrad CPC

Amstrad CPC supports 4-bit physical colour numbers translated to the Amstrad 3*3*3 colour palette and using logical colour -1 to set the border colour. It also supports the following to set colours to the native 3*3*3 Amstrad colour levels:

  • VDU 19,l,128+x,y,0,0 - flash between Amstrad colour x and y

See also

On a BBC/Master, VDU 19 performs similar actions to OSBYTE &9B and will update the ULA colour registers. It will automatically invert the physical colour value as required by the ULA.

--Tautology 13:10, 1 May 2011 (UTC) Jgharston (talk) 23:10, 16 June 2016 (UTC)