diff -Nur orig/Makefile new/Makefile
--- orig/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ new/Makefile	2011-03-05 20:49:16.000000000 +0100
@@ -0,0 +1,55 @@
+# **************************************************************************
+#    TI-99/4A read and write floppy images
+#
+#    Copyright (C) 2008 Michael Zapf (Michael.Zapf@mizapf.de)
+#    Copyright (C) 2011 Gerhard Wiesinger (gerhard@wiesinger.com)
+#
+#    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 3 of the License, or (at your option)
+#    any later version.
+#
+#    This program is distributed in the hope that it will be useful, but WITHOUT
+#    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#    FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+#    more details.
+#
+#    You should have received a copy of the GNU General Public License along with
+#    this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# **************************************************************************
+
+CC=gcc
+CCFLAGS=-g -Wall -pedantic -std=c99
+LDFLAGS=-g
+
+MAKEFILE=Makefile
+TARGET1=readti
+OBJS1=readti.o
+TARGET2=writeti
+OBJS2=writeti.o
+
+ORIGDIR=orig
+NEWDIR=new
+PATCHFILE=ti99.patch
+
+.c.o: 
+	$(CC) -c $(CCFLAGS) $< 
+
+all: $(TARGET1) $(TARGET2) $(PATCHFILE)
+
+$(TARGET1): $(OBJS1)
+	$(CC) $(LDFLAGS) -o $(TARGET1) $(OBJS1)
+#	strip $(TARGET1)
+
+$(TARGET2): $(OBJS2)
+	$(CC) $(LDFLAGS) -o $(TARGET2) $(OBJS2)
+#	strip $(TARGET2)
+
+$(PATCHFILE): $(MAKEFILE) $(TARGET1).c $(TARGET2).c
+	mkdir -p $(NEWDIR)
+	cp $(MAKEFILE) $(TARGET1).c $(TARGET2).c $(NEWDIR)
+	diff -Nur $(ORIGDIR) $(NEWDIR) > $(PATCHFILE); exit 0
+
+clean:
+	rm -f $(TARGET1) $(OBJS1) $(TARGET2) $(OBJS2) $(PATCHFILE)
diff -Nur orig/readti.c new/readti.c
--- orig/readti.c	2011-03-05 20:17:25.000000000 +0100
+++ new/readti.c	2011-03-05 20:49:16.000000000 +0100
@@ -4,6 +4,7 @@
               and Geneve computer family
     
     Copyright (C) 2008 Michael Zapf (Michael.Zapf@mizapf.de)
+    Copyright (C) 2011 Gerhard Wiesinger (gerhard@wiesinger.com)
 
     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 
@@ -24,13 +25,13 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <linux/fd.h>
 #include <linux/fdreg.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <fcntl.h>
 #include <sys/stat.h>
+#include <wchar.h>
 
 #define COMMAND 0
 #define PHEAD 1
@@ -126,7 +127,7 @@
 	if (raw_cmd.reply[0] > 0x07) 
 	{
 		printf("Read error reading sector %d on track %d, side %d. Filling with 0xdead.\n", sector, track, head+1);
-		wmemset(buffer, 0xaddeadde, size/4);
+		wmemset((wchar_t*)buffer, 0xaddeadde, size/sizeof(wchar_t));
 	}
 	write(fdout, buffer, size );
 }
@@ -180,7 +181,7 @@
 
 unsigned char *try_readid(int fd, int rate, int head, int track, int single_density)
 {
-	int tmp, size;
+	int tmp;
 	int need_seek = 1;
 
 	raw_cmd.cmd[COMMAND] = FD_READID;
@@ -211,7 +212,7 @@
 void analyze_disk(int fd)
 {
 	// fdrawcmd readid 0 rate=0 need_seek track=0
-	char *status;
+	unsigned char *status;
 	// Determine rate  
 	int rate, density;
 	int sectors, i, heads, stepping, tracks;
diff -Nur orig/writeti.c new/writeti.c
--- orig/writeti.c	2011-03-05 20:17:25.000000000 +0100
+++ new/writeti.c	2011-03-05 20:49:16.000000000 +0100
@@ -4,6 +4,7 @@
                TI-99/4A and Geneve computer family
     
     Copyright (C) 2009 Michael Zapf (Michael.Zapf@mizapf.de)
+    Copyright (C) 2011 Gerhard Wiesinger (gerhard@wiesinger.com)
 
     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 
@@ -24,13 +25,13 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <linux/fd.h>
 #include <linux/fdreg.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <fcntl.h>
 #include <sys/stat.h>
+#include <getopt.h>
 
 #define COMMAND 0
 #define PHEAD 1
@@ -213,7 +214,6 @@
 int main(int argc, char **argv)
 {
 	int fdflop, fdfile, i;
-	int index=1;
 	verbose = 0;
 	char c;
 	char *buffer;
