From fea1a419503dbf1954ed8d5fd858d75b0912addf Mon Sep 17 00:00:00 2001 From: Steo Date: Wed, 13 May 2026 23:45:04 +0100 Subject: [PATCH 1/4] Fix oversight with loop mode setting It would disable both Loop N times and Duration options if the settings were never previously saved, or if a language change occured. --- FamiStudio/Source/App/Common/Dialogs/ExportDialog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FamiStudio/Source/App/Common/Dialogs/ExportDialog.cs b/FamiStudio/Source/App/Common/Dialogs/ExportDialog.cs index 2a115dbc8..21a34a7e6 100644 --- a/FamiStudio/Source/App/Common/Dialogs/ExportDialog.cs +++ b/FamiStudio/Source/App/Common/Dialogs/ExportDialog.cs @@ -450,7 +450,7 @@ private void CreatePropertyPage(PropertyPage page, ExportFormat format) }, GetDefaultChannelsGridData(false, false, app.SelectedSong, out _), 7, ChannelGridTooltip); // 11 page.AddButton(null, ResetDefaultsLabel.Format(FormatAudioMessage.ToString().ToLowerInvariant())); // 12 page.SetPropertyEnabled( 3, audioSettings.Format == "MP3" || audioSettings.Format == "Ogg Vorbis"); - page.SetPropertyEnabled( 5, audioSettings.LoopMode == LoopNTimesOption); + page.SetPropertyEnabled( 5, audioSettings.LoopMode != DurationOption); page.SetPropertyEnabled( 6, audioSettings.LoopMode == DurationOption); page.SetPropertyVisible( 8, Platform.IsDesktop); // No separate files on mobile. page.SetPropertyVisible( 9, Platform.IsDesktop); // No separate intro on mobile. From 8d48aa85c12670139a21cd45f09651c64bd1a889 Mon Sep 17 00:00:00 2001 From: Steo Date: Mon, 18 May 2026 10:31:28 +0100 Subject: [PATCH 2/4] Fix MakeNiceAsmName for leading whitespace --- FamiStudio/Source/Utils/Utils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FamiStudio/Source/Utils/Utils.cs b/FamiStudio/Source/Utils/Utils.cs index 3fe30a3f4..96392832b 100644 --- a/FamiStudio/Source/Utils/Utils.cs +++ b/FamiStudio/Source/Utils/Utils.cs @@ -335,7 +335,7 @@ public static string MakeNiceAsmName(string name, bool allowDash = true) { if (char.IsLetterOrDigit(c)) niceName += char.ToLower(c); - else if (char.IsWhiteSpace(c) && niceName.Last() != '_') + else if (char.IsWhiteSpace(c) && (string.IsNullOrEmpty(niceName) || niceName.Last() != '_')) niceName += '_'; else if (c == '-') niceName += allowDash ? '-' : '_'; From e09f19945373b721a4382b32aa1a92d0c836b02c Mon Sep 17 00:00:00 2001 From: Steo Date: Wed, 20 May 2026 17:51:59 +0100 Subject: [PATCH 3/4] Simpler fix for asm name --- FamiStudio/Source/Utils/Utils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FamiStudio/Source/Utils/Utils.cs b/FamiStudio/Source/Utils/Utils.cs index 96392832b..dbda9b64f 100644 --- a/FamiStudio/Source/Utils/Utils.cs +++ b/FamiStudio/Source/Utils/Utils.cs @@ -335,7 +335,7 @@ public static string MakeNiceAsmName(string name, bool allowDash = true) { if (char.IsLetterOrDigit(c)) niceName += char.ToLower(c); - else if (char.IsWhiteSpace(c) && (string.IsNullOrEmpty(niceName) || niceName.Last() != '_')) + else if (char.IsWhiteSpace(c) && niceName.LastOrDefault() != '_') niceName += '_'; else if (c == '-') niceName += allowDash ? '-' : '_'; From 01251fb6d44b557efda911e90dbafd66c9d1ddf0 Mon Sep 17 00:00:00 2001 From: Steo Date: Mon, 1 Jun 2026 21:37:37 +0100 Subject: [PATCH 4/4] Fix more broken FT stuff Truncate envelopes larger than 253. --- FamiStudio/Source/IO/FamitrackerTextFile.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/FamiStudio/Source/IO/FamitrackerTextFile.cs b/FamiStudio/Source/IO/FamitrackerTextFile.cs index bac2e7826..b2830d854 100644 --- a/FamiStudio/Source/IO/FamitrackerTextFile.cs +++ b/FamiStudio/Source/IO/FamitrackerTextFile.cs @@ -565,6 +565,12 @@ private void ConvertPitchEnvelopes(Project project) if (env == null || env.IsEmpty(i)) continue; + if (i != EnvelopeType.N163Waveform && i != EnvelopeType.FdsWaveform && env?.Length > 253) + { + Log.LogMessage(LogSeverity.Warning, $"Instrument '{instrument.Name}' {EnvelopeType.InternalNames[i].ToLowerInvariant()} envelope has {env.Length} values. FamiTracker only supports up to 253 values. Truncating."); + env.Length = 253; + } + uint crc = env.CRC; if (uniqueEnvelopes[instrument.IsExpansionInstrument ? 1 : 0, i].TryGetValue(crc, out var existingEnv))