Bitmap Overlay

From VO-EM Wiki
Jump to: navigation, search

The bitmap overlay device is the simplest way to put graphics on the screen of the VO-EM console. It is extremely slow and limited in its colour selection, but is somewhat useful for applications such as drawing text, UI elements that are rarely updated, and the like.

Technical details

The overlay screen is a very simple device. It draws over the top of all of the GPU's graphics. It's 120 pixels wide and 80 pixels high. Every pixel is represented by a 6 bit RGB value in memory. The screen will update 30 times a second, synchronised with the GPU's updates.

Bitfield

Running from 0x0003 0000 to 0x0003 2579 is the raw data for the overlay screen. Every *byte* represents one pixel. Pixels are formatted like so:

XSRR GGBB
Unused
Switch - pixel will only draw if this is set to 1
2 bit red channel
2 bit green channel
2 bit blue channel

Brightness selector

In addition to the 6 bit colour choice, there are 8 levels of brightness that can be selected. They are applied to every pixel on the screen at once. The brightness control register is situated at 0x32580.

It is laid out like so:

XXXXXBBB
Unused/reserved
Brightness - a value between 0 and 7


Block fill function

The Bitmap Overlay device has a tool to fill a rectangular section of the screen with a solid colour. This can also be used to clear a section of the screen. The controls for this functionality begin at 0x32581

They are laid out as follows:

0x32581 -> Colour (Same as per-pixel colour controls, XSRR GGBB)
0x32582 -> X       - The X offset of the top left corner of the rectangle to draw
0x32583 -> Y       - The Y offset
0x32584 -> Width   - The width of the rectangle
0x32585 -> Height  - The height
0x32586 -> Trigger - Starts the drawing operation

If the trigger byte is set to any non-zero number when the device refreshes, the draw operation will occur and the trigger will be reset to zero.

The default value of all fields is zero, except for width which defaults to 120, and height which defaults to 80.

The operation draws both to the physical screen and to the device's memory.