From 94f4bd8cff675fa56a28a1da0c428e63396269dd Mon Sep 17 00:00:00 2001 From: Josh Davidson Date: Sat, 23 Apr 2022 22:26:43 -0400 Subject: [PATCH] Nand: Fix broken 4GB patch detection --- J-Runner/Classes/variables.cs | 2 +- J-Runner/MainForm.cs | 16 ++++++++++++---- J-Runner/Resources/Build.txt | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/J-Runner/Classes/variables.cs b/J-Runner/Classes/variables.cs index 884c186..4256509 100644 --- a/J-Runner/Classes/variables.cs +++ b/J-Runner/Classes/variables.cs @@ -82,7 +82,7 @@ public enum Windows public static string version = "3.1.4"; public static string build = "3140." + DateTime.ParseExact(Properties.Resources.Build.Trim(), "MM-dd-yyyy HH:mm:ss", null).ToString("yyMMdd.HHmm"); public const string staticversion = "3.1.4.0"; - public static int revision = 20; + public static int revision = 21; public static Windows currentOS = Windows.Unknown; public static bool iswriting; public static bool isscanningip = false; diff --git a/J-Runner/MainForm.cs b/J-Runner/MainForm.cs index ecd4664..0389e1e 100644 --- a/J-Runner/MainForm.cs +++ b/J-Runner/MainForm.cs @@ -2118,10 +2118,18 @@ void nandinit() try { byte[] check_XL_USB = new byte[0x5B230]; - fs.Position = 0x8FFD0; - fs.Read(check_XL_USB, 0, 0x5B230); // 0x8FFD0 - 0xEB200 - check_XL_USB = Nand.Nand.unecc(check_XL_USB); - + if (nand.noecc) + { + fs.Position = 0x8BA00; + fs.Read(check_XL_USB, 0, 0x58600); // 0x8BA00 - 0xE4000 + } + else + { + fs.Position = 0x8FFD0; + fs.Read(check_XL_USB, 0, 0x5B230); // 0x8FFD0 - 0xEB200 + check_XL_USB = Nand.Nand.unecc(check_XL_USB); + } + byte[] patches = new byte[0x1000]; if (nand.bigblock) diff --git a/J-Runner/Resources/Build.txt b/J-Runner/Resources/Build.txt index e4b3bdf..f5836bf 100644 --- a/J-Runner/Resources/Build.txt +++ b/J-Runner/Resources/Build.txt @@ -1 +1 @@ -04-24-2022 01:05:14 \ No newline at end of file +04-24-2022 02:26:30 \ No newline at end of file