http://beebwiki.mdfs.net/api.php?action=feedcontributions&user=Gerph&feedformat=atomBeebWiki - User contributions [en]2024-03-29T05:13:19ZUser contributionsMediaWiki 1.30.0-rc.0http://beebwiki.mdfs.net/index.php?title=VDU_23&diff=4544VDU 232023-10-27T20:03:43Z<p>Gerph: Updated Teletext documentation to reflect RISC OS Select and RISC OS Pyromaniac.</p>
<hr />
<div>[[Category:VDU commands]]__NOTOC__<br />
== Description ==<br />
Defines a character or performs various miscellaneous VDU functions.<br />
Unrecognised or unimplemented commands are passed to [[VDUV]], on platforms<br />
where VDUV is implemented.<br />
<br />
{| class="wikitable"<br />
|+ VDU 23<br />
|- style="vertical-align:top"<br />
|<br />
[[BASIC metasyntax|Syntax]]<br />
|<br />
<code>VDU 23,</code><numeric><code>,</code><numeric><code>,</code><br />
<numeric><code>,</code><numeric><code>,</code><numeric><code>,</code><br />
<numeric><code>,</code><numeric><code>,</code><numeric><code>,</code><br />
<numeric><br><br />
In BASIC IV onwards, <code>&#124;</code> can be used to terminate a VDU sequence with 9 zeroes, eg <code>VDU 23;</code><numeric><code>,</code><numeric><code>&#124;</code><br />
|- style="vertical-align:top"<br />
|<br />
Character stream (hex)<br />
|<br />
<code>17</code> <action><br />
<param1> <param2> <param3> <param4> <param5> <param6> <param7> <param8><br />
|- style="vertical-align:top"<br />
|<br />
Description<br />
|<br />
Defines a character or performs various miscellaneous VDU functions.<br />
|}<br />
<br />
== Summary ==<br />
<table><tr valign="top"><br />
<td><br />
* [[VDU_23#VDU_23.2C0_-_CRTC_register_programming|VDU 23,0]] - CRTC register programming<br />
* [[VDU_23#VDU_23.2C1_-_Cursor_control|VDU 23,1]] - Cursor control<br />
* [[VDU_23#VDU_23.2C2-5_-_Define_ECF_pattern|VDU 23,2]] - Define ECF pattern 1<br />
* [[VDU_23#VDU_23.2C2-5_-_Define_ECF_pattern|VDU 23,3]] - Define ECF pattern 2<br />
* [[VDU_23#VDU_23.2C2-5_-_Define_ECF_pattern|VDU 23,4]] - Define ECF pattern 3<br />
* [[VDU_23#VDU_23.2C2-5_-_Define_ECF_pattern|VDU 23,5]] - Define ECF pattern 4<br />
* [[VDU_23#VDU_23.2C6_-_Set_dotted_line_pattern|VDU 23,6]] - Set dotted line pattern<br />
* [[VDU_23#VDU_23.2C7_-_Scroll_rectangle_on_screen|VDU 23,7]] - Scroll rectangle on screen<br />
* [[VDU_23#VDU_23.2C8_-_Clear_block|VDU 23,8]] - Clear block<br />
* [[VDU_23#VDU_23.2C9_-_Set_flash_mark_period|VDU 23,9]] - Set flash mark period<br />
* [[VDU_23#VDU_23.2C10_-_Set_flash_space_period|VDU 23,10]] - Set flash space period<br />
* [[VDU_23#VDU_23.2C11_-_Set_default_ECF_patterns|VDU 23,11]] - Set default ECF patterns<br />
* [[VDU_23#VDU_23.2C12-15_-_Set_simple_ECF_pattern|VDU 23,12]] - Set simple ECF pattern 1<br />
* [[VDU_23#VDU_23.2C12-15_-_Set_simple_ECF_pattern|VDU 23,13]] - Set simple ECF pattern 2<br />
* [[VDU_23#VDU_23.2C12-15_-_Set_simple_ECF_pattern|VDU 23,14]] - Set simple ECF pattern 3<br />
* [[VDU_23#VDU_23.2C12-15_-_Set_simple_ECF_pattern|VDU 23,15]] - Set simple ECF pattern 4<br />
<td><br />
* [[VDU_23#VDU_23.2C16_-_Define_cursor_movement|VDU 23,16]] - Define cursor movement<br />
* [[VDU_23#VDU_23.2C17_-_Set_subsidary_colour_effects|VDU 23,17]] - Set subsidary colour effects<br />
* [[VDU_23#VDU_23.2C18_-_Set_Teletext_display_characteristics.5B1.5D|VDU 23,18]] - Set Teletext display characteristics<br />
* [[VDU_23#VDU_23.2C19-21_-_Unused|VDU 23,19]] - Unused<br />
* [[VDU_23#VDU_23.2C19-21_-_Unused|VDU 23,20]] - Unused<br />
* [[VDU_23#VDU_23.2C19-21_-_Unused|VDU 23,21]] - Unused<br />
* [[VDU_23#VDU_23.2C22_-_Select_user_defined_screen_mode|VDU 23,22]] - Select user defined screen mode<br />
* [[VDU_23#VDU_23.2C23_-_Set_linedraw_thickness|VDU 23,23]] - Set linedraw thickness<br />
* [[VDU_23#VDU_23.2C24_-_Set_character_spacing_adjustment|VDU 23,24]] - Set character spacing adjustment<br />
* [[VDU_23#VDU_23.2C25.2C0-4_-_Set_anti-aliasing_transfer_function|VDU 23,25]] - Set anti-aliasing transfer function<br />
* [[VDU_23#VDU_23.2C26_-_Select_font|VDU 23,26]] - Select font<br />
* [[VDU_23#VDU_23.2C27_-_Sprite_operation|VDU 23,27]] - Sprite operation<br />
* [[VDU_23#VDU_23.2C28-31_-_User_calls|VDU 23,28]] - Reserved for user calls<br />
* [[VDU_23#VDU_23.2C28-31_-_User_calls|VDU 23,29]] - Reserved for user calls<br />
* [[VDU_23#VDU_23.2C28-31_-_User_calls|VDU 23,30]] - Reserved for user calls<br />
* [[VDU_23#VDU_23.2C28-31_-_User_calls|VDU 23,31]] - Reserved for user calls<br />
* [[VDU_23#VDU_23.2C32-255_-_Define_character|VDU 23,32-255]] - Define character<br />
</table><br />
<br />
== VDU 23,32-255 - Define character ==<br />
VDU 23,32-255,row1,row2,row3,row4,row5,row6,row7,row8 (OS 0.10 onwards)<br />
[[Image:User defined stick figure.png|right|Defining a stick figure with VDU 23]]<br />
<br />
In this type of command, all nine parameters are used.<br />
<br />
The first parameter selects the character to be defined, and the other eight<br />
encode an 8&times;8 monochrome bitmap that [[OSWRCH]] will print for that<br />
character in future (through [[VDUCHR]]).<br />
<br />
The first byte of the bitmap (the second parameter) carries the top row of<br />
the bitmap. The most significant bit corresponds to the leftmost column. A<br />
binary 1 represents the foreground <code>[[COLOUR]]</code> (usually white),<br />
binary 0 the background <code>COLOUR</code> (usually black.)<br />
<br />
For example, the stick figure character printed in the ''User Guide'' (and<br />
above) can be defined with the following sequence:<br />
<br />
VDU 23,224,28,28,8,127,8,20,34,65<br />
<br />
When the character is printed, such as by<br />
<br />
VDU 224<br />
<br />
the figure will typically appear in ''white'' on a ''black'' background,<br />
that is, in the negative compared to the image above.<br />
<br />
Depending on the [[OSBYTE &14|font explode state]] a number of other<br />
characters will simultaneously be assigned that bitmap. The font is ''not''<br />
ordinarily transferred to the printer.<br />
<br />
In <code>[[MODE 7]]</code> the user defined character has no effect on the<br />
[[Teletext]] hardware, but the definition is stored for later use. In the<br />
bitmapped <code>MODE</code>s the new definition does not change the<br />
appearance of copies of that character already on screen; [[OSBYTE &87]]<br />
will no longer recognise them as that character.<br />
<br />
The character definition can be read with [[OSWORD &0A]]. Note that character<br />
127 can be defined with VDU 23,127, but can never be printed. The definition<br />
can be read with OSWORD &0A.<br />
<br />
== VDU 23,0 - CRTC register programming ==<br />
VDU 23,0,register,value,0,0,0,0,0,0 (OS 0.10 onwards)<br />
<br />
In this command, <code>VDU 23</code> programs the 6845 register <register><br />
(or emulated register) with value <value>. For the functions of each<br />
register, see [[CRTC]].<br />
<br />
Platforms without a hardware 6845 CRTC, such as [[RISC OS]] and<br />
[[80x86 BBC BASIC|BBC BASIC for Windows]], partly emulate the CRTC so that<br />
cursor appearance and screen interlace can be controlled with <code>VDU<br />
23</code>. The statement <code>VDU 23;8202;0;0;0;</code> which appears in<br />
many BBC Micro programs, also turns the cursor off in RISC OS, as it expands<br />
to VDU 23,0,10,32;0;0;0.<br />
<br />
Note that this command can 'unprogram' the current <code>[[MODE]]</code> so<br />
that a full DRAM refresh is no longer performed. This coupled with a tight<br />
machine code loop erases most of the I/O processor's memory, with disastrous<br />
results.<br />
<br />
Some BASIC programs contain embedded <code>VDU 23</code> sequences in<br />
<code>[[REM]]</code> statements to protect themselves against being<br />
<code>[[LIST]]</code>ed; for instance, Ducksoft's ''Tom Pinone Poker''.<br />
<br />
== VDU 23,1 - Cursor control ==<br />
VDU 23,1,state,0,0,0,0,0,0,0 (OS 1.00 onwards)<br />
<br />
This subcommand turns the cursor on or off. The defined values of<br />
<state> are:<br />
<table width="100%"><tr valign="top"><br />
<td><br />
* 0 - off<br />
* 1 - on<br />
<td><br />
* 2 - steady (MOS 3 onwards)<br />
* 3 - flashing (MOS 3 onwards)<br />
</table><br />
<br />
Note that the cursor will re-appear if cursor editing is used.<br />
<br />
== VDU 23,2-5 - Define ECF pattern ==<br />
VDU 23,2-5,row1,row2,row3,row4,row5,row6,row7,row8 (GXR, MOS 3.00 onwards, not BBFW)<br />
<br />
This defines Extended Colour Fill patterns (ECFs) 1 to 4. They are<br />
selectable for plotting with GCOL 16*ECF,0.<br />
<br />
As the fill patterns are mapped to the pixel layout of each screen mode,<br />
they are defined differently for different colour depths. On RISC OS, ECF<br />
patterns can be defined in BBC/Master compatible mode or in RISC OS native<br />
mode. To change between the modes, VDU 23,17,4 is used.<br />
<br />
Numbering the pixels of each row as 76543210 give the following arrangement:<br />
<br />
* 2-colour modes: 7,6,5,4,3,2,1,0 (BBC) 0,1,2,3,4,5,6,7 (RISC OS)<br />
* 4-colour modes: 73,62,51,40 (BBC) 10,32,54,76 (RISC OS)<br />
* 16-colour modes: 7531,6420 (BBC) 3210,7654 (RISC OS)<br />
* 256-colour modes: 76543210 (BBC) 76543210 (RISC OS)<br />
<br />
The ECFs are readable with [[OSWORD &0A|OSWORD 10,2-5]].<br />
<br />
== VDU 23,6 - Set dotted line pattern ==<br />
VDU 23,6,n1,n2,n3,n4,n5,n6,n7,n8 (GXR, MOS 3.00 onwards, not BBFW)<br />
<br />
This sets the dotted line pattern used by dotted [[VDU 25|PLOT]] commands.<br />
The pattern length is set with [[OSBYTE &A3|*FX163,242]]. The default is<br />
&AA, length 8, as prior to MOS 3.00. The pattern is readable with<br />
[[OSWORD &0A|OSWORD 10,6]], and the repeat length is read with<br />
[[OSBYTE &A3|OSBYTE 163,242]].<br />
<br />
== VDU 23,7 - Scroll rectangle on screen ==<br />
VDU 23,7,extent,direction,movement,0,0,0,0,0 (OS 3.00 onwards)<br />
<br />
This command will scroll the whole screen, or the current text window, in<br />
any direction.<br />
<br />
<table width="100%"><tr valign="top"><br />
<td colspan="2"><br />
* extent=0 - scroll the current text window<br />
* extent=1 - scroll the entire screen<br />
<tr valign="top"><br />
<td><br />
* direction=0 - scroll right<br />
* direction=1 - scroll left<br />
* direction=2 - scroll down<br />
* direction=3 - scroll up<br />
<td><br />
* direction=4 - scroll in positive X direction<br />
* direction=5 - scroll in negative X direction<br />
* direction=6 - scroll in positive Y direction<br />
* direction=7 - scroll in negative Y direction<br />
<tr valign="top"><br />
<td colspan="2"><br />
* movement=0 - scroll by 1 character cell<br />
* movement=1 - scroll by 1 character cell vertically, or 1 byte horizontally (not BBFW)<br />
</table><br />
<br />
When scrolling by a byte horizontally, the movement depends on the colour<br />
depth of the current mode:<br />
<br />
<table width="100%"><tr valign="top"><br />
<td colspan="2"><br />
* 8 pixels in 2-colour modes<br />
* 4 pixels in 4-colour modes<br />
* 2 pixels in 16-colour modes<br />
* 1 pixel in 256-colour modes<br />
</table><br />
<br />
Note that the cursor is never moved.<br />
<br />
== VDU 23,8 - Clear block ==<br />
VDU 23,8,t1,t2,x1,y1,x2,y2,0,0 (OS 3.00 onwards, not BBFW)<br />
<br />
This will clear a block of the current text window to the current text<br />
background colour.<br />
<br />
* <t1> and <t2> define the type of block to be cleared<br />
* <x1>,<y1> defines the start position of the block as specified by <t1><br />
* <x2>,<y2> defines the end position of the block as specified by <t2><br />
The <t1> and <t2> control bytes specify the location as:<br />
<table width="100%"><tr valign="top"><br />
<td><br />
* 0 - top left of text window<br />
* 4 - left end of cursor line<br />
* 8 - bottom left of text window<br />
<td><br />
* 1 - top of cursor column<br />
* 5 - cursor position<br />
* 9 - bottom of cursor column<br />
<td><br />
* 2 - off top right of text window<br />
* 6 - off right of cursor line<br />
* 10 - off bottom right of text window<br />
</table><br />
<br />
Note that 'left', 'up', etc are dependent on the direction of cursor<br />
movement as defined with VDU 23,16.<br />
<br />
<x1>,<y1>,<x2>,<y2> are from the positions specified by <t1> and <t2> and<br />
determine the start and end of the block to be cleared. If <t1> and <t2><br />
are both 0, then <x1>,<y1>,<x2>,<y2> specify a block within the current text<br />
window in the same manner as [[VDU 28]] defines the text window.<br />
<br />
Values of <t1> and <t2> other than those listed produce undefined results.<br />
<br />
No clearing will occur if the end point is before the start point.<br />
<br />
== VDU 23,9 - Set flash mark period ==<br />
VDU 23,9,period,0,0,0,0,0,0,0 (OS 3.00 onwards, not BBFW)<br />
<br />
Set flash mark period (the time the first flash colour is visible) in the<br />
number of VSyncs (usually 1/50s), as with [[OSBYTE &09|*FX9]]. If the period<br />
is 0, the first flash colour is displayed continously.<br />
<br />
== VDU 23,10 - Set flash space period ==<br />
VDU 23,10,period,0,0,0,0,0,0,0 (OS 3.00 onwards, not BBFW)<br />
<br />
Set flash space period (the time the second flash colour is visible) in the<br />
number of VSyncs (usually 1/50s), as with [[OSBYTE &0A|*FX10]]. If the<br />
period is 0, the second flash colour is displayed continuously.<br />
<br />
== VDU 23,11 - Set default ECF patterns ==<br />
VDU 23,11,0,0,0,0,0,0,0,0 (GXR, OS 3.00 onwards, not BBFW)<br />
<br />
This command resets all the Extended Colour Fill (ECF) patterns to the<br />
default for the current screen mode.<br />
<br />
== VDU 23,12-15 - Set simple ECF pattern ==<br />
VDU 23,12-15,a,b,c,d,e,f,g,h (GXR, OS 3.00 onwards, not BBFW)<br />
<br />
Defines Extended Colour Fill (ECF) patterns 1 to 4 in a simpler manner than<br />
VDU 23,2-5. The ECF is defined as a repeated block of four lines of two<br />
repeated pixels.<br />
<br />
The first pixel line uses alternative pixels of colours ''a'',''b''; the<br />
second pixel line uses alternative pixels of colours ''c'',''b'', etc.<br />
<br />
== VDU 23,16 - Define cursor movement ==<br />
VDU 23,16,setting,mask,0,0,0,0,0,0 (OS 3.00 onwards)<br />
<br />
This allows the direction the cursor moves after a character is printed to<br />
be specified. Normal cursor movement is to the right, and then wrapping off<br />
the edge of the screen or window and then downwards. VDU 23,16 changes these<br />
directions, and all other commands that move or set the position of the text<br />
cursor.<br />
<br />
The new direction is specified with (''old status'' AND ''mask'') EOR ''setting'',<br />
and the new status is interpreted as follows:<br />
<br />
<table><br />
<tr valign="top"><td>b7=0<td>normal value<br />
<tr valign="top"><td>b7=1<td>undefined<br />
<tr valign="top"><td>b6=0<td>In VDU 5 (text at graphics cursor) mode, movement beyond the edge of the window causes an implicit carriage return/linefeed to the next positive Y line.<br />
<tr valign="top"><td>b6=1<td>In VDU 5 (text at graphics cursor) mode, movement beyond the edge of the window causes no action, and the text 'continues' invisibly off the edge of the window.<br />
<tr valign="top"><td>b5=0<td>Cursor moves in positive X direction after a character is printed.<br />
<tr valign="top"><td>b5=1<td>Cursor does not move after a character is printed.<br />
<tr valign="top"><td>b4=0<td>Cursor movement in the positive Y direction past the bottom of the text window causes the text window to scroll in VDU 4 (text) mode, or moved to the opposite edge of the window in VDU 5 (text at graphics cursor) mode.<br />
<tr valign="top"><td>b4=1<td>Cursor movement in the positive Y direction past the bottom of the text window always causes the text cursor to be moved to the opposite edge of the window.<br />
</table><br />
<br />
<table><br />
<tr valign="top"><td colspan="4">b3,b2,b1 define the cursor directon as follows:<br />
<tr valign="top"><td>0<td>0<td>0<td>X direction is right, Y direction is down<br />
<tr valign="top"><td>0<td>0<td>1<td>X direction is left, Y direction is down<br />
<tr valign="top"><td>0<td>1<td>0<td>X direction is right, Y direction is up<br />
<tr valign="top"><td>0<td>1<td>1<td>X direction is left, Y direction is up<br />
<tr valign="top"><td>1<td>0<td>0<td>X direction is down, Y direction is right<br />
<tr valign="top"><td>1<td>0<td>1<td>X direction is down, Y direction is left<br />
<tr valign="top"><td>1<td>1<td>0<td>X direction is up, Y direction is right<br />
<tr valign="top"><td>1<td>1<td>1<td>X direction is up, Y direction is left<br />
</table><br />
<br />
<table><br />
<tr valign="top"><td>b0=0<td>disables scroll protection, the text cursor moving off the positive edge of the window will always move directly to the next line, scrolling the window if neccessary.<br />
<tr valign="top"><td>b0=1<td>enables scroll protection, the text cursor moving off the positive edge of the window generates a pending newline, and waits at the edge of the window until the movement is needed. While the cursor is waiting, the cursor position returned by POS via [[OSBYTE &87]] is the maximum column position plus one, ie the window width (eg 80 in MODE 0). If the cursor is moved elsewhere, the pending newline is abandoned, and no scrolling occurs.<br />
</table><br />
<br />
== VDU 23,17 - Set subsidary colour effects ==<br />
=== VDU 23,17,0-3 - Set tint ===<br />
VDU 23,17,action,tint,0,0,0,0,0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
Sets the additional tint for the specified colour. COLOUR and GCOL can only<br />
specify 6-bit logical colours, so in 256-colour screen modes, VDU 23,17 is<br />
used to set the lowest two bits of the colour.<br />
<br />
<table width="100%"><tr valign="top"><br />
<td><br />
* action=0 - sets tint for text foreground colour<br />
* action=1 - sets tint for text background colour<br />
<td><br />
* action=2 - sets tint for graphics foreground colour<br />
* action=3 - sets tint for graphics background colour<br />
</table><br />
<br />
The tint is passed in the top two bits of ''tint'' (allowing a further six<br />
bits of colour depth), so the normal range is &00, &40, &80, &80 darkest to<br />
lightest.<br />
<br />
The BASIC keyword [[TINT]] sends a VDU 23,17 sequence.<br />
<br />
=== VDU 23,17,4 - Select colour patterns ===<br />
VDU 23,17,4,pattern,0,0,0,0,0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
Selects which colour patterns future VDU 23,2-5 calls use.<br />
<br />
* pattern=0 - use BBC/Master compatible colour patterns<br />
* pattern=1 - use native RISC OS colour patterns<br />
<br />
=== VDU 23,17,5 - Swap text colours ===<br />
VDU 23,17,5,0,0,0,0,0,0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
After this command, characters are effectively printed in inverse video.<br />
After repeating the command, characters are effectively printed back in<br />
normal video.<br />
<br />
=== VDU 23,17,6 - Set ECF origin ===<br />
VDU 23,17,6,x;y;0,0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
Set Extended Colour Fill origin. By default, EFC patterns fill aligned with<br />
the bottom lefthand corner of the screen. This command changes this so that<br />
the bottom lethand pixel of the fill pattern is aligned with the specified<br />
point.<br />
<br />
=== VDU 23,17,7 - Set character size and spacing ===<br />
VDU 23,17,7,flags,xsize;ysize;0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
This allows the character size and spacing of text printed in VDU 5 mode<br />
(text at graphics cursor) to be changed. If bit 1 of flags is set, the text<br />
size is changed, if bit 2 is set, the spacing is changed. xsize and ysize<br />
are specified in pixels.<br />
<br />
== VDU 23,18 - Set Teletext display characteristics<ref>http://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Kernel/Docs/HiResTTX?hideattic=0;only_with_tag=HAL</ref>, <ref>http://riscos.com/support/developers/riscos6/graphics/teletext.html</ref> ==<br />
VDU 23,18,setting,mode,0,0,0,0,0,0<br><br />
<br />
Some implementations implement VDU 23,18 as:<br><br />
VDU 23,18,setting,mode,mask,0,0,0,0,0<br><br />
where the ''newmode'' = (''oldmode'' AND ''mask'') EOR ''mode'', which is compatible with mode,0 to write the whole setting in one go.<br />
<br />
<table width="100%"><br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,0,mode,mask,0,0,0,0,0 - Set Teletext transparency mode (RISC OS 5 onwards) ===<br />
<tr valign="top"><td>mode=0:<td> "Text" mode: the whole display is set opaque (default)<br />
<tr valign="top"><td>mode=1:<td>"Mix" mode: foreground colours, and both foreground and background of boxed text are opaque; non-boxed background colours are all transparent<br />
<tr valign="top"><td>mode=2:<td>"Box" mode: boxed regions are opaque, others are transparent<br />
<tr valign="top"><td>mode=3:<td>"TV" mode: the whole display is set transparent<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,1,flags,mask,0,0,0,0,0 - Set Teletext display update (RISC OS 5 onwards, RISC OS Select 4 onwards, RISC OS Pyromaniac 7.47 onwards) ===<br />
This sets how often the teletext screen is updated. Two bits are currently defined:<br />
<tr valign="top"><td>bit 0 =<td>suspend all automatic display update<br />
<tr valign="top"><td>bit 1 =<td>update display after every character<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,2,flags,mask,0,0,0,0,0 - Set Teletext reveal state (RISC OS 5 onwards, Brandy, RISC OS Select 4 onwards, RISC OS Pyromaniac 7.47 onwards) ===<br />
<tr valign="top"><td>bit 0 =<td>if set, any concealed text will be displayed. If cleared, concealed text is concealed.<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,3,enable,mask,0,0,0,0,0 - Set Teletext control character extension enable (RISC OS 5 onwards, Brandy) ===<br />
<tr valign="top"><td>bit 0 =<td>0: &80/&90 do nothing, 1: &80 selects black text, &90 selects black graphics<br />
<tr valign="top"><td>bit 1 =<td>0: &8E/&8F do nothing, 1: &8E selects wide text, &8F selects wide X high text<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,4,fontLo,fontHi,0,0,0,0,0 - Set Teletext font ===<br />
Selects teletext character font, numbering as for SAA505x series.<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,16,flags,mask,0,0,0,0,0 - Set Teletext display characteristics (RISC OS 5 onwards, RISC OS Select 4 onwards, RISC OS Pyromaniac 7.47 onwards) ===<br />
<tr valign="top"><td>bit 0 =<td>render high quality text<br />
<br />
<br />
</table><br />
<br />
== VDU 23,19-21 - Unused ==<br />
VDU 23,19-21,a,b,c,d,e,f,g,h<br />
<br />
Reserved for future expansion, passed to VDUV.<br />
<br />
== VDU 23,22 - Select user defined screen mode ==<br />
VDU 23,22,xpixels;ypixels;xchars,ychars,colours,flags (BBFW, BBCSDL, Brandy (without flags))<br />
<br />
This command selects a specified user-defined mode. Flags specified the<br />
following:<br />
<br />
* b0-b3=0 - ANSI character set<br />
* b0-b3=1 - OEM (IBM PC) character set<br />
* b0-b3=8 - UTF-8 (Unicode) character set<br />
* b7=0 - white text on black background<br />
* b7=1 - black text on white background<br />
<br />
== VDU 23,23 - Set linedraw thickness ==<br />
VDU 23,23,t,0,0,0,0,0,0,0 (BBFW, BBCSDL)<br />
<br />
This command sets the width in pixels of lines drawn with [[VDU 25|PLOT]]<br />
commands.<br />
<br />
== VDU 23,24 - Set character spacing adjustment ==<br />
VDU 23,24,a,0,0,0,0,0,0,0 (BBCSDL)<br />
<br />
Adjusts the character spacing when a TTF or OTF font has been selected. The parameter is a signed number of pixels, negative values reduce the character spacing and positive values increase the character spacing.<br />
<br />
== VDU 23,25 - Anti-aliasing functions ==<br />
=== VDU 23,25,0-4 - Set anti-aliasing transfer function ===<br />
VDU 23,25,bitsperpixel,threshold1,...,theshold7 (Communicator, Arthur 1.00 onwards, not BBFW)<br />
<br />
''bitsperpixel'' specify the number of bits per pixel to use when<br />
anit-alising fonts. ''threshold1'' to ''threshold7'' are used to decide<br />
which output bits are produced from the original values (0 to 15). There are<br />
either one, three or seven of them depending on the number of bits per<br />
pixel. For example:<br />
<br />
VDU 23,25,3,2,4,6,8,10,12,14<br />
<br />
translates the values 0-15 to 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7.<br />
<br />
=== VDU 23,25,&80+ - Set anti-aliasing pallette ===<br />
VDU 23,25,&80+logical background colour,logical foreground colour,start R,start G,start B,end R,end G,end B (Communicator, Arthur 1.00 onwards, not BBFW)<br />
<br />
This command sets the physical colour range to use when anti-aliasing<br />
between the two specified logical colours.<br />
<br />
=== VDU 23,25,&FF - Set anti-aliasing pallette in 256-colour modes ===<br />
VDU 23,25,&FF,logicalcolour,start R,start G,start B,end R,end G,end B (Communicator, Arthur 1.00 onwards, not BBFW)<br />
<br />
This command sets the physical colour range to use when anti-aliasing<br />
between the background and the specified logical foreground colour in<br />
256-colour screen modes.<br />
<br />
== VDU 23,26 - Select font ==<br />
VDU 23,26,fontnumber,size,xppi,yppi,xscale,yscale,0,0,fontname,13 (Communicator, Arthur 1.00 onwards, not BBFW)<br />
<br />
This selects the name font at the specified size for future use when<br />
selecting font ''fontnumber''. The font name is sent as a CR-terminated<br />
sequence immediately after the VDU 23 sequence.<br />
<br />
* ''fontnumber'' - the font handle that will be used to select the specified font<br />
* ''size'' - font size in points<br />
* ''xppi'' - if nonzero, specifies the number of horizontal pixels per inch<br />
* ''yppi'' - if nonzero, specifies the number of vertical pixels per inch<br />
* ''xscale'' - if nonzero, multiplier for font size width<br />
* ''yscale'' - if nonzero, multiplier for font size height<br />
<br />
''xscale'' and ''yscale'' allow non-integer font sizes to be selected, and<br />
allow the horizontal and vertical font sizes to be different. For example,<br />
using VDU 23,26,fontnumber,1,xppi,yppi,10,12,0,0,fontname,13 will set the<br />
horizontal point size to 1*10 and the vertical font size to 1*12.<br />
<br />
== VDU 23,27 - Sprite operation ==<br />
VDU 23,27,m,n,0,0,0,0,0,0 (GXR, SpriteROM, Arthur 1.00 onwards, not BBFW)<br />
<br />
This command performs various sprite operations, depending on the value of<br />
''m''.<br />
<br />
If m=0, then sprite ''n'' is selected to be plotted by subsequent<br />
[[VDU 25|PLOT &EC+k]] commands.<br />
<br />
If m=1, then the rectangular area between the last two graphics points is<br />
uses to define sprite ''n''.<br />
<br />
== VDU 23,28-31 - User calls ==<br />
VDU 23,28-31,a,b,c,d,e,f,g,h (OS 0.10 onwards)<br />
<br />
Reserved for user calls. These are defined to vector through VDUV, and will<br />
never be used for inbuilt functions.<br />
<br />
== References ==<br />
<references /></div>Gerphhttp://beebwiki.mdfs.net/index.php?title=VDU_23&diff=4543VDU 232023-10-27T19:57:40Z<p>Gerph: Also supported on RISC OS Select 4+</p>
<hr />
<div>[[Category:VDU commands]]__NOTOC__<br />
== Description ==<br />
Defines a character or performs various miscellaneous VDU functions.<br />
Unrecognised or unimplemented commands are passed to [[VDUV]], on platforms<br />
where VDUV is implemented.<br />
<br />
{| class="wikitable"<br />
|+ VDU 23<br />
|- style="vertical-align:top"<br />
|<br />
[[BASIC metasyntax|Syntax]]<br />
|<br />
<code>VDU 23,</code><numeric><code>,</code><numeric><code>,</code><br />
<numeric><code>,</code><numeric><code>,</code><numeric><code>,</code><br />
<numeric><code>,</code><numeric><code>,</code><numeric><code>,</code><br />
<numeric><br><br />
In BASIC IV onwards, <code>&#124;</code> can be used to terminate a VDU sequence with 9 zeroes, eg <code>VDU 23;</code><numeric><code>,</code><numeric><code>&#124;</code><br />
|- style="vertical-align:top"<br />
|<br />
Character stream (hex)<br />
|<br />
<code>17</code> <action><br />
<param1> <param2> <param3> <param4> <param5> <param6> <param7> <param8><br />
|- style="vertical-align:top"<br />
|<br />
Description<br />
|<br />
Defines a character or performs various miscellaneous VDU functions.<br />
|}<br />
<br />
== Summary ==<br />
<table><tr valign="top"><br />
<td><br />
* [[VDU_23#VDU_23.2C0_-_CRTC_register_programming|VDU 23,0]] - CRTC register programming<br />
* [[VDU_23#VDU_23.2C1_-_Cursor_control|VDU 23,1]] - Cursor control<br />
* [[VDU_23#VDU_23.2C2-5_-_Define_ECF_pattern|VDU 23,2]] - Define ECF pattern 1<br />
* [[VDU_23#VDU_23.2C2-5_-_Define_ECF_pattern|VDU 23,3]] - Define ECF pattern 2<br />
* [[VDU_23#VDU_23.2C2-5_-_Define_ECF_pattern|VDU 23,4]] - Define ECF pattern 3<br />
* [[VDU_23#VDU_23.2C2-5_-_Define_ECF_pattern|VDU 23,5]] - Define ECF pattern 4<br />
* [[VDU_23#VDU_23.2C6_-_Set_dotted_line_pattern|VDU 23,6]] - Set dotted line pattern<br />
* [[VDU_23#VDU_23.2C7_-_Scroll_rectangle_on_screen|VDU 23,7]] - Scroll rectangle on screen<br />
* [[VDU_23#VDU_23.2C8_-_Clear_block|VDU 23,8]] - Clear block<br />
* [[VDU_23#VDU_23.2C9_-_Set_flash_mark_period|VDU 23,9]] - Set flash mark period<br />
* [[VDU_23#VDU_23.2C10_-_Set_flash_space_period|VDU 23,10]] - Set flash space period<br />
* [[VDU_23#VDU_23.2C11_-_Set_default_ECF_patterns|VDU 23,11]] - Set default ECF patterns<br />
* [[VDU_23#VDU_23.2C12-15_-_Set_simple_ECF_pattern|VDU 23,12]] - Set simple ECF pattern 1<br />
* [[VDU_23#VDU_23.2C12-15_-_Set_simple_ECF_pattern|VDU 23,13]] - Set simple ECF pattern 2<br />
* [[VDU_23#VDU_23.2C12-15_-_Set_simple_ECF_pattern|VDU 23,14]] - Set simple ECF pattern 3<br />
* [[VDU_23#VDU_23.2C12-15_-_Set_simple_ECF_pattern|VDU 23,15]] - Set simple ECF pattern 4<br />
<td><br />
* [[VDU_23#VDU_23.2C16_-_Define_cursor_movement|VDU 23,16]] - Define cursor movement<br />
* [[VDU_23#VDU_23.2C17_-_Set_subsidary_colour_effects|VDU 23,17]] - Set subsidary colour effects<br />
* [[VDU_23#VDU_23.2C18_-_Set_Teletext_display_characteristics.5B1.5D|VDU 23,18]] - Set Teletext display characteristics<br />
* [[VDU_23#VDU_23.2C19-21_-_Unused|VDU 23,19]] - Unused<br />
* [[VDU_23#VDU_23.2C19-21_-_Unused|VDU 23,20]] - Unused<br />
* [[VDU_23#VDU_23.2C19-21_-_Unused|VDU 23,21]] - Unused<br />
* [[VDU_23#VDU_23.2C22_-_Select_user_defined_screen_mode|VDU 23,22]] - Select user defined screen mode<br />
* [[VDU_23#VDU_23.2C23_-_Set_linedraw_thickness|VDU 23,23]] - Set linedraw thickness<br />
* [[VDU_23#VDU_23.2C24_-_Set_character_spacing_adjustment|VDU 23,24]] - Set character spacing adjustment<br />
* [[VDU_23#VDU_23.2C25.2C0-4_-_Set_anti-aliasing_transfer_function|VDU 23,25]] - Set anti-aliasing transfer function<br />
* [[VDU_23#VDU_23.2C26_-_Select_font|VDU 23,26]] - Select font<br />
* [[VDU_23#VDU_23.2C27_-_Sprite_operation|VDU 23,27]] - Sprite operation<br />
* [[VDU_23#VDU_23.2C28-31_-_User_calls|VDU 23,28]] - Reserved for user calls<br />
* [[VDU_23#VDU_23.2C28-31_-_User_calls|VDU 23,29]] - Reserved for user calls<br />
* [[VDU_23#VDU_23.2C28-31_-_User_calls|VDU 23,30]] - Reserved for user calls<br />
* [[VDU_23#VDU_23.2C28-31_-_User_calls|VDU 23,31]] - Reserved for user calls<br />
* [[VDU_23#VDU_23.2C32-255_-_Define_character|VDU 23,32-255]] - Define character<br />
</table><br />
<br />
== VDU 23,32-255 - Define character ==<br />
VDU 23,32-255,row1,row2,row3,row4,row5,row6,row7,row8 (OS 0.10 onwards)<br />
[[Image:User defined stick figure.png|right|Defining a stick figure with VDU 23]]<br />
<br />
In this type of command, all nine parameters are used.<br />
<br />
The first parameter selects the character to be defined, and the other eight<br />
encode an 8&times;8 monochrome bitmap that [[OSWRCH]] will print for that<br />
character in future (through [[VDUCHR]]).<br />
<br />
The first byte of the bitmap (the second parameter) carries the top row of<br />
the bitmap. The most significant bit corresponds to the leftmost column. A<br />
binary 1 represents the foreground <code>[[COLOUR]]</code> (usually white),<br />
binary 0 the background <code>COLOUR</code> (usually black.)<br />
<br />
For example, the stick figure character printed in the ''User Guide'' (and<br />
above) can be defined with the following sequence:<br />
<br />
VDU 23,224,28,28,8,127,8,20,34,65<br />
<br />
When the character is printed, such as by<br />
<br />
VDU 224<br />
<br />
the figure will typically appear in ''white'' on a ''black'' background,<br />
that is, in the negative compared to the image above.<br />
<br />
Depending on the [[OSBYTE &14|font explode state]] a number of other<br />
characters will simultaneously be assigned that bitmap. The font is ''not''<br />
ordinarily transferred to the printer.<br />
<br />
In <code>[[MODE 7]]</code> the user defined character has no effect on the<br />
[[Teletext]] hardware, but the definition is stored for later use. In the<br />
bitmapped <code>MODE</code>s the new definition does not change the<br />
appearance of copies of that character already on screen; [[OSBYTE &87]]<br />
will no longer recognise them as that character.<br />
<br />
The character definition can be read with [[OSWORD &0A]]. Note that character<br />
127 can be defined with VDU 23,127, but can never be printed. The definition<br />
can be read with OSWORD &0A.<br />
<br />
== VDU 23,0 - CRTC register programming ==<br />
VDU 23,0,register,value,0,0,0,0,0,0 (OS 0.10 onwards)<br />
<br />
In this command, <code>VDU 23</code> programs the 6845 register <register><br />
(or emulated register) with value <value>. For the functions of each<br />
register, see [[CRTC]].<br />
<br />
Platforms without a hardware 6845 CRTC, such as [[RISC OS]] and<br />
[[80x86 BBC BASIC|BBC BASIC for Windows]], partly emulate the CRTC so that<br />
cursor appearance and screen interlace can be controlled with <code>VDU<br />
23</code>. The statement <code>VDU 23;8202;0;0;0;</code> which appears in<br />
many BBC Micro programs, also turns the cursor off in RISC OS, as it expands<br />
to VDU 23,0,10,32;0;0;0.<br />
<br />
Note that this command can 'unprogram' the current <code>[[MODE]]</code> so<br />
that a full DRAM refresh is no longer performed. This coupled with a tight<br />
machine code loop erases most of the I/O processor's memory, with disastrous<br />
results.<br />
<br />
Some BASIC programs contain embedded <code>VDU 23</code> sequences in<br />
<code>[[REM]]</code> statements to protect themselves against being<br />
<code>[[LIST]]</code>ed; for instance, Ducksoft's ''Tom Pinone Poker''.<br />
<br />
== VDU 23,1 - Cursor control ==<br />
VDU 23,1,state,0,0,0,0,0,0,0 (OS 1.00 onwards)<br />
<br />
This subcommand turns the cursor on or off. The defined values of<br />
<state> are:<br />
<table width="100%"><tr valign="top"><br />
<td><br />
* 0 - off<br />
* 1 - on<br />
<td><br />
* 2 - steady (MOS 3 onwards)<br />
* 3 - flashing (MOS 3 onwards)<br />
</table><br />
<br />
Note that the cursor will re-appear if cursor editing is used.<br />
<br />
== VDU 23,2-5 - Define ECF pattern ==<br />
VDU 23,2-5,row1,row2,row3,row4,row5,row6,row7,row8 (GXR, MOS 3.00 onwards, not BBFW)<br />
<br />
This defines Extended Colour Fill patterns (ECFs) 1 to 4. They are<br />
selectable for plotting with GCOL 16*ECF,0.<br />
<br />
As the fill patterns are mapped to the pixel layout of each screen mode,<br />
they are defined differently for different colour depths. On RISC OS, ECF<br />
patterns can be defined in BBC/Master compatible mode or in RISC OS native<br />
mode. To change between the modes, VDU 23,17,4 is used.<br />
<br />
Numbering the pixels of each row as 76543210 give the following arrangement:<br />
<br />
* 2-colour modes: 7,6,5,4,3,2,1,0 (BBC) 0,1,2,3,4,5,6,7 (RISC OS)<br />
* 4-colour modes: 73,62,51,40 (BBC) 10,32,54,76 (RISC OS)<br />
* 16-colour modes: 7531,6420 (BBC) 3210,7654 (RISC OS)<br />
* 256-colour modes: 76543210 (BBC) 76543210 (RISC OS)<br />
<br />
The ECFs are readable with [[OSWORD &0A|OSWORD 10,2-5]].<br />
<br />
== VDU 23,6 - Set dotted line pattern ==<br />
VDU 23,6,n1,n2,n3,n4,n5,n6,n7,n8 (GXR, MOS 3.00 onwards, not BBFW)<br />
<br />
This sets the dotted line pattern used by dotted [[VDU 25|PLOT]] commands.<br />
The pattern length is set with [[OSBYTE &A3|*FX163,242]]. The default is<br />
&AA, length 8, as prior to MOS 3.00. The pattern is readable with<br />
[[OSWORD &0A|OSWORD 10,6]], and the repeat length is read with<br />
[[OSBYTE &A3|OSBYTE 163,242]].<br />
<br />
== VDU 23,7 - Scroll rectangle on screen ==<br />
VDU 23,7,extent,direction,movement,0,0,0,0,0 (OS 3.00 onwards)<br />
<br />
This command will scroll the whole screen, or the current text window, in<br />
any direction.<br />
<br />
<table width="100%"><tr valign="top"><br />
<td colspan="2"><br />
* extent=0 - scroll the current text window<br />
* extent=1 - scroll the entire screen<br />
<tr valign="top"><br />
<td><br />
* direction=0 - scroll right<br />
* direction=1 - scroll left<br />
* direction=2 - scroll down<br />
* direction=3 - scroll up<br />
<td><br />
* direction=4 - scroll in positive X direction<br />
* direction=5 - scroll in negative X direction<br />
* direction=6 - scroll in positive Y direction<br />
* direction=7 - scroll in negative Y direction<br />
<tr valign="top"><br />
<td colspan="2"><br />
* movement=0 - scroll by 1 character cell<br />
* movement=1 - scroll by 1 character cell vertically, or 1 byte horizontally (not BBFW)<br />
</table><br />
<br />
When scrolling by a byte horizontally, the movement depends on the colour<br />
depth of the current mode:<br />
<br />
<table width="100%"><tr valign="top"><br />
<td colspan="2"><br />
* 8 pixels in 2-colour modes<br />
* 4 pixels in 4-colour modes<br />
* 2 pixels in 16-colour modes<br />
* 1 pixel in 256-colour modes<br />
</table><br />
<br />
Note that the cursor is never moved.<br />
<br />
== VDU 23,8 - Clear block ==<br />
VDU 23,8,t1,t2,x1,y1,x2,y2,0,0 (OS 3.00 onwards, not BBFW)<br />
<br />
This will clear a block of the current text window to the current text<br />
background colour.<br />
<br />
* <t1> and <t2> define the type of block to be cleared<br />
* <x1>,<y1> defines the start position of the block as specified by <t1><br />
* <x2>,<y2> defines the end position of the block as specified by <t2><br />
The <t1> and <t2> control bytes specify the location as:<br />
<table width="100%"><tr valign="top"><br />
<td><br />
* 0 - top left of text window<br />
* 4 - left end of cursor line<br />
* 8 - bottom left of text window<br />
<td><br />
* 1 - top of cursor column<br />
* 5 - cursor position<br />
* 9 - bottom of cursor column<br />
<td><br />
* 2 - off top right of text window<br />
* 6 - off right of cursor line<br />
* 10 - off bottom right of text window<br />
</table><br />
<br />
Note that 'left', 'up', etc are dependent on the direction of cursor<br />
movement as defined with VDU 23,16.<br />
<br />
<x1>,<y1>,<x2>,<y2> are from the positions specified by <t1> and <t2> and<br />
determine the start and end of the block to be cleared. If <t1> and <t2><br />
are both 0, then <x1>,<y1>,<x2>,<y2> specify a block within the current text<br />
window in the same manner as [[VDU 28]] defines the text window.<br />
<br />
Values of <t1> and <t2> other than those listed produce undefined results.<br />
<br />
No clearing will occur if the end point is before the start point.<br />
<br />
== VDU 23,9 - Set flash mark period ==<br />
VDU 23,9,period,0,0,0,0,0,0,0 (OS 3.00 onwards, not BBFW)<br />
<br />
Set flash mark period (the time the first flash colour is visible) in the<br />
number of VSyncs (usually 1/50s), as with [[OSBYTE &09|*FX9]]. If the period<br />
is 0, the first flash colour is displayed continously.<br />
<br />
== VDU 23,10 - Set flash space period ==<br />
VDU 23,10,period,0,0,0,0,0,0,0 (OS 3.00 onwards, not BBFW)<br />
<br />
Set flash space period (the time the second flash colour is visible) in the<br />
number of VSyncs (usually 1/50s), as with [[OSBYTE &0A|*FX10]]. If the<br />
period is 0, the second flash colour is displayed continuously.<br />
<br />
== VDU 23,11 - Set default ECF patterns ==<br />
VDU 23,11,0,0,0,0,0,0,0,0 (GXR, OS 3.00 onwards, not BBFW)<br />
<br />
This command resets all the Extended Colour Fill (ECF) patterns to the<br />
default for the current screen mode.<br />
<br />
== VDU 23,12-15 - Set simple ECF pattern ==<br />
VDU 23,12-15,a,b,c,d,e,f,g,h (GXR, OS 3.00 onwards, not BBFW)<br />
<br />
Defines Extended Colour Fill (ECF) patterns 1 to 4 in a simpler manner than<br />
VDU 23,2-5. The ECF is defined as a repeated block of four lines of two<br />
repeated pixels.<br />
<br />
The first pixel line uses alternative pixels of colours ''a'',''b''; the<br />
second pixel line uses alternative pixels of colours ''c'',''b'', etc.<br />
<br />
== VDU 23,16 - Define cursor movement ==<br />
VDU 23,16,setting,mask,0,0,0,0,0,0 (OS 3.00 onwards)<br />
<br />
This allows the direction the cursor moves after a character is printed to<br />
be specified. Normal cursor movement is to the right, and then wrapping off<br />
the edge of the screen or window and then downwards. VDU 23,16 changes these<br />
directions, and all other commands that move or set the position of the text<br />
cursor.<br />
<br />
The new direction is specified with (''old status'' AND ''mask'') EOR ''setting'',<br />
and the new status is interpreted as follows:<br />
<br />
<table><br />
<tr valign="top"><td>b7=0<td>normal value<br />
<tr valign="top"><td>b7=1<td>undefined<br />
<tr valign="top"><td>b6=0<td>In VDU 5 (text at graphics cursor) mode, movement beyond the edge of the window causes an implicit carriage return/linefeed to the next positive Y line.<br />
<tr valign="top"><td>b6=1<td>In VDU 5 (text at graphics cursor) mode, movement beyond the edge of the window causes no action, and the text 'continues' invisibly off the edge of the window.<br />
<tr valign="top"><td>b5=0<td>Cursor moves in positive X direction after a character is printed.<br />
<tr valign="top"><td>b5=1<td>Cursor does not move after a character is printed.<br />
<tr valign="top"><td>b4=0<td>Cursor movement in the positive Y direction past the bottom of the text window causes the text window to scroll in VDU 4 (text) mode, or moved to the opposite edge of the window in VDU 5 (text at graphics cursor) mode.<br />
<tr valign="top"><td>b4=1<td>Cursor movement in the positive Y direction past the bottom of the text window always causes the text cursor to be moved to the opposite edge of the window.<br />
</table><br />
<br />
<table><br />
<tr valign="top"><td colspan="4">b3,b2,b1 define the cursor directon as follows:<br />
<tr valign="top"><td>0<td>0<td>0<td>X direction is right, Y direction is down<br />
<tr valign="top"><td>0<td>0<td>1<td>X direction is left, Y direction is down<br />
<tr valign="top"><td>0<td>1<td>0<td>X direction is right, Y direction is up<br />
<tr valign="top"><td>0<td>1<td>1<td>X direction is left, Y direction is up<br />
<tr valign="top"><td>1<td>0<td>0<td>X direction is down, Y direction is right<br />
<tr valign="top"><td>1<td>0<td>1<td>X direction is down, Y direction is left<br />
<tr valign="top"><td>1<td>1<td>0<td>X direction is up, Y direction is right<br />
<tr valign="top"><td>1<td>1<td>1<td>X direction is up, Y direction is left<br />
</table><br />
<br />
<table><br />
<tr valign="top"><td>b0=0<td>disables scroll protection, the text cursor moving off the positive edge of the window will always move directly to the next line, scrolling the window if neccessary.<br />
<tr valign="top"><td>b0=1<td>enables scroll protection, the text cursor moving off the positive edge of the window generates a pending newline, and waits at the edge of the window until the movement is needed. While the cursor is waiting, the cursor position returned by POS via [[OSBYTE &87]] is the maximum column position plus one, ie the window width (eg 80 in MODE 0). If the cursor is moved elsewhere, the pending newline is abandoned, and no scrolling occurs.<br />
</table><br />
<br />
== VDU 23,17 - Set subsidary colour effects ==<br />
=== VDU 23,17,0-3 - Set tint ===<br />
VDU 23,17,action,tint,0,0,0,0,0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
Sets the additional tint for the specified colour. COLOUR and GCOL can only<br />
specify 6-bit logical colours, so in 256-colour screen modes, VDU 23,17 is<br />
used to set the lowest two bits of the colour.<br />
<br />
<table width="100%"><tr valign="top"><br />
<td><br />
* action=0 - sets tint for text foreground colour<br />
* action=1 - sets tint for text background colour<br />
<td><br />
* action=2 - sets tint for graphics foreground colour<br />
* action=3 - sets tint for graphics background colour<br />
</table><br />
<br />
The tint is passed in the top two bits of ''tint'' (allowing a further six<br />
bits of colour depth), so the normal range is &00, &40, &80, &80 darkest to<br />
lightest.<br />
<br />
The BASIC keyword [[TINT]] sends a VDU 23,17 sequence.<br />
<br />
=== VDU 23,17,4 - Select colour patterns ===<br />
VDU 23,17,4,pattern,0,0,0,0,0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
Selects which colour patterns future VDU 23,2-5 calls use.<br />
<br />
* pattern=0 - use BBC/Master compatible colour patterns<br />
* pattern=1 - use native RISC OS colour patterns<br />
<br />
=== VDU 23,17,5 - Swap text colours ===<br />
VDU 23,17,5,0,0,0,0,0,0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
After this command, characters are effectively printed in inverse video.<br />
After repeating the command, characters are effectively printed back in<br />
normal video.<br />
<br />
=== VDU 23,17,6 - Set ECF origin ===<br />
VDU 23,17,6,x;y;0,0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
Set Extended Colour Fill origin. By default, EFC patterns fill aligned with<br />
the bottom lefthand corner of the screen. This command changes this so that<br />
the bottom lethand pixel of the fill pattern is aligned with the specified<br />
point.<br />
<br />
=== VDU 23,17,7 - Set character size and spacing ===<br />
VDU 23,17,7,flags,xsize;ysize;0,0 (Arthur 1.00 onwards, not BBFW)<br />
<br />
This allows the character size and spacing of text printed in VDU 5 mode<br />
(text at graphics cursor) to be changed. If bit 1 of flags is set, the text<br />
size is changed, if bit 2 is set, the spacing is changed. xsize and ysize<br />
are specified in pixels.<br />
<br />
== VDU 23,18 - Set Teletext display characteristics<ref>http://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Kernel/Docs/HiResTTX?hideattic=0;only_with_tag=HAL</ref> ==<br />
VDU 23,18,setting,mode,0,0,0,0,0,0<br><br />
<br />
Some implementations implement VDU 23,18 as:<br><br />
VDU 23,18,setting,mode,mask,0,0,0,0,0<br><br />
where the ''newmode'' = (''oldmode'' AND ''mask'') EOR ''mode'', which is compatible with mode,0 to write the whole setting in one go.<br />
<br />
<table width="100%"><br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,0,mode,mask,0,0,0,0,0 - Set Teletext transparency mode (RISC OS 5 onwards) ===<br />
<tr valign="top"><td>mode=0:<td> "Text" mode: the whole display is set opaque (default)<br />
<tr valign="top"><td>mode=1:<td>"Mix" mode: foreground colours, and both foreground and background of boxed text are opaque; non-boxed background colours are all transparent<br />
<tr valign="top"><td>mode=2:<td>"Box" mode: boxed regions are opaque, others are transparent<br />
<tr valign="top"><td>mode=3:<td>"TV" mode: the whole display is set transparent<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,1,flags,mask,0,0,0,0,0 - Set Teletext display update (RISC OS 5 onwards) ===<br />
This sets how often the teletext screen is updated. Two bits are currently defined:<br />
<tr valign="top"><td>bit 0 =<td>suspend all automatic display upate<br />
<tr valign="top"><td>bit 1 =<td>update display after every character<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,2,flags,mask,0,0,0,0,0 - Set Teletext reveal state (RISC OS 5 onwards, Brandy) ===<br />
<tr valign="top"><td>bit 0 =<td>if set, any concealed text will be displayed. If cleared, concealed text is concealed.<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,3,enable,mask,0,0,0,0,0 - Set Teletext control character extension enable (RISC OS 5 onwards, Brandy) ===<br />
<tr valign="top"><td>bit 0 =<td>0: &80/&90 do nothing, 1: &80 selects black text, &90 selects black graphics<br />
<tr valign="top"><td>bit 1 =<td>0: &8E/&8F do nothing, 1: &8E selects wide text, &8F selects wide X high text<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,4,fontLo,fontHi,0,0,0,0,0 - Set Teletext font ===<br />
Selects teletext character font, numbering as for SAA505x series.<br />
<br />
<tr valign="top"><td colspan="2"><br />
=== VDU 23,18,16,flags,mask,0,0,0,0,0 - Set Teletext display characteristics (RISC OS 5 onwards, RISC OS Select 4 onwards) ===<br />
<tr valign="top"><td>bit 0 =<td>render high quality text<br />
<br />
<br />
</table><br />
<br />
== VDU 23,19-21 - Unused ==<br />
VDU 23,19-21,a,b,c,d,e,f,g,h<br />
<br />
Reserved for future expansion, passed to VDUV.<br />
<br />
== VDU 23,22 - Select user defined screen mode ==<br />
VDU 23,22,xpixels;ypixels;xchars,ychars,colours,flags (BBFW, BBCSDL, Brandy (without flags))<br />
<br />
This command selects a specified user-defined mode. Flags specified the<br />
following:<br />
<br />
* b0-b3=0 - ANSI character set<br />
* b0-b3=1 - OEM (IBM PC) character set<br />
* b0-b3=8 - UTF-8 (Unicode) character set<br />
* b7=0 - white text on black background<br />
* b7=1 - black text on white background<br />
<br />
== VDU 23,23 - Set linedraw thickness ==<br />
VDU 23,23,t,0,0,0,0,0,0,0 (BBFW, BBCSDL)<br />
<br />
This command sets the width in pixels of lines drawn with [[VDU 25|PLOT]]<br />
commands.<br />
<br />
== VDU 23,24 - Set character spacing adjustment ==<br />
VDU 23,24,a,0,0,0,0,0,0,0 (BBCSDL)<br />
<br />
Adjusts the character spacing when a TTF or OTF font has been selected. The parameter is a signed number of pixels, negative values reduce the character spacing and positive values increase the character spacing.<br />
<br />
== VDU 23,25 - Anti-aliasing functions ==<br />
=== VDU 23,25,0-4 - Set anti-aliasing transfer function ===<br />
VDU 23,25,bitsperpixel,threshold1,...,theshold7 (Communicator, Arthur 1.00 onwards, not BBFW)<br />
<br />
''bitsperpixel'' specify the number of bits per pixel to use when<br />
anit-alising fonts. ''threshold1'' to ''threshold7'' are used to decide<br />
which output bits are produced from the original values (0 to 15). There are<br />
either one, three or seven of them depending on the number of bits per<br />
pixel. For example:<br />
<br />
VDU 23,25,3,2,4,6,8,10,12,14<br />
<br />
translates the values 0-15 to 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7.<br />
<br />
=== VDU 23,25,&80+ - Set anti-aliasing pallette ===<br />
VDU 23,25,&80+logical background colour,logical foreground colour,start R,start G,start B,end R,end G,end B (Communicator, Arthur 1.00 onwards, not BBFW)<br />
<br />
This command sets the physical colour range to use when anti-aliasing<br />
between the two specified logical colours.<br />
<br />
=== VDU 23,25,&FF - Set anti-aliasing pallette in 256-colour modes ===<br />
VDU 23,25,&FF,logicalcolour,start R,start G,start B,end R,end G,end B (Communicator, Arthur 1.00 onwards, not BBFW)<br />
<br />
This command sets the physical colour range to use when anti-aliasing<br />
between the background and the specified logical foreground colour in<br />
256-colour screen modes.<br />
<br />
== VDU 23,26 - Select font ==<br />
VDU 23,26,fontnumber,size,xppi,yppi,xscale,yscale,0,0,fontname,13 (Communicator, Arthur 1.00 onwards, not BBFW)<br />
<br />
This selects the name font at the specified size for future use when<br />
selecting font ''fontnumber''. The font name is sent as a CR-terminated<br />
sequence immediately after the VDU 23 sequence.<br />
<br />
* ''fontnumber'' - the font handle that will be used to select the specified font<br />
* ''size'' - font size in points<br />
* ''xppi'' - if nonzero, specifies the number of horizontal pixels per inch<br />
* ''yppi'' - if nonzero, specifies the number of vertical pixels per inch<br />
* ''xscale'' - if nonzero, multiplier for font size width<br />
* ''yscale'' - if nonzero, multiplier for font size height<br />
<br />
''xscale'' and ''yscale'' allow non-integer font sizes to be selected, and<br />
allow the horizontal and vertical font sizes to be different. For example,<br />
using VDU 23,26,fontnumber,1,xppi,yppi,10,12,0,0,fontname,13 will set the<br />
horizontal point size to 1*10 and the vertical font size to 1*12.<br />
<br />
== VDU 23,27 - Sprite operation ==<br />
VDU 23,27,m,n,0,0,0,0,0,0 (GXR, SpriteROM, Arthur 1.00 onwards, not BBFW)<br />
<br />
This command performs various sprite operations, depending on the value of<br />
''m''.<br />
<br />
If m=0, then sprite ''n'' is selected to be plotted by subsequent<br />
[[VDU 25|PLOT &EC+k]] commands.<br />
<br />
If m=1, then the rectangular area between the last two graphics points is<br />
uses to define sprite ''n''.<br />
<br />
== VDU 23,28-31 - User calls ==<br />
VDU 23,28-31,a,b,c,d,e,f,g,h (OS 0.10 onwards)<br />
<br />
Reserved for user calls. These are defined to vector through VDUV, and will<br />
never be used for inbuilt functions.<br />
<br />
== References ==<br />
<references /></div>Gerphhttp://beebwiki.mdfs.net/index.php?title=OSBYTE_%2681&diff=3285OSBYTE &812020-02-03T22:34:20Z<p>Gerph: Add Pyromaniac as &AE; it's similar to Springboard, but it's definitely RISC OS.</p>
<hr />
<div>[[Category:OSBYTE]]<br />
OSBYTE &81 (129) - Read Key with Time Limit or Machine Type. Called by BASIC's =[[INKEY]] function.<br />
<br />
Action: Read key with time limit<br />
On entry: X=0..255<br />
Y=0..127<br />
On exit: Cy=0 character read, Y=0, X=character read<br />
Cy=1, Y=255 timed out<br />
Cy=1, Y=27 ESCAPE was pressed<br />
The caller can test for either Y=0 or Cy=0 for a valid returned character.<br />
<br />
Action: Read OS version<br />
On entry: X=0<br />
Y=255<br />
On exit: X=value identifying the host OS<br />
X=&00 BBC A/B with OS 0.10<br />
X=&00 RM Nimus<br />
X=&01 Acorn Electron OS<br />
X=&FF BBC Micro OS 1.00/1.20/1.23, Reuters OS R0.3 with *UK<br />
X=&FE BBC Micro (American OS A1.0), Reuters OS R0.3 with *US<br />
X=&FE NetBSD<br />
X=&FD Master 128 MOS 3.20/3.50<br />
X=&FC BBC Micro (West German MOS) - see note<br />
X=&FC Windows 32<br />
X=&FB BBC B+ 64/128 (OS 2.00)<br />
X=&FB Beos (Brandy Basic)<br />
X=&FA Acorn Business Computer OS 1.00/2.00<br />
X=&FA Cambridge Workstation OS 2.10<br />
X=&FA DOS with DJGPP extender (Brandy Basic)<br />
X=&F9 Linux<br />
X=&F8 MacOS X (Brandy Basic)<br />
X=&F7 Master ET MOS 4<br />
X=&F7 FreeBSD<br />
X=&F6 OpenBSD<br />
X=&F5 Master Compact MOS 5<br />
X=&F5 Amiga (Brandy Basic)<br />
X=&F4 Master 128 MOS 3.26<br />
X=&F4 GNU FreeBSD (Brandy Basic)<br />
X=&F3 GNU (Brandy Basic)<br />
X=&Ex Spectrum<br />
X=&Dx Amstrad 464/664/6128, etc.<br />
X=&Cx Commodore 64/64+/128, etc.<br />
X=&Bx PDP11 Unix<br />
X=&B7 PDP11 Unix Version 7<br />
X=&B6 PDP11 Unix Version 6<br />
X=&Ax ARM-based systems<br />
X=&A0 Arthur 1.20<br />
X=&A1 RISC OS 2.00<br />
X=&A2 RISC OS 2.01<br />
X=&A3 RISC OS 3.0x<br />
X=&A4 RISC OS 3.1x<br />
X=&A5 RISC OS 3.50<br />
X=&A6 RISC OS 3.60<br />
X=&A7 RISC OS 3.7x<br />
X=&A8 RISC OS 4.0x<br />
X=&A9 RISC OS 4.3x<br />
X=&AA RISC OS 5.xx<br />
X=&AE RISC OS Pyromaniac<br />
X=&AF Springboard (An ARM-based development system plugged into a PC)<br />
X=&8x TI Calculator<br />
X=&68 6809 system<br />
X=&63 6309 system<br />
X=&73 BBC BASIC for ARM CPU on SDL abstraction (ie ASC"s")<br />
X=&57 BBC BASIC for Windows (ie ASC"W")<br />
X=&53 BBC BASIC for Intel CPU on SDL abstraction (ie ASC"S")<br />
<br />
The known examples of German BBC MOS return X=&FF.<br />
<br />
Action: Scan for a range of keys<br />
On entry: X=1..127 lowest internal key number to start at EOR &7F<br />
Y=255<br />
On exit: X=internal key number pressed (or 255 for none)<br />
<br />
Action: Scan for a particular key<br />
On entry: X=128..255 internal key number to scan for EOR &80<br />
Y=255<br />
On exit: X=Y=0 for as not pressed<br />
X=Y=255 the key was being pressed<br />
<br />
==Extensions==<br />
The parameter to OSBYTE &81 is a 16-bit number. The standard implementation interprets that as:<br />
<&8000 - wait for keypress<br />
&FF00+nn - scan for BBC keypress<br />
&FF00 - return host machine type<br />
<br />
A parameter of &8000-&FEFF is undefined. Some systems extend INKEY as follows:<br />
&FE00+nn - scan for low level DOS/Window VK_xxxx keypress (cZ80Tube, console library)<br />
&FC00+nn - scan for low level SDL1.2 SDK_xxx keypress (Brandy Basic SDL builds)<br />
&8000+nn - wait for keypress, return 16-bit character code (cZ80Tube, console library)<br />
<br />
==See Also==<br />
* http://mdfs.net/Docs/Comp/BBC/Osbyte80<br />
* http://mdfs.net/Docs/Comp/Acorn/HostVals<br />
* http://mdfs.net/Docs/Comp/Acorn/Hosts<br />
* [[What BASIC is running]]<br />
* Negative INKEY numbers<br />
<br />
==See Also==<br />
* http://mdfs.net/Docs/Comp/BBC/Osbyte80<br />
<br />
[[User:Jgharston|Jgharston]] 21:56, 26 May 2009 (UTC)<br />
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 05:20, 23 June 2018 (CEST)<br />
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 22:09, 25 August 2019 (CEST)</div>Gerph