From e63c445e316df590e449aaf8f23461ceabdff5b6 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 4 May 2013 14:37:10 +0200 Subject: [PATCH 1/1] Output a cycle plot, for debugging of errors. --- decode.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/decode.cpp b/decode.cpp index 798a872..8e0adaa 100644 --- a/decode.cpp +++ b/decode.cpp @@ -178,9 +178,11 @@ int main(int argc, char **argv) stddev); } + FILE *fp = fopen("cycles.plot", "w"); std::vector tap_data; for (unsigned i = 0; i < pulses.size(); ++i) { double cycles = pulses[i].len * calibration_factor * C64_FREQUENCY; + fprintf(fp, "%f %f\n", pulses[i].time, cycles); int len = lrintf(cycles / TAP_RESOLUTION); if (i > SYNC_PULSE_END && (cycles < 100 || cycles > 800)) { fprintf(stderr, "Cycle with upflank at %.6f was detected at %.0f cycles; misdetect?\n", @@ -196,6 +198,7 @@ int main(int argc, char **argv) tap_data.push_back(overflow_len >> 16); } } + fclose(fp); tap_header hdr; memcpy(hdr.identifier, "C64-TAPE-RAW", 12); -- 2.39.2