shithub: ft²

Download patch

ref: ba7827f46f5471a47556e74cc4cf7ddfce111041
parent: c15838c29b81566b58021880e552b8788280e40b
author: Olav Sørensen <olav.sorensen@live.no>
date: Mon Oct 30 09:44:41 EDT 2023

Rename table for less confusion

--- a/src/ft2_module_saver.c
+++ b/src/ft2_module_saver.c
@@ -549,8 +549,8 @@
 					}
 					else
 					{
-						modPattData[offs+0] = (inst & 0xF0) | ((amigaPeriod[note-1] >> 8) & 0x0F);
-						modPattData[offs+1] = amigaPeriod[note-1] & 0xFF;
+						modPattData[offs+0] = (inst & 0xF0) | ((modPeriods[note-1] >> 8) & 0x0F);
+						modPattData[offs+1] = modPeriods[note-1] & 0xFF;
 					}
 
 					// FT2 bugfix: if effect is overflowing (0xF in .MOD), set effect and param to 0
--- a/src/ft2_tables.c
+++ b/src/ft2_tables.c
@@ -67,7 +67,7 @@
 	255,253,250,244,235,224,212,197,180,161,141,120, 97, 74, 49, 24
 };
 
-const uint16_t amigaPeriod[8 * 12] = // used for .MOD loading/saving
+const uint16_t modPeriods[8 * 12] = // used for .MOD loading/saving
 {
 	6848, 6464, 6096, 5760, 5424, 5120, 4832, 4560, 4304, 4064, 3840, 3624,
 	3424, 3232, 3048, 2880, 2712, 2560, 2416, 2280, 2152, 2032, 1920, 1812,
--- a/src/ft2_tables.h
+++ b/src/ft2_tables.h
@@ -15,7 +15,7 @@
 extern const uint8_t arpTab[256];
 extern const int8_t autoVibSineTab[256];
 extern const uint8_t vibTab[32];
-extern const uint16_t amigaPeriod[8 * 12];
+extern const uint16_t modPeriods[8 * 12];
 extern const uint16_t linearPeriods[1936];
 extern const uint16_t amigaPeriods[1936];
 
--- a/src/modloaders/ft2_load_mod.c
+++ b/src/modloaders/ft2_load_mod.c
@@ -123,7 +123,7 @@
 					uint16_t period = ((bytes[0] & 0x0F) << 8) | bytes[1];
 					for (i = 0; i < 8*12; i++)
 					{
-						if (period >= amigaPeriod[i])
+						if (period >= modPeriods[i])
 						{
 							p->note = (uint8_t)i + 1;
 							break;
@@ -181,7 +181,7 @@
 					uint16_t period = ((bytes[0] & 0x0F) << 8) | bytes[1];
 					for (i = 0; i < 8*12; i++)
 					{
-						if (period >= amigaPeriod[i])
+						if (period >= modPeriods[i])
 						{
 							p->note = (uint8_t)i + 1;
 							break;