C64: standardize missing firmware errors

This commit is contained in:
goyuken 2014-08-24 17:28:17 +00:00
parent 39526d3eb7
commit ab50181b31
1 changed files with 3 additions and 5 deletions

View File

@ -18,11 +18,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
private byte[] GetFirmware(string name, int length) private byte[] GetFirmware(string name, int length)
{ {
byte[] result = new byte[length]; byte[] result = CoreComm.CoreFileProvider.GetFirmware("C64", name, true);
using (Stream source = CoreComm.CoreFileProvider.OpenFirmware("C64", name)) if (result.Length != length)
{ throw new MissingFirmwareException(string.Format("Firmware {0} was {1} bytes, should be {2} bytes", name, result.Length, length));
source.Read(result, 0, length);
}
return result; return result;
} }