PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Terminal Emulation in Graphics Drivers

For details of Open Firmware driver design for most standard boot devices, including Open Firmware graphics drivers, see IEEE Standard 1275 and Writing FCode Programs. These books are listed in Other Publications.

Besides their generic requirements, Open Firmware drivers for PCI graphics cards in Power Macintosh computers must provide terminal emulation support. IEEE Standard 1275 defines the behavior of a terminal emulator support package, including the implementation of certain escape sequences defined by ANSI Standard X3.64. The Macintosh package, described here, conforms to ISO Standard 6429-1983. The Macintosh implementation of Open Firmware for PowerPC supports additional graphic renditions, through Select Graphic Rendition (SGR) escape sequences, beyond those specified in the Open Firmware standard.

For the Macintosh terminal emulation extensions to be used, the FCode device driver for a display device (a device whose device_type property has the value display ) must initialize the first 16 entries of its color table to appropriate values, as described below. These values assume that the color is represented by the low-order 3 bits of the color index and that the bit corresponding to a value of 8 represents the intensity. The ISO Standard 6429-1983 provides parameter values to control the color of foreground (30-37) and background (40-47) independently. The intensity is set separately (1-2), and must be issued before the color control; 1 -> color, 2 -> color+8.

In the Macintosh terminal emulator, there are current background and foreground colors whose values range from 0 through 15, corresponding to the first 16 entries of the color table. In positive image mode, pixels corresponding to a font or logo bit set to a value of 1 are set to the foreground color; pixels corresponding to a font or logo bit cleared to 0 are set to the background color. When in negative image mode, the roles of foreground and background are reversed.

The default rendition is positive image mode, with background set to 15 and the foreground set to 0, thus producing black characters on a bright white background.

Table 5-10 lists the effects of executing SGR escape sequences with various parameters.

Table 5-10 SGR escape sequence parameters 

Parameter

Interpretation

0 Default rendition
1 Bold (increased intensity)
2 Faint (decreased intensity)
7 Negative image
27 Positive image
30 Black foreground
31 Red foreground
32 Green foreground
33 Yellow foreground
34 Blue foreground
35 Magenta foreground
36 Cyan foreground
37 White foreground
40 Black background
41 Red background
42 Green background
43 Yellow background
44 Blue background
45 Magenta background
46 Cyan background
47 White background

The next sections define the additional behavior of display devices for Open Firmware implementations that support the terminal emulator extensions.

Color Table Initialization

Display Device Standard Properties

Display Device Standard Methods


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)