Hello, all!
SYMPTOMS: When loaded driver DISPLAY.SYS to support fonts with characters from non-latin alphabets, such as Cyrillics, Hebrew, Central European, Baltic etc., after termination of GRX application, localized fonts not loaded and international characters displayed incorrectly until manual reset video mode.
This happen always under TESTED SOFTWARE ENVIRONMENT: OPERATING SYSTEMS: MSDOS 7.0, 7.1; MS Windows 95, 98, SE, ME; MS Windows NT, 2000, (XP?) DISPLAY DRIVERS: DISPLAY.SYS from corresponding DOS/Windows installation (or 32-bit analog for NT family) KEYRUS - available to me alternative device driver.
CAUSE: Before terminating GRX application, this library always calls setmode() to restore initial videomode, which first invoke corresponding VESA function, instead of INT 10H AH=0, as expected (and supported) by driver.
SOLUTION: Forced call to INT 10H to reload ROM fonts (this function superceded by driver DISPLAY.SYS and loads localized fonts).
See code below.
(P.S. Excuse my terrible English. See my e-mail ;-)
======= begin "diff -c -p u_egavga.c.bak u_egavga.c"
*** u_egavga.c.bak Sat Jan 20 03:11:28 2001 --- u_egavga.c Mon Nov 10 20:04:34 2003 *************** *** 22,27 **** --- 22,56 ---- #include "vesa.h" #include "memfill.h"
+ void _GrViDrvReLoadFonts(void) + { + GRX_ENTER(); + int86Regs r; + sttzero(&r); + + /* read font height to load appropriate ROM BIOS font */ + IREG_AX(r) = 0x1130; + IREG_BX(r) = 0x0000; + int10(&r); + + IREG_BL(r) = 0x0000; + + if(IREG_CX(r) == 16) + IREG_AX(r) = 0x1114; + else if(IREG_CX(r) == 14) + IREG_AX(r) = 0x1111; + else if(IREG_CX(r) == 8) + IREG_AX(r) = 0x1112; + else{ + DBGPRINTF(DBG_DRIVER, ("Strange font height = %d\n", IREG_CX(r))); + GRX_RETURN(); + } + + int10(&r); + + GRX_LEAVE(); + } + int _GrViDrvDetectEGAVGA(void) { Int86Regs r; *************** static int setmode(int mode,int noclear) *** 79,85 **** IREG_AX(r) = VESA_FUNC + VESA_SET_MODE; IREG_BX(r) = (mode & 0x7fff) | (noclear ? 0x8000U : 0); int10(&r); ! if(IREG_AX(r) == VESA_SUCCESS) return(TRUE); IREG_AX(r) = (mode & 0x7f) | (noclear ? 0x80U : 0); int10(&r); return((_GrViDrvGetCurrentEGAVGAmode() == mode) ? TRUE : FALSE); --- 108,117 ---- IREG_AX(r) = VESA_FUNC + VESA_SET_MODE; IREG_BX(r) = (mode & 0x7fff) | (noclear ? 0x8000U : 0); int10(&r); ! if(IREG_AX(r) == VESA_SUCCESS){ ! _GrViDrvReLoadFonts(); ! return(TRUE); ! } IREG_AX(r) = (mode & 0x7f) | (noclear ? 0x80U : 0); int10(&r); return((_GrViDrvGetCurrentEGAVGAmode() == mode) ? TRUE : FALSE);
======= end of "diff -c -p u_egavga.c.bak u_egavga.c"
With best regards, Eugene Yavorsky. E-mail: eugene_yavorsky@mail.ru