src/emu/info.c
| r7724 | r7725 | |
| 137 | 137 | { |
| 138 | 138 | /* fix me -- this needs to be cleaned up to match the core style */ |
| 139 | 139 | |
| 140 | | enum {cjoy, cdoublejoy, cAD_stick, cdial, ctrackball, cpaddle, clightgun, cpedal, ENDCONTROLTYPES}; |
| 140 | enum {cjoy, cdoublejoy, cAD_stick, cdial, ctrackball, cpaddle, clightgun, cpedal, ckeypad, ckeyboard, ENDCONTROLTYPES}; |
| 141 | 141 | int nplayer = 0; |
| 142 | 142 | int nbutton = 0; |
| 143 | 143 | int ncoin = 0; |
| r7724 | r7725 | |
| 146 | 146 | int i; |
| 147 | 147 | const char* service = 0; |
| 148 | 148 | const char* tilt = 0; |
| 149 | | const char* const control_types[] = {"joy", "doublejoy", "stick", "dial", "trackball", "paddle", "lightgun", "pedal"}; |
| 149 | const char* const control_types[] = {"joy", "doublejoy", "stick", "dial", "trackball", "paddle", "lightgun", "pedal", "keypad", "keyboard"}; |
| 150 | 150 | static struct _input_info |
| 151 | 151 | { |
| 152 | 152 | const char * type; /* general type of input */ |
| 153 | 153 | const char * Xway; /* 2, 4, or 8 way */ |
| 154 | 154 | int analog; |
| 155 | int keyb; |
| 155 | 156 | int min; /* analog minimum value */ |
| 156 | 157 | int max; /* analog maximum value */ |
| 157 | 158 | int sensitivity; /* default analog sensitivity */ |
| r7724 | r7725 | |
| 161 | 162 | const input_port_config *port; |
| 162 | 163 | const input_field_config *field; |
| 163 | 164 | |
| 164 | | for (i=0;i<ENDCONTROLTYPES;i++) |
| 165 | for (i = 0; i < ENDCONTROLTYPES; i++) |
| 165 | 166 | { |
| 166 | 167 | control[i].type = control_types[i]; |
| 167 | 168 | control[i].Xway = NULL; |
| 168 | 169 | control[i].analog = 0; |
| 170 | control[i].keyb = 0; |
| 169 | 171 | control[i].min = 0; |
| 170 | 172 | control[i].max = 0; |
| 171 | 173 | control[i].sensitivity = 0; |
| r7724 | r7725 | |
| 176 | 178 | for (port = portlist.first(); port != NULL; port = port->next) |
| 177 | 179 | for (field = port->fieldlist; field != NULL; field = field->next) |
| 178 | 180 | { |
| 179 | | if (nplayer < field->player+1) |
| 180 | | nplayer = field->player+1; |
| 181 | if (nplayer < field->player + 1) |
| 182 | nplayer = field->player + 1; |
| 181 | 183 | |
| 182 | 184 | switch (field->type) |
| 183 | 185 | { |
| r7724 | r7725 | |
| 322 | 324 | case IPT_TILT : |
| 323 | 325 | tilt = "yes"; |
| 324 | 326 | break; |
| 327 | |
| 328 | case IPT_KEYPAD: |
| 329 | control[ckeypad].keyb = 1; |
| 330 | break; |
| 331 | |
| 332 | case IPT_KEYBOARD: |
| 333 | control[ckeyboard].keyb = 1; |
| 334 | break; |
| 325 | 335 | } |
| 326 | 336 | |
| 327 | 337 | /* get the analog stats */ |
| r7724 | r7725 | |
| 378 | 388 | |
| 379 | 389 | fprintf(out, "/>\n"); |
| 380 | 390 | } |
| 391 | if (control[i].keyb) |
| 392 | { |
| 393 | fprintf(out, "\t\t\t<control type=\"%s\"/>\n", xml_normalize_string(control_types[i])); |
| 394 | } |
| 381 | 395 | } |
| 382 | 396 | fprintf(out, "\t\t</input>\n"); |
| 383 | 397 | } |