shithub: ft2-clone

Download patch

ref: 252fc5e9896155c03e4e8642092589c9b7e4fec3
parent: fdfa2bc1a33b0e566fb6c2d6762475c67b7582bd
author: Olav Sørensen <olav.sorensen@live.no>
date: Thu Apr 1 07:26:53 EDT 2021

Added some comments

--- a/src/ft2_replayer.c
+++ b/src/ft2_replayer.c
@@ -528,8 +528,8 @@
 
 	if (ton != 0)
 	{
-		const uint16_t tmpTon = ((ton-1) << 4) + (((int8_t)ch->fineTune >> 3) + 16);
-		if (tmpTon < MAX_NOTES)
+		const uint16_t tmpTon = ((ton-1) << 4) + (((int8_t)ch->fineTune >> 3) + 16); // 0..1935
+		if (tmpTon < MAX_NOTES) // tmpTon is *always* below MAX_NOTES here, so this check is not really needed
 		{
 			assert(note2Period != NULL);
 			ch->outPeriod = ch->realPeriod = note2Period[tmpTon];