From: Steinar H. Gunderson Date: Sat, 4 May 2013 12:37:10 +0000 (+0200) Subject: Output a cycle plot, for debugging of errors. X-Git-Url: https://git.sesse.net/?p=c64tapwav;a=commitdiff_plain;h=e63c445e316df590e449aaf8f23461ceabdff5b6;hp=44fbaa041af0b1d9306d8ec0d6ad2e137f50f464;ds=sidebyside Output a cycle plot, for debugging of errors. --- 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);