diff --git a/.cvsignore b/.cvsignore old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore index e489d5d..7b3f338 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ WINBUILD-nibread/objfre* /obj* /objchk* /objfre* +*.o +*~ diff --git a/GNU/Makefile b/GNU/Makefile index 8086b91..d6cc2b0 100644 --- a/GNU/Makefile +++ b/GNU/Makefile @@ -47,30 +47,35 @@ dos: CFLAGS="-I include/DOS/ $(CFLAGS)" \ EXE=".exe" \ -f GNU/Makefile \ - nibread nibwrite nibconv nibscan nibrepair + nibconv nibscan nibrepair nibread nibwrite linux: - ${MAKE} CFLAGS="-I include/LINUX/ -I ${CBM_LNX_PATH}/include ${CFLAGS} -std=c99" \ + ${MAKE} CFLAGS="-I include/LINUX/ -I ${CBM_LNX_PATH}/include ${CFLAGS} -std=c99 -D_BSD_SOURCE" \ LDFLAGS="-L${CBM_LNX_PATH}/lib -lopencbm" \ -f GNU/Makefile \ - nibread nibwrite nibconv nibscan nibrepair nibsrqtest + nibconv nibscan nibrepair nibread nibwrite nibsrqtest win32: ${MAKE} CFLAGS="-I include/WINDOWS/ -I ${CBM_WIN_PATH}/include -D WIN32 ${CFLAGS} -std=c99" \ LDFLAGS="-L${CBM_WIN_PATH}/bin/i386/ -lopencbm" \ EXE=".exe" \ -f GNU/Makefile \ - nibread nibwrite nibconv nibscan nibrepair nibsrqtest + nibconv nibscan nibrepair nibread nibwrite nibsrqtest win64: ${MAKE} CFLAGS="-I include/WINDOWS/ -I ${CBM_WIN_PATH}/include -D WIN32 ${CFLAGS} -std=c99" \ LDFLAGS="-L${CBM_WIN_PATH}/bin/amd64/ -lopencbm" \ EXE=".exe" \ -f GNU/Makefile \ - nibread nibwrite nibconv nibscan nibrepair nibsrqtest + nibconv nibscan nibrepair nibread nibwrite nibsrqtest # Warning level. Don't reduce, fix your new code instead. -WARNS= -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wpointer-arith +WARNS= -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wpointer-arith \ + -Wextra -Wconversion -pedantic \ + -Werror-implicit-function-declaration \ + -Wsign-conversion +# -Werror=format-security + # Common objects OBJ=gcr.o prot.o fileio.o crc.o md5.o lz.o @@ -89,7 +94,7 @@ buildall: ${PROG} nibread: ${OBJ} ${NIBREAD_OBJ} ${NIBTOOLS_BIN} ${ARCH_OBJ} ${CC} -o nibread$(EXE) ${OBJ} ${NIBREAD_OBJ} ${ARCH_OBJ} ${LDFLAGS} - + nibsrqtest: ${NIBSRQTEST_OBJ} ${NIBTOOLS_BIN} ${ARCH_OBJ} ${CC} -o nibsrqtest$(EXE) ${NIBSRQTEST_OBJ} ${ARCH_OBJ} ${LDFLAGS} @@ -103,20 +108,20 @@ nibsrqtest.c: ${NIBTOOLS_BIN} nibwrite.c: ${NIBTOOLS_BIN} nibconv: ${OBJ} nibconv.o - ${CC} -o nibconv$(EXE) nibconv.o ${OBJ} $(LDFLAGS) + ${CC} -o nibconv$(EXE) nibconv.o ${OBJ} nibrepair: ${OBJ} nibrepair.o - ${CC} -o nibrepair$(EXE) nibrepair.o ${OBJ} $(LDFLAGS) + ${CC} -o nibrepair$(EXE) nibrepair.o ${OBJ} nibscan: ${OBJ} nibscan.o - ${CC} -o nibscan$(EXE) nibscan.o ${OBJ} $(LDFLAGS) + ${CC} -o nibscan$(EXE) nibscan.o ${OBJ} clean: ${RM} *.o ${MNIB_BIN} *.bin *.inc nib*.exe distclean: clean ${RM} ${PROG} *.exe - + drive.o: nibtools_1541.inc nibtools_1541_ihs.inc nibtools_1571.inc nibtools_1571_ihs.inc nibtools_1571_srq.inc nibtools_1571_srq_test.inc *.o: gcr.h nibtools.h @@ -136,7 +141,7 @@ nibtools_1541_ihs.bin: nibtools_15x1_ihs.asm nibtools_1571_ihs.bin: nibtools_15x1_ihs.asm $(CA65) $(CA65_FLAGS) -D DRIVE=1571 -o $*.tmp $< $(LD65) -o $@ --target none $*.tmp && rm -f $*.tmp - + nibtools_1571_srq.bin: nibtools_1571_srq.asm $(CA65) $(CA65_FLAGS) -D DRIVE=1571 -o $*.tmp $< $(LD65) -o $@ --target none $*.tmp && rm -f $*.tmp @@ -144,7 +149,7 @@ nibtools_1571_srq.bin: nibtools_1571_srq.asm nibtools_1571_srq_test.bin: nibtools_1571_srq_test.asm $(CA65) $(CA65_FLAGS) -D DRIVE=1571 -o $*.tmp $< $(LD65) -o $@ --target none $*.tmp && rm -f $*.tmp - + .bin.inc: test -s $< && od -txC -v -An $< | \ sed 's/\([0-9a-f]\{2\}\) */0x\1,/g; $$s/,$$//' > $@ diff --git a/LINUX/Makefile b/LINUX/Makefile index 2fa1b0a..cc54e70 100644 --- a/LINUX/Makefile +++ b/LINUX/Makefile @@ -1,20 +1,22 @@ # $Id: Makefile,v 1.1.1.1 2007/01/21 17:15:35 peter Exp $ -RELATIVEPATH=../ -include ${RELATIVEPATH}LINUX/config.make +#RELATIVEPATH=../ +#include ${RELATIVEPATH}LINUX/config.make .PHONY: all mrproper clean install uninstall install-files OBJS = nibread.o nibwrite.o nibscan.o nibconv.o nibrepair.o nibsrqtest.o read.o write.o gcr.o prot.o crc.o drive.o fileio.o ihs.o lz.o md5.o PROG = nibread nibwrite nibscan nibconv nibrepair nibsrqtest +CBM_LNX_PATH=../../../opencbm/OpenCBM/opencbm + all: - make -f GNU/Makefile CBM_LNX_PATH="../" linux + make -f GNU/Makefile CBM_LNX_PATH=$(CBM_LNX_PATH) linux mrproper: clean clean: - make -f GNU/Makefile CBM_LNX_PATH="../" distclean + make -f GNU/Makefile distclean install-files: $(PROG) install -m 755 -s $(PROG) $(BINDIR) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1e367fb --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ + +#TARGET_ENV=GNU +TARGET_ENV=LINUX +#TARGET_ENV=WSDK + +all: + make -f $(TARGET_ENV)/Makefile + +clean: + make -f $(TARGET_ENV)/Makefile clean + +install: + make -f $(TARGET_ENV)/Makefile install + +uninstall: + make -f $(TARGET_ENV)/Makefile uninstall + +.PHONY: all clean install uninstall diff --git a/drive.c b/drive.c index 71e1462..e468551 100644 --- a/drive.c +++ b/drive.c @@ -8,6 +8,10 @@ #include #include +#ifndef DJGPP +#include +#endif + #include "mnibarch.h" #include "gcr.h" #include "nibtools.h" diff --git a/drive.h b/drive.h new file mode 100644 index 0000000..b74e17a --- /dev/null +++ b/drive.h @@ -0,0 +1,34 @@ + +#ifndef DRIVE_H +#define DRIVE_H + +int compare_extension(unsigned char * filename, unsigned char * extension); +unsigned char burst_read(CBM_FILE f); +void burst_write(CBM_FILE f, unsigned char c); +int burst_read_n(CBM_FILE f, unsigned char *Buffer, unsigned int Length); +int burst_write_n(CBM_FILE f, unsigned char *Buffer, unsigned int Length); +int burst_read_track(CBM_FILE f, unsigned char *Buffer, unsigned int Length); +int burst_write_track(CBM_FILE f, unsigned char *Buffer, unsigned int Length); +void ARCH_SIGNALDECL handle_signals(int sig); +void ARCH_SIGNALDECL handle_exit(void); +int upload_code(CBM_FILE fd, BYTE drive); +int reset_floppy(CBM_FILE fd, BYTE drive); +int init_floppy(CBM_FILE fd, BYTE drive, int bump); +int set_density(CBM_FILE fd, BYTE density); +BYTE set_bitrate(CBM_FILE fd, BYTE density); +BYTE set_default_bitrate(CBM_FILE fd, int track); +BYTE scan_track(CBM_FILE fd, int track); +void perform_bump(CBM_FILE fd, BYTE drive); +int test_par_port(CBM_FILE fd); +void send_mnib_cmd(CBM_FILE fd, BYTE cmd, BYTE *args, int num_args); +void set_full_track(CBM_FILE fd); +void motor_on(CBM_FILE fd); +void motor_off(CBM_FILE fd); +void step_to_halftrack(CBM_FILE fd, int halftrack); +int verify_floppy(CBM_FILE fd); +#ifdef DJGPP +#include +int find_par_port(CBM_FILE fd); +#endif + +#endif diff --git a/fileio.h b/fileio.h new file mode 100644 index 0000000..d499699 --- /dev/null +++ b/fileio.h @@ -0,0 +1,25 @@ + +#ifndef FILEIO_H +#define FILEIO_H + +void parseargs(char *argv[]); +void switchusage(void); +int load_file(char *filename, BYTE *file_buffer); +int save_file(char *filename, BYTE *file_buffer, int length); +int read_nib(BYTE *file_buffer, int file_buffer_size, BYTE *track_buffer, BYTE *track_density, size_t *track_length); +int read_nb2(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); +int read_g64(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); +int read_d64(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); +int write_nib(BYTE*file_buffer, BYTE *track_buffer, BYTE *track_density, size_t *track_length); +int write_g64(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); +int write_d64(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); +size_t compress_halftrack(int halftrack, BYTE *track_buffer, BYTE track_density, size_t track_length); +int align_tracks(BYTE *track_buffer, BYTE *track_density, size_t *track_length, BYTE *track_alignment); +int sync_tracks(BYTE *track_buffer, BYTE *track_density, size_t *track_length, BYTE *track_alignment); +int write_dword(FILE * fd, DWORD * buf, int num); +unsigned int crc_dir_track(BYTE *track_buffer, size_t *track_length); +unsigned int crc_all_tracks(BYTE *track_buffer, size_t *track_length); +unsigned int md5_dir_track(BYTE *track_buffer, size_t *track_length, unsigned char *result); +unsigned int md5_all_tracks(BYTE *track_buffer, size_t *track_length, unsigned char *result); + +#endif diff --git a/ihs.c b/ihs.c old mode 100755 new mode 100644 diff --git a/ihs.h b/ihs.h old mode 100755 new mode 100644 diff --git a/include/LINUX/mnibarch.h b/include/LINUX/mnibarch.h index 1d6f65d..d45b584 100644 --- a/include/LINUX/mnibarch.h +++ b/include/LINUX/mnibarch.h @@ -1,4 +1,8 @@ -#include + +#ifndef MNIBARCH_H +#define MNIBARCH_H + +#include #include #define delay(x) usleep((x) * 1000) @@ -12,6 +16,12 @@ typedef unsigned char BYTE; // __int32 and min() are needed for bitshifter.c (included by fileio.c) typedef int32_t __int32; +#ifndef CBM_FILE +typedef int CBM_FILE; +#endif + #ifndef min #define min(x, y) ((x) > (y) ? (y) : (x)) #endif + +#endif diff --git a/lz.c b/lz.c old mode 100755 new mode 100644 diff --git a/lz.h b/lz.h old mode 100755 new mode 100644 diff --git a/nibconv.c b/nibconv.c index d5f5538..d4b3cae 100644 --- a/nibconv.c +++ b/nibconv.c @@ -12,10 +12,14 @@ #include "mnibarch.h" #include "gcr.h" -#include "nibtools.h" +#include "drive.h" +#include "fileio.h" #include "lz.h" +#include "nibtools_version.h" #include "prot.h" +void usage(void); + int _dowildcard = 1; BYTE compressed_buffer[(MAX_HALFTRACKS_1541 + 2) * NIB_TRACK_LENGTH]; diff --git a/nibread.c b/nibread.c index 17d574a..af2b749 100644 --- a/nibread.c +++ b/nibread.c @@ -11,6 +11,10 @@ #include #include +#ifndef DJGPP +#include +#endif + #include "mnibarch.h" #include "gcr.h" #include "nibtools.h" diff --git a/nibsrqtest.c b/nibsrqtest.c old mode 100755 new mode 100644 index 5d326b9..3462533 --- a/nibsrqtest.c +++ b/nibsrqtest.c @@ -9,6 +9,10 @@ #include #include +#ifndef DJGPP +#include +#endif + #include "mnibarch.h" #include "gcr.h" #include "nibtools.h" diff --git a/nibtools.h b/nibtools.h index a859549..16b0d33 100644 --- a/nibtools.h +++ b/nibtools.h @@ -4,112 +4,13 @@ * based on MNIB by Markus Brenner */ -#define VERSION "Built "__DATE__" "__TIME__ -#define AUTHOR "(C) Peter Rittwage and the rest of the C64 Preservation Project team\nhttp://c64preservation.com\n" -#ifndef SVN -#define SVN 2014 -#endif - -#define FL_STEPTO 0x00 -#define FL_MOTOR 0x01 -#define FL_RESET 0x02 -#define FL_READWOSYNC 0x03 -#define FL_READNORMAL 0x04 -#define FL_READIHS 0x05 -#define FL_DENSITY 0x06 -#define FL_SCANKILLER 0x07 -#define FL_SCANDENSITY 0x08 -#define FL_READMOTOR 0x09 -#define FL_TEST 0x0a -#define FL_WRITE 0x0b -#define FL_CAPACITY 0x0c -#define FL_ALIGNDISK 0x0d -#define FL_VERIFY_CODE 0x0e -#define FL_FILLTRACK 0x0f -#define FL_READMARKER 0x10 - -#define DISK_NORMAL 0 - -#define IMAGE_NIB 0 /* destination image format */ -#define IMAGE_D64 1 -#define IMAGE_G64 2 -#define IMAGE_NB2 3 - -#define BM_MATCH 0x10 /* not used but exists in very old images */ -#define BM_NO_CYCLE 0x20 -#define BM_NO_SYNC 0x40 -#define BM_FF_TRACK 0x80 - -#define DENSITY_SAMPLES 2 - -/* custom density maps for reading */ -#define DENSITY_STANDARD 0 -#define DENSITY_RAPIDLOK 1 - -#define MODE_READ_DISK 0 -#define MODE_WRITE_DISK 1 -#define MODE_UNFORMAT_DISK 2 -#define MODE_WRITE_RAW 3 -#define MODE_TEST_ALIGNMENT 4 -#define MODE_SPEED_ADJUST 5 - -#define BYTETOBINARYPATTERN "%d%d%d%d%d%d%d%d" -#define BYTETOBINARY(byte) \ - (byte & 0x80 ? 1 : 0), \ - (byte & 0x40 ? 1 : 0), \ - (byte & 0x20 ? 1 : 0), \ - (byte & 0x10 ? 1 : 0), \ - (byte & 0x08 ? 1 : 0), \ - (byte & 0x04 ? 1 : 0), \ - (byte & 0x02 ? 1 : 0), \ - (byte & 0x01 ? 1 : 0) - - -#ifndef DJGPP -#include -#endif +#include "nibtools_version.h" +#include "nibtools_defs.h" /* global variables */ -extern char bitrate_range[4]; -extern char bitrate_value[4]; -extern char density_branch[4]; -extern char *cbm_adapter; -extern BYTE density_map; -extern BYTE skew_map[]; -extern BYTE fillbyte; -extern BYTE copyprot; -extern BYTE drive; -extern FILE * fplog; -extern float motor_speed; -extern size_t error_retries; -extern int skew; -extern int mode; -extern int read_killer; -extern int align_disk; -extern int force_density; -extern int track_match; -extern int interactive_mode; -extern int gap_match_length; -extern int cap_min_ignore; -extern int verbose; -extern int ihs; -extern int start_track, end_track, track_inc; -extern int fix_gcr, reduce_sync, increase_sync; -extern int imagetype, auto_capacity_adjust; -extern int extended_parallel_test; -extern int force_nosync; -extern int rawmode; -extern int rpm_real; -extern int unformat_passes; -extern int align_delay; -extern int presync; -extern int use_floppycode_srq; -extern int override_srq; -extern int extra_capacity_margin; -extern int sync_align_buffer; -extern int fattrack; -extern int old_g64; +#include "nibtools_global.h" + #include "ihs.h" @@ -125,25 +26,7 @@ int loadimage(char * filename); int writeimage(CBM_FILE fd); /* fileio.c */ -void parseargs(char *argv[]); -void switchusage(void); -int load_file(char *filename, BYTE *file_buffer); -int save_file(char *filename, BYTE *file_buffer, int length); -int read_nib(BYTE *file_buffer, int file_buffer_size, BYTE *track_buffer, BYTE *track_density, size_t *track_length); -int read_nb2(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); -int read_g64(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); -int read_d64(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); -int write_nib(BYTE*file_buffer, BYTE *track_buffer, BYTE *track_density, size_t *track_length); -int write_g64(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); -int write_d64(char *filename, BYTE *track_buffer, BYTE *track_density, size_t *track_length); -size_t compress_halftrack(int halftrack, BYTE *track_buffer, BYTE track_density, size_t track_length); -int align_tracks(BYTE *track_buffer, BYTE *track_density, size_t *track_length, BYTE *track_alignment); -int sync_tracks(BYTE *track_buffer, BYTE *track_density, size_t *track_length, BYTE *track_alignment); -int write_dword(FILE * fd, DWORD * buf, int num); -unsigned int crc_dir_track(BYTE *track_buffer, size_t *track_length); -unsigned int crc_all_tracks(BYTE *track_buffer, size_t *track_length); -unsigned int md5_dir_track(BYTE *track_buffer, size_t *track_length, unsigned char *result); -unsigned int md5_all_tracks(BYTE *track_buffer, size_t *track_length, unsigned char *result); +#include "fileio.h" /* read.c */ BYTE read_halftrack(CBM_FILE fd, int halftrack, BYTE * buffer); @@ -168,31 +51,4 @@ void speed_adjust(CBM_FILE fd); void kill_track(CBM_FILE fd, int track); /* drive.c */ -int compare_extension(unsigned char * filename, unsigned char * extension); -unsigned char burst_read(CBM_FILE f); -void burst_write(CBM_FILE f, unsigned char c); -int burst_read_n(CBM_FILE f, unsigned char *Buffer, unsigned int Length); -int burst_write_n(CBM_FILE f, unsigned char *Buffer, unsigned int Length); -int burst_read_track(CBM_FILE f, unsigned char *Buffer, unsigned int Length); -int burst_write_track(CBM_FILE f, unsigned char *Buffer, unsigned int Length); -void ARCH_SIGNALDECL handle_signals(int sig); -void ARCH_SIGNALDECL handle_exit(void); -int upload_code(CBM_FILE fd, BYTE drive); -int reset_floppy(CBM_FILE fd, BYTE drive); -int init_floppy(CBM_FILE fd, BYTE drive, int bump); -int set_density(CBM_FILE fd, BYTE density); -BYTE set_bitrate(CBM_FILE fd, BYTE density); -BYTE set_default_bitrate(CBM_FILE fd, int track); -BYTE scan_track(CBM_FILE fd, int track); -void perform_bump(CBM_FILE fd, BYTE drive); -int test_par_port(CBM_FILE fd); -void send_mnib_cmd(CBM_FILE fd, BYTE cmd, BYTE *args, int num_args); -void set_full_track(CBM_FILE fd); -void motor_on(CBM_FILE fd); -void motor_off(CBM_FILE fd); -void step_to_halftrack(CBM_FILE fd, int halftrack); -int verify_floppy(CBM_FILE fd); -#ifdef DJGPP -#include -int find_par_port(CBM_FILE fd); -#endif +#include "drive.h" diff --git a/nibtools_1571_srq.asm b/nibtools_1571_srq.asm old mode 100755 new mode 100644 diff --git a/nibtools_1571_srq_test.asm b/nibtools_1571_srq_test.asm old mode 100755 new mode 100644 diff --git a/nibtools_15x1_ihs.asm b/nibtools_15x1_ihs.asm old mode 100755 new mode 100644 diff --git a/nibtools_defs.h b/nibtools_defs.h new file mode 100644 index 0000000..860acf9 --- /dev/null +++ b/nibtools_defs.h @@ -0,0 +1,59 @@ + +#ifndef NIBTOOLS_DEFS_H +#define NIBTOOLS_DEFS_H + +#define FL_STEPTO 0x00 +#define FL_MOTOR 0x01 +#define FL_RESET 0x02 +#define FL_READWOSYNC 0x03 +#define FL_READNORMAL 0x04 +#define FL_READIHS 0x05 +#define FL_DENSITY 0x06 +#define FL_SCANKILLER 0x07 +#define FL_SCANDENSITY 0x08 +#define FL_READMOTOR 0x09 +#define FL_TEST 0x0a +#define FL_WRITE 0x0b +#define FL_CAPACITY 0x0c +#define FL_ALIGNDISK 0x0d +#define FL_VERIFY_CODE 0x0e +#define FL_FILLTRACK 0x0f +#define FL_READMARKER 0x10 + +#define DISK_NORMAL 0 + +#define IMAGE_NIB 0 /* destination image format */ +#define IMAGE_D64 1 +#define IMAGE_G64 2 +#define IMAGE_NB2 3 + +#define BM_MATCH 0x10 /* not used but exists in very old images */ +#define BM_NO_CYCLE 0x20 +#define BM_NO_SYNC 0x40 +#define BM_FF_TRACK 0x80 + +#define DENSITY_SAMPLES 2 + +/* custom density maps for reading */ +#define DENSITY_STANDARD 0 +#define DENSITY_RAPIDLOK 1 + +#define MODE_READ_DISK 0 +#define MODE_WRITE_DISK 1 +#define MODE_UNFORMAT_DISK 2 +#define MODE_WRITE_RAW 3 +#define MODE_TEST_ALIGNMENT 4 +#define MODE_SPEED_ADJUST 5 + +#define BYTETOBINARYPATTERN "%d%d%d%d%d%d%d%d" +#define BYTETOBINARY(byte) \ + (byte & 0x80 ? 1 : 0), \ + (byte & 0x40 ? 1 : 0), \ + (byte & 0x20 ? 1 : 0), \ + (byte & 0x10 ? 1 : 0), \ + (byte & 0x08 ? 1 : 0), \ + (byte & 0x04 ? 1 : 0), \ + (byte & 0x02 ? 1 : 0), \ + (byte & 0x01 ? 1 : 0) + +#endif diff --git a/nibtools_global.h b/nibtools_global.h new file mode 100644 index 0000000..51b935a --- /dev/null +++ b/nibtools_global.h @@ -0,0 +1,45 @@ + +#ifndef NIBTOOLS_GLOBAL_H +#define NIBTOOLS_GLOBAL_H + +extern char bitrate_range[4]; +extern char bitrate_value[4]; +extern char density_branch[4]; +extern char *cbm_adapter; +extern BYTE density_map; +extern BYTE skew_map[]; +extern BYTE fillbyte; +extern BYTE copyprot; +extern BYTE drive; +extern FILE * fplog; +extern float motor_speed; +extern size_t error_retries; +extern int skew; +extern int mode; +extern int read_killer; +extern int align_disk; +extern int force_density; +extern int track_match; +extern int interactive_mode; +extern int gap_match_length; +extern int cap_min_ignore; +extern int verbose; +extern int ihs; +extern int start_track, end_track, track_inc; +extern int fix_gcr, reduce_sync, increase_sync; +extern int imagetype, auto_capacity_adjust; +extern int extended_parallel_test; +extern int force_nosync; +extern int rawmode; +extern int rpm_real; +extern int unformat_passes; +extern int align_delay; +extern int presync; +extern int use_floppycode_srq; +extern int override_srq; +extern int extra_capacity_margin; +extern int sync_align_buffer; +extern int fattrack; +extern int old_g64; + +#endif diff --git a/nibtools_version.h b/nibtools_version.h new file mode 100644 index 0000000..459f29e --- /dev/null +++ b/nibtools_version.h @@ -0,0 +1,12 @@ + +#ifndef NIBTOOLS_VERSION_H +#define NIBTOOLS_VERSION_H + +#define VERSION "Built "__DATE__" "__TIME__ +#define AUTHOR "(C) Peter Rittwage and the rest of the C64 Preservation Project team\nhttp://c64preservation.com\n" + +#ifndef SVN +#define SVN 2014 +#endif + +#endif diff --git a/nibwrite.c b/nibwrite.c index da76abd..68cd98a 100644 --- a/nibwrite.c +++ b/nibwrite.c @@ -11,6 +11,10 @@ #include #include +#ifndef DJGPP +#include +#endif + #include "mnibarch.h" #include "gcr.h" #include "nibtools.h" @@ -34,10 +38,10 @@ int start_track, end_track, track_inc; int reduce_sync; int fix_gcr, aggressive_gcr; int align; -unsigned int lpt[4]; -int lpt_num; +extern unsigned int lpt[4]; +extern int lpt_num; int drivetype; -unsigned int floppybytes; +extern unsigned int floppybytes; int imagetype; int mode; int verify; diff --git a/read.c b/read.c index 7a6fd26..2470cbd 100644 --- a/read.c +++ b/read.c @@ -9,6 +9,10 @@ #include #include +#ifndef DJGPP +#include +#endif + #include "mnibarch.h" #include "gcr.h" #include "nibtools.h" diff --git a/readme.txt b/readme.txt old mode 100755 new mode 100644