When a channel is opened the video driver obtains sufficient RAM from EXOS to support the page. This includes a certain amount for internal variables (128 bytes), an overhead of 2 bytes for each line of the page, and enough RAM for the display memory which will vary in size depending on the display mode and page size. Note that for any given display mode and page size, all of the four possible colour modes will use the same amount of RAM since they trade off resolution for number of colours without affecting the memory required.
There is a special function call provided which returns the actual
address of the display RAM for that page. In fact two addresses are
returned because some modes use two different areas of memory. The exact
meaning of the addresses for each mode is described below in the section
on the appropriate mode. The addresses which are returned are the
addresses as seen by the NICK chip. Thus an address in the range
0000h
..3FFFh
corresponds to RAM segment
0FCh
, 4000h
..7FFFh
corresponds to
segment 0FDh
and so on for segments 0FEh
and
0FFh
.
Parameters : A channel number (1..255) B @@ADDR (=3) (special function code) Results : A status BC main display RAM address DE secondary display RAM address
Note that the display RAM for a video channel can be moved by EXOS and so the addresses returned by this call will not always remain the same. The operations which can cause channel RAM areas to move are explained in the EXOS kernel specification. The most important ones are opening and closing other video channels and linking in user devices or resident system extensions. If any operations of this type have been performed then this special function call will have to be repeated to obtain the new addresses.
In the sections below, where HEIGHT and WIDTH are
referred to in specifying RAM requirements, these values are the actual
values from Y_SIZ_VID
and X_SIZ_VID
respectively. Thus for example a full screen size software text page has
a width of 42, even though it actually has 84 characters across.
The RAM requirements given below are the amount of channel RAM which the video driver will ask for. In addition to this each page will require a channel descriptor (of 16 bytes) which is allocated by EXOS.
In hardware text mode, one byte of RAM is allocated for each character position on the page. These bytes contain the character codes for the characters displayed on the page and the NICK chip itself translates these into character shapes using the font, when the display is generated. If the top bit of the character code in the display RAM is set then this character will be displayed using palette colours 2 and 3 rather than 0 and 1.
Initially the ASCII map starts with the top left character of the page and continues across the first line followed by the second line and so on down the page. However once any scrolling operations have been performed the ordering of lines on the page will be different so the first byte of the ASCII map will be the first character of a line but not necessarily the top line. The lines can end up in any arbitrary order and even clearing the page will not reorder them.
The RAM usage and address parameters for a page of this mode are:
Software text mode maintains an ASCII copy of the page which corresponds to the memory used in hardware text mode. This is one byte for each character on the page. In addition to this it has a complete bit map of the page. The video driver itself builds up the character shapes in this bit map from the character font. This bit map is used by the NICK chip to generate the display, The ASCII map is only used internally by the video driver software.
The bitmap initially corresponds directly with what is seen on the screen (assuming the video page is displayed), with one bit corresponding to each pixel. The first byte therefore corresponds to the first eight pixels on the top line of the page, which is the top line of the first character. The next byte corresponds to the top line of the next character and so on until the end of the first row of characters. The next byte will correspond to the second scan line of the first character. This continues for nine scan lines to complete the first row of characters. Subsequent rows of characters are built up in the same way.
The same comments about scrolling apply to software text pages as to hardware text. Scrolling operations can reorder the lines of a page in any arbitrary order. The ASCII map and the bit map are always reordered in the same way.
When the video driver is putting characters from the font onto a software text page it masks out the top and bottom bits of each byte and inserts colour information into these bits in the bit map. The values of these two bits control which colours are used to display this byte (all 9 bytes in a character will be the same colour). The meaning of there bits is:
bit 0 bit 7 palette colours used 0 0 0 and 1 0 1 2 and 3 1 0 4 and 5 1 1 6 and 7
The RAM requirement and address parameters for a software text page are:
The two pixel graphics modes are high resolution (mode 1) and low resolution (mode 5). The only difference between these modes is the amount of RAM they use, and therefore the resolution. A pixel graphics page has an area of RAM which is a straightforward bit map of the screen. The first byte corresponds to the top left of the page, the next byte to the second byte on the top scan line and so on to the end of the first scan line. This is then repeated for the next scan line and so on until the bottom of the page.
The mapping of these bytes into pixels depends on the colour mode and is described in the separate Nick chip specification.
In the low resolution pixel mode the full screen width is 42 bytes and in high resolution pixel and in high resolution mode it is 84 bytes. High resolution pixel mode thus uses twice the amount of RAM to cover the same screen area as low resolution pixel mode.
The RAM usage and address parameters for the two pixel graphics modes are:
An attribute graphics page requires two areas of RAM of equal size. The
first of these (the pixel data area) is a bit map of the video
page which corresponds exactly to the bit map for a two colour low
resolution pixel graphics page, with each byte defining eight pixels.
The second RAM area is the attribute data. Each byte in the attribue data
area defines two palette colours in the range 0.. 15, the
INK
attribute and the PAPER
attribute. The
eight bits in the corresponding pixel data byte define which of
the two colours each of the eight pixels covered by this byte will be.
The format of a byte in the attribute data area is:
b7:b6:b5:b4 - PAPER
colour,
used if a bit in pixel data byte is clear.
b3:b2:b1:b0 - INK
colour,
used if a bit in pixel data byte is set.
The RAM requirements and address parameters for an attribute graphics page are: