diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/msdos.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/msdos.c b/src/msdos.c index 113dba6abbd..cde3949564f 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -325,6 +325,9 @@ dosv_refresh_virtual_screen (int offset, int count) | |||
| 325 | { | 325 | { |
| 326 | __dpmi_regs regs; | 326 | __dpmi_regs regs; |
| 327 | 327 | ||
| 328 | if (offset < 0 || count < 0) /* paranoia; illegal values crash DOS/V */ | ||
| 329 | return; | ||
| 330 | |||
| 328 | regs.h.ah = 0xff; /* update relocated screen */ | 331 | regs.h.ah = 0xff; /* update relocated screen */ |
| 329 | regs.x.es = screen_virtual_segment; | 332 | regs.x.es = screen_virtual_segment; |
| 330 | regs.x.di = screen_virtual_offset + offset; | 333 | regs.x.di = screen_virtual_offset + offset; |
| @@ -340,8 +343,8 @@ dos_direct_output (y, x, buf, len) | |||
| 340 | char *buf; | 343 | char *buf; |
| 341 | int len; | 344 | int len; |
| 342 | { | 345 | { |
| 343 | int t = (int) ScreenPrimary + 2 * (x + y * screen_size_X); | 346 | int t0 = 2 * (x + y * screen_size_X); |
| 344 | int t0 = t; | 347 | int t = t0 + (int) ScreenPrimary; |
| 345 | int l0 = len; | 348 | int l0 = len; |
| 346 | 349 | ||
| 347 | #if (__DJGPP__ < 2) | 350 | #if (__DJGPP__ < 2) |
| @@ -741,8 +744,6 @@ IT_display_cursor (int on) | |||
| 741 | ScreenSetCursor (-1, -1); | 744 | ScreenSetCursor (-1, -1); |
| 742 | cursor_cleared = 1; | 745 | cursor_cleared = 1; |
| 743 | } | 746 | } |
| 744 | if (screen_virtual_segment) | ||
| 745 | dosv_refresh_virtual_screen (2 * (current_pos_X + screen_size_X * current_pos_Y), 1); | ||
| 746 | } | 747 | } |
| 747 | 748 | ||
| 748 | /* Emacs calls cursor-movement functions a lot when it updates the | 749 | /* Emacs calls cursor-movement functions a lot when it updates the |
| @@ -975,9 +976,6 @@ IT_reset_terminal_modes (void) | |||
| 975 | cursor_pos_Y = startup_pos_Y; | 976 | cursor_pos_Y = startup_pos_Y; |
| 976 | 977 | ||
| 977 | ScreenSetCursor (cursor_pos_Y, cursor_pos_X); | 978 | ScreenSetCursor (cursor_pos_Y, cursor_pos_X); |
| 978 | if (screen_virtual_segment) | ||
| 979 | dosv_refresh_virtual_screen (2*(cursor_pos_X+cursor_pos_Y*screen_size_X), | ||
| 980 | 1); | ||
| 981 | xfree (startup_screen_buffer); | 979 | xfree (startup_screen_buffer); |
| 982 | 980 | ||
| 983 | term_setup_done = 0; | 981 | term_setup_done = 0; |