[Smipl-devel] SF.net SVN: smipl:[32] smipl-devel
Brought to you by:
the_student
From: <the...@us...> - 2009-08-09 11:28:31
|
Revision: 32 http://smipl.svn.sourceforge.net/smipl/?rev=32&view=rev Author: the_student Date: 2009-08-09 11:28:22 +0000 (Sun, 09 Aug 2009) Log Message: ----------- Fixed strdup(char*,char*); Changed version-information to match 3.50.0 Simplified some functions Added some more DEBUG info Added place holders /Help/Help MIDI_Init and MIDI_Write for OSes where SMIPL does not yet support MIDI Modified Paths: -------------- smipl-devel/Console.h smipl-devel/FS.h smipl-devel/FS.zip smipl-devel/SIA.h smipl-devel/SIASOUND.h smipl-devel/SMIPL.cpp smipl-devel/String.h smipl-devel/config.h Modified: smipl-devel/Console.h =================================================================== --- smipl-devel/Console.h 2009-08-09 09:32:38 UTC (rev 31) +++ smipl-devel/Console.h 2009-08-09 11:28:22 UTC (rev 32) @@ -21,7 +21,7 @@ IFileStream *inputfile, *library_file; bool using_script=false, using_library=false; - if(PHYSFS_exists("/Console/Splash")){PrintFile("/Console/Splash");cin.get();} + if(PHYSFS_exists("/Console/Splash")){sys_clearscreen();PrintFile("/Console/Splash");cin.get();sys_clearscreen();} for(;;) { if(!EnterProgram) cout<<"? "; else cout<<number<<" "; @@ -123,28 +123,24 @@ } if(!stricmp(command.argv[0], "HELP")) { if(command.argc==1){ - if(PHYSFS_exists("/Help/Help")) PrintFile("/Help/Help"); - else cout<<"Help not found!"<<endl; + PrintFile("/Help/Help"); } else { //strtoupper(command.argv[1]); str=strdup("/Help/",command.argv[1]); - if(PHYSFS_exists(str))PrintFile(str); - else cout<<"Help for "<<command.argv[1]<<" not found!"<<endl; + PrintFile(str); delete[]str; } continue; } if(!stricmp(command.argv[0], "ABOUT")) { if(command.argc==1){ - if(PHYSFS_exists("/About/About")) PrintFile("/About/About"); - else cout<<"About not found!"<<endl; + PrintFile("/About/About"); } else { //strtoupper(command.argv[1]); str=strdup("/About/",command.argv[1]); - if(PHYSFS_exists(str))PrintFile(str); - else cout<<"About "<<command.argv[1]<<" not found!"<<endl; + PrintFile(str); delete[]str; } continue; Modified: smipl-devel/FS.h =================================================================== --- smipl-devel/FS.h 2009-08-09 09:32:38 UTC (rev 31) +++ smipl-devel/FS.h 2009-08-09 11:28:22 UTC (rev 32) @@ -52,6 +52,9 @@ void PrintFile(char *FileName) { pthread_mutex_lock(&FS); char* str; + #ifdef DEBUG + cout<<FileName<<":"<<endl; + #endif if(PHYSFS_exists(FileName)) { if(!PHYSFS_isDirectory(FileName)) { PHYSFS_File *File=PHYSFS_openRead(FileName); @@ -61,6 +64,7 @@ delete[] str; PHYSFS_close(File); } + else cout<<"Can't print directory"<<endl; } else cout<<"\""<<FileName<<"\": not found"<<endl; pthread_mutex_unlock(&FS); Modified: smipl-devel/FS.zip =================================================================== (Binary files differ) Modified: smipl-devel/SIA.h =================================================================== --- smipl-devel/SIA.h 2009-08-09 09:32:38 UTC (rev 31) +++ smipl-devel/SIA.h 2009-08-09 11:28:22 UTC (rev 32) @@ -2,10 +2,10 @@ #include <unistd.h> #include <fcntl.h> void sys_sleep(int time) {usleep(time);} -void sys_clearscreen(int time){system("clear");} +void sys_clearscreen(){system("clear");} #endif #ifdef system_is_ms_windows #include <windows.h> void sys_sleep(int time) {Sleep(time);} -void sys_clearscreen(int time){system("cls");} +void sys_clearscreen(){system("cls");} #endif Modified: smipl-devel/SIASOUND.h =================================================================== --- smipl-devel/SIASOUND.h 2009-08-09 09:32:38 UTC (rev 31) +++ smipl-devel/SIASOUND.h 2009-08-09 11:28:22 UTC (rev 32) @@ -14,7 +14,7 @@ void MIDI_Write(MIDI_Message Melding) { pthread_mutex_lock(&SIA_SOUND); if(MIDI_OUT_INITED) { - write(MIDI_Out, Melding.data, sizeof(Melding.data)); + write(MIDI_Out, Melding.word, sizeof(Melding.word)); } pthread_mutex_unlock(&SIA_SOUND); } @@ -42,3 +42,15 @@ pthread_mutex_unlock(&SIA_SOUND); } #endif +#ifndef EnableMIDI +void MIDI_Write(MIDI_Message Melding) { + #ifdef DEBUG + cout<<"MIDI not supported by runtime"<<endl; + #endif +} +void MIDI_Init() { + #ifdef DEBUG + cout<<"MIDI not supported by runtime"<<endl; + #endif +} +#endif Modified: smipl-devel/SMIPL.cpp =================================================================== --- smipl-devel/SMIPL.cpp 2009-08-09 09:32:38 UTC (rev 31) +++ smipl-devel/SMIPL.cpp 2009-08-09 11:28:22 UTC (rev 32) @@ -17,9 +17,18 @@ int main(int argc, char **argv) { cout<<"SMIPL "<<SMIPL_VERSION<<endl<<endl; cout<<"Setting up version globals"<<endl; - MDS_Create("/Global/SMIPL/Version/Major",3); - MDS_Create("/Global/SMIPL/Version/Minor",0); - MDS_Create("/Global/SMIPL/Version/Patch",0); + MDS_Create("/Global/com.smipl.version.major",3); + MDS_Create("/Global/com.smipl.version.minor",50); + MDS_Create("/Global/com.smipl.version.patch",0); + cout<<"Setting up compile-time configuration options"<<endl; + MDS_Create("/Global/com.smipl.midi.enable",false); + MDS_Create("/Global/com.smipl.midi.inited",false); + #ifdef EnableMIDI + cout<<"Enabling MIDI - "; + MIDI_Init(); + if(MIDI_OUT_INITED) {cout<<"OK"<<endl;MDS_Set("/Global/com.smipl.midi.inited",true);} + else cout<<"FAIL"<<endl; + #endif cout<<"Running init"<<endl; if(!Init(argc, argv)) {cerr<<"Init error:"<<GetLastSysError()<<endl;for(;;);} else if(!Console(argc, argv)) {cerr<<"Console error"<<GetLastSysError()<<endl;for(;;);} Modified: smipl-devel/String.h =================================================================== --- smipl-devel/String.h 2009-08-09 09:32:38 UTC (rev 31) +++ smipl-devel/String.h 2009-08-09 11:28:22 UTC (rev 32) @@ -5,7 +5,7 @@ char *strdup(char *a, char* b) { char* str=new char[strlen(a)+strlen(b)]; strcpy(str,a); - strcat(str,a); + strcat(str,b); return str; } void strtoupper(char*a) { Modified: smipl-devel/config.h =================================================================== --- smipl-devel/config.h 2009-08-09 09:32:38 UTC (rev 31) +++ smipl-devel/config.h 2009-08-09 11:28:22 UTC (rev 32) @@ -1,10 +1,12 @@ #ifdef __WIN32__ //Microsoft Windows #define system_is_ms_windows //Windows is Windows +#define EnableMIDI //We have got MIDI drivers #endif //#ifdef __WIN32__ #ifdef __linux__ //Linux #define system_is_posix //Linux is mostly POSIX #define TUX_SOUND //Linux uses linux sound +#define EnableMIDI //We have got MIDI drivers #endif //#ifdef __linux__ #ifdef DARWIN //Darwin (Darwin, OSX) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |