fix problem i caused by deleting usage of MakeAbsolutePath() in firmware names

This commit is contained in:
goyuken 2012-12-30 17:33:33 +00:00
parent 87a36128e3
commit 4e2cc88c9d
2 changed files with 18 additions and 13 deletions

View File

@ -407,11 +407,11 @@ namespace BizHawk.MultiClient
target.SMS_ShowBG = Global.Config.SMSDispBG; target.SMS_ShowBG = Global.Config.SMSDispBG;
target.SMS_ShowOBJ = Global.Config.SMSDispOBJ; target.SMS_ShowOBJ = Global.Config.SMSDispOBJ;
target.PSX_FirmwaresPath = Global.Config.FirmwaresPath; // PathManager.MakeAbsolutePath(Global.Config.PathPSXFirmwares, "PSX"); target.PSX_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); // PathManager.MakeAbsolutePath(Global.Config.PathPSXFirmwares, "PSX");
target.C64_FirmwaresPath = Global.Config.FirmwaresPath; // PathManager.MakeAbsolutePath(Global.Config.PathC64Firmwares, "C64"); target.C64_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); // PathManager.MakeAbsolutePath(Global.Config.PathC64Firmwares, "C64");
target.SNES_FirmwaresPath = Global.Config.FirmwaresPath; // PathManager.MakeAbsolutePath(Global.Config.PathSNESFirmwares, "SNES"); target.SNES_FirmwaresPath = PathManager.MakeAbsolutePath(Global.Config.FirmwaresPath, ""); // PathManager.MakeAbsolutePath(Global.Config.PathSNESFirmwares, "SNES");
target.SNES_ShowBG1_0 = Global.Config.SNES_ShowBG1_0; target.SNES_ShowBG1_0 = Global.Config.SNES_ShowBG1_0;
target.SNES_ShowBG1_1 = Global.Config.SNES_ShowBG1_1; target.SNES_ShowBG1_1 = Global.Config.SNES_ShowBG1_1;
target.SNES_ShowBG2_0 = Global.Config.SNES_ShowBG2_0; target.SNES_ShowBG2_0 = Global.Config.SNES_ShowBG2_0;
@ -1885,7 +1885,7 @@ namespace BizHawk.MultiClient
case "PCE": case "PCE":
case "PCECD": case "PCECD":
{ {
string biosPath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenamePCEBios); //PathManager.MakeAbsolutePath(Global.Config.PathPCEBios, "PCE"); string biosPath = PathManager.StandardFirmwareName(Global.Config.FilenamePCEBios); //PathManager.MakeAbsolutePath(Global.Config.PathPCEBios, "PCE");
if (File.Exists(biosPath) == false) if (File.Exists(biosPath) == false)
{ {
MessageBox.Show("PCE-CD System Card not found. Please check the BIOS path in Config->Paths->PC Engine."); MessageBox.Show("PCE-CD System Card not found. Please check the BIOS path in Config->Paths->PC Engine.");
@ -1972,7 +1972,7 @@ namespace BizHawk.MultiClient
break; break;
case "NES": case "NES":
{ {
string biosPath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenameFDSBios); string biosPath = PathManager.StandardFirmwareName(Global.Config.FilenameFDSBios);
byte[] bios = null; byte[] bios = null;
if (File.Exists(biosPath)) if (File.Exists(biosPath))
{ {
@ -2045,7 +2045,7 @@ namespace BizHawk.MultiClient
else else
{ {
// todo: get these bioses into a gamedb?? then we could demand different filenames for different regions? // todo: get these bioses into a gamedb?? then we could demand different filenames for different regions?
string sgbromPath = Path.Combine(Global.Config.FirmwaresPath, "sgb.sfc"); //Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathSNESFirmwares, "SNES"), "sgb.sfc"); string sgbromPath = PathManager.StandardFirmwareName("sgb.sfc"); //Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathSNESFirmwares, "SNES"), "sgb.sfc");
byte[] sgbrom = null; byte[] sgbrom = null;
try try
{ {
@ -2081,7 +2081,7 @@ namespace BizHawk.MultiClient
} }
break; break;
case "Coleco": case "Coleco":
string colbiosPath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenameCOLBios); string colbiosPath = PathManager.StandardFirmwareName(Global.Config.FilenameCOLBios);
FileInfo colfile = new FileInfo(colbiosPath); FileInfo colfile = new FileInfo(colbiosPath);
if (!colfile.Exists) if (!colfile.Exists)
{ {
@ -2097,11 +2097,11 @@ namespace BizHawk.MultiClient
case "INTV": case "INTV":
{ {
Intellivision intv = new Intellivision(nextComm, game, rom.RomData); Intellivision intv = new Intellivision(nextComm, game, rom.RomData);
string eromPath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenameINTVEROM); string eromPath = PathManager.StandardFirmwareName(Global.Config.FilenameINTVEROM);
if (!File.Exists(eromPath)) if (!File.Exists(eromPath))
throw new InvalidOperationException("Specified EROM path does not exist:\n\n" + eromPath); throw new InvalidOperationException("Specified EROM path does not exist:\n\n" + eromPath);
intv.LoadExecutiveRom(eromPath); intv.LoadExecutiveRom(eromPath);
string gromPath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenameINTVGROM); string gromPath = PathManager.StandardFirmwareName(Global.Config.FilenameINTVGROM);
if (!File.Exists(gromPath)) if (!File.Exists(gromPath))
throw new InvalidOperationException("Specified GROM path does not exist:\n\n" + gromPath); throw new InvalidOperationException("Specified GROM path does not exist:\n\n" + gromPath);
intv.LoadGraphicsRom(gromPath); intv.LoadGraphicsRom(gromPath);
@ -2109,9 +2109,9 @@ namespace BizHawk.MultiClient
} }
break; break;
case "A78": case "A78":
string ntsc_biospath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenameA78NTSCBios); string ntsc_biospath = PathManager.StandardFirmwareName(Global.Config.FilenameA78NTSCBios);
string pal_biospath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenameA78PALBios); string pal_biospath = PathManager.StandardFirmwareName(Global.Config.FilenameA78PALBios);
string hsbiospath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenameA78HSCBios); string hsbiospath = PathManager.StandardFirmwareName(Global.Config.FilenameA78HSCBios);
FileInfo ntscfile = new FileInfo(ntsc_biospath); FileInfo ntscfile = new FileInfo(ntsc_biospath);
FileInfo palfile = new FileInfo(pal_biospath); FileInfo palfile = new FileInfo(pal_biospath);
@ -2162,7 +2162,7 @@ namespace BizHawk.MultiClient
case "GBA": case "GBA":
if (INTERIM) if (INTERIM)
{ {
string gbabiospath = Path.Combine(Global.Config.FirmwaresPath, Global.Config.FilenameGBABIOS); string gbabiospath = PathManager.StandardFirmwareName(Global.Config.FilenameGBABIOS);
byte[] gbabios = null; byte[] gbabios = null;
if (File.Exists(gbabiospath)) if (File.Exists(gbabiospath))

View File

@ -108,6 +108,11 @@ namespace BizHawk.MultiClient
} }
} }
public static string StandardFirmwareName(string name)
{
return Path.Combine(MakeAbsolutePath(Global.Config.FirmwaresPath, ""), name);
}
public static string MakeAbsolutePath(string path, string system) public static string MakeAbsolutePath(string path, string system)
{ {
//This function translates relative path and special identifiers in absolute paths //This function translates relative path and special identifiers in absolute paths