MCPcopy Create free account
hub / github.com/NetHack/NetHack / txt_clear_screen

Function txt_clear_screen

sys/msdos/vidtxt.c:156–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void
157txt_clear_screen(void)
158/* djgpp provides ScreenClear(), but in version 1.09 it is broken
159 * so for now we just use the BIOS Routines
160 */
161{
162 union REGS regs;
163#ifdef PC9800
164 regs.h.dl = attr98[attrib_text_normal];
165 regs.h.ah = SETATT;
166 regs.h.cl = DIRECT_CON_IO;
167
168 (void) int86(DOS_EXT_FUNC, &regs, &regs);
169
170 regs.h.dl = 0x02; /* clear whole screen */
171 regs.h.ah = SCREEN_CLEAR;
172 regs.h.cl = DIRECT_CON_IO;
173
174 (void) int86(DOS_EXT_FUNC, &regs, &regs);
175#else
176 regs.h.dl = (char) (CO - 1); /* columns */
177 regs.h.dh = (char) (LI - 1); /* rows */
178 regs.x.cx = 0; /* CL,CH = x,y of upper left */
179 regs.x.ax = 0;
180 regs.x.bx = 0;
181 regs.h.bh = (char) attrib_text_normal;
182 regs.h.ah = (char) SCROLL;
183 /* DL,DH = x,y of lower rt */
184 (void) int86(VIDEO_BIOS, &regs, &regs); /* Scroll or init window */
185 txt_gotoxy(0, 0);
186#endif
187}
188
189/* clear to end of line */
190void txt_cl_end(int col, int row)

Callers 2

term_clear_screenFunction · 0.85
term_end_screenFunction · 0.85

Calls 1

txt_gotoxyFunction · 0.85

Tested by

no test coverage detected