aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/iism70/iispack.x
blob: 4c2c70f3e6a16698dab5e2f6a0d8b8d4d5c4642a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include "../lib/ids.h"

# IISPACK -- Pack color or frame data into a single word.

short procedure iispack (data)

short	data[ARB]
int	value, bit, i
int	or()

begin
	value = 0
	for (i=1;  data[i] != IDS_EOD;  i=i+1) {
	    bit = data[i] - 1
	    value = or (value, 2 ** bit)
	}

	return (value)
end