public void LoadDevice(string romFilePath, string ramFilePath) { UnloadDevice(); _currentExternalMemory = new StreamedExternalMemory(File.Open(ramFilePath, FileMode.OpenOrCreate)); CurrentDevice = new GameBoy.GameBoy(new EmulatedCartridge(File.ReadAllBytes(romFilePath), _currentExternalMemory)); OnDeviceLoaded(new DeviceEventArgs(CurrentDevice)); }
public void LoadDevice(string romFilePath, string ramFilePath) { UnloadDevice(); _currentExternalMemory = new StreamedExternalMemory(File.Open(ramFilePath, FileMode.OpenOrCreate)); var cartridge = new EmulatedCartridge(File.ReadAllBytes(romFilePath), _currentExternalMemory); _currentExternalMemory.SetBufferSize(cartridge.ExternalRamSize); CurrentDevice = new GameBoy.GameBoy(cartridge, !Properties.Settings.Default.ForceOriginalGameBoy); ApplyColorPalettes(); OnDeviceLoaded(new DeviceEventArgs(CurrentDevice)); }
public void UnloadDevice() { var device = _currentDevice; if (device != null) { device.Terminate(); _currentExternalMemory.Dispose(); _currentDevice = null; OnDeviceUnloaded(new DeviceEventArgs(device)); } }
public DeviceEventArgs(GameBoy.GameBoy device) { Device = device; }