drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / payloads / libpayload / curses / PDCurses / dos / pdcsetsc.c
blob4b2314edf2b8b6a0cfa957d871e4b62d4e2556a9
1 /* Public Domain Curses */
3 #include "pdcdos.h"
5 RCSID("$Id: pdcsetsc.c,v 1.39 2008/07/13 16:08:17 wmcbrine Exp $")
7 /*man-start**************************************************************
9 Name: pdcsetsc
11 Synopsis:
12 int PDC_set_blink(bool blinkon);
13 void PDC_set_title(const char *title);
15 Description:
16 PDC_set_blink() toggles whether the A_BLINK attribute sets an
17 actual blink mode (TRUE), or sets the background color to high
18 intensity (FALSE). The default is platform-dependent (FALSE in
19 most cases). It returns OK if it could set the state to match
20 the given parameter, ERR otherwise. Current platforms also
21 adjust the value of COLORS according to this function -- 16 for
22 FALSE, and 8 for TRUE.
24 PDC_set_title() sets the title of the window in which the curses
25 program is running. This function may not do anything on some
26 platforms. (Currently it only works in Win32 and X11.)
28 Portability X/Open BSD SYS V
29 PDC_set_blink - - -
30 PDC_set_title - - -
32 **man-end****************************************************************/
34 int PDC_curs_set(int visibility)
36 PDCREGS regs;
37 int ret_vis, start, end;
39 PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility));
41 ret_vis = SP->visibility;
42 SP->visibility = visibility;
44 switch (visibility)
46 case 0: /* invisible */
47 start = 32;
48 end = 0; /* was 32 */
49 break;
50 case 2: /* highly visible */
51 start = 0; /* full-height block */
52 end = 7;
53 break;
54 default: /* normal visibility */
55 start = (SP->orig_cursor >> 8) & 0xff;
56 end = SP->orig_cursor & 0xff;
59 /* if scrnmode is not set, some BIOSes hang */
61 regs.h.ah = 0x01;
62 regs.h.al = (unsigned char)pdc_scrnmode;
63 regs.h.ch = (unsigned char)start;
64 regs.h.cl = (unsigned char)end;
65 PDCINT(0x10, regs);
67 return ret_vis;
70 void PDC_set_title(const char *title)
72 PDC_LOG(("PDC_set_title() - called: <%s>\n", title));
75 int PDC_set_blink(bool blinkon)
77 PDCREGS regs;
79 switch (pdc_adapter)
81 case _EGACOLOR:
82 case _EGAMONO:
83 case _VGACOLOR:
84 case _VGAMONO:
85 regs.W.ax = 0x1003;
86 regs.W.bx = blinkon;
88 PDCINT(0x10, regs);
90 if (pdc_color_started)
91 COLORS = blinkon ? 8 : 16;
93 break;
94 default:
95 COLORS = 8;
98 return (COLORS - (blinkon * 8) != 8) ? OK : ERR;