Rename decode to mfmdecode now that I've found what might be an FM disk.

This commit is contained in:
David Given
2018-10-11 22:52:59 +02:00
parent 9dcfbc2ab1
commit 333fd989de
4 changed files with 10 additions and 13 deletions

View File

@@ -11,7 +11,7 @@ SRCS = \
cmd_usbbench.c \
cmd_read.c \
cmd_write.c \
cmd_decode.c \
cmd_mfmdecode.c \
cmd_testpattern.c \
cmd_fluxdump.c \

View File

@@ -28,6 +28,7 @@ static int inputlen;
static int cursor;
static int elapsed_ticks;
static int clock_period; /* mfm cell width */
static int period0; /* lower limit for a short transition */
static int period1; /* between short and medium transitions */
static int period2; /* between medium and long transitions */
@@ -48,7 +49,7 @@ static int nextlength = 0;
static void syntax_error(void)
{
fprintf(stderr,
"syntax: fluxclient decode <options>:\n"
"syntax: fluxclient mfmdecode <options>:\n"
" -i <filename> input filename (.flux)\n"
" -o <filename> output filename (.rec)\n"
" -v verbose decoding\n"
@@ -149,13 +150,13 @@ static void find_clock(void)
*/
uint32_t maxvalue = 0;
int maxindex = 0;
clock_period = 0;
for (int i=0; i<128; i++)
{
if (buckets[i] > maxvalue)
{
maxvalue = buckets[i];
maxindex = i;
clock_period = i;
}
}
@@ -167,7 +168,7 @@ static void find_clock(void)
* to assume that this was a 0 bit and set the phase, god help us.
*/
double short_time = maxindex;
double short_time = clock_period;
double medium_time = short_time * 1.5;
double long_time = short_time * 2.0;
@@ -178,10 +179,6 @@ static void find_clock(void)
phase = true;
phaselocked = true;
has_queued = false;
#if 0
printf("{%02x/%02x/%02x/%02x@%x}", period0, period1, period2, period3, cursor);
fflush(stdout);
#endif
return;
}
}
@@ -415,7 +412,7 @@ static void decode_track_cb(int track, int side, const struct fluxmap* fluxmap)
printf(" = %d records\n", record);
}
void cmd_decode(char* const* argv)
void cmd_mfmdecode(char* const* argv)
{
argv = parse_options(argv);
if (countargs(argv) != 1)

View File

@@ -61,7 +61,7 @@ extern void cmd_rpm(char* const* argv);
extern void cmd_usbbench(char* const* argv);
extern void cmd_read(char* const* argv);
extern void cmd_write(char* const* argv);
extern void cmd_decode(char* const* argv);
extern void cmd_mfmdecode(char* const* argv);
extern void cmd_testpattern(char* const* argv);
extern void cmd_fluxdump(char* const* argv);

4
main.c
View File

@@ -74,8 +74,8 @@ int main(int argc, char* const* argv)
cmd_read(argv);
else if (strcmp(argv[0], "write") == 0)
cmd_write(argv);
else if (strcmp(argv[0], "decode") == 0)
cmd_decode(argv);
else if (strcmp(argv[0], "mfmdecode") == 0)
cmd_mfmdecode(argv);
else if (strcmp(argv[0], "testpattern") == 0)
cmd_testpattern(argv);
else if (strcmp(argv[0], "fluxdump") == 0)