aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/ids/idssave.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /pkg/images/tv/iis/ids/idssave.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/images/tv/iis/ids/idssave.x')
-rw-r--r--pkg/images/tv/iis/ids/idssave.x82
1 files changed, 82 insertions, 0 deletions
diff --git a/pkg/images/tv/iis/ids/idssave.x b/pkg/images/tv/iis/ids/idssave.x
new file mode 100644
index 00000000..a66ebc00
--- /dev/null
+++ b/pkg/images/tv/iis/ids/idssave.x
@@ -0,0 +1,82 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "../lib/ids.h"
+
+# IDS_SAVE -- Save the control state of the display, together with
+# zero to all of the image and graphics planes.
+
+procedure ids_save (data, n)
+
+short data[ARB] # instruction data words
+short n # count of data words
+
+int fd # binary file output descriptor
+short i, j
+short frame[IDS_MAXIMPL+1] # frames to save
+short graph[IDS_MAXGRPL+1] # graph planes to save
+
+include "../lib/ids.com"
+
+begin
+ # do we need to check n ??
+
+ # determine file descriptor to write (opened by upper end)
+ # ( assume upper end has saved whatever data it wanted and
+ # leaves fd pointing at control information offset)
+ # then squirrel away the frame data
+
+ fd = data[1]
+
+ # image data
+
+ i = 1
+ j = 0
+ repeat {
+ i = i + 1
+ j = j + 1
+ frame[j] = data[i]
+ } until ( data[i] == IDS_EOD )
+ call write(fd, j, SZ_SHORT)
+ call write(fd, frame[1], j*SZ_SHORT)
+
+ # graph data
+
+ j = 0
+ repeat {
+ i = i + 1
+ j = j + 1
+ graph[j] = data[i]
+ } until ( data[i] == IDS_EOD )
+ call write(fd, j, SZ_SHORT)
+ call write(fd, graph[1], j*SZ_SHORT)
+
+ # get all control information
+
+ call zdev_save(fd)
+
+ # get image data
+
+ if ( frame[1] == IDS_EOD) {
+ for ( i = 1 ; i <= i_maxframes ; i = i + 1)
+ frame[i] = i
+ frame[i+1] = IDS_EOD
+ }
+ if ( frame[1] != 0 ) {
+ for ( i = 1 ; frame[i] != IDS_EOD ; i = i + 1)
+ call zim_save (fd, frame[i])
+ }
+
+ # get graphics data
+
+ if ( graph[1] == IDS_EOD) {
+ for ( i = 1 ; i <= i_maxgraph ; i = i + 1)
+ graph[i] = i
+ graph[i+1] = IDS_EOD
+ }
+ if ( graph[1] != 0 ) {
+ for ( i = 1 ; graph[i] != IDS_EOD ; i = i + 1)
+ call zgr_save (fd, graph[i])
+ }
+
+ # upper end to close file
+end