Physical Address Space |
 |
The physical frame buffer is addressed as 2048x1024 bytes.
The last 768 bytes of each line of the address space (those to the
right of the screen) are not displayed and no memory exists in those
areas.
To Access the Frame Buffer Directly |
 |
Programs that use direct frame buffer access need to follow
the protocol listed below:
Use the R_LOCK_DEVICE
gescape to gain exclusive access to the device.
Flush any buffered primitives by calling make_picture_current().
Use the PLUG_ACCELERATED_PIPELINE
gescape with an argument of 1 to allow access to the frame buffer.
Access the frame buffer directly.
Use the PLUG_ACCELERATED_PIPELINE
gescape with an argument of 0 to re-enable Starbase commands.
Use the R_UNLOCK_DEVICE
gescape to allow other processes to now access the device.
Do not attempt to read from or write to the offscreen addresses.
Such operations will cause unexpected errors.
The frame buffer is organized as a single one-dimensional
array of pixel values. The first byte (byte 0) of the frame buffer
represents the upper left corner pixel of the screen. Byte 1 is
immediately to its right. Byte 1279 is the last (right-most) displayable
pixel on the top line. The next 768 bytes are not displayable. Byte
2048 is the first (left-most) pixel on the second line from the
top. The last (lower right corner) pixel on the screen is byte number
2,096,383 (1023x2048+1279).
Only one bank (8 bits) of the CRX-48Z can be accessed at a
time. Use the bank_switch
call to select a bank to read or write. For information on the bank_switch call, read the
section "Changes to bank_switch()"
in Chapter 1. The bank selected will be the same as the bank selected
for block_read
and block_write.
If the current rendering mode is 8 planes (CMAP_NORMAL, CMAP_MONOTONIC, or CMAP_FULL 3:3:2), direct
frame buffer writes will write the same information to each of the
three banks in the appropriate buffer.