X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfsound%2Fcfg.c;fp=plugins%2Fdfsound%2Fcfg.c;h=0000000000000000000000000000000000000000;hp=5801453e73969880d8f8fc77819a9b13d8e8301d;hb=6d75977b13fede33db381324c610561c6e723a8b;hpb=8048a6d763a5d74c6887ea511ba43e3124cd1bff diff --git a/plugins/dfsound/cfg.c b/plugins/dfsound/cfg.c deleted file mode 100644 index 5801453e..00000000 --- a/plugins/dfsound/cfg.c +++ /dev/null @@ -1,161 +0,0 @@ -/*************************************************************************** - cfg.c - description - ------------------- - begin : Wed May 15 2002 - copyright : (C) 2002 by Pete Bernert - email : BlackDove@addcom.de - ***************************************************************************/ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. See also the license.txt file for * - * additional informations. * - * * - ***************************************************************************/ - -#include "stdafx.h" - -#define _IN_CFG - -#include "externals.h" - -//////////////////////////////////////////////////////////////////////// -// LINUX CONFIG/ABOUT HANDLING -//////////////////////////////////////////////////////////////////////// - -#include - -//////////////////////////////////////////////////////////////////////// -// START EXTERNAL CFG TOOL -//////////////////////////////////////////////////////////////////////// - -void StartCfgTool(char * pCmdLine) -{ - FILE * cf; - char filename[255]; - - strcpy(filename,"cfgDFSound"); - cf=fopen(filename,"rb"); - if(cf!=NULL) - { - fclose(cf); - if(fork()==0) - { - execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL); - exit(0); - } - } - else - { - strcpy(filename,"cfg/cfgDFSound"); - cf=fopen(filename,"rb"); - if(cf!=NULL) - { - fclose(cf); - if(fork()==0) - { - chdir("cfg"); - execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL); - exit(0); - } - } - else - { - sprintf(filename,"%s/cfgDFSound",getenv("HOME")); - cf=fopen(filename,"rb"); - if(cf!=NULL) - { - fclose(cf); - if(fork()==0) - { - chdir(getenv("HOME")); - execl("./cfgDFSound","cfgDFSound",pCmdLine,NULL); - exit(0); - } - } - else printf("Sound error: cfgDFSound not found!\n"); - } - } -} - -///////////////////////////////////////////////////////// -// READ LINUX CONFIG FILE -///////////////////////////////////////////////////////// - -static void ReadConfigFile(void) -{ - FILE *in;char t[256];int len; - char * pB, * p; - - strcpy(t,"dfsound.cfg"); - in = fopen(t,"rb"); - if(!in) - { - strcpy(t,"cfg/dfsound.cfg"); - in = fopen(t,"rb"); - if(!in) - { - sprintf(t,"%s/dfsound.cfg",getenv("HOME")); - in = fopen(t,"rb"); - if(!in) return; - } - } - - pB = (char *)malloc(32767); - memset(pB,0,32767); - - len = fread(pB, 1, 32767, in); - fclose(in); - - strcpy(t,"\nVolume");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;} - if(p) iVolume=4-atoi(p+len); - if(iVolume<1) iVolume=1; - if(iVolume>4) iVolume=4; - - strcpy(t,"\nXAPitch");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;} - if(p) iXAPitch=atoi(p+len); - if(iXAPitch<0) iXAPitch=0; - if(iXAPitch>1) iXAPitch=1; - - strcpy(t,"\nHighCompMode");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;} - if(p) iUseTimer=atoi(p+len); - if(iUseTimer<0) iUseTimer=0; - // note: timer mode 1 (win time events) is not supported - // in linux. But timer mode 2 (spuupdate) is safe to use. - if(iUseTimer) iUseTimer=2; - - strcpy(t,"\nSPUIRQWait");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;} - if(p) iSPUIRQWait=atoi(p+len); - if(iSPUIRQWait<0) iSPUIRQWait=0; - if(iSPUIRQWait>1) iSPUIRQWait=1; - - strcpy(t,"\nUseReverb");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;} - if(p) iUseReverb=atoi(p+len); - if(iUseReverb<0) iUseReverb=0; - if(iUseReverb>2) iUseReverb=2; - - strcpy(t,"\nUseInterpolation");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;} - if(p) iUseInterpolation=atoi(p+len); - if(iUseInterpolation<0) iUseInterpolation=0; - if(iUseInterpolation>3) iUseInterpolation=3; - - free(pB); -} - -///////////////////////////////////////////////////////// -// READ CONFIG called by spu funcs -///////////////////////////////////////////////////////// - -void ReadConfigSPU(void) -{ - iVolume=2; - iXAPitch=0; - iSPUIRQWait=0; - iUseTimer=2; - iUseReverb=2; - iUseInterpolation=2; - - ReadConfigFile(); -}