Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PhoenixICE committed Mar 9, 2021
1 parent e52b9e4 commit 022dc3f
Show file tree
Hide file tree
Showing 30 changed files with 11,773 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Chunithm.Tools.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31019.194
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chunithm.Tools", "Chunithm.Tools\Chunithm.Tools.csproj", "{54A6574F-471B-4057-A622-7D4FC1895636}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{54A6574F-471B-4057-A622-7D4FC1895636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54A6574F-471B-4057-A622-7D4FC1895636}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54A6574F-471B-4057-A622-7D4FC1895636}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54A6574F-471B-4057-A622-7D4FC1895636}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B9836AAC-8B50-4798-8315-FCBEE4DB33F0}
EndGlobalSection
EndGlobal
14 changes: 14 additions & 0 deletions Chunithm.Tools/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
148 changes: 148 additions & 0 deletions Chunithm.Tools/Chunithm.Tools.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\ILMerge.3.0.41\build\ILMerge.props" Condition="Exists('..\packages\ILMerge.3.0.41\build\ILMerge.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{54A6574F-471B-4057-A622-7D4FC1895636}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Chunithm.Tools</RootNamespace>
<AssemblyName>Chunithm.Tools</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.5.0.0\lib\net461\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.5.0.1\lib\net461\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Chunithm\Tools\ChunAppPatchStatusType.cs" />
<Compile Include="Chunithm\Tools\ChuniAppPatch.cs" />
<Compile Include="Chunithm\Tools\ChuniAppPatchType.cs" />
<Compile Include="Chunithm\Tools\ChunithmFile.cs" />
<Compile Include="Chunithm\Tools\ChunithmFolder.cs" />
<Compile Include="Chunithm\Tools\Validator\MusicDuplicatorValidator.cs" />
<Compile Include="Chunithm\Tools\Validator\MusicSortValidator.cs" />
<Compile Include="Chunithm\Tools\Validator\CueMusicFolderValidator.cs" />
<Compile Include="Chunithm\Tools\FileType.cs" />
<Compile Include="Chunithm\Tools\FolderType.cs" />
<Compile Include="Chunithm\Tools\Interface\IFolderValidator.cs" />
<Compile Include="Chunithm\Tools\Validator\MusicSortXML\MusicSort.cs" />
<Compile Include="Chunithm\Tools\Option.cs" />
<Compile Include="Chunithm\Tools\OptionSubFolder.cs" />
<Compile Include="Chunithm\Tools\OptionSubFolderType.cs" />
<Compile Include="Chunithm\Tools\PreProcessing.cs" />
<Compile Include="Chunithm\Tools\Settings.cs" />
<Compile Include="Chunithm\Tools\Validator\MusicXML\music.cs" />
<Compile Include="InteractiveConsole.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UnlockerMenu.cs" />
<Compile Include="Utility\AsciiTableGenerator.cs" />
<Compile Include="Utility\ConsoleMenu.cs" />
<Compile Include="ValidatorMenu.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="masterlist.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\ILMerge.3.0.41\build\ILMerge.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILMerge.3.0.41\build\ILMerge.props'))" />
<Error Condition="!Exists('..\packages\ILMerge.MSBuild.Task.1.0.7\build\ILMerge.MSBuild.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ILMerge.MSBuild.Task.1.0.7\build\ILMerge.MSBuild.Task.targets'))" />
</Target>
<Import Project="..\packages\ILMerge.MSBuild.Task.1.0.7\build\ILMerge.MSBuild.Task.targets" Condition="Exists('..\packages\ILMerge.MSBuild.Task.1.0.7\build\ILMerge.MSBuild.Task.targets')" />
</Project>
9 changes: 9 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/ChunAppPatchStatusType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Chunithm.Tools
{
public enum ChunAppPatchStatusType
{
Unknown = 0,
On = 1,
Off = 2
}
}
57 changes: 57 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/ChuniAppPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Chunithm.Tools
{
public struct ChuniAppPatch
{
public ChuniAppPatch(ChuniAppPatchType chuniAppPatchType, int offset, byte[] off, byte[] on)
{
ChuniAppPatchType = chuniAppPatchType;
Offset = offset;
On = on;
Off = off;
}

public ChuniAppPatchType ChuniAppPatchType { get; set; }

[JsonConverter(typeof(IntToHexConverter))]
public int Offset { get; set; }
[JsonConverter(typeof(ByteArrayToHexArrayConverter))]
public byte[] On { get; set; }
[JsonConverter(typeof(ByteArrayToHexArrayConverter))]
public byte[] Off { get; set; }
}

public class IntToHexConverter : JsonConverter<int>
{
public override int Read(
ref Utf8JsonReader reader,
Type typeToConvert,
JsonSerializerOptions options) =>
int.Parse(reader.GetString().Remove(0, 2), System.Globalization.NumberStyles.HexNumber);

public override void Write(
Utf8JsonWriter writer,
int intValue,
JsonSerializerOptions options) =>
writer.WriteStringValue("0x" + intValue.ToString("X"));
}

public class ByteArrayToHexArrayConverter : JsonConverter<byte[]>
{
public override byte[] Read(
ref Utf8JsonReader reader,
Type typeToConvert,
JsonSerializerOptions options) =>
reader.GetString().Split(',').Select(x => byte.Parse(x.Remove(0, 2), System.Globalization.NumberStyles.HexNumber)).ToArray();

public override void Write(
Utf8JsonWriter writer,
byte[] byteArrayValue,
JsonSerializerOptions options) =>
writer.WriteStringValue(string.Join(",", byteArrayValue.Select(x => "0x" + x.ToString("X"))));
}
}
21 changes: 21 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/ChuniAppPatchType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Chunithm.Tools
{
public enum ChuniAppPatchType
{
None = 0,
AllowLocalHost = 1,
DisableShopCloseLockout = 2,
ForceSharedAudioMode = 3,
Force2ChannelAudioOutput = 4,
DisableSongSelectTimer = 5,
SetAllTimersTo999 = 6,
PatchForHeadToHeadPlayer = 7,
AutoPlay = 8,
PatchForWindows7 = 9,
IncreaseMaxCreditsTo254 = 10,
FreePlay = 11,
DummyLED = 12,
NoEncryption = 13,
NOTLS = 14
}
}
20 changes: 20 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/ChunithmFile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Chunithm.Tools
{
public struct ChunithmFile
{
public ChunithmFile(string name, FileType file, FolderType parentFolder, string[] potentialPaths, bool mandatory = true)
{
Name = name;
File = file;
PotentialPaths = potentialPaths;
ParentFolder = parentFolder;
Mandatory = mandatory;
}

public FolderType ParentFolder { get; set; }
public string Name { get; set; }
public string[] PotentialPaths { get; set; }
public FileType File { get; set; }
public bool Mandatory { get; set; }
}
}
18 changes: 18 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/ChunithmFolder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Chunithm.Tools
{
public struct ChunithmFolder
{
public ChunithmFolder(string name, FolderType? parentFolder, string[] potentialPaths, bool mandatory = true)
{
Name = name;
ParentFolder = parentFolder;
PotentialPaths = potentialPaths;
Mandatory = mandatory;
}

public string Name { get; set; }
public string[] PotentialPaths { get; set; }
public FolderType? ParentFolder { get; set; }
public bool Mandatory { get; set; }
}
}
9 changes: 9 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/FileType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Chunithm.Tools
{
public enum FileType
{
None = 0,
ChuniApp = 1,
SegaToolsIni = 2
}
}
12 changes: 12 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/FolderType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Chunithm.Tools
{
public enum FolderType
{
None = 0,
Options = 1,
Bin = 2,
Data = 3,
A000 = 4,
App = 5
}
}
9 changes: 9 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/Interface/IFolderValidator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Collections.Generic;

namespace Chunithm.Tools.Interface
{
public interface IFolderValidator
{
IEnumerable<string> ValidateFolder(IEnumerable<OptionSubFolder> optionSubFolders);
}
}
12 changes: 12 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/Option.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;
using System.IO;

namespace Chunithm.Tools
{
// A000, A001 etc..
public class Option
{
public DirectoryInfo DirectoryInfo { get; set; }
public Dictionary<OptionSubFolderType, List<OptionSubFolder>> OptionSubFolders { get; set; }
}
}
17 changes: 17 additions & 0 deletions Chunithm.Tools/Chunithm/Tools/OptionSubFolder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.IO;

namespace Chunithm.Tools
{
// chara, course etc..
public class OptionSubFolder
{
public DirectoryInfo DirectoryInfo { get; set; }
public OptionSubFolderType OptionType { get; set; }
public FileInfo XMLFile { get; set; }
public string Contents { get; set; }
public Dictionary<string, bool> XMLTags { get; set; } = new Dictionary<string, bool>();
public bool IsDuplicate { get; set; }
public DirectoryInfo ParentDirectory { get; set; }
}
}
Loading

0 comments on commit 022dc3f

Please sign in to comment.