home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / PCHERC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-11  |  2.6 KB  |  101 lines

  1. /*
  2.     pcherc.c
  3.  
  4.     % Hercules device interface routines
  5.  
  6.     11/13/88  by Ted.
  7.  
  8.     OWL 1.1
  9.     Copyright (c) 1988, by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.     01/10/89 ted    Removed redundant disp clip.
  15.      1/18/89 Ted    changed call to PlotText for simplified interface.
  16.      6/28/89 ted    removed dispid and changed mmwidth/height to x/ypixperm
  17.      7/10/89 ted    installed new text-plotting approach.
  18.      7/12/89 ted    Added OSTATIC's and '_func' macros.
  19.      8/22/89 ted    Added fontdesc_struct elements to def_font initialization.
  20. */
  21.  
  22. #include "pcpriv.h"
  23.  
  24. OSTATIC pc_setinfo_func     (herc_setinfo);
  25. /* -------------------------------------------------------------------------- */
  26.  
  27. boolean pc_ModeHerc(digp)
  28.     dig_struct *digp;
  29. {
  30.     return(pc_OpenHerc(digp, PCMODE_HERC0));
  31. }
  32. /* -------------------------------------------------------------------------- */
  33.  
  34. boolean DIGPRIV pc_OpenHerc(digp, mode)
  35.     dig_struct *digp;
  36.     int mode;
  37. {
  38.     if (!pc_OpenDIG(digp, mode, herc_setinfo)) {
  39.         return(FALSE);
  40.     }
  41.     pc_setgfuncs(digp);
  42.     return(TRUE);
  43. }
  44. /* -------------------------------------------------------------------------- */
  45.  
  46. static dispinfo_struct hercinfo = {
  47.     {'I','B','M',' ', 'P','C',' ','H', 'E','R','C',' ',
  48.      'G','R','A','P', 'H','I','C','S', 0,0},            /* devname */
  49.     PCMODE_HERC0,    /* mode */
  50.     0, 0,            /* xpixperm, ypixperm */
  51.     &pcdatastruc.dmspace, /* dispmap */
  52.     VID_HERC0ADDR,    /* dispaddr */
  53.     90,                /* bytewidth */
  54.     2,                /* ileave */
  55.     VID_HERCBLOCK,    /* ilsize */
  56.     1,                /* nplanes */
  57.     1,                /* pixbits */
  58.  
  59.     2L,                /* ncolors */
  60.     DTYPE_MONOCHROME, /* color type */
  61.     (ocolmap_type)&pcdefmcmap,    /* defcolmap */
  62.  
  63.     FALSE,            /* hardcursor */
  64.     BO_LSBYTFIRST,    /* byteorder */
  65.     {                /* def_font */
  66.         0,                /* fontid */
  67.         { 8, 14, 0, 0,0,0, 0 },        /* real: width, height, style, etc. */
  68.         { 8, 14, 0, 0,0,0, 0 }        /* req:  width, height, style, etc. */
  69.     }
  70. };
  71. /* -------------------------------------------------------------------------- */
  72.  
  73. static boolean DIGPRIV herc_setinfo(mode)
  74.     int mode;
  75. {
  76. /* Set up the device info structure */
  77.     memmove(&pcdata->info, &hercinfo, sizeof(dispinfo_struct));
  78.     pc_initdispmap(720, 350);
  79.  
  80.     pcdata->info.mode = mode;
  81.     if (mode == PCMODE_HERC0) {
  82.         pcdata->info.dispaddr = VID_HERC0ADDR;
  83.     }
  84.     else {
  85.         pcdata->info.dispaddr = VID_HERC1ADDR;
  86.     }
  87.     /* Set up stuff for font plotter */
  88.     pcdata->attrcols = pc_attrcols;
  89.     pcdata->plotchar = pc_1bitplotchar;
  90.  
  91.     pcdata->fontoffs0 = hercfont_offs;
  92.     pcdata->fontseg0  = hercfont_seg;
  93.  
  94.     pchdata->xmouscale = 1;
  95.     pchdata->ymouscale = 1;
  96.  
  97.     return(TRUE);
  98. }
  99. /* -------------------------------------------------------------------------- */
  100.  
  101.