2016-06-21 18:58:22 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Imaging;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using Mesen.GUI.Forms;
|
|
|
|
|
using Microsoft.Win32;
|
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Config
|
|
|
|
|
{
|
|
|
|
|
public class EmulationInfo
|
|
|
|
|
{
|
|
|
|
|
public bool AllowInvalidInput = false;
|
2017-02-22 20:41:58 -05:00
|
|
|
|
public bool DisablePpu2004Reads = false;
|
2017-02-24 21:43:42 -05:00
|
|
|
|
public bool DisablePaletteRead = false;
|
|
|
|
|
public bool DisableOamAddrBug = false;
|
2017-02-24 23:06:13 -05:00
|
|
|
|
public bool DisablePpuReset = false;
|
2017-04-08 14:13:10 -04:00
|
|
|
|
public bool EnableOamDecay = false;
|
2017-02-25 10:56:38 -05:00
|
|
|
|
public bool UseNes101Hvc101Behavior = false;
|
2018-04-14 22:12:05 -04:00
|
|
|
|
public bool EnableMapperRandomPowerOnState = false;
|
2019-11-10 17:35:29 -05:00
|
|
|
|
public bool RandomizeCpuPpuAlignment = false;
|
2019-11-12 21:00:30 -05:00
|
|
|
|
public bool EnablePpu2006ScrollGlitch = false;
|
|
|
|
|
public bool EnablePpu2000ScrollGlitch = false;
|
2020-04-30 18:40:39 -04:00
|
|
|
|
public bool EnablePpuOamRowCorruption = false;
|
2016-06-21 18:58:22 -04:00
|
|
|
|
|
|
|
|
|
public bool UseAlternativeMmc3Irq = false;
|
|
|
|
|
|
2017-03-19 13:05:33 -04:00
|
|
|
|
[MinMax(0, 1000)] public UInt32 PpuExtraScanlinesBeforeNmi = 0;
|
|
|
|
|
[MinMax(0, 1000)] public UInt32 PpuExtraScanlinesAfterNmi = 0;
|
2016-06-21 18:58:22 -04:00
|
|
|
|
|
2016-08-24 20:48:14 -04:00
|
|
|
|
public RamPowerOnState RamPowerOnState;
|
|
|
|
|
|
2016-07-10 18:22:37 -04:00
|
|
|
|
public bool ShowLagCounter = false;
|
|
|
|
|
|
2017-09-03 10:54:31 -04:00
|
|
|
|
[MinMax(0, 5000)] public UInt32 EmulationSpeed = 100;
|
|
|
|
|
[MinMax(0, 5000)] public UInt32 TurboSpeed = 300;
|
|
|
|
|
[MinMax(0, 5000)] public UInt32 RewindSpeed = 100;
|
2019-12-24 13:46:10 -05:00
|
|
|
|
[MinMax(0, 10)] public UInt32 RunAheadFrames = 0;
|
2016-06-21 18:58:22 -04:00
|
|
|
|
|
|
|
|
|
public EmulationInfo()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static public void ApplyConfig()
|
|
|
|
|
{
|
|
|
|
|
EmulationInfo emulationInfo = ConfigManager.Config.EmulationInfo;
|
|
|
|
|
|
|
|
|
|
InteropEmu.SetEmulationSpeed(emulationInfo.EmulationSpeed);
|
2017-04-28 19:54:58 -04:00
|
|
|
|
InteropEmu.SetTurboRewindSpeed(emulationInfo.TurboSpeed, emulationInfo.RewindSpeed);
|
2019-12-24 13:46:10 -05:00
|
|
|
|
InteropEmu.SetRunAheadFrames(emulationInfo.RunAheadFrames);
|
2016-06-21 18:58:22 -04:00
|
|
|
|
|
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.Mmc3IrqAltBehavior, emulationInfo.UseAlternativeMmc3Irq);
|
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.AllowInvalidInput, emulationInfo.AllowInvalidInput);
|
2016-07-10 18:22:37 -04:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.ShowLagCounter, emulationInfo.ShowLagCounter);
|
2017-02-22 20:41:58 -05:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.DisablePpu2004Reads, emulationInfo.DisablePpu2004Reads);
|
2017-02-24 21:43:42 -05:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.DisablePaletteRead, emulationInfo.DisablePaletteRead);
|
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.DisableOamAddrBug, emulationInfo.DisableOamAddrBug);
|
2017-02-24 23:06:13 -05:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.DisablePpuReset, emulationInfo.DisablePpuReset);
|
2017-04-08 14:13:10 -04:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.EnableOamDecay, emulationInfo.EnableOamDecay);
|
2017-02-25 10:56:38 -05:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.UseNes101Hvc101Behavior, emulationInfo.UseNes101Hvc101Behavior);
|
2018-04-14 22:12:05 -04:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.RandomizeMapperPowerOnState, emulationInfo.EnableMapperRandomPowerOnState);
|
2019-11-10 17:35:29 -05:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.RandomizeCpuPpuAlignment, emulationInfo.RandomizeCpuPpuAlignment);
|
2019-11-12 21:00:30 -05:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.EnablePpu2000ScrollGlitch, emulationInfo.EnablePpu2000ScrollGlitch);
|
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.EnablePpu2006ScrollGlitch, emulationInfo.EnablePpu2006ScrollGlitch);
|
2020-04-30 18:40:39 -04:00
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.EnablePpuOamRowCorruption, emulationInfo.EnablePpuOamRowCorruption);
|
2016-06-21 18:58:22 -04:00
|
|
|
|
|
|
|
|
|
InteropEmu.SetPpuNmiConfig(emulationInfo.PpuExtraScanlinesBeforeNmi, emulationInfo.PpuExtraScanlinesAfterNmi);
|
2016-08-24 20:48:14 -04:00
|
|
|
|
|
|
|
|
|
InteropEmu.SetRamPowerOnState(emulationInfo.RamPowerOnState);
|
2016-06-21 18:58:22 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|