Diff for /np2/generic/hostdrvs.c between versions 1.11 and 1.16

version 1.11, 2004/07/15 13:48:39 version 1.16, 2005/05/20 14:32:01
Line 2 Line 2
   
 #if defined(SUPPORT_HOSTDRV)  #if defined(SUPPORT_HOSTDRV)
   
 #if defined(OSLANG_EUC)  #if defined(OSLANG_EUC) || defined(OSLANG_UTF8) || defined(OSLANG_UCS2)
 #include        "codecnv.h"  #include        "oemtext.h"
 #endif  #endif
 #include        "dosio.h"  #include        "dosio.h"
 #include        "pccore.h"  #include        "pccore.h"
Line 13 Line 13
   
 static const HDRVDIR hddroot = {"           ", 0, 0, 0, 0x10, {0}, {0}};  static const HDRVDIR hddroot = {"           ", 0, 0, 0, 0x10, {0}, {0}};
   
 static const BYTE dospathchr[] = {  static const UINT8 dospathchr[] = {
                         0xfa, 0x23,             // '&%$#"!  /.-,+*)(                          0xfa, 0x23,             // '&%$#"!  /.-,+*)(
                         0xff, 0x03,             // 76543210 ?>=<;:98                          0xff, 0x03,             // 76543210 ?>=<;:98
                         0xff, 0xff,             // GFEDCBA@ ONMLKJIH                          0xff, 0xff,             // GFEDCBA@ ONMLKJIH
Line 21  static const BYTE dospathchr[] = { Line 21  static const BYTE dospathchr[] = {
                         0x01, 0x00,             // gfedcba` onmlkjih                          0x01, 0x00,             // gfedcba` onmlkjih
                         0x00, 0x40};    // wvutsrqp ~}|{zyx                           0x00, 0x40};    // wvutsrqp ~}|{zyx 
   
 static void rcnvfcb(char *dst, UINT dlen, char *src, UINT slen) {  
   static void rcnvfcb(char *dst, UINT dlen, const char *src) {
   
         REG8    c;          REG8    c;
   
         while((slen) && (dlen)) {          while(dlen) {
                 slen--;  
                 c = (UINT8)*src++;                  c = (UINT8)*src++;
                 if (c == 0) {                  if (c == 0) {
                         break;                          break;
                 }                  }
 #if defined(OSLANG_SJIS) || defined(OSLANG_EUC) || defined(OSLANG_UTF8)  #if defined(OSLANG_SJIS) || defined(OSLANG_EUC) || defined(OSLANG_UTF8) || defined(OSLANG_UCS2)
                 if ((((c ^ 0x20) - 0xa1) & 0xff) < 0x3c) {                  if ((((c ^ 0x20) - 0xa1) & 0xff) < 0x3c) {
                         if ((!slen) || (src[0] == '\0')) {                          if (src[0] == '\0') {
                                 break;                                  break;
                         }                          }
                         if (dlen < 2) {                          if (dlen < 2) {
Line 75  static void rcnvfcb(char *dst, UINT dlen Line 75  static void rcnvfcb(char *dst, UINT dlen
         }          }
 }  }
   
 static BOOL realname2fcb(char *fcbname, FLINFO *fli) {  static BRESULT realname2fcb(char *fcbname, const FLINFO *fli) {
   
 #if defined(OSLANG_EUC) || defined(OSLANG_UTF8)          OEMCHAR *ext;
   #if defined(OSLANG_EUC) || defined(OSLANG_UTF8) || defined(OSLANG_UCS2)
         char    sjis[MAX_PATH];          char    sjis[MAX_PATH];
 #endif  #endif
         char    *realname;          OEMCHAR filename[MAX_PATH];
         char    *ext;  
           FillMemory(fcbname, 11, ' ');
   
 #if defined(OSLANG_EUC)          ext = file_getext(fli->path);
         codecnv_euc2sjis(sjis, sizeof(sjis), fli->path, NELEMENTS(fli->path));  #if defined(OSLANG_EUC) || defined(OSLANG_UTF8) || defined(OSLANG_UCS2)
         realname = sjis;          oemtext_oemtosjis(sjis, sizeof(sjis), ext, (UINT)-1);
 #elif defined(OSLANG_UTF8)          rcnvfcb(fcbname+8, 3, sjis);
         oemtext_oem2sjis(sjis, sizeof(sjis), fli->path, NELEMENTS(fli->path));  
         realname = sjis;  
 #else  #else
         realname = fli->path;          rcnvfcb(fcbname+8, 3, ext);
   #endif
   
           file_cpyname(filename, fli->path, NELEMENTS(filename));
           file_cutext(filename);
   #if defined(OSLANG_EUC) || defined(OSLANG_UTF8) || defined(OSLANG_UCS2)
           oemtext_oemtosjis(sjis, sizeof(sjis), filename, (UINT)-1);
           rcnvfcb(fcbname+0, 8, sjis);
   #else
           rcnvfcb(fcbname+0, 8, filename);
 #endif  #endif
         FillMemory(fcbname, 11, ' ');  
         // ToDo: SJISに変換済みなのに OEM依存してる  
         ext = file_getext(realname);  
         rcnvfcb(fcbname+0, 8, realname, ext - realname);  
         rcnvfcb(fcbname+8, 3, ext, (UINT)-1);  
         return(SUCCESS);          return(SUCCESS);
 }  }
   
Line 303  BOOL hostdrvs_newrealpath(HDRVPATH *hdp, Line 307  BOOL hostdrvs_newrealpath(HDRVPATH *hdp,
         char            dosname[16];          char            dosname[16];
         UINT            i;          UINT            i;
         char            *p;          char            *p;
 #if defined(OSLANG_EUC) || defined(OSLANG_UTF8)  #if defined(OSLANG_EUC) || defined(OSLANG_UTF8) || defined(OSLANG_UCS2)
         OEMCHAR         oemname[64];          OEMCHAR         oemname[64];
 #endif  #endif
   
Line 334  BOOL hostdrvs_newrealpath(HDRVPATH *hdp, Line 338  BOOL hostdrvs_newrealpath(HDRVPATH *hdp,
                 }                  }
                 *p = '\0';                  *p = '\0';
                 // ここで SJIS->OEMコードに未変換!                  // ここで SJIS->OEMコードに未変換!
 #if defined(OSLANG_EUC)  #if defined(OSLANG_EUC) || defined(OSLANG_UTF8) || defined(OSLANG_UCS2)
                 codecnv_sjis2euc(oemname, NELEMENTS(oemname), dosname, (UINT)-1);                  oemtext_sjistooem(oemname, NELEMENTS(oemname), dosname, (UINT)-1);
                 file_catname(path, oemname, NELEMENTS(path));  
 #elif defined(OSLANG_UTF8)  
                 oemtext_sjis2oem(oemname, NELEMENTS(oemname), dosname, (UINT)-1);  
                 file_catname(path, oemname, NELEMENTS(path));                  file_catname(path, oemname, NELEMENTS(path));
 #else  #else
                 file_catname(path, dosname, NELEMENTS(path));                  file_catname(path, dosname, NELEMENTS(path));

Removed from v.1.11  
changed lines
  Added in v.1.16


RetroPC.NET-CVS <cvs@retropc.net>