} else if(!strcmp(token, "mirroringEnabled")) { mirroringEnable = (atoi(value) == 0 ? false : true);
static void sdlApplyPerImagePreferences(){  FILE *f = sdlFindFile("vba-over.ini");  if(!f) {    fprintf(stderr, "vba-over.ini NOT FOUND (using emulator settings)\n");    return;  } else    fprintf(stderr, "Reading vba-over.ini\n");  char buffer[7];  buffer[0] = '[';  buffer[1] = rom[0xac];  buffer[2] = rom[0xad];  buffer[3] = rom[0xae];  buffer[4] = rom[0xaf];  buffer[5] = ']';  buffer[6] = 0;  char readBuffer[2048];  bool found = false;    while(1) {    char *s = fgets(readBuffer, 2048, f);    if(s == NULL)      break;    char *p  = strchr(s, ';');        if(p)      *p = 0;        char *token = strtok(s, " \t\n\r=");    if(!token)      continue;    if(strlen(token) == 0)      continue;    if(!strcmp(token, buffer)) {      found = true;      break;    }  }  if(found) {    while(1) {      char *s = fgets(readBuffer, 2048, f);      if(s == NULL)        break;      char *p = strchr(s, ';');      if(p)        *p = 0;      char *token = strtok(s, " \t\n\r=");      if(!token)        continue;      if(strlen(token) == 0)        continue;      if(token[0] == '[') // starting another image settings        break;      char *value = strtok(NULL, "\t\n\r=");      if(value == NULL)        continue;            if(!strcmp(token, "rtcEnabled"))        rtcEnable(atoi(value) == 0 ? false : true);      else if(!strcmp(token, "flashSize")) {        int size = atoi(value);        if(size == 0x10000 || size == 0x20000)          flashSetSize(size);      } else if(!strcmp(token, "saveType")) {        int save = atoi(value);        if(save >= 0 && save <= 5)          cpuSaveType = save;      }    }  }  fclose(f);}