From f86a89c04afa7e7663d5cb571efbf83466b67132 Mon Sep 17 00:00:00 2001
From: Deterous <138427222+Deterous@users.noreply.github.com>
Date: Thu, 16 Nov 2023 11:58:27 +1300
Subject: [PATCH] Move printing into IRDKit
---
IRDKit/IRDKit.csproj | 2 +-
IRDKit/Program.cs | 37 +++++++++++++++++++++++++++++++---
LibIRD.sln | 8 +-------
LibIRD/LibIRD.csproj | 4 ++--
PrintParams/PrintParams.cs | 36 ---------------------------------
PrintParams/PrintParams.csproj | 14 -------------
README.md | 4 ++--
7 files changed, 40 insertions(+), 65 deletions(-)
delete mode 100644 PrintParams/PrintParams.cs
delete mode 100644 PrintParams/PrintParams.csproj
diff --git a/IRDKit/IRDKit.csproj b/IRDKit/IRDKit.csproj
index 3a792eb..caff1f8 100644
--- a/IRDKit/IRDKit.csproj
+++ b/IRDKit/IRDKit.csproj
@@ -6,7 +6,7 @@
true
irdkit
./nupkg
- net6.0;net7.0
+ net6.0;net7.0;net8.0
win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64
0.1.0
diff --git a/IRDKit/Program.cs b/IRDKit/Program.cs
index 764acf5..09ff490 100644
--- a/IRDKit/Program.cs
+++ b/IRDKit/Program.cs
@@ -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;
}
}
diff --git a/LibIRD.sln b/LibIRD.sln
index e654573..659c9f7 100644
--- a/LibIRD.sln
+++ b/LibIRD.sln
@@ -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
diff --git a/LibIRD/LibIRD.csproj b/LibIRD/LibIRD.csproj
index abd1290..49978c5 100644
--- a/LibIRD/LibIRD.csproj
+++ b/LibIRD/LibIRD.csproj
@@ -2,7 +2,7 @@
- net6.0;net7.0
+ net6.0;net7.0;net8.0
win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64
0.1.0
@@ -25,7 +25,7 @@
-
+
diff --git a/PrintParams/PrintParams.cs b/PrintParams/PrintParams.cs
deleted file mode 100644
index f53b146..0000000
--- a/PrintParams/PrintParams.cs
+++ /dev/null
@@ -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");
- }
- }
- }
-}
diff --git a/PrintParams/PrintParams.csproj b/PrintParams/PrintParams.csproj
deleted file mode 100644
index 0e2902a..0000000
--- a/PrintParams/PrintParams.csproj
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- Exe
- net6.0
- win-x86;win-x64;linux-x64;osx-x64
- 0.1
-
-
-
-
-
-
-
diff --git a/README.md b/README.md
index fc0d47b..34ed42d 100644
--- a/README.md
+++ b/README.md
@@ -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).