apply Arcade Pit work: "Extract NesCarts.xml for easier modification"
This commit is contained in:
parent
3a41cc4531
commit
0b4fc8b6a5
Binary file not shown.
Binary file not shown.
|
@ -134,9 +134,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
// we could background thread this later instead if we wanted to be real clever
|
||||
NES.BootGodDB.GetDatabaseBytes = () =>
|
||||
{
|
||||
using (var NesCartFile =
|
||||
new HawkFile(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "NesCarts.7z")).BindFirst())
|
||||
string xmlPath = Path.Combine( PathManager.GetExeDirectoryAbsolute(), "gamedb", "NesCarts.xml" );
|
||||
string x7zPath = Path.Combine( PathManager.GetExeDirectoryAbsolute(), "gamedb", "NesCarts.7z" );
|
||||
bool loadXml = File.Exists( xmlPath );
|
||||
using (var NesCartFile = new HawkFile(loadXml ? xmlPath : x7zPath))
|
||||
{
|
||||
if (!loadXml) { NesCartFile.BindFirst(); }
|
||||
return NesCartFile
|
||||
.GetStream()
|
||||
.ReadAllBytes();
|
||||
|
|
|
@ -65,13 +65,15 @@ namespace BizHawk.Client.MultiHawk
|
|||
// we could background thread this later instead if we wanted to be real clever
|
||||
NES.BootGodDB.GetDatabaseBytes = () =>
|
||||
{
|
||||
using (var NesCartFile =
|
||||
new HawkFile(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "NesCarts.7z")).BindFirst())
|
||||
string xmlPath = Path.Combine( PathManager.GetExeDirectoryAbsolute(), "gamedb", "NesCarts.xml" );
|
||||
string x7zPath = Path.Combine( PathManager.GetExeDirectoryAbsolute(), "gamedb", "NesCarts.7z" );
|
||||
bool loadXml = File.Exists( xmlPath );
|
||||
using ( var NesCartFile = new HawkFile( loadXml ? xmlPath : x7zPath ) )
|
||||
{
|
||||
if ( !loadXml ) { NesCartFile.BindFirst(); }
|
||||
return NesCartFile
|
||||
.GetStream()
|
||||
.ReadAllBytes();
|
||||
}
|
||||
};
|
||||
|
||||
Database.LoadDatabase(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "gamedb.txt"));
|
||||
|
|
Loading…
Reference in New Issue