int LoadMDFNConfig(const char *filename, CFGSTRUCT *cfgst) { FILE *fp; fp=fopen(filename,"rb"); if(fp==NULL) return(0); LoadParse(cfgst,fp); fclose(fp); return(1); }
//loads the old fceu98 format void LoadFCEUConfig_old(const char *filename, CFGSTRUCT *cfgst) { FILE *fp = fopen(filename,"rb"); if(fp==NULL) return; LoadParse(cfgst,fp); fclose(fp); }
static void LoadParse(CFGSTRUCT *cfgst, FILE *fp) { int x=0; while(cfgst[x].ptr) { if(!cfgst[x].name) // Link to new config structure { LoadParse((CFGSTRUCT*)cfgst[x].ptr,fp); x++; continue; } GetValueR(fp,cfgst[x].name,cfgst[x].ptr,cfgst[x].len); x++; } }