2016-06-21 18:58:22 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using Mesen.GUI.Config;
|
|
|
|
|
using Mesen.GUI.GoogleDriveIntegration;
|
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Forms.Config
|
|
|
|
|
{
|
|
|
|
|
public partial class frmEmulationConfig : BaseConfigForm
|
|
|
|
|
{
|
|
|
|
|
public frmEmulationConfig()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
Entity = ConfigManager.Config.EmulationInfo;
|
|
|
|
|
|
|
|
|
|
AddBinding("EmulationSpeed", nudEmulationSpeed);
|
2016-09-02 19:36:37 -04:00
|
|
|
|
AddBinding("TurboSpeed", nudTurboSpeed);
|
2016-06-21 18:58:22 -04:00
|
|
|
|
|
|
|
|
|
AddBinding("UseAlternativeMmc3Irq", chkUseAlternativeMmc3Irq);
|
|
|
|
|
AddBinding("AllowInvalidInput", chkAllowInvalidInput);
|
|
|
|
|
AddBinding("RemoveSpriteLimit", chkRemoveSpriteLimit);
|
|
|
|
|
|
|
|
|
|
AddBinding("OverclockRate", nudOverclockRate);
|
|
|
|
|
AddBinding("OverclockAdjustApu", chkOverclockAdjustApu);
|
|
|
|
|
|
|
|
|
|
AddBinding("PpuExtraScanlinesBeforeNmi", nudExtraScanlinesBeforeNmi);
|
|
|
|
|
AddBinding("PpuExtraScanlinesAfterNmi", nudExtraScanlinesAfterNmi);
|
2016-07-10 18:22:37 -04:00
|
|
|
|
|
2016-08-24 17:32:22 -04:00
|
|
|
|
AddBinding("ShowLagCounter", chkShowLagCounter);
|
|
|
|
|
|
|
|
|
|
AddBinding("RamPowerOnState", cboRamPowerOnState);
|
2016-06-21 18:58:22 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnFormClosed(FormClosedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnFormClosed(e);
|
|
|
|
|
EmulationInfo.ApplyConfig();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void tmrUpdateClockRate_Tick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
decimal clockRateMultiplierNtsc = (nudOverclockRate.Value * (1 + (nudExtraScanlinesAfterNmi.Value + nudExtraScanlinesBeforeNmi.Value) / 262));
|
|
|
|
|
decimal clockRateMultiplierPal = (nudOverclockRate.Value * (1 + (nudExtraScanlinesAfterNmi.Value + nudExtraScanlinesBeforeNmi.Value) / 312));
|
2016-07-09 09:25:01 -04:00
|
|
|
|
decimal clockRateMultiplierDendy = (nudOverclockRate.Value * (1 + (nudExtraScanlinesAfterNmi.Value + nudExtraScanlinesBeforeNmi.Value) / 312));
|
2016-06-21 18:58:22 -04:00
|
|
|
|
lblEffectiveClockRateValue.Text = (1789773 * clockRateMultiplierNtsc / 100000000).ToString("#.####") + " mhz (" + ((int)clockRateMultiplierNtsc).ToString() + "%)";
|
|
|
|
|
lblEffectiveClockRateValuePal.Text = (1662607 * clockRateMultiplierPal / 100000000).ToString("#.####") + " mhz (" + ((int)clockRateMultiplierPal).ToString() + "%)";
|
2016-07-09 09:25:01 -04:00
|
|
|
|
lblEffectiveClockRateValueDendy.Text = (1773448 * clockRateMultiplierDendy / 100000000).ToString("#.####") + " mhz (" + ((int)clockRateMultiplierDendy).ToString() + "%)";
|
2016-06-21 18:58:22 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OverclockConfig_Validated(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if(string.IsNullOrWhiteSpace(nudExtraScanlinesAfterNmi.Text)) {
|
|
|
|
|
nudExtraScanlinesAfterNmi.Value = 0;
|
|
|
|
|
}
|
|
|
|
|
if(string.IsNullOrWhiteSpace(nudExtraScanlinesBeforeNmi.Text)) {
|
|
|
|
|
nudExtraScanlinesBeforeNmi.Value = 0;
|
|
|
|
|
}
|
|
|
|
|
if(string.IsNullOrWhiteSpace(nudOverclockRate.Text)) {
|
|
|
|
|
nudOverclockRate.Value = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-07-10 18:22:37 -04:00
|
|
|
|
|
|
|
|
|
private void btnResetLagCounter_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.ResetLagCounter();
|
|
|
|
|
}
|
2016-06-21 18:58:22 -04:00
|
|
|
|
}
|
|
|
|
|
}
|