Skip to content

Commit

Permalink
UI: Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Octal450 committed Oct 10, 2022
1 parent b09494e commit 2bdf68b
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 113 deletions.
29 changes: 17 additions & 12 deletions J-Runner/Classes/Nand-X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ private bool DeInit(UsbDevice dev)
return dev.ControlTransfer(ref packet, buffer, 8, out lengthTransfered);
}



private Errors read_v2(string filename, Nandsize nsize, bool print = true, int startblock = 0, int length = 0)
{
lock (MainForm._object)
Expand All @@ -283,6 +281,8 @@ private Errors read_v2(string filename, Nandsize nsize, bool print = true, int s
byte[] readBuf = new byte[0x4200];
int bytesRead;

if (print) Console.WriteLine("Checking Console...");

///Arm Version
if (!ArmVersion(MyUsbDevice, reader, out readBuffer, out ec, out bytesRead)) return Errors.FailedGetVersion; //1;
if (print) Console.WriteLine("Version: {0}", Oper.ByteArrayToString(readBuffer).Substring(0, 2));
Expand All @@ -301,7 +301,7 @@ private Errors read_v2(string filename, Nandsize nsize, bool print = true, int s
if (print) Console.WriteLine("Flash Config: 0x" + BitConverter.ToString(readBuffer, 0, 0x4).Replace("-", ""));
if (Oper.ByteArrayToString(readBuffer) == "00000000")
{
Console.WriteLine("Can Not Continue");
Console.WriteLine("Console Not Found");
Console.WriteLine("");
return Errors.NoFlashConfig;// 2;
}
Expand Down Expand Up @@ -330,7 +330,10 @@ private Errors read_v2(string filename, Nandsize nsize, bool print = true, int s
{
length = nsize.GetHashCode();
}

if (print) Console.WriteLine("");
Console.WriteLine("Reading Nand to {0}", filename);

BinaryWriter sw = new BinaryWriter(File.Open(filename, FileMode.Append, FileAccess.Write));
int i = startblock;
while (i < (length + startblock) && !variables.escapeloop)
Expand Down Expand Up @@ -394,6 +397,8 @@ private Errors erase_v2(Nandsize nsize, bool print = true, int startblock = 0, i
byte[] readBuffer = new byte[4];
int bytesRead;

if (print) Console.WriteLine("Checking Console...");

///Arm Version
if (!ArmVersion(MyUsbDevice, reader, out readBuffer, out ec, out bytesRead)) return Errors.FailedGetVersion; //1;
if (print) Console.WriteLine("Version: {0}", Oper.ByteArrayToString(readBuffer).Substring(0, 2));
Expand All @@ -410,12 +415,6 @@ private Errors erase_v2(Nandsize nsize, bool print = true, int startblock = 0, i
if (!FlashConfig(MyUsbDevice, reader, out readBuffer, out ec, out bytesRead)) return Errors.FailedGetConfig; //1;
Array.Reverse(readBuffer, 0, 0x4);
if (print) Console.WriteLine("Flash Config: 0x" + BitConverter.ToString(readBuffer, 0, 0x4).Replace("-", ""));
//if (Oper.ByteArrayToString(readBuffer) == "00000000")
{
//Console.WriteLine("Can not Continue");
//Console.WriteLine("");
//return Errors.NoFlashConfig;// 2;
}
bool found = false;
foreach (string fconf in variables.flashconfigs)
{
Expand All @@ -439,6 +438,8 @@ private Errors erase_v2(Nandsize nsize, bool print = true, int startblock = 0, i
{
length = nsize.GetHashCode();
}

Console.WriteLine("");
Console.WriteLine("Erasing Nand");

int i = startblock;
Expand Down Expand Up @@ -493,6 +494,8 @@ private Errors write_v2(string filename, Nandsize nsize, bool print = true, int
byte[] readBuffer = new byte[4];
int bytesRead;

if (print) Console.WriteLine("Checking Console...");

///Arm Version
if (!ArmVersion(MyUsbDevice, reader, out readBuffer, out ec, out bytesRead)) return Errors.FailedGetVersion; //1;
if (print) Console.WriteLine("Version: {0}", Oper.ByteArrayToString(readBuffer).Substring(0, 2));
Expand All @@ -511,7 +514,7 @@ private Errors write_v2(string filename, Nandsize nsize, bool print = true, int
if (print) Console.WriteLine("Flash Config: 0x" + BitConverter.ToString(readBuffer, 0, 0x4).Replace("-", ""));
if (Oper.ByteArrayToString(readBuffer) == "00000000")
{
Console.WriteLine("Can not Continue");
Console.WriteLine("Console Not Found");
Console.WriteLine("");
return Errors.NoFlashConfig;// 2;
}
Expand All @@ -535,6 +538,8 @@ private Errors write_v2(string filename, Nandsize nsize, bool print = true, int
else if (flashconfig == "01198010") layout = 0;
else layout = 1;

Console.WriteLine("");

byte[] writeBuffer = new byte[0x4200];
BinaryReader rw = new BinaryReader(File.Open(filename, FileMode.Open, FileAccess.Read));

Expand Down Expand Up @@ -972,11 +977,11 @@ public Errors read(string filename, Nandsize nsize, bool print = true, int start
return result;
}

public Errors getflashmb(ref string flashconf, bool stealth)
public Errors getflashmb(ref string flashconf)
{
Errors result = Errors.None;
result = getflashmb_JRunner(ref flashconf);
if (result == Errors.DeviceNotFound) { if (!stealth) Console.WriteLine(("Device Not Found")); }
if (result == Errors.DeviceNotFound) { Console.WriteLine("Device Not Found"); }
return result;
}

Expand Down
7 changes: 3 additions & 4 deletions J-Runner/Classes/variables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public enum Windows
public static string settingsfile = Path.Combine(AppData, "settings.xml");
public static bool escapeloop = false, exitedxe = true, autoExtract = false, allmove = false;
public static bool reading = false, writing;
public static bool slimprefersrgh = false;
public static bool mtxUsbMode = false;
public static bool noPatchWarnings = false;
public static Color logbackground = Color.Black;
Expand All @@ -140,8 +139,8 @@ public enum Windows
public static string backupRoot = "";
public static string COMPort = "";
public static string[] settings = { "XeBuild", "FileChecks", "COMPort", "Delay", "DashlaunchE", "IP", "NoReads", "IPStart", "IPEnd", "Dashlaunch", "PreferredDash", "KeepFiles", "RootDirOverride",
"LPTtiming", "LPTport", "Server", "AutoExtract", "AllMove", "LogBackground", "LogText", "SlimPreferSrgh", "MtxUsbMode", "NoPatchWarnings", "PlaySuccess",
"PlayError", "AutoDelXeLL", "CpuKeyDbSerial", "BackupEn", "BackupType", "BackupNaming", "BackupRoot", "ShowAdvancedTabs"};
"LPTtiming", "LPTport", "Server", "AutoExtract", "AllMove", "LogBackground", "LogText", "MtxUsbMode", "NoPatchWarnings", "PlaySuccess", "PlayError", "AutoDelXeLL",
"CpuKeyDbSerial", "BackupEn", "BackupType", "BackupNaming", "BackupRoot", "ShowAdvancedTabs"};

/// <summary>
/// Network
Expand Down Expand Up @@ -244,7 +243,7 @@ public enum Windows

public static string[] console_types = { "none/unk", "Xenon", "Zephyr", "Falcon", "Jasper", "Trinity", "Corona" };
public static string[] flashconfigs = new string[] { "00023010", "00043000", "01198010", "008A3020", "00AA3020", "008C3020", "00AC3020", "C0462002" };
public static bool fulldump = false, read1p28mb = false;
public static bool fulldump = false, read1p28mb = false, nandabort = false;
public static int smcmbtype = 0x0;
public static string flashconfig = "";

Expand Down
1 change: 0 additions & 1 deletion J-Runner/Classes/xFlasher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public int getFlashConfigActual(bool auto = false)
if (flashconf == "00000000" || flashconf == "FFFFFFFF")
{
Console.WriteLine("xFlasher: Console Not Found");
if (auto) Console.WriteLine("xFlasher: Can Not Continue");
Console.WriteLine("");
return 1;
}
Expand Down
10 changes: 5 additions & 5 deletions J-Runner/Forms/NandSel.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions J-Runner/Forms/NandSel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,39 @@ private void btn16_Click(object sender, EventArgs e)
{
variables.fulldump = false;
variables.read1p28mb = false;
variables.nandabort = false;
this.Close();
}

private void btn64_Click(object sender, EventArgs e)
{
variables.fulldump = false;
variables.read1p28mb = false;
variables.nandabort = false;
this.Close();
}

private void btn256_Click(object sender, EventArgs e)
{
variables.fulldump = true;
variables.read1p28mb = false;
variables.nandabort = false;
this.Close();
}

private void btn512_Click(object sender, EventArgs e)
{
variables.fulldump = true;
variables.read1p28mb = false;
variables.nandabort = false;
this.Close();
}

private void btn1p28_Click(object sender, EventArgs e)
{
variables.fulldump = false;
variables.read1p28mb = true;
variables.nandabort = false;
this.Close();
}

Expand Down
71 changes: 14 additions & 57 deletions J-Runner/Forms/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2bdf68b

Please sign in to comment.