@Section(OVERVIEW) The first section of this chapter provides information on the Level 1 Graphics system. The CSD154 and CSD155 are described, information on the bus interface, the pixel,...are also provided. The Software tools section provide information on the graphic packages (EDWIN, SLIDE and CAPTION) available on APM. @NewPage @section(LEVEL 1 GRAPHICS SYSTEM) The level 1 graphics board (CSD154) is a simple, write only, colour raster graphics controller and frame store. It provides a display of up to 1024*1024 pixels of four bits each. It can be configured to drive a large variety of monitors, both interlaced and non-interlaced and at different data, line and frame rates. It generates 3 TTL video outputs allowing 8 different colours to be displayed. A further board (CSD155) can be added to give an additional four bits per pixel and a colour map suitable for driving analogue input colour monitors. Together they can display up to 256 different colours at one time. These colours can be selected from a total of 32768 shades. @Newpage @SubSection(Switches and indicators) When viewed from the front of the system the layout of the control switches and indicators on the control processor board is as follows: @Begin(Format,Group) | |---- | [| MSD Address Select Switches (4 Hex Digits). |---- | [| Selects the high order 14 address bits used to |---- access the frame store and its associated control | [| registers within the system bus real address |---- space. The board is disabled if the LSD switch | [| LSD is not a multiple of 4. |---- | | | | | | |---- | 0 | Access indicator. On if a framestore update |---- is in progress | | | | | | | | | | | | | | | | | | | | | @End(Format) @SubSection(Coordinate System) The frame store is an array of 1024*1024 pixels. Pixel (0,0) is at the bottom left of the array and pixel (1023,1023) is at the top right of the array. The attached monitor will display a rectangular sub-region of this array. The size of the displayed area is determined by the Monitor specifications and is configured by PROM's on the graphics board. The display area for the Mitsubishi C3419E monitors is 512(V)*688(H) pixels. The origin of the displayed region is determined by the contents of a write only register, the START OF DISPLAY REGISTER. The Start of Display register is a 16 bit register. The 10 most significant bits specify the Y index of the TOPMOST displayed pixel. The 6 least significant bits specify the X index of the LEFTMOST displayed pixel, DIVIDED by 16. The X index of the first displayed pixel must be a multiple of 16. The two bytes of the register may be written separately. If the origin is such that an overflow occurs then the displayed region wraps around from high to low index pixels. @Begin(Format,Group) (0,1023) (1023,1023) ----------------------------------------------------------------- | | | Frame Store | | | | | | -----------------------------------------<- Y Start of | | | ^ | Display | | | | | | | | Displayed Area | | | | | (Mitsubishi C3419E) | | | | | | | | | | | | | | | | | | | |<--------------------- 688 ---+------->| | | | | | | | | | | | | | 512 | | | | | | | | | | | | | | v | | | ----------------------------------------- | | ^ | | | | | X Start of Display | | | | | ----------------------------------------------------------------- (0,0) (1023,0) @End(Format) @SubSection(System Bus Interface) The level 1 graphics board provides a number of write only locations that can be accessed as slave devices from the system EUCSD bus. The locations they occupy within the system bus address space are determined by 4 hex coded switches that are visible from the front of the board. These specify the 14 high order address bits (AD31L-AD18L) used to access the frame store and control registers. The next highest address line AD17L determines whether the frame store (AD17L is 0) or the control registers (AD17L is 1) are are accessed. If the control registers are accessed AD16L is used to determine whether the general control registers (AD16L is 0) or the colour map (AD16L is 1) is accessed. Note that accessing the colour map is effective only when the CSD155 board is available. @SubSection(Frame Store Addressing) The Frame Store appears as a linear sequence of 128K bytes in the system bus address space. This may be considered as a 1024*1024 array of bits, organised as groups of 8 bits in a 1024*128 array of bytes. Increasing byte addresses correspond to increasing X coordinates first and increasing Y coordinates second. Within a byte the most significant bit corresponds to the pixel with lowest X coordinate. Thus, if we consider a particular sequence of pixels as a binary number they appear on the display in the 'natural' left to right order of decreasing significance. Up to 4 aligned bytes may be written in a single frame store access. The user should note that internally 16 bit operations are performed. This implies that the store cycle time is doubled for 32 bit accesses. @SubSection(Pixels - CSD154 board only) Each pixel is associated with 4 bits of data. Each bit is stored in a separate 1024*1024 bit storage array or PLANE. The contents of planes 0, 1 and 2 determine whether the red, green and blue guns of the monitor are on or off. Plane 3 , the 'cursor' plane allows the sense of data from planes 0, 1, and 2 to be inverted. @Begin(Format,Group) Thus, for any given pixel: if plane 3 = 0 red gun is on if plane 0 = 1 green gun is on if plane 1 = 1 blue gun is on if plane 2 = 1 if plane 3 = 1 red gun is off if plane 0 = 1 green gun is off if plane 1 = 1 blue gun is off if plane 2 = 1 Note that a pixel may be any one of the following colours : black all off 0000 or 1111 red red only 0001 or 1110 green green only 0010 or 1101 yellow red+green 0011 or 1100 blue blue only 0100 or 1011 magenta red+blue 0101 or 1010 cyan green+blue 0110 or 1001 white red+green+blue 0111 or 1000 @End(Format) Notice that the colour displayed when plane 3 is 0 is the complement of that displayed when plane 3 is 1, provided that planes 0, 1 and 2 remain the same. Thus plane 3 may be used as a cursor plane on which any symbol written will probably be noticable, regardless of the contents of the other planes. @SubSection(Pixels - CSD154 and CSD155 two board system) With the CSD155 option installed each pixel is associated with 8 bits of data. Each bit is again stored in a separate 1024*1024 colour plane. The method of updating the frame store is unchanged. However, the manner in which each pixel is displayed is altered. When a pixel is displayed the 8 bits of data are used as an index to a writable COLOUR MAP. For each of the 256 possible values a pixel may take a 16 bit value is generated by the colour map. These 16 bit values are written into the colour map before the desired picture can be displayed. The 16 bits are used as three 5 bit fields and a single 1 bit field. The 5 bit fields are used as an unsigned integer to determine the analogue intensity of the red, green and blue guns of the CRT display. The 1 bit field is used as a control bit that determines whether the pixel flashes at one 16th of the display field rate; about 3 times a second. The colour map may be updated by normal writes to the graphics system. The low order address lines (AD9L-AD2L) are used to index the colour map and the data written provides the 16 bit values generated by the colour map. The colour map appears to the bus as 32 bit entries, the 16 high order bits being ignored. The individual bytes of the colour map entries may be written separately. The operation of writing a single new entry to the colour map will cause the display to be blanked for 3 pixels. This is to minimise the effect of generating incorrect data when a change is made. It may be possible to use the vertical sync output from the controller to synchronise colour map changes to the display vertical blanking period. This would allow colour map updates to go completely unnoticed on the display. @SubSection(Updating the Frame Store) Only write accesses to the frame store are allowed. When the frame store is written an UPDATE OPERATION takes place. The data when written does not go directly to the planes, but is used as a mask. Each bit in the mask corresponds to a pixel as discussed in the section on frame store addressing. If a data bit in the mask is 0 then no change is made to the corresponding pixel. If a bit is 1 then the pixel is updated. The change made to the bits that make up the pixel is determined by the contents of two control registers. The PLANE ENABLE REGISTER is a single byte and contains a bit corresponding to each of the colour planes. If the bit for a plane is zero, then that plane is not changed by frame store update operations. If the bit is 1 then the plane may be modified by the update operation. If the CSD154 board is used alone then only the 4 least significant bits are used. The COLOUR REGISTER is a single byte and contains a bit corresponding to each of the colour planes. When a frame store update operation takes place the contents of the colour register is written to the corresponding plane of each pixel that has 1 in the data mask. This is of course conditional on the enable bit for that plane being 1. If the CSD154 board is used alone then only the 4 least significant bits are used. This arrangement allows all planes to be updated simultaneously. However, it does not have any overall speed up when drawing finely detailed pictures. For example, to clear the frame store the following must be performed. First all 1's are written to the plane enable register. Then all 0's are written to the colour register. Finally all 1's are written to all the frame store locations. To draw an arbitrarily coloured picture we must proceed as follows. For each colour the colour register must be written before writing 1's to each pixel that will be that colour in the final picture. This must be repeated until the detail for all colours is drawn. For 'layered' applications such as VLSI plots it is sufficient to proceed as follows. First write all 1's to the colour register. Then for each layer write a single 1 to the plane enable register, before updating the frame store with the detail for that layer. Again this must be repeated until the detail for all of the layers is drawn. @SubSection(Register Address Map) To summarise, the registers appear in the system address space as follows: @Begin(Format,Group) SSST00000 - SSST0FFFF Frame store. SSST20000(4)SSST2FFFC Plane enable register. SSST20001(4)SSST2FFFD Colour register. SSST20002(4)SSST2FFFE Start of Display register. SSST30002(4)SSST3FFFE Colour map registers. SSST is the setting of the board address select switches The system is deselected unless T is a multiple of 4. @End(Format) @SubSection(Register Bit Encodings) Collectively the general control registers may be considered as a single 32 bit word. Each of the bytes may be accessed separately. The meaning of each of the bits in order of decreasing significance is as follows: @Begin(Format, Group) Byte 0 (MSByte) - Plane Enable register bit 7 (MSB) - Plane 7 enable bit - bit 6 - Plane 6 enable bit | Significant only bit 5 - Plane 5 enable bit | with CSD155 extension. bit 4 - Plane 4 enable bit - bit 3 - Plane 3 enable bit bit 2 - Plane 2 enable bit bit 1 - Plane 1 enable bit bit 0 (LSB) - Plane 0 enable bit If a bit is 0, updates to corresponding plane are disabled If a bit is 1, updates to corresponding plane are enabled @End(Format) @Begin(Format, Group) Byte 1 - Colour Register bit 7 (MSB) - Plane 7 data bit - bit 6 - Plane 6 data bit | Significant only bit 5 - Plane 5 data bit | with CSD155 extension. bit 4 - Plane 4 data bit - bit 3 - Plane 3 data bit bit 2 - Plane 2 data bit bit 1 - Plane 1 data bit bit 0 (LSB) - Plane 0 data bit The content of each bit is written to the corresponding plane during a suitably enabled and masked update operation. @End(Format) @Begin(Format,Group) Bytes 2 and 3 (LSByte) - Start of Display Register. byte 2 bits 7-0 byte 3 bits 6&7 - Y Finishing Index Y index of the last pixel displayed. byte 2 bit 7 is the most significant bit. byte 3 bit 6 is the least significant bit. byte 3 bits 5-0 - X Starting Index X Index/16 of first pixel displayed. The X index of the first pixel displayed is always a multiple of 16. bit 5 is the most significant bit. @End(Format) The colour map entries are 16 bits wide, but are 32 bit aligned. Only the Least significant 16 bits are used. Either of the two bytes may be written separately. @NewPage They have the following form : @Begin(Format,Group) byte 2 bit 7 - Flash bit If 0 pixel is steady If 1 pixel alternates between colour specified by rest of entry and black every 16 fields (about 3 times a second) byte 2 bits 6-2 - Blue intensity byte 2 bit 6 is the most significant bit. byte 2 bits 1 & 0, byte 3 bits 7-5 - Green intensity byte 2 bit 1 is the most significant bit. byte 3 bits 4-0 - red intensity byte 3 bit 4 is the most significant bit. @End(Format) @SubSection(Software Support Routines) A number of standard routines are available for using the Level 1 Graphics System. The following routines are written in assembler and their close interaction with the hardware exploits the full potential of the graphics system. their peformance is such that they should be used whenever possible. In assembler, parameters are passed in registers d0, d1, ... d5 in the order specified by the prototypes given below. @Begin(Description, LeftMargin +38, Indent -38) plot(x, y) @\Sets the pixel at coordinate (x, y) to the current contents of the colour register. The planes affected are those specified by the plane enable register. fill(x0, y0, x1, y1) @\Fills a rectangular area bounded by the coordinates (x0, y0) and (x1, y1). The colour used and planes affected are taken to be the current contents of the colour and plane enable registers. If x0>x1 or y0>y1 the the area filled is wrapped around the frame store. line(x0, y0, x1, y1) @\Draws a line between the coordinates (x0, y0) and (x1, y1). The colour used and planes affected are taken to be the current contents of the colour and plane enable registers. triangle(x0, y0, x1, y1, x2, y2) @\Draws a filled triangle with vertices (x0, y0), (x1, y1) and (x2, y2). The colour used and planes affected are taken to be the current contents of the colour and plane enable registers. trapeze(x0l, x0r, y0, x1l, x1r, y1) @\Draws a filled trapezium with parallel sides parallel to the X axis. The coordinates of the vertices are (x0l, y0), (x0r, y0), (x1l, y1) and (x1r, y1). The colour used and plane affected are taken to be the current contents of the colour and plane enable registers. Trapeze is primarily intended for polygon filling. @End(Description) In other languages further routines may be provided. This will be in addition to suitably interfaced calls to the basic routines given above. @NewPage @Section(SOFTWARE TOOLS) @SubSection(EDWIN) EDWIN is a graphics package consisting of set of procedure which provide basic facilities for producing two dimensional line drawings. It is fully available on APM. The programs and related files are held in the filestore directory EDWIN. Since EDWIN has already been fully described in the EDWIN user's manual, there is no need to repeat all this information in the present manual. However, in order to use EDWIN, you will need the following command: @Begin(FileExample) SETUP EDWIN @End(FileExample) For more information on the SETUP command see section @Ref(SETUP). You will also find useful information on Geometric utility routines in the file shapes.inc of directory EDWIN. @SubSection(CAPTION) The basic purpose of CAPTION is to generate good captions for displays; where a caption is some text with a box drawn around it. It can be used to produce notices, posters and instruction sheets although text only can be generated. CAPTION provides access to the Hershy font library; this is a collection of about thirty type faces, encompassing a wide range of styles. Tables of the available characters can be found at the end of the "CAPTION user's guide". (see bibliography @ref(BIBLIO)). One useful thing when producing captions is to be able to have odd words in special type styles or colours. CAPTION has reserved the sumbols '~' and '\' to do this, so that they may not appear in any captions which are generated. @Paragraph(The Input File) The input to CAPTION simply consists of lines of text interspersed with command lines. Lines are plotted literally with no attempt to fill up spacing where possible. This shows one disadvantage of CAPTION for complex use, commands must be on seperate lines, so a line of text is always printed in the same style. If several captions are included in one file they will be seperated with the END command, and will be plotted up the page. The end of file acts as an end of caption indicator as well. @Paragraph(Command formats) To change the options described in the next section, commands are used. These are always on a separate line, the first character of which is a percent sign. Commands may all be abbreviated to their first character, but the full name may be typed. Some commands take a parameter, which is always preceded by an equals sign. If you wish to return to the default settings for any option, issuing the command without the parameter or equals will do this. It should be noted that values of options span across several captions in one file, and do not return to the defaults at an END command. The following commands are all valid, with each group being equivalent: @Begin(FileExample) %Italics=15 %I=15 %C %Centre %Text_colour=green %Text=green %T=green @End(FileExample) @Paragraph(Options) The plotters provide a variety of facilities, all of which are available through Caption. @B(%Size [=]) The text can be plotted in any size from illegible tiny dots up to enormous. The units of size are entirely arbitrary, but have been found to be a convenient scale to work with. The default size is 30 units, and may be changed with the SIZE command. @b(%Overwrite [=]) When using large charcters, the width of pen is usually too narrow, so an overwriting facility is provided. The OVERWRITE command sets the number of overwrites. This is also useful for bolding text to make it stand out. The default value for this is 0, which means no overwrites. @newpage @b(%Italics [=]) It is possible to have italic text, at different angles, even backwards italics, using the ITALICS command. The parameter to this is the angle away from normal that the characters are slanted to. A pleasant angle is about 14, the default is 0, which is roman text. Users should note tht this command only applies to characters which are being drawn in the plotter hardware character sets (ie. Not the Hershy fonts). @b(%Text_Colour=) Since the plotters have several pens, it is possible to plot text in different colours. The TEXT_COLOUR command sets this. The default is black, but the following colours are available: blank (a special invisible colour), black, blue, green, red, purple, yellow, lime, brown, turquoise. Note that with some of the more exotic colours you may be asked to change pens in the plotter. @b(%Box_Colour=) It is also possible to use the BOX_COLOUR command to set the colour of the box, which also defaults to black. The special colour blank comes in useful here, if you want a caption without its box, simply set the colour of the box to blank. The range of colours is the same as for the TEXT_COLOUR command. @b(%Font [=]) When using caption, the FONT command selects one of the hardware fonts available on the current device or one of the Hershy Fonts. If the font number is negative, it is taken to mean the character fonts available ont he plotter. These are typically low resolution characters, but are faster than the Hershy fonts. A positie font number indicates one of the Hershy fonts. @b(%End) The END command separates captions. @b(%Center %Right %Left) Normally text is plotted with the left hand ends of the text in a line beside the left side of the bos, but by using the CENTRE command text is exactly centred in the box. Similarly RIGHT plots the text with the right hand ends in line with the right hand edge of the box, leaving a ragge left edge. LEFT restores the default setting. @b(Special Words) It is sometimes desirable to make works or phrases in a caption stand out from the rest of the text. This can be done by either setting the colour or the font to a new value. The characters '~' and '\' are used to switch to another colour or font respectivly. These characters should be followed by a number to indicate which colour or font is reuired. The colours are specified by number according to the following table: @Begin(FileExample) 1 - Black 5 - Purple 2 - Blue 6 - Yellow 3 - Green 7 - Lime Green 4 - Red 8 - Brown @End(FileExample) Example of a string which contains a colour and a font change: @Begin(FileExample) This is some \52Gothic\16 text, a word in ~4Red. @End(FileExample) Wich would appear on the output as @Begin(FileExample) This is some Gothic text, a word in Red. @End(FileExample) With the word "gothic" in font 52 and the word "Red." drawn with the red pen. @SubSection(SLIDE) SLIDE The main command of the SLIDE package are listed and concely described in this section. In order to use SLIDE you need to enter first the following command: @Begin(FileExample) SETUP EDWIN @End(FileExample) and then @Begin(FileExample) SLIDE [input] @End(FileExample) The command slide with no parameter means take input from the terminal, giving a file name means use that file for input, with the extension .SLD. @Paragraph(Commands) @Begin(FileExample, LeftMargin +0) @b(Command Parameters Function) @@ A macro name @@ followed by a macro name calls the macro. ! or { Introduces a comment. A3 This command is for use with A3 sized paper rather than slides. This is 400x280mm with the long side in the horizontal direction. A4 This command is for use with A4 sized paper rather than slides. These are regarded as being 210x280mm, with the long side in the vertical direction. Buoy Buoy name Box XY Circle Radius Colour Colour name The colour may be chosen from: black, blue, red, green, lime, turquoise, purple, blank, brown, yellow. IE EDIT File name Calls the IE screen editor. Font Font code The maping from number to font is given in the EDWIN users guide (see Bibliography @ref(Biblio)). To facilitate colour and font changes within text two special characters are provided: @b( ~ and \) If you want to put one of these two characters followed by a number into your text use the command escapes to switch the facility off and noescapes to switch back on again. Line XY Macro Macro name This name can be any series of characaters excluding spaces. Following lines are put into the macro, until an End command is encountered. Move XY New None Takes a new frame. Offset XY Shifts the whole drawing by the XY specified. Offset 0 0 restores. Quality 0 or 1 Sets the character quality required. 0 for device generated characters and 1 for software generated characters. Rotate Angle Sets the rotation of text. Scales Number Scales ALL coordinates using the given number For example: Scale 0.5 halves the picture. OFFSETS are also SCALed. Size Number The number will set the size of the characters in millemeters. Slide Resets to Slide size. Spacing Number Allows the user to change the spacing between lines of text. If it is positive then the spacing increases or if it is negative the spacing decreases. The units are TENTHS of a millimetre to allow very fine control. Speed Number Sets the plotting speed. Style Number Selects an EDWIN line style. Store File name Stores the picture in an EDWIN PDF. If the file name is OFF then storing is switched off, if it is ON then it is switched om again. Store with another file name closes the previous one and opens another. Use File name Uses that file name for input. Text The text command can be followed either by one line of text enclosed in double quotes or multiple lines following on seperate lines, terminated by a line consisting of only a colon. Text is simply plotted as it is typed in with no attempt at justification. The text is drawn with the outside box's bottom left corner at the current location unless the A qualifier was specified. When A has been specified, the bottom left character starts at the current location. "A" Text followed immediately by "A" (Absolute). "B" Text followed immediately by "B" leaves space for a box. "C" Text followed immediately by "C" is centred. "R" Text followed immediately by "R" is right justified. nothing Text followed by neither "A", "B", "C", "R" will get a box space but the box itsel will not be drawn. @End(FileExample) All dimensions are in millemeters and slides are 215x250mm in size. All commands may be abreviated to the minimum unambiguous number of characters. The XY parameter for Line, Move, and Box may be one of the following: @Begin(Description) number number @\relative X Y move. =number number @\absolute X Y move. . @\interactive, move to the position determined with cursor, the moved to position is printed at the terminal. buoy name @\move to a buoy defined with the buoy command. @End(Description) Currently buoy names are only A to Z but these may be extended sometime.