shithub: ft²

Download patch

ref: 848dff35011e5701b445a0ba0b0ce2b5e495e096
parent: 6de936ef684960570b2cde4805753103114ee3fd
author: Olav Sørensen <olav.sorensen@live.no>
date: Wed May 25 08:18:09 EDT 2022

Clear pattern loop (E6x) counters on playback

--- a/src/ft2_header.h
+++ b/src/ft2_header.h
@@ -12,7 +12,7 @@
 #endif
 #include "ft2_replayer.h"
 
-#define PROG_VER_STR "1.54"
+#define PROG_VER_STR "1.55"
 
 // do NOT change these! It will only mess things up...
 
--- a/src/ft2_replayer.c
+++ b/src/ft2_replayer.c
@@ -3127,11 +3127,20 @@
 	song.pBreakPos = 0;
 	song.pBreakFlag = false;
 
+	// reset pattern loops (E6x)
+	channel_t *ch = channel;
+	for (int32_t i = 0; i < song.numChannels; i++, ch++)
+	{
+		ch->jumpToRow = 0;
+		ch->patLoopCounter = 0;
+	}
+	
+	// reset global volume (if song was playing)
 	if (songPlaying)
 	{
 		song.globalVolume = 64;
 
-		channel_t *ch = channel;
+		ch = channel;
 		for (int32_t i = 0; i < song.numChannels; i++, ch++)
 			ch->status |= IS_Vol;
 	}