aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-01-06 21:23:25 +0000
committerRichard M. Stallman1997-01-06 21:23:25 +0000
commitb36701cc099704654a5260b51db567165ddcae5b (patch)
treebb63519b979527019bcd2d19ab261a2cec3a1303 /src
parentac707ebc83ed4631adab5e3c8df3e8d37d671966 (diff)
downloademacs-b36701cc099704654a5260b51db567165ddcae5b.tar.gz
emacs-b36701cc099704654a5260b51db567165ddcae5b.zip
(bright_bg): Save the original state of video blink bit.
(maybe_enable_blinking): New function, restores the original state of the blink bit. (IT_reset_terminal_modes): Restore the original state of the blink bit when suspending/exiting. (run_msdos_command): Make sure bright background colors are again enabled after subsidiary program returns.
Diffstat (limited to 'src')
-rw-r--r--src/msdos.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 0b4cc858e16..d809fffd46a 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -62,6 +62,10 @@ Boston, MA 02111-1307, USA. */
62#define _USE_LFN 0 62#define _USE_LFN 0
63#endif 63#endif
64 64
65#ifndef _dos_ds
66#define _dos_ds _go32_info_block.selector_for_linear_memory
67#endif
68
65#if __DJGPP__ > 1 69#if __DJGPP__ > 1
66 70
67#include <signal.h> 71#include <signal.h>
@@ -370,17 +374,39 @@ ScreenVisualBell (void)
370 374
371#ifndef HAVE_X_WINDOWS 375#ifndef HAVE_X_WINDOWS
372 376
377static int blink_bit = -1; /* the state of the blink bit at startup */
378
373/* Enable bright background colors. */ 379/* Enable bright background colors. */
374static void 380static void
375bright_bg (void) 381bright_bg (void)
376{ 382{
377 union REGS regs; 383 union REGS regs;
378 384
385 /* Remember the original state of the blink/bright-background bit.
386 It is stored at 0040:0065h in the BIOS data area. */
387 if (blink_bit == -1)
388 blink_bit = (_farpeekb (_dos_ds, 0x465) & 0x20) == 0x20;
389
379 regs.h.bl = 0; 390 regs.h.bl = 0;
380 regs.x.ax = 0x1003; 391 regs.x.ax = 0x1003;
381 int86 (0x10, &regs, &regs); 392 int86 (0x10, &regs, &regs);
382} 393}
383 394
395/* Disable bright background colors (and enable blinking) if we found
396 the video system in that state at startup. */
397static void
398maybe_enable_blinking (void)
399{
400 if (blink_bit == 1)
401 {
402 union REGS regs;
403
404 regs.h.bl = 1;
405 regs.x.ax = 0x1003;
406 int86 (0x10, &regs, &regs);
407 }
408}
409
384/* Set the screen dimensions so that it can show no less than 410/* Set the screen dimensions so that it can show no less than
385 ROWS x COLS frame. */ 411 ROWS x COLS frame. */
386 412
@@ -869,6 +895,10 @@ IT_reset_terminal_modes (void)
869 return; 895 return;
870 896
871 mouse_off (); 897 mouse_off ();
898
899 /* Leave the video system in the same state as we found it,
900 as far as the blink/bright-background bit is concerned. */
901 maybe_enable_blinking ();
872 902
873 /* We have a situation here. 903 /* We have a situation here.
874 We cannot just do ScreenUpdate(startup_screen_buffer) because 904 We cannot just do ScreenUpdate(startup_screen_buffer) because
@@ -3010,6 +3040,11 @@ run_msdos_command (argv, dir, tempin, tempout, temperr)
3010 mouse_init (); 3040 mouse_init ();
3011 mouse_moveto (x, y); 3041 mouse_moveto (x, y);
3012 } 3042 }
3043
3044 /* Some programs might change the meaning of the highest bit of the
3045 text attribute byte, so we get blinking characters instead of the
3046 bright background colors. Restore that. */
3047 bright_bg ();
3013 3048
3014 done: 3049 done:
3015 chdir (oldwd); 3050 chdir (oldwd);