Misc code cleanup
This commit is contained in:
parent
af1dbf5305
commit
f84a3709c9
|
@ -162,8 +162,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
x += 3;
|
x += 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int y = 0;
|
return ROM[(bank_32k << 15) + addr];
|
||||||
return ROM[(bank_32k * 0x8000) + addr];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override byte ReadPPU(int addr)
|
public override byte ReadPPU(int addr)
|
||||||
|
|
|
@ -409,7 +409,7 @@ namespace BizHawk.MultiClient
|
||||||
else
|
else
|
||||||
g.DrawString(GUITextList[x].Message, MessageFont, GUITextList[x].ForeColor, posx, posy);
|
g.DrawString(GUITextList[x].Message, MessageFont, GUITextList[x].ForeColor, posx, posy);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -514,11 +514,11 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
if (Global.MovieSession.Movie.Mode == MOVIEMODE.PLAY)
|
if (Global.MovieSession.Movie.Mode == MOVIEMODE.PLAY)
|
||||||
{
|
{
|
||||||
int r = (int)g.ClipBounds.Width;
|
|
||||||
Point[] p = { new Point(r - 20, 2),
|
|
||||||
new Point(r - 4, 12),
|
|
||||||
new Point(r - 20, 22) };
|
|
||||||
//TODO
|
//TODO
|
||||||
|
//int r = (int)g.ClipBounds.Width;
|
||||||
|
//Point[] p = { new Point(r - 20, 2),
|
||||||
|
// new Point(r - 4, 12),
|
||||||
|
// new Point(r - 20, 22) };
|
||||||
//g.FillPolygon(new SolidBrush(Color.Red), p);
|
//g.FillPolygon(new SolidBrush(Color.Red), p);
|
||||||
//g.DrawPolygon(new Pen(new SolidBrush(Color.Pink)), p);
|
//g.DrawPolygon(new Pen(new SolidBrush(Color.Pink)), p);
|
||||||
|
|
||||||
|
|
|
@ -137,44 +137,47 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetCheatsPath()
|
public string CheatsPath
|
||||||
{
|
{
|
||||||
string path;
|
get
|
||||||
switch (Global.Emulator.SystemId)
|
|
||||||
{
|
{
|
||||||
case "NES":
|
string path;
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathNESCheats, "NES");
|
switch (Global.Emulator.SystemId)
|
||||||
break;
|
{
|
||||||
case "SMS":
|
case "NES":
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathSMSCheats, "SMS");
|
path = PathManager.MakeAbsolutePath(Global.Config.PathNESCheats, "NES");
|
||||||
break;
|
break;
|
||||||
case "SG":
|
case "SMS":
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathSGCheats, "SG");
|
path = PathManager.MakeAbsolutePath(Global.Config.PathSMSCheats, "SMS");
|
||||||
break;
|
break;
|
||||||
case "GG":
|
case "SG":
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathGGCheats, "GG");
|
path = PathManager.MakeAbsolutePath(Global.Config.PathSGCheats, "SG");
|
||||||
break;
|
break;
|
||||||
case "GEN":
|
case "GG":
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathGenesisCheats, "GEN");
|
path = PathManager.MakeAbsolutePath(Global.Config.PathGGCheats, "GG");
|
||||||
break;
|
break;
|
||||||
case "SFX":
|
case "GEN":
|
||||||
case "PCE":
|
path = PathManager.MakeAbsolutePath(Global.Config.PathGenesisCheats, "GEN");
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathPCECheats, "PCE");
|
break;
|
||||||
break;
|
case "SFX":
|
||||||
case "GB":
|
case "PCE":
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathGBCheats, "GB");
|
path = PathManager.MakeAbsolutePath(Global.Config.PathPCECheats, "PCE");
|
||||||
break;
|
break;
|
||||||
case "TI83":
|
case "GB":
|
||||||
path = PathManager.MakeAbsolutePath(Global.Config.PathTI83Cheats, "TI83");
|
path = PathManager.MakeAbsolutePath(Global.Config.PathGBCheats, "GB");
|
||||||
break;
|
break;
|
||||||
default:
|
case "TI83":
|
||||||
path = PathManager.GetBasePathAbsolute();
|
path = PathManager.MakeAbsolutePath(Global.Config.PathTI83Cheats, "TI83");
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
path = PathManager.GetBasePathAbsolute();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var f = new FileInfo(path);
|
||||||
|
if (f.Directory.Exists == false)
|
||||||
|
f.Directory.Create();
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
var f = new FileInfo(path);
|
|
||||||
if (f.Directory.Exists == false)
|
|
||||||
f.Directory.Create();
|
|
||||||
return path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SaveCheatFile(string path)
|
public bool SaveCheatFile(string path)
|
||||||
|
@ -232,7 +235,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
public string MakeDefaultFilename()
|
public string MakeDefaultFilename()
|
||||||
{
|
{
|
||||||
return Path.Combine(Global.CheatList.GetCheatsPath(), PathManager.FilesystemSafeName(Global.Game) + ".cht");
|
return Path.Combine(Global.CheatList.CheatsPath, PathManager.FilesystemSafeName(Global.Game) + ".cht");
|
||||||
}
|
}
|
||||||
|
|
||||||
private int GetNumDigits(Int32 i)
|
private int GetNumDigits(Int32 i)
|
||||||
|
|
|
@ -362,7 +362,7 @@ namespace BizHawk.MultiClient
|
||||||
sfd.FileName = Path.GetFileNameWithoutExtension(Global.CheatList.currentCheatFile);
|
sfd.FileName = Path.GetFileNameWithoutExtension(Global.CheatList.currentCheatFile);
|
||||||
else if (!(Global.Emulator is NullEmulator))
|
else if (!(Global.Emulator is NullEmulator))
|
||||||
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
sfd.FileName = PathManager.FilesystemSafeName(Global.Game);
|
||||||
sfd.InitialDirectory = Global.CheatList.GetCheatsPath();
|
sfd.InitialDirectory = Global.CheatList.CheatsPath;
|
||||||
sfd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
|
sfd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
|
||||||
sfd.RestoreDirectory = true;
|
sfd.RestoreDirectory = true;
|
||||||
Global.Sound.StopSound();
|
Global.Sound.StopSound();
|
||||||
|
@ -471,7 +471,7 @@ namespace BizHawk.MultiClient
|
||||||
var ofd = new OpenFileDialog();
|
var ofd = new OpenFileDialog();
|
||||||
if (Global.CheatList.currentCheatFile.Length > 0)
|
if (Global.CheatList.currentCheatFile.Length > 0)
|
||||||
ofd.FileName = Path.GetFileNameWithoutExtension(Global.CheatList.currentCheatFile);
|
ofd.FileName = Path.GetFileNameWithoutExtension(Global.CheatList.currentCheatFile);
|
||||||
ofd.InitialDirectory = Global.CheatList.GetCheatsPath();
|
ofd.InitialDirectory = Global.CheatList.CheatsPath;
|
||||||
ofd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
|
ofd.Filter = "Cheat Files (*.cht)|*.cht|All Files|*.*";
|
||||||
ofd.RestoreDirectory = true;
|
ofd.RestoreDirectory = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue