The first TETRA belongs to the top left pixel. The second TETRA to the next pixel just to the right of it. Line by line from top to bottom, each TETRA in memory belongs to one pixel. The size of the video ram depends on the configuration. The default gives a frame buffer 640 pixel wide and 480 Pixel high. Other sizes are possible. It is possible to configure the visible size smaller than the size of the frame buffer; this leaves video ram, that is not visible (off screen video ram). It can be used to store bitmaps. These can be transfered to the visible part very fast using the GPU.
Index | Name | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00-01 | buttons | The value indicates which buttons are down when
the event happens:
| |||||||||||||||
02-03 | event | The event bits use MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON to indicate the button. Bit 0x04 (MK_SHIFT) is 1 for a down event, and 0 for an up event. If the down event is a double-click, the bit 0x08 (MK_CONTROL) is set in addition. A Mouse Move event is indicated by bit 0x80. | |||||||||||||||
04-05 | x | The x position where the event happens | |||||||||||||||
06-07 | y | The y position where the event happens | |||||||||||||||
08-11 | unused | ||||||||||||||||
12-13 | cx | the current x position of the mouse. | |||||||||||||||
14-15 | cy | the current y position of the mouse. |
Index | Name | Description |
---|---|---|
0x00 | command/status | see below. |
0x01-0x03 | command aux | see below. |
0x04-0x05 | x | new x position |
0x06-0x07 | y | new y position |
0x08-0x09 | w | width |
0x0a-0x0b | h | height |
0x0c-0x0d | cur_x | current x position |
0x0e-0x0f | cur_y | current y position |
0x10-0x17 | bba | bit block address |
0x18 | - | ignored |
0x19 | tbr | text background color red |
0x1a | tbg | text background color green |
0x1b | tbb | text background color blue |
0x1c | - | ignored |
0x1d | tfr | text foreground color red |
0x1e | tfg | text foreground color green |
0x1f | tfb | text foreground color blue |
0x20 | - | ignored |
0x21 | fr | fill color red |
0x22 | fg | fill color green |
0x23 | fb | fill color blue |
0x24 | - | ignored |
0x25 | lr | line color red |
0x26 | lg | line color green |
0x27 | lb | line color blue |
0x28-0x29 | cw | character width |
0x2a-0x2b | ch | character height |
0x2c-0x2f | - | unused |
0x30-0x31 | fw | frame width |
0x32-0x33 | fh | frame height |
0x34-0x35 | sh | screen width |
0x36-0x37 | sh | screen height |
The first 4 Byte (0-4) contain the command. Writing any of these bytes will trigger the execution of the command. The command may be split into a command number (byte 0) and some auxiliary information (1-3). The command number (byte 0) also serves as status byte. The most significant bit is an error indicator. Therefore reading a negativ status byte, indicates that an error has occured during the last operation. Reading the status byte will reset the error indicator. So reading the status byte twice will return a nonnegative value the second time (unless a new error has occured between the first and the second read). A zero status byte indicates that the GPU is idle and ready to receive new commands. A positive status byte indicates that the GPU is bussy. The values are device dependent. While the GPU is bussy, the effect of writing to the command byte is unspecified. You can, however, write to (or read from) all the other GPU registers. The values in the other registers will be used only when a GPU command starts executing.
Most commands require a position. The coordinates are either taken from Bytes 4,5 (x) and 6,7 (y) or from Bytes c,d (cur_x) and e,f (cur_y) (the current position). If appropriate, executing a command will update the values cur_x and cur_y to make the current position work like a cursor.
Bit Block transfers from/to non graphic memory need a physical target address. The address goes in the third OCTA, the bit block address (bba).
Some commands require, in addition, color information (Drawing of Text, Lines and Rectangles) this information comes in the fourth and fifth OCTA.
Commands that need new x, y information would primarily use byte 4 to 7. Alternatively the current x,y can be used. Width and height information can be provided in bytes 8, 9 (w) and 0xa, 0xb (w).
The sixth and seventh OCTA are read only. They provide information on the size of the system font, the frame size and the visible part of it.
Name | Value | Operation |
---|---|---|
SRCCOPY | 0xCC0020 | dest = source |
SRCPAINT | 0xEE0086 | dest = source OR dest |
SRCAND | 0x8800C6 | dest = source AND dest |
SRCINVERT | 0x660046 | dest = source XOR dest |
SRCERASE | 0x440328 | dest = source AND (NOT dest ) |
NOTSRCCOPY | 0x330008 | dest = (NOT source) |
NOTSRCERASE | 0x1100A6 | dest = (NOT src) AND (NOT dest) |
MERGECOPY | 0xC000CA | dest = (source AND pattern) |
MERGEPAINT | 0xBB0226 | dest = (NOT source) OR dest |
PATCOPY | 0xF00021 | dest = pattern |
PATPAINT | 0xFB0A09 | dest = DPSnoo |
PATINVERT | 0x5A0049 | dest = pattern XOR dest |
DSTINVERT | 0x550009 | dest = (NOT dest) |
BLACKNESS | 0x000042 | dest = BLACK |
WHITENESS | 0xFF0062 | dest = WHITE |
The GPU will raise an interrupt when the data transfer has completed.
The GPU will raise an interrupt when the data transfer has completed.
host | localhost | the host where the bus is located |
port | 9002 | the port where the bus is located |
address | 0x0002000000000000 | address where the video ram is located |
mouseaddress | 0x0001000000000010 | address where the mouse device is located |
gpuaddress | 0x0001000000000020 | address where the GPU is located |
interrupt | 19 | interrupt send by the mouse |
moveinterrupt | false | whether mouse movements produce interrupts |
gpuinterrupt | 20 | interrupt send by the GPU |
debug | false | to generate debug output |
debugmask | 0xFFF0 | set mask to hide debug output |
verbose | false | make debugging verbose, sets debug mask to zero |
width | 640 | visible width in pixel |
height | 480 | visible height in pixel |
fwidth | 640 | frame width in pixel |
fheight | 480 | frame height in pixel |
fontwidth | 10 | desired width of characters in pixel |
fontheight | 20 | desired height of characters in pixel |
zoom | 1 | initial zoom factor |
define | not set | to define a name for conditionals |
config | not set | filename for a configuration file |
help | false | to print information |