aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/iism70/iisofm.x
blob: 0c19c1173201e99958c3f2c043a93dadeddaa9c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include <mach.h>
include "iis.h"
include "../lib/ids.h"

define	LUT_OMAX	1023

# IISOFM -- Read and Write OUTPUT look up table.
# Written data is from end points, read data is full
# array.

procedure iisofm (rw, color, offset, n, data)

short	rw			# read or write
short	color[ARB]		# color(s) to write
short	offset			# offset into lut
short	n			# number of data values
short	data[ARB]		# the data

int	command,len,x,y,z
int	mapcolor()
pointer	sp, odata

include "iis.com"

begin
	z = mapcolor (color)
	if ( rw == IDS_WRITE) {
	    if (n < 4)
	        return
	
	    call smark (sp)
	    call salloc (odata, LEN_OFM, TY_SHORT)
	    call aclrs (Mems[odata], LEN_OFM)

	    command = IWRITE+VRETRACE
	    call idslfill (data, int(n), Mems[odata], LEN_OFM, 0, LUT_OMAX)
	    len = LEN_OFM
	}
	else {
	    len = n
	    command = IREAD+VRETRACE
	}
	y = ADVYONXOV
	x = ADVXONTC
	call iishdr (command, len, OFM, x, y, z, 0)
	if (rw == IDS_WRITE) {
	    call iisio (Mems[odata], len * SZB_CHAR)
	    call sfree (sp)
	} else
	    call iisio (data, len * SZB_CHAR)
end