Add new file "SgX.c". Upgrade Starbase graphics to support X windows
authorChris Hanson <org/chris-hanson/cph>
Fri, 15 Jul 1988 09:05:30 +0000 (09:05 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 15 Jul 1988 09:05:30 +0000 (09:05 +0000)
(version 10).

v7/src/microcode/sgraph.h
v7/src/microcode/sgraph_a.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index 1e7caaacdd825ed7b875e942e310316e2b3a8ce7..51761dc5f0f6ed68d19a04e0414ae6f21850e0d1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-Copyright (c) 1987 Massachusetts Institute of Technology
+Copyright (c) 1988 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -30,29 +30,9 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/sgraph.h,v 1.2 1988/03/11 02:54:59 arthur Rel $ */
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/sgraph.h,v 1.3 1988/07/15 09:03:46 cph Exp $ */
 
 #include <starbase.c.h>
-
-/* Defaults (300h color display) can be overriden in the Makefile. */
-
-#ifndef STARBASE_DRIVER_NAME
-
-#define STARBASE_DRIVER_NAME "hp300h"
-
-#define STARBASE_COLOR_TABLE_START             0
-#define STARBASE_COLOR_TABLE_SIZE              16
-
-/* Screen Boundaries */
-
-#define STARBASE_XMIN          -512.0
-#define STARBASE_YMIN          -384.0
-#define STARBASE_ZMIN             0.0
-#define STARBASE_XMAX           511.0
-#define STARBASE_YMAX           383.0
-#define STARBASE_ZMAX             0.0
-
-#endif
 \f
 /* Bobcat graphics primitives. Interface to the Starbase package*/
 
@@ -64,28 +44,57 @@ MIT in each case. */
 #define MAX_NUMBER_OF_CORNERS   512
 #define TWICE_MAX_NUMBER_OF_CORNERS  (2 * MAX_NUMBER_OF_CORNERS)
 
-#define DEFAULT_REPLACEMENT_RULE 3
-
 extern int screen_handle;
-extern int locator_handle;     /* mouse, ignored if not present */
 extern long replacement_rule;
-extern float xposition, yposition;
-extern float Color_Table[STARBASE_COLOR_TABLE_SIZE][3];
-\f
+extern float xposition;
+extern float yposition;
+
+extern char * sb_device;
+extern char * sb_driver;
+extern float sb_xmin;
+extern float sb_xmax;
+extern float sb_ymin;
+extern float sb_ymax;
+extern float sb_zmin;
+extern float sb_zmax;
+
 /* Generic dispatch of coordinates. No BIGNUM support yet. */
 
-#define Make_Flonum( pointer, flonum, integer, error)          \
-{                                                              \
-  switch( Type_Code( pointer))                                 \
-    {                                                          \
-    case TC_FIXNUM:                                            \
-      Sign_Extend( pointer, integer);                          \
-      flonum = ((float) integer);                              \
-      break;                                                   \
-    case TC_BIG_FLONUM:                                                \
-      flonum = (float) Get_Float( pointer);                    \
-      break;                                                   \
-    default:                                                   \
-      Primitive_Error( error);                                 \
-    }                                                          \
+#define Make_Flonum(pointer, flonum, integer, error)                   \
+{                                                                      \
+  switch (Type_Code (pointer))                                         \
+    {                                                                  \
+    case TC_FIXNUM:                                                    \
+      Sign_Extend (pointer, integer);                                  \
+      flonum = ((float) integer);                                      \
+      break;                                                           \
+    case TC_BIG_FLONUM:                                                        \
+      flonum = ((float) (Get_Float (pointer)));                                \
+      break;                                                           \
+    default:                                                           \
+      Primitive_Error (error);                                         \
+    }                                                                  \
+}
+
+/* Easier to use flonum arg conversion. */
+#define FLONUM_ARG(argno, target)                                      \
+{                                                                      \
+  fast Pointer argument;                                               \
+  fast long fixnum_value;                                              \
+                                                                       \
+  argument = (ARG_REF (argno));                                                \
+  switch (Type_Code (argument))                                                \
+    {                                                                  \
+    case TC_FIXNUM:                                                    \
+      Sign_Extend (argument, fixnum_value);                            \
+      target = ((float) fixnum_value);                                 \
+      break;                                                           \
+                                                                       \
+    case TC_BIG_FLONUM:                                                        \
+      target = ((float) (Get_Float (argument)));                       \
+      break;                                                           \
+                                                                       \
+    default:                                                           \
+      error_wrong_type_arg (argno);                                    \
+    }                                                                  \
 }
index e0f598a447ecdaf57a024ba4d7a12f9b48a0bfc9..0a06301fbe8fbeab311f671a2b882edd20cc9c43 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/sgraph_a.c,v 1.2 1987/05/29 17:40:27 jinx Rel $ */
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/sgraph_a.c,v 1.3 1988/07/15 09:03:54 cph Exp $ */
 
 #include "scheme.h"
 #include "primitive.h"
@@ -38,6 +38,14 @@ MIT in each case. */
 #include "Sgraph.h"
 #include "array.h"
 
+#ifndef STARBASE_COLOR_TABLE_START
+#define STARBASE_COLOR_TABLE_START 0
+#endif
+
+#ifndef STARBASE_COLOR_TABLE_SIZE
+#define STARBASE_COLOR_TABLE_SIZE 16
+#endif
+
 float Color_Table[STARBASE_COLOR_TABLE_SIZE][3];
 \f
 Define_Primitive(Prim_Plot_Array_In_Box, 3, "PLOT-ARRAY-IN-BOX")
@@ -265,9 +273,7 @@ C_Clear_Rectangle(Box)
   clear_view_surface(screen_handle);
   make_picture_current(screen_handle);
   clear_control(screen_handle, CLEAR_DISPLAY_SURFACE); /* back to the default */
-  clip_rectangle(screen_handle,
-                STARBASE_XMIN, STARBASE_XMAX,
-                STARBASE_YMIN, STARBASE_YMAX);
+  clip_rectangle(screen_handle, sb_xmin, sb_xmax, sb_ymin, sb_ymax);
 }
 \f
 Define_Primitive(Prim_Box_Move, 2, "BOX-MOVE") 
index a405d955d73e692d8ad5039eeffa47294f28a0ff..f602d2a7d07d4a2bf6b85c627989b90e99fc7aab 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.44 1988/07/08 02:27:10 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.45 1988/07/15 09:05:30 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     44
+#define SUBVERSION     45
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index 33f84169ca7c1bf8aacdd5025952dc0e0d312198..dde93ba3631c21bf6a28d68cfc4aab6fadf12623 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.44 1988/07/08 02:27:10 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.45 1988/07/15 09:05:30 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     44
+#define SUBVERSION     45
 #endif
 
 #ifndef UCODE_TABLES_FILENAME