changeset 21489:a1a2beb0a09c

(dosv_refresh_virtual_screen): Do not use negative arguments. (dos_direct_output): Fix the offset passed to dosv_refresh_virtual_screen. (IT_display_cursor): Don't call dosv_refresh_virtual_screen. (IT_reset_terminal_modes): Don't call dosv_refresh_virtual_screen when setting cursor.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 13 Apr 1998 06:42:31 +0000
parents 2c0815a83862
children 366a1d025c6c
files src/msdos.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/msdos.c	Mon Apr 13 06:30:41 1998 +0000
+++ b/src/msdos.c	Mon Apr 13 06:42:31 1998 +0000
@@ -325,6 +325,9 @@
 {
   __dpmi_regs regs;
 
+  if (offset < 0 || count < 0)	/* paranoia; illegal values crash DOS/V */
+    return;
+
   regs.h.ah = 0xff;	/* update relocated screen */
   regs.x.es = screen_virtual_segment;
   regs.x.di = screen_virtual_offset + offset;
@@ -340,8 +343,8 @@
      char *buf;
      int len;
 {
-  int t = (int) ScreenPrimary + 2 * (x + y * screen_size_X);
-  int t0 = t;
+  int t0 = 2 * (x + y * screen_size_X);
+  int t = t0 + (int) ScreenPrimary;
   int l0 = len;
 
 #if (__DJGPP__ < 2)
@@ -741,8 +744,6 @@
       ScreenSetCursor (-1, -1);
       cursor_cleared = 1;
     }
-  if (screen_virtual_segment)
-    dosv_refresh_virtual_screen (2 * (current_pos_X + screen_size_X * current_pos_Y), 1);
 }
 
 /* Emacs calls cursor-movement functions a lot when it updates the
@@ -975,9 +976,6 @@
     cursor_pos_Y = startup_pos_Y;
 
   ScreenSetCursor (cursor_pos_Y, cursor_pos_X);
-  if (screen_virtual_segment)
-    dosv_refresh_virtual_screen (2*(cursor_pos_X+cursor_pos_Y*screen_size_X),
-				 1);
   xfree (startup_screen_buffer);
 
   term_setup_done = 0;