| 1 |
C @(#)gd8c.for 19.1 (ES0-DMD) 02/25/03 13:55:08 |
| 2 |
C=========================================================================== |
| 3 |
C Copyright (C) 1995 European Southern Observatory (ESO) |
| 4 |
C |
| 5 |
C This program is free software; you can redistribute it and/or |
| 6 |
C modify it under the terms of the GNU General Public License as |
| 7 |
C published by the Free Software Foundation; either version 2 of |
| 8 |
C the License, or (at your option) any later version. |
| 9 |
C |
| 10 |
C This program is distributed in the hope that it will be useful, |
| 11 |
C but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
C GNU General Public License for more details. |
| 14 |
C |
| 15 |
C You should have received a copy of the GNU General Public |
| 16 |
C License along with this program; if not, write to the Free |
| 17 |
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, |
| 18 |
C MA 02139, USA. |
| 19 |
C |
| 20 |
C Corresponding concerning ESO-MIDAS should be addressed as follows: |
| 21 |
C Internet e-mail: [email protected] |
| 22 |
C Postal address: European Southern Observatory |
| 23 |
C Data Management Division |
| 24 |
C Karl-Schwarzschild-Strasse 2 |
| 25 |
C D 85748 Garching bei Muenchen |
| 26 |
C GERMANY |
| 27 |
C=========================================================================== |
| 28 |
C |
| 29 |
SUBROUTINE GD8029(DISPLAY,CHAN,CURSNO,SHAPE,COLOUR,XC,YC,IDST) |
| 30 |
C |
| 31 |
C++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 32 |
C |
| 33 |
C.IDENTIFICATION |
| 34 |
C a) subroutine IICINC version 1.00 880921 |
| 35 |
C b) subroutine IICSCV version 1.00 880915 |
| 36 |
C c) subroutine IICWCP version 1.00 880915 |
| 37 |
C d) subroutine IICRCP version 1.00 880915 |
| 38 |
C K. Banse ESO - Garching |
| 39 |
C |
| 40 |
C.KEYWORDS |
| 41 |
C DeAnza, cursor boards |
| 42 |
C |
| 43 |
C.PURPOSE |
| 44 |
C fulfill the requirements as described in the IDI document |
| 45 |
C |
| 46 |
C.ALGORITHM |
| 47 |
C use DeAnza level-0 software |
| 48 |
C |
| 49 |
C.INPUT/OUTPUT |
| 50 |
C call as |
| 51 |
C a) IICINC(DISPLAY,CHAN,CURSNO,SHAPE,COLOUR,XC,YC,IDST) |
| 52 |
C b) IICSCV(DISPLAY,CURSNO,VIS,IDST) |
| 53 |
C c) IICWCP(DISPLAY,CHAN,CURSNO,XC,YC,IDST) |
| 54 |
C d) IICRCP(DISPLAY,CHAN,CURSNO,XC,YC,MEMO,IDST) |
| 55 |
C |
| 56 |
C input par: |
| 57 |
C DISPLAY: I*4 display id. |
| 58 |
C CHAN: I*4 memory id (not used, always assumed to be -1 ...) |
| 59 |
C CURSNO: I*4 cursor number, 0 or 1 |
| 60 |
C SHAPE: I*4 cursor shape |
| 61 |
C = 0 for DeAnza programmable or fixed cursors |
| 62 |
C 1,2,3,7 as in IDI doc. page 44 |
| 63 |
C COLOUR: I*4 cursor colour |
| 64 |
C if shape = 0 |
| 65 |
C = 0 for just set cursor on |
| 66 |
C 1,...,16 for fixed forms 0,...,15 |
| 67 |
C 99 for loading a programmable cursor, |
| 68 |
C name stored in keyword IN_A |
| 69 |
C if shape > 0 |
| 70 |
C 0,1,2 as in IDI doc. page 38 |
| 71 |
C XC: I*4 x cursor position |
| 72 |
C YC: I*4 y cursor position |
| 73 |
C |
| 74 |
C VIS: I*4 1 = visible, 0 = invisible |
| 75 |
C |
| 76 |
C output par: |
| 77 |
C MEMO: I*4 memory cursor is currently pointing to |
| 78 |
C |
| 79 |
C IDST: I*4 return status |
| 80 |
C |
| 81 |
C-------------------------------------------------- |
| 82 |
C |
| 83 |
IMPLICIT NONE |
| 84 |
C |
| 85 |
INTEGER*4 DISPLAY,CHAN,CURSNO,SHAPE,COLOUR,XC,YC,IDST |
| 86 |
INTEGER*4 N,FIX |
| 87 |
C |
| 88 |
INTEGER*2 UNIT,CURSAR(1024) |
| 89 |
INTEGER*2 PMASK,COFF,RESREG,I2WORD(2),XY |
| 90 |
INTEGER*2 RR,LR,LCR,RCR,LPA |
| 91 |
C |
| 92 |
INCLUDE 'MID_INCLUDE:DEANZAH.INC' |
| 93 |
INCLUDE 'MID_INCLUDE:DEANZAS.INC' |
| 94 |
C |
| 95 |
EQUIVALENCE (I2WORD(1),N) |
| 96 |
C |
| 97 |
EXTERNAL LR,RR,LCR,RCR,LPA |
| 98 |
C |
| 99 |
C get unit |
| 100 |
UNIT = DISPLAY |
| 101 |
IDST = 0 |
| 102 |
C |
| 103 |
C get cursor control register |
| 104 |
CALL IP8QW(RCR,UNIT,DZIOSB,,,CURREG(5),2,0,4) |
| 105 |
C |
| 106 |
C set up bit masks |
| 107 |
IF (CURSNO.EQ.0) THEN |
| 108 |
PMASK = "40000 |
| 109 |
COFF = "177717 !leave P2 bit as it is |
| 110 |
XY = "60 |
| 111 |
ELSE |
| 112 |
PMASK = "100000 |
| 113 |
COFF = "176377 !leave P1 bit as it is |
| 114 |
XY = "1400 |
| 115 |
ENDIF |
| 116 |
C |
| 117 |
C clear P2 (15), Y2, X2 (9,8) or P1 (14), Y1, X1 (5,4) |
| 118 |
C clear F3, F2,F1,F0 bits (3, 2,1,0) |
| 119 |
C |
| 120 |
N = IAND(CURREG(5),COFF) |
| 121 |
N = IAND(N,"177760) |
| 122 |
CURREG(5) = I2WORD(1) !to avoid integer overflow .... |
| 123 |
C |
| 124 |
C branch according to cursor shape |
| 125 |
C |
| 126 |
IF (SHAPE.NE.0) GOTO 1000 |
| 127 |
C |
| 128 |
C DeAnza specific stuff, see if fixed (COLOUR in [1,16]) or programmable |
| 129 |
IF ( (COLOUR.GE.1) .AND. (COLOUR.LE.16) ) THEN |
| 130 |
FIX = COLOUR - 1 |
| 131 |
FIX = IAND(FIX,"17) !cut out last 4 bits |
| 132 |
CURREG(5) = IOR(CURREG(5),FIX) !insert fixed cursor shape |
| 133 |
CURREG(5) = IOR(CURREG(5),XY) !insert X, Y components |
| 134 |
ELSE |
| 135 |
CURREG(5) = IOR(CURREG(5),PMASK) |
| 136 |
C |
| 137 |
C check, if just enable current cursor |
| 138 |
IF (COLOUR.EQ.0) GOTO 5000 |
| 139 |
C |
| 140 |
C read specified cursor shape from table file (COLOUR = 99) |
| 141 |
CALL KKCTAB(SHAPE,COLOUR,CURSAR,IDST) |
| 142 |
IF (IDST.NE.0) THEN |
| 143 |
IDST = 71 |
| 144 |
RETURN |
| 145 |
ENDIF |
| 146 |
C |
| 147 |
C set resolution register for low byte transfer |
| 148 |
CALL IP8QW(RR,UNIT,DZIOSB,,,SYSREG(12),2,0,11) |
| 149 |
RESREG = IAND(SYSREG(12),"177677) |
| 150 |
RESREG = IOR(RESREG,"100) |
| 151 |
CALL IP8QW(LR,UNIT,DZIOSB,,,RESREG,2,0,11) |
| 152 |
C |
| 153 |
C finally load the cursor table into the DeAnza + reset SYSREG(12) |
| 154 |
CALL IP8QW(LPA,UNIT,DZIOSB,,,CURSAR,2048,CURSNO,3) |
| 155 |
CALL IP8QW(LR,UNIT,DZIOSB,,,SYSREG(12),2,0,11) |
| 156 |
ENDIF |
| 157 |
GOTO 5000 |
| 158 |
C |
| 159 |
C handle the "official" IDI cursor shapes |
| 160 |
C |
| 161 |
1000 IF ( SHAPE.EQ.1) THEN !Cross hair |
| 162 |
CURREG(5) = IOR(CURREG(5),XY) !insert X, Y components |
| 163 |
ELSE |
| 164 |
CURREG(5) = IOR(CURREG(5),PMASK) !all others are implemented |
| 165 |
C !via programmable cursors |
| 166 |
C read specified cursor shape from table file |
| 167 |
CALL KKCTAB(SHAPE,COLOUR,CURSAR,IDST) |
| 168 |
IF (IDST.NE.0) THEN |
| 169 |
IDST = 71 |
| 170 |
RETURN |
| 171 |
ENDIF |
| 172 |
C |
| 173 |
C set resolution register for low byte transfer |
| 174 |
CALL IP8QW(RR,UNIT,DZIOSB,,,SYSREG(12),2,0,11) |
| 175 |
RESREG = IAND(SYSREG(12),"177677) |
| 176 |
RESREG = IOR(RESREG,"100) |
| 177 |
CALL IP8QW(LR,UNIT,DZIOSB,,,RESREG,2,0,11) |
| 178 |
C |
| 179 |
C finally load the cursor table into the DeAnza + reset SYSREG(12) |
| 180 |
CALL IP8QW(LPA,UNIT,DZIOSB,,,CURSAR,2048,CURSNO,3) |
| 181 |
CALL IP8QW(LR,UNIT,DZIOSB,,,SYSREG(12),2,0,11) |
| 182 |
ENDIF |
| 183 |
C |
| 184 |
C send cursor control register to the Deanza |
| 185 |
5000 CALL IP8QW(LCR,UNIT,DZIOSB,,,CURREG(5),2,0,4) |
| 186 |
C |
| 187 |
C look, if we also want to position the cursor |
| 188 |
IF (XC.GE.0) |
| 189 |
+ CALL GD8032(DISPLAY,CHAN,CURSNO,XC,YC,IDST) |
| 190 |
C |
| 191 |
C alright then... |
| 192 |
RETURN |
| 193 |
END |
| 194 |
|
| 195 |
SUBROUTINE GD8030(DISPLAY,CURSNO,VIS,IDST) |
| 196 |
C |
| 197 |
IMPLICIT NONE |
| 198 |
C |
| 199 |
INTEGER*4 DISPLAY,CURSNO,VIS,IDST |
| 200 |
INTEGER*4 IPROG |
| 201 |
C |
| 202 |
INTEGER*2 UNIT |
| 203 |
INTEGER*2 CURSOFF,CURSON,PMASK,CMASK |
| 204 |
INTEGER*2 LCR,RCR |
| 205 |
C |
| 206 |
INCLUDE 'MID_INCLUDE:DEANZAH.INC' |
| 207 |
INCLUDE 'MID_INCLUDE:DEANZAS.INC' |
| 208 |
C |
| 209 |
EXTERNAL LCR,RCR |
| 210 |
C |
| 211 |
C get unit |
| 212 |
UNIT = DISPLAY |
| 213 |
C |
| 214 |
C get cursor register 4 |
| 215 |
CALL IP8QW(RCR,UNIT,DZIOSB,,,CURREG(5),2,0,4) |
| 216 |
C |
| 217 |
C set bit masks |
| 218 |
IF (CURSNO.EQ.0) THEN |
| 219 |
PMASK = "40000 |
| 220 |
CURSOFF = "137717 |
| 221 |
CMASK = "60 |
| 222 |
ELSE |
| 223 |
PMASK = "100000 |
| 224 |
CURSOFF = "076377 |
| 225 |
CMASK = "1400 |
| 226 |
ENDIF |
| 227 |
C |
| 228 |
C test, if we are using fixed or programmable cursors |
| 229 |
IPROG = 0 ! 4 bytes = 0 |
| 230 |
IPROG = IAND(CURREG(5),PMASK) |
| 231 |
C |
| 232 |
IF (IPROG.NE.0) THEN |
| 233 |
CURSON = PMASK |
| 234 |
ELSE |
| 235 |
CURSON = CMASK |
| 236 |
ENDIF |
| 237 |
C |
| 238 |
C dis/enable cursor |
| 239 |
IF (VIS.EQ.0) THEN |
| 240 |
CURREG(5) = IAND(CURREG(5),CURSOFF) |
| 241 |
ELSE |
| 242 |
CURREG(5) = IOR(CURREG(5),CURSON) |
| 243 |
ENDIF |
| 244 |
C |
| 245 |
C and send it to the Deanza |
| 246 |
CALL IP8QW(LCR,UNIT,DZIOSB,,,CURREG(5),2,0,4) |
| 247 |
C |
| 248 |
C alright then... |
| 249 |
IDST = 0 |
| 250 |
RETURN |
| 251 |
END |
| 252 |
|
| 253 |
SUBROUTINE GD8032(DISPLAY,CHAN,CURSNO,XC,YC,IDST) |
| 254 |
C |
| 255 |
IMPLICIT NONE |
| 256 |
C |
| 257 |
INTEGER*4 DISPLAY,CHAN,CURSNO,XC,YC,IDST |
| 258 |
INTEGER*4 N1,N |
| 259 |
C |
| 260 |
INTEGER*2 UNIT |
| 261 |
INTEGER*2 LCR |
| 262 |
C |
| 263 |
INCLUDE 'MID_INCLUDE:DEANZAH.INC' |
| 264 |
INCLUDE 'MID_INCLUDE:DEANZAS.INC' |
| 265 |
C |
| 266 |
EXTERNAL LCR |
| 267 |
C |
| 268 |
C get unit |
| 269 |
UNIT = DISPLAY |
| 270 |
C |
| 271 |
C set index |
| 272 |
IF (CURSNO.EQ.0) THEN |
| 273 |
N = 0 |
| 274 |
N1 = 1 |
| 275 |
ELSE |
| 276 |
N = 2 |
| 277 |
N1 = 3 |
| 278 |
ENDIF |
| 279 |
C |
| 280 |
C cut off irrelevant parts of XC, YC |
| 281 |
CURREG(N1) = IAND(XC,"777) |
| 282 |
CURREG(N1+1) = IAND(YC,"777) |
| 283 |
C |
| 284 |
C and send it to the Deanza |
| 285 |
CALL IP8QW(LCR,UNIT,DZIOSB,,,CURREG(N1),4,0,N) |
| 286 |
C |
| 287 |
C alright then... |
| 288 |
IDST = 0 |
| 289 |
RETURN |
| 290 |
END |
| 291 |
|
| 292 |
SUBROUTINE GD8031(DISPLAY,CHAN,CURSNO,XC,YC,MEMO,IDST) |
| 293 |
C |
| 294 |
IMPLICIT NONE |
| 295 |
C |
| 296 |
INTEGER*4 DISPLAY,CHAN,CURSNO,XC,YC,MEMO,IDST |
| 297 |
INTEGER*4 N1,N,ISS |
| 298 |
C |
| 299 |
INTEGER*2 UNIT,CONTROL,FCREG |
| 300 |
INTEGER*2 RCR,RVR,LPR |
| 301 |
C |
| 302 |
INCLUDE 'MID_INCLUDE:DEANZAH.INC' |
| 303 |
INCLUDE 'MID_INCLUDE:DEANZAS.INC' |
| 304 |
C |
| 305 |
EXTERNAL RCR,RVR,LPR |
| 306 |
C |
| 307 |
C get unit |
| 308 |
UNIT = DISPLAY |
| 309 |
C |
| 310 |
C set index |
| 311 |
IF (CURSNO.EQ.0) THEN |
| 312 |
N = 0 |
| 313 |
N1 = 1 |
| 314 |
ELSE |
| 315 |
N = 2 |
| 316 |
N1 = 3 |
| 317 |
ENDIF |
| 318 |
C |
| 319 |
C get cursor registers from the Deanza |
| 320 |
CALL IP8QW(RCR,UNIT,DZIOSB,,,CURREG(N1),4,0,N) |
| 321 |
C |
| 322 |
C fill parameters |
| 323 |
XC = CURREG(N1) |
| 324 |
YC = CURREG(N1+1) |
| 325 |
C |
| 326 |
C get X-, Y- split registers + FCRs |
| 327 |
CALL IP8QW(RVR,UNIT,DZIOSB,,,VOCREG(1),4,0,0) |
| 328 |
CALL IP8QW(RVR,UNIT,DZIOSB,,,FCR(1),16,0,8) |
| 329 |
C |
| 330 |
C determine relevant FCR |
| 331 |
IF ( (VOCREG(1).EQ.0) .AND. (VOCREG(2).EQ.511) ) THEN |
| 332 |
FCREG = FCR(4) !no split screen |
| 333 |
ELSE |
| 334 |
IF (XC.LT.VOCREG(1)) THEN |
| 335 |
ISS = 1 |
| 336 |
IF (YC.LT.VOCREG(2)) ISS = 2 |
| 337 |
ELSE |
| 338 |
ISS = 0 |
| 339 |
IF (YC.LT.VOCREG(2)) ISS = 3 |
| 340 |
ENDIF |
| 341 |
FCREG = FCR(ISS+1) |
| 342 |
ENDIF |
| 343 |
C |
| 344 |
C pull out memory channel from FCR |
| 345 |
MEMO = IAND(FCREG,"17) |
| 346 |
C |
| 347 |
C alright then... |
| 348 |
IDST = 0 |
| 349 |
RETURN |
| 350 |
END |