comparison src/msdos.c @ 15341:8a0f5a5937e5

(bright_bg): New function, enables bright background colors. (dos_set_window_size): Move code to `bright_bg'. (IT_set_terminal_modes): Enable bright background colors. (IT_set_frame_parameters): Don't mask bright color bit in background colors. Record colors on `termscript' file. (internal_terminal_init): Enable bright background colors. Fix default colors setting from $EMACSCOLORS.
author Richard M. Stallman <rms@gnu.org>
date Thu, 06 Jun 1996 15:27:03 +0000
parents cc264dd966cd
children 9ac116f47f33
comparison
equal deleted inserted replaced
15340:a79f1c8d3984 15341:8a0f5a5937e5
363 } 363 }
364 #endif 364 #endif
365 365
366 #ifndef HAVE_X_WINDOWS 366 #ifndef HAVE_X_WINDOWS
367 367
368 /* Enable bright background colors. */
369 static void
370 bright_bg (void)
371 {
372 union REGS regs;
373
374 regs.h.bl = 0;
375 regs.x.ax = 0x1003;
376 int86 (0x10, &regs, &regs);
377 }
378
368 /* Set the screen dimensions so that it can show no less than 379 /* Set the screen dimensions so that it can show no less than
369 ROWS x COLS frame. */ 380 ROWS x COLS frame. */
370 381
371 void 382 void
372 dos_set_window_size (rows, cols) 383 dos_set_window_size (rows, cols)
398 409
399 if (INTEGERP (video_mode) 410 if (INTEGERP (video_mode)
400 && (video_mode_value = XINT (video_mode)) > 0) 411 && (video_mode_value = XINT (video_mode)) > 0)
401 { 412 {
402 regs.x.ax = video_mode_value; 413 regs.x.ax = video_mode_value;
403 int86 (0x10, &regs, &regs);
404 regs.h.bl = 0;
405 regs.x.ax = 0x1003;
406 int86 (0x10, &regs, &regs); 414 int86 (0x10, &regs, &regs);
407 415
408 if (have_mouse) 416 if (have_mouse)
409 { 417 {
410 /* Must hardware-reset the mouse, or else it won't update 418 /* Must hardware-reset the mouse, or else it won't update
492 } 500 }
493 501
494 /* Tell the caller what dimensions have been REALLY set. */ 502 /* Tell the caller what dimensions have been REALLY set. */
495 *rows = ScreenRows (); 503 *rows = ScreenRows ();
496 *cols = ScreenCols (); 504 *cols = ScreenCols ();
505
506 /* Enable bright background colors. */
507 bright_bg ();
497 } 508 }
498 509
499 /* If we write a character in the position where the mouse is, 510 /* If we write a character in the position where the mouse is,
500 the mouse cursor may need to be refreshed. */ 511 the mouse cursor may need to be refreshed. */
501 512
724 ScreenRetrieve (startup_screen_buffer = xmalloc (screen_size * 2)); 735 ScreenRetrieve (startup_screen_buffer = xmalloc (screen_size * 2));
725 736
726 if (termscript) 737 if (termscript)
727 fprintf (termscript, "<SCREEN SAVED (dimensions=%dx%d)>\n", 738 fprintf (termscript, "<SCREEN SAVED (dimensions=%dx%d)>\n",
728 screen_size_X, screen_size_Y); 739 screen_size_X, screen_size_Y);
740
741 bright_bg ();
729 } 742 }
730 743
731 /* IT_reset_terminal_modes is called when emacs is 744 /* IT_reset_terminal_modes is called when emacs is
732 suspended or killed. */ 745 suspended or killed. */
733 746
824 unsigned long new_color = load_color (f, val); 837 unsigned long new_color = load_color (f, val);
825 if (new_color != ~0) 838 if (new_color != ~0)
826 { 839 {
827 FRAME_FOREGROUND_PIXEL (f) = new_color; 840 FRAME_FOREGROUND_PIXEL (f) = new_color;
828 redraw = 1; 841 redraw = 1;
842 if (termscript)
843 fprintf (termscript, "<FGCOLOR %d>\n", new_color);
829 } 844 }
830 } 845 }
831 else if (EQ (prop, intern ("background-color"))) 846 else if (EQ (prop, intern ("background-color")))
832 { 847 {
833 unsigned long new_color = load_color (f, val); 848 unsigned long new_color = load_color (f, val);
834 if (new_color != ~0) 849 if (new_color != ~0)
835 { 850 {
836 FRAME_BACKGROUND_PIXEL (f) = new_color & ~8; 851 FRAME_BACKGROUND_PIXEL (f) = new_color;
837 redraw = 1; 852 redraw = 1;
853 if (termscript)
854 fprintf (termscript, "<BGCOLOR %d>\n", new_color);
838 } 855 }
839 } 856 }
840 else if (EQ (prop, intern ("menu-bar-lines"))) 857 else if (EQ (prop, intern ("menu-bar-lines")))
841 { 858 {
842 int new; 859 int new;
891 Vwindow_system_version = make_number (1); 908 Vwindow_system_version = make_number (1);
892 909
893 bzero (&the_only_x_display, sizeof the_only_x_display); 910 bzero (&the_only_x_display, sizeof the_only_x_display);
894 the_only_x_display.background_pixel = 7; /* White */ 911 the_only_x_display.background_pixel = 7; /* White */
895 the_only_x_display.foreground_pixel = 0; /* Black */ 912 the_only_x_display.foreground_pixel = 0; /* Black */
913 bright_bg ();
896 colors = getenv ("EMACSCOLORS"); 914 colors = getenv ("EMACSCOLORS");
897 if (colors && strlen (colors) >= 2) 915 if (colors && strlen (colors) >= 2)
898 { 916 {
899 /* Foreground colrs use 4 bits, background only 3. */ 917 /* The colors use 4 bits each (we enable bright background). */
900 if (isxdigit (colors[0]) && !isdigit (colors[0])) 918 if (isdigit (colors[0]))
901 colors[0] += 10 - (isupper (colors[0]) ? 'A' : 'a'); 919 colors[0] -= '0';
920 else if (isxdigit (colors[0]))
921 colors[0] -= (isupper (colors[0]) ? 'A' : 'a') - 10;
902 if (colors[0] >= 0 && colors[0] < 16) 922 if (colors[0] >= 0 && colors[0] < 16)
903 the_only_x_display.foreground_pixel = colors[0]; 923 the_only_x_display.foreground_pixel = colors[0];
904 if (colors[1] >= 0 && colors[1] < 8) 924 if (isdigit (colors[1]))
925 colors[1] -= '0';
926 else if (isxdigit (colors[1]))
927 colors[1] -= (isupper (colors[1]) ? 'A' : 'a') - 10;
928 if (colors[1] >= 0 && colors[1] < 16)
905 the_only_x_display.background_pixel = colors[1]; 929 the_only_x_display.background_pixel = colors[1];
906 } 930 }
907 the_only_x_display.line_height = 1; 931 the_only_x_display.line_height = 1;
908 the_only_frame.output_data.x = &the_only_x_display; 932 the_only_frame.output_data.x = &the_only_x_display;
909 the_only_frame.output_method = output_msdos_raw; 933 the_only_frame.output_method = output_msdos_raw;