From a2983692930564815a77f81e74c151268f5b935f Mon Sep 17 00:00:00 2001 From: ParantezTech <12572227+par274@users.noreply.github.com> Date: Sat, 10 Oct 2026 16:40:10 +0300 Subject: [PATCH] [Demo] remove bg music from bundled demo --- src/SharpEmu.CLI/SharpEmu.CLI.csproj | 6 +++- src/SharpEmu.GUI/BundledDemo.cs | 1 - .../GUI/BundledDemoTests.cs | 35 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 tests/SharpEmu.Libs.Tests/GUI/BundledDemoTests.cs diff --git a/src/SharpEmu.CLI/SharpEmu.CLI.csproj b/src/SharpEmu.CLI/SharpEmu.CLI.csproj index dfe7ddc..46fd61a 100644 --- a/src/SharpEmu.CLI/SharpEmu.CLI.csproj +++ b/src/SharpEmu.CLI/SharpEmu.CLI.csproj @@ -181,7 +181,7 @@ SPDX-License-Identifier: GPL-2.0-or-later - e3a6dd3 + 49e6b3b demo $(BaseIntermediateOutputPath)sharpemu-demo/$(SharpEmuDemoTag) $(SharpEmuDemoCacheDir)/sharpemu-demo.zip @@ -207,6 +207,8 @@ SPDX-License-Identifier: GPL-2.0-or-later DestinationFolder="$(SharpEmuDemoDir)" Condition="'$(SharpEmuDemoTag)' != '' And '$(_SharpEmuDemoCurrent)' != 'true' And Exists('$(SharpEmuDemoArchive)')" ContinueOnError="WarnAndContinue" /> + + true @@ -231,6 +233,7 @@ SPDX-License-Identifier: GPL-2.0-or-later SourceFiles="@(_SharpEmuDemoFiles)" DestinationFiles="@(_SharpEmuDemoFiles->'$(OutDir)$(SharpEmuDemoFolderName)/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> + @@ -245,6 +248,7 @@ SPDX-License-Identifier: GPL-2.0-or-later SourceFiles="@(_SharpEmuDemoFiles)" DestinationFiles="@(_SharpEmuDemoFiles->'$(PublishDir)$(SharpEmuDemoFolderName)/%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /> + diff --git a/src/SharpEmu.GUI/BundledDemo.cs b/src/SharpEmu.GUI/BundledDemo.cs index 31a8c5c..854010e 100644 --- a/src/SharpEmu.GUI/BundledDemo.cs +++ b/src/SharpEmu.GUI/BundledDemo.cs @@ -15,7 +15,6 @@ internal static class BundledDemo Path.Combine("sce_sys", "param.json"), Path.Combine("sce_sys", "icon0.png"), Path.Combine("sce_sys", "pic0.png"), - Path.Combine("sce_sys", "snd0.at9"), ]; internal static string? FindEboot(string baseDirectory) diff --git a/tests/SharpEmu.Libs.Tests/GUI/BundledDemoTests.cs b/tests/SharpEmu.Libs.Tests/GUI/BundledDemoTests.cs new file mode 100644 index 0000000..f740a4b --- /dev/null +++ b/tests/SharpEmu.Libs.Tests/GUI/BundledDemoTests.cs @@ -0,0 +1,35 @@ +// Copyright (C) 2026 SharpEmu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +using SharpEmu.GUI; +using Xunit; + +namespace SharpEmu.Libs.Tests.GUI; + +public sealed class BundledDemoTests +{ + [Fact] + public void FindEbootRequiresDemoAssetsButNotPreviewMusic() + { + var directory = Directory.CreateTempSubdirectory("bundled-demo-test-"); + try + { + var root = Path.Combine(directory.FullName, BundledDemo.FolderName); + var assets = Directory.CreateDirectory(Path.Combine(root, "sce_sys")).FullName; + var eboot = Path.Combine(root, "eboot.bin"); + File.WriteAllBytes(eboot, []); + foreach (var name in new[] { "param.json", "icon0.png", "pic0.png" }) + { + File.WriteAllBytes(Path.Combine(assets, name), []); + } + + Assert.Equal(eboot, BundledDemo.FindEboot(directory.FullName)); + File.Delete(Path.Combine(assets, "param.json")); + Assert.Null(BundledDemo.FindEboot(directory.FullName)); + } + finally + { + directory.Delete(recursive: true); + } + } +}