From 96d45b1320357c5d4b8fe0bcc9c22d6a5f8f8ff9 Mon Sep 17 00:00:00 2001 From: Markus Steinborn Date: Sun, 27 Sep 2020 21:47:17 +0200 Subject: [PATCH] Fix for double sided disks --- p64conv.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/p64conv.cpp b/p64conv.cpp index 5fb55d1..c62cb27 100644 --- a/p64conv.cpp +++ b/p64conv.cpp @@ -46,17 +46,19 @@ int txt2p64(string infile, string outfile) if (position == 0) position = 1; - P64PulseStreamAddPulse(&P64Image.PulseStreams[side][track], position, 0xffffffff); +// printf( "Add pulse %i.%i\n", track, side); +// P64PulseStreamAddPulse(&P64Image.PulseStreams[side][track], position, 0xffffffff); } else if (RE2::FullMatch(line, trackPattern, &number)) { - track = int(2 * number + 0.1); + side = 0; - if (track > 128) + if (number > 128) { side = 1; - track -= 128; + number -= 128; } + track = int(2 * number + 0.1); } else if (RE2::FullMatch(line, writeProtectPattern, &tmpInt)) { @@ -136,7 +138,6 @@ int p642txt(string infile, string outfile) { TP64PulseStream & instance = P64Image.PulseStreams[side][track]; int current = instance.UsedFirst; - if (current >= 0) { sprintf(buffer2, "track %i%s\n", track / 2 + 128*side, track & 1 ? ".5" : "");