mirror of
https://github.com/datajerk/c2d.git
synced 2025-01-15 14:31:38 +00:00
minor cleanup
This commit is contained in:
parent
da5d869e01
commit
ec117e4d9e
@ -87,7 +87,7 @@ Examples:
|
|||||||
|
|
||||||
### The Ugly Stuff
|
### The Ugly Stuff
|
||||||
|
|
||||||
c2d, Code to Disk, Version 0.3, Sat Apr 1 19:57:16 MDT 2017
|
c2d, Code to Disk, Version 0.31, Sun Apr 2 16:33:28 UTC 2017
|
||||||
|
|
||||||
(c) 2012,2017 All Rights Reserved, Egan Ford (egan@sense.net)
|
(c) 2012,2017 All Rights Reserved, Egan Ford (egan@sense.net)
|
||||||
|
|
||||||
|
BIN
bin/c2d.exe
BIN
bin/c2d.exe
Binary file not shown.
12
c2d.c
12
c2d.c
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
c2d, Code to Disk, Version 0.3, Sat Apr 1 19:57:16 MDT 2017
|
c2d, Code to Disk, Version 0.31, Sun Apr 2 16:33:28 UTC 2017
|
||||||
|
|
||||||
(c) 2012,2017 All Rights Reserved, Egan Ford (egan@sense.net)
|
(c) 2012,2017 All Rights Reserved, Egan Ford (egan@sense.net)
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ Bugs:
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "c2d.h"
|
#include "c2d.h"
|
||||||
|
|
||||||
#define VERSION "Version 0.3"
|
#define VERSION "Version 0.31"
|
||||||
#define INFILE argv[argc-2]
|
#define INFILE argv[argc-2]
|
||||||
#define OUTFILE argv[argc-1]
|
#define OUTFILE argv[argc-1]
|
||||||
#define BINARY 0
|
#define BINARY 0
|
||||||
@ -81,7 +81,8 @@ int main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
case 's': // override rate for -1/-2 only
|
case 's': // override rate for -1/-2 only
|
||||||
start_override = (int)strtol(optarg, (char **)NULL, 16);
|
warm = 0;
|
||||||
|
start_override = (int)strtol(optarg, (char **)NULL, 16); // todo: input check
|
||||||
break;
|
break;
|
||||||
case 'h': // help
|
case 'h': // help
|
||||||
case '?':
|
case '?':
|
||||||
@ -113,7 +114,7 @@ int main(int argc, char **argv)
|
|||||||
if(k == 0)
|
if(k == 0)
|
||||||
start = -1;
|
start = -1;
|
||||||
else
|
else
|
||||||
start = (int)strtol(load_address, (char **)NULL, 16);
|
start = (int)strtol(load_address, (char **)NULL, 16); // todo: input check
|
||||||
|
|
||||||
if((ext = getext(filename)) != NULL)
|
if((ext = getext(filename)) != NULL)
|
||||||
if(strcmp(ext,"mon") == 0 || strcmp(ext,"MON") == 0)
|
if(strcmp(ext,"mon") == 0 || strcmp(ext,"MON") == 0)
|
||||||
@ -147,6 +148,7 @@ int main(int argc, char **argv)
|
|||||||
fread(&blank.track[1].sector[0].byte[start & 0xFF], filesize, 1, ifp);
|
fread(&blank.track[1].sector[0].byte[start & 0xFF], filesize, 1, ifp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo: lots of input checking
|
||||||
if(inputtype == MONITOR) {
|
if(inputtype == MONITOR) {
|
||||||
int byte, naddr;
|
int byte, naddr;
|
||||||
char addrs[8], s;
|
char addrs[8], s;
|
||||||
@ -183,7 +185,7 @@ int main(int argc, char **argv)
|
|||||||
blank.track[0].sector[1].byte[0x1A] = ceil((filesize + (start & 0xFF))/ 256.0) - 16*(ceil((filesize + (start & 0xFF)) / 4096.0) - 1) - 1;
|
blank.track[0].sector[1].byte[0x1A] = ceil((filesize + (start & 0xFF))/ 256.0) - 16*(ceil((filesize + (start & 0xFF)) / 4096.0) - 1) - 1;
|
||||||
|
|
||||||
fprintf(stderr,"Number of sectors: %d\n",(int)ceil((filesize + (start & 0xFF)) / 256.0));
|
fprintf(stderr,"Number of sectors: %d\n",(int)ceil((filesize + (start & 0xFF)) / 256.0));
|
||||||
fprintf(stderr,"Sector page range: $%02X - $%02X\n",start >> 8,(start + filesize - 1) >> 8);
|
fprintf(stderr,"Memory page range: $%02X - $%02X\n",start >> 8,(start + filesize - 1) >> 8);
|
||||||
|
|
||||||
if(warm)
|
if(warm)
|
||||||
start = 0xFF69;
|
start = 0xFF69;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user