From: Chris Hanson Date: Fri, 15 Jul 1988 09:05:30 +0000 (+0000) Subject: Add new file "SgX.c". Upgrade Starbase graphics to support X windows X-Git-Tag: 20090517-FFI~12665 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2fdbba8d484de67efe9830b69d13ec914c83ebc8;p=mit-scheme.git Add new file "SgX.c". Upgrade Starbase graphics to support X windows (version 10). --- diff --git a/v7/src/microcode/sgraph.h b/v7/src/microcode/sgraph.h index 1e7caaacd..51761dc5f 100644 --- a/v7/src/microcode/sgraph.h +++ b/v7/src/microcode/sgraph.h @@ -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 - -/* 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 /* 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]; - +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); \ + } \ } diff --git a/v7/src/microcode/sgraph_a.c b/v7/src/microcode/sgraph_a.c index e0f598a44..0a06301fb 100644 --- a/v7/src/microcode/sgraph_a.c +++ b/v7/src/microcode/sgraph_a.c @@ -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]; 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); } Define_Primitive(Prim_Box_Move, 2, "BOX-MOVE") diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index a405d955d..f602d2a7d 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -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 diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index 33f84169c..dde93ba36 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -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