diff -Naru xmtomid-0.1/Makefile xmtomid-0.2/Makefile
--- xmtomid-0.1/Makefile	2000-02-13 18:45:59.000000000 +0900
+++ xmtomid-0.2/Makefile	2004-02-11 12:52:01.000000000 +0900
@@ -1,8 +1,13 @@
-CC    = c++
+CXX    = c++
+# Prevent the warnings on the deprecated or antiquated headers
+# for the recent g++ compiler.
+CXXFLAGS = -Wno-deprecated
 PROGRAM = xmtomid
 
 all:  xmtomid
 
 xmtomid:  
-	$(CC) -o $(PROGRAM) main.c xm.c xmpattern.c xmheader.c xmtrack.c map.c midi.c midtrack.c  midheader.c
+	$(CXX) $(CXXFLAGS) -o $(PROGRAM) main.c xm.c xmpattern.c xmheader.c xmtrack.c map.c midi.c midtrack.c  midheader.c
 
+clean:
+	rm -f xmtomid
diff -Naru xmtomid-0.1/README xmtomid-0.2/README
--- xmtomid-0.1/README	2000-02-13 19:05:53.000000000 +0900
+++ xmtomid-0.2/README	2004-02-13 09:23:07.000000000 +0900
@@ -1,4 +1,8 @@
-the use of program:
-xmtomid mapfile xmfile midfile
+The use of program:
+xmtomid mapfile xmfile midfile [copyrighter] [tempo factor]
 
-you can find an example mapfile in this directory.
+You can find an example mapfile in this directory.
+Optionally a copyrighter's name (length < 26 characters) may be specified.
+You can alter the tempo by specifying a tempo factor, e.g., the 
+tempo factor of 2.0 makes the tempo twice as slow as the original 
+one.
diff -Naru xmtomid-0.1/main.c xmtomid-0.2/main.c
--- xmtomid-0.1/main.c	2000-02-13 18:34:37.000000000 +0900
+++ xmtomid-0.2/main.c	2004-02-11 19:46:54.000000000 +0900
@@ -1,26 +1,35 @@
 #include "xm.h"
 #include "map.h"
 #include "midi.h"
+#include <stdlib.h>
 
 int main(int argc,char **argv){
 
     InstMap *map;
-    if (argc==4) {
+    if (argc==4 || (argc == 5 || argc == 6)) {
     	map = new InstMap(argv[1]);
 	    
     	XM *x;
     	x = new XM(argv[2]);
 
-
     	Midi *mid;
+		if(argc==4){
+    		mid = new Midi(argv[3],x,map,(unsigned char *)" ",1.0);
+    	} else if (argc==5){
+    		double tf = ::atof(argv[4]);
+    		tf > 0.0 ?
+    			mid = new Midi(argv[3],x,map,(unsigned char *)" ",tf) :
+        		mid = new Midi(argv[3],x,map,(unsigned char *)argv[4],1.0);
+    	} else if (argc==6){
+        	mid = new Midi(argv[3],x,map,(unsigned char *)argv[4],::atof(argv[5]));
+        }
 
-    	mid = new Midi(argv[3],x,map);
-    
 		delete mid;
 		delete map;
     	delete x;
     } else {
-    	cout << "usage: xmtomid mapfile xmfile midfile\n";
+    	std::cout << "usage: xmtomid mapfile xmfile midfile [copyrighter] [tempo factor]\n";
     }
     return 0;
 }
+
diff -Naru xmtomid-0.1/map.c xmtomid-0.2/map.c
--- xmtomid-0.1/map.c	2000-02-13 18:35:20.000000000 +0900
+++ xmtomid-0.2/map.c	2004-02-11 15:57:55.000000000 +0900
@@ -11,12 +11,13 @@
  * version history:
  * 
  * 0.1 - 1998/08/23 - private version 
+ * 0.2 - 2004/02/11 - modification 
  * 
  */
 
 #include "map.h"
 #include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
 
 /*
  * Create the istrument map from the mapping file fname
@@ -31,7 +32,11 @@
     int i;
     ifstream in;
     in.open(fname);
-    
+    if (!in) {
+	std::cout << "***ERROR*** " << fname << " not found.\n";
+	exit(255);
+	}
+
     in.get(c);
 
 	for (i=0;i<256;i++) {
@@ -151,16 +156,18 @@
 
 		if (chn[i]!=255) {
 
-			cout << "Instrument " << i << "\n";
-			cout << "   chn.no. " << (int)chn[i] << " program " << (int)prg[i] << "\n";
-			cout << "   volume  " << (int)vol[i] << "\n";
+			std::cout << "Instrument " << i << "\n";
+			std::cout << "   chn.no. " << (int)chn[i] << " program " << (int)prg[i] << "\n";
+			std::cout << "   volume  " << (int)vol[i] << "\n";
 			s = getTranspositionLength(i);
-			cout << "   trans. ";
+			std::cout << "   trans. ";
 			for (j=0; j<s; j++) {
-				cout << getTransposition(j,i) << " ";
+				std::cout << getTransposition(j,i) << " ";
 			}
-			cout << "\n\n";
+			std::cout << "\n\n";
 		}
 	}
 }
 
+
+
diff -Naru xmtomid-0.1/map.h xmtomid-0.2/map.h
--- xmtomid-0.1/map.h	2000-02-13 18:35:37.000000000 +0900
+++ xmtomid-0.2/map.h	2004-02-11 11:36:16.000000000 +0900
@@ -46,3 +46,5 @@
 };
 
 #endif
+
+
diff -Naru xmtomid-0.1/midheader.c xmtomid-0.2/midheader.c
--- xmtomid-0.1/midheader.c	2000-02-13 18:35:52.000000000 +0900
+++ xmtomid-0.2/midheader.c	2004-02-11 11:36:32.000000000 +0900
@@ -34,11 +34,11 @@
     unsigned char division[2] = { 0, 24 };
 
 	if (numTracks!=NULL) {
-		out->write(MThdID,4);
-		out->write(length,4);
-		out->write(format,2);
-		out->write(numTracks,2);
-		out->write(division,2);
+		out->write((const char*)MThdID,4);
+		out->write((const char*)length,4);
+		out->write((const char*)format,2);
+		out->write((const char*)numTracks,2);
+		out->write((const char*)division,2);
 	
 		return 0;
 	} else {
@@ -56,4 +56,5 @@
 
 	return 0;
 
-}
\ No newline at end of file
+}
+
diff -Naru xmtomid-0.1/midheader.h xmtomid-0.2/midheader.h
--- xmtomid-0.1/midheader.h	2000-02-13 18:35:59.000000000 +0900
+++ xmtomid-0.2/midheader.h	2004-02-11 11:36:33.000000000 +0900
@@ -35,4 +35,5 @@
 
 };
 
-#endif  	
\ No newline at end of file
+#endif  	
+
diff -Naru xmtomid-0.1/midi.c xmtomid-0.2/midi.c
--- xmtomid-0.1/midi.c	2000-02-13 18:45:01.000000000 +0900
+++ xmtomid-0.2/midi.c	2004-02-13 09:01:19.000000000 +0900
@@ -10,12 +10,14 @@
  * version history:
  * 
  * 0.1 - 1998/08/28 - private version 
+ * 0.2 - 2004/02/11 - modification 
  * 
  */
 
 #include "midi.h"
 
-Midi::Midi(char* fn, XM* xm, InstMap* map) {
+Midi::Midi(char* fn, XM* xm, InstMap* map, 
+           unsigned char* CpyRighter, double tempofactor) {
 
 
 	fname = fn;
@@ -25,10 +27,30 @@
 	tracks = (MidiTrack**)malloc(17*sizeof(MidiTrack));
 
 	tracks[0] = new MidiTrack(&outmid);
-	unsigned char Copyright[10] = { 0xFF, 0x02, 0x07 ,'(','c',')','P','i','l','u' };
-	tracks[0]->writeNextEvent(0x0,Copyright,10);
-	unsigned char Tempo[6] = { 0xFF, 0x51, 0x03, 0x07, 0x53, 0x00 };
-	tracks[0]->writeNextEvent(0x0, Tempo, 6);
+	unsigned char Copyright[31] = { 0xFF, 0x02, 0x00 ,\
+	'(','c',')','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0',\
+	'\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0'};
+	// Set the Copyright string.
+	{
+		int i;
+    	for (i = 6; i < 31 && *CpyRighter != '\0'; i++)
+			Copyright[i] = *CpyRighter++;
+		Copyright[2] = (unsigned char) (i - 3);
+		tracks[0]->writeNextEvent(0x0,Copyright,i);
+	}
+	unsigned char Tempo[6] = { 0xFF, 0x51, 0x03, 0x00, 0x00, 0x00 };
+	// Alter the current tempo 500000us (120 beats/minute) by the factor
+	// of tempofactor.
+	{
+		int i = (int)(500000.0*tempofactor);
+		Tempo[5]=(unsigned char)i;
+		i >>= 8;
+		Tempo[4]=(unsigned char)i;
+		i >>= 8;
+		Tempo[3]=(unsigned char)i;
+		tracks[0]->writeNextEvent(0x0, Tempo, 6);
+	}
+	
 	unsigned char EOT[3] = { 0xFF, 0x2F, 0x00 };
 	pp = 6;
 	
@@ -61,7 +83,7 @@
 	// for each patterns
 	for (o=0;o<xm->header->getSongLength();o++){
 	p=xm->header->order[o];
-	cout << "pattern: " << (int)p <<"\r" ; 
+	std::cout << "pattern: " << (int)p <<"\r" ; 
 	
 	for (r=cc;r<xm->patterns[p]->numRows;r++) { //for each row
 		et++;
@@ -85,7 +107,7 @@
 			    vel = (int)((efp*efp)/64);
 			} else 	if (eft==0x0F) {
 			    if (efp < 0x20) {
-				tempo=efp*80000;
+				tempo=(int)((double)efp*80000.0*tempofactor);
 				Tempo[5]=(unsigned char)tempo;
 				tempo >>= 8;
 				Tempo[4]=(unsigned char)tempo;
@@ -94,7 +116,7 @@
 				tracks[0]->writeNextEvent((et-lt[0])*pp, Tempo, 6);
 				lt[0]=et;
 			    } else {
-				tempo=(int)(60000000/efp);
+				tempo=(int)(60000000.0/(double)efp*tempofactor);
 				Tempo[5]=(unsigned char)tempo;
 				tempo >>= 8;
 				Tempo[4]=(unsigned char)tempo;
@@ -254,7 +276,7 @@
 			tracks[t]->writeNextEvent(et-lt[t], EOT, 3);
 		}
 	}
-	cout <<"\n";
+	std::cout <<"\n";
 	write();
 }
 
@@ -289,10 +311,10 @@
 	for (i=0;i<17;i++) {
 		if (tracks[i]!=NULL) {
 			tracks[i]->write();
-			cout << "Track " << i << "\r";
+			std::cout << "Track " << i << "\r";
 		}
 	}
-	cout <<"\n";
+	std::cout <<"\n";
 	return 0;
 }
 
@@ -355,3 +377,5 @@
 	}
 	return 0;
 }
+
+
diff -Naru xmtomid-0.1/midi.h xmtomid-0.2/midi.h
--- xmtomid-0.1/midi.h	1998-11-10 22:17:18.000000000 +0900
+++ xmtomid-0.2/midi.h	2004-02-11 15:35:02.000000000 +0900
@@ -10,14 +10,15 @@
  * version history:
  * 
  * 0.1 - 1998/08/27 - private version 
+ * 0.2 - 2004/02/11 - modification 
  * 
  */
 
 #ifndef _midi_h
 #define _midi_h
 
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdlib.h>
 #include "midheader.h"
 #include "midtrack.h"
@@ -45,7 +46,7 @@
 	int aftertouch(int,int,int);
  	
  public:
- 	Midi(char*,XM*,InstMap*);
+ 	Midi(char*,XM*,InstMap*,unsigned char*,double);
  	~Midi();
 
  	int write();
@@ -56,3 +57,5 @@
 
 #endif
  
+
+
diff -Naru xmtomid-0.1/midtrack.c xmtomid-0.2/midtrack.c
--- xmtomid-0.1/midtrack.c	2000-02-13 18:39:40.000000000 +0900
+++ xmtomid-0.2/midtrack.c	2004-02-11 15:38:42.000000000 +0900
@@ -1,5 +1,5 @@
 /*
- * midtrack.c 0.1 1998/08/27 
+ * midtrack.c 0.1 1998/08/27
  * 
  * Midi Track format class implementation
  * 
@@ -10,11 +10,13 @@
  * version history:
  * 
  * 0.1 - 1998/08/27 - private version 
+ * 0.2 - 2004/02/11 - modification 
  * 
  */
 
 #include "midtrack.h"
 #include <stdlib.h>
+#include <iostream>
 
 MidiTrack::MidiTrack(ofstream* o){
 	
@@ -52,7 +54,7 @@
 		trackdata[i]=(unsigned char)l;
 		l >>= 8;
 	}
-	out->write(trackdata,len);
+	out->write((const char*)trackdata,len);
 	return 0;
 }
 
@@ -85,7 +87,7 @@
 	    }
 	    trackdata = (unsigned char*)realloc(trackdata,tds);
 	    if (trackdata==NULL) {
-		cout << "***ERROR***\n";
+		std::cout << "***ERROR***\n";
 		exit(255);
 	    }    	
     	
@@ -107,4 +109,5 @@
 
 		
 	return 0;
-}
\ No newline at end of file
+}
+
diff -Naru xmtomid-0.1/midtrack.h xmtomid-0.2/midtrack.h
--- xmtomid-0.1/midtrack.h	2000-02-13 18:39:53.000000000 +0900
+++ xmtomid-0.2/midtrack.h	2004-02-11 11:36:52.000000000 +0900
@@ -39,4 +39,5 @@
 
 };
 
-#endif
\ No newline at end of file
+#endif
+
diff -Naru xmtomid-0.1/xm.c xmtomid-0.2/xm.c
--- xmtomid-0.1/xm.c	2000-02-13 18:40:23.000000000 +0900
+++ xmtomid-0.2/xm.c	2004-02-11 15:57:47.000000000 +0900
@@ -10,10 +10,12 @@
  * version history:
  * 
  * 0.1 - 1998/07/13 - the first private version 
+ * 0.2 - 2004/02/11 - modification 
  * 
  */
 
 #include "xm.h"
+#include "stdlib.h"
 
 XM::XM(char *fn) {
 
@@ -30,6 +32,10 @@
 
 int XM::read(){
     inpxm.open(fname);
+    if (!inpxm) {
+	std::cout << "***ERROR*** " << fname << " not found.\n";
+	exit(255);
+	}
     
     header = new XMHeader(&inpxm);
     patterns = (XMPattern**)malloc((header->getNumberPatterns())*sizeof(XMPattern));
@@ -55,3 +61,5 @@
     }
     //PENDING
 }
+
+
diff -Naru xmtomid-0.1/xm.h xmtomid-0.2/xm.h
--- xmtomid-0.1/xm.h	2000-02-13 18:40:40.000000000 +0900
+++ xmtomid-0.2/xm.h	2004-02-11 11:37:00.000000000 +0900
@@ -41,4 +41,5 @@
     
 };
 
-#endif
\ No newline at end of file
+#endif
+
diff -Naru xmtomid-0.1/xmheader.c xmtomid-0.2/xmheader.c
--- xmtomid-0.1/xmheader.c	2000-02-13 18:41:25.000000000 +0900
+++ xmtomid-0.2/xmheader.c	2004-02-11 11:37:06.000000000 +0900
@@ -114,3 +114,5 @@
     }
 
 }
+
+
diff -Naru xmtomid-0.1/xmheader.h xmtomid-0.2/xmheader.h
--- xmtomid-0.1/xmheader.h	1998-11-10 22:17:16.000000000 +0900
+++ xmtomid-0.2/xmheader.h	2004-02-11 11:37:08.000000000 +0900
@@ -58,4 +58,5 @@
     
 };
 
-#endif
\ No newline at end of file
+#endif
+
diff -Naru xmtomid-0.1/xmpattern.c xmtomid-0.2/xmpattern.c
--- xmtomid-0.1/xmpattern.c	2000-02-13 18:42:13.000000000 +0900
+++ xmtomid-0.2/xmpattern.c	2004-02-11 15:35:36.000000000 +0900
@@ -10,11 +10,12 @@
  * version history:
  * 
  * 0.2 - 1998/08/23 - private version 
+ * 0.3 - 2004/02/11 - modification 
  * 
  */
 
 #include "xmpattern.h"
-#include <iostream.h>
+#include <iostream>
 #include <stdlib.h>
 
 XMPattern::XMPattern(ifstream* inp,unsigned short numChn){
@@ -43,17 +44,17 @@
 	int i,j,v;
 	unsigned char c,n;
 
-	inp->read(&headerLength,4);
+	inp->read((char *)&headerLength,4);
     
-	inp->read(&packType,1);
+	inp->read((char *)&packType,1);
     
-	inp->read(&numRows,2);
+	inp->read((char *)&numRows,2);
     
-	inp->read(&patternDataSize,2);
+	inp->read((char *)&patternDataSize,2);
 	
 	patternData = (unsigned char*)malloc(patternDataSize);    
 		
-	inp->read(patternData,patternDataSize);
+	inp->read((char *)patternData,patternDataSize);
    
 	
     for (i=0;i<numChannels;i++) {
@@ -118,7 +119,7 @@
 	if (v==patternDataSize) {
 	    return 0;
 	} else {
-		cout << v << " != " << patternDataSize << "\n";
+		std::cout << v << " != " << patternDataSize << "\n";
 		return 1;
 	}
 }
@@ -150,3 +151,5 @@
 }
     
     
+
+
diff -Naru xmtomid-0.1/xmpattern.h xmtomid-0.2/xmpattern.h
--- xmtomid-0.1/xmpattern.h	1998-11-10 22:17:16.000000000 +0900
+++ xmtomid-0.2/xmpattern.h	2004-02-11 11:37:21.000000000 +0900
@@ -41,4 +41,5 @@
     
 };
 
-#endif
\ No newline at end of file
+#endif
+
diff -Naru xmtomid-0.1/xmtrack.c xmtomid-0.2/xmtrack.c
--- xmtomid-0.1/xmtrack.c	2000-02-13 18:42:37.000000000 +0900
+++ xmtomid-0.2/xmtrack.c	2004-02-11 11:37:24.000000000 +0900
@@ -135,3 +135,5 @@
 
 }
 
+
+
diff -Naru xmtomid-0.1/xmtrack.h xmtomid-0.2/xmtrack.h
--- xmtomid-0.1/xmtrack.h	1998-11-10 22:17:20.000000000 +0900
+++ xmtomid-0.2/xmtrack.h	2004-02-11 11:37:25.000000000 +0900
@@ -54,4 +54,5 @@
 
 };
 
-#endif	
\ No newline at end of file
+#endif	
+
