Diff for /np2/keystat.c between versions 1.16 and 1.18

version 1.16, 2005/02/04 05:32:22 version 1.18, 2005/03/18 09:23:10
Line 26  static KEYSTAT  keystat; Line 26  static KEYSTAT  keystat;
   
 void keystat_initialize(void) {  void keystat_initialize(void) {
   
         char    path[MAX_PATH];          OEMCHAR path[MAX_PATH];
   
         ZeroMemory(&keyctrl, sizeof(keyctrl));          ZeroMemory(&keyctrl, sizeof(keyctrl));
         keyctrl.keyrep = 0x21;          keyctrl.keyrep = 0x21;
Line 36  void keystat_initialize(void) { Line 36  void keystat_initialize(void) {
         ZeroMemory(&keystat, sizeof(keystat));          ZeroMemory(&keystat, sizeof(keystat));
         FillMemory(keystat.ref, sizeof(keystat.ref), NKEYREF_NC);          FillMemory(keystat.ref, sizeof(keystat.ref), NKEYREF_NC);
         keystat_tblreset();          keystat_tblreset();
         getbiospath(path, "key.txt", sizeof(path));          getbiospath(path, OEMTEXT("key.txt"), NELEMENTS(path));
         keystat_tblload(path);          keystat_tblload(path);
 }  }
   
Line 79  void keystat_tblset(REG8 ref, const UINT Line 79  void keystat_tblset(REG8 ref, const UINT
   
 // ---- config...  // ---- config...
   
 static const char str_userkey1[] = "userkey1";  static const OEMCHAR str_userkey1[] = OEMTEXT("userkey1");
 static const char str_userkey2[] = "userkey2";  static const OEMCHAR str_userkey2[] = OEMTEXT("userkey2");
   
 static REG8 searchkeynum(const char *str, BOOL user) {  static REG8 searchkeynum(const OEMCHAR *str, BOOL user) {
   
 const KEYNAME   *n;  const KEYNAME   *n;
 const KEYNAME   *nterm;  const KEYNAME   *nterm;
   
         n = keyname;          n = keyname;
         nterm = keyname + (sizeof(keyname) / sizeof(KEYNAME));          nterm = keyname + NELEMENTS(keyname);
         while(n < nterm) {          while(n < nterm) {
                 if (!milstr_cmp(n->str, str)) {                  if (!milstr_cmp(n->str, str)) {
                         return(n->num);                          return(n->num);
Line 106  const KEYNAME *nterm; Line 106  const KEYNAME *nterm;
         return(0xff);          return(0xff);
 }  }
   
 void keystat_tblload(const char *filename) {  void keystat_tblload(const OEMCHAR *filename) {
   
         TEXTFILEH       tfh;          TEXTFILEH       tfh;
         char            work[256];          OEMCHAR         work[256];
         char            *p;          OEMCHAR         *p;
         char            *q;          OEMCHAR         *q;
         char            *r;          OEMCHAR         *r;
         UINT8           ref;          UINT8           ref;
         UINT8           key[15];          UINT8           key[15];
         UINT            cnt;          UINT            cnt;
Line 121  void keystat_tblload(const char *filenam Line 121  void keystat_tblload(const char *filenam
         if (tfh == NULL) {          if (tfh == NULL) {
                 goto kstbl_err;                  goto kstbl_err;
         }          }
         while(textfile_read(tfh, work, sizeof(work)) == SUCCESS) {          while(textfile_read(tfh, work, NELEMENTS(work)) == SUCCESS) {
                 p = milstr_nextword(work);                  p = milstr_nextword(work);
                 q = milstr_chr(p, '\t');                  q = milstr_chr(p, '\t');
                 if (q == NULL) {                  if (q == NULL) {

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


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