Atari 7800 - don't require all 3 bios files to run. But do nag them that they are missing them.

This commit is contained in:
adelikat 2012-12-27 22:24:42 +00:00
parent 06bd1b979a
commit 9c945a175e
2 changed files with 50 additions and 31 deletions

View File

@ -202,7 +202,13 @@ namespace BizHawk.Emulation
{ {
cart = Cart.Create(rom, GameInfo.CartType); cart = Cart.Create(rom, GameInfo.CartType);
ILogger logger = new ConsoleLogger(); ILogger logger = new ConsoleLogger();
HSC7800 hsc7800 = new HSC7800(hsbios, hsram);
HSC7800 hsc7800 = null;
if (hsbios != null)
{
hsc7800 = new HSC7800(hsbios, hsram);
}
Bios7800 bios7800 = new Bios7800(bios); Bios7800 bios7800 = new Bios7800(bios);
theMachine = MachineBase.Create theMachine = MachineBase.Create
(GameInfo.MachineType, (GameInfo.MachineType,
@ -260,25 +266,28 @@ namespace BizHawk.Emulation
delegate(int addr, byte val) delegate(int addr, byte val)
{ {
})); }));
_MemoryDomains.Add(new MemoryDomain( if (hsc7800 != null)
"HSC ROM", hsbios.Length, Endian.Unknown, {
delegate(int addr) _MemoryDomains.Add(new MemoryDomain(
{ "HSC ROM", hsbios.Length, Endian.Unknown,
return hsbios[addr]; delegate(int addr)
}, {
delegate(int addr, byte val) return hsbios[addr];
{ },
})); delegate(int addr, byte val)
_MemoryDomains.Add(new MemoryDomain( {
"HSC RAM", hsram.Length, Endian.Unknown, }));
delegate(int addr) _MemoryDomains.Add(new MemoryDomain(
{ "HSC RAM", hsram.Length, Endian.Unknown,
return hsram[addr]; delegate(int addr)
}, {
delegate(int addr, byte val) return hsram[addr];
{ },
hsram[addr] = val; delegate(int addr, byte val)
})); {
hsram[addr] = val;
}));
}
_MemoryDomains.Add(new MemoryDomain( _MemoryDomains.Add(new MemoryDomain(
"System Bus", 65536, Endian.Unknown, "System Bus", 65536, Endian.Unknown,
delegate(int addr) delegate(int addr)

View File

@ -2051,30 +2051,40 @@ namespace BizHawk.MultiClient
FileInfo palfile = new FileInfo(pal_biospath); FileInfo palfile = new FileInfo(pal_biospath);
FileInfo hsfile = new FileInfo(hsbiospath); FileInfo hsfile = new FileInfo(hsbiospath);
byte[] NTSC_BIOS7800 = null;
byte[] PAL_BIOS7800 = null;
byte[] HighScoreBIOS = null;
if (!ntscfile.Exists) if (!ntscfile.Exists)
{ {
MessageBox.Show("Unable to find the required Atari 7800 BIOS file - \n" + ntsc_biospath, "Unable to load BIOS", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Unable to find the required Atari 7800 BIOS file - \n" + ntsc_biospath + "\nIf the selected game requires it, it may crash", "Unable to load BIOS", MessageBoxButtons.OK, MessageBoxIcon.Error);
throw new Exception(); //throw new Exception();
}
else
{
NTSC_BIOS7800 = File.ReadAllBytes(ntsc_biospath);
} }
if (!palfile.Exists) if (!palfile.Exists)
{ {
MessageBox.Show("Unable to find the required Atari 7800 BIOS file - \n" + pal_biospath, "Unable to load BIOS", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Unable to find the required Atari 7800 BIOS file - \n" + pal_biospath + "\nIf the selected game requires it, it may crash", "Unable to load BIOS", MessageBoxButtons.OK, MessageBoxIcon.Error);
throw new Exception(); //throw new Exception();
}
else
{
PAL_BIOS7800 = File.ReadAllBytes(pal_biospath);
} }
if (!hsfile.Exists) if (!hsfile.Exists)
{ {
MessageBox.Show("Unable to find the required Atari 7800 BIOS file - \n" + hsbiospath, "Unable to load BIOS", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Unable to find the required Atari 7800 BIOS file - \n" + hsbiospath + "\nIf the selected game requires it, it may crash", "Unable to load BIOS", MessageBoxButtons.OK, MessageBoxIcon.Error);
throw new Exception(); //throw new Exception();
}
else
{
HighScoreBIOS = File.ReadAllBytes(hsbiospath);
} }
byte[] NTSC_BIOS7800 = File.ReadAllBytes(ntsc_biospath);
byte[] PAL_BIOS7800 = File.ReadAllBytes(pal_biospath);
byte[] HighScoreBIOS = File.ReadAllBytes(hsbiospath);
string gamedbpath = Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "EMU7800.csv"); string gamedbpath = Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "EMU7800.csv");
var a78 = new BizHawk.Emulation.Atari7800(nextComm, game, rom.RomData, NTSC_BIOS7800, PAL_BIOS7800, HighScoreBIOS, gamedbpath); var a78 = new BizHawk.Emulation.Atari7800(nextComm, game, rom.RomData, NTSC_BIOS7800, PAL_BIOS7800, HighScoreBIOS, gamedbpath);
nextEmulator = a78; nextEmulator = a78;
break; break;