Esempio n. 1
0
 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));
 }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        public void UnloadDevice()
        {
            var device = _currentDevice;

            if (device != null)
            {
                device.Terminate();
                _currentExternalMemory.Dispose();
                _currentDevice = null;
                OnDeviceUnloaded(new DeviceEventArgs(device));
            }
        }
Esempio n. 4
0
 public DeviceEventArgs(GameBoy.GameBoy device)
 {
     Device = device;
 }