Move printing into IRDKit

This commit is contained in:
Deterous
2023-11-16 11:58:27 +13:00
parent e665391e47
commit f86a89c04a
7 changed files with 40 additions and 65 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<PackAsTool>true</PackAsTool>
<ToolCommandName>irdkit</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<Version>0.1.0</Version>
+34 -3
View File
@@ -33,10 +33,11 @@ namespace IRDKit
}
// IRD Info
[Verb("info")]
public class InfoOptions
{
[Value(0, Required = true, HelpText = "Path to the IRD file to be printed")]
public string IRDPath { get; set; }
[Value(0, Required = true, HelpText = "Path to the IRD or ISO file to be printed")]
public string Path { get; set; }
}
public static void Main(string[] args)
@@ -105,7 +106,37 @@ namespace IRDKit
}
break;
case InfoOptions info:
//
bool isISO = false;
if (isISO)
{
string filename = "./PS3_DISC.SFB";
if (File.Exists(filename))
{
PS3_DiscSFB ps3_DiscSFB = new(filename);
Console.WriteLine("PS3_DISC.SFB for: " + ps3_DiscSFB.Field["TITLE_ID"]);
ps3_DiscSFB.Print();
}
else
{
Console.WriteLine(filename + " not found");
}
filename = "./PARAM.SFO";
if (File.Exists(filename))
{
ParamSFO paramSFO = new(filename);
Console.WriteLine("PARAM.SFO for: " + paramSFO["TITLE_ID"]);
paramSFO.Print();
}
else
{
Console.WriteLine(filename + " not found");
}
}
else
{
IRD.Read(info.Path).Print();
}
break;
}
}
+1 -7
View File
@@ -5,9 +5,7 @@ VisualStudioVersion = 17.7.34202.233
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibIRD", "LibIRD\LibIRD.csproj", "{4A80C34B-D4C5-4536-BEAE-46218BC09980}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrintParams", "PrintParams\PrintParams.csproj", "{B5D9C0AD-EA8D-486E-A1D7-ED2C3C7163BC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IRDKit", "IRDKit\IRDKit.csproj", "{9060E3AF-E4FB-436F-93A1-5C47389CB88E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRDKit", "IRDKit\IRDKit.csproj", "{9060E3AF-E4FB-436F-93A1-5C47389CB88E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -19,10 +17,6 @@ Global
{4A80C34B-D4C5-4536-BEAE-46218BC09980}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A80C34B-D4C5-4536-BEAE-46218BC09980}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A80C34B-D4C5-4536-BEAE-46218BC09980}.Release|Any CPU.Build.0 = Release|Any CPU
{B5D9C0AD-EA8D-486E-A1D7-ED2C3C7163BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5D9C0AD-EA8D-486E-A1D7-ED2C3C7163BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5D9C0AD-EA8D-486E-A1D7-ED2C3C7163BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5D9C0AD-EA8D-486E-A1D7-ED2C3C7163BC}.Release|Any CPU.Build.0 = Release|Any CPU
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9060E3AF-E4FB-436F-93A1-5C47389CB88E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+2 -2
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<!-- Assembly Properties -->
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<Version>0.1.0</Version>
@@ -25,7 +25,7 @@
<PackageReference Include="DiscUtils.Core" Version="0.16.13" />
<PackageReference Include="DiscUtils.Iso9660" Version="0.16.13" />
<PackageReference Include="DiscUtils.Streams" Version="0.16.13" />
<PackageReference Include="System.IO.Hashing" Version="7.0.0" />
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
</ItemGroup>
</Project>
-36
View File
@@ -1,36 +0,0 @@
using LibIRD;
using System;
using System.IO;
namespace PrintParams
{
internal class Program
{
static void Main()
{
string filename = "./PS3_DISC.SFB";
if (File.Exists(filename))
{
PS3_DiscSFB ps3_DiscSFB = new(filename);
Console.WriteLine("PS3_DISC.SFB for: " + ps3_DiscSFB.Field["TITLE_ID"]);
ps3_DiscSFB.Print();
}
else
{
Console.WriteLine(filename + " not found");
}
filename = "./PARAM.SFO";
if (File.Exists(filename))
{
ParamSFO paramSFO = new(filename);
Console.WriteLine("PARAM.SFO for: " + paramSFO["TITLE_ID"]);
paramSFO.Print();
}
else
{
Console.WriteLine(filename + " not found");
}
}
}
}
-14
View File
@@ -1,14 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win-x86;win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Version>0.1</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LibIRD\LibIRD.csproj" />
</ItemGroup>
</Project>
+2 -2
View File
@@ -12,8 +12,8 @@ IRDKit is a tool that allows direct use of LibIRD functionality from the command
```
irdkit create game.iso
```
For detailed usage, read more [here](IRDKit/README.MD).
For detailed usage, read more [here](IRDKit).
## Using the LibIRD library
LibIRD was originally made for creating reproducible, redump-style IRDs when dumping PS3 discs with [MPF](https://github.com/SabreTools/MPF). If you wish to integrate LibIRD into your own application, read the examples [here](LibIRD/README.MD).
LibIRD was originally made for creating reproducible, redump-style IRDs when dumping PS3 discs with [MPF](https://github.com/SabreTools/MPF). If you wish to integrate LibIRD into your own application, read the examples [here](LibIRD).