head     56.3;
access   paws bayes jws quist brad dew jwh cfb;
symbols  ;
locks    ; strict;
comment  @# @;


56.3
date     93.01.27.13.29.14;  author jwh;  state Exp;
branches ;
next     56.2;

56.2
date     93.01.27.12.06.51;  author jwh;  state Exp;
branches ;
next     56.1;

56.1
date     91.11.05.09.50.33;  author jwh;  state Exp;
branches ;
next     55.4;

55.4
date     91.11.04.15.13.51;  author jwh;  state Exp;
branches ;
next     55.3;

55.3
date     91.10.25.19.49.09;  author cfb;  state Exp;
branches ;
next     55.2;

55.2
date     91.10.10.09.00.16;  author cfb;  state Exp;
branches ;
next     55.1;

55.1
date     91.08.25.10.26.31;  author jwh;  state Exp;
branches ;
next     54.5;

54.5
date     91.08.21.13.20.52;  author jwh;  state Exp;
branches ;
next     54.4;

54.4
date     91.07.23.12.28.42;  author cfb;  state Exp;
branches ;
next     54.3;

54.3
date     91.07.11.08.57.54;  author cfb;  state Exp;
branches ;
next     54.2;

54.2
date     91.07.09.09.47.06;  author cfb;  state Exp;
branches ;
next     54.1;

54.1
date     91.03.18.15.29.47;  author jwh;  state Exp;
branches ;
next     53.1;

53.1
date     91.03.11.19.29.46;  author jwh;  state Exp;
branches ;
next     52.1;

52.1
date     91.02.19.09.13.46;  author jwh;  state Exp;
branches ;
next     51.1;

51.1
date     91.01.30.16.13.40;  author jwh;  state Exp;
branches ;
next     50.1;

50.1
date     90.10.29.16.28.30;  author jwh;  state Exp;
branches ;
next     49.1;

49.1
date     90.08.14.14.12.23;  author jwh;  state Exp;
branches ;
next     48.1;

48.1
date     90.07.26.11.18.39;  author jwh;  state Exp;
branches ;
next     47.1;

47.1
date     90.05.14.11.02.17;  author dew;  state Exp;
branches ;
next     46.1;

46.1
date     90.05.07.08.49.23;  author jwh;  state Exp;
branches ;
next     45.1;

45.1
date     90.04.19.15.57.19;  author jwh;  state Exp;
branches ;
next     44.1;

44.1
date     90.04.01.22.14.26;  author jwh;  state Exp;
branches ;
next     43.1;

43.1
date     90.03.20.14.06.25;  author jwh;  state Exp;
branches ;
next     42.1;

42.1
date     90.01.23.17.51.10;  author jwh;  state Exp;
branches ;
next     41.1;

41.1
date     89.12.22.11.33.12;  author jwh;  state Exp;
branches ;
next     40.1;

40.1
date     89.09.29.11.54.47;  author jwh;  state Exp;
branches ;
next     39.1;

39.1
date     89.09.26.16.39.21;  author dew;  state Exp;
branches ;
next     38.1;

38.1
date     89.08.29.11.31.23;  author jwh;  state Exp;
branches ;
next     37.1;

37.1
date     89.05.12.11.44.29;  author dew;  state Exp;
branches ;
next     36.1;

36.1
date     89.02.06.10.22.23;  author dew;  state Exp;
branches ;
next     35.1;

35.1
date     89.02.02.13.37.38;  author dew;  state Exp;
branches ;
next     34.1;

34.1
date     89.01.23.16.12.47;  author jwh;  state Exp;
branches ;
next     33.1;

33.1
date     89.01.16.11.44.31;  author dew;  state Exp;
branches ;
next     32.1;

32.1
date     89.01.10.11.53.28;  author bayes;  state Exp;
branches ;
next     31.1;

31.1
date     88.12.14.18.14.30;  author bayes;  state Exp;
branches ;
next     30.1;

30.1
date     88.12.09.13.51.25;  author dew;  state Exp;
branches ;
next     29.1;

29.1
date     88.10.31.15.36.18;  author bayes;  state Exp;
branches ;
next     28.1;

28.1
date     88.10.06.11.02.43;  author dew;  state Exp;
branches ;
next     27.1;

27.1
date     88.09.29.11.42.45;  author bayes;  state Exp;
branches ;
next     26.1;

26.1
date     88.09.28.13.20.32;  author bayes;  state Exp;
branches ;
next     25.2;

25.2
date     88.03.30.09.12.21;  author bayes;  state Exp;
branches ;
next     25.1;

25.1
date     88.03.02.09.36.46;  author bayes;  state Exp;
branches ;
next     24.1;

24.1
date     87.08.31.10.01.44;  author jws;  state Exp;
branches ;
next     23.1;

23.1
date     87.08.26.10.39.57;  author bayes;  state Exp;
branches ;
next     22.1;

22.1
date     87.08.17.11.25.27;  author bayes;  state Exp;
branches ;
next     21.1;

21.1
date     87.08.12.14.08.05;  author bayes;  state Exp;
branches ;
next     20.1;

20.1
date     87.07.30.11.21.51;  author bayes;  state Exp;
branches ;
next     19.1;

19.1
date     87.06.01.08.35.19;  author jws;  state Exp;
branches ;
next     18.1;

18.1
date     87.05.20.15.37.38;  author bayes;  state Exp;
branches ;
next     17.1;

17.1
date     87.04.30.10.46.27;  author jws;  state Exp;
branches ;
next     16.1;

16.1
date     87.04.26.15.57.48;  author jws;  state Exp;
branches ;
next     15.1;

15.1
date     87.04.13.09.35.23;  author jws;  state Exp;
branches ;
next     14.1;

14.1
date     87.04.01.15.42.07;  author jws;  state Exp;
branches ;
next     13.1;

13.1
date     87.02.28.18.42.08;  author jws;  state Exp;
branches ;
next     12.1;

12.1
date     87.02.02.13.33.52;  author jws;  state Exp;
branches ;
next     11.1;

11.1
date     87.01.19.10.00.14;  author jws;  state Exp;
branches ;
next     10.1;

10.1
date     86.12.24.11.11.09;  author jws;  state Exp;
branches ;
next     9.1;

9.1
date     86.12.12.14.54.37;  author bayes;  state Exp;
branches ;
next     8.1;

8.1
date     86.11.27.12.08.36;  author jws;  state Exp;
branches ;
next     7.1;

7.1
date     86.11.20.14.11.57;  author hal;  state Exp;
branches ;
next     6.2;

6.2
date     86.11.19.17.04.17;  author bayes;  state Exp;
branches ;
next     6.1;

6.1
date     86.11.04.18.12.25;  author paws;  state Exp;
branches ;
next     5.2;

5.2
date     86.10.29.14.22.29;  author geli;  state Exp;
branches ;
next     5.1;

5.1
date     86.10.28.17.00.47;  author hal;  state Exp;
branches ;
next     4.1;

4.1
date     86.09.30.19.57.25;  author hal;  state Exp;
branches ;
next     3.3;

3.3
date     86.09.26.12.44.15;  author hal;  state Exp;
branches ;
next     3.2;

3.2
date     86.09.24.11.10.24;  author hal;  state Exp;
branches ;
next     3.1;

3.1
date     86.09.01.12.07.47;  author hal;  state Exp;
branches ;
next     2.1;

2.1
date     86.07.30.14.56.29;  author hal;  state Exp;
branches ;
next     1.1;

1.1
date     86.06.30.15.51.51;  author danm;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


56.3
log
@
pws2rcs automatic delta on Wed Jan 27 13:14:25 MST 1993
@
text
@{                                                                           }
{ Graphics Low End                                                          }
{                                                                           }
{ Module    = GLE_RAS_OUT                                                   }
{ Programer = BJS                                                           }
{ Date      = 11-05-82                                                      }
{                                                                           }
{ Purpose: To provide device handler routines for raster devices.           }

{ Rev history                                                               }
{  Created  - 11-05-82                                                      }
{  Modified - 02-14-84  BDS  (added code for gator black/white)             }

{     (c) Copyright Hewlett-Packard Company, 1985.
      All rights are reserved.  Copying or other
      reproduction of this program except for archival
      purposes is prohibited without the prior
      written consent of Hewlett-Packard Company.


		  RESTRICTED RIGHTS LEGEND

      Use, duplication, or disclosure by the Government
      is subject to restrictions as set forth in
      paragraph (b) (3) (B) of the Rights in Technical
      Data and Computer Software clause in
      DAR 7-104.9(a).

      HEWLETT-PACKARD COMPANY
      Fort Collins, Colorado                              }

$search 'GLE_TYPES',
	'GLE_STEXT',
	'ASM_STEXT',
	'GLE_SCLIP',
	'ASM_SCLIP',
	'GLE_SMARK',
	'GLE_AUTL',
	'RGL'$
$modcal$ $TABLES OFF$
$include 'OPTIONS.'$       { ****************** COMPILER OPTIONS ********************** }
$linenum 8000$
$DEBUG OFF$

module gle_ras_out;

import gle_types,sysglobals,sysdevs,gle_aras_out;

export

procedure gle_init_raster_output (  gcb : graphics_control_block_ptr);
procedure gator_clear ( gcb : graphics_control_block_ptr );
PROCEDURE BOBCAT_CLEAR( GCB : GRAPHICS_CONTROL_BLOCK_PTR );

type
  raster_byte = 0..255;
  raster_code_space = packed array[1..240] of raster_byte;
  dither_type = packed array [0..15] of raster_byte;
  cmap_def = packed record
	       map_red : gle_shortint;
	       map_grn : gle_shortint;
	       map_blu : gle_shortint;
	     end;

  system_cmap_def = packed array [0..255] of cmap_def;


  raster_device_rec_ptr = ^ raster_device_rec;
  raster_device_rec =
    record
      addr1           : anyptr   ;
      addr2           : anyptr   ;
      addr3           : anyptr   ;
      n3              : gle_shortint ;
      devicetype      : gle_shortint ;
      deviceaddress   : integer  ;
      monitortype     : gle_shortint ;
      plane1_addr     : anyptr   ;
      plane1_offset   : integer  ;
      plane2_offset   : integer  ;
      plane3_offset   : integer  ;
      n_glines        : gle_shortint ;
      gspacing        : gle_shortint ;
      bytesperline    : gle_shortint ;
      hard_xmax       : gle_shortint ;
      hard_ymax       : gle_shortint ;
      red_intensity   : gle_shortint ;
      grn_intensity   : gle_shortint ;
      blu_intensity   : gle_shortint ;
      dither_pattern  : dither_type;
      cursor_x        : gle_shortint ;
      cursor_y        : gle_shortint ;
      area_draw_mode  : gle_shortint ;
      pen_draw_mode   : gle_shortint ;
      linepattern     : gle_shortint ;
      pen_number      : gle_shortint ;
      cpen            : gle_shortint ;
      oldpattern      : gle_shortint ;
      rgltemp1        : integer  ;
      rgltemp2        : integer  ;
      rgltemp3        : integer  ;
      rgltemp4        : integer  ;
      rgltemp5        : integer  ;
      repeatrate      : gle_shortint ;
      repeatcount     : gle_shortint ;
      index           : integer  ;
      softvec         : raster_code_space  ;
      system_cmap         : system_cmap_def;
     {brightness_sequence : packed array [0..255] of gle_shortint;}
     {count               : packed array [0..255] of gle_shortint;}
      cmap_address    : integer;
    end;

const
  packed_pixel_odd_byte_display  = 0;
  packed_pixel_display           = 1;
  packed_pixel_3_plane_display   = 2;
  byte_per_pixel_display         = 3;
  gator_display                  = 4;
  gatorbox_display               = 5;
  bobcat_display                 = 6;
  bobcat_lores_display           = 7;
  catseye_display                = 8;
  catseye_hrx_display            = 9;
  woodcut_vga_display            = 10;
  woodcut_med_display            = 11;
  woodcut_hrx_display            = 12;
  woodcut_vgam_display           = 13;                         { CFB - 30JUL91 }
  woodcut_hrxm_display           = 14;                         { CFB - 30JUL91 }

  dominant                       = 3;
  erase                          = 0;
  non_dominant                   = 7;
  compliment                     = 10;
  clr_with_LM                    = 128;
  one_with_LM                    = 255;

implement

import gle_stext,
       gle_astext,
       gle_sclip,
       gle_asclip,
       gle_smark,
       gle_autl;

type
  word_array = packed array[1..maxint] of gle_shortint;
  fixed_word_array = array [0..13] of gle_shortint;
  map_array = array[1..maxint] of integer;
  wd_ptr = ^word_array;
  byte_array = packed array [0..maxint] of raster_byte;

type
  gboxstatreg2 = packed record  {gatorbox secondary status register layout}
		 enable_vg_intr, vg_intr,
		 enable_bm_intr, bm_busy,
		 enable_vsync_intr, vsync_intr,
		 not_hsync, enable_video :      boolean;
	      end;
  {ADDED GTCOLREG, BTCOLREG SFB 6/25/85}
  gboxreg     = (gwreg, ghreg, grreg, gbusyreg, gwpreg, gtcolreg);
  gboxregtype = array[gboxreg] of gle_shortint;
  bobreg      = (bwreg, bhreg, bwrreg, bprreg, bbusyreg, bwenreg,
		 bsxreg, bsyreg, bdxreg, bdyreg, bmovereg, btcolreg,
		 bfben0reg {added 2/9/88 - SFB} );
  bobregtype  = array[bobreg] of gle_shortint;

const
  gboxregs = gboxregtype[hex('5001'), hex('5003'), hex('5007'),
			 hex('0002'), hex('6009'), hex('68BD')];
  bobregs  = bobregtype [hex('4102'), hex('4106'), hex('40EE'), hex('40EA'),
			 hex('4044'), hex('4090'),
			 hex('40F2'), hex('40F6'), hex('40FA'), hex('40FE'),
			 hex('409C'), hex('60BC'),
			 hex('4500') {added 2/9/88 - SFB} ];
var
  fb_ptr : ^byte_array;
  fb_ptr_ptr : ^integer;
  topmask : gle_shortint;       {used to store copy of gle_gcb^. gamut, if
			bobcat type display. Note--topmask should be set to
			0 before accessing any topcat registers, so we know
			windowmover need not be tested for ready. Once we
			are ready to do window moves, should set topmask to
			gle_gcb^.gamut, so bobmoveready works!! This sequence
			is implemented by setup_bobcat.}

{const}
  {init_crt = fixed_word_array [22,16,21,01,48,11,48,48,0,15,0,0,0,0 ];{17"}
  {init_crt = fixed_word_array [20,16,17,2,48,11,48,48,0,15,0,0,0,0 ];{19"}
{init_crt = fixed_word_array [20,16,16,4,48,11,48,48,0,15,0,0,32,0 ];{17"-NEW}


PROCEDURE wait_ready;

BEGIN
  REPEAT
  UNTIL status^.notbusy
END;

PROCEDURE set_rule ( rule : INTEGER );

BEGIN
  replregcopy := rule;
  wait_ready;
  rule_reg^ := rule;
END;

PROCEDURE set_width ( width : INTEGER );

BEGIN
  windowregcopy := width;
  wait_ready;
  width_reg^ := width;
END;



{gator_fill_index_color actually prepares dither_pattern for both
 gator_display, and all bobcat_displays.}

procedure gator_fill_index_color ( gcb : graphics_control_block_ptr );

type
     dpt1 = packed array [0..15] of boolean;
     dpt2 = packed array [0..16] of dpt1;
var
     i : integer;
     j : integer;

     r : integer;
     g : integer;
     b : integer;

const
     t = true;
     f = false;
     dp = dpt2[dpt1[f,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, f,f,t,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,f,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,t],
	       dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,f,f,t],
	       dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,t,f,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,f,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,t,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, t,t,t,t],
	       dpt1[t,f,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,f,t,t, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,t,t,t, t,t,t,t],
	       dpt1[t,t,t,t, t,t,t,t, t,t,t,t, t,t,t,t]];

begin
  with gcb^,raster_device_rec_ptr(dev_dep_stuff)^ do
    begin
      if info1 = 0 then                    {set up dither pattern}
	begin
	  r := info2;
	  g := info3;
	  b := info4;

	  current_polygon_red := r;
	  current_polygon_green := g;
	  current_polygon_blue := b;

	  r := (r+32) div 64;
	  g := (g+32) div 64;
	  b := (b+32) div 64;

	  red_intensity := r;
	  grn_intensity := g;
	  blu_intensity := b;

	  i:=r;
	  if i<g then i:=g;
	  if i<b then i:=b;

	  for j:=0 to 15 do dither_pattern[j]:=0;
	  for j:=0 to 15 do if dp[i,j] then dither_pattern[j]:=1;

	  if devicetype = gator_display then
	   store_dit(gcb);
	  end
      else
      if info1 = 1 then
	begin
	  for i := 0 to 15 do
	     dither_pattern[i] := info2;
	  if devicetype = gator_display then
	   store_dit(gcb);
	end;

    end;
end;

procedure gator_clear ( gcb : graphics_control_block_ptr );

var i : integer;

begin
  if gcb^.info2 = 0 then set_rule(clr_with_LM)
  else                   set_rule(one_with_LM);
  set_width(-1024);
  with gcb^,raster_device_rec_ptr(dev_dep_stuff)^ do
    begin
      for i := 0 to hard_ymax do           {fix to allow for changing ymax}
	begin
	  wait_ready;
	  fb_ptr^ [i*1024] := 0;
	end;
    end;
  set_rule(dominant);
end;

function romval(offset:gle_shortint) : gle_shortint;
var temp : gle_shortint;
    ptr  : ^char;
begin
 ptr    := anyptr(control_space + offset);
 temp   := ord(ptr^) * 256;
 ptr    := anyptr(control_space + offset + 2);
 romval := temp + ord(ptr^);
end;

{ wait for gatorbox blockmover to go ready }
procedure waitgboxmoveready;
var regptr : ^gboxstatreg2;
begin
 regptr := anyptr(control_space + gboxregs[gbusyreg]);
 while regptr^.bm_busy do ;   { bit 4 = 0 => blockmover ready }
end;

{ read any gatorbox register that requires blockmover not busy }
function readgboxreg(reg : gboxreg) : gle_shortint;
var regptr : ^char;
begin
 regptr := anyptr(control_space + gboxregs[reg]);
 waitgboxmoveready;
 readgboxreg := ord(regptr^);
end;

{ write any gatorbox register that requires blockmover not busy }
procedure setgboxreg(reg : gboxreg; value : gle_shortint);
var regptr : ^char;
begin
 regptr := anyptr(control_space + gboxregs[reg]);
 waitgboxmoveready;
 regptr^ := chr(value);
end;

{ sets gatorbox DGL area using tiler, as follows: }
{ if info1 =-1, info2 = 0       clear display to all 0 pixels}
{ if info1 =-1, info2 = n       set display to all n-value pixels}
{ if info1 =n,  info2 = 0       clear only planes with 1 bits in n,
  (n >= 0) note that info1 = 0 really means all planes!}
{ other combinations not supported}
{ does not save previous values of gatorbox registers used !! }
procedure gatorbox_clear( gcb : graphics_control_block_ptr );
var depth  : integer;
    savesc : integer;
begin
 writeregcopy := 0;
 with gcb^ do
  if info1 > 0 then
   writeregcopy := (255-info1) mod 256; { so interrupt can restore
					  non-readable wp register }
 TRY    {in case STOP is hit or other error, can restore gatorbox regs}
  depth := 256 - (raster_device_rec_ptr(gcb^.dev_dep_stuff)^.n_glines div 4);
  setgboxreg(gwpreg,writeregcopy);{ write enable all planes }
  setgboxreg(grreg,128+64);       { set replacement rule to rule 0, tile down }
  setgboxreg(ghreg,depth);        { set height to tiles for n_glines }
  setgboxreg(gwreg,0);            { set width to 256 tiles }
  waitgboxmoveready;
  fb_ptr^[0] := fb_ptr^[0];       { start the tiler move }
  with gcb^ do
  if info2 <> 0 then
   begin
    setgboxreg(grreg,128+64+15); { set replacement rule to rule 15, tile down }
    writeregcopy := 255-info2;   { protect only planes 0 in info2 }
    setgboxreg(gwpreg, writeregcopy);
    waitgboxmoveready;
    fb_ptr^[0] := fb_ptr^[0];
   end;

  writeregcopy := 0;
  setgboxreg(gwpreg,0);           { write enable all planes }
  setgboxreg(grreg,3);            { set replacement rule to "idle"--no tile,
				    dominant }
 RECOVER        {restore gatorbox registers to "idle" state before exiting, if
		 some kind of escape}
  begin
   try
    savesc := escapecode;
    writeregcopy := 0;
    setgboxreg(gwpreg,0);
    setgboxreg(grreg,3);
   recover;
   escape(savesc);
  end;
end;

{ wait for bobcat windowmover to go ready }
procedure waitbobmoveready;
var regptr : ^gle_shortint;
    temp   : gle_shortint;
begin
 if topmask <> 0 then {while topmask still 0, not doing any ops requiring wait}
  begin
   regptr := anyptr(control_space + bobregs[bbusyreg]);
   repeat               {do it slowly, so as not to interrupt topcats too much}
    temp := regptr^;
    temp := gle_iand(temp,256*topmask);
    temp := gle_ishift(temp,-8);
   until temp = 0;
  end;
end;

{ read any bobcat register (may require windowmover not busy) }
function readbobreg(reg : bobreg) : integer;
var regptr : ^gle_shortint;
begin
 regptr := anyptr(control_space + bobregs[reg]);
 waitbobmoveready;
 readbobreg := regptr^;
end;

{ write any bobcat register (may require windowmover not busy) }
procedure setbobreg(reg : bobreg; value : integer);
var regptr : ^gle_shortint;
begin
 regptr := anyptr(control_space + bobregs[reg]);
 waitbobmoveready;
 regptr^ := gle_iand(value, hex('ffff'));
end;

{ sets Bobcat DGL area using windowmover, as follows: }
{ if info1 =-1, info2 = 0       clear display to all 0 pixels}
{ if info1 =-1, info2 = n       set display to all n-value pixels}
{ if info1 =n,  info2 = 0       clear only planes with 1 bits in n,
  (n >= 0) note that info1 = 0 really means all planes!}
{ other combinations not supported}
{ does not save previous values of bobcat registers used !! }

procedure bobcat_clear( gcb : graphics_control_block_ptr );
var planes_to_clear : gle_shortint;
    savesc          : integer;
begin
 TRY    {in case STOP is hit or other error, can restore bobcat regs}
  with gcb^ do
   if info1 <> 0 then             {write enable appropriate planes}
    planes_to_clear := info1 MOD (gamut+1)
   else
    planes_to_clear := gamut;
  setbobreg(bwrreg,0);            { set window replacement rule to rule 0}
  setbobreg(bwreg,romval(13));    { set width to visible display width }
{ Below is bugfix for the "clear typeahead pixels" bug SFB 9-27-86 }
{ setbobreg(bhreg,romval(17));    { set height to visible display height }
  setbobreg(bhreg,raster_device_rec_ptr(gcb^.dev_dep_stuff)^.n_glines);
  setbobreg(bsxreg,0);            { set window source x reg to 0 }
  setbobreg(bsyreg,0);            { set window source y reg to 0 }
  setbobreg(bdxreg,0);            { set window destination x reg to 0 }
  setbobreg(bdyreg,0);            { set window destination y reg to 0 }
  setbobreg(bfben0reg,planes_to_clear*256); {added for CATSEYE due to difference
					     from Topcat - SFB 2/9/88 }
  setbobreg(bmovereg,planes_to_clear*256); { trigger window move }

  {below is bugfix for mono display clear_display SFB 9/16/86}
  with gcb^ do
  if info2 <> 0 then    {we're asked to setframe buffer to value info2}
   begin
    setbobreg(bwrreg, 15);          { write 1s}
    setbobreg(bfben0reg,info2*256); {added for CATSEYE due to difference from
				     Topcat - SFB 2/9/88 }
    setbobreg(bmovereg, info2*256); { trigger window move }
   end;

  setbobreg(bwrreg,3);            { restore window replacement rule to rule 3 }
 RECOVER        {restore bobcat registers to "idle" state before exiting, if
		 some kind of escape}
  begin
   try
    savesc := escapecode;
    setbobreg(bwrreg,3);
    setbobreg(bwenreg,hex('ff'));
   recover;
   escape(savesc);
  end;
end;

procedure setup_gator(gcb : graphics_control_block_ptr);

var
  color_list : packed array [0..47] of gle_shortint;
  i : integer;

begin
  set_6845s (gcb);
  status^.bit0 := write_to_status;
  i := 0;
  with gcb^ do
    begin
      info1 := 0;
      info2 := 1;
      info_ptr1 := addr(color_list);
      call (define_color_map,gcb);
    end;
  set_rule(dominant);
end;

procedure setup_gatorbox(gcb : graphics_control_block_ptr);

const blinkrega = hex('6001');
      blinkregb = hex('6005');
type
 aptrtype = ^anyptr;
var
  ptr : ^char;
begin
  {NOTE - cannot guarantee access to frame buffer will not cause DTACK error
   until set_6845s has executed ! Normally would set gamut in rgcbinit, but
   due to need to run rgcbinit BEFORE set_6845s, kluge it here.}


  set_6845s (gcb);

  { next compute gamut by seeing which frame buffer planes are loaded }
  setgboxreg(grreg,dominant);    {tiler off, dominant}
  writeregcopy := 0;
  setgboxreg(gwpreg,0);          {write enable all planes}

  {set ptr to point to last location in framebuffer}
  with raster_device_rec_ptr(gcb^.dev_dep_stuff)^ do
   begin        {added setup of monitortype SFB 6/11/85}
    monitortype := gcb^.info4;
    if monitortype = 0 then     {SFB 6/25/85}
     setgboxreg(gtcolreg,0);
    ptr := anyptr(integer(aptrtype(plane1_addr)^) + 1024*1024 - 1);
   end;
  ptr^ := #255;            {write 1s to 8 potential planes}
  gcb^.gamut := ord(ptr^); {unloaded planes return 0s - planes MUST be loaded
			    in sequence from plane 0 to plane n (n<=7) }
  with gcb^ do
   begin
    ptr := anyptr(info2+blinkrega);     {now enable blink registers}
    ptr^:= chr(gamut);                  {could not do before because we did}
    ptr := anyptr(info2+blinkregb);     {know which planes to enable--gamut}
    ptr^:= chr(gamut);                  {now contains this info}
   end;
end;    {leaving 8 planes write enabled}

procedure setup_bobcat(gcb : graphics_control_block_ptr);
const
 planemask = hex('60ba');
 nblank    = hex('4080');
type
 aptrtype = ^anyptr;
 planes_mask_type = packed array[1..8] of char;
const
 planes_mask = planes_mask_type[#1, #3, #7, #15, #31, #63, #127, #255];
var
  cptr: ^char;
  ptr : ^gle_shortint;
  w,h : gle_shortint;
  numplanes : integer;

begin
  topmask := 0;  {until topmask < > 0, DO NOT do bobcat operations which
		  require wait on windowmover!!}

  {NOTE - cannot guarantee access to frame buffer will not cause DTACK error
   until set_6845s has executed ! Normally would set gamut in rgcbinit, but
   due to need to run rgcbinit BEFORE set_6845s, kluge it here.}

  {Following test added to prevent traversal of graphics "ID" ROM for CATSEYEs.
   This is needed to support the "suppress display clear" value (bit 7) of the
   control word in display_init... We trust that either we are not running
   CATSEYE (hence the test) in which case set_6845s is called and doesn't clear,
   or that the BOOTROM has traversed the ID ROM at boot time. Rev C and later
   BOOTROMs guarantee to do this, and CATSEYE is not supported on earlier
   BOOTROMs except for LCC in 310/320. On 310/320, the display will have been
   initialized because LCC (any CATSEYE actually) can only reside at $560000 in
   DIO I space, and all bitmap-capable BOOTROMs initialize with the ID ROM for
   this select code. CATSEYE can only be address-switched in DIO II space, which
   is not supported on SPUs with pre-rev C BOOTROMs. SFB}

  with gcb^ do
   if (info1<>mcatseye) and (info1<>mcatseye_hrx) then   {SFB}
    set_6845s (gcb);

  setbobreg(bprreg,dominant*256); {pixel replacement rule dominant (in MSB)}
   setbobreg(bwenreg,-256 {hex('ff00')} );       {write enable all planes}

  {now find gamut == plane mask == number of planes loaded}

  with gcb^, raster_device_rec_ptr(dev_dep_stuff)^ do
   begin
    cptr := anyptr(info2 + hex('5b'));
    if cptr^ <> #0 then  {ID location $5b contains number of planes}
      gamut := ord(planes_mask[ord(cptr^)])
    else
     begin     {have to sort out for ourselves which planes are loaded}
      { compute gamut by seeing which frame buffer planes are loaded }
      w := romval(hex('5'));    {find frame buffer width, height}
      h := romval(hex('9'));

      {set ptr to point to last location in framebuffer--it's offscreen}
      cptr := anyptr(integer(aptrtype(plane1_addr)^) + w*h - 1);
      cptr^ := #255;           {write 1s to 8 potential planes}
      gamut := ord(cptr^); {unloaded planes return 0s - planes MUST be loaded
			    in sequence from plane 0 to plane n (n<=7) }
      end;
    ptr := anyptr(info2+nblank);        {enable NBLANK register}
    ptr^:= 256*gamut;
    if color_map_support <> 0 then
     begin
      setbobreg(btcolreg, 0);       {SFB 7/10/85}
      ptr := anyptr(info2+planemask);     {now enable cmap planemask register}
      ptr^:= gamut;
     end;
    topmask := gamut;   {now can do windowmover operations, as we know gamut}
   end;
end;

procedure setup_woodcut(gcb : graphics_control_block_ptr);         {CFB 12JUN91}
const
    planemask = hex('6061A');                                  {lower two bytes}
type
    aptrtype = ^anyptr;
    planes_mask_type = packed array[1..8] of char;
const
    planes_mask = planes_mask_type[#1, #3, #7, #15, #31, #63, #127, #255];
var
    cptr      : ^char;
    ptr       : ^gle_shortint;
    w,h       : gle_shortint;
    numplanes : integer;

begin
  {now find gamut == plane mask == number of planes loaded}

  with gcb^, raster_device_rec_ptr(dev_dep_stuff)^ do
  begin
    cptr := anyptr(info2 + hex('5b'));
    gamut := ord(planes_mask[ord(cptr^)]);
    if color_map_support <> 0 then
    begin
      ptr := anyptr(info2+planemask);     {now enable cmap planemask register}
      ptr^:= gamut*256+gamut;
     end;
   topmask := gamut;
   end;
end;

procedure bobcat_fill_index_color( gcb : graphics_control_block_ptr );
label 1;
type
    aptrtype = ^anyptr;
    four_row_array = packed array[0..3,0..1023] of char;

var
    move_width,
    first_fill_row,
    i,nmoves        : gle_shortint;
    fill_area       : ^four_row_array;

begin           { SFB 2-27-85 }

  with gcb^, raster_device_rec_ptr(dev_dep_stuff)^ do
  begin
    if gamut<>1 then
      rfill_index_color( gcb )      {set up dither_pattern with fill pattern}
    else
      gator_fill_index_color( gcb );


  if (devicetype = catseye_display) or (devicetype = catseye_hrx_display) then
  begin
    dither_to_pattregs( gcb );
    goto 1;
  end;
  {will use TRR, not offscreen Framebuf to hold
   area fill pattern. See rfill_index_color in
   RGL - SFB 2/9/88}


  {now get pointer to last four pixel rows on screen, by using rgl info
   on start of frame buffer and ID ROM info on height of frame buffer}

  first_fill_row := romval(9) - 4;  {fourth last framebuf row}
  fill_area := anyptr(integer(aptrtype(plane1_addr)^) + first_fill_row*1024);

  setbobreg(bwenreg, 256*gamut);
  setbobreg(bprreg,  256*3);

  if devicetype = bobcat_display then
  begin
    for i:=0 to 15 do    {copy dither_pattern to offscreen area at left edge}
      fill_area^[i div 4, i mod 4] := chr(dither_pattern[i]);
    nmoves := 7;
    move_width := 4;
  end;

  if devicetype = bobcat_lores_display then
  begin
    for i:=0 to 15 do    {copy dither_pattern to offscreen area at left edge}
    begin
      fill_area^[i div 4, (i mod 4)*2    ] := chr(dither_pattern[i]);
      fill_area^[i div 4, (i mod 4)*2 + 1] := chr(dither_pattern[i]);
    end;
    nmoves := 6;
    move_width := 8;
  end;

   {now use window mover to replicate fill cell across full width of frame buf}
  setbobreg(bhreg, 4);
  setbobreg(bsxreg, 0);
  setbobreg(bsyreg, first_fill_row);
  setbobreg(bdyreg, first_fill_row);
  setbobreg(bwrreg, 3);

  for i := 0 to nmoves do
  begin
    setbobreg(bwreg, move_width);
    setbobreg(bdxreg, move_width);       {destination x always = width because
					  it's a geometric sequence with r=2}
    setbobreg(bmovereg, 256*gamut);      {do the move}
    move_width  := move_width * 2;       {move twice as many next time}
  end;
end;  {with}
1:end;

procedure rdummy_proc (  gcb : graphics_control_block_ptr );
begin
end;

procedure rget_polygon_info (  gcb : graphics_control_block_ptr );

begin            { only solid fill supported }
  with gcb^ do
    if info2 = polygon_solid_fill then error_return := 0
    else                               error_return := 1;
end;

procedure rdefine_color_map (  gcb : graphics_control_block_ptr );

type
  packed_color_map_def = packed array [0..15] of gle_shortint;
  color_map_ptr = ^packed_color_map_def;
  color_data_def = packed array [0..3*256-1 {47}] of gle_shortint;
  color_data_ptr_def = ^color_data_def;

var
  color_map : color_map_ptr;
  temp_color_map : packed_color_map_def;
  n,i : gle_shortint;
  temp : integer;
  brt : array [0..255 {15}] of integer;
  color_data_ptr : color_data_ptr_def;
  packed_map : boolean;

begin
  with gcb^,raster_device_rec_ptr(dev_dep_stuff)^ do
  begin
    packed_map := true;
    if   (display_name = '98700A')    {gbox or any bobcat SFB 6/11/85}
      or (display_name = '98542A') or (display_name = '98543A')
      or (display_name = '98544A') or (display_name = '98545A')
      or (display_name = '98547A') or (display_name = '98548A')      {SFB}
      or (display_name = '98549A') or (display_name = '98550A')      {SFB}
      or (display_name = 'E640  ') or (display_name = 'E1024 ')    {CFB 30JUL91}
      or (display_name = 'E1280 ') or (display_name = 'E640G ')    {CFB 30JUL91}
      or (display_name = 'E1280G') then                            {CFB 30JUL91}
      packed_map := false;
    color_data_ptr := info_ptr1;
    for i := info1 to info2 do
      with system_cmap[i] do
      begin
	n := (i - info1)*3;
	map_red := color_data_ptr^[n];
	map_grn := color_data_ptr^[n+1];
	map_blu := color_data_ptr^[n+2];
	if packed_map then
	  temp_color_map[i] := (15-map_red div 64)*256 +
			       (15-map_grn div 64) * 16 +
			       (15-map_blu div 64);
      end;

    if color_map_support = yes then
    begin
      color_map := anyptr(cmap_address);
      if packed_map then
      begin
	rawait_blanking(gcb);
	for i := info1 to info2 do
	  color_map^[i] := temp_color_map[i];
      end
      else { unpacked map }
      for i:= info1 to info2 do
      with system_cmap[i] do
      begin
	info2 := map_red div 4;
	info3 := map_grn div 4;
	info4 := map_blu div 4;
	if display_name = '98700A' then
	begin   {GATORBOX}
	  info1 := i;
	  if monitortype = 3 then   {discrete colormap SFB 6/11/85}
	    setgboxcmap(gcb)
	  else
	    set_nereid(gcb);      {SFB 6/11/85}
	end
	else                              { WOODCUT support CFB 12JUN91 }
	if (display_name = 'E640  ') or (display_name = 'E1024 ')
	or (display_name = 'E1280 ') or (display_name = 'E640G ')
	or (display_name = 'E1280G') then
	begin
	  info1 := i;
	  set_wood_cmap(gcb);
	end
	else
	begin   {BOBCAT}
	  info1 := 255-i;
	  set_nereid(gcb);
	end;
      end;
    end;
      {We now calculate brightness sequence on the fly in RGL, when setting
       up to fill a polygon. The reason to do this is that, with color maps
       now having up to 256 elements, the sorting takes too long to do each
       time we change color map, so we do it only when it's relevant, during
       polygon fill setup. That's why the code is no longer here.}
  end;
end;

procedure gle_init_raster_output (  gcb : graphics_control_block_ptr);

var
  cnt : gle_shortint;
  tempinfo3{, tempinfo1}: integer;       {SFB 9/09/86}

begin
  with gcb^,raster_device_rec_ptr(dev_dep_stuff)^ do
    begin
      tempinfo3 := info3;  {KLUGE TO ALLOW EXPANSION OF COLORMAP DISPLAY - SFB}

     {tempinfo1 := info1;
      if info1 = mcatseye then {fake it for rgcbinit SFB 9/09/86
       info1 := mbobcat;}       {removed as rgcbinit is fixed - SFB 2/9/88}

      if (info1 = mgatorbox) then
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + gboxregs[grreg]-1);
	   width_reg := anyptr(info2 + gboxregs[gwreg]-1);
	   status := anyptr(info2 + 2); { secondary gatorbox intr reg }
	   info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
						COLORMAP BASE ADDRESS}
	   crt := nil;
	   ww_reg := anyptr(info2 + gboxregs[gwreg]-1);
	end;
      if (info1=mbobcat) or (info1=mbobcatlores)
      or (info1=mcatseye {SFB}) or (info1=mcatseye_hrx {SFB}) then
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + bobregs[bprreg]); {pixel rule reg}
	   width_reg := anyptr(info2 + bobregs[bwreg]); {window width reg}
	   status := anyptr(info2 + bobregs[bbusyreg]); {windowmover busy reg}
	   info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
						COLORMAP BASE ADDRESS}
	   if info2=info3 then
	    info3 := 0;                        {SET CMAP_ADDRESS TO 0 IF THERE
						IS NO COLORMAP}
	   crt := nil;
	   ww_reg := anyptr(info2 + bobregs[bwreg]);
	end;
      if (info1 = m9837a)  then
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + (hex('4008')));
	   width_reg := anyptr(info2 + (hex('400c')));
	   status := anyptr(info2 + (hex('4000')));
	   crt := anyptr(info2 + (hex('6000')));
	end;
      error_return := 0;

      rgcbinit ( gcb );

      info3 := tempinfo3; {NOW WE WANT INFO3 = EXPAND SCREEN SELECTION FOR
			   BITMAP DISPLAYS}
     {info1 := tempinfo1; {NOW LET DISPLAY NAME BE SET CORRECTLY SFB 9/09/86}

      move                 := rmove;
      draw                 := rdraw;
      clear                := rclear;
      text                 := gle_soft_text;
      clip_limits          := gle_soft_clip_limits;
      char_size            := gle_soft_char_size;
      text_spacing         := gle_soft_text_spacing;
      text_dir             := gle_soft_text_dir;
      text_just            := gle_soft_text_just;
      marker               := gle_soft_marker;
      marker_size          := gle_soft_marker_size;
      set_marker           := gle_soft_set_marker;
      index_color          := rset_color;
      linestyle            := rlinestyle;
      await_blanking       := rawait_blanking;
      linewidth            := rdummy_proc;
      inq_p1p2             := rget_p1p2;
      get_polygon_info     := rget_polygon_info;
      calc_soft_text_xform := gle_text_xform;
      fill_index_color     := rfill_index_color;
      graphics_on_off      := rgraphics_on_off;
      cursor               := rcursor;
      define_drawing_mode  := rdefine_drawing_mode;
      polygon              := rpolygon;
      define_color_map     := rdefine_color_map;
      buffer_mode          := rdummy_proc;
      output_escapei       := rdummy_proc;
      output_escapeo       := rdummy_proc;
      flush_buffer         := rdummy_proc;
      get_raster           := rget_raster;

      soft_font_ptr        := addr(font);

      case info1 of
	munknown : { reserved } ;
	m9816a   : { 9816 }
	  begin
	    display_name := '9816A ';
	    display_name_char_count := 5;
	    display_res_x := 2.375;                { 168mm X 126mm }
	    display_res_y := 2.37301587301587;
	  end;
	m9826a :   { 9826 }
	  begin
	    display_name := '9826A ';
	    display_name_char_count := 5;
	    display_res_x := 3.325;                { 120mm X 90mm }
	    display_res_y := 3.322222222222222;
	  end;
	m9836a : { 9836 }
	  begin
	    display_name := '9836A ';
	    display_name_char_count := 5;
	    display_res_x := 2.433333333333333;     { 210mm X 160mm }
	    display_res_y := 2.43125;
	  end;
	m9836c : { 9836C }
	  begin
	    display_name := '9836C ';
	    display_name_char_count := 5;
	    display_res_x := 2.35483870967742;     { 217mm X 163mm }
	    display_res_y := 2.38650306748466;
	  end;
	m98627a : { 98627 }
	  begin
	    display_name := '98627A';
	    display_name_char_count := 6;
	    deviceaddress := info2;
	    display_res_x := 3.333333333333333;
	    display_res_y := 3.333333333333333;
	  end;
	m9837a : { Gator Black/White }
	  begin
	    display_name := '9837a ';
	    display_name_char_count := 5;

	    {GATOR CONSTANTS CORRECTED 4/15/85 SFB}
	    display_res_x := 3.27884; {1023/312}    { 312mm X  234mm }
	    display_res_y := 3.27778; {767/234}
	    if info3 = 1 then                      {added to detect current}
	     begin                                  {ymax.                  }
	       n_glines := 768;
	       hard_ymax := 767;
	     end;
	    await_blanking := rdummy_proc;
	    setup_gator(gcb);
	    clear := gator_clear;
	    fill_index_color := gator_fill_index_color;
	    define_color_map := rdummy_proc;
	  end;
	mgatorbox:  { Gatorbox SFB 4/15/85}
	  begin
	    display_name := '98700A';           {SFB 6/11/85}
	    display_name_char_count := 6;
	    display_res_x := 2.841667;             {360mm X  270mm +/- 1.5%}
	    display_res_y := 2.840740;
	    if info3 = 1 then                      {added to detect current}
	     begin                                 {ymax.                  }
	       n_glines := 768;
	       hard_ymax := 767;
	     end;
	    setup_gatorbox(gcb);
	    clear := gatorbox_clear;
	  end;
	mbobcat,mbobcatlores,mcatseye,mcatseye_hrx:         {Bobcat SFB 4/15/85}
						    {added MCATSEYE SFB 9/09/86}
	  begin
	    setup_bobcat(gcb);
	    clear := bobcat_clear;
	    display_name_char_count := 6;
	    fill_index_color := bobcat_fill_index_color;
	    if   (info1 = mbobcat) or (info1 = mcatseye)
	      or (info1 = mcatseye_hrx)  then { bobcat hires }
	    begin
	      {assume 98545/98547/98549 and change later if necessary. SFB}
	      display_res_x := 2.841666667;     {360mm X  270mm +/- 1.5%}
	      display_res_y := 2.840740741;
	      if pallette = 1 then
	       if info1=mbobcat then
		 begin                            {hires mono}
		  display_name := '98544A';       {SFB 6/11/85, BUGFIX 9/09/86}
		  display_res_x := 3.27884;       {same as GATOR}
		  display_res_y := 3.27778;
		 end
	       else
		 begin                            {hires mono CATSEYE}
		  display_name := '98548A';       {SFB 2/9/86}
		  display_res_x := 3.728862974;   {19 inch monitor default}
		  display_res_y := 3.733576642;
		 end
	      else      {pallette <> 1}
	       begin                              {hires color}
		if info1 = mbobcat then
		 if gamut = 15 then               {ADDED SFB 9/09/86}
		  display_name := '98545A'        {SFB 6/11/85}
		 else
		  display_name := '98547A'        {HEXAGON SFB 9/09/86}
		else
		 if gamut=63 then
		  display_name := '98549A'        {LCC}
		 else
		  begin
		   display_name := '98550A';
		   display_res_x := 3.728862974;  {19 inch monitor default}
		   display_res_y := 3.733576642;
		  end;
	       end;
	      if info3 = 1 then                   {added to detect current}
	       if (display_name<>'98548A') and (display_name<>'98550A') then
								{SFB 2/9/88}
		 begin                            {ymax.                  }
		   n_glines  := 768;
		   hard_ymax := 767;
		 end
	       else
		 begin                             {ymax.                  }
		   n_glines  := 1024;       {true (to date) hi-res - SFB 2/9/88}
		   hard_ymax := 1023;
		 end;
	     end        {if info1 = mbobcat or mcatseye}
	    else        { bobcat lores }
	     begin      {color and mono have same spec}
	      display_res_x := 2.433333;
	      display_res_y := 2.432926;
	      if pallette = 1 then       {SFB 6/11/85}
	       display_name := '98542A'
	      else
	       display_name := '98543A';       {BUGFIX SFB 9/09/86}
	      if info3 = 1 then
	       begin
		n_glines  := 400;
		hard_ymax := 399;
	       end;
	     end;
	  end;
	mvga_woodcut,                                 {added WOODCUT CFB 8JUN91}
	mvgam_woodcut:                                  {added MONO CFB 30JUL91}
	  begin
	    setup_woodcut(gcb);
	    if info1 = mvga_woodcut then
	    begin
	      display_name := 'E640  ';
	      display_name_char_count := 4;
	    end
	    else
	    begin
	      display_name := 'E640G ';
	      display_name_char_count := 5;
	    end;
	    display_res_x := 2.206896552;                     {~290x210mm (14")}
	    display_res_y := 2.285714286;
	    if info3 = 1 then
	    begin
	      n_glines  := 480;
	      hard_ymax := 479;
	    end;
	  end;
	mmed_woodcut:                                 {added WOODCUT CFB 8JUN91}
	  begin
	    setup_woodcut(gcb);
	    display_name := 'E1024 ';
	    display_name_char_count := 5;
	    display_res_x := 3.413333333;                      {300x225mm (16")}
	    display_res_y := 3.413333333;
	    if info3 = 1 then
	    begin
	      n_glines  := 768;
	      hard_ymax := 767;
	    end;
	  end;
	mhrx_woodcut,                                 {added WOODCUT CFB 8JUN91}
	mhrxm_woodcut:                                  {added MONO CFB 30JUL91}
	  begin
	    setup_woodcut(gcb);
	    if info1 = mhrx_woodcut then
	    begin
	      display_name := 'E1280 ';
	      display_name_char_count := 5;
	    end
	    else
	    begin
	      display_name := 'E1280G';
	      display_name_char_count := 6;
	    end;
	    display_res_x := 3.764705882;                      {340x272mm (19")}
	    display_res_y := 3.764705882;
	    if info3 = 1 then
	    begin
	      n_glines  := 1024;                 {changed from 1000 CFB 25OCT91}
	      hard_ymax := 1023;
	    end;
	  end;
	end; {of case }

      display_handler_name := 'RASTER';
      display_handler_char_count := 6;

      display_min_x := 0;
      display_min_y := 0;
      display_max_x := hard_xmax;
      display_max_y := hard_ymax;

      info1 := 0;
      info2 := display_max_x;
      info3 := 0;
      info4 := display_max_y;
      gle_soft_clip_limits ( gcb );  { set default clipping limits }

      pen_draw_mode := 0;
      area_draw_mode := 0;
      pen_number := 1;
      info1 := 1;
      rset_color(gcb);
    end;
end;

end. { output }

@


56.2
log
@
pws2rcs automatic delta on Wed Jan 27 11:57:27 MST 1993
@
text
@d1 1155
@


56.1
log
@Automatic bump of revision number for PWS version 3.25
@
text
@a0 1155
{                                                                           }
{ Graphics Low End                                                          }
{                                                                           }
{ Module    = GLE_RAS_OUT                                                   }
{ Programer = BJS                                                           }
{ Date      = 11-05-82                                                      }
{                                                                           }
{ Purpose: To provide device handler routines for raster devices.           }

{ Rev history                                                               }
{  Created  - 11-05-82                                                      }
{  Modified - 02-14-84  BDS  (added code for gator black/white)             }

{     (c) Copyright Hewlett-Packard Company, 1985.
      All rights are reserved.  Copying or other
      reproduction of this program except for archival
      purposes is prohibited without the prior
      written consent of Hewlett-Packard Company.


		  RESTRICTED RIGHTS LEGEND

      Use, duplication, or disclosure by the Government
      is subject to restrictions as set forth in
      paragraph (b) (3) (B) of the Rights in Technical
      Data and Computer Software clause in
      DAR 7-104.9(a).

      HEWLETT-PACKARD COMPANY
      Fort Collins, Colorado                              }

$search 'GLE_TYPES',
	'GLE_STEXT',
	'ASM_STEXT',
	'GLE_SCLIP',
	'ASM_SCLIP',
	'GLE_SMARK',
	'GLE_AUTL',
	'RGL'$
$modcal$ $TABLES OFF$
$include 'OPTIONS.'$       { ****************** COMPILER OPTIONS ********************** }
$linenum 8000$
$DEBUG OFF$

module gle_ras_out;

import gle_types,sysglobals,sysdevs,gle_aras_out;

export

procedure gle_init_raster_output (  gcb : graphics_control_block_ptr);
procedure gator_clear ( gcb : graphics_control_block_ptr );
PROCEDURE BOBCAT_CLEAR( GCB : GRAPHICS_CONTROL_BLOCK_PTR );

type
  raster_byte = 0..255;
  raster_code_space = packed array[1..240] of raster_byte;
  dither_type = packed array [0..15] of raster_byte;
  cmap_def = packed record
	       map_red : gle_shortint;
	       map_grn : gle_shortint;
	       map_blu : gle_shortint;
	     end;

  system_cmap_def = packed array [0..255] of cmap_def;


  raster_device_rec_ptr = ^ raster_device_rec;
  raster_device_rec =
    record
      addr1           : anyptr   ;
      addr2           : anyptr   ;
      addr3           : anyptr   ;
      n3              : gle_shortint ;
      devicetype      : gle_shortint ;
      deviceaddress   : integer  ;
      monitortype     : gle_shortint ;
      plane1_addr     : anyptr   ;
      plane1_offset   : integer  ;
      plane2_offset   : integer  ;
      plane3_offset   : integer  ;
      n_glines        : gle_shortint ;
      gspacing        : gle_shortint ;
      bytesperline    : gle_shortint ;
      hard_xmax       : gle_shortint ;
      hard_ymax       : gle_shortint ;
      red_intensity   : gle_shortint ;
      grn_intensity   : gle_shortint ;
      blu_intensity   : gle_shortint ;
      dither_pattern  : dither_type;
      cursor_x        : gle_shortint ;
      cursor_y        : gle_shortint ;
      area_draw_mode  : gle_shortint ;
      pen_draw_mode   : gle_shortint ;
      linepattern     : gle_shortint ;
      pen_number      : gle_shortint ;
      cpen            : gle_shortint ;
      oldpattern      : gle_shortint ;
      rgltemp1        : integer  ;
      rgltemp2        : integer  ;
      rgltemp3        : integer  ;
      rgltemp4        : integer  ;
      rgltemp5        : integer  ;
      repeatrate      : gle_shortint ;
      repeatcount     : gle_shortint ;
      index           : integer  ;
      softvec         : raster_code_space  ;
      system_cmap         : system_cmap_def;
     {brightness_sequence : packed array [0..255] of gle_shortint;}
     {count               : packed array [0..255] of gle_shortint;}
      cmap_address    : integer;
    end;

const
  packed_pixel_odd_byte_display  = 0;
  packed_pixel_display           = 1;
  packed_pixel_3_plane_display   = 2;
  byte_per_pixel_display         = 3;
  gator_display                  = 4;
  gatorbox_display               = 5;
  bobcat_display                 = 6;
  bobcat_lores_display           = 7;
  catseye_display                = 8;
  catseye_hrx_display            = 9;
  woodcut_vga_display            = 10;
  woodcut_med_display            = 11;
  woodcut_hrx_display            = 12;
  woodcut_vgam_display           = 13;                         { CFB - 30JUL91 }
  woodcut_hrxm_display           = 14;                         { CFB - 30JUL91 }

  dominant                       = 3;
  erase                          = 0;
  non_dominant                   = 7;
  compliment                     = 10;
  clr_with_LM                    = 128;
  one_with_LM                    = 255;

implement

import gle_stext,
       gle_astext,
       gle_sclip,
       gle_asclip,
       gle_smark,
       gle_autl;

type
  word_array = packed array[1..maxint] of gle_shortint;
  fixed_word_array = array [0..13] of gle_shortint;
  map_array = array[1..maxint] of integer;
  wd_ptr = ^word_array;
  byte_array = packed array [0..maxint] of raster_byte;

type
  gboxstatreg2 = packed record  {gatorbox secondary status register layout}
		 enable_vg_intr, vg_intr,
		 enable_bm_intr, bm_busy,
		 enable_vsync_intr, vsync_intr,
		 not_hsync, enable_video :      boolean;
	      end;
  {ADDED GTCOLREG, BTCOLREG SFB 6/25/85}
  gboxreg     = (gwreg, ghreg, grreg, gbusyreg, gwpreg, gtcolreg);
  gboxregtype = array[gboxreg] of gle_shortint;
  bobreg      = (bwreg, bhreg, bwrreg, bprreg, bbusyreg, bwenreg,
		 bsxreg, bsyreg, bdxreg, bdyreg, bmovereg, btcolreg,
		 bfben0reg {added 2/9/88 - SFB} );
  bobregtype  = array[bobreg] of gle_shortint;

const
  gboxregs = gboxregtype[hex('5001'), hex('5003'), hex('5007'),
			 hex('0002'), hex('6009'), hex('68BD')];
  bobregs  = bobregtype [hex('4102'), hex('4106'), hex('40EE'), hex('40EA'),
			 hex('4044'), hex('4090'),
			 hex('40F2'), hex('40F6'), hex('40FA'), hex('40FE'),
			 hex('409C'), hex('60BC'),
			 hex('4500') {added 2/9/88 - SFB} ];
var
  fb_ptr : ^byte_array;
  fb_ptr_ptr : ^integer;
  topmask : gle_shortint;       {used to store copy of gle_gcb^. gamut, if
			bobcat type display. Note--topmask should be set to
			0 before accessing any topcat registers, so we know
			windowmover need not be tested for ready. Once we
			are ready to do window moves, should set topmask to
			gle_gcb^.gamut, so bobmoveready works!! This sequence
			is implemented by setup_bobcat.}

{const}
  {init_crt = fixed_word_array [22,16,21,01,48,11,48,48,0,15,0,0,0,0 ];{17"}
  {init_crt = fixed_word_array [20,16,17,2,48,11,48,48,0,15,0,0,0,0 ];{19"}
{init_crt = fixed_word_array [20,16,16,4,48,11,48,48,0,15,0,0,32,0 ];{17"-NEW}


PROCEDURE wait_ready;

BEGIN
  REPEAT
  UNTIL status^.notbusy
END;

PROCEDURE set_rule ( rule : INTEGER );

BEGIN
  replregcopy := rule;
  wait_ready;
  rule_reg^ := rule;
END;

PROCEDURE set_width ( width : INTEGER );

BEGIN
  windowregcopy := width;
  wait_ready;
  width_reg^ := width;
END;



{gator_fill_index_color actually prepares dither_pattern for both
 gator_display, and all bobcat_displays.}

procedure gator_fill_index_color ( gcb : graphics_control_block_ptr );

type
     dpt1 = packed array [0..15] of boolean;
     dpt2 = packed array [0..16] of dpt1;
var
     i : integer;
     j : integer;

     r : integer;
     g : integer;
     b : integer;

const
     t = true;
     f = false;
     dp = dpt2[dpt1[f,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, f,f,t,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,f,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,t],
	       dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,f,f,t],
	       dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,t,f,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,f,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,t,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, t,t,t,t],
	       dpt1[t,f,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,f,t,t, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,t,t,t, t,t,t,t],
	       dpt1[t,t,t,t, t,t,t,t, t,t,t,t, t,t,t,t]];

begin
  with gcb^,raster_device_rec_ptr(dev_dep_stuff)^ do
    begin
      if info1 = 0 then                    {set up dither pattern}
	begin
	  r := info2;
	  g := info3;
	  b := info4;

	  current_polygon_red := r;
	  current_polygon_green := g;
	  current_polygon_blue := b;

	  r := (r+32) div 64;
	  g := (g+32) div 64;
	  b := (b+32) div 64;

	  red_intensity := r;
	  grn_intensity := g;
	  blu_intensity := b;

	  i:=r;
	  if i<g then i:=g;
	  if i<b then i:=b;

	  for j:=0 to 15 do dither_pattern[j]:=0;
	  for j:=0 to 15 do if dp[i,j] then dither_pattern[j]:=1;

	  if devicetype = gator_display then
	   store_dit(gcb);
	  end
      else
      if info1 = 1 then
	begin
	  for i := 0 to 15 do
	     dither_pattern[i] := info2;
	  if devicetype = gator_display then
	   store_dit(gcb);
	end;

    end;
end;

procedure gator_clear ( gcb : graphics_control_block_ptr );

var i : integer;

begin
  if gcb^.info2 = 0 then set_rule(clr_with_LM)
  else                   set_rule(one_with_LM);
  set_width(-1024);
  with gcb^,raster_device_rec_ptr(dev_dep_stuff)^ do
    begin
      for i := 0 to hard_ymax do           {fix to allow for changing ymax}
	begin
	  wait_ready;
	  fb_ptr^ [i*1024] := 0;
	end;
    end;
  set_rule(dominant);
end;

function romval(offset:gle_shortint) : gle_shortint;
var temp : gle_shortint;
    ptr  : ^char;
begin
 ptr    := anyptr(control_space + offset);
 temp   := ord(ptr^) * 256;
 ptr    := anyptr(control_space + offset + 2);
 romval := temp + ord(ptr^);
end;

{ wait for gatorbox blockmover to go ready }
procedure waitgboxmoveready;
var regptr : ^gboxstatreg2;
begin
 regptr := anyptr(control_space + gboxregs[gbusyreg]);
 while regptr^.bm_busy do ;   { bit 4 = 0 => blockmover ready }
end;

{ read any gatorbox register that requires blockmover not busy }
function readgboxreg(reg : gboxreg) : gle_shortint;
var regptr : ^char;
begin
 regptr := anyptr(control_space + gboxregs[reg]);
 waitgboxmoveready;
 readgboxreg := ord(regptr^);
end;

{ write any gatorbox register that requires blockmover not busy }
procedure setgboxreg(reg : gboxreg; value : gle_shortint);
var regptr : ^char;
begin
 regptr := anyptr(control_space + gboxregs[reg]);
 waitgboxmoveready;
 regptr^ := chr(value);
end;

{ sets gatorbox DGL area using tiler, as follows: }
{ if info1 =-1, info2 = 0       clear display to all 0 pixels}
{ if info1 =-1, info2 = n       set display to all n-value pixels}
{ if info1 =n,  info2 = 0       clear only planes with 1 bits in n,
  (n >= 0) note that info1 = 0 really means all planes!}
{ other combinations not supported}
{ does not save previous values of gatorbox registers used !! }
procedure gatorbox_clear( gcb : graphics_control_block_ptr );
var depth  : integer;
    savesc : integer;
begin
 writeregcopy := 0;
 with gcb^ do
  if info1 > 0 then
   writeregcopy := (255-info1) mod 256; { so interrupt can restore
					  non-readable wp register }
 TRY    {in case STOP is hit or other error, can restore gatorbox regs}
  depth := 256 - (raster_device_rec_ptr(gcb^.dev_dep_stuff)^.n_glines div 4);
  setgboxreg(gwpreg,writeregcopy);{ write enable all planes }
  setgboxreg(grreg,128+64);       { set replacement rule to rule 0, tile down }
  setgboxreg(ghreg,depth);        { set height to tiles for n_glines }
  setgboxreg(gwreg,0);            { set width to 256 tiles }
  waitgboxmoveready;
  fb_ptr^[0] := fb_ptr^[0];       { start the tiler move }
  with gcb^ do
  if info2 <> 0 then
   begin
    setgboxreg(grreg,128+64+15); { set replacement rule to rule 15, tile down }
    writeregcopy := 255-info2;   { protect only planes 0 in info2 }
    setgboxreg(gwpreg, writeregcopy);
    waitgboxmoveready;
    fb_ptr^[0] := fb_ptr^[0];
   end;

  writeregcopy := 0;
  setgboxreg(gwpreg,0);           { write enable all planes }
  setgboxreg(grreg,3);            { set replacement rule to "idle"--no tile,
				    dominant }
 RECOVER        {restore gatorbox registers to "idle" state before exiting, if
		 some kind of escape}
  begin
   try
    savesc := escapecode;
    writeregcopy := 0;
    setgboxreg(gwpreg,0);
    setgboxreg(grreg,3);
   recover;
   escape(savesc);
  end;
end;

{ wait for bobcat windowmover to go ready }
procedure waitbobmoveready;
var regptr : ^gle_shortint;
    temp   : gle_shortint;
begin
 if topmask <> 0 then {while topmask still 0, not doing any ops requiring wait}
  begin
   regptr := anyptr(control_space + bobregs[bbusyreg]);
   repeat               {do it slowly, so as not to interrupt topcats too much}
    temp := regptr^;
    temp := gle_iand(temp,256*topmask);
    temp := gle_ishift(temp,-8);
   until temp = 0;
  end;
end;

{ read any bobcat register (may require windowmover not busy) }
function readbobreg(reg : bobreg) : integer;
var regptr : ^gle_shortint;
begin
 regptr := anyptr(control_space + bobregs[reg]);
 waitbobmoveready;
 readbobreg := regptr^;
end;

{ write any bobcat register (may require windowmover not busy) }
procedure setbobreg(reg : bobreg; value : integer);
var regptr : ^gle_shortint;
begin
 regptr := anyptr(control_space + bobregs[reg]);
 waitbobmoveready;
 regptr^ := gle_iand(value, hex('ffff'));
end;

{ sets Bobcat DGL area using windowmover, as follows: }
{ if info1 =-1, info2 = 0       clear display to all 0 pixels}
{ if info1 =-1, info2 = n       set display to all n-value pixels}
{ if info1 =n,  info2 = 0       clear only planes with 1 bits in n,
  (n >= 0) note that info1 = 0 really means all planes!}
{ other combinations not supported}
{ does not save previous values of bobcat registers used !! }

procedure bobcat_clear( gcb : graphics_control_block_ptr );
var planes_to_clear : gle_shortint;
    savesc          : integer;
begin
 TRY    {in case STOP is hit or other error, can restore bobcat regs}
  with gcb^ do
   if info1 <> 0 then             {write enable appropriate planes}
    planes_to_clear := info1 MOD (gamut+1)
   else
    planes_to_clear := gamut;
  setbobreg(bwrreg,0);            { set window replacement rule to rule 0}
  setbobreg(bwreg,romval(13));    { set width to visible display width }
{ Below is bugfix for the "clear typeahead pixels" bug SFB 9-27-86 }
{ setbobreg(bhreg,romval(17));    { set height to visible display height }
  setbobreg(bhreg,raster_device_rec_ptr(gcb^.dev_dep_stuff)^.n_glines);
  setbobreg(bsxreg,0);            { set window source x reg to 0 }
  setbobreg(bsyreg,0);            { set window source y reg to 0 }
  setbobreg(bdxreg,0);            { set window destination x reg to 0 }
  setbobreg(bdyreg,0);            { set window destination y reg to 0 }
  setbobreg(bfben0reg,planes_to_clear*256); {added for CATSEYE due to difference
					     from Topcat - SFB 2/9/88 }
  setbobreg(bmovereg,planes_to_clear*256); { trigger window move }

  {below is bugfix for mono display clear_display SFB 9/16/86}
  with gcb^ do
  if info2 <> 0 then    {we're asked to setframe buffer to value info2}
   begin
    setbobreg(bwrreg, 15);          { write 1s}
    setbobreg(bfben0reg,info2*256); {added for CATSEYE due to difference from
				     Topcat - SFB 2/9/88 }
    setbobreg(bmovereg, info2*256); { trigger window move }
   end;

  setbobreg(bwrreg,3);            { restore window replacement rule to rule 3 }
 RECOVER        {restore bobcat registers to "idle" state before exiting, if
		 some kind of escape}
  begin
   try
    savesc := escapecode;
    setbobreg(bwrreg,3);
    setbobreg(bwenreg,hex('ff'));
   recover;
   escape(savesc);
  end;
end;

procedure setup_gator(gcb : graphics_control_block_ptr);

var
  color_list : packed array [0..47] of gle_shortint;
  i : integer;

begin
  set_6845s (gcb);
  status^.bit0 := write_to_status;
  i := 0;
  with gcb^ do
    begin
      info1 := 0;
      info2 := 1;
      info_ptr1 := addr(color_list);
      call (define_color_map,gcb);
    end;
  set_rule(dominant);
end;

procedure setup_gatorbox(gcb : graphics_control_block_ptr);

const blinkrega = hex('6001');
      blinkregb = hex('6005');
type
 aptrtype = ^anyptr;
var
  ptr : ^char;
begin
  {NOTE - cannot guarantee access to frame buffer will not cause DTACK error
   until set_6845s has executed ! Normally would set gamut in rgcbinit, but
   due to need to run rgcbinit BEFORE set_6845s, kluge it here.}


  set_6845s (gcb);

  { next compute gamut by seeing which frame buffer planes are loaded }
  setgboxreg(grreg,dominant);    {tiler off, dominant}
  writeregcopy := 0;
  setgboxreg(gwpreg,0);          {write enable all planes}

  {set ptr to point to last location in framebuffer}
  with raster_device_rec_ptr(gcb^.dev_dep_stuff)^ do
   begin        {added setup of monitortype SFB 6/11/85}
    monitortype := gcb^.info4;
    if monitortype = 0 then     {SFB 6/25/85}
     setgboxreg(gtcolreg,0);
    ptr := anyptr(integer(aptrtype(plane1_addr)^) + 1024*1024 - 1);
   end;
  ptr^ := #255;            {write 1s to 8 potential planes}
  gcb^.gamut := ord(ptr^); {unloaded planes return 0s - planes MUST be loaded
			    in sequence from plane 0 to plane n (n<=7) }
  with gcb^ do
   begin
    ptr := anyptr(info2+blinkrega);     {now enable blink registers}
    ptr^:= chr(gamut);                  {could not do before because we did}
    ptr := anyptr(info2+blinkregb);     {know which planes to enable--gamut}
    ptr^:= chr(gamut);                  {now contains this info}
   end;
end;    {leaving 8 planes write enabled}

procedure setup_bobcat(gcb : graphics_control_block_ptr);
const
 planemask = hex('60ba');
 nblank    = hex('4080');
type
 aptrtype = ^anyptr;
 planes_mask_type = packed array[1..8] of char;
const
 planes_mask = planes_mask_type[#1, #3, #7, #15, #31, #63, #127, #255];
var
  cptr: ^char;
  ptr : ^gle_shortint;
  w,h : gle_shortint;
  numplanes : integer;

begin
  topmask := 0;  {until topmask < > 0, DO NOT do bobcat operations which
		  require wait on windowmover!!}

  {NOTE - cannot guarantee access to frame buffer will not cause DTACK error
   until set_6845s has executed ! Normally would set gamut in rgcbinit, but
   due to need to run rgcbinit BEFORE set_6845s, kluge it here.}

  {Following test added to prevent traversal of graphics "ID" ROM for CATSEYEs.
   This is needed to support the "suppress display clear" value (bit 7) of the
   control word in display_init... We trust that either we are not running
   CATSEYE (hence the test) in which case set_6845s is called and doesn't clear,
   or that the BOOTROM has traversed the ID ROM at boot time. Rev C and later
   BOOTROMs guarantee to do this, and CATSEYE is not supported on earlier
   BOOTROMs except for LCC in 310/320. On 310/320, the display will have been
   initialized because LCC (any CATSEYE actually) can only reside at $560000 in
   DIO I space, and all bitmap-capable BOOTROMs initialize with the ID ROM for
   this select code. CATSEYE can only be address-switched in DIO II space, which
   is not supported on SPUs with pre-rev C BOOTROMs. SFB}

  with gcb^ do
   if (info1<>mcatseye) and (info1<>mcatseye_hrx) then   {SFB}
    set_6845s (gcb);

  setbobreg(bprreg,dominant*256); {pixel replacement rule dominant (in MSB)}
   setbobreg(bwenreg,-256 {hex('ff00')} );       {write enable all planes}

  {now find gamut == plane mask == number of planes loaded}

  with gcb^, raster_device_rec_ptr(dev_dep_stuff)^ do
   begin
    cptr := anyptr(info2 + hex('5b'));
    if cptr^ <> #0 then  {ID location $5b contains number of planes}
      gamut := ord(planes_mask[ord(cptr^)])
    else
     begin     {have to sort out for ourselves which planes are loaded}
      { compute gamut by seeing which frame buffer planes are loaded }
      w := romval(hex('5'));    {find frame buffer width, height}
      h := romval(hex('9'));

      {set ptr to point to last location in framebuffer--it's offscreen}
      cptr := anyptr(integer(aptrtype(plane1_addr)^) + w*h - 1);
      cptr^ := #255;           {write 1s to 8 potential planes}
      gamut := ord(cptr^); {unloaded planes return 0s - planes MUST be loaded
			    in sequence from plane 0 to plane n (n<=7) }
      end;
    ptr := anyptr(info2+nblank);        {enable NBLANK register}
    ptr^:= 256*gamut;
    if color_map_support <> 0 then
     begin
      setbobreg(btcolreg, 0);       {SFB 7/10/85}
      ptr := anyptr(info2+planemask);     {now enable cmap planemask register}
      ptr^:= gamut;
     end;
    topmask := gamut;   {now can do windowmover operations, as we know gamut}
   end;
end;

procedure setup_woodcut(gcb : graphics_control_block_ptr);         {CFB 12JUN91}
const
    planemask = hex('6061A');                                  {lower two bytes}
type
    aptrtype = ^anyptr;
    planes_mask_type = packed array[1..8] of char;
const
    planes_mask = planes_mask_type[#1, #3, #7, #15, #31, #63, #127, #255];
var
    cptr      : ^char;
    ptr       : ^gle_shortint;
    w,h       : gle_shortint;
    numplanes : integer;

begin
  {now find gamut == plane mask == number of planes loaded}

  with gcb^, raster_device_rec_ptr(dev_dep_stuff)^ do
  begin
    cptr := anyptr(info2 + hex('5b'));
    gamut := ord(planes_mask[ord(cptr^)]);
    if color_map_support <> 0 then
    begin
      ptr := anyptr(info2+planemask);     {now enable cmap planemask register}
      ptr^:= gamut*256+gamut;
     end;
   topmask := gamut;
   end;
end;

procedure bobcat_fill_index_color( gcb : graphics_control_block_ptr );
label 1;
type
    aptrtype = ^anyptr;
    four_row_array = packed array[0..3,0..1023] of char;

var
    move_width,
    first_fill_row,
    i,nmoves        : gle_shortint;
    fill_area       : ^four_row_array;

begin           { SFB 2-27-85 }

  with gcb^, raster_device_rec_ptr(dev_dep_stuff)^ do
  begin
    if gamut<>1 then
      rfill_index_color( gcb )      {set up dither_pattern with fill pattern}
    else
      gator_fill_index_color( gcb );


  if (devicetype = catseye_display) or (devicetype = catseye_hrx_display) then
  begin
    dither_to_pattregs( gcb );
    goto 1;
  end;
  {will use TRR, not offscreen Framebuf to hold
   area fill pattern. See rfill_index_color in
   RGL - SFB 2/9/88}


  {now get pointer to last four pixel rows on screen, by using rgl info
   on start of frame buffer and ID ROM info on height of frame buffer}

  first_fill_row := romval(9) - 4;  {fourth last framebuf row}
  fill_area := anyptr(integer(aptrtype(plane1_addr)^) + first_fill_row*1024);

  setbobreg(bwenreg, 256*gamut);
  setbobreg(bprreg,  256*3);

  if devicetype = bobcat_display then
  begin
    for i:=0 to 15 do    {copy dither_pattern to offscreen area at left edge}
      fill_area^[i div 4, i mod 4] := chr(dither_pattern[i]);
    nmoves := 7;
    move_width := 4;
  end;

  if devicetype = bobcat_lores_display then
  begin
    for i:=0 to 15 do    {copy dither_pattern to offscreen area at left edge}
    begin
      fill_area^[i div 4, (i mod 4)*2    ] := chr(dither_pattern[i]);
      fill_area^[i div 4, (i mod 4)*2 + 1] := chr(dither_pattern[i]);
    end;
    nmoves := 6;
    move_width := 8;
  end;

   {now use window mover to replicate fill cell across full width of frame buf}
  setbobreg(bhreg, 4);
  setbobreg(bsxreg, 0);
  setbobreg(bsyreg, first_fill_row);
  setbobreg(bdyreg, first_fill_row);
  setbobreg(bwrreg, 3);

  for i := 0 to nmoves do
  begin
    setbobreg(bwreg, move_width);
    setbobreg(bdxreg, move_width);       {destination x always = width because
					  it's a geometric sequence with r=2}
    setbobreg(bmovereg, 256*gamut);      {do the move}
    move_width  := move_width * 2;       {move twice as many next time}
  end;
end;  {with}
1:end;

procedure rdummy_proc (  gcb : graphics_control_block_ptr );
begin
end;

procedure rget_polygon_info (  gcb : graphics_control_block_ptr );

begin            { only solid fill supported }
  with gcb^ do
    if info2 = polygon_solid_fill then error_return := 0
    else                               error_return := 1;
end;

procedure rdefine_color_map (  gcb : graphics_control_block_ptr );

type
  packed_color_map_def = packed array [0..15] of gle_shortint;
  color_map_ptr = ^packed_color_map_def;
  color_data_def = packed array [0..3*256-1 {47}] of gle_shortint;
  color_data_ptr_def = ^color_data_def;

var
  color_map : color_map_ptr;
  temp_color_map : packed_color_map_def;
  n,i : gle_shortint;
  temp : integer;
  brt : array [0..255 {15}] of integer;
  color_data_ptr : color_data_ptr_def;
  packed_map : boolean;

begin
  with gcb^,raster_device_rec_ptr(dev_dep_stuff)^ do
  begin
    packed_map := true;
    if   (display_name = '98700A')    {gbox or any bobcat SFB 6/11/85}
      or (display_name = '98542A') or (display_name = '98543A')
      or (display_name = '98544A') or (display_name = '98545A')
      or (display_name = '98547A') or (display_name = '98548A')      {SFB}
      or (display_name = '98549A') or (display_name = '98550A')      {SFB}
      or (display_name = 'E640  ') or (display_name = 'E1024 ')    {CFB 30JUL91}
      or (display_name = 'E1280 ') or (display_name = 'E640G ')    {CFB 30JUL91}
      or (display_name = 'E1280G') then                            {CFB 30JUL91}
      packed_map := false;
    color_data_ptr := info_ptr1;
    for i := info1 to info2 do
      with system_cmap[i] do
      begin
	n := (i - info1)*3;
	map_red := color_data_ptr^[n];
	map_grn := color_data_ptr^[n+1];
	map_blu := color_data_ptr^[n+2];
	if packed_map then
	  temp_color_map[i] := (15-map_red div 64)*256 +
			       (15-map_grn div 64) * 16 +
			       (15-map_blu div 64);
      end;

    if color_map_support = yes then
    begin
      color_map := anyptr(cmap_address);
      if packed_map then
      begin
	rawait_blanking(gcb);
	for i := info1 to info2 do
	  color_map^[i] := temp_color_map[i];
      end
      else { unpacked map }
      for i:= info1 to info2 do
      with system_cmap[i] do
      begin
	info2 := map_red div 4;
	info3 := map_grn div 4;
	info4 := map_blu div 4;
	if display_name = '98700A' then
	begin   {GATORBOX}
	  info1 := i;
	  if monitortype = 3 then   {discrete colormap SFB 6/11/85}
	    setgboxcmap(gcb)
	  else
	    set_nereid(gcb);      {SFB 6/11/85}
	end
	else                              { WOODCUT support CFB 12JUN91 }
	if (display_name = 'E640  ') or (display_name = 'E1024 ')
	or (display_name = 'E1280 ') or (display_name = 'E640G ')
	or (display_name = 'E1280G') then
	begin
	  info1 := i;
	  set_wood_cmap(gcb);
	end
	else
	begin   {BOBCAT}
	  info1 := 255-i;
	  set_nereid(gcb);
	end;
      end;
    end;
      {We now calculate brightness sequence on the fly in RGL, when setting
       up to fill a polygon. The reason to do this is that, with color maps
       now having up to 256 elements, the sorting takes too long to do each
       time we change color map, so we do it only when it's relevant, during
       polygon fill setup. That's why the code is no longer here.}
  end;
end;

procedure gle_init_raster_output (  gcb : graphics_control_block_ptr);

var
  cnt : gle_shortint;
  tempinfo3{, tempinfo1}: integer;       {SFB 9/09/86}

begin
  with gcb^,raster_device_rec_ptr(dev_dep_stuff)^ do
    begin
      tempinfo3 := info3;  {KLUGE TO ALLOW EXPANSION OF COLORMAP DISPLAY - SFB}

     {tempinfo1 := info1;
      if info1 = mcatseye then {fake it for rgcbinit SFB 9/09/86
       info1 := mbobcat;}       {removed as rgcbinit is fixed - SFB 2/9/88}

      if (info1 = mgatorbox) then
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + gboxregs[grreg]-1);
	   width_reg := anyptr(info2 + gboxregs[gwreg]-1);
	   status := anyptr(info2 + 2); { secondary gatorbox intr reg }
	   info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
						COLORMAP BASE ADDRESS}
	   crt := nil;
	   ww_reg := anyptr(info2 + gboxregs[gwreg]-1);
	end;
      if (info1=mbobcat) or (info1=mbobcatlores)
      or (info1=mcatseye {SFB}) or (info1=mcatseye_hrx {SFB}) then
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + bobregs[bprreg]); {pixel rule reg}
	   width_reg := anyptr(info2 + bobregs[bwreg]); {window width reg}
	   status := anyptr(info2 + bobregs[bbusyreg]); {windowmover busy reg}
	   info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
						COLORMAP BASE ADDRESS}
	   if info2=info3 then
	    info3 := 0;                        {SET CMAP_ADDRESS TO 0 IF THERE
						IS NO COLORMAP}
	   crt := nil;
	   ww_reg := anyptr(info2 + bobregs[bwreg]);
	end;
      if (info1 = m9837a)  then
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + (hex('4008')));
	   width_reg := anyptr(info2 + (hex('400c')));
	   status := anyptr(info2 + (hex('4000')));
	   crt := anyptr(info2 + (hex('6000')));
	end;
      error_return := 0;

      rgcbinit ( gcb );

      info3 := tempinfo3; {NOW WE WANT INFO3 = EXPAND SCREEN SELECTION FOR
			   BITMAP DISPLAYS}
     {info1 := tempinfo1; {NOW LET DISPLAY NAME BE SET CORRECTLY SFB 9/09/86}

      move                 := rmove;
      draw                 := rdraw;
      clear                := rclear;
      text                 := gle_soft_text;
      clip_limits          := gle_soft_clip_limits;
      char_size            := gle_soft_char_size;
      text_spacing         := gle_soft_text_spacing;
      text_dir             := gle_soft_text_dir;
      text_just            := gle_soft_text_just;
      marker               := gle_soft_marker;
      marker_size          := gle_soft_marker_size;
      set_marker           := gle_soft_set_marker;
      index_color          := rset_color;
      linestyle            := rlinestyle;
      await_blanking       := rawait_blanking;
      linewidth            := rdummy_proc;
      inq_p1p2             := rget_p1p2;
      get_polygon_info     := rget_polygon_info;
      calc_soft_text_xform := gle_text_xform;
      fill_index_color     := rfill_index_color;
      graphics_on_off      := rgraphics_on_off;
      cursor               := rcursor;
      define_drawing_mode  := rdefine_drawing_mode;
      polygon              := rpolygon;
      define_color_map     := rdefine_color_map;
      buffer_mode          := rdummy_proc;
      output_escapei       := rdummy_proc;
      output_escapeo       := rdummy_proc;
      flush_buffer         := rdummy_proc;
      get_raster           := rget_raster;

      soft_font_ptr        := addr(font);

      case info1 of
	munknown : { reserved } ;
	m9816a   : { 9816 }
	  begin
	    display_name := '9816A ';
	    display_name_char_count := 5;
	    display_res_x := 2.375;                { 168mm X 126mm }
	    display_res_y := 2.37301587301587;
	  end;
	m9826a :   { 9826 }
	  begin
	    display_name := '9826A ';
	    display_name_char_count := 5;
	    display_res_x := 3.325;                { 120mm X 90mm }
	    display_res_y := 3.322222222222222;
	  end;
	m9836a : { 9836 }
	  begin
	    display_name := '9836A ';
	    display_name_char_count := 5;
	    display_res_x := 2.433333333333333;     { 210mm X 160mm }
	    display_res_y := 2.43125;
	  end;
	m9836c : { 9836C }
	  begin
	    display_name := '9836C ';
	    display_name_char_count := 5;
	    display_res_x := 2.35483870967742;     { 217mm X 163mm }
	    display_res_y := 2.38650306748466;
	  end;
	m98627a : { 98627 }
	  begin
	    display_name := '98627A';
	    display_name_char_count := 6;
	    deviceaddress := info2;
	    display_res_x := 3.333333333333333;
	    display_res_y := 3.333333333333333;
	  end;
	m9837a : { Gator Black/White }
	  begin
	    display_name := '9837a ';
	    display_name_char_count := 5;

	    {GATOR CONSTANTS CORRECTED 4/15/85 SFB}
	    display_res_x := 3.27884; {1023/312}    { 312mm X  234mm }
	    display_res_y := 3.27778; {767/234}
	    if info3 = 1 then                      {added to detect current}
	     begin                                  {ymax.                  }
	       n_glines := 768;
	       hard_ymax := 767;
	     end;
	    await_blanking := rdummy_proc;
	    setup_gator(gcb);
	    clear := gator_clear;
	    fill_index_color := gator_fill_index_color;
	    define_color_map := rdummy_proc;
	  end;
	mgatorbox:  { Gatorbox SFB 4/15/85}
	  begin
	    display_name := '98700A';           {SFB 6/11/85}
	    display_name_char_count := 6;
	    display_res_x := 2.841667;             {360mm X  270mm +/- 1.5%}
	    display_res_y := 2.840740;
	    if info3 = 1 then                      {added to detect current}
	     begin                                 {ymax.                  }
	       n_glines := 768;
	       hard_ymax := 767;
	     end;
	    setup_gatorbox(gcb);
	    clear := gatorbox_clear;
	  end;
	mbobcat,mbobcatlores,mcatseye,mcatseye_hrx:         {Bobcat SFB 4/15/85}
						    {added MCATSEYE SFB 9/09/86}
	  begin
	    setup_bobcat(gcb);
	    clear := bobcat_clear;
	    display_name_char_count := 6;
	    fill_index_color := bobcat_fill_index_color;
	    if   (info1 = mbobcat) or (info1 = mcatseye)
	      or (info1 = mcatseye_hrx)  then { bobcat hires }
	    begin
	      {assume 98545/98547/98549 and change later if necessary. SFB}
	      display_res_x := 2.841666667;     {360mm X  270mm +/- 1.5%}
	      display_res_y := 2.840740741;
	      if pallette = 1 then
	       if info1=mbobcat then
		 begin                            {hires mono}
		  display_name := '98544A';       {SFB 6/11/85, BUGFIX 9/09/86}
		  display_res_x := 3.27884;       {same as GATOR}
		  display_res_y := 3.27778;
		 end
	       else
		 begin                            {hires mono CATSEYE}
		  display_name := '98548A';       {SFB 2/9/86}
		  display_res_x := 3.728862974;   {19 inch monitor default}
		  display_res_y := 3.733576642;
		 end
	      else      {pallette <> 1}
	       begin                              {hires color}
		if info1 = mbobcat then
		 if gamut = 15 then               {ADDED SFB 9/09/86}
		  display_name := '98545A'        {SFB 6/11/85}
		 else
		  display_name := '98547A'        {HEXAGON SFB 9/09/86}
		else
		 if gamut=63 then
		  display_name := '98549A'        {LCC}
		 else
		  begin
		   display_name := '98550A';
		   display_res_x := 3.728862974;  {19 inch monitor default}
		   display_res_y := 3.733576642;
		  end;
	       end;
	      if info3 = 1 then                   {added to detect current}
	       if (display_name<>'98548A') and (display_name<>'98550A') then
								{SFB 2/9/88}
		 begin                            {ymax.                  }
		   n_glines  := 768;
		   hard_ymax := 767;
		 end
	       else
		 begin                             {ymax.                  }
		   n_glines  := 1024;       {true (to date) hi-res - SFB 2/9/88}
		   hard_ymax := 1023;
		 end;
	     end        {if info1 = mbobcat or mcatseye}
	    else        { bobcat lores }
	     begin      {color and mono have same spec}
	      display_res_x := 2.433333;
	      display_res_y := 2.432926;
	      if pallette = 1 then       {SFB 6/11/85}
	       display_name := '98542A'
	      else
	       display_name := '98543A';       {BUGFIX SFB 9/09/86}
	      if info3 = 1 then
	       begin
		n_glines  := 400;
		hard_ymax := 399;
	       end;
	     end;
	  end;
	mvga_woodcut,                                 {added WOODCUT CFB 8JUN91}
	mvgam_woodcut:                                  {added MONO CFB 30JUL91}
	  begin
	    setup_woodcut(gcb);
	    if info1 = mvga_woodcut then
	    begin
	      display_name := 'E640  ';
	      display_name_char_count := 4;
	    end
	    else
	    begin
	      display_name := 'E640G ';
	      display_name_char_count := 5;
	    end;
	    display_res_x := 2.206896552;                     {~290x210mm (14")}
	    display_res_y := 2.285714286;
	    if info3 = 1 then
	    begin
	      n_glines  := 480;
	      hard_ymax := 479;
	    end;
	  end;
	mmed_woodcut:                                 {added WOODCUT CFB 8JUN91}
	  begin
	    setup_woodcut(gcb);
	    display_name := 'E1024 ';
	    display_name_char_count := 5;
	    display_res_x := 3.413333333;                      {300x225mm (16")}
	    display_res_y := 3.413333333;
	    if info3 = 1 then
	    begin
	      n_glines  := 768;
	      hard_ymax := 767;
	    end;
	  end;
	mhrx_woodcut,                                 {added WOODCUT CFB 8JUN91}
	mhrxm_woodcut:                                  {added MONO CFB 30JUL91}
	  begin
	    setup_woodcut(gcb);
	    if info1 = mhrx_woodcut then
	    begin
	      display_name := 'E1280 ';
	      display_name_char_count := 5;
	    end
	    else
	    begin
	      display_name := 'E1280G';
	      display_name_char_count := 6;
	    end;
	    display_res_x := 3.764705882;                      {340x272mm (19")}
	    display_res_y := 3.764705882;
	    if info3 = 1 then
	    begin
	      n_glines  := 1024;                 {changed from 1000 CFB 25OCT91}
	      hard_ymax := 1023;
	    end;
	  end;
	end; {of case }

      display_handler_name := 'RASTER';
      display_handler_char_count := 6;

      display_min_x := 0;
      display_min_y := 0;
      display_max_x := hard_xmax;
      display_max_y := hard_ymax;

      info1 := 0;
      info2 := display_max_x;
      info3 := 0;
      info4 := display_max_y;
      gle_soft_clip_limits ( gcb );  { set default clipping limits }

      pen_draw_mode := 0;
      area_draw_mode := 0;
      pen_number := 1;
      info1 := 1;
      rset_color(gcb);
    end;
end;

end. { output }

@


55.4
log
@
pws2rcs automatic delta on Mon Nov  4 13:45:04 MST 1991
@
text
@@


55.3
log
@Fixed incorrect n_glines on HiRes WOODCUT - CFB
@
text
@d21 1
a21 1
                  RESTRICTED RIGHTS LEGEND
d33 7
a39 7
        'GLE_STEXT',
        'ASM_STEXT',
        'GLE_SCLIP',
        'ASM_SCLIP',
        'GLE_SMARK',
        'GLE_AUTL',
        'RGL'$
d60 4
a63 4
               map_red : gle_shortint;
               map_grn : gle_shortint;
               map_blu : gle_shortint;
             end;
d156 5
a160 5
                 enable_vg_intr, vg_intr,
                 enable_bm_intr, bm_busy,
                 enable_vsync_intr, vsync_intr,
                 not_hsync, enable_video :      boolean;
              end;
d165 2
a166 2
                 bsxreg, bsyreg, bdxreg, bdyreg, bmovereg, btcolreg,
                 bfben0reg {added 2/9/88 - SFB} );
d171 1
a171 1
                         hex('0002'), hex('6009'), hex('68BD')];
d173 4
a176 4
                         hex('4044'), hex('4090'),
                         hex('40F2'), hex('40F6'), hex('40FA'), hex('40FE'),
                         hex('409C'), hex('60BC'),
                         hex('4500') {added 2/9/88 - SFB} ];
d181 6
a186 6
                        bobcat type display. Note--topmask should be set to
                        0 before accessing any topcat registers, so we know
                        windowmover need not be tested for ready. Once we
                        are ready to do window moves, should set topmask to
                        gle_gcb^.gamut, so bobmoveready works!! This sequence
                        is implemented by setup_bobcat.}
d239 16
a254 16
               dpt1[t,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f],
               dpt1[t,f,f,f, f,f,f,f, f,f,t,f, f,f,f,f],
               dpt1[t,f,f,f, f,f,f,f, t,f,t,f, f,f,f,f],
               dpt1[t,f,t,f, f,f,f,f, t,f,t,f, f,f,f,f],
               dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,f],
               dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,t],
               dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,f,f,t],
               dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,t,f,t],
               dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,f,t],
               dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,t,t],
               dpt1[t,f,t,f, t,t,f,t, t,f,t,f, t,t,t,t],
               dpt1[t,f,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
               dpt1[t,t,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
               dpt1[t,t,t,f, t,t,t,t, t,f,t,t, t,t,t,t],
               dpt1[t,t,t,f, t,t,t,t, t,t,t,t, t,t,t,t],
               dpt1[t,t,t,t, t,t,t,t, t,t,t,t, t,t,t,t]];
d260 4
a263 4
        begin
          r := info2;
          g := info3;
          b := info4;
d265 3
a267 3
          current_polygon_red := r;
          current_polygon_green := g;
          current_polygon_blue := b;
d269 3
a271 3
          r := (r+32) div 64;
          g := (g+32) div 64;
          b := (b+32) div 64;
d273 3
a275 3
          red_intensity := r;
          grn_intensity := g;
          blu_intensity := b;
d277 3
a279 3
          i:=r;
          if i<g then i:=g;
          if i<b then i:=b;
d281 2
a282 2
          for j:=0 to 15 do dither_pattern[j]:=0;
          for j:=0 to 15 do if dp[i,j] then dither_pattern[j]:=1;
d284 3
a286 3
          if devicetype = gator_display then
           store_dit(gcb);
          end
d289 6
a294 6
        begin
          for i := 0 to 15 do
             dither_pattern[i] := info2;
          if devicetype = gator_display then
           store_dit(gcb);
        end;
d310 4
a313 4
        begin
          wait_ready;
          fb_ptr^ [i*1024] := 0;
        end;
d369 1
a369 1
                                          non-readable wp register }
d391 1
a391 1
                                    dominant }
d393 1
a393 1
                 some kind of escape}
d467 1
a467 1
                                             from Topcat - SFB 2/9/88 }
d476 1
a476 1
                                     Topcat - SFB 2/9/88 }
d482 1
a482 1
                 some kind of escape}
d544 1
a544 1
                            in sequence from plane 0 to plane n (n<=7) }
d571 1
a571 1
                  require wait on windowmover!!}
d613 1
a613 1
                            in sequence from plane 0 to plane n (n<=7) }
d728 1
a728 1
                                          it's a geometric sequence with r=2}
d781 8
a788 8
        n := (i - info1)*3;
        map_red := color_data_ptr^[n];
        map_grn := color_data_ptr^[n+1];
        map_blu := color_data_ptr^[n+2];
        if packed_map then
          temp_color_map[i] := (15-map_red div 64)*256 +
                               (15-map_grn div 64) * 16 +
                               (15-map_blu div 64);
d796 3
a798 3
        rawait_blanking(gcb);
        for i := info1 to info2 do
          color_map^[i] := temp_color_map[i];
d804 24
a827 24
        info2 := map_red div 4;
        info3 := map_grn div 4;
        info4 := map_blu div 4;
        if display_name = '98700A' then
        begin   {GATORBOX}
          info1 := i;
          if monitortype = 3 then   {discrete colormap SFB 6/11/85}
            setgboxcmap(gcb)
          else
            set_nereid(gcb);      {SFB 6/11/85}
        end
        else                              { WOODCUT support CFB 12JUN91 }
        if (display_name = 'E640  ') or (display_name = 'E1024 ')
        or (display_name = 'E1280 ') or (display_name = 'E640G ')
        or (display_name = 'E1280G') then
        begin
          info1 := i;
          set_wood_cmap(gcb);
        end
        else
        begin   {BOBCAT}
          info1 := 255-i;
          set_nereid(gcb);
        end;
d854 11
a864 11
        begin
           fb_ptr_ptr := info_ptr1;
           fb_ptr := anyptr(fb_ptr_ptr^);
           rule_reg := anyptr(info2 + gboxregs[grreg]-1);
           width_reg := anyptr(info2 + gboxregs[gwreg]-1);
           status := anyptr(info2 + 2); { secondary gatorbox intr reg }
           info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
                                                COLORMAP BASE ADDRESS}
           crt := nil;
           ww_reg := anyptr(info2 + gboxregs[gwreg]-1);
        end;
d867 14
a880 14
        begin
           fb_ptr_ptr := info_ptr1;
           fb_ptr := anyptr(fb_ptr_ptr^);
           rule_reg := anyptr(info2 + bobregs[bprreg]); {pixel rule reg}
           width_reg := anyptr(info2 + bobregs[bwreg]); {window width reg}
           status := anyptr(info2 + bobregs[bbusyreg]); {windowmover busy reg}
           info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
                                                COLORMAP BASE ADDRESS}
           if info2=info3 then
            info3 := 0;                        {SET CMAP_ADDRESS TO 0 IF THERE
                                                IS NO COLORMAP}
           crt := nil;
           ww_reg := anyptr(info2 + bobregs[bwreg]);
        end;
d882 8
a889 8
        begin
           fb_ptr_ptr := info_ptr1;
           fb_ptr := anyptr(fb_ptr_ptr^);
           rule_reg := anyptr(info2 + (hex('4008')));
           width_reg := anyptr(info2 + (hex('400c')));
           status := anyptr(info2 + (hex('4000')));
           crt := anyptr(info2 + (hex('6000')));
        end;
d895 1
a895 1
                           BITMAP DISPLAYS}
d932 41
a972 41
        munknown : { reserved } ;
        m9816a   : { 9816 }
          begin
            display_name := '9816A ';
            display_name_char_count := 5;
            display_res_x := 2.375;                { 168mm X 126mm }
            display_res_y := 2.37301587301587;
          end;
        m9826a :   { 9826 }
          begin
            display_name := '9826A ';
            display_name_char_count := 5;
            display_res_x := 3.325;                { 120mm X 90mm }
            display_res_y := 3.322222222222222;
          end;
        m9836a : { 9836 }
          begin
            display_name := '9836A ';
            display_name_char_count := 5;
            display_res_x := 2.433333333333333;     { 210mm X 160mm }
            display_res_y := 2.43125;
          end;
        m9836c : { 9836C }
          begin
            display_name := '9836C ';
            display_name_char_count := 5;
            display_res_x := 2.35483870967742;     { 217mm X 163mm }
            display_res_y := 2.38650306748466;
          end;
        m98627a : { 98627 }
          begin
            display_name := '98627A';
            display_name_char_count := 6;
            deviceaddress := info2;
            display_res_x := 3.333333333333333;
            display_res_y := 3.333333333333333;
          end;
        m9837a : { Gator Black/White }
          begin
            display_name := '9837a ';
            display_name_char_count := 5;
d974 157
a1130 157
            {GATOR CONSTANTS CORRECTED 4/15/85 SFB}
            display_res_x := 3.27884; {1023/312}    { 312mm X  234mm }
            display_res_y := 3.27778; {767/234}
            if info3 = 1 then                      {added to detect current}
             begin                                  {ymax.                  }
               n_glines := 768;
               hard_ymax := 767;
             end;
            await_blanking := rdummy_proc;
            setup_gator(gcb);
            clear := gator_clear;
            fill_index_color := gator_fill_index_color;
            define_color_map := rdummy_proc;
          end;
        mgatorbox:  { Gatorbox SFB 4/15/85}
          begin
            display_name := '98700A';           {SFB 6/11/85}
            display_name_char_count := 6;
            display_res_x := 2.841667;             {360mm X  270mm +/- 1.5%}
            display_res_y := 2.840740;
            if info3 = 1 then                      {added to detect current}
             begin                                 {ymax.                  }
               n_glines := 768;
               hard_ymax := 767;
             end;
            setup_gatorbox(gcb);
            clear := gatorbox_clear;
          end;
        mbobcat,mbobcatlores,mcatseye,mcatseye_hrx:         {Bobcat SFB 4/15/85}
                                                    {added MCATSEYE SFB 9/09/86}
          begin
            setup_bobcat(gcb);
            clear := bobcat_clear;
            display_name_char_count := 6;
            fill_index_color := bobcat_fill_index_color;
            if   (info1 = mbobcat) or (info1 = mcatseye)
              or (info1 = mcatseye_hrx)  then { bobcat hires }
            begin
              {assume 98545/98547/98549 and change later if necessary. SFB}
              display_res_x := 2.841666667;     {360mm X  270mm +/- 1.5%}
              display_res_y := 2.840740741;
              if pallette = 1 then
               if info1=mbobcat then
                 begin                            {hires mono}
                  display_name := '98544A';       {SFB 6/11/85, BUGFIX 9/09/86}
                  display_res_x := 3.27884;       {same as GATOR}
                  display_res_y := 3.27778;
                 end
               else
                 begin                            {hires mono CATSEYE}
                  display_name := '98548A';       {SFB 2/9/86}
                  display_res_x := 3.728862974;   {19 inch monitor default}
                  display_res_y := 3.733576642;
                 end
              else      {pallette <> 1}
               begin                              {hires color}
                if info1 = mbobcat then
                 if gamut = 15 then               {ADDED SFB 9/09/86}
                  display_name := '98545A'        {SFB 6/11/85}
                 else
                  display_name := '98547A'        {HEXAGON SFB 9/09/86}
                else
                 if gamut=63 then
                  display_name := '98549A'        {LCC}
                 else
                  begin
                   display_name := '98550A';
                   display_res_x := 3.728862974;  {19 inch monitor default}
                   display_res_y := 3.733576642;
                  end;
               end;
              if info3 = 1 then                   {added to detect current}
               if (display_name<>'98548A') and (display_name<>'98550A') then
                                                                {SFB 2/9/88}
                 begin                            {ymax.                  }
                   n_glines  := 768;
                   hard_ymax := 767;
                 end
               else
                 begin                             {ymax.                  }
                   n_glines  := 1024;       {true (to date) hi-res - SFB 2/9/88}
                   hard_ymax := 1023;
                 end;
             end        {if info1 = mbobcat or mcatseye}
            else        { bobcat lores }
             begin      {color and mono have same spec}
              display_res_x := 2.433333;
              display_res_y := 2.432926;
              if pallette = 1 then       {SFB 6/11/85}
               display_name := '98542A'
              else
               display_name := '98543A';       {BUGFIX SFB 9/09/86}
              if info3 = 1 then
               begin
                n_glines  := 400;
                hard_ymax := 399;
               end;
             end;
          end;
        mvga_woodcut,                                 {added WOODCUT CFB 8JUN91}
        mvgam_woodcut:                                  {added MONO CFB 30JUL91}
          begin
            setup_woodcut(gcb);
            if info1 = mvga_woodcut then
            begin
              display_name := 'E640  ';
              display_name_char_count := 4;
            end
            else
            begin
              display_name := 'E640G ';
              display_name_char_count := 5;
            end;
            display_res_x := 2.206896552;                     {~290x210mm (14")}
            display_res_y := 2.285714286;
            if info3 = 1 then
            begin
              n_glines  := 480;
              hard_ymax := 479;
            end;
          end;
        mmed_woodcut:                                 {added WOODCUT CFB 8JUN91}
          begin
            setup_woodcut(gcb);
            display_name := 'E1024 ';
            display_name_char_count := 5;
            display_res_x := 3.413333333;                      {300x225mm (16")}
            display_res_y := 3.413333333;
            if info3 = 1 then
            begin
              n_glines  := 768; 
              hard_ymax := 767; 
            end;
          end;
        mhrx_woodcut,                                 {added WOODCUT CFB 8JUN91}
        mhrxm_woodcut:                                  {added MONO CFB 30JUL91}
          begin
            setup_woodcut(gcb);
            if info1 = mhrx_woodcut then
            begin
              display_name := 'E1280 ';
              display_name_char_count := 5;
            end
            else
            begin
              display_name := 'E1280G';
              display_name_char_count := 6;
            end;
            display_res_x := 3.764705882;                      {340x272mm (19")}
            display_res_y := 3.764705882;
            if info3 = 1 then
            begin
              n_glines  := 1024;                 {changed from 1000 CFB 25OCT91}
              hard_ymax := 1023; 
            end;
          end;
        end; {of case }
@


55.2
log
@Added support for High-res and Greyscale - CFB
@
text
@d1126 1
a1126 1
              n_glines  := 1000; 
@


55.1
log
@Automatic bump of revision number for PWS version 3.25A
@
text
@d21 1
a21 1
		  RESTRICTED RIGHTS LEGEND
d33 7
a39 7
	'GLE_STEXT',
	'ASM_STEXT',
	'GLE_SCLIP',
	'ASM_SCLIP',
	'GLE_SMARK',
	'GLE_AUTL',
	'RGL'$
d41 1
a41 1
$include 'OPTIONS'$       { ****************** COMPILER OPTIONS ********************** }
d60 4
a63 4
	       map_red : gle_shortint;
	       map_grn : gle_shortint;
	       map_blu : gle_shortint;
	     end;
d128 2
d156 5
a160 5
		 enable_vg_intr, vg_intr,
		 enable_bm_intr, bm_busy,
		 enable_vsync_intr, vsync_intr,
		 not_hsync, enable_video :      boolean;
	      end;
d165 2
a166 2
		 bsxreg, bsyreg, bdxreg, bdyreg, bmovereg, btcolreg,
		 bfben0reg {added 2/9/88 - SFB} );
d171 1
a171 1
			 hex('0002'), hex('6009'), hex('68BD')];
d173 4
a176 4
			 hex('4044'), hex('4090'),
			 hex('40F2'), hex('40F6'), hex('40FA'), hex('40FE'),
			 hex('409C'), hex('60BC'),
			 hex('4500') {added 2/9/88 - SFB} ];
d181 6
a186 6
			bobcat type display. Note--topmask should be set to
			0 before accessing any topcat registers, so we know
			windowmover need not be tested for ready. Once we
			are ready to do window moves, should set topmask to
			gle_gcb^.gamut, so bobmoveready works!! This sequence
			is implemented by setup_bobcat.}
d239 16
a254 16
	       dpt1[t,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, f,f,t,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,f,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,t],
	       dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,f,f,t],
	       dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,t,f,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,f,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,t,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, t,t,t,t],
	       dpt1[t,f,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,f,t,t, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,t,t,t, t,t,t,t],
	       dpt1[t,t,t,t, t,t,t,t, t,t,t,t, t,t,t,t]];
d260 4
a263 4
	begin
	  r := info2;
	  g := info3;
	  b := info4;
d265 3
a267 3
	  current_polygon_red := r;
	  current_polygon_green := g;
	  current_polygon_blue := b;
d269 3
a271 3
	  r := (r+32) div 64;
	  g := (g+32) div 64;
	  b := (b+32) div 64;
d273 3
a275 3
	  red_intensity := r;
	  grn_intensity := g;
	  blu_intensity := b;
d277 3
a279 3
	  i:=r;
	  if i<g then i:=g;
	  if i<b then i:=b;
d281 2
a282 2
	  for j:=0 to 15 do dither_pattern[j]:=0;
	  for j:=0 to 15 do if dp[i,j] then dither_pattern[j]:=1;
d284 3
a286 3
	  if devicetype = gator_display then
	   store_dit(gcb);
	  end
d289 6
a294 6
	begin
	  for i := 0 to 15 do
	     dither_pattern[i] := info2;
	  if devicetype = gator_display then
	   store_dit(gcb);
	end;
d310 4
a313 4
	begin
	  wait_ready;
	  fb_ptr^ [i*1024] := 0;
	end;
d369 1
a369 1
					  non-readable wp register }
d391 1
a391 1
				    dominant }
d393 1
a393 1
		 some kind of escape}
d467 1
a467 1
					     from Topcat - SFB 2/9/88 }
d476 1
a476 1
				     Topcat - SFB 2/9/88 }
d482 1
a482 1
		 some kind of escape}
d544 1
a544 1
			    in sequence from plane 0 to plane n (n<=7) }
d571 1
a571 1
		  require wait on windowmover!!}
d613 1
a613 1
			    in sequence from plane 0 to plane n (n<=7) }
d728 1
a728 1
					  it's a geometric sequence with r=2}
d773 3
a775 2
      or (display_name = 'VGA   ') or (display_name = 'MEDIUM')      {CFB}
      or (display_name = 'HIRES ') then                              {CFB}
d781 8
a788 8
	n := (i - info1)*3;
	map_red := color_data_ptr^[n];
	map_grn := color_data_ptr^[n+1];
	map_blu := color_data_ptr^[n+2];
	if packed_map then
	  temp_color_map[i] := (15-map_red div 64)*256 +
			       (15-map_grn div 64) * 16 +
			       (15-map_blu div 64);
d796 3
a798 3
	rawait_blanking(gcb);
	for i := info1 to info2 do
	  color_map^[i] := temp_color_map[i];
d804 24
a827 23
	info2 := map_red div 4;
	info3 := map_grn div 4;
	info4 := map_blu div 4;
	if display_name = '98700A' then
	begin   {GATORBOX}
	  info1 := i;
	  if monitortype = 3 then   {discrete colormap SFB 6/11/85}
	    setgboxcmap(gcb)
	  else
	    set_nereid(gcb);      {SFB 6/11/85}
	end
	else                              { WOODCUT support CFB 12JUN91 }
	if (display_name = 'VGA   ') or (display_name = 'MEDIUM')
	or (display_name = 'HIRES ') then
	begin
	  info1 := i;
	  set_wood_cmap(gcb);
	end
	else
	begin   {BOBCAT}
	  info1 := 255-i;
	  set_nereid(gcb);
	end;
d854 11
a864 11
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + gboxregs[grreg]-1);
	   width_reg := anyptr(info2 + gboxregs[gwreg]-1);
	   status := anyptr(info2 + 2); { secondary gatorbox intr reg }
	   info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
						COLORMAP BASE ADDRESS}
	   crt := nil;
	   ww_reg := anyptr(info2 + gboxregs[gwreg]-1);
	end;
d867 14
a880 14
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + bobregs[bprreg]); {pixel rule reg}
	   width_reg := anyptr(info2 + bobregs[bwreg]); {window width reg}
	   status := anyptr(info2 + bobregs[bbusyreg]); {windowmover busy reg}
	   info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
						COLORMAP BASE ADDRESS}
	   if info2=info3 then
	    info3 := 0;                        {SET CMAP_ADDRESS TO 0 IF THERE
						IS NO COLORMAP}
	   crt := nil;
	   ww_reg := anyptr(info2 + bobregs[bwreg]);
	end;
d882 8
a889 8
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + (hex('4008')));
	   width_reg := anyptr(info2 + (hex('400c')));
	   status := anyptr(info2 + (hex('4000')));
	   crt := anyptr(info2 + (hex('6000')));
	end;
d895 1
a895 1
			   BITMAP DISPLAYS}
d932 41
a972 41
	munknown : { reserved } ;
	m9816a   : { 9816 }
	  begin
	    display_name := '9816A ';
	    display_name_char_count := 5;
	    display_res_x := 2.375;                { 168mm X 126mm }
	    display_res_y := 2.37301587301587;
	  end;
	m9826a :   { 9826 }
	  begin
	    display_name := '9826A ';
	    display_name_char_count := 5;
	    display_res_x := 3.325;                { 120mm X 90mm }
	    display_res_y := 3.322222222222222;
	  end;
	m9836a : { 9836 }
	  begin
	    display_name := '9836A ';
	    display_name_char_count := 5;
	    display_res_x := 2.433333333333333;     { 210mm X 160mm }
	    display_res_y := 2.43125;
	  end;
	m9836c : { 9836C }
	  begin
	    display_name := '9836C ';
	    display_name_char_count := 5;
	    display_res_x := 2.35483870967742;     { 217mm X 163mm }
	    display_res_y := 2.38650306748466;
	  end;
	m98627a : { 98627 }
	  begin
	    display_name := '98627A';
	    display_name_char_count := 6;
	    deviceaddress := info2;
	    display_res_x := 3.333333333333333;
	    display_res_y := 3.333333333333333;
	  end;
	m9837a : { Gator Black/White }
	  begin
	    display_name := '9837a ';
	    display_name_char_count := 5;
d974 157
a1130 142
	    {GATOR CONSTANTS CORRECTED 4/15/85 SFB}
	    display_res_x := 3.27884; {1023/312}    { 312mm X  234mm }
	    display_res_y := 3.27778; {767/234}
	    if info3 = 1 then                      {added to detect current}
	     begin                                  {ymax.                  }
	       n_glines := 768;
	       hard_ymax := 767;
	     end;
	    await_blanking := rdummy_proc;
	    setup_gator(gcb);
	    clear := gator_clear;
	    fill_index_color := gator_fill_index_color;
	    define_color_map := rdummy_proc;
	  end;
	mgatorbox:  { Gatorbox SFB 4/15/85}
	  begin
	    display_name := '98700A';           {SFB 6/11/85}
	    display_name_char_count := 6;
	    display_res_x := 2.841667;             {360mm X  270mm +/- 1.5%}
	    display_res_y := 2.840740;
	    if info3 = 1 then                      {added to detect current}
	     begin                                 {ymax.                  }
	       n_glines := 768;
	       hard_ymax := 767;
	     end;
	    setup_gatorbox(gcb);
	    clear := gatorbox_clear;
	  end;
	mbobcat,mbobcatlores,mcatseye,mcatseye_hrx:         {Bobcat SFB 4/15/85}
						    {added MCATSEYE SFB 9/09/86}
	  begin
	    setup_bobcat(gcb);
	    clear := bobcat_clear;
	    display_name_char_count := 6;
	    fill_index_color := bobcat_fill_index_color;
	    if   (info1 = mbobcat) or (info1 = mcatseye)
	      or (info1 = mcatseye_hrx)  then { bobcat hires }
	    begin
	      {assume 98545/98547/98549 and change later if necessary. SFB}
	      display_res_x := 2.841666667;     {360mm X  270mm +/- 1.5%}
	      display_res_y := 2.840740741;
	      if pallette = 1 then
	       if info1=mbobcat then
		 begin                            {hires mono}
		  display_name := '98544A';       {SFB 6/11/85, BUGFIX 9/09/86}
		  display_res_x := 3.27884;       {same as GATOR}
		  display_res_y := 3.27778;
		 end
	       else
		 begin                            {hires mono CATSEYE}
		  display_name := '98548A';       {SFB 2/9/86}
		  display_res_x := 3.728862974;   {19 inch monitor default}
		  display_res_y := 3.733576642;
		 end
	      else      {pallette <> 1}
	       begin                              {hires color}
		if info1 = mbobcat then
		 if gamut = 15 then               {ADDED SFB 9/09/86}
		  display_name := '98545A'        {SFB 6/11/85}
		 else
		  display_name := '98547A'        {HEXAGON SFB 9/09/86}
		else
		 if gamut=63 then
		  display_name := '98549A'        {LCC}
		 else
		  begin
		   display_name := '98550A';
		   display_res_x := 3.728862974;  {19 inch monitor default}
		   display_res_y := 3.733576642;
		  end;
	       end;
	      if info3 = 1 then                   {added to detect current}
	       if (display_name<>'98548A') and (display_name<>'98550A') then
								{SFB 2/9/88}
		 begin                            {ymax.                  }
		   n_glines  := 768;
		   hard_ymax := 767;
		 end
	       else
		 begin                             {ymax.                  }
		   n_glines  := 1024;       {true (to date) hi-res - SFB 2/9/88}
		   hard_ymax := 1023;
		 end;
	     end        {if info1 = mbobcat or mcatseye}
	    else        { bobcat lores }
	     begin      {color and mono have same spec}
	      display_res_x := 2.433333;
	      display_res_y := 2.432926;
	      if pallette = 1 then       {SFB 6/11/85}
	       display_name := '98542A'
	      else
	       display_name := '98543A';       {BUGFIX SFB 9/09/86}
	      if info3 = 1 then
	       begin
		n_glines  := 400;
		hard_ymax := 399;
	       end;
	     end;
	  end;
	mvga_woodcut:                                 {added WOODCUT CFB 8JUN91}
	  begin
	    setup_woodcut(gcb);
	    {fill_index_color := bobcat_fill_index_color;}
	    display_name := 'VGA   ';
	    display_name_char_count := 3;
	    display_res_x := 2.206896552;                     {~290x210mm (14")}
	    display_res_y := 2.285714286;
	    if info3 = 1 then
	    begin
	      n_glines  := 480;
	      hard_ymax := 479;
	    end;
	  end;
	mmed_woodcut:                                 {added WOODCUT CFB 8JUN91}
	  begin
	    setup_woodcut(gcb);
	    {fill_index_color := bobcat_fill_index_color;}
	    display_name := 'MEDIUM';
	    display_name_char_count := 6;
	    display_res_x := 3.413333333;                      {300x225mm (16")}
	    display_res_y := 3.413333333;
	    if info3 = 1 then
	    begin
	      n_glines  := 768;
	      hard_ymax := 767;
	    end;
	  end;
	mhrx_woodcut:                                 {added WOODCUT CFB 8JUN91}
	  begin
	    setup_woodcut(gcb);
	    {fill_index_color := bobcat_fill_index_color;}
	    display_name := 'HIRES ';
	    display_name_char_count := 5;
	    display_res_x := 3.764705882;                      {340x272mm (19")}
	    display_res_y := 3.764705882;
	    if info3 = 1 then
	    begin
	      n_glines  := 1000;
	      hard_ymax := 1023;
	    end;
	  end;
	end; {of case }
@


54.5
log
@
pws2rcs automatic delta on Wed Aug 21 12:59:22 MDT 1991
@
text
@@


54.4
log
@updated display resolution for VGA, MEDIUM, and HIRES - CFB
@
text
@d21 1
a21 1
                  RESTRICTED RIGHTS LEGEND
d33 7
a39 7
        'GLE_STEXT',
        'ASM_STEXT',
        'GLE_SCLIP',
        'ASM_SCLIP',
        'GLE_SMARK',
        'GLE_AUTL',
        'RGL'$
d60 4
a63 4
               map_red : gle_shortint;
               map_grn : gle_shortint;
               map_blu : gle_shortint;
             end;
d154 5
a158 5
                 enable_vg_intr, vg_intr,
                 enable_bm_intr, bm_busy,
                 enable_vsync_intr, vsync_intr,
                 not_hsync, enable_video :      boolean;
              end;
d163 2
a164 2
                 bsxreg, bsyreg, bdxreg, bdyreg, bmovereg, btcolreg,
                 bfben0reg {added 2/9/88 - SFB} );
d169 1
a169 1
                         hex('0002'), hex('6009'), hex('68BD')];
d171 4
a174 4
                         hex('4044'), hex('4090'),
                         hex('40F2'), hex('40F6'), hex('40FA'), hex('40FE'),
                         hex('409C'), hex('60BC'),
                         hex('4500') {added 2/9/88 - SFB} ];
d179 6
a184 6
                        bobcat type display. Note--topmask should be set to
                        0 before accessing any topcat registers, so we know
                        windowmover need not be tested for ready. Once we
                        are ready to do window moves, should set topmask to
                        gle_gcb^.gamut, so bobmoveready works!! This sequence
                        is implemented by setup_bobcat.}
d237 16
a252 16
               dpt1[t,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f],
               dpt1[t,f,f,f, f,f,f,f, f,f,t,f, f,f,f,f],
               dpt1[t,f,f,f, f,f,f,f, t,f,t,f, f,f,f,f],
               dpt1[t,f,t,f, f,f,f,f, t,f,t,f, f,f,f,f],
               dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,f],
               dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,t],
               dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,f,f,t],
               dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,t,f,t],
               dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,f,t],
               dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,t,t],
               dpt1[t,f,t,f, t,t,f,t, t,f,t,f, t,t,t,t],
               dpt1[t,f,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
               dpt1[t,t,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
               dpt1[t,t,t,f, t,t,t,t, t,f,t,t, t,t,t,t],
               dpt1[t,t,t,f, t,t,t,t, t,t,t,t, t,t,t,t],
               dpt1[t,t,t,t, t,t,t,t, t,t,t,t, t,t,t,t]];
d258 4
a261 4
        begin
          r := info2;
          g := info3;
          b := info4;
d263 3
a265 3
          current_polygon_red := r;
          current_polygon_green := g;
          current_polygon_blue := b;
d267 3
a269 3
          r := (r+32) div 64;
          g := (g+32) div 64;
          b := (b+32) div 64;
d271 3
a273 3
          red_intensity := r;
          grn_intensity := g;
          blu_intensity := b;
d275 3
a277 3
          i:=r;
          if i<g then i:=g;
          if i<b then i:=b;
d279 2
a280 2
          for j:=0 to 15 do dither_pattern[j]:=0;
          for j:=0 to 15 do if dp[i,j] then dither_pattern[j]:=1;
d282 3
a284 3
          if devicetype = gator_display then
           store_dit(gcb);
          end
d287 6
a292 6
        begin
          for i := 0 to 15 do
             dither_pattern[i] := info2;
          if devicetype = gator_display then
           store_dit(gcb);
        end;
d308 4
a311 4
        begin
          wait_ready;
          fb_ptr^ [i*1024] := 0;
        end;
d367 1
a367 1
                                          non-readable wp register }
d389 1
a389 1
                                    dominant }
d391 1
a391 1
                 some kind of escape}
d465 1
a465 1
                                             from Topcat - SFB 2/9/88 }
d474 1
a474 1
                                     Topcat - SFB 2/9/88 }
d480 1
a480 1
                 some kind of escape}
d542 1
a542 1
                            in sequence from plane 0 to plane n (n<=7) }
d569 1
a569 1
                  require wait on windowmover!!}
d611 1
a611 1
                            in sequence from plane 0 to plane n (n<=7) }
d726 1
a726 1
                                          it's a geometric sequence with r=2}
d778 8
a785 8
        n := (i - info1)*3;
        map_red := color_data_ptr^[n];
        map_grn := color_data_ptr^[n+1];
        map_blu := color_data_ptr^[n+2];
        if packed_map then
          temp_color_map[i] := (15-map_red div 64)*256 +
                               (15-map_grn div 64) * 16 +
                               (15-map_blu div 64);
d793 3
a795 3
        rawait_blanking(gcb);
        for i := info1 to info2 do
          color_map^[i] := temp_color_map[i];
d801 23
a823 23
        info2 := map_red div 4;
        info3 := map_grn div 4;
        info4 := map_blu div 4;
        if display_name = '98700A' then
        begin   {GATORBOX}
          info1 := i;
          if monitortype = 3 then   {discrete colormap SFB 6/11/85}
            setgboxcmap(gcb)
          else
            set_nereid(gcb);      {SFB 6/11/85}
        end
        else                              { WOODCUT support CFB 12JUN91 }
        if (display_name = 'VGA   ') or (display_name = 'MEDIUM')
        or (display_name = 'HIRES ') then
        begin
          info1 := i;
          set_wood_cmap(gcb);
        end
        else
        begin   {BOBCAT}
          info1 := 255-i;
          set_nereid(gcb);
        end;
d850 11
a860 11
        begin
           fb_ptr_ptr := info_ptr1;
           fb_ptr := anyptr(fb_ptr_ptr^);
           rule_reg := anyptr(info2 + gboxregs[grreg]-1);
           width_reg := anyptr(info2 + gboxregs[gwreg]-1);
           status := anyptr(info2 + 2); { secondary gatorbox intr reg }
           info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
                                                COLORMAP BASE ADDRESS}
           crt := nil;
           ww_reg := anyptr(info2 + gboxregs[gwreg]-1);
        end;
d863 14
a876 14
        begin
           fb_ptr_ptr := info_ptr1;
           fb_ptr := anyptr(fb_ptr_ptr^);
           rule_reg := anyptr(info2 + bobregs[bprreg]); {pixel rule reg}
           width_reg := anyptr(info2 + bobregs[bwreg]); {window width reg}
           status := anyptr(info2 + bobregs[bbusyreg]); {windowmover busy reg}
           info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
                                                COLORMAP BASE ADDRESS}
           if info2=info3 then
            info3 := 0;                        {SET CMAP_ADDRESS TO 0 IF THERE
                                                IS NO COLORMAP}
           crt := nil;
           ww_reg := anyptr(info2 + bobregs[bwreg]);
        end;
d878 8
a885 8
        begin
           fb_ptr_ptr := info_ptr1;
           fb_ptr := anyptr(fb_ptr_ptr^);
           rule_reg := anyptr(info2 + (hex('4008')));
           width_reg := anyptr(info2 + (hex('400c')));
           status := anyptr(info2 + (hex('4000')));
           crt := anyptr(info2 + (hex('6000')));
        end;
d891 1
a891 1
                           BITMAP DISPLAYS}
d928 41
a968 41
        munknown : { reserved } ;
        m9816a   : { 9816 }
          begin
            display_name := '9816A ';
            display_name_char_count := 5;
            display_res_x := 2.375;                { 168mm X 126mm }
            display_res_y := 2.37301587301587;
          end;
        m9826a :   { 9826 }
          begin
            display_name := '9826A ';
            display_name_char_count := 5;
            display_res_x := 3.325;                { 120mm X 90mm }
            display_res_y := 3.322222222222222;
          end;
        m9836a : { 9836 }
          begin
            display_name := '9836A ';
            display_name_char_count := 5;
            display_res_x := 2.433333333333333;     { 210mm X 160mm }
            display_res_y := 2.43125;
          end;
        m9836c : { 9836C }
          begin
            display_name := '9836C ';
            display_name_char_count := 5;
            display_res_x := 2.35483870967742;     { 217mm X 163mm }
            display_res_y := 2.38650306748466;
          end;
        m98627a : { 98627 }
          begin
            display_name := '98627A';
            display_name_char_count := 6;
            deviceaddress := info2;
            display_res_x := 3.333333333333333;
            display_res_y := 3.333333333333333;
          end;
        m9837a : { Gator Black/White }
          begin
            display_name := '9837a ';
            display_name_char_count := 5;
d970 142
a1111 142
            {GATOR CONSTANTS CORRECTED 4/15/85 SFB}
            display_res_x := 3.27884; {1023/312}    { 312mm X  234mm }
            display_res_y := 3.27778; {767/234}
            if info3 = 1 then                      {added to detect current}
             begin                                  {ymax.                  }
               n_glines := 768;
               hard_ymax := 767;
             end;
            await_blanking := rdummy_proc;
            setup_gator(gcb);
            clear := gator_clear;
            fill_index_color := gator_fill_index_color;
            define_color_map := rdummy_proc;
          end;
        mgatorbox:  { Gatorbox SFB 4/15/85}
          begin
            display_name := '98700A';           {SFB 6/11/85}
            display_name_char_count := 6;
            display_res_x := 2.841667;             {360mm X  270mm +/- 1.5%}
            display_res_y := 2.840740;
            if info3 = 1 then                      {added to detect current}
             begin                                 {ymax.                  }
               n_glines := 768;
               hard_ymax := 767;
             end;
            setup_gatorbox(gcb);
            clear := gatorbox_clear;
          end;
        mbobcat,mbobcatlores,mcatseye,mcatseye_hrx:         {Bobcat SFB 4/15/85}
                                                    {added MCATSEYE SFB 9/09/86}
          begin
            setup_bobcat(gcb);
            clear := bobcat_clear;
            display_name_char_count := 6;
            fill_index_color := bobcat_fill_index_color;
            if   (info1 = mbobcat) or (info1 = mcatseye)
              or (info1 = mcatseye_hrx)  then { bobcat hires }
            begin
              {assume 98545/98547/98549 and change later if necessary. SFB}
              display_res_x := 2.841666667;     {360mm X  270mm +/- 1.5%}
              display_res_y := 2.840740741;
              if pallette = 1 then
               if info1=mbobcat then
                 begin                            {hires mono}
                  display_name := '98544A';       {SFB 6/11/85, BUGFIX 9/09/86}
                  display_res_x := 3.27884;       {same as GATOR}
                  display_res_y := 3.27778;
                 end
               else
                 begin                            {hires mono CATSEYE}
                  display_name := '98548A';       {SFB 2/9/86}
                  display_res_x := 3.728862974;   {19 inch monitor default}
                  display_res_y := 3.733576642;
                 end
              else      {pallette <> 1}
               begin                              {hires color}
                if info1 = mbobcat then
                 if gamut = 15 then               {ADDED SFB 9/09/86}
                  display_name := '98545A'        {SFB 6/11/85}
                 else
                  display_name := '98547A'        {HEXAGON SFB 9/09/86}
                else
                 if gamut=63 then
                  display_name := '98549A'        {LCC}
                 else
                  begin
                   display_name := '98550A';
                   display_res_x := 3.728862974;  {19 inch monitor default}
                   display_res_y := 3.733576642;
                  end;
               end;
              if info3 = 1 then                   {added to detect current}
               if (display_name<>'98548A') and (display_name<>'98550A') then
                                                                {SFB 2/9/88}
                 begin                            {ymax.                  }
                   n_glines  := 768;
                   hard_ymax := 767;
                 end
               else
                 begin                             {ymax.                  }
                   n_glines  := 1024;       {true (to date) hi-res - SFB 2/9/88}
                   hard_ymax := 1023;
                 end;
             end        {if info1 = mbobcat or mcatseye}
            else        { bobcat lores }
             begin      {color and mono have same spec}
              display_res_x := 2.433333;
              display_res_y := 2.432926;
              if pallette = 1 then       {SFB 6/11/85}
               display_name := '98542A'
              else
               display_name := '98543A';       {BUGFIX SFB 9/09/86}
              if info3 = 1 then
               begin
                n_glines  := 400;
                hard_ymax := 399;
               end;
             end;
          end;
        mvga_woodcut:                                 {added WOODCUT CFB 8JUN91}
          begin
            setup_woodcut(gcb);
            {fill_index_color := bobcat_fill_index_color;}
            display_name := 'VGA   ';
            display_name_char_count := 3;
            display_res_x := 2.206896552;                     {~290x210mm (14")}
            display_res_y := 2.285714286;
            if info3 = 1 then
            begin
              n_glines  := 480;
              hard_ymax := 479;
            end;
          end;
        mmed_woodcut:                                 {added WOODCUT CFB 8JUN91}
          begin
            setup_woodcut(gcb);
            {fill_index_color := bobcat_fill_index_color;}
            display_name := 'MEDIUM';
            display_name_char_count := 6;
            display_res_x := 3.413333333;                      {300x225mm (16")}
            display_res_y := 3.413333333;
            if info3 = 1 then
            begin
              n_glines  := 768; 
              hard_ymax := 767; 
            end;
          end;
        mhrx_woodcut:                                 {added WOODCUT CFB 8JUN91}
          begin
            setup_woodcut(gcb);
            {fill_index_color := bobcat_fill_index_color;}
            display_name := 'HIRES ';
            display_name_char_count := 5;
            display_res_x := 3.764705882;                      {340x272mm (19")}
            display_res_y := 3.764705882;
            if info3 = 1 then
            begin
              n_glines  := 1000; 
              hard_ymax := 1023; 
            end;
          end;
        end; {of case }
@


54.3
log
@removed . from include file names - CFB
@
text
@d1075 2
a1076 2
            display_res_x := 2.782608696;                     {~230x170mm (14")}
            display_res_y := 2.823529412;
d1089 2
a1090 2
            display_res_x := 2.392982457;                          {16" default}
            display_res_y := 2.392202729;
d1103 2
a1104 2
            display_res_x := 2.392982457;                          {16" default}
            display_res_y := 2.392202729;
@


54.2
log
@Added support for WOODCUT graphics hardware - CFB
@
text
@d41 1
a41 1
$include 'OPTIONS.'$       { ****************** COMPILER OPTIONS ********************** }
@


54.1
log
@Automatic bump of revision number for PWS version 3.24
@
text
@d21 1
a21 1
		  RESTRICTED RIGHTS LEGEND
d33 7
a39 7
	'GLE_STEXT',
	'ASM_STEXT',
	'GLE_SCLIP',
	'ASM_SCLIP',
	'GLE_SMARK',
	'GLE_AUTL',
	'RGL'$
d41 1
a41 1
$include 'OPTIONS'$       { ****************** COMPILER OPTIONS ********************** }
d60 4
a63 4
	       map_red : gle_shortint;
	       map_grn : gle_shortint;
	       map_blu : gle_shortint;
	     end;
d125 3
d154 5
a158 5
		 enable_vg_intr, vg_intr,
		 enable_bm_intr, bm_busy,
		 enable_vsync_intr, vsync_intr,
		 not_hsync, enable_video :      boolean;
	      end;
d163 2
a164 2
		 bsxreg, bsyreg, bdxreg, bdyreg, bmovereg, btcolreg,
		 bfben0reg {added 2/9/88 - SFB} );
d169 1
a169 1
			 hex('0002'), hex('6009'), hex('68BD')];
d171 4
a174 4
			 hex('4044'), hex('4090'),
			 hex('40F2'), hex('40F6'), hex('40FA'), hex('40FE'),
			 hex('409C'), hex('60BC'),
			 hex('4500') {added 2/9/88 - SFB} ];
d179 6
a184 6
			bobcat type display. Note--topmask should be set to
			0 before accessing any topcat registers, so we know
			windowmover need not be tested for ready. Once we
			are ready to do window moves, should set topmask to
			gle_gcb^.gamut, so bobmoveready works!! This sequence
			is implemented by setup_bobcat.}
d237 16
a252 16
	       dpt1[t,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, f,f,t,f, f,f,f,f],
	       dpt1[t,f,f,f, f,f,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,f,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,f],
	       dpt1[t,f,t,f, f,t,f,f, t,f,t,f, f,f,f,t],
	       dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,f,f,t],
	       dpt1[t,f,t,f, f,t,f,t, t,f,t,f, f,t,f,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,f,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, f,t,t,t],
	       dpt1[t,f,t,f, t,t,f,t, t,f,t,f, t,t,t,t],
	       dpt1[t,f,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,f,t,f, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,f,t,t, t,t,t,t],
	       dpt1[t,t,t,f, t,t,t,t, t,t,t,t, t,t,t,t],
	       dpt1[t,t,t,t, t,t,t,t, t,t,t,t, t,t,t,t]];
d258 4
a261 4
	begin
	  r := info2;
	  g := info3;
	  b := info4;
d263 3
a265 3
	  current_polygon_red := r;
	  current_polygon_green := g;
	  current_polygon_blue := b;
d267 3
a269 3
	  r := (r+32) div 64;
	  g := (g+32) div 64;
	  b := (b+32) div 64;
d271 3
a273 3
	  red_intensity := r;
	  grn_intensity := g;
	  blu_intensity := b;
d275 3
a277 3
	  i:=r;
	  if i<g then i:=g;
	  if i<b then i:=b;
d279 2
a280 2
	  for j:=0 to 15 do dither_pattern[j]:=0;
	  for j:=0 to 15 do if dp[i,j] then dither_pattern[j]:=1;
d282 3
a284 3
	  if devicetype = gator_display then
	   store_dit(gcb);
	  end
d287 6
a292 6
	begin
	  for i := 0 to 15 do
	     dither_pattern[i] := info2;
	  if devicetype = gator_display then
	   store_dit(gcb);
	end;
d308 4
a311 4
	begin
	  wait_ready;
	  fb_ptr^ [i*1024] := 0;
	end;
d367 1
a367 1
					  non-readable wp register }
d389 1
a389 1
				    dominant }
d391 1
a391 1
		 some kind of escape}
d444 1
d465 1
a465 1
					     from Topcat - SFB 2/9/88 }
d474 1
a474 1
				     Topcat - SFB 2/9/88 }
d480 1
a480 1
		 some kind of escape}
d542 1
a542 1
			    in sequence from plane 0 to plane n (n<=7) }
d569 1
a569 1
		  require wait on windowmover!!}
d592 1
a592 1
  setbobreg(bwenreg,-256 {hex('ff00')} );       {write enable all planes}
d611 1
a611 1
			    in sequence from plane 0 to plane n (n<=7) }
d625 30
d658 3
a660 2
 aptrtype = ^anyptr;
 four_row_array = packed array[0..3,0..1023] of char;
d662 5
a666 4
 move_width,
 first_fill_row,
 i,nmoves        : gle_shortint;
 fill_area       : ^four_row_array;
d669 1
a669 1
 with gcb^, raster_device_rec_ptr(dev_dep_stuff)^ do
d671 4
a674 4
   if gamut<>1 then
    rfill_index_color( gcb )      {set up dither_pattern with fill pattern}
   else
    gator_fill_index_color( gcb );
d677 2
a678 2
 if (devicetype = catseye_display) or (devicetype = catseye_hrx_display) then
   begin
d681 4
a684 4
   end;
 {will use TRR, not offscreen Framebuf to hold
  area fill pattern. See rfill_index_color in
  RGL - SFB 2/9/88}
d687 2
a688 2
 {now get pointer to last four pixel rows on screen, by using rgl info
  on start of frame buffer and ID ROM info on height of frame buffer}
d690 2
a691 2
   first_fill_row := romval(9) - 4;  {fourth last framebuf row}
   fill_area := anyptr(integer(aptrtype(plane1_addr)^) + first_fill_row*1024);
d693 2
a694 2
   setbobreg(bwenreg, 256*gamut);
   setbobreg(bprreg,  256*3);
d696 3
a698 3
   if devicetype = bobcat_display then
    begin
     for i:=0 to 15 do    {copy dither_pattern to offscreen area at left edge}
d700 3
a702 3
     nmoves := 7;
     move_width := 4;
    end;
d704 3
a706 1
   if devicetype = bobcat_lores_display then
d708 2
a709 7
     for i:=0 to 15 do    {copy dither_pattern to offscreen area at left edge}
      begin
       fill_area^[i div 4, (i mod 4)*2    ] := chr(dither_pattern[i]);
       fill_area^[i div 4, (i mod 4)*2 + 1] := chr(dither_pattern[i]);
      end;
     nmoves := 6;
     move_width := 8;
d711 3
d716 5
a720 5
   setbobreg(bhreg, 4);
   setbobreg(bsxreg, 0);
   setbobreg(bsyreg, first_fill_row);
   setbobreg(bdyreg, first_fill_row);
   setbobreg(bwrreg, 3);
d722 2
a723 2
   for i := 0 to nmoves do
   begin
d726 1
a726 1
					  it's a geometric sequence with r=2}
d729 2
a730 2
   end;
  end;  {with}
d764 25
d790 36
a825 52
      packed_map := true;
      if   (display_name = '98700A')    {gbox or any bobcat SFB 6/11/85}
	or (display_name = '98542A') or (display_name = '98543A')
	or (display_name = '98544A') or (display_name = '98545A')
	or (display_name = '98547A') or (display_name = '98548A')      {SFB}
	or (display_name = '98549A') or (display_name = '98550A') then {SFB}
       packed_map := false;
      color_data_ptr := info_ptr1;
      for i := info1 to info2 do
	 with system_cmap[i] do
	  begin
	    n := (i - info1)*3;
	    map_red := color_data_ptr^[n];
	    map_grn := color_data_ptr^[n+1];
	    map_blu := color_data_ptr^[n+2];
	    if packed_map then
	     temp_color_map[i] := (15-map_red div 64)*256 +
				  (15-map_grn div 64) * 16 +
				  (15-map_blu div 64);
	  end;

      if color_map_support = yes then
	begin
	  color_map := anyptr(cmap_address);
	  if packed_map then
	   begin
	    rawait_blanking(gcb);
	    for i := info1 to info2 do
	     color_map^[i] := temp_color_map[i];
	   end
	  else { unpacked map }
	    for i:= info1 to info2 do
	     with system_cmap[i] do
	      begin
	       info2 := map_red div 4;
	       info3 := map_grn div 4;
	       info4 := map_blu div 4;
	       if display_name = '98700A' then
		begin   {GATORBOX}
		 info1 := i;
		 if monitortype = 3 then   {discrete colormap SFB 6/11/85}
		   setgboxcmap(gcb)
		 else
		  set_nereid(gcb);      {SFB 6/11/85}
		end
	       else
		begin   {BOBCAT}
		 info1 := 255-i;
		 set_nereid(gcb);
		end;
	      end;
	end;
d831 1
a831 1
    end;
d844 1
d848 1
d850 11
a860 11
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + gboxregs[grreg]-1);
	   width_reg := anyptr(info2 + gboxregs[gwreg]-1);
	   status := anyptr(info2 + 2); { secondary gatorbox intr reg }
	   info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
						COLORMAP BASE ADDRESS}
	   crt := nil;
	   ww_reg := anyptr(info2 + gboxregs[gwreg]-1);
	end;
d862 15
a876 15
      or (info1=mcatseye {SFB}) or (info1=mcatseye_hrx {SFB})then
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + bobregs[bprreg]); {pixel rule reg}
	   width_reg := anyptr(info2 + bobregs[bwreg]); {window width reg}
	   status := anyptr(info2 + bobregs[bbusyreg]); {windowmover busy reg}
	   info3 := info2 + romval(hex('33')); {RGCBINIT WANTS INFO3 =
						COLORMAP BASE ADDRESS}
	   if info2=info3 then
	    info3 := 0;                        {SET CMAP_ADDRESS TO 0 IF THERE
						IS NO COLORMAP}
	   crt := nil;
	   ww_reg := anyptr(info2 + bobregs[bwreg]);
	end;
d878 8
a885 8
	begin
	   fb_ptr_ptr := info_ptr1;
	   fb_ptr := anyptr(fb_ptr_ptr^);
	   rule_reg := anyptr(info2 + (hex('4008')));
	   width_reg := anyptr(info2 + (hex('400c')));
	   status := anyptr(info2 + (hex('4000')));
	   crt := anyptr(info2 + (hex('6000')));
	end;
d891 1
a891 1
			   BITMAP DISPLAYS}
d928 41
a968 41
	munknown : { reserved } ;
	m9816a   : { 9816 }
	  begin
	    display_name := '9816A ';
	    display_name_char_count := 5;
	    display_res_x := 2.375;                { 168mm X 126mm }
	    display_res_y := 2.37301587301587;
	  end;
	m9826a :   { 9826 }
	  begin
	    display_name := '9826A ';
	    display_name_char_count := 5;
	    display_res_x := 3.325;                { 120mm X 90mm }
	    display_res_y := 3.322222222222222;
	  end;
	m9836a : { 9836 }
	  begin
	    display_name := '9836A ';
	    display_name_char_count := 5;
	    display_res_x := 2.433333333333333;     { 210mm X 160mm }
	    display_res_y := 2.43125;
	  end;
	m9836c : { 9836C }
	  begin
	    display_name := '9836C ';
	    display_name_char_count := 5;
	    display_res_x := 2.35483870967742;     { 217mm X 163mm }
	    display_res_y := 2.38650306748466;
	  end;
	m98627a : { 98627 }
	  begin
	    display_name := '98627A';
	    display_name_char_count := 6;
	    deviceaddress := info2;
	    display_res_x := 3.333333333333333;
	    display_res_y := 3.333333333333333;
	  end;
	m9837a : { Gator Black/White }
	  begin
	    display_name := '9837a ';
	    display_name_char_count := 5;
d970 142
a1111 100
	    {GATOR CONSTANTS CORRECTED 4/15/85 SFB}
	    display_res_x := 3.27884; {1023/312}    { 312mm X  234mm }
	    display_res_y := 3.27778; {767/234}
	    if info3 = 1 then                      {added to detect current}
	     begin                                  {ymax.                  }
	       n_glines := 768;
	       hard_ymax := 767;
	     end;
	    await_blanking := rdummy_proc;
	    setup_gator(gcb);
	    clear := gator_clear;
	    fill_index_color := gator_fill_index_color;
	    define_color_map := rdummy_proc;
	  end;
	mgatorbox:  { Gatorbox SFB 4/15/85}
	  begin
	    display_name := '98700A';           {SFB 6/11/85}
	    display_name_char_count := 6;
	    display_res_x := 2.841667;             {360mm X  270mm +/- 1.5%}
	    display_res_y := 2.840740;
	    if info3 = 1 then                      {added to detect current}
	     begin                                 {ymax.                  }
	       n_glines := 768;
	       hard_ymax := 767;
	     end;
	    setup_gatorbox(gcb);
	    clear := gatorbox_clear;
	  end;
	mbobcat,mbobcatlores,mcatseye,mcatseye_hrx:  { Bobcat SFB 4/15/85}
					{ added MCATSEYE SFB 9/09/86}
	  begin
	    setup_bobcat(gcb);
	    clear := bobcat_clear;
	    display_name_char_count := 6;
	    fill_index_color := bobcat_fill_index_color;
	    if (info1 = mbobcat) or (info1 = mcatseye)
	    or (info1 = mcatseye_hrx)  then { bobcat hires }
	     begin
	      {assume 98545/98547/98549 and change later if necessary. SFB}
	      display_res_x := 2.841666667;     {360mm X  270mm +/- 1.5%}
	      display_res_y := 2.840740741;
	      if pallette = 1 then
	       if info1=mbobcat then
		 begin                            {hires mono}
		  display_name := '98544A';       {SFB 6/11/85, BUGFIX 9/09/86}
		  display_res_x := 3.27884;       {same as GATOR}
		  display_res_y := 3.27778;
		 end
	       else
		 begin                            {hires mono CATSEYE}
		  display_name := '98548A';       {SFB 2/9/86}
		  display_res_x := 3.728862974;   {19 inch monitor default}
		  display_res_y := 3.733576642;
		 end
	      else      {pallette <> 1}
	       begin                              {hires color}
		if info1 = mbobcat then
		 if gamut = 15 then               {ADDED SFB 9/09/86}
		  display_name := '98545A'        {SFB 6/11/85}
		 else
		  display_name := '98547A'        {HEXAGON SFB 9/09/86}
		else
		 if gamut=63 then
		  display_name := '98549A'        {LCC}
		 else
		  begin
		   display_name := '98550A';
		   display_res_x := 3.728862974;  {19 inch monitor default}
		   display_res_y := 3.733576642;
		  end;
	       end;
	      if info3 = 1 then                   {added to detect current}
	       if (display_name<>'98548A') and (display_name<>'98550A') then
								{SFB 2/9/88}
		 begin                            {ymax.                  }
		   n_glines  := 768;
		   hard_ymax := 767;
		 end
	       else
		begin                             {ymax.                  }
		   n_glines  := 1024;             {true (to date) hi-res - SFB 2/9/88}
		   hard_ymax := 1023;
		 end;
	     end        {if info1 = mbobcat or mcatseye}
	    else        { bobcat lores }
	     begin      {color and mono have same spec}
	      display_res_x := 2.433333;
	      display_res_y := 2.432926;
	      if pallette = 1 then       {SFB 6/11/85}
	       display_name := '98542A'
	      else
	       display_name := '98543A';       {BUGFIX SFB 9/09/86}
	      if info3 = 1 then
	       begin
		n_glines  := 400;
		hard_ymax := 399;
	       end;
	     end;
	  end;
	end; {of case }
a1112 1

d1121 4
a1124 2
      info1 := 0; info2 := display_max_x;
      info3 := 0; info4 := display_max_y;
@


53.1
log
@Automatic bump of revision number for PWS version 3.24B
@
text
@@


52.1
log
@Automatic bump of revision number for PWS version 3.24A
@
text
@@


51.1
log
@Automatic bump of revision number for PWS version 3.24d
@
text
@@


50.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


49.1
log
@Automatic bump of revision number for PWS version 3.24b
@
text
@@


48.1
log
@Automatic bump of revision number for PWS version 3.24a
@
text
@@


47.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


46.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


45.1
log
@Automatic bump of revision number for PWS version 3.23C
@
text
@@


44.1
log
@Automatic bump of revision number for PWS version 3.23B
@
text
@@


43.1
log
@Automatic bump of revision number for PWS version 3.23aA
@
text
@@


42.1
log
@Automatic bump of revision number for PWS version 3.23e
@
text
@@


41.1
log
@Automatic bump of revision number for PWS version 3.23d
@
text
@@


40.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


39.1
log
@Automatic bump of revision number for PWS version 3.23b
@
text
@@


38.1
log
@Automatic bump of revision number for PWS version 3.23a
@
text
@@


37.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


36.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


35.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


34.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


33.1
log
@Automatic bump of revision number for PWS version 3.22D
@
text
@@


32.1
log
@Automatic bump of revision number for PWS version 3.22C
@
text
@@


31.1
log
@Automatic bump of revision number for PWS version 3.22B
@
text
@@


30.1
log
@Automatic bump of revision number for PWS version 3.22A
@
text
@@


29.1
log
@Automatic bump of revision number for PWS version 3.22b
@
text
@@


28.1
log
@Automatic bump of revision number for PWS version 3.3b
@
text
@@


27.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


26.1
log
@Automatic bump of revision number for PWS version 3.3 Synch
@
text
@@


25.2
log
@For CATSEYE support
@
text
@@


25.1
log
@Automatic bump of revision number for PWS version 3.2Y
@
text
@d123 2
d160 2
a161 1
		 bsxreg, bsyreg, bdxreg, bdyreg, bmovereg, btcolreg);
d170 2
a171 1
			 hex('409C'), hex('60BC')];
d460 2
d469 2
d571 11
a581 1
  set_6845s (gcb);
d583 4
a618 1

d622 1
d632 1
d641 10
d695 1
a695 1
end;
d733 2
a734 1
	or (display_name = '98547A') or (display_name = '98549A') then
d793 1
a793 1
  tempinfo3, tempinfo1 : integer;       {SFB 9/09/86}
d799 3
a801 3
      tempinfo1 := info1;
      if info1 = mcatseye then  {fake it for rgcbinit SFB 9/09/86}
       info1 := mbobcat;
d814 2
a815 1
      if (info1 = mbobcat) or (info1 = mbobcatlores) then
d840 1
d842 1
d845 1
a845 1
      info1 := tempinfo1; {NOW LET DISPLAY NAME BE SET CORRECTLY SFB 9/09/86}
d951 1
a951 1
	mbobcat,mbobcatlores,mcatseye:  { Bobcat SFB 4/15/85}
d958 2
a959 1
	    if (info1 = mbobcat) or (info1 = mcatseye)  then { bobcat hires }
d961 3
d965 14
a978 7
	       begin                                {hires mono}
		display_name := '98544A';       {SFB 6/11/85, BUGFIX 9/09/86}
		display_res_x := 3.27884;           {same as GATOR}
		display_res_y := 3.27778;
	       end
	      else
	       begin                                {hires color}
d980 2
a981 2
		 if gamut = 15 then       {ADDED SFB 9/09/86}
		  display_name := '98545A'            {SFB 6/11/85}
d985 8
a992 3
		 display_name := '98549A';  {change when known SFB 9/09/86}
		display_res_x := 2.841667;          {360mm X  270mm +/- 1.5%}
		display_res_y := 2.840740;
d994 13
a1006 6
	      if info3 = 1 then                      {added to detect current}
	      begin                                  {ymax.                  }
		n_glines  := 768;
		hard_ymax := 767;
	      end;
	     end        {if info1 = mbobcat}
@


24.1
log
@Automatic bump of revision number for PWS version 3.2
@
text
@@


23.1
log
@Automatic bump of revision number for PWS version 3.2P
@
text
@@


22.1
log
@Automatic bump of revision number for PWS version 3.2N
@
text
@@


21.1
log
@Automatic bump of revision number for PWS version 3.2M
@
text
@@


20.1
log
@Automatic bump of revision number for PWS version 3.2L
@
text
@@


19.1
log
@Automatic bump of revision number for PWS version 3.2K
@
text
@@


18.1
log
@Automatic bump of revision number for PWS version 3.2J
@
text
@@


17.1
log
@Automatic bump of revision number for PWS version 3.2I+
@
text
@@


16.1
log
@Automatic bump of revision number for PWS version 3.2I
@
text
@@


15.1
log
@Automatic bump of revision number for PWS version 3.2H
@
text
@@


14.1
log
@Automatic bump of revision number for PWS version 3.2G
@
text
@@


13.1
log
@Automatic bump of revision number for PWS version 3.2F
@
text
@@


12.1
log
@Automatic bump of revision number for PWS version 3.2E
@
text
@@


11.1
log
@Automatic bump of revision number for PWS version 3.2D
@
text
@@


10.1
log
@Automatic bump of revision number for PWS version 3.2C
@
text
@@


9.1
log
@Automatic bump of revision number for PWS version 3.2B
@
text
@@


8.1
log
@Automatic bump of revision number for PWS version 3.2A
@
text
@@


7.1
log
@Automatic bump of revision number for PWS version 3.2l
@
text
@@


6.2
log
@Pws2unix automatic delta on Wed Nov 19 15:16:12 MST 1986
@
text
@@


6.1
log
@Automatic bump of revision number for PWS version 3.2k
@
text
@d345 6
a350 2
{ clears gatorbox planes with 1 in info1 to 0 in frame buffer, using tiler }
{ except if info1 = 0, then clear all planes }
d358 1
a358 1
  if info1 <> 0 then
d365 1
a365 1
  setgboxreg(ghreg,depth);        { set height to 192 tiles }
d369 10
d430 6
a435 2
{ clears bobcat planes with 1 in info1 to 0 in frame buffer, using mover }
{ except if info1 = 0, then clear all planes }
d449 3
a451 1
  setbobreg(bhreg,romval(17));    { set height to visible display height }
a971 1

@


5.2
log
@Changes from Scott Bayes
@
text
@@


5.1
log
@Automatic bump of revision number for PWS version 3.2j
@
text
@d437 9
d679 2
a680 1
	or (display_name = '98544A') or (display_name = '98545A') then
d739 1
a739 1
  tempinfo3 : integer;
d745 3
d788 1
d894 2
a895 1
	mbobcat,mbobcatlores:  { Bobcat SFB 4/15/85}
d901 1
a901 1
	    if info1 = mbobcat then { bobcat hires }
d905 1
a905 1
		display_name := '98543A';           {SFB 6/11/85}
d911 7
a917 1
		display_name := '98545A';           {SFB 6/11/85}
d934 1
a934 1
	       display_name := '98544A';
@


4.1
log
@Automatic bump of revision number for PWS version 3.2i
@
text
@@


3.3
log
@Revert to 3.1 version so we can turn 3.2i.
@
text
@@


3.2
log
@Changes from Scott Bayes.
@
text
@a436 9

  {below is bugfix for mono display clear_display SFB 9/16/86}
  with gcb^ do
  if info2 <> 0 then    {we're asked to setframe buffer to value info2}
   begin
    setbobreg(bwrreg, 15);          { write 1s}
    setbobreg(bmovereg, info2*256); { trigger window move }
   end;

d729 1
a729 1
  tempinfo3, tempinfo1 : integer;       {SFB 9/09/86}
a734 3
      tempinfo1 := info1;
      if info1 = mcatseye then  {fake it for rgcbinit SFB 9/09/86}
       info1 := mbobcat;
a774 1
      info1 := tempinfo1; {NOW LET DISPLAY NAME BE SET CORRECTLY SFB 9/09/86}
d880 1
a880 2
	mbobcat,mbobcatlores,mcatseye:  { Bobcat SFB 4/15/85}
					{ added MCATSEYE SFB 9/09/86}
d886 1
a886 1
	    if (info1 = mbobcat) or (info1 = mcatseye)  then { bobcat hires }
d890 1
a890 1
		display_name := '98544A';       {SFB 6/11/85, BUGFIX 9/09/86}
d896 1
a896 7
		if info1 = mbobcat then
		 if gamut = 15 then       {ADDED SFB 9/09/86}
		  display_name := '98545A'            {SFB 6/11/85}
		 else
		  display_name := '98547A'        {HEXAGON SFB 9/09/86}
		else
		 display_name := 'CATS-I';  {change when known SFB 9/09/86}
d913 1
a913 1
	       display_name := '98543A';       {BUGFIX SFB 9/09/86}
@


3.1
log
@Automatic bump of revision number for PWS version 3.2h
@
text
@d437 9
d738 1
a738 1
  tempinfo3 : integer;
d744 3
d787 1
d893 2
a894 1
	mbobcat,mbobcatlores:  { Bobcat SFB 4/15/85}
d900 1
a900 1
	    if info1 = mbobcat then { bobcat hires }
d904 1
a904 1
		display_name := '98543A';           {SFB 6/11/85}
d910 7
a916 1
		display_name := '98545A';           {SFB 6/11/85}
d933 1
a933 1
	       display_name := '98544A';
@


2.1
log
@Auto bump rev number to 2.1 for sys 3.2e.
@
text
@@


1.1
log
@Initial revision
@
text
@@
