aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/iism70/iiswr.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/images/tv/iis/iism70/iiswr.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/images/tv/iis/iism70/iiswr.x')
-rw-r--r--pkg/images/tv/iis/iism70/iiswr.x51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkg/images/tv/iis/iism70/iiswr.x b/pkg/images/tv/iis/iism70/iiswr.x
new file mode 100644
index 00000000..11bb2803
--- /dev/null
+++ b/pkg/images/tv/iis/iism70/iiswr.x
@@ -0,0 +1,51 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <mach.h>
+include "iis.h"
+
+# IISWR -- Write pixel data to IIS. Writes are packed with full lines only.
+# The data is line-flipped, causing the first line to be displayed at the bottom
+# of the screen.
+
+procedure iiswr (chan, buf, nbytes, offset)
+
+int chan[ARB]
+short buf[ARB]
+int nbytes
+long offset
+
+long off1, off2
+int nchars, thing_count, tid, y1, y2, x
+int or()
+include "iis.com"
+
+begin
+ # Convert to chars and clip at the top of the display.
+ off1 = (offset - 1) / SZB_CHAR + 1
+ off2 = min (IIS_XDIM * IIS_YDIM, (offset + nbytes - 1) / SZB_CHAR) + 1
+ nchars = off2 - off1
+
+ y1 = (off1-1 ) / IIS_XDIM
+ y2 = (off2-1 - IIS_XDIM) / IIS_XDIM
+ y2 = max (y1,y2)
+
+ # Pack only if full lines
+ x = (off1 - 1) - y1 * IIS_XDIM
+ if ( x == 0 )
+ tid = IWRITE+BYPASSIFM+PACKED+BLOCKXFER+BYTE
+ else
+ tid = IWRITE+BYPASSIFM
+
+ # If only a few chars, don't pack (BLOCKXFER needs nchar>=4)
+ if ( nchars < 4 )
+ tid = IWRITE+BYPASSIFM
+
+ thing_count = nchars
+
+ call iishdr (tid, thing_count, REFRESH,
+ or (x, ADVXONTC), or (IIS_YDIM-1-y2, ADVYONXOV), iframe, iplane)
+ if ( tid == IWRITE+BYPASSIFM)
+ call iisio (buf, nbytes)
+ else
+ call iispio (buf, y2 - y1 + 1)
+end