Subversion Repositories SvarDOS

Rev

Rev 92 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 92 Rev 96
Line 6... Line 6...
6
 * Copyright (C) 2016 Mateusz Viste
6
 * Copyright (C) 2016 Mateusz Viste
7
 */
7
 */
8
 
8
 
9
/* the kblayouts list is a NULL-terminated array that contains entries in the
9
/* the kblayouts list is a NULL-terminated array that contains entries in the
10
 * following format:
10
 * following format:
11
 * human description string <0> layout code string <0> <codepage number as a 16bit value> <ega.sys file number as a single byte> <keyboard.sys file number as a single byte>
11
 * human description string <0> layout code string <0> <codepage number as a 16bit value> <ega.sys file number as a single byte> <keyboard.sys file number as a single byte> <sub keyb ID as a 16bit value, zero if none>
12

12

13
    char *kblayouts[] = {
13
    char *kblayouts[] = {
14
    "English (US)\0xxxx",
14
    "English (US)\0xxxx",
15
    "Polish\0pl\0xxxx"};
15
    "Polish\0pl\0xxxx"};
16
  };
16
  };
Line 35... Line 35...
35
  }
35
  }
36
  return(res);
36
  return(res);
37
}
37
}
38
 
38
 
39
 
39
 
40
static void addnew(char *countrycode, char *humanlang, char *keybcode, unsigned short cp, unsigned char egafile, unsigned char keybfile) {
40
static void addnew(char *countrycode, char *humanlang, char *keybcode, unsigned short cp, unsigned char egafile, unsigned char keybfile, unsigned int subid) {
41
  static char lastcountry[4] = {0};
41
  static char lastcountry[4] = {0};
42
  static int curoffset = 0, curcountryoffset = 0;
42
  static int curoffset = 0, curcountryoffset = 0;
43
  /* if new country, declare an offset */
43
  /* if new country, declare an offset */
44
  if (strcmp(countrycode, lastcountry) != 0) {
44
  if (strcmp(countrycode, lastcountry) != 0) {
45
    /* close previous one, if any */
45
    /* close previous one, if any */
Line 58... Line 58...
58
      fprintf(fdoff, "#define OFFCOUNT %d\r\n", curoffset);
58
      fprintf(fdoff, "#define OFFCOUNT %d\r\n", curoffset);
59
    }
59
    }
60
  }
60
  }
61
  /* */
61
  /* */
62
  if (countrycode[0] != 0) {
62
  if (countrycode[0] != 0) {
63
    fprintf(fdkeyb, "  \"%s\\0%s\\0\\%d\\%d\\%d\\%d\",\r\n", humanlang, keybcode, dec2oct(cp >> 8), dec2oct(cp & 0xff), dec2oct(egafile), dec2oct(keybfile));
63
    fprintf(fdkeyb, "  \"%s\\0%s\\0\\%d\\%d\\%d\\%d\\%d\\%d\",\r\n", humanlang, keybcode, dec2oct(cp >> 8), dec2oct(cp & 0xff), dec2oct(egafile), dec2oct(keybfile), dec2oct(subid >> 8), dec2oct(subid & 0xff));
64
  } else {
64
  } else {
65
    fprintf(fdkeyb, "  NULL};\r\n");
65
    fprintf(fdkeyb, "  NULL};\r\n");
66
  }
66
  }
67
  curoffset++;
67
  curoffset++;
68
}
68
}
Line 75... Line 75...
75
  fdoff = fopen("keyoff.h", "wb");
75
  fdoff = fopen("keyoff.h", "wb");
76
 
76
 
77
  /******************* LAYOUTS LIST START *******************/
77
  /******************* LAYOUTS LIST START *******************/
78
 
78
 
79
  /* English */
79
  /* English */
80
  addnew("EN", "English (US)", "en", 437, 0, 0);
80
  addnew("EN", "English (US)", "en", 437, 0, 0, 0);
81
  addnew("EN", "English (UK)", "uk", 437, 0, 1);
81
  addnew("EN", "English (UK)", "uk", 437, 0, 1, 0);
82
 
82
 
83
  /* French */
83
  /* French */
84
  addnew("FR", "French (France)", "fr", 858, 1, 1);
84
  addnew("FR", "French (France)", "fr", 858, 1, 1, 0);
85
  addnew("FR", "French (Canada, standard)", "cf", 863, 9, 1);
85
  addnew("FR", "French (Canada, standard)", "cf", 863, 9, 1, 0);
86
  addnew("FR", "French (Canada, legacy)", "cf501", 863, 9, 1);
86
  addnew("FR", "French (Canada, legacy)", "cf", 863, 9, 1, 501);
87
 
87
 
88
  /* German */
88
  /* German */
89
  addnew("DE", "German", "de", 858, 1, 1);
89
  addnew("DE", "German", "de", 858, 1, 1, 0);
90
 
90
 
91
  /* Hungarian */
91
  /* Hungarian */
92
  addnew("HU", "Hungarian", "hu208", 852, 1, 1);
92
  addnew("HU", "Hungarian", "hu", 852, 1, 1, 208);
93
 
93
 
94
  /* Polish */
94
  /* Polish */
95
  addnew("PL", "Polish", "pl", 991, 10, 1);
95
  addnew("PL", "Polish", "pl", 991, 10, 1, 0);
96
 
96
 
97
  /* Spanish */
97
  /* Spanish */
98
  addnew("ES", "Spanish", "es", 858, 1, 1);
98
  addnew("ES", "Spanish", "es", 858, 1, 1, 0);
99
 
99
 
100
  /* Turkish */
100
  /* Turkish */
101
  addnew("TR", "Turkish", "tr", 857, 1, 2);
101
  addnew("TR", "Turkish", "tr", 857, 1, 2, 0);
102
 
102
 
103
  /******************* LAYOUTS LIST STOP *******************/
103
  /******************* LAYOUTS LIST STOP *******************/
104
 
104
 
105
  /* end of list - DO NOT REMOVE */
105
  /* end of list - DO NOT REMOVE */
106
  addnew("", "", "", 0, 0, 0);
106
  addnew("", "", "", 0, 0, 0, 0);
107
 
107
 
108
  /* close files */
108
  /* close files */
109
  fclose(fdoff);
109
  fclose(fdoff);
110
  fclose(fdkeyb);
110
  fclose(fdkeyb);
111
 
111