plato:source:plaopl:draws
Table of Contents
DRAWS
Table Of Contents
- [00008] DRAWS OVERLAYS FOR COMMAND EXECUTION
- [00027] DRAWOV -DRAW- -RDRAW- -GDRAW-
- [00358] -RORIGIN-
- [00418] -RAT- -RATNM- -RDOT-
- [00546] CIRCLE ROUTINE
Source Code
- DRAWS.txt
- DRAWS
- * /--- FILE TYPE = E
- * /--- BLOCK DRAWS 00 000 77/07/19 19.16
- IDENT PLAT18$
- LCC OVERLAY(PLATO,1,0)
- END
- IDENT DRAWS
- TITLE DRAWS OVERLAYS FOR COMMAND EXECUTION
- *
- *
- CST
- *
- *
- DRAWS$ OVFILE
- *
- *
- EXT PROC,PROCO
- EXT ERROROF
- EXT ILOC,VARCNT,VARADD
- EXT GETCODX
- EXT XDATA,YDATA,SCALXY
- EXT WINDBUF
- EXT XSLICE,SIMPLOT
- *
- *
- * /--- BLOCK DRAWOV 00 000 79/10/04 04.05
- TITLE DRAWOV -DRAW- -RDRAW- -GDRAW-
- *** DRAWOV -- OVERLAY FOR SLOW DRAW COMMANDS
- * ORIGINALLY WRITTEN BY B SHERWOOD
- * MODIFIED 6/74 FOR GDRAW/RDRAW D. SHIRER
- * REWRITTEN 10/10/75 L.A.WHITE
- *
- * IF -DRAW- COMMAND IS WINDOWED, WILL COME HERE.
- * -RDRAW- AND -GDRAW- BOTH COME HERE.
- *
- * ON ENTRY---
- * THERE IS AT LEAST 70 WORDS LEFT IN MOUT BUFFER.
- * OVARG1= -1 RDRAW
- * 0 DRAW
- * 1 GDRAW
- *
- * X5 = COMMAND WORD
- * BIT 59=CONTINUED DRAW FLAG
- * BIT 58=PACKED UP DRAW FLAG
- * (IGNORED BY THIS ROUTINE)
- * BITS 40-57=COUNT OF GETVAR CODES
- * BITS 20-39=FIRST GETVAR CODE
- * BITS 0-19=XSTOR OFFSET + COMMAND NUMBER
- *
- * THE TOP TWO BITS OF EACH GETVAR CODE ARE
- * USED AS FOLLOWS---
- * 00 = COARSE GRID GETVAR CODE
- * 01 = X-COORD FINE GRID GETVAR CODE
- * (FOLLOWING GETVAR CODE IS Y-COORD)
- * 10 = PACKED UP FINE GRID, 9BITS X, 9BITS Y
- * 11 = SKIP INDICATOR
- *
- * ROUTINE PROCEDURE---
- * GETVAR CODES PLACED IN VARBUF
- * CODES EVALUATED ONE AT A TIME,
- * PLACING RESULTS IN TEMPORARY BUFFER
- * RDRAW MAY THEN SCAN THE TEMPORARY BUFFER,
- * RELOCATING POINTS
- * THEN POINTS ARE OUTPUT INTO *MOUT* BUFFER,
- * WINDOWED IF NECESSARY.
- *
- * TEMPORARY BUFFER --
- DRWBUF EQU INFO MAY USE 64*2+EPSILON WORDS
- *
- * /--- BLOCK DRAW 00 000 78/05/05 01.16
- EJECT
- NDRAWOV OVRLAY
- BX6 X5
- AX6 60-XCODEL GET NO. OF VARS TO DECODE
- SX6 X6+1 ADD 1 TO INCLUDE COUNT ITSELF
- RJ GETCODX GETVAR CODES IN VARBUF
- MX6 -1 MARK *INFO* BUFFER USED
- SA6 JJSTORE
- SX6 DRWBUF BUFFER FOR X,Y
- SA6 ILOC ILOC->CURRENT BUFFER LOCATION
- SX6 VARBUF+1 X6 -> FIRST VARIABLE
- SA2 VARCNT
- SX7 X2-1 X7 = COUNT OF POINTS REMAINING
- *
- * GET NEXT GETVAR CODE ---
- * X7= COUNT OF POINTS LEFT
- * A2=ADDRESS OF VARCNT
- * X6->NEXT GETVAR CODE
- DRAWX5 ZR X7,DRAWEM IF DONE
- SA7 A2 UPDATE VARCNT
- SA2 X6 X2 = THIS GETVAR CODE
- SA6 VARADD UPDATE ->GETVAR CODES
- MX0 2
- BX5 -X0*X2 GETVAR CODE IN TOP OF X5
- BX2 X0*X2 TYPE OF CODE BITS IN X2
- LX2 2
- SB2 X2 00=COARSE, 01=FINE,
- JP *+1+B2 10=PACKED FINE, 11=SKIP
- + EQ CGDRAW COARSE GRID VERTEX
- + EQ FGDRAW FINE GRID VERTEX
- + EQ PKDRAW PACKED FINE GRID
- + MX6 2 -SKIP- TAG INDICATORS
- MX7 2
- DRAWX6 SX3 1 SINGLE GETVAR CODE USED
- EQ DRAWX8
- *
- DRAWX7 SX3 2 TWO GETVAR CODES USED
- * X6=X-COORD, X7=Y-COORD
- * X3=NUMBER OF GETVAR CODES USED
- DRAWX8 SA1 ILOC CURRENT -DRWBUF- POINTER
- SA6 X1 STORE -X-
- SA7 X1+1 STORE -Y-
- SX7 X1+2 UPDATE -DRWBUF- POINTER
- SA7 A1
- SA1 VARADD
- IX6 X1+X3 X6 -> NEXT GETVAR CODE
- SA2 VARCNT
- IX7 X2-X3 X7 = NEW COUNT OF TAGS LEFT
- EQ DRAWX5 AND GET NEXT GETVAR CODE
- * /--- BLOCK DRAW 00 000 76/08/21 22.23
- *
- * COARSE GRID VERTEX --- DRAW AND RDRAW ONLY
- CGDRAW NGETVAR ROW-COLUMN ARGUMENT IN X1
- CALL RCTOXY (X,Y) IN X6,X7
- SA2 OVARG1
- ZR X2,DRAWX6 JUMP IF DRAW
- SX1 8 CORRECT X FOR RDRAW
- IX6 X6+X1
- LX7 51 KEEP ONLY 9 BITS OF Y
- AX7 51
- EQ DRAWX6
- *
- * FINE GRID VERTEX ---
- FGDRAW SA2 OVARG1
- ZR X2,FGDRAWA IF -DRAW-
- NG X2,FGDRAWA IF -RDRAW-
- * FINE GRID -GDRAW-
- FGETVAR X OR R VALUE FOR -GDRAW-
- BX7 X1
- SA7 XDATA READY TO CONVERT SCALED X
- SA1 VARADD X1 = CURRENT VARBUF ADDRESS
- SA1 X1+1 X1 = NEXT -GETVAR- CODE
- BX5 X1
- FGETVAR -Y- OR -ANGLE- VALUE FOR GDRAW
- BX7 X1
- SA7 YDATA READY TO CONVERT Y
- CALL SCALXY CONVERT TO DOTS
- EQ DRAWX7
- *
- * FINE GRID -DRAW-
- * FINE GRID -RDRAW-
- FGDRAWA NGETVAR GET X VALUE FOR DRAW OR RDRAW
- BX6 X1
- SA6 ILOC+1 SAVE X VALUE
- SA1 VARADD X1 = CURRENT *VARBUF* ADDRESS
- SA1 X1+1 X1 = NEXT -GETVAR- CODE
- BX5 X1
- NGETVAR GET Y VALUE
- BX7 X1
- SA1 ILOC+1
- BX6 X1
- EQ DRAWX7
- *
- * PACKED DRAW COORDINATES, CAN ONLY BE -DRAW- COMMAND
- PKDRAW MX0 -9
- LX5 XCODEL POSITION LOWER
- BX7 -X0*X5 Y-COORDINATE
- LX5 -9
- BX6 -X0*X5 X-COORDINATE
- EQ DRAWX6
- * /--- BLOCK DRAWEM 00 000 75/12/09 21.30
- *
- * -GETVAR- CODES HAVE BEEN EVALUATED AND ARE ALL IN
- * FINE GRID NOW. -GDRAW- TAGS HAVE BEEN RELOCATED,
- * BUT -RDRAW- TAGS HAVE NOT BEEN YET. FIRST RELOCATE
- * -RDRAW- TAGS, AND THEN OUTPUT THE POINTS INTO THE
- * MOUT BUFFER. IF WINDOWING IS OFF, OUTPUTING THE
- * POINTS IS FAST AND EASY. IF NOT, OUTPUTING USES
- * THE -WINDOW- ROUTINE WHICH OUTPUTS THE POINTS
- * IN A VERY SLOW WAY.
- *
- *
- DRAWEM SA1 ILOC CALC NUMBER OF ARGS
- SX6 DRWBUF
- IX7 X1-X6
- SA7 VARCNT VARCNT = NO. OF ARGUMENTS
- SA6 A1 ILOC -> START OF BUFFER
- SA1 OVARG1
- PL X1,DRAWEM1 IF -GDRAW- OR -DRAW-
- *
- * * * DO -RDRAW- SIZING, ROTATING, RELOCATING
- * *
- * * X1 = X*SIZEX*COS - Y*SIZEY*SIN + X-ORIGIN
- * * Y1 = Y*SIZEY*COS + X*SIZEX*SIN + Y-ORIGIN
- *
- SA1 RORG RELOCATION ORIGIN
- SB2 X1 B2 = Y-ORIGIN
- AX1 18
- SB1 X1 B1 = X-ORIGIN
- *
- SA1 RSIZE LOAD SIZE FACTORS (*256)
- NZ X1,RDRAW1 IF SPECIFIED
- SX1 256 IF NOT SPECIFIED, USE SIZE 1
- SX2 256
- EQ RDRAW2
- RDRAW1 SX2 X1 SIGN EXTENSION ON SIZEY*256
- AX1 18 POSITION SIZEX
- SX1 X1 SIGN EXTENSION ON SIZEX*256
- RDRAW2 SA4 ROTATE LOAD SIN AND COS
- ZR X4,RDRAW3 IF NO ROTATION
- SX5 X4 SIGN EXTENSION ON COSINE*256
- AX4 18 POSITION SINE
- SX4 X4 SIGN EXTENSION ON SINE*256
- IX0 X1*X5 SIZEX*COS (*256*256)
- IX3 X2*X4 SIZEY*SIN (*256*256)
- IX5 X2*X5 SIZEY*COS (*256*256)
- IX4 X1*X4 SIZEX*SIN (*256*256)
- SB3 B0 INDICATE ROTATION
- EQ RDRAW4
- *
- RDRAW3 BX0 X1 SIZEX* COS=1
- LX0 8
- * MX3 0 SIZEY* SIN=0
- * MX4 0 SIZEX* SIN=0
- BX5 X2 SIZEY* COS=1
- LX5 8
- SB3 1 DONT HAVE TO MPY BY X3 OR X4
- * /--- BLOCK DRAWEM 00 000 78/01/07 19.32
- *
- RDRAW4 SA1 VARCNT NUMBER OF X AND Y COORDINATES
- SB4 X1 WILL RESET B4 LATER
- SA1 DRWBUF-2 ADDRESS OF COORDINATES
- *
- RDRAW5 SB4 B4-2 END TEST
- NG B4,RDRAW9 DONE WITH RELOCATION
- SA1 A1+2 X1 = X-COORDINATE
- PL X1,RDRAW6
- MX6 2 CHECK FOR -SKIP- OPTION
- BX6 X1-X6
- ZR X6,RDRAW5 GO TO NEXT COORD IF -SKIP-
- *
- * * X1 = X*SIZEX*COS - Y*SIZEY*SIN + X-ORIGIN
- * X1 * (X0) - X2 * (X3) + B1
- *
- * * Y1 = Y*SIZEY*COS + X*SIZEX*SIN + Y-ORIGIN
- * X2 * (X5) + X1 * (X4) + B2
- *
- RDRAW6 SA2 A1+1 X2 = Y-COORDINATE
- IX6 X1*X0 X * (SIZEX*COS)
- IX7 X2*X5 Y * (SIZEY*COS)
- NZ B3,RDRAW7 IF SINES ARE ZERO
- IX2 X2*X3 Y * (SIZEY*SIN)
- IX1 X1*X4 X * (SIZEX*SIN)
- IX6 X6-X2 X1 = X*SIZEX*COS - Y*SIZEY*SIN
- IX7 X7+X1 Y1 = Y*SIZEY*COS + X*SIZEX*SIN
- * ROUNDING ISN'7T NECESSARY FOR MOST APPLICATIONS,
- * BUT IS DONE HERE FOR THOSE FEW THAT IT IMPROVES.
- RDRAW7 MX1 1 ROUND POINTS
- LX1 16 CREATE POSITIVE .5*256*256
- BX2 X6 ROUND X WITH +.5 OR -.5
- AX2 60
- BX2 X2-X1
- IX6 X6+X2
- BX2 X7 SIMILARLY, ROUND Y
- AX2 60
- BX2 X2-X1
- IX7 X7+X2
- AX6 16 REMOVE 256*256 BIAS
- AX7 16
- SX6 X6+B1 ADD X-ORIGIN
- SX7 X7+B2 ADD Y-ORIGIN
- SA6 A1 SAVE RELOCATED X
- SA7 A2 SAVE RELOCATED Y
- EQ RDRAW5
- *
- *
- *
- RDRAW9 EQ DRAWEM1 DONE WITH -RDRAW- RELOCATION
- *
- * /--- BLOCK DRAWEM 00 000 76/06/13 19.59
- EJECT
- *
- * *ILOC* -> DRWBUF
- * THE POINTS ARE NOW IN *DRWBUF*, TWO WORDS PER
- * POINT WITH (X,Y). -SKIP- IS INDICATED BY THE
- * TOP TWO BITS OF EACH (X,Y) BEING SET, REST OF
- * WORD 0. THE TOP BIT OF THE COMMAND WORD IS
- * SET IF IT IS A CONTINUED DRAW. *VARCNT* HOLDS
- * THE NUMBER OF WORDS OF *DRWBUF* THAT ARE USED.
- *
- * NOW PLACE THE POINTS IN THE *MOUT* BUFFER.
- *
- DRAWEM1 SA1 TBWNDOW CAN USE FAST OUTPUT CODE
- ZR X1,DRAWEM2 IF NOT WINDOWED
- SA5 A5 CHECK FOR NEEDED -AT-
- SA1 ILOC X1 -> BUFFER
- SA2 VARCNT X2 = NO. WORDS IN BUFFER
- RJ WINDBUF OUTPUT WINDOWED LINES
- EQ PROCO DONE WITH COMMAND
- *
- * DRAW POINTS IN *DRWBUF*
- * NOT WINDOWED
- * USE FAST OUTPUT -DRWCODE-
- *
- DRAWEM2 SA1 VARCNT
- SB1 1 B1 = CONSTANT 1
- SB2 B1+B1 B2 = CONSTANT 2
- AX1 1 NUMBER OF (X,Y) PAIRS
- SB3 X1 B3 = NUMBER OF (X,Y) PAIRS
- SA2 MOUTLOC CURRENT OUTPUT POINTER
- SX3 X1+B1 NO. WORDS TO BE PUT IN MOUT
- IX6 X2+X3
- SX7 X6-MOUTLTH CHECK FOR OVERFLOW
- PL X7,ERROROF OUTPUT BUFFER OVERFLOW
- SA6 A2 UPDATE MOUT POINTER
- SX6 SKPCODE ASSUME NOT CONTINUED DRAW
- SA5 A5 CHECK CONTINUED FLAG
- + PL X5,*+1
- SX6 CDWCODE MARK CONTINUED DRAW
- + LX3 12
- LX1 24
- BX6 X6+X3 WITH COUNT OF WORDS
- BX6 X6+X1 AND COUNT OF POINTS
- SA6 MOUT+X2 OUTPUT HEADER
- SA1 DRWBUF-2 PREPARE FOR LOOP
- MX3 2 SKIP INDICATOR
- MX0 -9 ON SCREEN MASK
- *
- * NOW OUTPUT THE POINTS INTO MOUT BUFFER
- DRWLOOP SB3 B3-B1 LOOP COUNTER
- NG B3,DRWEND END TEST
- SA1 A1+B2 GET NEXT X-COORDINATE
- BX4 X1-X3 CHECK FOR SKIP
- ZR X4,DRWLOOP1 IF SKIP
- SA2 A1+B1 GET Y-COORDINATE
- BX6 -X0*X1 MASK (X,Y) ON SCREEN
- BX7 -X0*X2
- LX6 9 FORM (X,Y) FOR OUTPUT
- BX6 X6+X7
- SA6 A6+B1 OUTPUT COMPLETED (X,Y)
- EQ DRWLOOP
- *
- * -SKIP- COORDINATE
- DRWLOOP1 MX6 2 OUTPUT SKIP INDICATOR
- LX6 20
- SA6 A6+B1
- EQ DRWLOOP
- *
- * END OF OUTPUT LOOP -- UPDATE (NX,NY) FROM LAST POINT
- DRWEND BX6 X1
- BX7 X2
- SA6 NX
- SA7 NY
- EQ PROCO DONE WITH COMMAND
- *
- ENDOV
- * /--- BLOCK RORIGIN 00 000 77/10/20 18.41
- TITLE -RORIGIN-
- *** RORIGIN - SPECIFY ORIGIN FOR RELOCATABLE COMMANDS
- * WRITTEN 11/15/75 L.A.WHITE
- * MADE RORIGIN DO IMPLICIT -RAT- 0,0 7/22/76 DLS
- *
- * -RORIGIN-
- * ZERO TAGS - ORIGIN AT CURRENT WHEREX,WHEREY
- * ONE TAG - COARSE GRID ORIGIN
- * TWO TAGS - FINE GRID ORIGIN
- * EXECUTION CONSISTS OF STORING ORIGIN
- * SPECIFICATION IN *RORG* IN THE STUDENT BANK.
- *
- * OVARG1 /0 RORIGIN, /1 RAT, /2 RATNM, 3/ RDOT
- *
- RORGOV OVRLAY
- SA1 OVARG1 SEE IF -RORIGIN-
- NZ X1,RATOV IF -RAT- OR -RATNM- (1,2)
- *
- * EXECUTE -RORIGIN-
- NG X5,RORG0 IF NO TAGS
- NGETVAR RETURN X1 = FIRST TAG
- SA5 A5 RETREIVE COMMAND WORD
- LX5 XCODEL
- NG X5,RORG1 IF ONLY ONE TAG
- BX6 X1 SAVE X-ORIGIN
- SA6 ILOC
- NGETVAR RETURN X1 = Y-ORIGIN
- BX7 X1 Y-ORIGIN
- SA1 ILOC
- BX6 X1 X-ORIGIN
- EQ RORG2
- *
- RORG0 SA1 NX SET ORIGIN TO WHEREX,WHEREY
- SA2 NY
- MX0 -18
- BX6 -X0*X1 MASK X-ORIGIN
- BX7 -X0*X2 MASK Y-ORIGIN
- LX6 18
- BX6 X6+X7
- SA6 RORG 24/0, 18/XORG, 18/YORG
- EQ PROC NO NEED TO RESET NX,NY
- *
- RORG1 CALL RCTOXY
- RORG2 MX0 -18
- BX6 -X0*X6 MASK X-ORIGIN
- BX7 -X0*X7 MASK Y-ORIGIN
- SA6 NX
- SA7 NY UPDATE SCREEN -WHERE-
- LX6 18
- BX6 X6+X7
- SA6 RORG 24/0, 18/XORG, 18/YORG
- SA1 NX GET BACK NX
- MX0 -9
- BX6 -X0*X1 MASK TO 9 BIT SCREEN VALUE
- BX7 -X0*X7
- LX6 9
- BX1 X6+X7
- EQ RAT9 SET MARGINS
- *
- * /--- BLOCK RAT RDOT 00 000 77/10/20 18.42
- TITLE -RAT- -RATNM- -RDOT-
- *** RAT - RELOCATABLE -AT-
- *** RATNM - RELOCATABLE -AT- WITHOUT SETTING MARGINS
- *** RDOT - RELOCATABLE -DOT-
- * WRITTEN 11/15/75 L.A.WHITE
- * MODIFIED 06/28/76 L.A.WHITE
- *
- * -RAT- OVARG1 = 1
- * -RATNM- = 2
- * -RDOT- = 3
- * ZERO TAGS - TO CURRENT RORIGIN
- * ONE TAG - COARSE GRID LOCATION
- * TWO TAGS - FINE GRID LOCATION
- * EXECUTION CONSISTS OF DOING AN -AT- OR -DOT- TO
- * THE GIVEN POSITION AFTER RELOCATING FROM *RORG*
- *
- RATOV NG X5,RAT0 IF BLANK TAG
- NGETVAR RETURN X1 = FIRST TAG
- SA5 A5 RETRIEVE COMMAND WORD
- LX5 XCODEL
- NG X5,RAT1 IF ONLY ONE TAG
- BX6 X1 SAVE X-COORDINATE
- SA6 ILOC
- NGETVAR RETURN X1 = Y-COORDINATE
- BX7 X1 Y-COORDINATE
- SA1 ILOC
- BX6 X1 X-COORDINATE
- EQ RAT2
- *
- RAT0 MX6 0 BLANK TAG HAS
- MX7 0 ZERO OFFSET
- EQ RAT7 FROM ORIGIN
- *
- RAT1 CALL RCTOXY
- SX1 8 FIX UP X
- IX6 X6+X1
- LX7 51 KEEP ONLY 9 BITS OF Y
- AX7 51
- *
- * SIZE THE OFFSETS
- RAT2 SA1 RSIZE
- NZ X1,RAT3 IF SIZE NON ZERO
- LX6 8 IF ZERO, MAKE SIZE ONE
- LX7 8 DITTO
- EQ RAT4
- RAT3 SX2 X1 SIGN EXTENSION ON SIZEY*256
- AX1 18 POSITION SIZEX
- SX1 X1 SIGN EXTENSION ON SIZEX*256
- IX6 X6*X1 SIZE X-OFFSET
- IX7 X7*X2 SIZE Y-OFFSET
- * /--- BLOCK RAT 00 000 77/10/20 18.42
- *
- * ROTATE THE OFFSETS
- RAT4 SA1 ROTATE
- NZ X1,RAT5 IF ROTATE SPECIFIED
- LX6 8 IF NOT, LEAVE ALONE
- LX7 8
- EQ RAT6
- RAT5 SX2 X1 SIGN EXTENSION ON COSINE*256
- AX1 18 POSITION SINE
- SX1 X1 SIGN EXTENSION ON SINE*256
- IX3 X6*X1 X*SIN
- IX4 X7*X1 Y*SIN
- IX6 X6*X2 X*COS
- IX7 X7*X2 Y*COS
- IX6 X6-X4 X1 = X*COS - Y*SIN
- IX7 X7+X3 Y1 = Y*COS + X*SIN
- RAT6 MX1 1 ROUND THE POINTS
- LX1 8+8 .5 (*256*256)
- BX2 X6 NEED +-.5 ACCORDING TO SIGN
- AX2 60
- BX2 X2-X1 + OR - .5
- IX6 X6+X2 ROUNDED X OFFSET (*256*256)
- BX3 X7
- AX3 60
- BX3 X3-X1
- IX7 X7+X3 ROUNDED Y OFFSET (*256*256)
- AX6 8+8 CORRECT FOR FACTOR OF 256*256
- AX7 8+8 DITTO
- *
- * RELOCATE THE OFFSETS (X6,X7 = OFFSETS)
- RAT7 SA1 RORG GET ORIGIN LOCATION
- SX2 X1 SIGN EXTENSION ON Y-ORIGIN
- AX1 18 POSITION X-ORIGIN
- SX1 X1 SIGN EXTENSION ON X-ORIGIN
- IX6 X1+X6 X-POSITION
- IX7 X2+X7 Y-POSITION
- *
- MX0 -18 CUT DOWN TO 18 BITS,
- BX6 -X0*X6 LIKE -ATNM- COMMAND.
- BX7 -X0*X7 'I DON'7T KNOW WHY.
- *
- SA6 NX UPDATE X-POSITION
- SA7 NY UPDATE Y-POSITION
- MX0 -9 POSITION SO ON-SCREEN
- BX6 -X0*X6
- BX7 -X0*X7
- LX6 9 PREPARE FOR -AT-
- BX1 X6+X7 -AT- LOCATION
- SA2 OVARG1
- SX2 X2-2
- ZR X2,RATED IF -RATNM-, DONT SET MARGINS
- PL X2,RDOTED IF -RDOT-
- *
- RAT9 AX6 9
- SA6 TBMARG SET X-MARGIN
- BX4 X1
- LX4 7+3 POSITION X/Y MARGIN FOR SIZE
- MX0 -18
- LX0 7+3 POSITION MASK
- SA2 TBWRITE
- BX2 X0*X2 CLEAR OUT OLD X/Y MARGIN
- BX4 -X0*X4 LIMIT TO 18 BITS -- BIF 8/27/76
- BX6 X2+X4
- SA6 A2 SET NEW X/Y MARGIN
- *
- OUTCODE WFMCODE FINE WHERE THAT SETS MARGIN
- EQ PROCO
- *
- RATED OUTCODE WFCODE FINE WHERE WITHOUT MARGINS
- EQ PROCO
- *
- RDOTED OUTCODE DFCODE -DOT-
- EQ PROCO
- *
- ENDOV
- *
- * /--- BLOCK CIRCLE 00 000 76/05/08 02.49
- TITLE CIRCLE ROUTINE
- *** CIRCLE - GENERATE CIRCLES BY DRAWING LINES
- * WRITTEN BY B.A.SHERWOOD
- *
- * MODIFIED 02/15/72 P.J.TENCZAR
- * PUT OUTPUT IN-LINE AND USE REGISTERS
- * (GAVE SPEED-UP BY A FACTOR OF ABOUT 2)
- * (A CIRCLE WITH RADIUS OF 64 TAKES ABOUT
- * 2 MILLISECONDS AND HAS 28 CHORDS)
- * THE WINDOWING COULD BE IMPROVED IF DESIRED.
- *
- * MODIFIED 11/15/75 L.A.WHITE
- * USES CURRENT *WHERE* POSITION FOR CENTER OF
- * CIRCLE. ADDED -RCIRCLE- COMMAND (SIZED,
- * RELOCATABLE, ROTATED ARCS). ADDED -GCIRCLE-
- * COMMAND (SCALED, RELOCATABLE). BOTH NEW
- * COMMANDS CAN DO ELLIPSES IF THE SCALES SO
- * SPECIFY.
- *
- *
- * -CIRCLE-
- * CIRCLE R OR
- * CIRCLE R,THETA1,THETA2
- * CIRCLEB R OR
- * CIRCLEB R,THETA1,THETA2
- * RCIRCLE R OR
- * RCIRCLE R,THETA1,THETA2
- * GCIRCLE R OR
- * GCIRCLE R,THETA1,THETA2
- *
- * DRAW A FULL OR PARTIAL CIRCLE, MAYBE DASHED.
- * R IS RADIUS, *WHEREX,WHEREY* IS THE CENTER,
- * THETA1 AND THETA2 THE INITIAL AND FINAL
- * ANGLES, MEASURED CCW FROM THE X-AXIS.
- *
- * ON ENTRY *OVARG1* IS
- * -1 CIRCLEB
- * 0 CIRCLE
- * 1 RCIRCLE
- * 2 GCIRCLE
- *
- * /--- BLOCK CIRCOV 00 000 76/08/16 16.29
- EJECT
- NCIRCOV OVRLAY
- MX6 -1 MARK *INFO* BUFFER USED
- SA6 JJSTORE
- *
- * GET RADIUS
- FGETVAR RETURN X1 = RADIUS
- BX7 X1 SAVE RADIUS
- *** KLUDGE FOR THE WEEK OF 7/18/76 TILL FIXED RIGHT LAW
- SA1 OVARG1
- SX1 X1-1
- PL X1,KDKD2 IF GCIRCLE/RCIRCLE, NO ROUNDING
- SA1 CHALF
- BX2 X7 .5 OF SAME SIGN AS RADIUS
- AX2 60
- BX1 X1-X2
- FX7 X7+X1 ADD .5 TO RADIUS
- NX7 X7
- KDKD2 BSS 0
- *** END KLUDGE
- SA7 INITX FULL CIRCLE INITX = RADIUS
- BX6 X7 STORE ABS(RADIUS)
- AX6 60
- BX6 X6-X7
- SA6 RADIUS
- MX7 0
- SA7 INITY FULL CIRCLE INITY = 0
- SA7 PCIRCLE NOT PARTIAL CIRCLE
- SA1 TWOPI
- BX7 X1
- SA7 ARC FULL CIRCLE ARC = 2*PI
- *
- * CHECK FULL CIRCLE ASSUMPTION
- SA5 A5 RETRIEVE COMMAND WORD
- LX5 XCODEL TOP BIT OF 2ND GETVAR CODE
- NG X5,CIRCOV1 IF FULL CIRCLE
- *
- * IS PARTIAL CIRCLE -- GET ANGLES
- SX7 1 INDICATE PARTIAL CIRCLE
- SA7 PCIRCLE
- FGETVAR RETURN X1 = INITIAL ANGLE
- SA2 RADDEG RADIANS PER DEGREE
- RX6 X1*X2 CONVERT TO RADIANS
- SA6 ARC SAVE INITIAL ANGLE TEMPORARILY
- CALL SINCOS GET SIN AND COS OF X6
- SA1 INITX COMPUTE INITIAL (X,Y)
- RX6 X6*X1 Y = SIN*RADIUS
- RX7 X7*X1 X = COS*RADIUS
- SA6 INITY
- SA7 A1
- *
- SA5 A5 RETREIVE COMMAND WORD
- AX5 XCMNDL
- MX0 2*XCODEL+XCMNDL
- BX5 -X0*X5
- SA1 X5+B5 GET EXTRA ARGUMENT WORD
- BX5 X1 GETVAR CODE TO TOP
- FGETVAR RETURN X1 = FINAL ANGLE
- SA2 RADDEG RADIANS PER DEGREE
- SA3 ARC STARTING ANGLE
- RX7 X1*X2 CONVERT TO RADIANS
- RX7 X7-X3 FINAL ANGLE - INITIAL ANGLE
- NX7 X7
- SA2 TWOPI MAXIMUM OF TWO PI
- BX6 X7 ABS(ARC) FOR TWOPI TEST
- AX6 60
- BX1 X7-X6 ABS(ARC)
- RX1 X2-X1 POSITIVE IF TWOPI>ABS(ARC)
- + PL X1,*+1 COMPARE ABS(ARC) WITH TWOPI
- BX7 X6-X2 USE TWOPI WITH SIGN OF ARC
- + SA7 ARC STORE LENGTH OF ARC TO DRAW
- *
- * /--- BLOCK CIRCOV1 00 000 77/10/20 18.25
- EJECT
- *
- * PROCESS ACCORDING TO COMMAND
- CIRCOV1 SA1 OVARG1
- SB1 X1
- JP *+1+B1
- + EQ CIRCL 0 = CIRCLE
- + EQ RCIRCL 1 = RCIRCLE
- + EQ GCIRCL 2 = GCIRCLE
- + EQ CIRCLB 3 = CIRCLEB
- SPACE 4
- *
- * * * CIRCLE B
- *
- CIRCLB SX6 CIRBCK ADDRESS OF PROCESSING ROUTINE
- SA6 ROUTINE
- SA1 RADIUS AVERAGE RADIUS
- EQ CIRCOV2
- *
- * * * CIRCLE
- *
- CIRCL SX6 CIRLP ADDRESS OF PROCESSING ROUTINE
- SA6 ROUTINE
- SA1 RADIUS AVERAGE RADIUS
- EQ CIRCOV2
- *
- * * * GCIRCLE
- *
- GCIRCL SA1 GDATA GET AXES INFO
- BX0 X1 SAVE IT FOR NEXT FEW LINES
- LX1 60-2*PFIELD
- AX1 60-PFIELD EXTEND SIGN OF (X+)
- NZ X1,GCIRCL1 USUALLY X+ IS NONZERO
- BX1 X0 IF NOT, USE X-
- LX1 60-4*PFIELD
- AX1 60-PFIELD
- GCIRCL1 PX1 X1
- NX1 X1 FLOAT (X+)
- SA2 GXMAX
- SA3 XOFFSET
- RX2 X2-X3 XMAX-XOFFSET
- NX2 X2
- RX3 X1/X2 (X+)/(XMAX-XOFFSET) (',SIZEX',)
- *
- BX1 X0 GET (Y+)
- LX1 60-PFIELD
- AX1 60-PFIELD EXTEND SIGN
- NZ X1,GCIRCL2 USUALLY Y+ IS NONZERO
- BX1 X0 IF NOT, USE Y-
- LX1 60-3*PFIELD
- AX1 60-PFIELD
- GCIRCL2 PX1 X1
- NX1 X1 FLOAT (Y+)
- SA2 GYMAX
- SA4 YOFFSET
- FX2 X2-X4 YMAX-YOFFSET
- NX2 X2
- RX6 X1/X2 (Y+)/(YMAX-YOFFSET) (',SIZEY',)
- *
- SA4 C256 X4 = 256. NEEDED BY RCIRCL
- *** SAME CODE AS AT RCIRCL1 ***
- SB1 1 ASSUME SIZES EQUAL
- IX7 X3-X6 TEST SIZES EQUAL
- ZR X7,RCIRCL6 IF EQUAL
- SB1 -B1 INDICATE SIZES UNEQUAL
- *
- * IF SIZE=0, B1=0
- * SIZEX=SIZEY B1=1
- * SIZEX^=SIZEY B1=-1
- * X3 = FLOATING SIZE X
- * X6 = FLOATING SIZE Y
- *
- *
- EQ RCIRCL6 CONTINUE AS RCIRCLE
- * /--- BLOCK RCIRCL 00 000 76/09/05 14.31
- *
- * * * RCIRCLE
- *
- RCIRCL SA4 C256 X4 = 256.
- SA2 RSIZE --- SET UP SIZE ---
- SA3 C1 SET TO SIZE 1.
- BX6 X3
- SB1 B0 INDICATE SIZE ZERO
- ZR X2,RCIRCL2 IF SIZE=0, USE SIZE 1
- SX6 X2 256*SIZEY
- AX2 18
- SX3 X2 256*SIZEX
- PX3 X3
- NX3 X3
- PX6 X6
- NX6 X6
- RX3 X3/X4 X3 = FLOATING SIZE X
- RX6 X6/X4 X6 = FLOATING SIZE Y
- RCIRCL1 SB1 1 ASSUME SIZES EQUAL
- IX7 X3-X6 TEST SIZES EQUAL
- ZR X7,RCIRCL2 IF EQUAL
- SB1 -B1 INDICATE SIZES UNEQUAL
- *
- * IF SIZE=0, B1=0
- * SIZEX=SIZEY B1=1
- * SIZEX^=SIZEY B1=-1
- * X3 = FLOATING SIZE X
- * X6 = FLOATING SIZE Y
- *
- *
- RCIRCL2 SA2 ROTATE --- SET UP ROTATE ---
- ZR X2,RCIRCL6 IF ROTATE=0
- SX5 X2 256*COSINE OF ROTATION
- AX2 18
- SX0 X2 256*SINE OF ROTATION
- PX0 X0
- NX0 X0
- PX5 X5
- NX5 X5
- RX0 X0/X4 X0 = SIN
- RX5 X5/X4 X5 = COS
- GE B1,B0,RCIRCL4 IF SIZEX=SIZEY
- * SIZEX^=SIZEY, ROTATE^=0
- SX7 RCIRLP ADDRESS OF PROCESSSING ROUTINE
- SA7 ROUTINE
- RX7 X3*X0 SIZEX*SINE
- SA7 XSIN
- RX7 X3*X5 SIZEX*COSINE
- SA7 XCOS
- RX7 X6*X0 SIZEY*SINE
- SA7 YSIN
- RX7 X6*X5 SIZEY*COSINE
- SA7 YCOS
- RCIRCL3 BX2 X3
- BX4 X6
- AX2 60
- AX4 60
- BX2 X2-X3 ABS(SIZEX)
- BX4 X4-X6 ABS(SIZEY)
- RX4 X2+X4
- NX4 X4
- SA2 C2 =2.
- RX4 X4/X2 AVERAGE SIZE
- SA1 RADIUS
- RX1 X1*X4 AVERAGE RADIUS
- EQ CIRCOV2
- * /--- BLOCK RCIRCL4 00 000 76/01/24 13.29
- *
- * SIZEX=SIZEY, ROTATE^=0
- * PERFORM INITIAL ROTATION, SIZE THE RADIUS,
- * THEN IS A SIMPLE CIRCLE
- RCIRCL4 SA1 INITX
- SA2 INITY
- RX1 X1*X3 SIZE STARTING POINTS
- RX2 X2*X3
- RX6 X1*X5 X*COS
- RX7 X2*X0 Y*SIN
- RX6 X6-X7
- NX6 X6
- SA6 A1 NEW X = X*COS - Y*SIN
- RX6 X2*X5 Y*COS
- RX7 X1*X0 X*SIN
- RX6 X6+X7
- NX6 X6
- SA6 A2 NEW Y = Y*COS + X*SIN
- RCIRCL5 SA1 RADIUS
- BX2 X3
- AX2 60
- BX2 X2-X3 ABS(SIZE)
- RX6 X1*X2 RADIUS*ABS(SIZE)
- SA6 A1 NEW RADIUS
- EQ CIRCL NOW, IS A SIMPLE CIRCLE
- *
- * ROTATE=0
- RCIRCL6 ZR B1,CIRCL IF SIZE=0 IS SIMPLE CIRCLE
- NG B1,RCIRCL7 IF SIZEX^=SIZEY
- * ROTATE=0, SIZEX=SIZEY
- SA1 INITX SIZE INITIAL POINTS
- SA2 INITY
- RX6 X1*X3
- RX7 X2*X3
- SA6 A1
- SA7 A2
- EQ RCIRCL5
- *
- * ROTATE=0, SIZEX^=SIZEY
- RCIRCL7 SX7 GCIRLP ADDRESS OF PROCESSING ROUTINE
- SA7 ROUTINE
- SA6 YCOS SAVE SIZEY
- BX7 X3
- SA7 XCOS SAVE SIZEX
- EQ RCIRCL3
- *
- * /--- BLOCK CIRCOV2 00 000 77/10/20 18.31
- *
- * COMPUTE NUMBER OF CHORDS WANTED
- * ENTRY X1 = AVERAGE RADIUS
- *
- * IF THE NUMBER OF CHORDS WOULD OVERFLOW THE
- * OUTPUT BUFFER (OR TAKE TOO LONG TO COMPUTE),
- * IT IS REDUCED TO WHAT WILL FIT IN THE OUTPUT BUFFER.
- * THE ONLY DRAWBACK IS A SLIGHT REDUCTION IN
- * THE ',FINENESS', OF LARGE CIRCLES THAT ARE
- * ONLY PARTLY (OR NOT AT ALL) ON THE SCREEN.
- *
- CIRCOV2 SA2 C40 CHORDS/RADIAN = (3+RADIUS/40)
- RX7 X1/X2 (EMPIRICAL CRITERION)
- SA2 C3 =3.
- RX7 X2+X7
- SA4 ARC X4 = TOTAL ANGLE TO DRAW
- RX7 X4*X7 RADIANS * CHORDS PER RADIAN
- UX7 X7,B1 X7 = NUMBER OF CHORDS
- LX7 X7,B1
- BX0 X7 SET X7=ABS(X7)
- AX0 60
- BX7 X7-X0 X7 = POSITIVE NUMBER OF CHORDS
- SA3 OVARG1 X3 = TYPE OF CIRCLE FLAG
- SX1 X3-3 CHECK FOR BROKEN CIRCLE TYPE
- NZ X1,CIRTYPE 0,1,2 MEANS NORMAL CIRCLES
- MX3 -1 -1 MEANS BROKEN CIRCLES
- CIRTYPE BSS 0
- **
- SA1 MOUTLOC COMPUTE MAXIMUM CHORDS TO FIT
- SX2 MOUTLTH-10 LITTLE EXTRA ROOM
- IX2 X2-X1 X2 = ROOM LEFT
- NG X2,ERROROF .WOWWIE. ALREADY OVERFLOW
- IX6 X2-X7
- + PL X6,*+1 JUMP IF CIRCLE WILL FIT
- BX7 X2 USE ROOM LEFT IF WONT FIT
- + SA1 TBWNDOW IF WINDOWED, MAKE SURE
- ZR X1,CIRCOV3 ..INFO BUFFER WILL HOLD
- SX2 INFOLTH/2-10 ..ALL INTERMEDIATE POINTS
- + PL X3,*+1 IF NORMAL CIRCLES
- SX2 INFOLTH/3-10 ..CIRCLEB NEEDS MORE ROOM
- + IX6 X2-X7
- PL X6,*+1 JUMP IF CIRCLE WILL FIT
- BX7 X2 USE ROOM LEFT IF WONT FIT
- **
- CIRCOV3 PL X3,CIRCOV4 IF NOT CIRCLEB
- SA1 PCIRCLE REPLACE ODD/EVEN BIT
- MX6 59
- BX7 X6*X7
- BX7 X7+X1 WITH PARTIAL CIRCLE FLAG
- CIRCOV4 NZ X7,*+1 AT LEAST ONE ARC
- SX7 1
- + SA7 CHORDS STORE NUMBER OF CHORDS
- PX7 X7 DURN, BACK TO FLOATING AGAIN
- NX7 X7
- RX6 X4/X7 RADIANS PER CHORD
- CALL SINCOS TAKE SIN AND COS OF X6
- BX0 X6 X0 = SINE OF CHORD ANGLE
- BX5 X7 X5 = COSINE OF CHORD ANGLE
- *
- SA3 INITX X3 = INITIAL X OFFSET
- SA4 INITY X4 = INITIAL Y OFFSET
- *
- SX7 B5 SAVE B5
- SA7 SAVB5
- SX7 B7 SAVE B7
- SA7 SAVB7
- *
- * /--- BLOCK CIRCOV3 00 000 76/07/30 22.48
- *** IT SHOULD BE IMPOSSIBLE TO GET AN OUTPUT
- *** BUFFER OVERFLOW NOW... CHECKS LEFT IN
- *** HERE JUST TO MAKE SURE. LAW 7/30/76
- *
- SA2 CHORDS
- SB2 X2 B2 = NUMBER OF CHORDS TO OUTPUT
- SA1 MOUTLOC
- SX6 X1+B2
- SX6 X6+3-MOUTLTH
- PL X6,ERROROF
- *
- SA2 TBWNDOW
- NZ X2,CIRCOV5 IF WINDOWED
- MX6 0 CLEAR HEADER WORD FOR NOW
- SA6 MOUT+X1 A6 = MOUT LOCATION
- SB1 1 INDICATE NOT WINDOWED
- EQ CIRCOV6
- *
- CIRCOV5 SX6 B2+3-2*INFOLTH/3
- PL X6,ERROROF
- SB1 -1 INDICATE WINDOWED
- SA6 INFO START AT INFO+1
- *
- CIRCOV6 SA1 NX CENTER OF CIRCLE
- SA2 NY
- SB3 X1 B3 = X-CENTER
- SB4 X2 B4 = Y-CENTER
- *
- SA0 B3 LAST X POS
- SB7 B4 LAST Y POS
- *
- * GO TO THE CORRECT ROUTINE
- SA2 ROUTINE
- SB5 X2 TYPE OF CIRCLE TO DO
- JP B5 GO TO CORRECT ROUTINE
- *
- * /--- BLOCK CIRLP 00 000 76/09/11 17.01
- *
- * THE FOLLOWING ROUTINES PERFORM THE CALCULATIONS
- * FOR COMPUTING EACH END-CHORD POSITION AROUND THE
- * CIRCLE. ALL REGISTERS ARE USED.
- *
- * A B X
- *
- * 0 FINAL X - SIN OF CHORD ANGLE
- * 1 SCRATCH MULTI FLAG SCRATCH
- * 2 SCRATCH LOOP COUNT SCRATCH
- * 3 - X-CENTER CURRENT X
- * 4 - Y-CENTER CURRENT Y
- * 5 - ROUTINE ADR COS OF CHORD ANGLE
- * 6 OUTPUT LOC SCRATCH SCRATCH
- * 7 SCRATCH FINAL Y SCRATCH
- *
- * CIRCLES
- CIRLP BX6 X3 PLAIN CIRCLE
- BX7 X4
- CIRLP1 UX6 X6,B6 INTEGER X,Y
- LX6 X6,B6
- UX7 X7,B6
- LX7 X7,B6
- SX6 X6+B3 OFFSET X,Y FROM CENTER
- SX7 X7+B4
- NG B1,CIRLP4 IF WINDOWED
- BX1 X6+X7 SEE IF ON SCREEN
- AX1 9
- NZ X1,CIRLP3 IF OFF SCREEN
- NG X1,CIRLP3 IF OFF SCREEN
- SA0 X6 LAST X,Y
- SB7 X7
- LX6 9
- BX6 X6+X7 COMBINE (X,Y)
- SB1 1 INDICATE NO SKIPS IN PROGRESS
- SA6 A6+B1 OUTPUT POINT
- CIRLP2 SB2 B2-1
- LT B2,CIRDONE EXIT CONDITION
- RJ INCXY GET NEXT (X,Y) IN (X3,X4)
- JP B5 DO STUFF WITH (X,Y)
- *
- CIRLP3 ZR B1,CIRLP2 IF ALREADY SKIPPING
- MX6 2 OUTPUT SKIP
- LX6 20
- SA6 A6+B1
- SB1 B0 INDICATE SKIPPING
- EQ CIRLP2
- *
- * WINDOWED CHORDS
- CIRLP4 SA0 X6 LAST X,Y
- SB7 X7
- SA6 A6-B1 OUTPUT X,Y INTO TEMP BUFFER
- BX6 X7
- SA6 A6-B1
- EQ CIRLP2
- *
- * DO RCIRCLE TYPE OPERATIONS
- * ROTATED AND SIZEX^=SIZEY
- RCIRLP SA1 XCOS SIZEX*COS
- SA2 YSIN SIZEY*SIN
- RX6 X3*X1 X*SIZEX*COS
- RX7 X4*X2 Y*SIZEY*XIN
- RX6 X6-X7 SIZED, ROTATED X
- SA1 YCOS SIZEY*COS
- SA2 XSIN SIZEX*SIN
- RX7 X4*X1 Y*SIZEY*COS
- RX2 X3*X2 X*SIZEX*SIN
- RX7 X7+X2 SIZED, ROTATED Y
- EQ CIRLP1
- *
- * DO GCIRCLE TYPE OPERATION
- * NO ROTATION, SIZEX^=SIZEY
- GCIRLP SA1 XCOS SIZEX*COS (COS=1)
- SA2 YCOS SIZEY*COS
- RX6 X3*X1 SIZED X
- RX7 X4*X2 SIZED Y
- EQ CIRLP1
- * /--- BLOCK INCXY 00 000 76/01/13 00.21
- *
- * X1,X2,X6,X7 SCRATCH FOR COMPUTATION
- * X3,X4 = CURRENT (X,Y) FLOATING POINT
- * X0,X5 = (SIN,COS) OF CHORD ANGLE
- *
- * GET NEXT POINT FOR CIRCLE ROUTINES
- INCXY EQ *
- RX6 X3*X5 X*COS
- RX7 X4*X0 Y*SIN
- RX1 X4*X5 Y*COS
- RX2 X3*X0 X*SIN
- RX3 X6-X7 NEW X = X*COS-Y*SIN
- NX3 X3
- RX4 X1+X2 NEW Y = Y*COS+X*SIN
- NX4 X4
- EQ INCXY
- * /--- BLOCK CIRBLP 00 000 76/05/13 20.35
- *
- *
- CIRBCK NG B1,WCIRBLP IF WINDOWED
- *
- * NON-WINDOWED CIRCLEB
- * OUTPUT THE POINTS
- CIRBLP UX7 X3,B6 START (X,Y) IN (X3,X4)
- LX7 X7,B6 INTEGER X
- SX7 X7+B3 OFFSET X
- SA7 INITX SAVE FIRST X
- UX7 X4,B6
- LX7 X7,B6 INTEGER Y
- SX7 X7+B4 OFFSET Y
- SA7 INITY SAVE FIRST Y
- RJ INCXY GET NEXT (X,Y)
- UX6 X3,B6
- LX6 X6,B6 INTEGER X
- SX6 X6+B3 OFFSET X
- UX7 X4,B6
- LX7 X7,B6 INTEGER Y
- SX7 X7+B4 OFFSET Y
- SA1 INITX RETRIEVE FIRST X
- SA2 INITY RETRIEVE FIRST Y
- BX1 X1+X2 SEE IF OFF SCREEN
- BX1 X1+X6
- BX1 X1+X7
- AX1 9
- NZ X1,CIRBLP1 IF OFF SCREEN
- NG X1,CIRBLP1 IF OFF SCREEN
- SA0 X6 LAST X
- SB7 X7 LAST Y
- LX6 9 NOT OFF SCREEN, COMBINE
- BX6 X6+X7
- LX2 20
- BX6 X6+X2
- SA1 A1 RETRIEVE FIRST X
- LX1 20+9
- BX6 X6+X1
- MX7 2 INDICATE SKIP;X,Y;X,Y
- BX6 X6+X7 ALL IN ONE WORD
- SA6 A6+1 OUTPUT POINTS
- CIRBLP1 SB2 B2-2
- LE B2,CIRDONE EXIT CONDITION
- RJ INCXY GET NEXT (X,Y) IN (X3,X4)
- EQ CIRBLP
- *
- *
- * WINDOWED CIRCLEB
- * GENERATE THE POINTS IN AN INTERMEDIATE BUFFER
- * IN THE FORM SKIP;X,Y;X,Y
- WCIRBLP SB1 1
- WCIRB1 UX6 X3,B6
- LX6 X6,B6 INTEGER FIRST X
- SX6 X6+B3 OFFSET X
- SA6 A6+B1
- UX6 X4,B6
- LX6 X6,B6 INTEGER FIRST Y
- SX6 X6+B4 OFFSET Y
- SA6 A6+B1
- RJ INCXY GET NEXT (X,Y) IN (X3,X4)
- UX6 X3,B6
- LX6 X6,B6 INTEGER SECOND X
- SX6 X6+B3 OFFSET X
- SA6 A6+B1
- UX6 X4,B6
- LX6 X6,B6 INTEGER SECOND Y
- SX6 X6+B4 OFFSET Y
- SA6 A6+B1
- SB2 B2-2
- LE B2,CIRDONE END TEST
- RJ INCXY GET NEXT (X,Y) IN (X3,X4)
- MX6 2 OUTPUT SKIP
- SA6 A6+B1
- SA6 A6+B1 TAKES TWO WORDS
- EQ WCIRB1 CONTINUE LOOPING
- *
- * /--- BLOCK CIRDONE 00 000 78/01/07 19.32
- *
- * DONE WITH CIRCLE GENERATION
- CIRDONE SA1 NX SAVE END SCREEN LOCATION
- SA2 NY
- SA3 PCIRCLE
- ZR X3,CIRDONE1 IF SHOULD BE CENTER POSITION
- SX1 A0 SHOULD BE LAST POINT DRAWN
- SX2 B7
- CIRDONE1 MX0 -18
- BX7 -X0*X1
- SA7 SAVNX SAVE POSITIONS
- BX7 -X0*X2
- SA7 SAVNY
- *
- SA1 SAVB5 RESTORE REGISTERS
- SB5 X1 RESTORE B5
- SA1 SAVB7
- SB7 X1 RESTORE B7
- SA1 TBWNDOW
- NZ X1,WCIRDONE IF WINDOWED
- *
- * CREATE MOUT HEADER
- SA2 MOUTLOC
- SX5 MOUT+X2 -> FIRST WORD FOLLOWING HEADER
- SX0 A6 -> LAST WORD OF OUTPUT
- IX0 X0-X5 NUMBER OF POINTS OUTPUT
- BX6 X0
- LX6 24 SHIFT TO POSITION
- SX0 X0+1 NUMBER OF WORDS IN GROUP
- BX1 X0
- LX1 12
- BX6 X6+X1
- SX1 SKPCODE
- BX6 X6+X1 COMPLETED HEADER WORD
- SA6 MOUT+X2 OUTPUT IT
- IX6 X2+X0 UPDATE MOUT POINTER
- SA6 A2
- *
- * OUTPUT -ATNM- TO FINAL LOCATION
- CIRDONE2 SA1 SAVNX X-FINAL
- SA2 SAVNY Y-FINAL
- BX6 X1
- BX7 X2
- SA6 NX
- SA7 NY
- MX0 -9
- BX1 -X0*X1 ON SCREEN
- BX2 -X0*X2
- LX1 9
- BX1 X1+X2
- OUTCODE WFCODE
- EQ PROCO
- *
- * WINDOWED CIRCLE DONE
- WCIRDONE SB3 INFO
- SX2 A6-B3 NUMBER OF WORDS IN INFO BUFFER
- SX1 INFO+1 -> BUFFER
- MX5 0 NOT CONTINUED DRAW
- RJ WINDBUF OUTPUT THE LINES
- EQ CIRDONE2
- *
- * /--- BLOCK VARIABLES 00 000 76/07/18 21.08
- *
- CHALF DATA .5
- C1 DATA 1.
- C2 DATA 2.
- C3 DATA 3.
- C40 DATA 40.
- C256 DATA 256.
- TWOPI DATA 6.28318 2*PI
- RADDEG DATA 0.0174533 RADIANS PER DEGREE (PI/180)
- *
- * THE FOLLOWING VARIABLES ARE NOT KEPT IN THE OVERLAY
- * WHEN ECS RESIDENT, BUT FOLLOW THE OVERLAY IN CM.
- * THE -ENDOV- MACRO SHOULD BE CHANGED TO ACCEPT A PARAMETER,
- * INDICATING THE LAST WORD IN CM THAT WOULD BE REFERENCED
- * BY THE OVERLAY, SO IT CAN DO ITS RANGE CHECK CORRECTLY.
- * IN THIS TIME, THE FOLLOWING VARIABLES WILL FIT IN THE
- * CM BUFFER, SO IT ISN'7T WORTH IT TO PUT THE CHECK IN.
- *
- RADIUS BSS 0 RADIUS OF CIRCLE
- ARC EQU RADIUS+1 ARC OF CIRCLE
- CHORDS EQU ARC+1 NUMBER OF CHORDS IN THIS CIRCLE
- PCIRCLE EQU CHORDS+1 1 IF PARTIAL CIRCLE, 0 IF FULL
- XSIN EQU PCIRCLE+1 SIZEX*SINE(ROTATE)
- YSIN EQU XSIN+1 SIZEY*SINE(ROTATE)
- XCOS EQU YSIN+1 SIZEX*COSINE(ROTATE)
- YCOS EQU XCOS+1 SIZEY*COSINE(ROTATE)
- INITX EQU YCOS+1 INITIAL X-COORDINATE
- INITY EQU INITX+1 INITIAL Y-COORDINATE
- ROUTINE EQU INITY+1 PROCESSING ROUTINE ADDRESS
- SAVB5 EQU ROUTINE+1 LOCATION TO SAVE B5
- SAVB7 EQU SAVB5+1 LOCATION TO SAVE B7
- SAVNX EQU SAVB7+1
- SAVNY EQU SAVNX+1
- *
- ENDOV
- * /--- BLOCK END 00 000 76/07/30 19.45
- *
- *
- OVTABLE
- *
- *
- END DRAWS$
plato/source/plaopl/draws.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator