shithub: pt2-clone

Download patch

ref: 1969e6763675792f743c5299de1d78bbe342da22
parent: e9b37b836ddad6c588fe2f3e5ec1423398e0397e
author: Olav Sørensen <olav.sorensen@live.no>
date: Wed Nov 18 09:40:37 EST 2020

Code cleanup and version change

--- a/src/pt2_header.h
+++ b/src/pt2_header.h
@@ -14,7 +14,7 @@
 #include "pt2_unicode.h"
 #include "pt2_palette.h"
 
-#define PROG_VER_STR "1.24"
+#define PROG_VER_STR "1.25"
 
 #ifdef _WIN32
 #define DIR_DELIMITER '\\'
--- a/src/pt2_replayer.c
+++ b/src/pt2_replayer.c
@@ -79,10 +79,9 @@
 
 	if (song != NULL)
 	{
-		for (int32_t i = 0; i < AMIGA_VOICES; i++)
+		moduleChannel_t *c = song->channels;
+		for (int32_t i = 0; i < AMIGA_VOICES; i++, c++)
 		{
-			moduleChannel_t *c = &song->channels[i];
-
 			c->n_wavecontrol = 0;
 			c->n_glissfunk = 0;
 			c->n_finetune = 0;
@@ -348,11 +347,13 @@
 	}
 	else
 	{
+		// F00 - stop song
+
 		editor.songPlaying = false;
 		editor.playMode = PLAY_MODE_NORMAL;
 		editor.currMode = MODE_IDLE;
 
-		pointerResetThreadSafe(); // set gray mouse cursor
+		pointerResetThreadSafe(); // set normal gray mouse pointer
 	}
 }
 
@@ -1024,10 +1025,9 @@
 
 		if (pattDelTime2 == 0)
 		{
-			for (i = 0; i < AMIGA_VOICES; i++)
+			c = song->channels;
+			for (i = 0; i < AMIGA_VOICES; i++, c++)
 			{
-				c = &song->channels[i];
-
 				playVoice(c);
 				paulaSetVolume(i, c->n_volume);
 
@@ -1038,8 +1038,9 @@
 		}
 		else
 		{
-			for (i = 0; i < AMIGA_VOICES; i++)
-				checkEffects(&song->channels[i]);
+			c = song->channels;
+			for (i = 0; i < AMIGA_VOICES; i++, c++)
+				checkEffects(c);
 		}
 
 		if (!editor.isWAVRendering && !editor.isSMPRendering)
@@ -1103,8 +1104,9 @@
 	}
 	else
 	{
-		for (i = 0; i < AMIGA_VOICES; i++)
-			checkEffects(&song->channels[i]);
+		c = song->channels;
+		for (i = 0; i < AMIGA_VOICES; i++, c++)
+			checkEffects(c);
 
 		if (posJumpAssert)
 			nextPosition();
@@ -1185,7 +1187,7 @@
 	const bool audioWasntLocked = !audio.locked;
 	if (doLockAudio && audioWasntLocked)
 		lockAudio();
-
+	
 	modBPM = bpm;
 	if (!editor.isSMPRendering && !editor.isWAVRendering)
 	{