Skip to content

Commit

Permalink
change to v1.4k
Browse files Browse the repository at this point in the history
  • Loading branch information
AK6DN committed Jun 11, 2015
1 parent f75f74a commit 9fa75c0
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If the emulator is run with no options, it prints a usage screen:
E:\DEC> tu58em
ERROR: no units were specified
FATAL: illegal command line
tu58 tape emulator v1.4j
tu58 tape emulator v1.4k
Usage: ./tu58em [-options] -[rwci] file1 ... -[rwci] file7
Options: -V | --version output version string
-v | --verbose enable verbose output to terminal
Expand Down
Binary file modified cygwin1.dll
Binary file not shown.
4 changes: 3 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
// v1.4j - 01 Nov 2014 - donorth - Change 'int' to 'long' where possible.
// Only use char/short/long types, not int.
// Fix source for ubuntu linux 12.04 (time structs)
// v1.4k - 11 Jun 2015 - donorth - Integrate Mark Blair's changes for MacOSX compilation
// - No functionality changes on other platforms
//


Expand All @@ -49,7 +51,7 @@
static char copyright[] = "(C) 2005-2014 Don North <ak6dn" "@" "mindspring.com>, " \
"(C) 1984 Dan Ts'o <Rockefeller University>";

static char version[] = "tu58 tape emulator v1.4j";
static char version[] = "tu58 tape emulator v1.4k";

static char port[32] = "1"; // default port number (COM1, /dev/ttyS0)
static long speed = 9600; // default line speed
Expand Down
18 changes: 15 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
# tu58em emulator makefile
#

ifeq ($(comm),win)
ifeq ($(comm),mac)
# UNIX comms model, but on a Mac
PROG = tu58em
COMM = -UWINCOMM -DMACOSX
else ifeq ($(comm),win)
# WINDOWS comms model
PROG = tu58ew
COMM = -DWINCOMM
else
else # ifeq ($(comm),unix)
# UNIX comms model
PROG = tu58em
COMM = -UWINCOMM
Expand All @@ -16,7 +20,11 @@ BIN = ../../../../../tools/exe

CC = gcc
CFLAGS = -I. -O3 -Wall -c $(COMM)
ifeq ($(comm),mac)
LFLAGS = -lpthread
else
LFLAGS = -lpthread -lrt
endif

$(PROG) : main.o tu58drive.o file.o serial.o
$(CC) -o $@ main.o tu58drive.o file.o serial.o $(LFLAGS)
Expand All @@ -27,6 +35,10 @@ all :
make --always comm=unix
make clean

mac :
make --always comm=mac
make --clean

installall :
make --always comm=win install
make clean
Expand All @@ -35,7 +47,7 @@ installall :

clean :
-rm -f *.o
-chmod a-x,ug+w,o-w *.c *.h Makefile
-chmod a-x,ug+w,o-w *.c *.h makefile
-chmod a+rx $(PROG) $(PROG).exe
-chown `whoami` *

Expand Down
6 changes: 6 additions & 0 deletions serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include <winbase.h>
#endif // WINCOMM

#ifdef MACOSX
#define IUCLC 0 // Not POSIX
#define OLCUC 0 // Not POSIX
#define CBAUD 0 // Not POSIX
#endif

#include <termios.h>

#define BUFSIZE 256 // size of serial line buffers (bytes, each way)
Expand Down
18 changes: 18 additions & 0 deletions tu58drive.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@

#include "tu58.h"

#ifdef MACOSX
// clock_gettime() is not available under OSX
#define CLOCK_REALTIME 1
#include <mach/mach_time.h>

void clock_gettime(int dummy, timespec_t *t) {
uint64_t mt;
mt = mach_absolute_time();
t->tv_sec = mt / 1000000000;
t->tv_nsec = mt % 1000000000;
}
#endif


// delays for modeling device access
Expand Down Expand Up @@ -524,6 +536,12 @@ static void command (int8_t flag)
char *name= "none";
uint8_t mode = 0;

// Avoid uninitialized variable warnings
time_start.tv_sec = 0;
time_start.tv_nsec = 0;
time_end.tv_sec = 0;
time_end.tv_nsec = 0;

pk.flag = flag;
pk.length = devrxget();

Expand Down
Binary file modified tu58em.exe
Binary file not shown.
Binary file modified tu58ew.exe
Binary file not shown.

0 comments on commit 9fa75c0

Please sign in to comment.