shithub: ft²

Download patch

ref: 992427b9edf98c2d0f8b92493e8456193668b74a
parent: 5dca43d1a307ba6d2288c4be9ff7d3f705aaabc4
author: Olav Sørensen <olav.sorensen@live.no>
date: Tue Jul 6 12:50:54 EDT 2021

Just some minor changes

--- a/src/ft2_replayer.c
+++ b/src/ft2_replayer.c
@@ -265,7 +265,7 @@
 	const uint32_t quotient = invPeriod / 768;
 	const uint32_t remainder = invPeriod % 768;
 
-	return dLogTab[remainder] * dExp2MulTab[(14-quotient) & 31]; // x = y / 2^((14-quotient) & 31)
+	return dLogTab[remainder] * dExp2MulTab[(14-quotient) & 31]; // x = y >> ((14-quotient) & 31);
 }
 
 double dAmigaPeriod2Hz(int32_t period)
@@ -400,7 +400,7 @@
 void calcReplayerLogTab(void)
 {
 	for (int32_t i = 0; i < 32; i++)
-		dExp2MulTab[i] = 1.0 / exp2(i); // 1/2^i
+		dExp2MulTab[i] = 1.0 / exp2(i); // 1/(2^i)
 
 	for (int32_t i = 0; i < 768; i++)
 		dLogTab[i] = 8363.0 * 256.0 * exp2(i / 768.0);
--- a/src/ft2_sample_loader.c
+++ b/src/ft2_sample_loader.c
@@ -38,9 +38,8 @@
 char *supportedSmpExtensions[] =
 {
 	"iff", "raw", "wav", "snd", "smp", "sam", "aif", "pat",
-	"aiff","flac",
+	"aiff","flac", // IMPORTANT: Remember comma after last entry!!!
 
-	// IMPORTANT: Remember comma after last entry above
 	"END_OF_LIST" // do NOT move, remove or edit this line!
 };
 
@@ -59,7 +58,7 @@
 // Crude sample detection routine. These aren't always accurate detections!
 static int8_t detectSample(FILE *f)
 {
-	uint8_t D[256];
+	uint8_t D[512];
 
 	uint32_t oldPos = ftell(f);
 	rewind(f);