home *** CD-ROM | disk | FTP | other *** search
- /*
- pcherc.c
-
- % Hercules device interface routines
-
- 11/13/88 by Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 01/10/89 ted Removed redundant disp clip.
- 1/18/89 Ted changed call to PlotText for simplified interface.
- 6/28/89 ted removed dispid and changed mmwidth/height to x/ypixperm
- 7/10/89 ted installed new text-plotting approach.
- 7/12/89 ted Added OSTATIC's and '_func' macros.
- 8/22/89 ted Added fontdesc_struct elements to def_font initialization.
- */
-
- #include "pcpriv.h"
-
- OSTATIC pc_setinfo_func (herc_setinfo);
- /* -------------------------------------------------------------------------- */
-
- boolean pc_ModeHerc(digp)
- dig_struct *digp;
- {
- return(pc_OpenHerc(digp, PCMODE_HERC0));
- }
- /* -------------------------------------------------------------------------- */
-
- boolean DIGPRIV pc_OpenHerc(digp, mode)
- dig_struct *digp;
- int mode;
- {
- if (!pc_OpenDIG(digp, mode, herc_setinfo)) {
- return(FALSE);
- }
- pc_setgfuncs(digp);
- return(TRUE);
- }
- /* -------------------------------------------------------------------------- */
-
- static dispinfo_struct hercinfo = {
- {'I','B','M',' ', 'P','C',' ','H', 'E','R','C',' ',
- 'G','R','A','P', 'H','I','C','S', 0,0}, /* devname */
- PCMODE_HERC0, /* mode */
- 0, 0, /* xpixperm, ypixperm */
- &pcdatastruc.dmspace, /* dispmap */
- VID_HERC0ADDR, /* dispaddr */
- 90, /* bytewidth */
- 2, /* ileave */
- VID_HERCBLOCK, /* ilsize */
- 1, /* nplanes */
- 1, /* pixbits */
-
- 2L, /* ncolors */
- DTYPE_MONOCHROME, /* color type */
- (ocolmap_type)&pcdefmcmap, /* defcolmap */
-
- FALSE, /* hardcursor */
- BO_LSBYTFIRST, /* byteorder */
- { /* def_font */
- 0, /* fontid */
- { 8, 14, 0, 0,0,0, 0 }, /* real: width, height, style, etc. */
- { 8, 14, 0, 0,0,0, 0 } /* req: width, height, style, etc. */
- }
- };
- /* -------------------------------------------------------------------------- */
-
- static boolean DIGPRIV herc_setinfo(mode)
- int mode;
- {
- /* Set up the device info structure */
- memmove(&pcdata->info, &hercinfo, sizeof(dispinfo_struct));
- pc_initdispmap(720, 350);
-
- pcdata->info.mode = mode;
- if (mode == PCMODE_HERC0) {
- pcdata->info.dispaddr = VID_HERC0ADDR;
- }
- else {
- pcdata->info.dispaddr = VID_HERC1ADDR;
- }
- /* Set up stuff for font plotter */
- pcdata->attrcols = pc_attrcols;
- pcdata->plotchar = pc_1bitplotchar;
-
- pcdata->fontoffs0 = hercfont_offs;
- pcdata->fontseg0 = hercfont_seg;
-
- pchdata->xmouscale = 1;
- pchdata->ymouscale = 1;
-
- return(TRUE);
- }
- /* -------------------------------------------------------------------------- */
-