| 314 | } |
| 315 | |
| 316 | void generalParseConfig(const char* line) { |
| 317 | char* equalsPos; |
| 318 | if ((equalsPos = strrchr(line, '=')) != 0 && equalsPos != line+strlen(line)-1) { |
| 319 | *equalsPos = '\0'; |
| 320 | const char* parameter = line; |
| 321 | const char* value = equalsPos+1; |
| 322 | |
| 323 | if (strcasecmp(parameter, "rompath") == 0) { |
| 324 | if (romPath != 0) |
| 325 | free(romPath); |
| 326 | romPath = (char*)malloc(strlen(value)+1); |
| 327 | strcpy(romPath, value); |
| 328 | romChooserState.directory = romPath; |
| 329 | } |
| 330 | else if (strcasecmp(parameter, "biosfile") == 0) { |
| 331 | if (biosPath != 0) |
| 332 | free(biosPath); |
| 333 | biosPath = (char*)malloc(strlen(value)+1); |
| 334 | strcpy(biosPath, value); |
| 335 | loadBios(biosPath); |
| 336 | } |
| 337 | else if (strcasecmp(parameter, "borderfile") == 0) { |
| 338 | if (borderPath != 0) |
| 339 | free(borderPath); |
| 340 | borderPath = (char*)malloc(strlen(value)+1); |
| 341 | strcpy(borderPath, value); |
| 342 | } |
| 343 | } |
| 344 | if (borderPath == NULL || *borderPath == '\0') { |
| 345 | free(borderPath); |
| 346 | borderPath = (char*)malloc(strlen("/border.bmp")+1); |
| 347 | strcpy(borderPath, "/border.bmp"); |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | void generalPrintConfig(FILE* file) { |
| 352 | if (romPath == 0) |
nothing calls this directly
no test coverage detected