Debian Codegraph @

libsrc/idi/fidi/deanza/gd8l.for

raw
1 C @(#)gd8l.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 GD8025(DISPLAY,NLUT,ISTA,COUNT,RLUT,IDST)
30 C
31 C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32 C
33 C.IDENTIFICATION
34 C subroutine IILWLT version 1.00 880120
35 C IILRLT 1.00 880120
36 C K. Banse ESO - Garching
37 C
38 C.KEYWORDS
39 C DeAnza display , LUT
40 C
41 C.PURPOSE
42 C to load an LUT into the DeAnza,
43 C to read an LUT from DeAnza,
44 C according to 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 IILWLT(DISPLAY,NLUT,ISTA,COUNT,RLUT,IDST)
51 C IILRLT(DISPLAY,NLUT,ISTA,COUNT,RLUT,IDST)
52 C
53 C input par:
54 C DISPLAY: I*4 DISPLAY no.
55 C NLUT: I*4 LUT section no. (0 - 3)
56 C if = 4, it's for the overlay !!
57 C ISTA: I*4 start within LUT table in DeAnza
58 C COUNT: I*4 no. of entries in table to send/read
59 C
60 C input/output par:
61 C RLUT: R*4 array LUT table with R,G,B entries
62 C IDST: I*4 return status
63 C
64 C-----------------------------------------------------
65 C
66 IMPLICIT NONE
67 C
68 INTEGER*4 DISPLAY,NLUT,ISTA,COUNT,IDST
69 INTEGER*4 N,NN,ISW
70 C
71 REAL*4 RLUT(3,COUNT)
72 C
73 INTEGER*2 UNIT,LUT(1024,2),RESREG
74 INTEGER*2 RR,LR,LPA,LVR
75 C
76 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
77 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
78 C
79 EXTERNAL RR,LR,LPA,LVR
80 C
81 UNIT = DISPLAY
82 C
83 C check, if we want to load an overlay table
84 IF (NLUT.EQ.4) THEN
85 CALL KKOWLT(UNIT,ISTA,COUNT,RLUT,IDST)
86 RETURN
87 ENDIF
88 C
89 C set resolution register for low byte transfer
90 CALL IP8QW(RR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
91 RESREG = IAND(SYSREG(12),"177677)
92 RESREG = IOR(RESREG,"100)
93 CALL IP8QW(LR,UNIT,DZIOSB,,,RESREG,2,0,11)
94 C
95 C set LUT address in the DeAnza
96 N = IAND("377,ISTA) !cut out low byte
97 VOCREG(4) = IOR(N,ISHFT(NLUT,8))
98 C
99 C main loop:
100 C convert R, G, B real table to I*2 and send it to the DeAnza
101 C
102 ISW = 1
103 DO NN=1,3
104 C
105 DO N=1,COUNT
106 LUT(N,ISW) = NINT(RLUT(NN,N)*255.)
107 ENDDO
108 C
109 CALL IP8W(UNIT) !wait till ready ...
110 CALL IP8QW(LVR,UNIT,DZIOSB,,,VOCREG(4),2,0,3)
111 CALL IP8Q(LPA,UNIT,DZIOSB,,,LUT(1,ISW),COUNT*2,NN-1,1)
112 ISW = 3 - ISW !switch buffer
113 ENDDO
114 C
115 CALL IP8QW(LR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
116 IDST = 0
117 RETURN
118 END
119
120 SUBROUTINE GD8026(DISPLAY,NLUT,ISTA,COUNT,RLUT,IDST)
121 C
122 IMPLICIT NONE
123 C
124 INTEGER*4 DISPLAY,NLUT,ISTA,COUNT,IDST
125 INTEGER*4 N,ISW,JSW
126 C
127 REAL*4 RLUT(3,COUNT)
128 REAL*4 F
129 C
130 INTEGER*2 UNIT,LUT(1024,2),RESREG
131 INTEGER*2 RR,LR,RPA,LVR
132 C
133 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
134 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
135 C
136 EXTERNAL RR,LR,RPA,LVR
137 C
138 UNIT = DISPLAY
139 C
140 C set resolution register for low byte transfer
141 CALL IP8QW(RR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
142 RESREG = IAND(SYSREG(12),"177677)
143 RESREG = IOR(RESREG,"100)
144 CALL IP8QW(LR,UNIT,DZIOSB,,,RESREG,2,0,11)
145 C
146 C set LUT address in the DeAnza
147 N = IAND("377,ISTA) !cut out low byte
148 VOCREG(4) = IOR(N,ISHFT(NLUT,8))
149 C
150 C main loop:
151 C get LUT from the DeAnza and convert I*2 table to R, G, B real table
152 C
153 ISW = 1
154 JSW = 3 - ISW !switch buffer
155 F = 1./255.
156 C
157 C read red table with wait + greeen table without wait
158 CALL IP8QW(LVR,UNIT,DZIOSB,,,VOCREG(4),2,0,3)
159 CALL IP8QW(RPA,UNIT,DZIOSB,,,LUT(1,ISW),COUNT*2,0,1)
160 CALL IP8QW(LVR,UNIT,DZIOSB,,,VOCREG(4),2,0,3)
161 CALL IP8Q(RPA,UNIT,DZIOSB,,,LUT(1,JSW),COUNT*2,1,1)
162 C
163 C make sure high byte is 0 and convert red table to real
164 DO N=1,COUNT
165 RLUT(1,N) = F * FLOAT(IAND(LUT(N,ISW),"377))
166 ENDDO
167 C
168 C fire up reading of blue as soon as green table is in
169 CALL IP8W(UNIT) !wait till ready ...
170 CALL IP8QW(LVR,UNIT,DZIOSB,,,VOCREG(4),2,0,3)
171 CALL IP8Q(RPA,UNIT,DZIOSB,,,LUT(1,ISW),COUNT*2,2,1)
172 C
173 C convert green table
174 DO N=1,COUNT
175 RLUT(2,N) = F * FLOAT(IAND(LUT(N,JSW),"377))
176 ENDDO
177 C
178 C wait + convert blue table
179 CALL IP8W(UNIT)
180 DO N=1,COUNT
181 RLUT(3,N) = F * FLOAT(IAND(LUT(N,ISW),"377))
182 ENDDO
183 C
184 CALL IP8QW(LR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
185 IDST = 0
186 RETURN
187 END
188
189 SUBROUTINE GD8023(DISPLAY,CHAN,NITT,ISTA,COUNT,RITT,IDST)
190 C
191 C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
192 C
193 C.IDENTIFICATION
194 C subroutine IILWIT version 1.00 880120
195 C IILRIT 1.00 880120
196 C K. Banse ESO - Garching
197 C
198 C.KEYWORDS
199 C DeAnza display , ITT
200 C
201 C.PURPOSE
202 C to load an ITT into the DeAnza,
203 C to read an ITT from DeAnza
204 C according to the IDI document
205 C
206 C.ALGORITHM
207 C use DeAnza level 0 software
208 C
209 C.INPUT/OUTPUT
210 C call as IILWIT(DISPLAY,CHAN,NITT,ISTA,COUNT,RITT,IDST)
211 C IILRIT(DISPLAY,CHAN,NITT,ISTA,COUNT,RITT,IDST)
212 C
213 C input par:
214 C DISPLAY: I*4 display no.
215 C CHAN: I*4 memory board no.
216 C NITT: I*4 ITT section no. (0 - 3)
217 C ISTA: I*4 start in ITT table inside DeAnza
218 C COUNT: I*4 no. of bytes to send/read
219 C
220 C input/output par:
221 C RITT: R*4 array ITT table
222 C IDST: I*4 return stat
223 C
224 C-----------------------------------------------------
225 C
226 IMPLICIT NONE
227 C
228 INTEGER*4 DISPLAY,CHAN,NITT,ISTA,COUNT,IDST
229 INTEGER*4 N
230 C
231 REAL*4 RITT(1)
232 C
233 INTEGER*2 UNIT,ITT(256),ILADR,RESREG
234 INTEGER*2 RR,LR,LMC,LPA
235 C
236 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
237 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
238 C
239 EXTERNAL RR,LR,LMC,LPA
240 C
241 UNIT = DISPLAY
242 C
243 C set resolution register for low byte transfer
244 CALL IP8QW(RR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
245 RESREG = IAND(SYSREG(12),"177677)
246 RESREG = IOR(RESREG,"100)
247 CALL IP8QW(LR,UNIT,DZIOSB,,,RESREG,2,0,11)
248 C
249 C convert real table to I*2
250 DO N=1,COUNT
251 ITT(N) = NINT(RITT(N)*255.)
252 ENDDO
253 C
254 C build ITT address
255 N = IAND("377,ISTA) !cut out start (usually = 0 anyway)
256 N = IOR("10000,ISTA) !add ITT enable bit (bit 12)
257 ILADR = IOR(N,ISHFT(NITT,8)) !integrate also ITT section
258 N = CHAN + 1
259 MEMREG(4,N) = IAND(MEMREG(4,N),"176377) !clear L9,L8 bit (9,8)
260 MEMREG(4,N) = IOR(MEMREG(4,N),ILADR)
261 C
262 C send the table to the DeAnza
263 CALL IP8QW(LMC,UNIT,DZIOSB,,,MEMREG(4,N),2,CHAN,3) !set LUT address reg.
264 CALL IP8QW(LPA,UNIT,DZIOSB,,,ITT,COUNT*2,CHAN,0)
265 C
266 CALL IP8QW(LR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
267 IDST = 0
268 RETURN
269 END
270
271 SUBROUTINE GD8024(DISPLAY,CHAN,NITT,ISTA,COUNT,RITT,IDST)
272 C
273 IMPLICIT NONE
274 C
275 INTEGER*4 DISPLAY,CHAN,NITT,ISTA,COUNT,IDST
276 INTEGER*4 N
277 C
278 INTEGER*2 UNIT,ITT(256),ILADR,RESREG
279 INTEGER*2 RR,LR,LMC,RPA
280 C
281 REAL*4 RITT(1)
282 REAL*4 F
283 C
284 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
285 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
286 C
287 EXTERNAL RR,LR,LMC,RPA
288 C
289 C set resolution register for low byte transfer
290 CALL IP8QW(RR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
291 RESREG = IAND(SYSREG(12),"177677)
292 RESREG = IOR(RESREG,"100)
293 CALL IP8QW(LR,UNIT,DZIOSB,,,RESREG,2,0,11)
294 C
295 C build ITT address
296 N = IAND("377,ISTA) !cut out start (usually = 0 anyway)
297 N = IOR("10000,ISTA) !add ITT enable bit (bit 12)
298 ILADR = IOR(N,ISHFT(NITT,8)) !integrate also ITT section
299 N = CHAN + 1
300 MEMREG(4,N) = IAND(MEMREG(4,N),"176377) !clear L9,L8 bit (9,8)
301 MEMREG(4,N) = IOR(MEMREG(4,N),ILADR)
302 C
303 C read the table from the DeAnza
304 CALL IP8QW(LMC,UNIT,DZIOSB,,,MEMREG(4,N),2,CHAN,3) !set LUT address reg.
305 CALL IP8QW(RPA,UNIT,DZIOSB,,,ITT,COUNT*2,CHAN,0)
306 C
307 C make sure high byte is 0 and convert to real
308 F = 1./255.
309 DO N=1,COUNT
310 RITT(N) = F * FLOAT(IAND(ITT(N),"377))
311 ENDDO
312 C
313 CALL IP8QW(LR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
314 IDST = 0
315 RETURN
316 END
317
318 SUBROUTINE GD8049(DISPLAY,CHAN,VISI,IDST)
319 C
320 C++++++++++++++++++++++++++++++++++++++++++++++++++
321 C
322 C.IDENTIFICATION
323 C subroutine IILSBV version 1.00 880125
324 C K. Banse ESO - Garching
325 C
326 C.KEYWORDS
327 C DeAnza, LUT
328 C
329 C.PURPOSE
330 C fulfill the requirements as described in the IDI document
331 C
332 C.ALGORITHM
333 C use DeAnza level 0 software
334 C
335 C.INPUT/OUTPUT
336 C call as IILSBV(DISPLAY,CHAN,VISI,IDST)
337 C
338 C input par:
339 C DISPLAY: I*4 display id.
340 C CHAN: I*4 memory id
341 C VISI: I*4 LUT bar visibility, 0 = off, > 0 = on
342 C
343 C output par:
344 C IDST: I*4 return status
345 C
346 C--------------------------------------------------
347 C
348 IMPLICIT NONE
349 C
350 INTEGER*4 DISPLAY,CHAN,VISI,IDST
351 INTEGER*4 N,STAT
352 C
353 INTEGER*2 UNIT,CLREF,SETREF
354 INTEGER*2 LMC
355 C
356 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
357 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
358 C
359 DATA CLREF /"167777/, SETREF /"010000/
360 C
361 EXTERNAL LMC
362 C
363 N = CHAN + 1
364 UNIT = DISPLAY
365 C
366 C clear + set RF bit (12) of memory register 0 of channel CHAN
367 C depending upon VISI
368 C
369 MEMREG(1,N) = IAND(MEMREG(1,N),CLREF)
370 IF (VISI.GT.0)
371 + MEMREG(1,N) = IOR(MEMREG(1,N),SETREF)
372 C
373 CALL IP8QW(LMC,UNIT,DZIOSB,,,MEMREG(1,N),2,CHAN,0)
374 C
375 IDST = 0
376 RETURN
377 END