cleanup & format

This commit is contained in:
Lucent 2023-10-27 23:47:09 +02:00
parent c45fe707d2
commit 92ff4d3f28
2 changed files with 68 additions and 65 deletions

View file

@ -1,6 +1,4 @@
using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Windows.Forms;
namespace SharpCreditsCrediter namespace SharpCreditsCrediter
{ {

View file

@ -33,9 +33,11 @@ namespace SharpCreditsCrediter
private string intToText(int value) private string intToText(int value)
{ {
try { try
{
return intToTextTable[value]; return intToTextTable[value];
} catch(Exception) }
catch (Exception)
{ {
return String.Format("{0:X2}", Convert.ToInt32(value)); return String.Format("{0:X2}", Convert.ToInt32(value));
} }
@ -59,7 +61,7 @@ namespace SharpCreditsCrediter
} }
private void probeGame() private void probeGame()
{ {
if(this.isLoaded()) if (this.isLoaded())
{ {
#pragma warning disable CS8602 // isLoaded checks already if romFile is null or not #pragma warning disable CS8602 // isLoaded checks already if romFile is null or not
byte[] gameCodeBuf = new byte[4]; byte[] gameCodeBuf = new byte[4];
@ -70,7 +72,8 @@ namespace SharpCreditsCrediter
if (gameCode == "AMTE") if (gameCode == "AMTE")
{ {
this.isZM = false; this.isZM = false;
} else }
else
{ {
this.isZM = true; this.isZM = true;
} }
@ -149,7 +152,8 @@ namespace SharpCreditsCrediter
var currentLine = credits.ReadLine(); var currentLine = credits.ReadLine();
if (currentLine != null) if (currentLine != null)
{ {
if (currentLine.Length > 38) { if (currentLine.Length > 38)
{
currentLine = currentLine[..38]; currentLine = currentLine[..38];
} }
@ -181,7 +185,8 @@ namespace SharpCreditsCrediter
return true; return true;
} }
return false; return false;
} catch (Exception) }
catch (Exception)
{ {
return false; return false;
} }