aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/iism70/iisminmax.x
blob: 22a3062ec2a3863a483b61ba2c0e90b1de7ab24b (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

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

define	LEN_MM	6

# IISMIN -- Read minimum registers

procedure iismin (rw, color, n, data)

short	rw			# read or write
short	color[ARB]		# color
short	n			# number of data values
short	data[ARB]		# the data

int	command,x
short	const[LEN_MM]
int	i,j

include "iis.com"

begin
	if ( rw == IDS_WRITE)
	    return
	command = IREAD+VRETRACE
	x = ADVXONTC
	call iishdr(command, LEN_MM, SUMPROC+COMMAND, x, 0, 0, 0)
	call iisio (const, LEN_MM * SZB_CHAR)
	j = 1
	for ( i = 1 ; i <= n ; i = i + 1 ) {
	    switch(color[j]) {
		case IDS_RED:
		    data[i] = const[5]

		case IDS_GREEN:
		    data[i] = const[3]

		case IDS_BLUE:
		    data[i] = const[1]
	    }
	    j = j+1
	    if ( color[j] == IDS_EOD )
	        j = j - 1
	}
end

# IISMAX -- Read maximum registers

procedure iismax (rw, color, n, data)

short	rw			# read or write
short	color[ARB]		# color
short	n			# number of data values
short	data[ARB]		# the data

int	command,x
short	const[LEN_MM]
int	i,j

include "iis.com"

begin
	if ( rw == IDS_WRITE)
	    return
	command = IREAD+VRETRACE
	x = ADVXONTC
	call iishdr(command, LEN_MM, SUMPROC+COMMAND, x, 0, 0, 0)
	call iisio (const, LEN_MM * SZB_CHAR)
	j = 1
	for ( i = 1 ; i <= n ; i = i + 1 ) {
	    switch(color[j]) {
		case IDS_RED:
		    data[i] = const[6]

		case IDS_GREEN:
		    data[i] = const[4]

		case IDS_BLUE:
		    data[i] = const[2]
	    }
	    j = j+1
	    if ( color[j] == IDS_EOD )
		j = j - 1
	}
end