fixed bug with advancing tape counter if no input events have been recorded
authorHolger Schemel <info@artsoft.org>
Wed, 7 Dec 2022 18:40:30 +0000 (19:40 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 7 Dec 2022 18:40:30 +0000 (19:40 +0100)
src/tape.c

index fb00fcd561e7fdc220ff2ac5b14422dcaf3f707d..0a7dffc3db840681520a6c5fdb371cb155009772 100644 (file)
@@ -779,7 +779,9 @@ static void TapeAppendRecording(void)
 
 void TapeHaltRecording(void)
 {
-  tape.counter++;
+  // only advance tape counter if any input events have been recorded
+  if (tape.pos[tape.counter].delay > 0)
+    tape.counter++;
 
   // initialize delay for next tape entry (to be able to continue recording)
   if (tape.counter < MAX_TAPE_LEN)