Video Documentation

We recommend that all screen output be done via the GEM VDI. This technique allows an application to take advantage of higher resolutions and greater color capabilities of new screen modes yet still function in more limited situations. We do recognize, however, that direct screen output is something that applications authors are going to want to do. As a result we are documenting the screen memory organizations in all modes on the Atari Falcon030.

The 1,2,4 and 8 bit per pixel modes are arranged as they are in an ST, STE or TT. This organization consists of 16 bits of each plane in adjacent words until all planes are accounted for.

The 16 bit per pixel (true color) mode is organized as packed pixels. Each 16 bit word contains all of the information for a pixel.

Since this mode is a true color mode there is no palette to convert the data into RGB information for the video system. The information is encoded in each pixel where the 16 bits represent RRRRRGGGGGGBBBBB. An overlay mode exists where the 16 bits represent RRRRRGGGGGXBBBBB. The X bit is used as an overlay bit.

The video (_VDO) cookie is 0x00000300. This cookie is provided to developers so that applications that depend on the exact video specifications can do so. In general it is preferred for software to use the O.S. inquiry calls to check for specific abilities of the system.

OPCODES

WORD Setscreen(long log, long phys,

WORD rez, WORD mode)

Setscreen() has been enhanced to handle the new Falcon video modes. If you pass a 3 in the 'rez' word and a modecode in the 'mode' word, Setscreen will set that mode, ~ i

. aptd rcallou llm tuiion RAM to match that mpde. cl J cf p^^ , i kp <>¿>10 O * ^ ^/v^pc- SC'ltt?^ Vt

Application programmers are better off usmg Setscreen() {Vi > ^ \

than VsetMode because Setscreen will handle reallocating the c "c\ ^< c 0 screen and will initialize the VDI for them. The VsetMode() c 7 ¿2I0 call does NOT initialize the VDI with the new mode ^ j ^ 7 /v . information. . Q i >cC -

However, VsetMode(-l) should still be used to inquire what resolution the machine is in before setting a new one. Then this information should be used to restore the previous resolution.

OPCODE 88

int Vsetmode(int modecode);

The Vsetmode(int modecode) call is used to place the Atari Falcon030 into a specific video mode. A bit-encoded value (called a "modecode") is passed to Vsetmode() to set the mode. Vsetmode() returns the previous mode that was set.

A "modecode" is a bit-encoded value that works as follows:

S

0 j P I V

8

N

N

N » Bits per pixel ^ 4 « 16 BPS 1=2 BPS N n V 3 - 8 BPS 0=1 BPS

8 » 80 column flag (if set, mode is 80 columns, otherwise it is a 40 Column mode) V » VGA flag, VGA monitor mode if set., otherwise TV mode.

P » PAL flag, PAL mode if set., otherwise NTSC. 0 » Overscan flag / Multiplies both x and y by 1.2

(Not used in VGA) S » ST compatibility flag.. It set, mode used will be ST compatible, (for ST Low, ST Kedium, ST High)

Low byte

N » Bits per pixel ^ 4 « 16 BPS 1=2 BPS N n V 3 - 8 BPS 0=1 BPS

8 » 80 column flag (if set, mode is 80 columns, otherwise it is a 40 Column mode) V » VGA flag, VGA monitor mode if set., otherwise TV mode.

P » PAL flag, PAL mode if set., otherwise NTSC. 0 » Overscan flag / Multiplies both x and y by 1.2

(Not used in VGA) S » ST compatibility flag.. It set, mode used will be ST compatible, (for ST Low, ST Kedium, ST High)

High Byte

F » Vertical flag. If set, Interlace mode used on a color monitor, double line used on VGA monitors. X » Reserved

A few modes are not allowed. 40 column 1 BPS modes are not supported. 80 column VGA 16 BPS modes are not supported.

To help make the building of modecode values easier, here is a table of defines:

#define

VERTFLAG

0x100

#define

STMODES

0x80

#define

OVERSCAN

0x40

#define

PAL

0x20

#define

VGA

0x10

#define

TV

0x0

#define

COL 80

0x08

#define

COL 40

0x0

#de£ine

NUMCOLS

7

#define

BPS 16

4

#define

BPS8

3

#define

BPS4

2

#define

BPS2

1

#define

BPSl

0

Using these defines, you can build a modecode for any possible mode. For example:

For True Color Overscan: modecode = OVERSCAN|COL40|BPS16;

For ST Medium Compatibility mode on a Color Monitor/TV: modecode = STMODES|COL80|BPS2;

For ST Low Compatibility mode in PAL on a Color Monitor/TV: modecode - STMODES|PAL|COLSO|BPS2;

For 256 color, 80 column mode on a VGA monitor: modecode » VGA|COL8Q|BPS8;

If you have a modecode and wish to know how many bits per pixel it has, use the following:

if(modecode & NUMCOLS) BPS16)

do_something_cool (); » You have true color mode «

The Vsetmode() call will return the previous modecode set. You must use this value to get back to whatever mode you were in before you made your Vsetmode call.

A word of warning: Vsetmode() does not provide error checking on valid modes. It will try to set modes that do not exist or that will not work on the monitor you are using. Be careful to set the proper mode for the right monitor!

The defines that are listed above as well as the xbios binding for Vsetmode() are defined in MODE.H on the distribution disk.

IMPORTANT NOTES: Vsetmode() does not adjust the video base address, allocate any memory for the new mode, or initialize the VDI. If you want to do these things, you should use Vsetscreen().

0 0

Post a comment

  • Receive news updates via email from this site