2 #include "dos.h" /* AN000 */
3 #include "fdisk.h" /* AN000 */
4 #include "extern.h" /* AN000 */
5 #include "doscall.h" /* AN000 */
6 #include "fdiskmsg.h" /* AN000 */
11 void clear_screen(TopRow,LeftCol,BotRow,RightCol)
21 char *attribute_ptr = &attribute;
23 if (mono_flag == TRUE) /* AN006 */
24 attribute = GRAY_ON_BLACK; /* AN006 */
26 attribute = WHITE_ON_BLUE; /* AC000 */
27 VIOSCROLLUP(TopRow,LeftCol,BotRow,RightCol,u(0),attribute_ptr,u(0)); /* AC000 */
37 /****************************************************************************/
38 /* Initializes the screen and stores the lower right hand corner */
39 /* of the screen in the global variable LowerRightHandCorner. This */
40 /* is which is used for screen clears. If the screen is in grahpics mode, */
41 /* it is changed to BW 40x25. This procedure is only called once at program*/
42 /* start. Also saves the current screen */
43 /****************************************************************************/
47 void init_video_information()
50 mono_flag = FALSE; /* AN006 */
52 /* Get the current video state */
53 regs.h.ah = uc(CURRENT_VIDEO_STATE); /* AC000 */
54 int86((int)VIDEO,®s,®s); /* AC000 */
56 /* Save the mode and display page */
57 video_mode = regs.h.al;
58 display_page = regs.h.bh;
60 get_video_attribute(); /* AN006 */
63 /* assume color mode */
64 regs.h.al = uc(Color80_25); /* AC000 */
66 /* See if we are in MONOCHROME mode */
67 if ((video_mode == uc(MONO80_25)) || (video_mode == uc(MONO80_25A))) /* AC000 AC006 */
70 /* Nope,set to BW80x25*/
71 regs.h.al = uc(BW80_25); /* AC000 */
72 mono_flag = TRUE; /* AN006 */
75 /* go set the new mode */
76 regs.h.ah = uc(SET_MODE); /* AC000 */
77 int86((int)VIDEO,®s,®s); /* AC000 */
80 /* Set the display page */
81 regs.h.ah = uc(SET_ACTIVE_DISPLAY_PAGE); /* AC000 */
82 regs.h.al = uc(0); /* AC000 */
83 int86((int)VIDEO,®s,®s); /* AC000 */
90 /* Resets the video mode to the original value */
93 void reset_video_information()
97 char *attribute_ptr = &video_attribute; /* AN006 */
99 /* Clear display with colors that were present when FDISK was invoked */
100 VIOSCROLLUP(u(0),u(0),u(24),u(79),u(0),attribute_ptr,u(0)); /* AN006 */
102 /* Reset the video mode */
103 regs.h.ah = SET_MODE;
104 regs.h.al = video_mode;
105 int86((int)VIDEO,®s,®s); /* AC000 */
108 regs.h.ah = SET_PAGE;
109 regs.h.al = display_page;
110 int86((int)VIDEO,®s,®s); /* AC000 */
115 /******************************************************************************/
116 /*Routine name: GET_VIDEO_ATTRIBUTE */
117 /******************************************************************************/
119 /*Description: This routine will invoke interrupt 10 function 08h to */
120 /* get the current attributes at the cursor postition in order */
121 /* to restore the correct colors when returning out of FDISK. */
123 /*Called Procedures: none */
126 /*Change History: Created 3/11/88 DRM */
132 /******************************************************************************/
134 void get_video_attribute() /* AN006 */
138 /* Get current attributes */
139 regs.h.ah = CURRENT_VIDEO_ATTRIBUTE; /* AN006 */
140 regs.h.bh = display_page; /* AN006 */
141 int86((int)VIDEO,®s,®s); /* AN006 */
142 video_attribute = regs.h.ah; /* AN006 */