IGSXCIRC PAS&GSXFUNC PAS5"8!GSXINIT PASWbGSXMODE CMDgvWGSXMODE PAS&GSXADDENPAS MPROCEDURE Set_Writing_mode (Mode : INTEGER); BEGIN Contrl[1] := 32; { Op code for Set_Writing_Mode } Contrl[2] := 0; Contrl[4] := 1; { Number of elements in the Intin Array } Intin[1] := Mode; { Writing mode requested } Call_gsx END; { PROCEDURE Set_Writing_Mode } PROCEDURE Set_Plane_Mask (Mask : INTEGER); BEGIN Contrl[1] := 5; { Op code for Escape } Contrl[2] := 0; Contrl[4] := 0; Contrl[6] := 51; { Function ID for Set_Plane_Mask } Intin[1] := Mask; { Plane mask requested } Call_gsx END; { PROCEDURE Set_Plane_Mask } PROCEDURE Reverse_Video_On; BEGIN Contrl[1] := 5; { Op code for Escape } Contrl[2] := 0; Contrl[4] := 0; Contrl[6] := 13; { Function ID for Reverse_Video_On } Call_gsx END; { PROCEDURE Reverse_Video_On } PROCEDURE Reverse_Video_Off; BEGIN Contrl[1] := 5; { Op code for Escape } Contrl[2] := 0; Contrl[4] := 0; Contrl[6] := 14; { Function ID for Reverse_Video_Off } Call_gsx END; { PROCEDURE Reverse_Video_Off } PROCEDURE Direct_Cursor_Address (Row, Col : INTEGER); BEGIN Contrl[1] := 5; { Op code for Escape } Contrl[2] := 0; Contrl[4] := 0; Contrl[6] := 11; { Function ID for Direct_Cursor_Address } Intin[1] := Row; { Requested row number } Intin[2] := Col; { Requested column number } Call_gsx END; { PROCEDURE Direct_Cursor_Address } PROCEDURE Update_Workstation; BEGIN Contrl[1] := 4; { Op code for Update_Workstation } Contrl[2] := 0; Contrl[4] := 0; Call_gsx END; { PROCEDURE Update_Workstation } { These procedures calculate data necessary to present three- dimensional circles using homogenous coordinates. } { We need some global variables specific to these procedures. } VAR Display_scale : REAL; Table_init : BOOLEAN; PROCEDURE Screen_init; { This prepares data tables for screen display } BEGIN Display_scale := 1.58; { Scale factor for y coordinate screen display } Table_init := FALSE; { Signal that tables must be initialized } END; { PROCEDURE Screen_init } PROCEDURE Printer_init; { This prepares data tables for printer display } BEGIN Display_scale := 0.88; { Scale factor for y coordinate printer display } Table_init := FALSE; { Signal that tables must be initialized } END; { Procedure Printer_init } { The following procedures have been developed to demonstrate the calculations necessary to display true three-dimensional circles using GSX. But first we must define types and global variables for this. } CONST Rad = 57.296; Sides = 48; TYPE Circle_Table = RECORD x, y, z, w : REAL END; { RECORD } Display_Table = RECORD x, y, z, w : INTEGER END; { RECORD } Circle_Array = ARRAY[1..sides] of Circle_Table; Display_Array = ARRAY[1..sides] of Display_Table; VAR Circle_pt, Sized_circle : Circle_Array; Display_data : Display_Array; PROCEDURE Draw_circle (Center_x, Center_y, Radius : REAL; Fill_index, Interior_index : INTEGER); PROCEDURE Init_Circle_Table; { This is necessary because Turbo Pascal does not initialize variables. The record is set-up for three-dimensional homogenous coordinates. } VAR I : INTEGER; BEGIN FOR I := 1 to sides DO BEGIN WITH Circle_pt[I] DO BEGIN x := 0; y := 0; z := 0; w := 0 END; { WITH } END; { FOR } Table_init := TRUE END; { PROCEDURE Init_Circle_Table } PROCEDURE Calculate_Circle_Table; { This calculates the x, y coordinates of unit circle at origin. These points define a 48-sided polygon. } VAR I : INTEGER; Angle, Delta_angle, Theta : REAL; Testcos, Testsin : REAL; BEGIN Delta_angle := 7.5; Angle := 0; BEGIN Init_Circle_table; FOR I := 1 TO sides DO { Calculate unit circle based on origin } BEGIN Theta := Angle/Rad; WITH Circle_pt[I] DO BEGIN x := COS(Theta); y := SIN(Theta) END; { WITH } Angle := Angle + Delta_angle END { FOR } END; { IF..THEN } END; { PROCEDURE Calculate_circle_table } PROCEDURE Size_circle; { Calculates the x, y coordinates of a circle of size Radius } VAR I : INTEGER; BEGIN Sized_circle := Circle_pt; { Make copy of table for further calculations. } FOR I := 1 TO sides DO BEGIN WITH Sized_circle[I] DO BEGIN x := x * Radius; y := Y * Radius END { WITH } END; { FOR } END; { PROCEDURE Size_circle } PROCEDURE Size_display; { Calculates the y coordinate for true size on display screen } VAR I : INTEGER; BEGIN FOR I := 1 TO sides DO Sized_circle[I].y := Sized_circle[I].y * Display_scale; END; { PROCEDURE Size_display } PROCEDURE Locate_circle; { Calculates specific x, y coordinates for given circle } VAR I : INTEGER; BEGIN FOR I := 1 TO sides DO BEGIN WITH Sized_circle[I] DO BEGIN x := x + Center_x; y := y + Center_y END { WITH } END; { FOR } { Now convert to integers to pass to line drawing procedure } FOR I := 1 TO sides DO BEGIN Display_data[I].x := ROUND (Sized_circle[I].x); Display_data[I].y := ROUND (Sized_circle[I].y); Display_data[I].z := ROUND (Sized_circle[I].z) END { FOR } END; { PROCEDURE Locate_circle } PROCEDURE Draw_circle; { Coordinates of polygon now passed to GSX Polyline procedure } VAR I, J : INTEGER; BEGIN I := 1; J := 1; REPEAT Ptsin[I] := Display_data[J].x; Ptsin[I+1] := Display_data[J].y; I := I + 2; J := J + 1; UNTIL J > sides; Contrl[1] := 9; { Op code for filled polygon } Contrl[2] := sides; Contrl[4] := 0; { Now this information is passed to GSX } Call_gsx END; { PROCEDURE Draw_circle } { PROCEDURE Draw_Filled_Circle Main Program } BEGIN Fill_interior (Fill_index); Fill_style (Interior_index); IF NOT Table_init THEN { Determine if table needs to be calculated } Calculate_circle_table; Size_circle; Size_display; Locate_circle; Draw_circle END; { PROCEDURE Draw_circle } { This ends the include file for drawing circle } { These are procedures that performs GSX functions that may be called from various user programs. It is designed to be used as an include file. } PROCEDURE Init_Work_Station (WS_number:INTEGER); { This opens the workstation whose number is passed to this procedure. See page 20, GSX manual. } BEGIN Contrl[1] := 1; Contrl[2] := 0; Contrl[4] := 10; Intin[1] := WS_number; { Calls device driver for the specified station } Intin[2] := 1; { The values set the default settings for the station } Intin[3] := 1; Intin[4] := 1; Intin[5] := 1; Intin[6] := 1; Intin[7] := 1; Intin[8] := 1; Intin[9] := 1; Intin[10] := 1; { Now that initialization has been done, call GSX. } Call_gsx; END; { PROCEDURE Init_Work_Station } { The following procedure returns from alpha to graphics mode } PROCEDURE Enter_graphics_mode; BEGIN Contrl[1] := 5; { Op code for escape } Contrl[2] := 0; Contrl[4] := 0; Contrl[6] := 2; { Function ID: enter graphics mode } { Now that initialization has been done, call GSX. } Call_gsx; END; { PROCEDURE Enter_graphics_mode } { The following procedure returns from graphics to alpha mode } PROCEDURE Exit_graphics_mode; BEGIN Contrl[1] := 5; { Op code for escape } Contrl[2] := 0; Contrl[4] := 0; Contrl[6] := 3; { Function ID: exit graphics mode } { Now that initialization has been done, Call GSX. } Call_gsx; END; { PROCEDURE Exit_graphics_mode } { The following procedure clears the screen in monitor mode. It dumps the graphics memory to the printer when the printer is the open work station. } PROCEDURE Clear_work_station; BEGIN Contrl[1] := 3; { Op code } Contrl[2] := 0; Contrl[4] := 0; { Now that initialization has been done, call GSX. } Call_gsx; END; { PROCEDURE Clear_work_station } { This procedure is called by others which allow definition of line types. } PROCEDURE Set_line_type (Line_type : INTEGER); BEGIN Contrl[1] := 15; { Op code } Contrl[2] := 0; Contrl[4] := 1; Intin[1] := Line_type; { Now that initialization has been done, call GSX. } Call_gsx; END; { PROCEDURE Set_line_type } { The following procedure controls the size and orientation of the string which will be sent by the Text procedure. } PROCEDURE Set_character_spec (Height : INTEGER; Angle : REAL); CONST Rad = 57.296; { For angle conversion } BEGIN { Set up height first } Contrl[1] := 12; { Op code } Contrl[2] := 1; Contrl[4] := 0; Ptsin[1] := 0; Ptsin[2] := Height; Call_gsx; { Now set up angle } Contrl[1] := 13; { Op code } Contrl[2] := 0; Contrl[4] := 3; Intin[1] := ROUND (Angle * 10); Intin[2] := ROUND (COS(Angle/Rad) * 100); Intin[3] := ROUND (SIN(Angle/Rad) * 100); Call_gsx END; { PROCEDURE Set_character_spec } { This procedure allows for changing of text font } PROCEDURE Set_text_font (Text_font : INTEGER); BEGIN Contrl[1] := 21; { Op code } Contrl[2] := 0; Contrl[4] := 1; Intin[1] := Text_font; Call_gsx END; { PROCEDURE Set_text_font} { The following procedure sends the text passed to it to the work station. } PROCEDURE Text (x,y : INTEGER; Text_string : Screenline); VAR I, Lens : INTEGER; BEGIN Lens := LENGTH(Text_string); { Set-up according to GSX convention } Contrl[1] := 8; { Op code } Contrl[2] := 1; Contrl[4] := Lens; Contrl[6] := 12; { Function ID } Ptsin[1] := x; Ptsin[2] := y; { Now prepare the string for GSX, see page 46, GSX manual. } FOR I := 1 to Lens DO Intin[I] := ORD(Text_string[I]); Call_gsx END; { PROCEDURE Text } { This procedure determines the interior fill style of a filled figure } PROCEDURE Fill_style (Style : INTEGER); BEGIN Contrl[1] := 24; { Op code } Contrl[2] := 0; Contrl[4] := 1; Intin[1] := Style; Call_gsx END; { PROCEDURE Fill_style } { This procedure determines the choices of interior styles } PROCEDURE Fill_interior (Style : INTEGER); BEGIN Contrl[1] := 23; { Op code } Contrl[2] := 0; Contrl[4] := 1; Intin[1] := Style; Call_gsx END; { PROCEDURE Fill_interior } { This ends the include file of GSX functions. } { These procedures call GSX from Turbo Pascal. Development begun March 29, 1984, by Dr. August E. Sapega. Essentially completed on March 2, 1984. Extended on April 7, 1984. } { The link up to GSX is accomplished in the calling procedures through the folling procedure. } PROCEDURE Call_gsx; { Before we can call GSX we must set-up the parameter block. This assigns addresses to parameter blocks as required by GSX. See page 12 of the GSX. Also see Turbo manual, page 176. } TYPE Address_Type = ^Pblock_Address; {This is necessary to use ADDR procedure} Pblock_Address = RECORD PB_Address : Address_Type { A 32-bit word ! } END; PBlockA = ARRAY [1..20] of PBlock_Address; { To hold 32-bit address } RegPack = RECORD { See Turbo addendum, page 4 } ax,bx,cx,dx,bp,si,di,ds,es,flags: INTEGER END; VAR RecPack : RegPack; PBlock : PBlockA; Dxp, Dsp : INTEGER; BEGIN { First we set-up the parameter block. These are 32-bit addresses as needed in the parameter block. } PBlock[1].PB_Address := ADDR(Contrl); PBlock[2].PB_Address := ADDR(Intin); PBlock[3].PB_Address := ADDR(Ptsin); PBlock[4].PB_Address := ADDR(Ptsout); PBlock[5].PB_Address := ADDR(Intout); { Now we set-up the d-registers, before calling the interrupt to GSX. See page 11, GSX manual. } Dxp := OFS(PBlock); { See page 176, Turbo manual. } Dsp := SEG(PBlock); RecPack.dx := Dxp; RecPack.ds := Dsp; { The following sets register CX, as required by GSX. See page 11, GSX manual. Decimal 1139 is equal to 0437H. } RecPack.cx := 1139; { Now we issue the interrupt to call GSX, using Intr procedure as supplied by Turbo Pascal. See page 5 Turbo Addendum. Decimal 224 is the interrupt required by GSX. } Intr(224, RecPack) END; { PROCEDURE Call_gsx } { This ends the Include file for calling GSX. } @$ͫCopyright (C) 1984 BORLAND IncK Rainbow 100chelectedP=1h>1l.' t C. u* SQRWVP2PX^_ZY[t .X[SP.>t.SPX[ûm}SQRWVP..FFGG..$...!X^_ZY[ÿ2.t.OOK2.n t0.G u d[YSЊpc2$U tt<u\!2XZPs0tL t L<uLXZP XZP2a[_)PQYX%;u;&E&]P X[S>Y[r3$ȋaUc>Ut%s >ac&=st +%6&=T`njQRȋӋČӃ_3hZYw- 33SP&u&5njT&&E&E&E6a&<&D6Y&<&DÑ[_[S& &Ur3$]_>UnjsW&&]s6_6]&&\&D&D& &U&E&]<t&=&E&]& &U&UW&&]ȋӡ]_&E&]egnjgKVuQJt1&&\&L&T&&]eg)&E&]3É>W3_3333>Ut&=ČӃ3+r;sȋ[&&U[&&Eik[,.;W!tW.!uTtFʱ3H,i.G!$R2,!& u,.G!Z€kuփ$6, U]%SQRWVLW  _2Ҋ{}U336R6P&&u2ұ63P yP[Ë*(SQNJ݊2XXظbȸ6؉*( y-C2'd 2+sut0C3?$ uCPCX0r% ru rsRZr2s tÊ-uCQYr-u[& 2A+^. 2A+Z62C6?CC6CC:v6A[2+L6 G[262+ t'y6 A6 AG!9BKT ]f6 2G62Fڊ;v t u:ZYQ62F6 r&62+AV^NOAG&XnH62+v;v3҇6&[62D62G6 2F3+r@ tBQWV^_Yt@GJu3&56[:<&>@S>:WP6HB>>>:66%5W8[6:<S>:WP6H>:68P[Xu6\26@6@[6:t22AG u tò[Z Q t2uY **t2u[ 36Ñ[XS*r26sCË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pw_uXPHqP GSX GRAPHICSP-$OP>_ TO LEAVE GRAPHICS MODEPxῙ렙2=TtHP2=ttHY ul,5To obtain print out of graphics on LA50, type P ࿙sꠙ2=PtHP2=ptHY u(PaThis concludes demonstration.ꠙ2=PtHP2=ptHY uɹPaThis{$R+} PROGRAM GSX_Model; { This is a model program to demonstrate GSX, and to provide a template to build on for further developments. This program begun April 11, 1984 by Dr. August E. Sapega. This program takes advantage of the special feature of Turbo Pascal which allows any section (such as TYPE, VAR, etc.) to occur any number of times in any order. See page 45, Turbo Manual for further details. } { The following global arrays hold information needed by GSX. } TYPE ControlA = ARRAY[1..6] of INTEGER; IntinA = ARRAY[1..100] of INTEGER; IntoutA = ARRAY[1..100] of INTEGER; PtsinA = ARRAY[1..100] of INTEGER; PtsoutA = ARRAY[1..100] of INTEGER; ScreenLine = STRING[80]; { For text via Procedure Text. } { These are global variables used to reach GSX through the above arrays. } VAR Contrl : ControlA; Intin : IntinA; Intout : IntoutA; Ptsin : PtsinA; Ptsout : PtsoutA; { This global variable is needed in the demonstration program. } Ch : CHAR; { Now we include those procedures which initialize and call GSX. Note that the include line is indented so that when using Tlist to print out program it will not list the included files. Consult the help function of Tlist for further details. } {$I GSXINIT.PAS} { Here are included some GSX Procedures called from demonstration program. } {$I GSXFUNC.PAS} {$I GSXCIRC.PAS} { This procedure uses the GSX GDP for a circle } PROCEDURE Circle (X, Y, Radius, Interior, Fill : INTEGER); BEGIN { CIRCLE } Set_line_type (3); Fill_Style (Fill); Fill_Interior (Interior); Contrl[1] := 11; { Circle op code } Contrl[2] := 3; Contrl[4] := 0; Contrl[6] := 4; { Circle identifier } Ptsin[1] := X; Ptsin[2] := Y; Ptsin[3] := 0; Ptsin[4] := 0; Ptsin[5] := Radius; { Radius } Ptsin[6] := 0; Call_gsx END; { PROCEDURE Circle } { This procedure uses the GSX GDP for a bar } PROCEDURE Bar (Lx, Ly, Ux, Uy, Interior, Fill : INTEGER); BEGIN { BAR } Fill_Style (Fill); Fill_Interior (Interior); Contrl[1] := 11; { Op code } Contrl[2] := 2; Contrl[4] := 0; Contrl[6] := 1; { Bar identifier } Ptsin[1] := Lx; Ptsin[2] := Ly; Ptsin[3] := Ux; Ptsin[4] := Uy; Call_gsx END; { PROCEDURE Bar } { This procedure uses the GSX GDP for a filled polygon. } PROCEDURE Shape; BEGIN Fill_Style (1); Fill_Interior (2); Contrl[1] := 9; { Filled area op code } Contrl[2] := 4; Contrl[4] := 0; Ptsin[1] := 20000; Ptsin[2] := 15000; Ptsin[3] := 25000; Ptsin[4] := 25000; Ptsin[5] := 29000; Ptsin[6] := 5000; Ptsin[7] := 20000; Ptsin[8] := 15000; Call_gsx END; { PROCEDURE Shape } PROCEDURE Border; { This draws a border within the edges of NDC spaces. } BEGIN { Draw Border } { Set origin } Contrl[1] := 6; { Polyline op code } Contrl[2] := 5; { Number of lines to connect } Contrl[4] := 500; Ptsin[1] := 500; Ptsin[2] := 500; Ptsin[3] := 32000; Ptsin[4] := 500; Ptsin[5] := 32000; Ptsin[6] := 32000; Ptsin[7] := 500; Ptsin[8] := 32000; Ptsin[9] := 500; Ptsin[10] := 500; { Having defined the border, now draw it. } Call_gsx END; { PROCEDURE Border } PROCEDURE Graphics_Demo; BEGIN Border; Circle (17000,16000,10000,0,2); Bar (6000,5000,8000,14000,3,1); Bar (10000,16000,12000,18000,3,2); Bar (13000,5000,19000,25000,3,5); Shape; Set_Line_Type (4); Draw_Circle (16000,16000,8000,0,0); Draw_Circle (6000,20000,1000,3,6); Draw_Circle (24000,8000,2000,2,5); Draw_Circle (12000,4000,800,2,6); Set_Character_Spec (2500,0); Text (7000,29000,'GSX GRAPHICS'); Set_Character_Spec (2000,0); Text (6000,26000,'Using Turbo Pascal'); Set_Character_Spec (1000,90); Text (2000,3300,'by Dr. August E. Sapega'); Set_Character_Spec (1600,270); Text (30000,25000,'TRINITY COLLEGE'); Set_Character_Spec (1200,45); Text (5000,15000,'Easy-to-use'); END; { PROCEDURE Graphics_Demo } { Main program } BEGIN WRITELN ('This program demonstrates GSX pascal.'); Init_Work_Station (1); { Open workstation for display } Screen_init; { This sets scaling for Draw_Circle procedure } Graphics_Demo; Set_Text_Font (2); Set_Character_Spec (1000,0); Text (1000,1200,'TYPE T TO LEAVE GRAPHICS MODE'); REPEAT READLN (Ch) UNTIL (Ch = 'T') OR (Ch = 't'); Exit_Graphics_Mode; WRITELN ('To obtain print out of graphics on LA50, type P '); READLN (Ch); IF (Ch = 'P') OR (Ch = 'p') THEN BEGIN Init_Work_Station (21); Printer_Init; Graphics_Demo; Clear_Work_Station END; WRITELN ('This concludes demonstration.') END. { GSX test program } END.