Diff for /np2/win9x/ini.cpp between versions 1.38 and 1.39

version 1.38, 2005/03/20 08:58:19 version 1.39, 2005/03/21 02:24:23
Line 14 Line 14
 #include        "pccore.h"  #include        "pccore.h"
   
   
   static void bitmapset(UINT8 *ptr, UINT pos, BOOL set) {
 static BOOL inigetbmp(const UINT8 *ptr, UINT pos) {  
   
         return((ptr[pos >> 3] >> (pos & 7)) & 1);  
 }  
   
 static void inisetbmp(UINT8 *ptr, UINT pos, BOOL set) {  
   
         UINT8   bit;          UINT8   bit;
   
Line 34  static void inisetbmp(UINT8 *ptr, UINT p Line 28  static void inisetbmp(UINT8 *ptr, UINT p
         }          }
 }  }
   
 static void inirdargs16(const OEMCHAR *src, const PFTBL *ini) {  static BOOL bitmapget(const UINT8 *ptr, UINT pos) {
   
         SINT16  *dst;  
         int             dsize;  
         int             i;  
         OEMCHAR c;  
   
         dst = (SINT16 *)ini->value;  
         dsize = ini->arg;  
   
         for (i=0; i<dsize; i++) {          return((ptr[pos >> 3] >> (pos & 7)) & 1);
                 while(*src == ' ') {  
                         src++;  
                 }  
                 if (*src == '\0') {  
                         break;  
                 }  
                 dst[i] = (SINT16)milstr_solveINT(src);  
                 while(*src != '\0') {  
                         c = *src++;  
                         if (c == ',') {  
                                 break;  
                         }  
                 }  
         }  
 }  }
   
 static void inirdargh8(const OEMCHAR *src, const PFTBL *ini) {  static void binset(UINT8 *bin, UINT binlen, const OEMCHAR *src) {
   
         UINT8   *dst;          UINT    i;
         int             dsize;  
         int             i;  
         UINT8   val;          UINT8   val;
         BOOL    set;          BOOL    set;
         OEMCHAR c;          OEMCHAR c;
   
         dst = (UINT8 *)ini->value;          for (i=0; i<binlen; i++) {
         dsize = ini->arg;  
   
         for (i=0; i<dsize; i++) {  
                 val = 0;                  val = 0;
                 set = FALSE;                  set = FALSE;
                 while(*src == ' ') {                  while(*src == ' ') {
Line 102  static void inirdargh8(const OEMCHAR *sr Line 69  static void inirdargh8(const OEMCHAR *sr
                 if (set == FALSE) {                  if (set == FALSE) {
                         break;                          break;
                 }                  }
                 dst[i] = val;                  bin[i] = val;
         }          }
 }  }
   
 static void iniwrsetargh8(OEMCHAR *work, int size, const PFTBL *ini) {  static void binget(OEMCHAR *work, int size, const UINT8 *bin, UINT binlen) {
   
         UINT    i;          UINT    i;
 const UINT8     *ptr;  
         UINT    arg;  
         OEMCHAR tmp[8];          OEMCHAR tmp[8];
   
         ptr = (UINT8 *)ini->value;          if (binlen) {
         arg = ini->arg;                  OEMSPRINTF(tmp, OEMTEXT("%.2x"), bin[0]);
         if (arg > 0) {  
                 OEMSPRINTF(tmp, OEMTEXT("%.2x"), ptr[0]);  
                 milstr_ncpy(work, tmp, size);                  milstr_ncpy(work, tmp, size);
         }          }
         for (i=1; i<arg; i++) {          for (i=1; i<binlen; i++) {
                 OEMSPRINTF(tmp, OEMTEXT(" %.2x"), ptr[i]);                  OEMSPRINTF(tmp, OEMTEXT(" %.2x"), bin[i]);
                 milstr_ncat(work, tmp, size);                  milstr_ncat(work, tmp, size);
         }          }
 }  }
Line 128  const UINT8 *ptr; Line 91  const UINT8 *ptr;
   
 // ---- user  // ---- user
   
   static void inirdargs16(const OEMCHAR *src, const PFTBL *ini) {
   
           SINT16  *dst;
           int             dsize;
           int             i;
           OEMCHAR c;
   
           dst = (SINT16 *)ini->value;
           dsize = ini->arg;
   
           for (i=0; i<dsize; i++) {
                   while(*src == ' ') {
                           src++;
                   }
                   if (*src == '\0') {
                           break;
                   }
                   dst[i] = (SINT16)milstr_solveINT(src);
                   while(*src != '\0') {
                           c = *src++;
                           if (c == ',') {
                                   break;
                           }
                   }
           }
   }
   
 static void inirdbyte3(const OEMCHAR *src, const PFTBL *ini) {  static void inirdbyte3(const OEMCHAR *src, const PFTBL *ini) {
   
         UINT    i;          UINT    i;
Line 189  const PFTBL *pterm; Line 179  const PFTBL *pterm;
   
                         case PFTYPE_BITMAP:                          case PFTYPE_BITMAP:
                                 GetPrivateProfileString(title, p->item,                                  GetPrivateProfileString(title, p->item,
                                         (inigetbmp((UINT8 *)p->value, p->arg))?str_true:str_false,                                          (bitmapget((UINT8 *)p->value, p->arg))?str_true:str_false,
                                                                                                 work, NELEMENTS(work), path);                                                                                                  work, NELEMENTS(work), path);
                                 inisetbmp((UINT8 *)p->value, p->arg,                                  bitmapset((UINT8 *)p->value, p->arg,
                                                                                 (milstr_cmp(work, str_true) == 0));                                                                                  (milstr_cmp(work, str_true) == 0));
                                 break;                                  break;
   
                         case PFTYPE_ARGS16:  
                                 GetPrivateProfileString(title, p->item, str_null,  
                                                                                                 work, NELEMENTS(work), path);  
                                 inirdargs16(work, p);  
                                 break;  
   
                         case PFTYPE_BIN:                          case PFTYPE_BIN:
                                 GetPrivateProfileString(title, p->item, str_null,                                  GetPrivateProfileString(title, p->item, str_null,
                                                                                                 work, NELEMENTS(work), path);                                                                                                  work, NELEMENTS(work), path);
                                 inirdargh8(work, p);                                  binset((UINT8 *)p->value, p->arg, work);
                                 break;                                  break;
   
                         case PFTYPE_SINT8:                          case PFTYPE_SINT8:
Line 252  const PFTBL *pterm; Line 236  const PFTBL *pterm;
                                 *(UINT32 *)p->value = (UINT32)val;                                  *(UINT32 *)p->value = (UINT32)val;
                                 break;                                  break;
   
                           case PFTYPE_ARGS16:
                                   GetPrivateProfileString(title, p->item, str_null,
                                                                                                   work, NELEMENTS(work), path);
                                   inirdargs16(work, p);
                                   break;
   
                         case PFTYPE_BYTE3:                          case PFTYPE_BYTE3:
                                 GetPrivateProfileString(title, p->item, str_null,                                  GetPrivateProfileString(title, p->item, str_null,
                                                                                                 work, NELEMENTS(work), path);                                                                                                  work, NELEMENTS(work), path);
Line 291  const OEMCHAR *set; Line 281  const OEMCHAR *set;
                                         set = (*((UINT8 *)p->value))?str_true:str_false;                                          set = (*((UINT8 *)p->value))?str_true:str_false;
                                         break;                                          break;
   
                                   case PFTYPE_BITMAP:
                                           set = (bitmapget((UINT8 *)p->value, p->arg))?
                                                                                                                   str_true:str_false;
                                           break;
   
                                 case PFTYPE_BIN:                                  case PFTYPE_BIN:
                                         iniwrsetargh8(work, NELEMENTS(work), p);                                          binget(work, NELEMENTS(work), (UINT8 *)p->value, p->arg);
                                         break;                                          break;
   
                                 case PFTYPE_SINT8:                                  case PFTYPE_SINT8:

Removed from v.1.38  
changed lines
  Added in v.1.39


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