IMD 1.18: 14/11/2012 8:30:15 1/27/84 graphics documentation ncr & 1kx1k  ååååååååååååååååååååååå åååååååååååååååååååååååååå     å BARRYèùÛ„§ OLD.COVER.TEXT/c§OLD.INTRO.TEXT/R§$OLD.BASIC.TEXT/S§$4 OLD.DOC1.TEXT\/c§4B OLD.DOC2.TEXT\/S§B` OLD.DOC3.TEXT\/R§`x OLD.DOC4.TEXT\/c§xˆOLD.UTILS.TEXT/R§ˆ–OLD.APPEN.TEXT/’¦–˜ GRAF.PARSòãÖ \/TY§˜œ PF.GRAF.TEXT \/Q§œ  README.TEXTÖ \/Q§ ¤ GRAF.RUN.TEXT\/槤¥*1KX1K**2òãÖ \/$§¥«GRAF.INTRO.TEXTR§«ÁGRAF.UTILS.TEXTY§ÁÙGRAF.APPEN.TEXTY§Ù÷GRAF.DOC3.TEXT/$§÷GRAF.COVER.$CURSOR $EQUAL OÍO.S§c§TEXT$§ GRAF.BASIC.TEXT$§ GRAF.DOC1.TEXT/‰¦-GRAF.DOC2.TEXT/J¦-[GRAF.DOC4.TEXT/‰¦[{NGRAF.DOC3.TEXTJ¦ååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå^20 6{|UCSD p-SYSTEM VERSION IV.1|} E E 6{|NEC APC GRAPHICS SUPPLEMENT|} F 0{|Copyright (c) 1983, TICOM Systems, Inc.|} E E E E E E E E E E E X X X X X Z{March 23, 1983}  ^F  ^5 ;{TABLE of CONTENTS} = = = = =  "1. INTRODUCTION ........................................... 1-1 " "2. BASIC TERMS AND CONCEPTS ............................... 2-1 " "3. THE GRAFDRAW UNIT ...................................... 3-1 " INTERFACE SECTION ....................................å 3-2 " CORE RECORD VARIABLES ................................ 3-5 (GRAFDRAW UNIT PROCEDURES ............................. 3-6 *MOVE_ABS ........................................... 3-7 *MOVE_CURSOR......................................... 3-8 *MOVE_REL ........................................... 3-9 *SET_CURSOR ......................................... 3-10 *SIZE_CURSOR......................................... 3-11 *SET_FILL_PATTERN ................................... 3-12  BARRYèùÛ„§ OLD.COVER.TEXT/c§OLD.INTRO.TEXT/R§$OLD.BASIC.TEXT/S§$4 OLD.DOC1.TEXT\/c§4B OLD.DOC2.TEXT\/S§B` OLD.DOC3.TEXT\/R§`x OLD.DOC4.TEXT\/c§xˆOLD.UTILS.TEXT/R§ˆ–OLD.APPEN.TEXT/’¦–˜ GRAF.PARSòãÖ \/TY§˜œ PF.GRAF.TEXT \/Q§œ  README.TEXTÖ \/Q§ ¤ GRAF.RUN.TEXT\/槤¥*1KX1K**2òãÖ \/$§¥«GRAF.INTRO.TEXTR§«ÁGRAF.UTILS.TEXTY§ÁÙGRAF.APPEN.TEXTY§Ù÷GRAF.DOC3.TEXT/$§÷GRAF.COVER.*BOX_ABS ............................................ 3-13 *BOX_REL ............................................ 3-14 *WRITE_BLOCK_PIXELS ................................. 3-15 *READ_BLOCK_PIXELS .................................. 3-16 *SET_CHARUP ......................................... 3-17 *SET_FONT ........................................... 3-18 *TEXT ............................................... 3-19 *SET_LINE_STYLE ..................................... 3-20 *LINE_ABS .....................TEXT$§ GRAF.BASIC.TEXT$§ GRAF.DOC1.TEXT/‰¦-GRAF.DOC2.TEXT/J¦-[GRAF.DOC4.TEXT/‰¦[{NGRAF.DOC3.TEXTJ¦ååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå     ...................... 3-21 *LINE_REL ........................................... 3-22 *PLINE_ABS .......................................... 3-23 *PLINE_REL .......................................... 3-24 *CIRCLE_ABS ......................................... 3-25 *CIRCLE_REL ......................................... 3-26 *DEFINE_COLOR ....................................... 3-27 *INQ_COLOR .......................................... 3-28 *INQ_VALUE .......................................... 3-29 the Ramtek 6214  which proved to be a useful tool for the implementation of graphics  applications under the UCSD p-System.   Appendix A lists the minimum hardware configuration required for  execution of graphics applications.   Appendix B describes the files provided on the release disk.   On your disk is a set of demo programs that will demonstrate the  features of the GRAFDRAW unit. The source for these programs is also *PLANE_ENABLE ....................................... 3-30 *PLANE_VISIBLE ...................................... 3-31 *SET_PALETTE ........................................ 3-32 *SET_VALUE .......................................... 3-33 *ERASE .............................................. 3-34 *ERASE_ALPHA ........................................ 3-35 *FLOOD .............................................. 3-36 *ARC_REL ............................................ 3-37 *ARC_ABS ...................... included so that you may see how the calls to the unit are made.   Please refer to Appendix C for details on running the demo programs.   ^PAGE 1  ...................... 3-39 " "4. THE FONT COMPILER ...................................... 4-1  ^F " "5. THE PATTERN COMPILER ................................... 5-1 " "APPENDICES " "A. MINIMUM HARDWARE REQUIREMENTS .......................... A-1 "B. FILES ON THE RELEASE DISK .............................. B-1  C. RUNNING THE DEMO PROGRAMS .............................. C-1 "D. INITIAL VALUES OF THE CORE RECORD VARIABLES ............ D-1 "E. INSTALLING THE GRAFDRAW UNIT ........................... E-1  ^PAGE 1  $CURSOR $EQUAL ­O.S§S§ÿÿI^¦¢§R@@@@@@@ 7{|BASIC TERMS AND CONCEPTS|}  {2.1 How the GRAFDRAW unit works}   A graphics application communicates with the graphics hardware $through the interface provided by the GRAFDRAW unit. Most of the $unit is implemented in assembly language for efficiency of $operation. Because the unit is designed to be a subset of the $SIGGRAPH CORE standard, graphics applications can maintain a high $degree of portability across various hardware environments. For the $sake of program compatibility, some procedures have been included in $the unit eventhough they perform no operation. $  {2.2 Definitions} $  Following are some common terms used throughout the manual. $ (Color : The APC makes eight colors available for display. ( These colors are fixed and cannot be altered. The 4term 'index' is used as a synonym for color in many 4places. Conceptually, a color index is a pointer 4into a color table that determines which color is to  ;{|INTRODUCTION|}   The TICOM implementation of graphics for the NEC Advanced Personal  Computer (APC) is composed of three major components. The first is  GRAFDRAW, a collection of Pascal procedures comprising a subset of the  SIGGRAPH CORE. The second is a Font Compiler, which allows you to  define your own text fonts. The third component is a Pattern Compiler,  for defining patterns that will be used when doing fills. The GRAFDRAW  unit is defined in a similar manner to the unit used on      e  skeleton of such a program. & &Program My_Program; &USES (*$U GRAFICS:GRAFDRAW.CODE*) GRAFDRAW; & &Begin (. (. (. &End.   In order to use GRAFDRAW when running a program, you either have to  use the "LIBRARY" utility to put GRAFDRAW.CODE in your system library  or create a text file on the systems disk called "USERLIB.TEXT" where the  only line in it is the name "NGRAFDRAW.CODE".   Remember that run time versions of the unit should be installed (Cursor : A software controlled graphics cursor. It shows on 4the screen as a hairline cross with equal vertical 4and horizontal bar sizes. The cursor can be any 4size, up to the full screen. The default cursor 4size is 15 pixels. ( (Pixel : The elementary display unit. Each pixel is a dot on ( the display, and is individually controlled by 4attributes stored for it in the graphics display 4memory. The NEC APC has a 640 x 480 pixel display. ( The attributes {without} the INTERFACE part.   ^F  /{|INTERFACE SECTION OF THE GRAFDRAW UNIT|}  ^CO UNDERLINE \\  Interface  "Const Graf_Version = '0.4'; " "Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable, { Cursor enable } 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace  for each pixel are stored in a 4-bit 4field where the high order bit is always 0, and the 4remaining 3 bits give the color associated with the 4pixel. ( (Plane : The display screen may be visualized as three ( superimposed bit planes, one for each of the primary 4colors, Red, Green and Blue. The color for an 4individual pixel is therefore determined by a three 4bit value, depicting a color value or "index". (  {2.3 Support utilities}  contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons } 'Int_Type = (Plain, { Solid rectangle } 8Patterned); { User pattern } 'Edge_Type = (Solid_Line, { Solid border } 8Interior); { Invisible border } 9 'Directions = (Left, { Left direction or position } 8Right, { Right direction or position }  In addition to the GRAFDRAW unit, it is necessary to be able to $define patterns (for fill operations) and fonts (for text display). $A "Compiler" program is provided for each of these operations. $These programs accept standard p-System text files properly $formatted to describe fonts and patterns, and create binary data $files that can by used by the graphics application. $ $Chapters 4 and 5 describe the operation of the Font and Pattern $Compilers, respectively. $   ^PAGE 1  8Up, { Up direction } 8Down, { Down direction } 8Top, { Top position } 8Center, { Center (horz/vert) position } 8Bottom); { Bottom position } 'Font_Type = -1..99; 'Pat_Type = -1..99; 'Color_Index = 0..15; 'Point = Integer; 'Point_Array = Array [1..128] Of Point; 'Sorcery = ^Integer; ' 'Core_Record = Record 9X_Min, { Left edge of screen } 9X_Max, { Right edge of screen } 9Y_Min, { Top edge of screen } 9Y_Max, { Bottom edge of screen } 9 9X_Org, { X-origin of fill pattern } 9Y_Org, { Y-origin of fill pattern } 9 9X_CP, { X-current position } 9Y_CP : Point;{ Y-current position } 9 9Line_Index, { Line color} 9Fill_Index, { Filled object color } 9Text_Index, { Text color} 9Background : Color_Index; { Background color } ; $CURSOR $EQUAL §¨O.S§c§9Line_Style : Integer; { Line pattern } 9Display_Mode : Display_Type; { Fast/Fill } 9Overlay_Mode : Overlay_Type; { Replace/Xor pixels } 9Polygon_Interior : Int_Type; { Plain/Patterned } 9Polygon_Edge : Edge_Type; { Solid_Line/Interior } 9 9Font_Number : Font_Type; { Current font number } 9Font_Cols, { Columns per char } 9Font_Rows : Point; { Rows per char } 9 9Char_Spacing : Real; { Character pitch } 9Top_Bottom, { Above/below t4be used for drawing lines, shapes, displaying text, 4etc. In reality, since the color scheme is fixed, 4there is no need to keep such tables around. 4Therefore, the color tables are conceptual only, and 4the index {is} the color. 4 4Color and index values are as follows: 4 80 - Black 4 - Blue 81 - Red 5 - Magenta 82 - Green 6 - Turquoise 83 - Yellow 7 - White ( (CP : The system's Current Position. The point within the 4graphic co 9{|THE GRAFDRAW UNIT|}  The GRAFDRAW unit is composed of 28 procedures along with a variable  that defines the current state of the graphic screen and values for  the next operation (CORE^). Below you will find a listing of the  interface section for the unit. This will show you all of the  procedures and their parameters, as well as the types and variables  that are available. In order to use the GRAFDRAW unit from a program,  you must include it with the "USES" statement. Following is thordinate space where the next output 4operation will take place. The CP is kept in memory 4in the X_CP and Y_CP CORE variables. ( ( In this manual, the CP is occasionally indicated by 4an ordered pair of X and Y coordinates, such as 4( 100, 200 ). 4 4Some of the GRAFDRAW procedures have an effect on 4the value of the CP, others do not. This effect is 4indicated in the documentation by an expression of 4the form: 4 8CP <-- ( New_X_Value, New_Y_Value ); 8      ext } 9Left_Right, { Left/right of text } 9Char_Path : Directions; { Write direction } 9DX_Charup, { Char rotation X } 9DY_Charup : Integer; { Char rotation Y } 9Char_Height, { Rows to display } 9Char_Width : Integer; { Colums to display } 9 9Pat_Number : Pat_Type; { User pattern number } 9Pat_Cols, { Columns in pattern } 9Pat_Rows : Point; { Rows in pattern } 7 9File_Prefix : String[7]; { Prefix for font, text } 7End {of Core_Record}; " "Var Core : ^Core_Record;  Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " "Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedur8{|CORE RECORD VARIABLES|}  The CORE record is made up of the following fields: # %X_Min * Left edge of the screen %X_Max * Right edge of the screen %Y_Min * Top of the screen %Y_Max * Bottom of the screen %X_Org, ** X-origin of fill pattern %Y_Org, ** Y-origin of fill pattern %X_CP X current position %Y_CP Y current position %Line_Index Color of line %Fill_Indee Box_Rel (Width, Height : Point); " Procedure Write_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1, -$P|  4{|USING THE PATTERN COMPILER|}   The pattern compiler accepts a text file containing a pattern definition  and produces a .PTRN data file acceptable for use with the GRAFDRAW  unit. To execute the pattern compiler, X(ecute PAT.COMP. The compiler  will prompt for the name of the text file containing the pattern  definition. This file contains pattern parameters and the pattern 9 9{|USING THE FONT COMPILER|}   The font compiler accepts a series of text files containing a font  definition and produces a .FONT data file acceptable for use with the  GRAFDRAW unit. To execute the font compiler, X(ecute FONT.COMP. The  compiler will prompt for the name of the first text file of the font  definition. This file contains font parameters and the first part of  the font definition. The next prompt is for the name of the font data  file. This should be specified as "FONTxx" wh definition. The next prompt is for the name of the pattern data file.  This should be specified as "PATxx" where xx is a two digit pattern  number (e.g. 00 or 15). The compiler will store the pattern definition  in the file PATxx.PTRN. The pattern compiler processes the pattern  definition until the end of the text file is encountered. The pattern  compiler then closes the pattern data file and terminates. "  Pattern text files are line oriented. The first line of the text file  contains twoere xx is a two digit  font number (e.g. 00 or 15). The compiler will store the font  definition in the file FONTxx.FONT. The font compiler then processes  the character definitions until the end of the text file is  encountered. It then prompts for the name of a continuation text  file. If there are no other text files, a causes  the font compiler to close the font data file and terminate. "  Font text files are line oriented. The first line of the first text  numbers describing the pattern. The first number is the  number of pixels in the horizontal direction. The second number is the  number of pixels in the vertical direction. The numbers are  separated by one or more spaces. A follows the  second number. The remainder of the text file contains the pattern  definition. A pattern definition consists of several lines  containing a drawing consisting of color identifiers representing the  file in a font definition contains four numbers describing the font.  The first number is the number of pixels in the horizontal direction.  The second number is the number of pixels in the vertical direction.  The third number is the ASCII value of the first character in the font  definition (e.g. 32 for ). The fourth number is the ASCII  value of the last character in the font definition (e.g. 127 for  ). Numbers are separated by one or more spaces. A follows t value of each pixel, each separated by two spaces. The color  identifiers are: " *D, d, or . for dark (black) *R or r for red *G or g for green *Y or y for yellow *B or b for blue *P or p for purple *T or t for turquoise *W or w for white "  Each line corresponds to a row of the pattern image. There are as  many lines as there are rows in the pattern image. An example of a  character definition for an 11 by 11 pathe last number. The remainder of the text file (and  all of any continuation text files) contains character definitions,  starting with the lowest valued character of the font and continuing  without interruption through the highest valued character. A  character definition consists of a line containing the character  enclosed in quotes (e.g. "G") followed by several lines containing a  drawing consisting of alternating patterns of either '.'s tern is: " /. b b b b b b b b b . /y . b b b b b b b . g /y y . b b b b b . g g /y y y . b b b . g g g /y y y y . b . g g g g /y y y y y . g g g g g /y y y y . r . g g g g /y y y . r r r . g g g /y y . r r r r r . g g /y . r r r r r r r . g /. r r r r r r r r r . "  Note that there should be no blank lines either at the end of the  pattern text file nor at the beginning.  ^F "  (representing an empty pixel) or characters other than '.'s  (representing a dot), separated by two spaces. Each line corresponds  to a row of the character image. There are as many lines as there  are rows in the character image. The next character definition  follows immediately after the last line of the current character  definition; there are no intervening blank lines. An example of a  character definition for a 8 by 14 character is: " ;"b" ;. . . . . . . . ;. b . . . . . "The format of the .PTRN datafile is: " &Word 1: Number of pixels in the horizontal direction &Word 2: Number of pixels in the vertical direction &Word 3-? Array [Word1..Word2] of pattern rows &  The pattern image is an array of word-aligned rows. Each row consists  of an array of color identifiers each occupying 4 bits. A row occupies  (Word1 + 3) Div 4 words. The pattern occupies Word2 * ((Word1 + 3) Div  4) words. Note that this format corresponds to the internal  representation of an . ;. b . . . . . . ;. b . . . . . . ;. b . b b . . . ;. b b . . b . . ;. b . . . . b . ;. b . . . . b . ;. b . . . . b . ;. b . . . . b . ;. b b . . b . . ;. b . b b . . . ;. . . . . . . . ;. . . . . . . . =  Note that there should be no blank lines either at the end of the font  text file nor at the beginning. " "The format of the .FONT datafile is: " I^§2§Rÿÿ&Word 1: Number of pixels in the horizontal direction &Word 2: Number of pixels in the vertical direction &Word 3: Value of the first character in the font &Word 4: Value of the last character in the font &Word 5-? Array [Word3..Word4] of character images &  Each character image is an array of byte-aligned rows. Each row  occupies (Word1 + 7) Div 8 bytes. Each character occupies Word2 *  ((Word1 + 7) Div 8) bytes. There are no padding bytes between rows. Character definitions are word a      array under the UCSD Pascal system. An array  declaration for the example pattern might be 0 0Array [1..11] Of Packed Array [1..11] Of 0..15; * &The color token values for the possible colors are: & 20 for dark (black) 21 for red 22 for green 23 for yellow 24 for blue 25 for purple 26 for turquoise 27 for white ^PAGE 1  ^T 1 |A-$P| " LUES OF THE CORE RECORD VARIABLES|}   The initial (default) CORE record field values are as follows:  %Field name Initial value  ----------------- ------------------------- % %X_Min * 0 %X_Max * 639 %Y_Min * 0 %Y_Max * 479 %X_CP 0 %Y_CP 0 %Line_Index 7 (White) %Fill_Index 7 (White) %Text_Index 7 (White) I^’¦’¦%Background 0 (Black) %Line_Style ? %Display_Mode Fast (No fill) %Overlay_Mode Replace %Polygon_Interior Plain %Polygon_Edge ? %Font_Number ** -1 (Undefined) %Font_Cols ** ? %Font_Rows ** ? %Char_Spacing ? %Char_Path ? %DX_Charup ? %DY_Charup ? %Char_Height ? %Char_Width ? %Pat_Number ** -1 (Undefined) %Pat_Cols ** ? %Pat_Rows ** ? %   Note: The variables in the CORE record flagged by "*" and "**" in the 'above table should not be explicitly set by a user program. Such 'an attempt will cause unpredictable results. ' '* These variables are set once by the system. '** These variables are automatically set by procedure calls. '  ^PAGE 1  ^TAIL 1 |E-$P|   {|APPENDIX E|} 6 6 6{|INSTALLATION OF GRAPHICS ADD ON|} 6   {|APPENDIX A|}  4{|MINIMUM HARDWARE REQUIREMENTS|}   The minimum hardware configuration required to run graphics applications  on the NEC APC is as follows:   - 128K RAM - Monochrome or Color Graphics Board "- 1 Floppy Drive   Note: Graphics programs may be developed and prepared for execution on  any APC equipped with the p-System Development package. '  ^PAGE 1  ^TAIL 1 |B-$P|   {|APPENDIX B|}  5{|DEFINITION OF FILES ON THE DISK|} " "You have 4 This section describes the procedure for integrating your development  system with your graphics extension. The method described is the  simplest way to make the Grafdraw unit accessable to any programs  you write. If you would like to install the unit directly into the  system library for more efficient accesss, you may do so. If you are  not familiar with the library utility, this method will be sufficient.     The Graphics Add On may be installed by executing the following steps: $  With test/demo programs: %Demo.Text Short demonstration program. %Graftest.Text Extensive demonstration and validation suite. %Boat.Text Demonstrates extensive use of arcs and filling. %APC.Text Short demonstration of filling.  Charts.Text Fast Display Bar Charts and Pie Charts. " "You have 1 version of the GRAFDRAW unit code file: %Grafdraw.Code Contains GRAFDRAW unit in P-Code  "You have 1 character font and 4 patterns:  your system disk in the left drive and the "Graphics Add On" disk in  the right drive: $1 ) Type an "X" from the command line that appears on the screen (immediately after booting the system disk. $2 ) The prompt: "Execute what file ? " will appear on the top line (of the screen. $3 ) Type in "I=#5:INSUSR" followed by a carriage return. $4 ) The system will then install the unit onto the system disk and (set the environment so that you can execute any of the demo files %Font00.Font Data file containing the default character 8font. %Font.A.Text Contains the source of the first 1/7 of the font 8definition found in Font00.Font. %Font.G.Text Font.B.Text through Font.G.Text contain the rest 8of the font definiton found in Font00.Font %Pat00.Ptrn Data file containing a medium sized triangle 8pattern. %Pat.A.Text Contains the source for the pattern in Pat00.Ptrn. %Pat01.Ptrn Data file containing a medium sized rectangle 8p(included on the disk. % % ^F  attern. %Pat.B.Text Contains the source for the pattern in Pat01.Ptrn. %Pat02.Ptrn Data file containing a small grid pattern. %Pat.C.Text Contains the source for the pattern in Pat02.Ptrn. %Pat03.Ptrn Data file containing a large triangle pattern. %Pat.D.Text Contains the source for the pattern in Pat03.Ptrn.   ^PAGE 1  ^TAIL 1 |C-$P|   {|APPENDIX C|}  6{|RUNNING THE DEMO PROGRAMS|}   To run the DEMO program, first prefix to GRAFICS:, then X(ecute DEMO.  A display of all rectangle and circle drawing modes will appear. It  will stay on the screen until the [RETURN] key is hit.   To run the BOAT, CHARTS and APC programs, follow the same steps as above.   To run the GRAFTEST program, follow the same steps as above. However,  the program will run indefinitely. In order to stop it, you must reboot  the system.   ^PAGE 1  ^TAIL 1 |D-$P|   {|APPENDIX D|}  -{|INITIAL VA     O^Q§Q§I^æ§æ§^M GRAPHICS UNIT --- FEB '83  GRAF.NOTES  GRAF.RUN -pages  GRAF.COVER 1 to 2  GRAF.INTRO 1-1  GRAF.BASIC 2-1 to 2-2  GRAF.DOC1 3-1 to 3-5  GRAF.DOC2 3-6 to 3-13  GRAF.DOC3 3-14 to 3-27  GRAF.DOC4 3-28 to 3-40  GRAF.UTILS 4-1 to 5-2  GRAF.APPEN A1 to E1  //   ^!-------------------------------------------------  ^! WRITER CONTROL FILE FOR GRAF DOCUMENTATION  ^!-------------------------------------------------   ^!  ^! Header and Tail setup  ^H 1 NEC APC GRAPHICS SUPPLEMENT  ^H 2 p-System IV.1  ^OP PREC 0   ^!  ^! Run time variables for page numbers  ^!  ^! C : Chapter number  ^!   ^I GRAF.COVER   ^HFIRST  ^SET C = 1;  ^Tail |-$P|  ^I GRAF.INTRO   ^SET C = C + 1;  ^Tail |-$P|  ^I GRAF.BASIC   ^SET C = C+1;  ^Tail |-$P|  ^I GRAF.DOC1   ^I GRAF.DOC2   ^I GRAF.DOC3   ^I GRAF.DOC4   ^SET C = C+1;  ^Tail |-$P|  ^I GRAF.UTILS   ^! Appendices. Special handling   ^I GRAF.APPEN   O^Q§Q§O^Q§Q§#12:GRAF.RUN.TEXTÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛg?,HNEC APC GRAPHICS SUPPLEMENTÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛg p-System IV.1ÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛg # #To whoever uses this disk: # #The directory of the files to create the graphics supplement and #the pages that they should be on are in PF.GRAF.text. If you need #more files for the printing they are on the disk "first pass #graphics documentation. Anymore questions ask me. # #Doug ÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛgÛg1.3ÛgÛgÛgÛgÛgÛgÛg     ÿÿI^¦¢§R@@@@@@@ ^PAGE 1 @{|DRAW RESULTS|}  ^CO UN \\ (  Each procedure in the GRAFDRAW unit returns a status describing the  success or failure of the requested operation. The status is deposited  in the Core variable Draw_Result. Hence, the Draw_Result variable  reflects the status of the most recent draw request. Draw statuses with  values below 10 are considered successful or non-fatal statuses. Draw  statuses of 10 and above are considered fatal and cause the requested  operation to be ignored. &  The non-fatal statuses are Draw_OK, Draw_Clipped and Draw_Init.  Successful calls to GRAFDRAW procedures cause the Draw_Result to be set  to Draw_OK. The Draw_Clipped result is returned after a successful draw  that was clipped when it ran into a viewport boundary. The Draw_Init is  returned after the initialization or reinitialization of the GRAFDRAW  unit. (  There are seven fatal draw statuses. The Draw_Overflow status indicates  ;{|INTRODUCTION|}   The TICOM implementation of graphics for the NEC Advanced Personal  Computer (APC) is composed of three major components. The first is  GRAFDRAW, a collection of Pascal procedures comprising a subset of the  SIGGRAPH CORE. The second is a Font Compiler, which allows you to  define your own text fonts. The third component is a Pattern Compiler,  for defining patterns that will be used when doing fills. The GRAFDRAW  unit is defined in a similar manner to the unit used on  that a coordinate was out of range of the relevant coordinate system.  The Draw_Not_Imp status indicates that the desired operation is not  currently implemented. The Draw_Not_Found status indicates that a  requested font or pattern file was not available. The Draw_No_Memory  status indicates that there was not enough memory available to  facilitate the opening of a new font or pattern file. The Draw_Win_Ovfl  status indicates that an attempt was made to create too many windows.  The Draw_Win_the Ramtek 6214  which proved to be a useful tool for the implementation of graphics  applications under the UCSD p-System.   Appendix A lists the minimum hardware configuration required for  execution of graphics applications.   Appendix B describes the files provided on the release disk.   On your disk is a set of demo programs that will demonstrate the  features of the GRAFDRAW unit. The source for these programs is also Imp status indicates that an attempt was made to create a  window that the current hardware cannot process. The Draw_No_Font  status indicates that an attempt to draw text was made when no font had  been successfully defined. (  In addition to the standard draw results, a pseude-draw result has been  defined to equal the highest defined draw result. The Draw_Max result  is provided to aid in defining draw result subranges even as new draw  included so that you may see how the calls to the unit are made.   Please refer to Appendix C for details on running the demo programs.   ^PAGE 1   results are added. The current draw results are summarized below: & ( %Draw_OK = 0; {Nominal draw result} %Draw_Clipped = 1; {Draw performed, figure clipped} %Draw_Init = 2; {Draw variables at initial state}  %Draw_Overflow = 10; {Draw ignored, coordinate out of range} %Draw_Not_Imp = 11; {Draw ignored, feature not implemented} %Draw_Not_Found = 12; {Draw ignored, file not found} %Draw_No_Memory = 13; {Draw ignored, not enough memory} %Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} %Draw_Win_Imp = 15; {Draw ignored, implementation restrict} %Draw_No_Font = 16; {Draw ignored, no font defined} % %Draw_Max = Draw_No_Font; {Current maximum draw result number} %  ^CO UN {}  ^PAGE 1 ^SET C = C + 1 ^T 1 |-$P| 9 9{|USING THE FONT COMPILER|}   The font compiler accepts a series of text files containing a font  definition and produces a .FONT data file acceptable for use with the I^Y§Y§ÿÿ GRAFDRAW unit. To execute the font compiler, X(ecute FONT.COMP. The  compiler will prompt for the name of the first text file of the font  definition. This file contains font parameters and the first part of  the font definition. The next prompt is for the name of the font data  file. This should be specified as "FONTxx" where xx is a two digit  font number (e.g. 00 or 15). The compiler will store the font  definition in the file FONTxx.FONT. The font compiler then processes  the character de     *P or p for purple *T or t for turquoise *W or w for white "  Each line corresponds to a row of the pattern image. There are as  many lines as there are rows in the pattern image. An example of a  character definition for an 11 by 11 pattern is: " /. b b b b b b b b b . /y . b b b b b b b . g /y y . b b b b b . g g /y y y . b b b . g g g /y y y y . b . g g g g /y y y y y . g g g g g /y y y y . r lowest valued character of the font and continuing  without interruption through the highest valued character. A  character definition consists of a line containing the character  enclosed in quotes (e.g. "G") followed by several lines containing a  drawing consisting of alternating patterns of either '.'s  (representing an empty pixel) or characters other than '.'s  (representing a dot), separated by two spaces. Each line corresponds . g g g g /y y y . r r r . g g g /y y . r r r r r . g g /y . r r r r r r r . g /. r r r r r r r r r . "  Note that there should be no blank lines either at the end of the  pattern text file nor at the beginning.  ^F " "The format of the .PTRN datafile is: " &Word 1: Number of pixels in the horizontal direction &Word 2: Number of pixels in the vertical direction &Word 3-? Array [Word1..Word2] of pattern rows &  to a row of the character image. There are as many lines as there  are rows in the character image. The next character definition  follows immediately after the last line of the current character  definition; there are no intervening blank lines. An example of a  character definition for a 8 by 14 character is: " ;"b" ;. . . . . . . . ;. b . . . . . . ;. b . . . . . . ;. b . . . . . . ;. b . b b . . . ;. b b . . b . . ;. b . . . . b . ;. b The pattern image is an array of word-aligned rows. Each row consists  of an array of color identifiers each occupying 4 bits. A row occupies  (Word1 + 3) Div 4 words. The pattern occupies Word2 * ((Word1 + 3) Div  4) words. Note that this format corresponds to the internal  representation of an array under the UCSD Pascal system. An array  declaration for the example pattern might be 0 0Array [1..11] Of Packed Array [1..11] Of 0..15; * &The color token values for the possible colors are: & . . . . b . ;. b . . . . b . ;. b . . . . b . ;. b b . . b . . ;. b . b b . . . ;. . . . . . . . ;. . . . . . . . =  Note that there should be no blank lines either at the end of the font  text file nor at the beginning. " "The format of the .FONT datafile is: " &Word 1: Number of pixels in the horizontal direction &Word 2: Number of pixels in the vertical direction &Word 3: Value of the first character in the font  20 for dark (black) 21 for red 22 for green 23 for yellow 24 for blue 25 for purple 26 for turquoise 27 for white ^PAGE 1  ^T 1 |A-$P| " &Word 4: Value of the last character in the font &Word 5-? Array [Word3..Word4] of character images &  Each character image is an array of byte-aligned rows. Each row  occupies (Word1 + 7) Div 8 bytes. Each character occupies Word2 *  ((Word1 + 7) Div 8) bytes. There are no padding bytes between rows. Character definitions are word aligned. ^PAGE 1 ^SET C = C + 1 ^T 1 |-$P|  4{|USING THE PATTERN COMPILER|}   The pattern compiler accepts a text file containing a pattern definition  and I^Y§Y§produces a .PTRN data file acceptable for use with the GRAFDRAW  unit. To execute the pattern compiler, X(ecute PAT.COMP. The compiler  will prompt for the name of the text file containing the pattern  definition. This file contains pattern parameters and the pattern  definition. The next prompt is for the name of the pattern data file.  This should be specified as "PATxx" where xx is a two digit pattern  number (e.g. 00 or 15). The compiler will store the pattern definition  in the file PATxx.PTRN. The pattern compiler processes the pattern  definition until the end of the text file is encountered. The pattern  compiler then closes the pattern data file and terminates. "  Pattern text files are line oriented. The first line of the text file  contains two numbers describing the pattern. The first number is the  number of pixels in the horizontal direction. The second number is the  number of pixels in the vertical direction. The numbers are  separated by one or morfinitions until the end of the text file is  encountered. It then prompts for the name of a continuation text  file. If there are no other text files, a causes  the font compiler to close the font data file and terminate. "  Font text files are line oriented. The first line of the first text  file in a font definition contains four numbers describing the font.  The first number is the number of pixels in the horizontal direction. e spaces. A follows the  second number. The remainder of the text file contains the pattern  definition. A pattern definition consists of several lines  containing a drawing consisting of color identifiers representing the  value of each pixel, each separated by two spaces. The color  identifiers are: " *D, d, or . for dark (black) *R or r for red *G or g for green *Y or y for yellow *B or b for blue  The second number is the number of pixels in the vertical direction.  The third number is the ASCII value of the first character in the font  definition (e.g. 32 for ). The fourth number is the ASCII  value of the last character in the font definition (e.g. 127 for  ). Numbers are separated by one or more spaces. A follows the last number. The remainder of the text file (and  all of any continuation text files) contains character definitions,  starting with the        {|APPENDIX A|}  4{|MINIMUM HARDWARE REQUIREMENTS|}   The minimum hardware configuration required to run graphics applications  on the NEC APC is as follows:   - 128K RAM - Monochrome or Color Graphics Board "- 1 Floppy Drive   Note: Graphics programs may be developed and prepared for execution on  any APC equipped with the p-System Development package. '  ^PAGE 1  ^TAIL 1 |B-$P|   {|APPENDIX B|}  5{|DEFINITION OF FILES ON THE DISK|} " "You have 4%Glob_Y_Max * 1023 %   Note: The variables in the CORE record flagged by "*" and "**" in the 'above table should not be explicitly set by a user program. Such 'an attempt will cause unpredictable results. ' '* These variables are set once by the system. '** These variables are automatically set by procedure calls. '  ^PAGE 1  ^TAIL 1 |E-$P|   {|APPENDIX E|} 6 6 6{|INSTALLATION OF GRAPHICS ADD ON|} 6  This section describes the procedure for integrating your development  test/demo programs: %Demo.Text Short demonstration program. %Graftest.Text Extensive demonstration and validation suite. %Boat.Text Demonstrates extensive use of arcs and filling. %APC.Text Short demonstration of filling.  Charts.Text Fast Display Bar Charts and Pie Charts. " "You have 1 version of the GRAFDRAW unit code file: %Grafdraw.Code Contains GRAFDRAW unit in P-Code  "You have 1 character font and 4 patterns:  system with your graphics extension. The method described is the  simplest way to make the Grafdraw unit accessable to any programs  you write. If you would like to install the unit directly into the  system library for more efficient accesss, you may do so. If you are  not familiar with the library utility, this method will be sufficient.     The Graphics Add On may be installed by executing the following steps: $  With your system disk in the left drive and the "Graphics Add On" disk in %Font00.Font Data file containing the default character 8font. %Font.A.Text Contains the source of the first 1/7 of the font 8definition found in Font00.Font. %Font.G.Text Font.B.Text through Font.G.Text contain the rest 8of the font definiton found in Font00.Font %Pat00.Ptrn Data file containing a medium sized triangle 8pattern. %Pat.A.Text Contains the source for the pattern in Pat00.Ptrn. %Pat01.Ptrn Data file containing a medium sized rectangle 8p the right drive: $ $1 ) Transfer the Grafdraw.code file to your system disk. $ $2 ) Create a USERLIB.TEXT file as mentioned in Appendix C. %  ^PAGE 1  ^TAIL 1 |F-$P|  {|APPENDIX F|} 6 3{|Arc Drawing and Color Masking|}   Previous releases of the GRAFDRAW unit contained flawed algorithms for  arc clipping and color masking. The arc clipping algorithms caused arcs  to be drawn beyond the bounds of the current viewport. However, since  the pervious releases equated the current viewport aattern. %Pat.B.Text Contains the source for the pattern in Pat01.Ptrn. %Pat02.Ptrn Data file containing a small grid pattern. %Pat.C.Text Contains the source for the pattern in Pat02.Ptrn. %Pat03.Ptrn Data file containing a large triangle pattern. %Pat.D.Text Contains the source for the pattern in Pat03.Ptrn.   ^PAGE 1  ^TAIL 1 |C-$P|   {|APPENDIX C|}  6{|RUNNING THE DEMO PROGRAMS|}  nd display window to  the entire screen, the flaws were unnoticable. In the current versions,  the arc clipping algorigthms do not use trigonometric functions and  hence are not subject to the sluggishness and roundoff problems of prior  versions. Additionally, arcs clipped at the top of screen often appeared  to be clipped at their 45 degree points instead of the display boundary.  This problem has also been corrected. (  In previous releases, the mask specified by calling the Plane_Enable  Before running any of the demo programs a USERLIB.TEXT file should be  created on the root volume. This USERLIB.TEXT file should contain  the string 'Grafics: Grafdraw'. If you are unsure how to create the  USERLIB.TEXT file, refer to the p-System manual that discusses user  libraries.   To run the DEMO program set the prefix to GRAFICS: and then X(ecute  DEMO. A display of all rectangle and circle drawing modes will appear.  It will stay on the screen until the [RETURN] key is hit.   To procedure was anded directly with the color value before drawing. This  had the unwanted effect of erasing images in "disabled" planes when the  Core Overlay_Mode was set to Replace. In the current version, the  "disabled" planes are not affected by any drawing operations regardless  of the color of the draw. In addition, the red and blue planes are  automatically "disabled" when using a monochrome graphics board. Note  that the speed of a draw varies directly with the number of "disabled"  plane run the BOAT, CHARTS and APC programs, follow the same steps as above.   To run the GRAFTEST program, follow the same steps as above. However,  the program will run indefinitely. In order to stop it, you must reboot  the system.   ^PAGE 1  ^TAIL 1 |D-$P|   {|APPENDIX D|}  -{|INITIAL VALUES OF THE CORE RECORD VARIABLES|}   The initial (default) CORE record field values are as follows:  %Field name Initial value  ----------------- ------------------------- % s. (  ;{|Text XOR Mode|}   Use of the Core Overlay_Mode state is not specified in the Ramtek  GRAFDRAW specification. In previous releases of the GRAFDRAW unit, the  Text procedure drew in Replace mode only. In the current version, The  Text procedure observes the state of the Overlay_Mode variable and hence  draws text in either Replace mode or XOR mode. (  ( 8{|Changes to GRAFDRAW|} "  A number of the GRAFDRAW procedures have subtly changed as a result of %X_Min * 0 %X_Max * 639 %Y_Min * 0 %Y_Max * 479 %X_CP 0 %Y_CP 0 %Line_Index 7 (White) %Fill_Index 7 (White) %Text_Index 7 (White) %Background 0 (Black) %Line_Style ? %Display_Mode Fast (No fill) %Overlay_Mode Replace %Polygon_Interior Plain %Polygon_Edge ? %Font_Number ** -1 (Undefined) %Font_ the addition of the viewport and windowing facilities. This section  briefly describes the changes made for each procedure and variable in  the GRAFDRAW interface. References to the relevant expository sections  are also given. Note that all procedures return a status in the Core  Draw_Result variable. "   {|The Core Record|}   The Overlay_Mode value is observed in the Text procedure. Refer to the  section on Text XOR Mode. &  The Region_X_Org and Region_Y_Org variables contain the globalCols ** ? %Font_Rows ** ? %Char_Spacing ? %Char_Path ? %DX_Charup ? %DY_Charup ? %Char_Height ? %Char_Width ? %Pat_Number ** -1 (Undefined) %Pat_Cols ** ? %Pat_Rows ** ? %Region_X_Org ** 0 %Region_Y_Org ** 0 %Win_X_Res * 16 %Win_Y_Res * 1 %Glob_X_Min * 0 %Glob_X_Max * 1023 %Glob_Y_Min * 0        |PROCEDURE BOX_ABS (X_Corner, Y_Corner : Point);| "  Description: "This procedure draws a rectangular box starting at the CP. The box is "drawn parallel to the x and y axes. One corner is located at the CP, "and the opposite corner at the point given by X_Corner and Y_Corner. " "If CORE^.Displaymode = 'Fast', the box will be drawn as a rectangular "outline. If it is 'Fill', the box will be drawn as a rectangular "solid. " "If CORE^.Polygon_Edge = 'Solid_Line' and CORE^.displaymode = 'Filalways drawn. Currently, only the portions of the rectangle sides that  are contained within the viewport (if at all) are drawn. " "  {|The Text Procedure|}   The Overlay_Mode value is observed in the Text procedure. Refer to the  section Text XOR Mode. In addition, text drawn beyond the end of the  viewport is clipped. Refer to the description of Procedure Set_Region in  chapter 3. " "  {|The Circle_Abs and Circle_Rel Procedures|}  l', "the box will be drawn as a solid rectangle with a border. If it is "'Interior', no border will be drawn. " "If CORE^.Polygon_Interior = 'plain' and CORE^.displaymode = 'fill', "the box will be drawn as a solid-colored rectangle. If it is "'patterned', then the box will be drawn using the current pattern. " "If CORE^.Overlaymode = 'replace', each pixel on the screen will be "overwritten by the corresponding pixel of the box. If it is 'XOR',  The Circle_Abs and Circle_Rel procedures are now capable of drawing  circles of radius greater than 480. Circle clipping has been altered so  that circles drawn over the top boundary are clipped at the top boundary  instead of at their 45 degree points. Also, Clipping calculations are  now much faster. Refer to the section Arc Drawing and Color Masking. "   {|The Arc_Abs and Arc_Rel Procedures|}   The Arc_Abs and Arc_Rel procedures are now capable of drawing arcs of  radius greater than 480"then a boolean XOR is performed of the screen and the box and the "result is displayed. " "CORE^.Lineindex specifies the color in which the border of the box "is drawn. " "CORE^.Fillindex specifies the color to be used for a solid fill.   Effect on CP:  "The CP retains the value it had before the box was drawn. "  Example: " "CORE^.Lineindex := 1; "CORE^.Fillindex := 4; "CORE^.Displaymode := fill; "CORE^.Polygon_Edge := Solid_Line; "CORE^.Polygon_Interior := plain; "CORE^.Overlaymode. Arc clipping has been altered so that arcs  drawn over the top boundary are clipped at the top boundary instead of  at their 45 degree points. Arc clipping now observes viewport  boundaries exactly instead of approximately. Clipping calculations are  now much faster. Refer to the section Arc Drawing and Color Masking. " "  ^F  {|The Set_Region Procedure|}   The Set_Region procedure is new in this release and allows the  declaration of viewports. Refer to chapter 3.    := replace; " "Box_Abs(90,70); " "This draws a box with a border color of 1 and fills it with a solid "color of 4. The box starts at the Current Position and has its "opposite corner at ( 90, 70).  ^F "  |PROCEDURE BOX_REL (Width, Height : Point);|   Description: "This procedure is similar to BOX_ABS. The only difference is that the "point defining the corner of the box opposite to the anchor point, is "given as a relative displacement from the CP. Therefore, Width is an  {|The Set_Window Procedure|} "  The Set_Window procedure is new in this release and allows the  declaration of windows. Refer to chapter 3.   "offset from the current X position and Height is an offset from the "current Y position. "  Effect on CP:  "See BOX_ABS. "  Example: "Refer to BOX_ABS.  ^F "  |PROCEDURE WRITE_BLOCK_PIXELS (Data : Sorcery; Rows, Columns : Integer);|   Description: "This procedure takes a rectangular array of pixels from a user- "defined area and writes it to the screen starting at the Current "Position. The parameters Rows and Columns define the size of the "pixel array to be transferred from memory. The order of display is "from left to right and bottom to top. " "The memory array resides in an area pointed to by the parameter Data. "This parameter is of type Sorcery and needs to be set prior to the "procedure call. " "CORE^.Overlay_Mode has an effect on this function if it is set to "XOR. "  Effect on CP:  "None. "  Example: "Type Screen = Packed array [0..19, 0..19] of color_index; " "Var Screen_Seg : ^Screen 'Data : ^Sorcery; " "begin O^$§$§  coordinates of the origin of the current viewport. Refer to the  description of Procedure Set_Region in chapter 3. 9  ^F  The Window_List variable points to the list of currently defined  windows. The Win_X_Res and Win_Y_Res variables specify the window  placement resolution within the global coordinate space. Refer to  description of Procedure Set_Window in chapter 3.   The Glob_X_Min, Glob_X_Max, Glob_Y_Min and Glob_Y_Max variables describe  the bounds of the global coordinate space. 9  The Draw_Result variable indicates the result of the most recent draw  operation. See chapter 4.  "  {|The Move_Cursor Procedure|}   The Move_Cursor procedure has been changed to draw a clipped cursor when  overrunning the edge of a viewport. Previous version maintained axial  symmetry at all times. " !  {|The Box_Abs and Box_Rel Procedures|}   In previous versions, boxes drawn with either the Box_Abs or Box_Rel  procedures were clipped so that all four sides of the rectangle were       $new(Screen_Seg); (* Fill screen_seg with pixel values *) $moveleft(Screen_Seg,Data,2); (* Move the address of the screen Einto Data*) $Move_Abs(100,100); $Write_Block_Pixels(Data,20,20); "end; " "This will write the pixels from Screen_Seg to the screen starting at "( 100, 100 ). The rectangular screen area that is affected by this "code is 20 pixels on each side.  "Note that for the two-dimensional array, Screen, the first coordinate "is the Y value and the second coordinate i"CORE^.Text_Index specifies the color for the string. " "CORE^.Font_Number is set by the procedure SET_FONT and is the number "of the currrent text font. "  Effect on CP:  "None. "  Example:  CORE^.Text_Index := 1; "CORE^.Char_Width := 12; "CORE^.Char_Height := 30; "SET_FONT(1); "TEXT('LETS SEE WHAT THIS LOOKS LIKE'); "  ^F   |PROCEDURE SET_LINE_STYLE (Dot_1, Dot_2, Dot_3, Dot_4,  Dot_5, Dot_6, Dot_7, Dot_8 : Switch_Type);|   Description: "This proces the X value.  ^F E  |PROCEDURE READ_BLOCK_PIXELS (Data : Sorcery; Rows, Columns : Integer);|   Description: "This procedure does just the opposite of WRITE_BLOCK_PIXELS. The "parameters mean the same thing, except that Data is now the "destination for the screen area defined by the Current Position and "the parameters Rows and Columns.   Effect on CP:  "None. "  Example: "Refer to WRITE_BLOCK_PIXELS  ^F   |PROCEDURE SET_CHARUP (DX_Charup, DY_Charup : Integer);|  dure allows you to define the type of line that will be "used to draw lines, circles and boxes. It can be a solid line, a "dashed line, or a line with dots and dashes. This is done by setting "the definition of one segment of the line which is composed of 8 "pixels. Each of the eight pixels can be turned either 'ON' or 'OFF'. "  Effect on CP:  "None. "  Example: "SET_LINE_STYLE(ON,ON,ON,ON,OFF,OFF,OFF,OFF); " "This line will have 4 pixels on, then 4 pixels off, then 4 on, 4 off, "etc.  Description: "This procedure establishes the rotation angle for each individual "character output via subsequent TEXT calls. It does not specify the "direction for the character path (given by the contents of "CORE^.Char_Path). " "The rotation angle is determined by a normalized cartesian vector "system and is governed by the following table:   DX_Charup DY_Charup Character rotation %--------- --------- ----------------------------- % 0 1  ^F   |PROCEDURE LINE_ABS (X_End, Y_End : Point);|   Description: "This procedure draws a line beginning at the Current Position and "going to the point defined by X_End and Y_End. The current position "is then updated to the X_End, Y_End position. " "If CORE^.Overlaymode = 'Replace', each pixel on the screen will be "overwritten by the corresponding pixels of the line. If it = 'XOR', "then a Boolean XOR of the screen and the line will be performed and "the result will be displayed.  Right side up )0 -1 Upside down )1 0 Rotated to the right (-1 0 Rotated to the left ( "If DX_Charup and DY_Charup have values other than (-1,0,1), the system "automatically normalizes the vector based on the larger of the two "values. "  Effect on CP:  "None. "  Example: "SET_CHARUP(-1,0); " "This causes all characters output by subsequent TEXT calls to appear "rotated to the left. "  ^F  " "CORE^.Line_Index is the color in which the line will be drawn. " "CORE^.Line_Style is set by the procedure SET_LINE_STYLE.   Effect on CP:  "CP <-- ( X_End, Y_End ); "  Example: "SET_LINE_STYLE(ON,ON,ON,ON,OFF,OFF,OFF,OFF); "CORE^.Line_Index := 1; "CORE^.Overlaymode := xor; "MOVE_ABS(100,100); "LINE_ABS(120,120);   ^F   |PROCEDURE LINE_REL (X_Length, Y_Length : Point);|   Description: "This procedure is the same as LINE_ABS except that the end point is  |PROCEDURE SET_FONT (Font_Num : Font_Type);|   Description: "This procedure selects a user-defined text font for use in the TEXT "procedure. The file containing the pattern must be named "FONT*.FONT where '*' is a number between 0 and 99. The variables "CORE^.Fontnumber, CORE^.Fontrows and CORE^.Fontcols are set by this "procedure.   Effect on CP:  "None. "  Example: "SET_FONT(3); " "This causes the system to read the file FONT03.FONT if it is present. "All future calls to the TE"specified by relative displacements from the Current Position. "  Effect on CP:  "CP <-- ( X_CP+X_Length, Y_CP+Y_Length ); "  Example: "SET_LINE_STYLE(ON,ON,ON,ON,OFF,OFF,OFF,OFF); "CORE^.Line_Index := 1; "CORE^.Overlaymode := XOR; "MOVE_ABS(100,100); "LINE_REL(21,21);  "This does the same as the example for LINE_ABS.   ^F   |PROCEDURE PLINE_ABS (Var X_End, Y_End : Point_Array; Count : Integer);|   Description: "This procedure draws a series of lines beginning at the current XT procedure will use this font.   ^F   |PROCEDURE TEXT (The_String : String);|   Description: "This procedure writes a string of text to the screen using a user- "defined font. The size of the characters, their orientation, the "spacing between them and their path can be defined. The parameter is "a standard Pascal string to be displayed.   CORE^.Char_Width and CORE^.Char_Height define the size of the "characters to be printed rounded to the nearest multiples. " "position and going to the first set of points in the two arrays "X_END and Y_END, then the next line to the second position in the "array and so on for Count lines. At the end, the CP is pointing "to the end of the last line. A line of zero length implies a pen-up "command so that the next line is interpreted as cursor movement only "with no display. The line after that will be displayed again.  "If CORE^.Overlaymode = 'Replace', each pixel on the screen will be "CORE^.Char_Path defines the direction in which the text string is to "be written (Left,Right,Up or Down). " "CORE^.DX_Charup and CORE^.DY_Charup define the rotation at which the "characters are written. These variables can be set with the "SET_CHARUP procedure. " "CORE^.Spacing can be used to define the distance between characters. "This is a real number and is used to represent a unit of the "character size. The number can be a fraction to move .5 characters "apart, or it can be a negat"overwritten by the corresponding pixels of the line. If it is 'XOR', "then a Boolean XOR of the screen and the line will be performed and "the result will be displayed. " "CORE^.Line_Index is the color in which the line will be drawn. " "CORE^.Line_Style is set by the procedure SET_LINE_STYLE.   Effect on CP:  "CP <-- ( X_End[Count], Y_End[Count] ); "  Example: "CORE^.Line_Index := 1; "X_END[1] := 200; "Y_END[1] := 100; "X_END[2] := 200; "Y_END[2] := 200; "X_END[3] := 100; "Y_END[ive number to move the characters closer "together. " "CORE^.Left_Right and CORE^.Top_Bottom are used to position the text "relative to the current position (X_CP,Y_CP). CORE^.Left_Right is "used to position the string so that the 'left' edge, 'right' edge or "'center' of the string is located on the X component of the Current "Position. CORE^.Top_Bottom is used to position the string so the "'top' edge, 'bottom' edge or 'center' is located on the Y component of "the Current Position. "       ^20 6{|UCSD p-SYSTEM VERSION IV.1|} E E 6{|NEC APC GRAPHICS SUPPLEMENT|} F 0{|Copyright (c) 1983, TICOM Systems, Inc.|} E E E E E E E E E E E X X X X X W{September 30, 1983}  ^F  ^5 ;{TABLE of CONTENTS} = = = = =  "1. INTRODUCTION ........................................... 1-1 " "2. BASIC TERMS AND CONCEPTS ............................... 2-1 " "3. THE GRAFDRAW UNIT ...................................... 3-1 " INTERFACE SECTION ................................_LENGHT, Y_LENGHT, 4); " "This example will draw a box in color 1 starting at (100,100) and "returning there.  ^F "  |PROCEDURE CIRCLE_ABS (X_Of_Edge, Y_Of_Edge : Point);|   Description: "This procedure draws a circle that is centered around the Current "Position with the edge of the circle passing through the point "defined by X_Of_Edge and Y_Of_Edge. The circle can be drawn as an "outline or as a solid disk. If it is solid, it may be filled with a .... 3-2 (CORE RECORD VARIABLES ................................ 3-7 (GRAFDRAW UNIT PROCEDURES ............................. 3-8 *MOVE_ABS ........................................... 3-9 *MOVE_CURSOR......................................... 3-10 *MOVE_REL ........................................... 3-11 *SET_CURSOR ......................................... 3-12 *SIZE_CURSOR......................................... 3-13 *SET_FILL_PATTERN ................................... 3-14 "solid color or a user-defined pattern.  "If CORE^.Display_Mode = 'Fast', the circle will be drawn as an "outline. If it is 'Fill', the circle will be drawn as a solid. " "If CORE^.Polygon_Edge = 'Solid_Line' and CORE^.Display_Mode = 'Fill', "the circle will be drawn as a solid disk with a border. If it is "'Interior', no border will be drawn. " "If CORE^.Polygon_Interior = 'Plain' and CORE^.Display_Mode = 'Fill', "the circle will be drawn as a solid-colored disk. If it is "'Patterned', t*BOX_ABS ............................................ 3-15 *BOX_REL ............................................ 3-16 *WRITE_BLOCK_PIXELS ................................. 3-17 *READ_BLOCK_PIXELS .................................. 3-18 *SET_CHARUP ......................................... 3-19 *SET_FONT ........................................... 3-20 *TEXT ............................................... 3-21 *SET_LINE_STYLE ..................................... 3-22 *LINE_ABS .....................hen the circle will be drawn using the current pattern. " "If CORE^.Overlay_Mode = 'Replace', each pixel on the screen will be "overwritten by the corresponding pixel of the circle. If it is 'XOR', "then a boolean XOR is performed with the current contents of the "screen before the result is displayed. " "CORE^.Line_Index specifies the color in which the border of the circle "is drawn. " "CORE^.Fill_Index specifies the color to be used for a solid fill.   Effect on CP:  ...................... 3-23 *LINE_REL ........................................... 3-24 *PLINE_ABS .......................................... 3-25 *PLINE_REL .......................................... 3-26 *CIRCLE_ABS ......................................... 3-27 *CIRCLE_REL ......................................... 3-28 *DEFINE_COLOR ....................................... 3-29 *INQ_COLOR .......................................... 3-30 *INQ_VALUE .......................................... 3-31 "The CP retains the value it had before the procedure call. "  Example: "CORE^.Line_Index := 1; "CORE^.Fill_Index := 4; "CORE^.Display_Mode := Fill; "CORE^.Polygon_Edge := Solid_Line; "CORE^.Polygon_Interior := Plain; "CORE^.Overlay_Mode := Replace; " "CIRCLE_ABS(90,70); " "This draws a circle with a border color of 1 and fills it with a solid "color of 4. The circle has its center at the current position, and "the border passes through the point ( 90, 70 ).   ^F   |PROCEDURE CIRCLE*PLANE_ENABLE ....................................... 3-32 *PLANE_VISIBLE ...................................... 3-33 *SET_PALETTE ........................................ 3-34 *SET_VALUE .......................................... 3-35 *ERASE .............................................. 3-36 *ERASE_ALPHA ........................................ 3-37 *FLOOD .............................................. 3-38 *ARC_REL ............................................ 3-39 *ARC_ABS ......................_REL (Radius : Point);|   Description: "This procedure is similar to the CIRCLE_ABS procedure. The "difference is that instead of drawing the border through a specific "point, the circle is still centered at the Current Position, but the "border is 'Radius' pixels away from the center. "  Effect on CP:  "The CP retains the value it had before the procedure call. "  Example: "Refer to CIRCLE_ABS.   ^F  ...................... 3-41 *SET_REGION ......................................... 3-42 *SET_WINDOW ......................................... 3-44  ^F  "4. DRAW RESULTS ........................................... 4-1  "5. THE FONT COMPILER ...................................... 5-1  "6. THE PATTERN COMPILER ................................... 6-1  "APPENDICES  "A. MINIMUM HARDWARE REQUIREMENTS .......................... A-1 $CURSOR $EQUAL ^O.$§$§3] := 200; "X_END[4] := 100; "Y_END[4] := 100; "MOVE_ABS(100,100); "PLINE_ABS(X_END, Y_END, 4); " "The above example will draw a box in color 1 starting at (100,100) and "returning there. "  ^F "  |PROCEDURE PLINE_REL (Var X_Length, Y_Length : Point_Array; Count : Integer);|   Description: "This procedure is the same as PLINE_ABS except that the lines are "specified in terms of relative displacements rather than absolute end "point locations. A line of length zero still implies a pen-up "command. "  Effect on CP:  "CP <-- ( X_Final, Y_Final ); " %Where: 'X_Final = X_CP+X_Length[1]+X_Length[2]+ ... +X_Length[Count] 'Y_Final = Y_CP+Y_Length[1]+Y_Length[2]+ ... +Y_Length[Count] ,  Example: "CORE^.Line_Index := 1; "X_LENGTH[1] := 100; "Y_LENGTH[1] := 0; "X_LENGTH[2] := 0; "Y_LENGTH[2] := 100; "X_LENGTH[3] := -100; "Y_LENGTH[3] := 0; "X_LENGTH[4] := 0; "Y_LENGTH[4] := -100; "MOVE_ABS(100,100); "PLINE_REL(X      "B. FILES ON THE RELEASE DISK .............................. B-1 "C. RUNNING THE DEMO PROGRAMS .............................. C-1 "D. INITIAL VALUES OF THE CORE RECORD VARIABLES ............ D-1 "E. INSTALLING THE GRAFDRAW UNIT ........................... E-1 "F. SUMMARY OF VERSION 0.5 ENHANCEMENTS .................... F-1  ^PAGE 1   (Cursor : A software controlled graphics cursor. It shows on 4the screen as a hairline cross with equal vertical 4and horizontal bar sizes. The cursor can be any 4size, up to the full screen. The default cursor 4size is 15 pixels. ( &Pixel : The elementary display unit. Each pixel is a dot on 4the display, and is individually controlled by 4attributes stored for it in the graphics display 4memory. The NEC APC has a 640 x 480 pixel display. 4The attributes for each pixel are stored in a 4-bit 4field where the high order bit is always 0, and the 4remaining 3 bits give the color associated with the 4pixel.  &Plane : The display screen may be visualized as three ( superimposed bit planes, one for each of the primary 4colors, Red, Green and Blue. The color for an 4individual pixel is therefore determined by a three 4bit value, depicting a color value or "index". ( &Viewport : A rectangular subset of the global coordinate space $CURSOR $EQUAL ÏO.$§$§4where drawing can occur. Viewports need not be 4coincident with windows. 4 &Windows : A rectangular subset of the global coordinate space 4which the display hardware actually displays on the 4screen. Windows may or may not be coincident with 4viewports. 4  {2.3 Support utilities}   In addition to the GRAFDRAW unit, it is necessary to be able to $define patterns (for fill operations) and fonts (for text display). $A "Compiler" program is provided for each of these operations.  $These programs accept standard p-System text files properly $formatted to describe fonts and patterns, and create binary data $files that can by used by the graphics application. $ $Chapters 5 and 6 describe the operation of the Font and Pattern $Compilers, respectively. $   ^PAGE 1   7{|BASIC TERMS AND CONCEPTS|}  {2.1 How the GRAFDRAW unit works}   A graphics application communicates with the graphics hardware $through the interface provided by the GRAFDRAW unit. Most of the $unit is implemented in assembly language for efficiency of $operation. Because the unit is designed to be a subset of the $SIGGRAPH CORE standard, graphics applications can maintain a high $degree of portability across various hardware environments. For the $sake of program compatibili$CURSOR $EQUAL ‹O.‰¦‰¦ty, some procedures have been included in $the unit eventhough they perform no operation. $  {2.2 Definitions} $  Following are some common terms used throughout the manual. $ (Color : The APC makes eight colors available for display. ( These colors are fixed and cannot be altered. The 4term 'index' is used as a synonym for color in many 4places. Conceptually, a color index is a pointer 4into a color table that determines which color is to 4be used for drawing lines, shapes, displaying text, 4etc. In reality, since the color scheme is fixed, 4there is no need to keep such tables around. 4Therefore, the color tables are conceptual only, and 4the index {is} the color. 4 4Color and index values are as follows: 4 80 - Black 4 - Blue 81 - Red 5 - Magenta 82 - Green 6 - Turquoise 83 - Yellow 7 - White ( (CP : The system's Current Position. The point within the 4graphic co 9{|THE GRAFDRAW UNIT|}  The GRAFDRAW unit is composed of 30 procedures along with a variable  that defines the current state of the graphic screen and values for  the next operation (CORE^). Below you will find a listing of the  interface section for the unit. This will show you all of the  procedures and their parameters, as well as the types and variables  that are available. In order to use the GRAFDRAW unit from a program,  you must include it with the "USES" statement. Following is theordinate space where the next output 4operation will take place. The CP is kept in memory 4in the X_CP and Y_CP CORE variables. ( ( In this manual, the CP is occasionally indicated by 4an ordered pair of X and Y coordinates, such as 4( 100, 200 ). 4 4Some of the GRAFDRAW procedures have an effect on 4the value of the CP, others do not. This effect is 4indicated in the documentation by an expression of 4the form: 4 8CP <-- ( New_X_Value, New_Y_Value ); 8       7Pat_Rows : Point; { Rows in pattern } 7 7File_Prefix : String[7]; { Prefix for font, text } 5 7Region_X_Org, 7Region_Y_Org : Point; { Draw region origin }  ^F 7Window_List : Win_Rec_P { Chain of window records } 7Win_X_Res, 7Win_Y_Res : Point; { Deltas for window coords } 7Glob_X_Min, 7Glob_X_Max, 7Glob_Y_Min, 7Glob_Y_Max : Point; { Global coordinates } 7 7Draw_Result : Draw_OK..Draw_Max; T{ Result of last draw } 5End {of Core_Record}; " "Var Cor {Draw ignored, file not found} &Draw_No_Memory = 13; {Draw ignored, not enough memory} &Draw_Win_Ovfl = 14; {Draw ignored, window list out of range} &Draw_Win_Imp = 15; {Draw ignored, implementation restrict} &Draw_No_Font = 16; {Draw ignored, no font defined} &Draw_Max = Draw_No_Font; {Current maximum draw result number} ( "Type Cur_Attribute = (Cur_Disable, { Cursor disable } 8Cur_Enable, { Cursor enable } e : ^Core_Record; Procedure Move_Abs (X_Position, 6Y_Position : Point); " "Procedure Move_Cursor (X_Position, 9Y_Position : Point); " "Procedure Move_Rel (Delta_X, 6Delta_Y : Point); " "Procedure Set_Cursor (Attrib : Cur_Attribute); " "Procedure Size_Cursor (Size : Integer); " Procedure Set_Fill_Pattern (Pattern_Num : Pat_Type); " "Procedure Box_Abs (X_Corner, Y_Corner : Point); " "Procedure Box_Rel (Width, Height : Point); " 8Cur_Visible, { Cursor visible } 8Cur_Invisible, { Cursor invisible } 8Cur_Small, { Cursor small } 8Cur_Full); { Cursor full } 'Switch_Types = (Off, On); 'Overlay_Type = (Replace, { Replace contents } 8Xor); { Merge contents } 'Display_Type = (Fast, { No filling } 8Fill); { Fill all polygons } 'Int_Type = (Plain, { Solid rectangle } 8Patterned); { User pattern } 'Edg Procedure Write_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " "Procedure Read_Block_Pixels (Data : Sorcery; Rows, Columns : Integer); " Procedure Set_Charup (DX_Charup, 8DY_Charup : Integer); " "Procedure Set_Font (Font_Num : Font_Type); " "Procedure Text (The_String : String); " Procedure Set_Line_Style (Dot_1,  +_____ .......... "of a window in the drawing space, its coordinates on the physical "screen and the window's size. The global coordinates within "the drawing space specify the lower left corner of the window. "The physical screen coordinates specify the location of the "lower left corner of the image on the display screen (assuming "the lower left corner is (0, 0)). The window's size is specified "by the number of pixels in the horizontal and vertical directions. "The record is declared as follows:   ^CO UN \\ 2---- => __________ 7============= 2____ '__________________    ^F "The following example declares two windows corresponding to the "illustration above. The first window is displayed starting at "(0, 0) on the physical display and continuing through (639, 10). It "displays the drawing space bounded by (500, 20) and (1139, 488). "Thus, the window is 640 by 11 pixels. The second window is "displayed starting at (0, 11) on the physical display and "continuing through (639, 479)Win_Rec_P = ^Win_Rec; )Win_Rec = Record ;Next_Window : Win_Rec_P; { Link to next rec } ;Win_X_Org, { Global drawspace } ;Win_Y_Org, { coordinates } ;Disp_X_Org, { Display screen } ;Disp_Y_Org, { coordinates } ;Win_X_Size, { Window size } ;Win_Y_Size : Point; 9End {of Win_Rec};   ^CO UN {} "The Core variable Window_List initially points to a window record ). It displays the drawing space "bounded by (64, 1000) and (703, 1010). Thus, the window is 640 by "469.   ^CO UN \\ )Var Win_Example : Win_Rec_P; )Begin +New (Win_Example); {Set up window list} +New (Win_Example^.Next_Window); +Win_Example^.Next_Window^.Next_Window := Nil; +With Win_Example^ Do {Set up first window} -Begin /Win_X_Org := 500; { Global drawspace } /Win_Y_Org := 20; { coordinates } /Disp_X_Org := 0; { Display screen } "that declares a window at (0, 0) in the global coordinate space "and (0, 0) on the display screen for the entire display screen "(640 pixels horizontally and 480 pixels vertically). " "Global drawspace coordinates not within the global coordinate "space, physical display coordinates not within the screen's "coordinate space and negative window sizes cause an entire "Set_Window request to be ignored and a Draw_Overflow status to be "returned as the Draw_Result (refer to the chapter on Draw Results) (0, 0) | &|-------------------------------------------------| $[0, 0] [x, y] are global coordinates 2(x, y) are viewport coordinates  "In the example above, the global space is the 1024 by 1024 "rectangle. A viewport is defined at (X_Start, Y_Start) relative "to the global space. The viewport is X_Length pixels wide and "Y_Length pixels high. The Set_Region call required to set up such "a viewport would be: " . " "Due to hardware constraints within the NEC APC, a number of "constraints are placed on the contents of the window list. There "may be a minimum of zero and a maximum of two entries in the "window list. If there are no entries (i.e. the list pointer is "NIL), the screen is blanked. (Note that since the 7220 chip draws "quite quickly when the screen is blanked, this mode can be used to "increase drawing speed). If there are any entries in the window 'Set_Region (X_Start, Y_Start, X_Length, Y_Length); ' "Any operations attempting to draw outside of the current viewport "are clipped and a Draw_Clipped status is returned as the "Draw_Result. Generally, clipping is performed so that the figure "actually drawn appears exactly as it would have if no clipping "were performed, except that it is truncated at the viewport "boundaries. The exception to this rule is text. Text erased "using the Erase_Alpha procedure and text written to the screen "usin      /Disp_Y_Org := 0; { coordinates } /Win_X_Size := 640; { Window size } /Win_Y_Size := 11; -End {of With}; +With Win_Example^.Next_Window^ Do {Set up second window} -Begin /Win_X_Org := 64; { Global drawspace } /Win_Y_Org := 1000; { coordinates } /Disp_X_Org := 0; { Display screen } /Disp_Y_Org := 11; { coordinates } /Win_X_Size := 640; { Window size } /Win_Y_Size := 469; -End {of With}; )End; )  ^CO UN {}  ^F "offset from the current X position and Height is an offset from the "current Y position. "  Effect on CP:  "See BOX_ABS. "  Example: "Refer to BOX_ABS.  ^F "  |PROCEDURE WRITE_BLOCK_PIXELS (Data : Sorcery; Rows, Columns : Integer);|   Description: "This procedure takes a rectangular array of pixels from a user- "defined area and writes it to the screen starting at the Current "Position. The parameters Rows and Columns define the size of the "pixel array to be transferred from memory. The order of display is "from left to right and bottom to top. " "The memory array resides in an area pointed to by the parameter Data. "This parameter is of type Sorcery and needs to be set prior to the "procedure call. " "CORE^.Overlay_Mode has an effect on this function if it is set to "XOR. "  Effect on CP:  "None. "  Example: "Type Screen = Packed array [0..19, 0..19] of color_index; " "Var Screen_Seg : ^Screen 'Data : ^Sorcery; " "begin I^J¦J¦$new(Screen_Seg); (* Fill screen_seg with pixel values *) $moveleft(Screen_Seg,Data,2); (* Move the address of the screen Einto Data*) $Move_Abs(100,100); $Write_Block_Pixels(Data,20,20); "end; " "This will write the pixels from Screen_Seg to the screen starting at "( 100, 100 ). The rectangular screen area that is affected by this "code is 20 pixels on each side.  "Note that for the two-dimensional array, Screen, the first coordinate "is the Y value and the second coordinate is the X value.  ^F E  |PROCEDURE READ_BLOCK_PIXELS (Data : Sorcery; Rows, Columns : Integer);|   Description: "This procedure does just the opposite of WRITE_BLOCK_PIXELS. The "parameters mean the same thing, except that Data is now the "destination for the screen area defined by the Current Position and "the parameters Rows and Columns.   Effect on CP:  "None. "  Example: "Refer to WRITE_BLOCK_PIXELS  ^F   |PROCEDURE SET_CHARUP (DX_Charup, DY_Charup : Integer);|    |PROCEDURE BOX_ABS (X_Corner, Y_Corner : Point);| "  Description: "This procedure draws a rectangular box starting at the CP. The box is "drawn parallel to the x and y axes. One corner is located at the CP, "and the opposite corner at the point given by X_Corner and Y_Corner. " "If CORE^.Displaymode = 'Fast', the box will be drawn as a rectangular "outline. If it is 'Fill', the box will be drawn as a rectangular "solid. " "If CORE^.Polygon_Edge = 'Solid_Line' and CORE^.displaymode = 'Fil Description: "This procedure establishes the rotation angle for each individual "character output via subsequent TEXT calls. It does not specify the "direction for the character path (given by the contents of "CORE^.Char_Path). " "The rotation angle is determined by a normalized cartesian vector "system and is governed by the following table:   DX_Charup DY_Charup Character rotation %--------- --------- ----------------------------- % 0 1 l', "the box will be drawn as a solid rectangle with a border. If it is "'Interior', no border will be drawn. " "If CORE^.Polygon_Interior = 'plain' and CORE^.displaymode = 'fill', "the box will be drawn as a solid-colored rectangle. If it is "'patterned', then the box will be drawn using the current pattern. " "If CORE^.Overlaymode = 'replace', each pixel on the screen will be "overwritten by the corresponding pixel of the box. If it is 'XOR',  Right side up )0 -1 Upside down )1 0 Rotated to the right (-1 0 Rotated to the left ( "If DX_Charup and DY_Charup have values other than (-1,0,1), the system "automatically normalizes the vector based on the larger of the two "values. "  Effect on CP:  "None. "  Example: "SET_CHARUP(-1,0); " "This causes all characters output by subsequent TEXT calls to appear "rotated to the left. "  ^F  "then a boolean XOR is performed of the screen and the box and the "result is displayed. " "CORE^.Lineindex specifies the color in which the border of the box "is drawn. " "CORE^.Fillindex specifies the color to be used for a solid fill.   Effect on CP:  "The CP retains the value it had before the box was drawn. "  Example: " "CORE^.Lineindex := 1; "CORE^.Fillindex := 4; "CORE^.Displaymode := fill; "CORE^.Polygon_Edge := Solid_Line; "CORE^.Polygon_Interior := plain; "CORE^.Overlaymode |PROCEDURE SET_FONT (Font_Num : Font_Type);|   Description: "This procedure selects a user-defined text font for use in the TEXT "procedure. The file containing the pattern must be named "FONT*.FONT where '*' is a number between 0 and 99. The variables "CORE^.Fontnumber, CORE^.Fontrows and CORE^.Fontcols are set by this "procedure.   Effect on CP:  "None. "  Example: "SET_FONT(3); " "This causes the system to read the file FONT03.FONT if it is present. "All future calls to the TE := replace; " "Box_Abs(90,70); " "This draws a box with a border color of 1 and fills it with a solid "color of 4. The box starts at the Current Position and has its "opposite corner at ( 90, 70).  ^F "  |PROCEDURE BOX_REL (Width, Height : Point);|   Description: "This procedure is similar to BOX_ABS. The only difference is that the "point defining the corner of the box opposite to the anchor point, is "given as a relative displacement from the CP. Therefore, Width is an       "command so that the next line is interpreted as cursor movement only "with no display. The line after that will be displayed again.  "If CORE^.Overlaymode = 'Replace', each pixel on the screen will be "overwritten by the corresponding pixels of the line. If it is 'XOR', "then a Boolean XOR of the screen and the line will be performed and "the result will be displayed. " "CORE^.Line_Index is the color in which the line will be drawn. " "CORE^.Line_Style is set by the procedure SET_LINE_STYLive number to move the characters closer "together. " "CORE^.Left_Right and CORE^.Top_Bottom are used to position the text "relative to the current position (X_CP,Y_CP). CORE^.Left_Right is "used to position the string so that the 'left' edge, 'right' edge or "'center' of the string is located on the X component of the Current "Position. CORE^.Top_Bottom is used to position the string so the "'top' edge, 'bottom' edge or 'center' is located on the Y component of "the Current Position. " E.   Effect on CP:  "CP <-- ( X_End[Count], Y_End[Count] ); "  Example: "CORE^.Line_Index := 1; "X_END[1] := 200; "Y_END[1] := 100; "X_END[2] := 200; "Y_END[2] := 200; "X_END[3] := 100; "Y_END[3] := 200; "X_END[4] := 100; "Y_END[4] := 100; "MOVE_ABS(100,100); "PLINE_ABS(X_END, Y_END, 4); " "The above example will draw a box in color 1 starting at (100,100) and "returning there. "  ^F "  |PROCEDURE PLINE_REL (Var X_Length, Y_Length : Point_Array; Count : Integer);|  "CORE^.Text_Index specifies the color for the string. " "CORE^.Font_Number is set by the procedure SET_FONT and is the number "of the currrent text font. "  NOTE - While in graphics mode, this procedure is the only way to send " text to the console on the Decision Mate V. Use of the )p-System console unit I/O intrinsics is not allowed!   Effect on CP:  "None. "  Example:  CORE^.Text_Index := 1; "CORE^.Char_Width := 12; "CORE^.Char_Height := 30; "SET_FONT(1); "TEXT('LETS SE Description: "This procedure is the same as PLINE_ABS except that the lines are "specified in terms of relative displacements rather than absolute end "point locations. A line of length zero still implies a pen-up "command. "  Effect on CP:  "CP <-- ( X_Final, Y_Final ); " %Where: 'X_Final = X_CP+X_Length[1]+X_Length[2]+ ... +X_Length[Count] 'Y_Final = Y_CP+Y_Length[1]+Y_Length[2]+ ... +Y_Length[Count] ,  Example: "CORE^.Line_Index := 1; "X_LENGTH[1] := 100; "Y_LENGTH[1] := 0; "X_E WHAT THIS LOOKS LIKE'); "  ^F   |PROCEDURE SET_LINE_STYLE (Dot_1, Dot_2, Dot_3, Dot_4,  Dot_5, Dot_6, Dot_7, Dot_8 : Switch_Type);|   Description: "This procedure allows you to define the type of line that will be "used to draw lines, circles and boxes. It can be a solid line, a "dashed line, or a line with dots and dashes. This is done by setting "the definition of one segment of the line which is composed of 8 LENGTH[2] := 0; "Y_LENGTH[2] := 100; "X_LENGTH[3] := -100; "Y_LENGTH[3] := 0; "X_LENGTH[4] := 0; "Y_LENGTH[4] := -100; "MOVE_ABS(100,100); "PLINE_REL(X_LENGHT, Y_LENGHT, 4); " "This example will draw a box in color 1 starting at (100,100) and "returning there.  ^F "  |PROCEDURE CIRCLE_ABS (X_Of_Edge, Y_Of_Edge : Point);|   Description: "This procedure draws a circle that is centered around the Current "Position with the edge of the circle passing through the point "pixels. Each of the eight pixels can be turned either 'ON' or 'OFF'. "  Effect on CP:  "None. "  Example: "SET_LINE_STYLE(ON,ON,ON,ON,OFF,OFF,OFF,OFF); " "This line will have 4 pixels on, then 4 pixels off, then 4 on, 4 off, "etc.  ^F   |PROCEDURE LINE_ABS (X_End, Y_End : Point);|   Description: "This procedure draws a line beginning at the Current Position and "going to the point defined by X_End and Y_End. The current position "is then updated to the X_End, Y_End position. " "defined by X_Of_Edge and Y_Of_Edge. The circle can be drawn as an "outline or as a solid disk. If it is solid, it may be filled with a "solid color or a user-defined pattern.  "If CORE^.Display_Mode = 'Fast', the circle will be drawn as an "outline. If it is 'Fill', the circle will be drawn as a solid. " "If CORE^.Polygon_Edge = 'Solid_Line' and CORE^.Display_Mode = 'Fill', "the circle will be drawn as a solid disk with a border. If it is "'Interior', no border will be drawn. " "If CO"If CORE^.Overlaymode = 'Replace', each pixel on the screen will be "overwritten by the corresponding pixels of the line. If it = 'XOR', "then a Boolean XOR of the screen and the line will be performed and "the result will be displayed. " "CORE^.Line_Index is the color in which the line will be drawn. " "CORE^.Line_Style is set by the procedure SET_LINE_STYLE.   Effect on CP:  "CP <-- ( X_End, Y_End ); "  Example: "SET_LINE_STYLE(ON,ON,ON,ON,OFF,OFF,OFF,OFF); "CORE^.Line_Index := 1; RE^.Polygon_Interior = 'Plain' and CORE^.Display_Mode = 'Fill', "the circle will be drawn as a solid-colored disk. If it is "'Patterned', then the circle will be drawn using the current pattern. " "If CORE^.Overlay_Mode = 'Replace', each pixel on the screen will be "overwritten by the corresponding pixel of the circle. If it is 'XOR', "then a boolean XOR is performed with the current contents of the "screen before the result is displayed. " "CORE^.Overlaymode := xor; "MOVE_ABS(100,100); "LINE_ABS(120,120);   ^F   |PROCEDURE LINE_REL (X_Length, Y_Length : Point);|   Description: "This procedure is the same as LINE_ABS except that the end point is "specified by relative displacements from the Current Position. "  Effect on CP:  "CP <-- ( X_CP+X_Length, Y_CP+Y_Length ); "  Example: "SET_LINE_STYLE(ON,ON,ON,ON,OFF,OFF,OFF,OFF); "CORE^.Line_Index := 1; "CORE^.Overlaymode := XOR; "MOVE_ABS(100,100); "LINE_REL(21,21);  XT procedure will use this font.   ^F   |PROCEDURE TEXT (The_String : String);|   Description: "This procedure writes a string of text to the screen using a user- "defined font. The size of the characters, their orientation, the "spacing between them and their path can be defined. The parameter is "a standard Pascal string to be displayed.   CORE^.Char_Width and CORE^.Char_Height define the size of the "characters to be printed rounded to the nearest multiples. " "This does the same as the example for LINE_ABS.   ^F   |PROCEDURE PLINE_ABS (Var X_End, Y_End : Point_Array; Count : Integer);|   Description: "This procedure draws a series of lines beginning at the current "position and going to the first set of points in the two arrays "X_END and Y_END, then the next line to the second position in the "array and so on for Count lines. At the end, the CP is pointing "to the end of the last line. A line of zero length implies a pen-up "CORE^.Char_Path defines the direction in which the text string is to "be written (Left,Right,Up or Down). " "CORE^.DX_Charup and CORE^.DY_Charup define the rotation at which the "characters are written. These variables can be set with the "SET_CHARUP procedure. " "CORE^.Spacing can be used to define the distance between characters. "This is a real number and is used to represent a unit of the "character size. The number can be a fraction to move .5 characters "apart, or it can be a negat      "CORE^.Line_Index specifies the color in which the border of the circle "is drawn. " "CORE^.Fill_Index specifies the color to be used for a solid fill.   Effect on CP:  "The CP retains the value it had before the procedure call. "  Example: "CORE^.Line_Index := 1; "CORE^.Fill_Index := 4; "CORE^.Display_Mode := Fill; "CORE^.Polygon_Edge := Solid_Line; "CORE^.Polygon_Interior := Plain; "CORE^.Overlay_Mode := Replace; " "CIRCLE_ABS(90,70); " "This draws a circle with a border color of 1å and fills it with a solid "color of 4. The circle has its center at the current position, and "the border passes through the point ( 90, 70 ).   ^F   |PROCEDURE CIRCLE_REL (Radius : Point);|   Description: "This procedure is similar to the CIRCLE_ABS procedure. The "difference is that instead of drawing the border through a specific "point, the circle is still centered at the Current Position, but the "border is 'Radius' pixels away from the center. "  Effect on CP:  å"The CP retains the value it had before the procedure call. "  Example: "Refer to CIRCLE_ABS.   ^F  ååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå     ååååååååååååååå      ååååååååååååååå      ååååååååååååååå!     ååååååååååååååå!     ååååååååååååååå"     ååååååååååååååå"     ååååååååååååååå#     ååååååååååååååå#     ååååååååååååååå$     ååååååååååååååå$     ååååååååååååååå%     ååååååååååååååå%     ååååååååååååååå&     ååååååååååååååå&     ååååååååååååååå'     ååååååååååååååå'     ååååååååååååååå(     ååååååååååååååå(     ååååååååååååååå)     ååååååååååååååå)     ååååååååååååååå*     ååååååååååååååå*     ååååååååååååååå+     ååååååååååååååå+     ååååååååååååååå,     ååååååååååååååå,     ååååååååååååååå-     ååååååååååååååå-     ååååååååååååååå.     ååååååååååååååå.     ååååååååååååååå/     ååååååååååååååå/     ååååååååååååååå0     ååååååååååååååå0     ååååååååååååååå1     ååååååååååååååå1     ååååååååååååååå2     ååååååååååååååå2     ååååååååååååååå3     ååååååååååååååå3     ååååååååååååååå4     ååååååååååååååå4     ååååååååååååååå5     ååååååååååååååå5     ååååååååååååååå6     ååååååååååååååå6     ååååååååååååååå7     ååååååååååååååå7     ååååååååååååååå8     ååååååååååååååå8     ååååååååååååååå9     ååååååååååååååå9     ååååååååååååååå:     ååååååååååååååå:     ååååååååååååååå;     ååååååååååååååå;     ååååååååååååååå<     ååååååååååååååå<     ååååååååååååååå=     ååååååååååååååå=     ååååååååååååååå>     ååååååååååååååå>     ååååååååååååååå?     ååååååååååååååå?     ååååååååååååååå@     ååååååååååååååå@     åååååååååååååååA     åååååååååååååååA     åååååååååååååååB     åååååååååååååååB     åååååååååååååååC     åååååååååååååååC     åååååååååååååååD     åååååååååååååååD     åååååååååååååååE     åååååååååååååååE     åååååååååååååååF     åååååååååååååååF     ååååååååååååååG     åååååååååååååååG     ååååååååååååååH     åååååååååååååååH     ååååååååååååååI     åååååååååååååååI     ååååååååååååååJ     åååååååååååååååJ     åååååååååååååååK     åååååååååååååååK     åååååååååååååååL     åååååååååååååååL     ååååååååååååååå