From ab50181b31ec38c1ecf25ca56889f14abdd5f661 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sun, 24 Aug 2014 17:28:17 +0000 Subject: [PATCH] C64: standardize missing firmware errors --- BizHawk.Emulation.Cores/Computers/Commodore64/C64.Core.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Core.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Core.cs index 4aa03d21ae..36300282aa 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Core.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Core.cs @@ -18,11 +18,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 private byte[] GetFirmware(string name, int length) { - byte[] result = new byte[length]; - using (Stream source = CoreComm.CoreFileProvider.OpenFirmware("C64", name)) - { - source.Read(result, 0, length); - } + byte[] result = CoreComm.CoreFileProvider.GetFirmware("C64", name, true); + if (result.Length != length) + throw new MissingFirmwareException(string.Format("Firmware {0} was {1} bytes, should be {2} bytes", name, result.Length, length)); return result; }