+ minimum_rate = ConfigGetParamInt(l_ConfigAudio, "MINIMUM_RATE" );
+ pich_percent = ConfigGetParamInt(l_ConfigAudio, "PITCH_PERCENT" );
+
+ /* get rom crc */
+ char romcrc[50];
+ m64p_rom_header romheader;
+ CoreDoCommand(M64CMD_ROM_GET_HEADER, sizeof(romheader), &romheader); // is that the right way to get rom header and crc ?
+ sprintf((char*)romcrc, "%08x%08x", (unsigned int)romheader.CRC1, (unsigned int)romheader.CRC2);
+
+ /* open NotazAudio.ini if any, and look for the rom crc section to have per rom config */
+ FILE *f;
+ f = fopen("NotazAudio.ini", "r");
+ if (f)
+ {
+ int section = 0;
+ int rightsection = 0;
+ char line[500];
+ while (!feof(f))
+ {
+ fgets(line, 500, f);
+ size_t ln = strlen(line) - 1;
+ if (line[ln] == '\n')
+ line[ln] = '\0';
+ // *TODO* remove unused whitespaces
+ if (line[0] == '/')
+ continue;
+ if (!(strcasecmp(line,"")==0))
+ {
+ if (line[0] == '{') //if a section heading
+ {
+ line[strlen(line)-1]='\0';
+ if (strcasecmp(line+1,romcrc)==0)
+ section = 1; // found !!!
+ else
+ section = 0;
+ } else if (section==1)
+ {
+ if (strncasecmp(line, "MINIMUM_RATE", 12)==0)
+ {
+ minimum_rate = strtol(strchr(line,'=')+1,NULL,10);
+ }
+ else if (strncasecmp(line, "PITCH_PERCENT", 13)==0)
+ {
+ pich_percent = strtol(strchr(line,'=')+1,NULL,10);
+ }
+ }
+ }
+ }
+ fclose(f);
+
+ }
+