aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/stdgraph/stgmove.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 /sys/gio/stdgraph/stgmove.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/gio/stdgraph/stgmove.x')
-rw-r--r--sys/gio/stdgraph/stgmove.x27
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/gio/stdgraph/stgmove.x b/sys/gio/stdgraph/stgmove.x
new file mode 100644
index 00000000..5f7396a3
--- /dev/null
+++ b/sys/gio/stdgraph/stgmove.x
@@ -0,0 +1,27 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "stdgraph.h"
+
+# STG_MOVE -- Output a device move instruction to move to the position (x,y)
+# in GKI coordinates.
+
+procedure stg_move (x, y)
+
+int x, y # destination
+int stg_encode()
+include "stdgraph.com"
+
+begin
+ # Transform the first point from GKI coords to device coords and
+ # move to the transformed point.
+
+ call ttyputs (g_out, g_tty, Memc[SG_STARTMOVE(g_sg)], 1)
+
+ g_reg[1] = x * g_dx + g_x1
+ g_reg[2] = y * g_dy + g_y1
+ g_reg[E_IOP] = 1
+ if (stg_encode (Memc[g_xy], g_mem, g_reg) == OK)
+ call write (g_out, g_mem, g_reg[E_IOP] - 1)
+
+ call ttyputs (g_out, g_tty, Memc[SG_ENDMOVE(g_sg)], 1)
+end