From 87f8d13ca51954bfc6aba30a446dced049d4a3a0 Mon Sep 17 00:00:00 2001 From: goyuken Date: Tue, 10 Dec 2013 18:16:39 +0000 Subject: [PATCH] apply new firmware load system to ColecoVision and Intellivision --- BizHawk.Client.EmuHawk/MainForm.cs | 23 ++----------------- .../Consoles/Coleco/ColecoVision.cs | 3 ++- .../Consoles/Intellivision/Intellivision.cs | 3 +++ 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 2f9636553a..146bc35135 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -3151,6 +3151,7 @@ namespace BizHawk.Client.EmuHawk game.System = "SNES"; nextComm.SNES_ExePath = SNES_Prepare(Global.Config.SNESProfile); + // need to get rid of this hack at some point ((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", "")); //Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename var snes = new LibsnesCore(nextComm); @@ -3264,34 +3265,14 @@ namespace BizHawk.Client.EmuHawk } break; case "Coleco": - var colbiosPath = Global.FirmwareManager.Request("Coleco", "Bios"); - var colfile = colbiosPath != null ? new FileInfo(colbiosPath) : null; - if (colfile == null || !colfile.Exists) { - MessageBox.Show("Unable to find the required ColecoVision BIOS file - \n" + colbiosPath, "Unable to load BIOS", MessageBoxButtons.OK, MessageBoxIcon.Error); - throw new Exception(); - } - else - { - var c = new ColecoVision(nextComm, game, rom.RomData, colbiosPath, Global.Config.ColecoSkipBiosIntro); + var c = new ColecoVision(nextComm, game, rom.RomData, Global.Config.ColecoSkipBiosIntro); nextEmulator = c; } break; case "INTV": { var intv = new Intellivision(nextComm, game, rom.RomData); - var eromPath = Global.FirmwareManager.Request("INTV", "EROM"); - if (!File.Exists(eromPath)) - { - throw new InvalidOperationException("Specified EROM path does not exist:\n\n" + eromPath); - } - intv.LoadExecutiveRom(eromPath); - var gromPath = Global.FirmwareManager.Request("INTV", "GROM"); - if (!File.Exists(gromPath)) - { - throw new InvalidOperationException("Specified GROM path does not exist:\n\n" + gromPath); - } - intv.LoadGraphicsRom(gromPath); nextEmulator = intv; } break; diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index fcff0736e6..b740993767 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision public SN76489 PSG; public byte[] Ram = new byte[1024]; - public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, string biosPath, bool skipbios) + public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, bool skipbios) { CoreComm = comm; @@ -37,6 +37,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision PSG = new SN76489(); // TODO: hack to allow bios-less operation would be nice, no idea if its feasible + string biosPath = CoreComm.CoreFileProvider.GetFirmwarePath("Coleco", "Bios", true, "Coleco BIOS file is required."); BiosRom = File.ReadAllBytes(biosPath); if (game["NoSkip"]) diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs index 0abdfc181f..1b3c1d3919 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs @@ -83,6 +83,9 @@ namespace BizHawk.Emulation.Cores.Intellivision Connect(); Cpu.LogData(); + + LoadExecutiveRom(CoreComm.CoreFileProvider.GetFirmwarePath("INTV", "EROM", true, "Executive ROM is required.")); + LoadGraphicsRom(CoreComm.CoreFileProvider.GetFirmwarePath("INTV", "GROM", true, "Graphics ROM is required.")); } public void FrameAdvance(bool render, bool rendersound)