diff --git a/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs b/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs index 43a75cb3c3..482eaa2f51 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/GBA/Meteor.cs @@ -21,11 +21,13 @@ namespace BizHawk.Emulation.Consoles.Nintendo.GBA public ControllerDefinition ControllerDefinition { get { return GBAController; } } public IController Controller { get; set; } - public void Load(byte[] rom) + public void Load(byte[] rom, byte[] bios) { + if (bios.Length != 16384) + throw new Exception("GBA bios must be exactly 16384 bytes!"); Init(); LibMeteor.libmeteor_reset(); - LibMeteor.libmeteor_loadbios(File.ReadAllBytes("gbabios.rom"), 16384); + LibMeteor.libmeteor_loadbios(bios, (uint)bios.Length); LibMeteor.libmeteor_loadrom(rom, (uint)rom.Length); } diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index d270971e54..ea5d16b92f 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -99,6 +99,14 @@ namespace BizHawk.MultiClient public string PathSNESCheats = Path.Combine(".", "Cheats"); public string PathSNESFirmwares = Path.Combine(".", "Firmwares"); + public string BaseGBA = Path.Combine(".", "GBA"); + public string PathGBAROMs = "."; + public string PathGBASavestates = Path.Combine(".", "State"); + public string PathGBASaveRAM = Path.Combine(".", "SaveRAM"); + public string PathGBAScreenshots = Path.Combine(".", "Screenshots"); + public string PathGBACheats = Path.Combine(".", "Cheats"); + public string PathGBAFirmwares = Path.Combine(".", "Firmwares"); + public string BaseSMS = Path.Combine(".", "SMS"); public string PathSMSROMs = "."; public string PathSMSSavestates = Path.Combine(".", "State"); diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index d416acbb8d..e9fd749074 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -1809,12 +1809,12 @@ namespace BizHawk.MultiClient break; case "A78": string ntsc_biospath = PathManager.MakeAbsolutePath(Global.Config.PathAtari7800NTSCBIOS, "A78"); - string pal_biospath = PathManager.MakeAbsolutePath(Global.Config.PathAtari7800PALBIOS, "A78"); + string pal_biospath = PathManager.MakeAbsolutePath(Global.Config.PathAtari7800PALBIOS, "A78"); string hsbiospath = PathManager.MakeAbsolutePath(Global.Config.PathAtari7800HighScoreBIOS, "A78"); byte[] NTSC_BIOS7800 = File.ReadAllBytes(ntsc_biospath); byte[] PAL_BIOS7800 = File.ReadAllBytes(pal_biospath); byte[] HighScoreBIOS = File.ReadAllBytes(hsbiospath); - + Atari7800 a78 = new Atari7800(game, rom.RomData, NTSC_BIOS7800, PAL_BIOS7800, HighScoreBIOS); nextEmulator = a78; break; @@ -1825,8 +1825,20 @@ namespace BizHawk.MultiClient nextEmulator = c64; break; case "GBA": + string gbabiospath = Path.Combine(PathManager.MakeAbsolutePath(Global.Config.PathGBAFirmwares, "GBA"), "gbabios.rom"); + byte[] gbabios = null; + + if (File.Exists(gbabiospath)) + { + gbabios = File.ReadAllBytes(gbabiospath); + } + else + { + MessageBox.Show(string.Format("Couldn't open GBA BIOS: {0}\nCheck your firmware config", gbabiospath)); + throw new Exception(); + } GBA gba = new GBA(); - gba.Load(rom.RomData); + gba.Load(rom.RomData, gbabios); nextEmulator = gba; break; } diff --git a/BizHawk.MultiClient/config/PathManager.cs b/BizHawk.MultiClient/config/PathManager.cs index 5ef038efdb..63fb9f2146 100644 --- a/BizHawk.MultiClient/config/PathManager.cs +++ b/BizHawk.MultiClient/config/PathManager.cs @@ -99,6 +99,8 @@ namespace BizHawk.MultiClient return Global.Config.BaseSNES; case "Coleco": return Global.Config.BaseCOL; + case "GBA": + return Global.Config.BaseGBA; case "NULL": default: return "";