-
Notifications
You must be signed in to change notification settings - Fork 0
/
agon_VDU.txt
133 lines (117 loc) · 6.7 KB
/
agon_VDU.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
From BBC BASIC (from console8 Doc's 13/01/2024)
The VDU command interprets each of the integer values following the keyword as an ASCII value. Values between 0 and 255 are accepted, and are separated by commas. If the value is immediately followed by a semicolon ; then the value is a little-endian word from 0 to 65535.
Example:
VDU 25, 69, 640; 512;: Plot a dot in the center of the screen
From MOS (Version 1.03 or greater)
The VDU command accepts values between 0 and 255 and are separated by spaces.
Example:
VDU 17 15: Set the text foreground colour to 15
VDU Character Sequences
The aim is that the Agon’s VDP should be as compatible as practical with the BBC Micro’s VDU command, as well as the VDU commands supported by later versions of Acorn and R.T.Russell’s BBC BASICs. Where necessary, some extensions have been added to help facilitate the Agon’s unique features and architecture.
The following VDU sequences are supported:
VDU 0: Null (no operation)
VDU 4: Write text at text cursor
VDU 5: Write text at graphics cursor
VDU 7: Make a short beep (BEL)
VDU 8: Move cursor back one character
VDU 9: Move cursor forward one character
VDU 10: Move cursor down one line
VDU 11: Move cursor up one line
VDU 12: Clear text area (CLS)
VDU 13: Carriage return
VDU 14: Page mode ON (VDP 1.03 or greater)
VDU 15: Page mode OFF (VDP 1.03 or greater)
VDU 16: Clear graphics area (CLG)
VDU 17, colour: Define text colour (COLOUR)
VDU 18, mode, colour: Define graphics colour (GCOL mode, colour)
VDU 19, l, p, r, g, b: Define logical colour (COLOUR l, p / COLOUR l, r, g, b)
VDU 22, n: Select screen mode (MODE n)
VDU 23, n: Re-program display character / System Commands
VDU 24, left; bottom; right; top;: Set graphics viewport (VDP 1.04 or greater)
VDU 25, mode, x; y;: PLOT mode, x, y
VDU 26: Reset graphics and text viewports (VDP 1.04 or greater)
VDU 27, char: Output character to screen (Agon Console8 VDP 2.3.0 or later)
VDU 28, left, bottom, right, top: Set text viewport (VDP 1.04 or greater)
VDU 29, x; y;: Graphics origin
VDU 30: Home cursor
VDU 31, x, y: TAB(x, y)
VDU 127: Backspace
All other characters, i.e. those in the range of 32 to 126 and 128 to 255, are sent to the screen as ASCII, unaltered.
Any VDU command that is not recognised (such as VDU 1) will be ignored.
VDU 23, 0: VDP commands
VDU 23, 0 is reserved for commands sent to the VDP
VDU 23, 0, &80, n: General poll, which echoes back n to MOS (see Serial Protocol)
VDU 23, 0, &81, n: Set the keyboard locale (0=UK, 1=US, etc)
VDU 23, 0, &82: Request text cursor position
VDU 23, 0, &83, x; y;: Get ASCII code of character at character position x, y
VDU 23, 0, &84, x; y;: Get colour of pixel at pixel position x, y
VDU 23, 0, &85, channel, command, <args>: Send a command to the VDP Enhanced Audio API **
VDU 23, 0, &86: Fetch the screen dimensions
VDU 23, 0, &87: RTC control *
VDU 23, 0, &88, delay; rate; led: Keyboard Control *
VDU 23, 0, &89, command, [<args>]: Mouse control **
VDU 23, 0, &90, n, b1, b2, b3, b4, b5, b6, b7, b8: Redefine character n (0-255) with 8 bytes of data §
VDU 23, 0, &91: Reset all characters to original definition §
VDU 23, 0, &92, char, bitmapId;: Map character char to display bitmapId §§
VDU 23, 0, &94, n: Read colour palette entry n (returns a pixel colour data packet) §§
VDU 23, 0, &A0, bufferId, command, <args>: Send a command to the VDP Buffered Commands API **
VDU 23, 0, &A1: Update VDP (for exclusive use of the agon-flash tool) **
VDU 23, 0, &C0, n: Turn logical screen scaling on and off, where 1=on and 0=off *
VDU 23, 0, &C1, n: Switch legacy modes on or off **
VDU 23, 0, &C3: Flip the screen buffer (double-buffered modes only) or wait for VSYNC (all modes) **
VDU 23, 0, &FF: Switch to or resume terminal mode for CP/M (This will disable keyboard entry in BBC BASIC/MOS)
* Requires VDP 1.03 or above
** Requires VDP 1.04 or above
§ Requires Console8 VDP 2.3.0 or above
§§ Requires Console8 VDP 2.4.0 or above
Commands between &82 and &89 will return their data back to the eZ80 via the serial protocol.
NB:
Prior to MOS 1.03 these were indexed from &00, not &80. For example, VDU 23, 0, &02 to request the cursor position.
RTC control
VDU 23, 0, 7, 0: Read the RTC
VDU 23, 0, 7, 1, y, m, d, h, m, s: Set the RTC
Mouse control
Commands beginning with VDU 23, 0, &89 are reserved for mouse control, and are implemented from VDP 1.04 onwards.
VDU 23, 0, &89, 0: Enable the mouse
VDU 23, 0, &89, 1: Disable the mouse
VDU 23, 0, &89, 2: Reset the mouse
VDU 23, 0, &89, 3, cursorId;: Set mouse cursor
VDU 23, 0, &89, 4, x; y;: Set mouse cursor position
VDU 23, 0, &89, 5, x1; y1; x2; y2;: Reserved (Set mouse area - not yet implemented)
VDU 23, 0, &89, 6, sampleRate;: Set mouse sample rate
VDU 23, 0, &89, 7, resolution;: Set mouse resolution
VDU 23, 0, &89, 8, scaling: Set mouse scaling
VDU 23, 0, &89, 9, acceleration;: Set mouse acceleration
VDU 23, 0, &89, 10, wheelAcceleration; wheelAccHighByte: Set mouse wheel acceleration (accepts a 24-bit value)
VDU 23, 1: Cursor display
VDU 23, 1, 0: Disable the text cursor
VDU 23, 1, 1: Enable the text cursor
VDU 23, 7: Scrolling
VDU 23, 7, extent, direction, speed: Scroll the screen
VDU 23, 16: Define Cursor Behaviour (Requires VDP 1.04 or greater)
VDU 23, 16, setting, mask: Specify cursor behaviour by ANDing with mask then XORing with setting
VDU 23, 27: Bitmaps, sprites, and mouse cursor
VDU 23, 27 is reserved for the bitmap, sprite, and mouse cursor functionality
Bitmaps
VDU 23, 27, 0, n: Select bitmap n (equating to buffer ID numbered 64000+n)
VDU 23, 27, 1, w; h; b1, b2 ... bn: Load colour bitmap data into current bitmap
VDU 23, 27, 2, w; h; col1; col2;: Create a solid colour rectangular bitmap (col1 and col2 form a 32 bit number in RGBA colour range.)
VDU 23, 27, 3, x; y;: Draw current bitmap on screen at pixel position x, y (a valid bitmap must be selected first)
VDU 23, 27, &20, bufferId;: Select bitmap using a 16-bit buffer ID
VDU 23, 27, &21, w; h; format: Create bitmap from selected buffer
Sprites
VDU 23, 27, 4, n: Select sprite n
VDU 23, 27, 5: Clear frames in current sprite
VDU 23, 27, 6, n: Add bitmap n as a frame to current sprite (where bitmap’s buffer ID is 64000+n)
VDU 23, 27, 7, n: Activate n sprites
VDU 23, 27, 8: Select next frame of current sprite
VDU 23, 27, 9: Select previous frame of current sprite
VDU 23, 27, 10, n: Select the nth frame of current sprite
VDU 23, 27, 11: Show current sprite
VDU 23, 27, 12: Hide current sprite
VDU 23, 27, 13, x; y;: Move current sprite to pixel position x, y
VDU 23, 27, 14, x; y;: Move current sprite by x, y pixels
VDU 23, 27, 15: Update the sprites in the GPU
VDU 23, 27, 16: Reset bitmaps and sprites and clear all data
VDU 23, 27, 17: Reset sprites (only) and clear all data
VDU 23, 27, &26, n;: Add bitmap n as a frame to current sprite using a 16-bit buffer ID