home *** CD-ROM | disk | FTP | other *** search
- /* This module contains routines to
- 1. save the current contents of the screen and the current cursor
- position before invoking em and
- 2. restore the saved screen and cursor position after leaving em.
- */
-
- static char saved_screen[4000];
- static int savedrow,savedcol;
- int _rax,_rbx,_rcx,_rdx,_rsi,_rdi,_rds,_res;
- unsigned screen_seg;
-
- save_screen_and_cursor()
- {
- int mode;
- mode = get_mode();
- find_cursor();
- if ( mode == 7)
- screen_seg = 0xb000;
- else
- screen_seg = 0xb800;
- _lmove(4000,0,screen_seg,saved_screen,_showds() );
- }
-
- restore_screen_and_cursor()
- {
- _lmove(4000,saved_screen,_showds(),0,screen_seg);
- scr_rowcol(savedrow,savedcol);
- }
-
- void find_cursor()
- {
- _rax = 0x0300;
- _rbx = 0;
- _doint(0x10);
- savedrow= _rdx>>8;
- savedcol = _rdx & 0x00ff;
- }
-
- int get_mode()
- {
- _rax = 0x0f00;
- _doint( 0x10);
- return (_rax & 0x00ff);
- }