Misc code cleanup

This commit is contained in:
adelikat 2012-08-12 01:09:30 +00:00
parent af1dbf5305
commit f84a3709c9
4 changed files with 47 additions and 45 deletions

View File

@ -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)

View File

@ -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);

View File

@ -137,7 +137,9 @@ namespace BizHawk.MultiClient
} }
} }
public string GetCheatsPath() public string CheatsPath
{
get
{ {
string path; string path;
switch (Global.Emulator.SystemId) switch (Global.Emulator.SystemId)
@ -176,6 +178,7 @@ namespace BizHawk.MultiClient
f.Directory.Create(); f.Directory.Create();
return path; 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)

View File

@ -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;