home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / PCHERC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-29  |  2.6 KB  |  98 lines

  1. /*
  2.     pcherc.c
  3.  
  4.     % Hercules device interface routines
  5.  
  6.     11/13/88  by Ted.
  7.  
  8.     OWL-PC 1.2
  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.      3/28/90 jmd    ansi-fied
  21. */
  22.  
  23. #include "pcpriv.h"
  24.  
  25. OSTATIC pc_setinfo_func     (herc_setinfo);
  26. /* -------------------------------------------------------------------------- */
  27.  
  28. boolean pc_ModeHerc(dig_struct *digp)
  29. {
  30.     return(pc_OpenHerc(digp, PCMODE_HERC0));
  31. }
  32. /* -------------------------------------------------------------------------- */
  33.  
  34. boolean DIGPRIV pc_OpenHerc(dig_struct *digp, int mode)
  35. {
  36.     if (!pc_OpenDIG(digp, mode, herc_setinfo)) {
  37.         return(FALSE);
  38.     }
  39.     pc_setgfuncs(digp);
  40.     return(TRUE);
  41. }
  42. /* -------------------------------------------------------------------------- */
  43.  
  44. static dispinfo_struct hercinfo = {
  45.     {'I','B','M',' ', 'P','C',' ','H', 'E','R','C',' ',
  46.      'G','R','A','P', 'H','I','C','S', 0,0},            /* devname */
  47.     PCMODE_HERC0,    /* mode */
  48.     0, 0,            /* xpixperm, ypixperm */
  49.     &pcdatastruc.dmspace, /* dispmap */
  50.     VID_HERC0ADDR,    /* dispaddr */
  51.     90,                /* bytewidth */
  52.     2,                /* ileave */
  53.     VID_HERCBLOCK,    /* ilsize */
  54.     1,                /* nplanes */
  55.     1,                /* pixbits */
  56.  
  57.     2L,                /* ncolors */
  58.     DTYPE_MONOCHROME, /* color type */
  59.     (ocolmap_type)&pcdefmcmap,    /* defcolmap */
  60.  
  61.     FALSE,            /* hardcursor */
  62.     BO_LSBYTFIRST,    /* byteorder */
  63.     {                /* def_font */
  64.         0,                /* fontid */
  65.         { 8, 14, 0, 0,0,0, 0 },        /* real: width, height, style, etc. */
  66.         { 8, 14, 0, 0,0,0, 0 }        /* req:  width, height, style, etc. */
  67.     }
  68. };
  69. /* -------------------------------------------------------------------------- */
  70.  
  71. static boolean DIGPRIV herc_setinfo(int mode)
  72. {
  73. /* Set up the device info structure */
  74.     memmove(&pcdata->info, &hercinfo, sizeof(dispinfo_struct));
  75.     pc_initdispmap(720, 350);
  76.  
  77.     pcdata->info.mode = mode;
  78.     if (mode == PCMODE_HERC0) {
  79.         pcdata->info.dispaddr = VID_HERC0ADDR;
  80.     }
  81.     else {
  82.         pcdata->info.dispaddr = VID_HERC1ADDR;
  83.     }
  84.     /* Set up stuff for font plotter */
  85.     pcdata->attrcols = pc_attrcols;
  86.     pcdata->plotchar = pc_1bitplotchar;
  87.  
  88.     pcdata->fontoffs0 = hercfont_offs;
  89.     pcdata->fontseg0  = hercfont_seg;
  90.  
  91.     pchdata->xmouscale = 1;
  92.     pchdata->ymouscale = 1;
  93.  
  94.     return(TRUE);
  95. }
  96. /* -------------------------------------------------------------------------- */
  97.  
  98.