When a character is read from the video driver the result depends on the mode. In text modes the ASCII code of the character at the cursor position will be returned, without moving the cursor. In graphics mode the palette colour of the pixel at the current beam position will be returned. This will be 0 or 1 in two colour mode, 0..3 in four colour mode, 1..15 in sixteen colour or attribute modes and 0..255 in 256 colour mode.
The escape sequence - esc ?
- is supported in text and
attribute graphics modes. It triggers the video channel to return the
current cursor coordinates as the next two characters read from
this channel. The coordinates will be returned in the same way as
they are specified for cursor positioning, ie. with a 20h
offset added on.
This is supported by graphics pages only (pixel and attribute modes).
The escape sequence - esc @
- will trigger the channel to
return the current graphics beam position as the next four bytes read
from the video page. The coordinates are returned in the same
format as they would be specified for an absolute beam position.