Hi All,

This patch differentiates the calls to NLSFUNC's MUX-14-01 and
MUX-14-03. Fixes implementation of int 21-38-XX/DX=FFFF (SET COUNTRY
CODE) and int 21-66-02 (SET GLOBAL CODE PAGE TABLE) and is needed for
the upcoming NLSFUNC (together with this previous patch by Steffen,
which is already in UNSTABLE:
http://sourceforge.net/mailarchive/message.php?msg_id=8804587 )

Eduardo.



diff -uNrp ke2035.orig/kernel/nls.c ke2035/kernel/nls.c
-- ke2035.orig/kernel/nls.c 2004-07-26 14:06:47.000000000 +0200
+++ ke2035/kernel/nls.c 2004-07-26 14:11:13.000000000 +0200
@@ -109,7 +109,7 @@ STATIC COUNT muxGo(int subfct, UWORD bp,
/*
  * Call NLSFUNC to load the NLS package
  */
-COUNT muxLoadPkg(UWORD cp, UWORD cntry)
+COUNT muxLoadPkg(int subfct, UWORD cp, UWORD cntry)
{
   UWORD id; /* on stack, call_nls in int2f.asm takes care of this
              * if DS != SS */
@@ -131,7 +131,7 @@ COUNT muxLoadPkg(UWORD cp, UWORD cntry)
   /* OK, the correct NLSFUNC is available --> load pkg */
   /* If cp == -1 on entry, NLSFUNC updates cp to the codepage loaded
      into memory. The system must then change to this one later */
-  return muxGo(NLSFUNC_LOAD_PKG, 0, cp, cntry, 0, 0, 0);
+  return muxGo(subfct, 0, cp, cntry, 0, 0, 0);
}

STATIC int muxBufGo(int subfct, int bp, UWORD cp, UWORD cntry,
@@ -367,15 +367,30 @@ STATIC COUNT nlsSetPackage(struct nlsPac
}
STATIC COUNT DosSetPackage(UWORD cp, UWORD cntry)
{
+  /* Right now, we do not have codepage change support in kernel, so
push
+     it through the mux in any case. */
+
+  return muxLoadPkg(NLSFUNC_LOAD_PKG2, cp, cntry);
+}
+
+STATIC COUNT nlsLoadPackage(struct nlsPackage FAR * nls)
+{
+
+  nlsInfo.actPkg = nls;
+
+  return SUCCESS;
+}
+STATIC COUNT DosLoadPackage(UWORD cp, UWORD cntry)
+{
   struct nlsPackage FAR *nls;   /* NLS package to use to return the
info from */

   /* nls := NLS package of cntry/codepage */
   if ((nls = searchPackage(cp, cntry)) != NULL)
     /* OK the NLS pkg is loaded --> activate it */
-    return nlsSetPackage(nls);
+    return nlsLoadPackage(nls);

   /* not loaded --> invoke NLSFUNC to load it */
-  return muxLoadPkg(cp, cntry);
+  return muxLoadPkg(NLSFUNC_LOAD_PKG, cp, cntry);
}

STATIC void nlsUpMem(struct nlsPackage FAR * nls, VOID FAR * str, int
len)
@@ -556,7 +572,7 @@ COUNT DosGetCountryInformation(UWORD cnt
#ifndef DosSetCountry
COUNT DosSetCountry(UWORD cntry)
{
-  return DosSetPackage(NLS_DEFAULT, cntry);
+  return DosLoadPackage(NLS_DEFAULT, cntry);
}
#endif

@@ -628,6 +644,7 @@ UWORD ASMCFUNC syscall_MUX14(DIRECT_IREG
       /* Does not pass buffer length */
       return nlsGetData(nls, CL, MK_FP(ES, DI), 512);
     case NLSFUNC_LOAD_PKG:
+      return nlsLoadPackage(nls);
     case NLSFUNC_LOAD_PKG2:
       return nlsSetPackage(nls);
     case NLSFUNC_YESNO:




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to