C C=========================================================================== C C Graphics driver for the GRINNELL GMR 37-30 color display C C 9.0" x 7.0" (512 x 512) C C=========================================================================== C JDEV = JDEV - 1 IF (JDEV .NE. 0) GOTO 3999 C IF ((IMODE .LT. -5) .OR. (IMODE .GT. 6)) RETURN GOTO (3000,3001,3005,90,90,3010,3020,3030,90,3040,3050,3060), 1 IMODE+6 C C mode -5: we exist C 3000 X = 1.0 GOTO 90 C C mode -4: initialize C 3001 CALL GTATT(LUNGRP) ! attach the device CALL GTGRIN("120000) ! select the only device CALL GTGRIN("100001) ! load display channel 1 CALL GTGRIN("010017) ! load subchannel mask (all colors) CALL GTGRIN("026012) ! load update mode CALL GTGRIN("024060) ! load write mode CALL GTGRIN("010007) ! set the default color to white CALL GTF ! and send this stuff out GOTO 90 C C mode -3: return screen size C 3005 X = 9.0 Y = 7.0 GOTO 90 C C mode 0: clear screen C 3010 CALL GTGRIN("030000) ! erase selected subchannels CALL GTF GOTO 90 C C mode 1: unwritten vector C 3020 IX = MIN1(511.,AMAX1(0.,56.88888*XT+0.5)) IY = MIN1(511.,AMAX1(0.,73.14286*YT+0.5)) CALL GTGRIN(IX .OR. "044000) CALL GTGRIN(IY .OR. "064000) GOTO 90 C C mode 2: written vector C 3030 IX = MIN1(511.,AMAX1(0.,56.88888*XT+0.5)) IX = IX - MIN1(511.,AMAX1(0.,56.88888*XTLAST+0.5)) IY = MIN1(511.,AMAX1(0.,73.14286*YT+0.5)) IY = IY - MIN1(511.,AMAX1(0.,73.14286*YTLAST+0.5)) CALL GTGRIN((IX .AND. "777) .OR. "050000) CALL GTGRIN((IY .AND. "777) .OR. "072000) GOTO 90 C C mode 4: complete the plot C 3040 CALL GTF ! flush the buffer CALL GTATT(-LUNGRP) ! deattach the device CALL CLOSE(LUNGRP) GOTO 90 C C mode 5: nibs (X; color) and line pattern (Y; ignored) C 3050 NIBS = X IX = (NIBS/256) .AND. "17 IF (IX .LE. 0) IX = 7 ! color 0 ==> white CALL GTGRIN(IX .OR. "010000) LINPAT = Y GOTO 90 C C mode 6: identify ourself C 3060 WRITE (LUN,3070) 3070 FORMAT('+ Grinnell GMR-37 Color Graphics display') C C link to the next device C 3999 CONTINUE