diff --git a/Core/EmulationSettings.h b/Core/EmulationSettings.h index 0d93ec45..44aa4506 100644 --- a/Core/EmulationSettings.h +++ b/Core/EmulationSettings.h @@ -46,6 +46,7 @@ enum EmulationFlags : uint64_t EnableOamDecay = 0x80000000, UseNes101Hvc101Behavior = 0x100000000, + ShowFrameCounter = 0x200000000, Turbo = 0x2000000000, InBackground = 0x4000000000, diff --git a/Core/MessageManager.cpp b/Core/MessageManager.cpp index 8e5f0386..0298a09a 100644 --- a/Core/MessageManager.cpp +++ b/Core/MessageManager.cpp @@ -36,6 +36,7 @@ std::unordered_map MessageManager::_enResources = { { "CouldNotLoadFile", u8"Could not load file: %1" }, { "EmulationMaximumSpeed", u8"Maximum speed" }, { "EmulationSpeedPercent", u8"%1%" }, + { "Frame", u8"Frame" }, { "GameCrash", u8"Game has crashed (%1)" }, { "Lag", u8"Lag" }, { "Mapper", u8"Mapper: %1, SubMapper: %2" }, @@ -104,6 +105,7 @@ std::unordered_map MessageManager::_frResources = { { "CouldNotLoadFile", u8"Impossible de charger le fichier : %1" }, { "EmulationMaximumSpeed", u8"Vitesse maximale" }, { "EmulationSpeedPercent", u8"%1%" }, + { "Frame", u8"Image" }, { "GameCrash", u8"Le jeu a planté (%1)" }, { "Lag", u8"Lag" }, { "Mapper", u8"Mapper : %1, SubMapper : %2" }, @@ -172,6 +174,7 @@ std::unordered_map MessageManager::_jaResources = { { "CouldNotLoadFile", u8"ファイルをロードできませんでした: %1" }, { "EmulationMaximumSpeed", u8"最高速度" }, { "EmulationSpeedPercent", u8"%1%" }, + { "Frame", u8"フレーム" }, { "GameCrash", u8"ゲームは停止しました (%1)" }, { "Lag", u8"ラグ" }, { "Mapper", u8"Mapper: %1, SubMapper: %2" }, @@ -240,6 +243,7 @@ std::unordered_map MessageManager::_ruResources = { { "CouldNotLoadFile", u8"Не удалось загрузить файл: %1" }, { "EmulationMaximumSpeed", u8"Максимальная скорость" }, { "EmulationSpeedPercent", u8"%1%" }, + { "Frame", u8"Frame" }, { "GameCrash", u8"Игра была аварийно завершена (%1)" }, { "Lag", u8"Лаг" }, { "Mapper", u8"Mapper: %1, SubMapper: %2" }, @@ -308,6 +312,7 @@ std::unordered_map MessageManager::_esResources = { { "CouldNotLoadFile", u8"No se puede cargar el archivo: %1" }, { "EmulationMaximumSpeed", u8"Velocidad Máxima" }, { "EmulationSpeedPercent", u8"%1%" }, + { "Frame", u8"Frame" }, { "GameCrash", u8"El juego se ha colgado (%1)" }, { "Lag", u8"Lag" }, { "Mapper", u8"Mapeado: %1, SubMapeado: %2" }, @@ -377,6 +382,7 @@ std::unordered_map MessageManager::_ukResources = { { "CouldNotLoadFile", u8"Не вдалося завантажити файл: %1" }, { "EmulationMaximumSpeed", u8"Максимальна швидкiсть" }, { "EmulationSpeedPercent", u8"%1%" }, + { "Frame", u8"Frame" }, { "GameCrash", u8"Гра була аварійно завершена (%1)" }, { "Lag", u8"Лаг" }, { "Mapper", u8"Mapper: %1, SubMapper: %2" }, @@ -445,6 +451,7 @@ std::unordered_map MessageManager::_ptResources = { { "CouldNotLoadFile", u8"Não foi possível carregar o arquivo: %1" }, { "EmulationMaximumSpeed", u8"Velocidade Máxima" }, { "EmulationSpeedPercent", u8"%1%" }, + { "Frame", u8"Frame" }, { "GameCrash", u8"O jogo crashou (%1)" }, { "Lag", u8"Lag" }, { "Mapper", u8"Mapeado: %1, SubMapeado: %2" }, diff --git a/GUI.NET/Config/EmulationInfo.cs b/GUI.NET/Config/EmulationInfo.cs index b7447cca..2eedd522 100644 --- a/GUI.NET/Config/EmulationInfo.cs +++ b/GUI.NET/Config/EmulationInfo.cs @@ -34,6 +34,7 @@ namespace Mesen.GUI.Config public RamPowerOnState RamPowerOnState; public bool ShowLagCounter = false; + public bool ShowFrameCounter = false; [MinMax(0, 500)] public UInt32 EmulationSpeed = 100; [MinMax(0, 500)] public UInt32 TurboSpeed = 300; @@ -54,6 +55,7 @@ namespace Mesen.GUI.Config InteropEmu.SetFlag(EmulationFlags.AllowInvalidInput, emulationInfo.AllowInvalidInput); InteropEmu.SetFlag(EmulationFlags.RemoveSpriteLimit, emulationInfo.RemoveSpriteLimit); InteropEmu.SetFlag(EmulationFlags.ShowLagCounter, emulationInfo.ShowLagCounter); + InteropEmu.SetFlag(EmulationFlags.ShowFrameCounter, emulationInfo.ShowFrameCounter); InteropEmu.SetFlag(EmulationFlags.DisablePpu2004Reads, emulationInfo.DisablePpu2004Reads); InteropEmu.SetFlag(EmulationFlags.DisablePaletteRead, emulationInfo.DisablePaletteRead); InteropEmu.SetFlag(EmulationFlags.DisableOamAddrBug, emulationInfo.DisableOamAddrBug); diff --git a/GUI.NET/Dependencies/resources.es.xml b/GUI.NET/Dependencies/resources.es.xml index ed78bb48..45eee431 100644 --- a/GUI.NET/Dependencies/resources.es.xml +++ b/GUI.NET/Dependencies/resources.es.xml @@ -293,6 +293,7 @@ Rewind Speed: Avanzado + Show Frame Counter Utilizar la versión alternativa de componentes de IRQs de MMC3 Permitir las entradas inválidas (Arriba+Abajo e Izquierda+Derecha al mismo tiempo) Estado inicial de la memoria durante el inicio: diff --git a/GUI.NET/Dependencies/resources.fr.xml b/GUI.NET/Dependencies/resources.fr.xml index b7d61cc7..ae16cbc3 100644 --- a/GUI.NET/Dependencies/resources.fr.xml +++ b/GUI.NET/Dependencies/resources.fr.xml @@ -294,6 +294,7 @@ Vitesse du rembobinage : Avancé + Afficher le compteur d'images Utiliser la version alternative du comportement des IRQs du MMC3 Permettre les entrées invalides (Bas+Haut ou Gauche+Droite en même temps) Éliminer la limite de sprites (Réduit le clignotement dans certains jeux) diff --git a/GUI.NET/Dependencies/resources.ja.xml b/GUI.NET/Dependencies/resources.ja.xml index d4e47b8a..8fa22623 100644 --- a/GUI.NET/Dependencies/resources.ja.xml +++ b/GUI.NET/Dependencies/resources.ja.xml @@ -294,6 +294,7 @@ 巻き戻しの速度: 詳細設定 + フレームカウンタを表示する MMC3AのIRQ仕様を使う コントローラでは不可能インプットを可能にする (同時に上と下や右と左) スプライトの制限を解除 (点滅を軽減する) diff --git a/GUI.NET/Dependencies/resources.pt.xml b/GUI.NET/Dependencies/resources.pt.xml index d8d22112..d620b786 100644 --- a/GUI.NET/Dependencies/resources.pt.xml +++ b/GUI.NET/Dependencies/resources.pt.xml @@ -293,6 +293,7 @@ Rewind Speed: Avançado + Show Frame Counter Utilizar a versão alternativa de componentes de IRQs de MMC3 Permitir as entradas inválidas (Cima+Baixo e Esquerda+Direita ao mesmo tempo) Estado inicial da memória durante o início: diff --git a/GUI.NET/Dependencies/resources.ru.xml b/GUI.NET/Dependencies/resources.ru.xml index e77416d1..723ae7cc 100644 --- a/GUI.NET/Dependencies/resources.ru.xml +++ b/GUI.NET/Dependencies/resources.ru.xml @@ -294,6 +294,7 @@ Rewind Speed: Расширенные + Show Frame Counter Использовать альтернативный IRQ MMC3 Разрешить недопустимые комбинации (Вниз+Вверх и Влево+Вправо) Содержимое ОЗУ при включении : diff --git a/GUI.NET/Dependencies/resources.uk.xml b/GUI.NET/Dependencies/resources.uk.xml index 4fa4bcfc..e46e0c64 100644 --- a/GUI.NET/Dependencies/resources.uk.xml +++ b/GUI.NET/Dependencies/resources.uk.xml @@ -294,6 +294,7 @@ Rewind Speed: Розширені + Show Frame Counter Використовувати альтернативний IRQ MMC3 Дозволити неприпустимі комбінації (Вниз+Вгору і Ліворуч+Вправо) Вміст ОЗУ при включенні : diff --git a/GUI.NET/Forms/Config/frmEmulationConfig.Designer.cs b/GUI.NET/Forms/Config/frmEmulationConfig.Designer.cs index 99f772d7..cf2ff07c 100644 --- a/GUI.NET/Forms/Config/frmEmulationConfig.Designer.cs +++ b/GUI.NET/Forms/Config/frmEmulationConfig.Designer.cs @@ -41,6 +41,10 @@ namespace Mesen.GUI.Forms.Config this.nudEmulationSpeed = new System.Windows.Forms.NumericUpDown(); this.lblEmuSpeedHint = new System.Windows.Forms.Label(); this.lblEmulationSpeed = new System.Windows.Forms.Label(); + this.lblRewindSpeed = new System.Windows.Forms.Label(); + this.flowLayoutPanel10 = new System.Windows.Forms.FlowLayoutPanel(); + this.nudRewindSpeed = new System.Windows.Forms.NumericUpDown(); + this.lblRewindSpeedHint = new System.Windows.Forms.Label(); this.tpgAdvanced = new System.Windows.Forms.TabPage(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.chkEnableOamDecay = new Mesen.GUI.Controls.ctrlRiskyOption(); @@ -84,10 +88,7 @@ namespace Mesen.GUI.Forms.Config this.chkShowLagCounter = new System.Windows.Forms.CheckBox(); this.btnResetLagCounter = new System.Windows.Forms.Button(); this.tmrUpdateClockRate = new System.Windows.Forms.Timer(this.components); - this.lblRewindSpeed = new System.Windows.Forms.Label(); - this.flowLayoutPanel10 = new System.Windows.Forms.FlowLayoutPanel(); - this.nudRewindSpeed = new System.Windows.Forms.NumericUpDown(); - this.lblRewindSpeedHint = new System.Windows.Forms.Label(); + this.chkShowFrameCounter = new System.Windows.Forms.CheckBox(); this.tabMain.SuspendLayout(); this.tpgGeneral.SuspendLayout(); this.tableLayoutPanel4.SuspendLayout(); @@ -95,6 +96,8 @@ namespace Mesen.GUI.Forms.Config ((System.ComponentModel.ISupportInitialize)(this.nudTurboSpeed)).BeginInit(); this.flowLayoutPanel6.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudEmulationSpeed)).BeginInit(); + this.flowLayoutPanel10.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudRewindSpeed)).BeginInit(); this.tpgAdvanced.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.flowLayoutPanel8.SuspendLayout(); @@ -112,8 +115,6 @@ namespace Mesen.GUI.Forms.Config ((System.ComponentModel.ISupportInitialize)(this.nudExtraScanlinesBeforeNmi)).BeginInit(); this.flowLayoutPanel2.SuspendLayout(); this.flowLayoutPanel7.SuspendLayout(); - this.flowLayoutPanel10.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nudRewindSpeed)).BeginInit(); this.SuspendLayout(); // // baseConfigPanel @@ -254,6 +255,50 @@ namespace Mesen.GUI.Forms.Config this.lblEmulationSpeed.TabIndex = 12; this.lblEmulationSpeed.Text = "Emulation Speed:"; // + // lblRewindSpeed + // + this.lblRewindSpeed.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblRewindSpeed.AutoSize = true; + this.lblRewindSpeed.Location = new System.Drawing.Point(3, 58); + this.lblRewindSpeed.Name = "lblRewindSpeed"; + this.lblRewindSpeed.Size = new System.Drawing.Size(80, 13); + this.lblRewindSpeed.TabIndex = 15; + this.lblRewindSpeed.Text = "Rewind Speed:"; + // + // flowLayoutPanel10 + // + this.flowLayoutPanel10.AutoSize = true; + this.flowLayoutPanel10.Controls.Add(this.nudRewindSpeed); + this.flowLayoutPanel10.Controls.Add(this.lblRewindSpeedHint); + this.flowLayoutPanel10.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel10.Location = new System.Drawing.Point(111, 52); + this.flowLayoutPanel10.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel10.Name = "flowLayoutPanel10"; + this.flowLayoutPanel10.Size = new System.Drawing.Size(408, 26); + this.flowLayoutPanel10.TabIndex = 16; + // + // nudRewindSpeed + // + this.nudRewindSpeed.Location = new System.Drawing.Point(3, 3); + this.nudRewindSpeed.Maximum = new decimal(new int[] { + 500, + 0, + 0, + 0}); + this.nudRewindSpeed.Name = "nudRewindSpeed"; + this.nudRewindSpeed.Size = new System.Drawing.Size(48, 20); + this.nudRewindSpeed.TabIndex = 1; + // + // lblRewindSpeedHint + // + this.lblRewindSpeedHint.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblRewindSpeedHint.AutoSize = true; + this.lblRewindSpeedHint.Location = new System.Drawing.Point(57, 6); + this.lblRewindSpeedHint.Name = "lblRewindSpeedHint"; + this.lblRewindSpeedHint.Size = new System.Drawing.Size(121, 13); + this.lblRewindSpeedHint.TabIndex = 2; + this.lblRewindSpeedHint.Text = "% (0 = Maximum speed)"; + // // tpgAdvanced // this.tpgAdvanced.Controls.Add(this.tableLayoutPanel1); @@ -269,20 +314,22 @@ namespace Mesen.GUI.Forms.Config // this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Controls.Add(this.chkEnableOamDecay, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.chkEnableOamDecay, 0, 4); this.tableLayoutPanel1.Controls.Add(this.chkRemoveSpriteLimit, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel8, 0, 9); - this.tableLayoutPanel1.Controls.Add(this.chkDisablePaletteRead, 0, 7); - this.tableLayoutPanel1.Controls.Add(this.chkDisableOamAddrBug, 0, 6); - this.tableLayoutPanel1.Controls.Add(this.chkDisablePpuReset, 0, 4); - this.tableLayoutPanel1.Controls.Add(this.chkDisablePpu2004Reads, 0, 5); - this.tableLayoutPanel1.Controls.Add(this.chkUseNes101Hvc101Behavior, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.chkAllowInvalidInput, 0, 8); - this.tableLayoutPanel1.Controls.Add(this.chkUseAlternativeMmc3Irq, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel8, 0, 10); + this.tableLayoutPanel1.Controls.Add(this.chkDisablePaletteRead, 0, 8); + this.tableLayoutPanel1.Controls.Add(this.chkDisableOamAddrBug, 0, 7); + this.tableLayoutPanel1.Controls.Add(this.chkDisablePpuReset, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.chkDisablePpu2004Reads, 0, 6); + this.tableLayoutPanel1.Controls.Add(this.chkUseNes101Hvc101Behavior, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.chkAllowInvalidInput, 0, 9); + this.tableLayoutPanel1.Controls.Add(this.chkUseAlternativeMmc3Irq, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.chkShowFrameCounter, 0, 1); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 11; + this.tableLayoutPanel1.RowCount = 12; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -301,7 +348,7 @@ namespace Mesen.GUI.Forms.Config // this.chkEnableOamDecay.AutoSize = true; this.chkEnableOamDecay.Checked = false; - this.chkEnableOamDecay.Location = new System.Drawing.Point(0, 69); + this.chkEnableOamDecay.Location = new System.Drawing.Point(0, 92); this.chkEnableOamDecay.Name = "chkEnableOamDecay"; this.chkEnableOamDecay.Size = new System.Drawing.Size(243, 23); this.chkEnableOamDecay.TabIndex = 9; @@ -322,7 +369,7 @@ namespace Mesen.GUI.Forms.Config this.flowLayoutPanel8.Controls.Add(this.lblRamPowerOnState); this.flowLayoutPanel8.Controls.Add(this.cboRamPowerOnState); this.flowLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel8.Location = new System.Drawing.Point(0, 207); + this.flowLayoutPanel8.Location = new System.Drawing.Point(0, 230); this.flowLayoutPanel8.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel8.Name = "flowLayoutPanel8"; this.flowLayoutPanel8.Size = new System.Drawing.Size(519, 27); @@ -351,7 +398,7 @@ namespace Mesen.GUI.Forms.Config // this.chkDisablePaletteRead.AutoSize = true; this.chkDisablePaletteRead.Checked = false; - this.chkDisablePaletteRead.Location = new System.Drawing.Point(0, 161); + this.chkDisablePaletteRead.Location = new System.Drawing.Point(0, 184); this.chkDisablePaletteRead.Name = "chkDisablePaletteRead"; this.chkDisablePaletteRead.Size = new System.Drawing.Size(248, 23); this.chkDisablePaletteRead.TabIndex = 6; @@ -361,7 +408,7 @@ namespace Mesen.GUI.Forms.Config // this.chkDisableOamAddrBug.AutoSize = true; this.chkDisableOamAddrBug.Checked = false; - this.chkDisableOamAddrBug.Location = new System.Drawing.Point(0, 138); + this.chkDisableOamAddrBug.Location = new System.Drawing.Point(0, 161); this.chkDisableOamAddrBug.Name = "chkDisableOamAddrBug"; this.chkDisableOamAddrBug.Size = new System.Drawing.Size(311, 23); this.chkDisableOamAddrBug.TabIndex = 5; @@ -371,7 +418,7 @@ namespace Mesen.GUI.Forms.Config // this.chkDisablePpuReset.AutoSize = true; this.chkDisablePpuReset.Checked = false; - this.chkDisablePpuReset.Location = new System.Drawing.Point(0, 92); + this.chkDisablePpuReset.Location = new System.Drawing.Point(0, 115); this.chkDisablePpuReset.Name = "chkDisablePpuReset"; this.chkDisablePpuReset.Size = new System.Drawing.Size(414, 23); this.chkDisablePpuReset.TabIndex = 7; @@ -381,7 +428,7 @@ namespace Mesen.GUI.Forms.Config // this.chkDisablePpu2004Reads.AutoSize = true; this.chkDisablePpu2004Reads.Checked = false; - this.chkDisablePpu2004Reads.Location = new System.Drawing.Point(0, 115); + this.chkDisablePpu2004Reads.Location = new System.Drawing.Point(0, 138); this.chkDisablePpu2004Reads.Name = "chkDisablePpu2004Reads"; this.chkDisablePpu2004Reads.Size = new System.Drawing.Size(341, 23); this.chkDisablePpu2004Reads.TabIndex = 4; @@ -390,7 +437,7 @@ namespace Mesen.GUI.Forms.Config // chkUseNes101Hvc101Behavior // this.chkUseNes101Hvc101Behavior.AutoSize = true; - this.chkUseNes101Hvc101Behavior.Location = new System.Drawing.Point(3, 26); + this.chkUseNes101Hvc101Behavior.Location = new System.Drawing.Point(3, 49); this.chkUseNes101Hvc101Behavior.Name = "chkUseNes101Hvc101Behavior"; this.chkUseNes101Hvc101Behavior.Size = new System.Drawing.Size(292, 17); this.chkUseNes101Hvc101Behavior.TabIndex = 8; @@ -402,7 +449,7 @@ namespace Mesen.GUI.Forms.Config this.chkAllowInvalidInput.AutoSize = true; this.chkAllowInvalidInput.Checked = false; this.chkAllowInvalidInput.Dock = System.Windows.Forms.DockStyle.Fill; - this.chkAllowInvalidInput.Location = new System.Drawing.Point(0, 184); + this.chkAllowInvalidInput.Location = new System.Drawing.Point(0, 207); this.chkAllowInvalidInput.Name = "chkAllowInvalidInput"; this.chkAllowInvalidInput.Size = new System.Drawing.Size(519, 23); this.chkAllowInvalidInput.TabIndex = 1; @@ -411,7 +458,7 @@ namespace Mesen.GUI.Forms.Config // chkUseAlternativeMmc3Irq // this.chkUseAlternativeMmc3Irq.AutoSize = true; - this.chkUseAlternativeMmc3Irq.Location = new System.Drawing.Point(3, 49); + this.chkUseAlternativeMmc3Irq.Location = new System.Drawing.Point(3, 72); this.chkUseAlternativeMmc3Irq.Name = "chkUseAlternativeMmc3Irq"; this.chkUseAlternativeMmc3Irq.Size = new System.Drawing.Size(197, 17); this.chkUseAlternativeMmc3Irq.TabIndex = 0; @@ -779,49 +826,15 @@ namespace Mesen.GUI.Forms.Config this.tmrUpdateClockRate.Enabled = true; this.tmrUpdateClockRate.Tick += new System.EventHandler(this.tmrUpdateClockRate_Tick); // - // lblRewindSpeed + // chkShowFrameCounter // - this.lblRewindSpeed.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblRewindSpeed.AutoSize = true; - this.lblRewindSpeed.Location = new System.Drawing.Point(3, 58); - this.lblRewindSpeed.Name = "lblRewindSpeed"; - this.lblRewindSpeed.Size = new System.Drawing.Size(80, 13); - this.lblRewindSpeed.TabIndex = 15; - this.lblRewindSpeed.Text = "Rewind Speed:"; - // - // flowLayoutPanel10 - // - this.flowLayoutPanel10.AutoSize = true; - this.flowLayoutPanel10.Controls.Add(this.nudRewindSpeed); - this.flowLayoutPanel10.Controls.Add(this.lblRewindSpeedHint); - this.flowLayoutPanel10.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel10.Location = new System.Drawing.Point(111, 52); - this.flowLayoutPanel10.Margin = new System.Windows.Forms.Padding(0); - this.flowLayoutPanel10.Name = "flowLayoutPanel10"; - this.flowLayoutPanel10.Size = new System.Drawing.Size(408, 26); - this.flowLayoutPanel10.TabIndex = 16; - // - // nudRewindSpeed - // - this.nudRewindSpeed.Location = new System.Drawing.Point(3, 3); - this.nudRewindSpeed.Maximum = new decimal(new int[] { - 500, - 0, - 0, - 0}); - this.nudRewindSpeed.Name = "nudRewindSpeed"; - this.nudRewindSpeed.Size = new System.Drawing.Size(48, 20); - this.nudRewindSpeed.TabIndex = 1; - // - // lblRewindSpeedHint - // - this.lblRewindSpeedHint.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblRewindSpeedHint.AutoSize = true; - this.lblRewindSpeedHint.Location = new System.Drawing.Point(57, 6); - this.lblRewindSpeedHint.Name = "lblRewindSpeedHint"; - this.lblRewindSpeedHint.Size = new System.Drawing.Size(121, 13); - this.lblRewindSpeedHint.TabIndex = 2; - this.lblRewindSpeedHint.Text = "% (0 = Maximum speed)"; + this.chkShowFrameCounter.AutoSize = true; + this.chkShowFrameCounter.Location = new System.Drawing.Point(3, 26); + this.chkShowFrameCounter.Name = "chkShowFrameCounter"; + this.chkShowFrameCounter.Size = new System.Drawing.Size(125, 17); + this.chkShowFrameCounter.TabIndex = 10; + this.chkShowFrameCounter.Text = "Show Frame Counter"; + this.chkShowFrameCounter.UseVisualStyleBackColor = true; // // frmEmulationConfig // @@ -848,6 +861,9 @@ namespace Mesen.GUI.Forms.Config this.flowLayoutPanel6.ResumeLayout(false); this.flowLayoutPanel6.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudEmulationSpeed)).EndInit(); + this.flowLayoutPanel10.ResumeLayout(false); + this.flowLayoutPanel10.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudRewindSpeed)).EndInit(); this.tpgAdvanced.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); @@ -874,9 +890,6 @@ namespace Mesen.GUI.Forms.Config this.flowLayoutPanel2.PerformLayout(); this.flowLayoutPanel7.ResumeLayout(false); this.flowLayoutPanel7.PerformLayout(); - this.flowLayoutPanel10.ResumeLayout(false); - this.flowLayoutPanel10.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.nudRewindSpeed)).EndInit(); this.ResumeLayout(false); } @@ -940,5 +953,6 @@ namespace Mesen.GUI.Forms.Config private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel10; private System.Windows.Forms.NumericUpDown nudRewindSpeed; private System.Windows.Forms.Label lblRewindSpeedHint; + private System.Windows.Forms.CheckBox chkShowFrameCounter; } } \ No newline at end of file diff --git a/GUI.NET/Forms/Config/frmEmulationConfig.cs b/GUI.NET/Forms/Config/frmEmulationConfig.cs index f36bfb6b..b6048592 100644 --- a/GUI.NET/Forms/Config/frmEmulationConfig.cs +++ b/GUI.NET/Forms/Config/frmEmulationConfig.cs @@ -25,6 +25,7 @@ namespace Mesen.GUI.Forms.Config AddBinding("TurboSpeed", nudTurboSpeed); AddBinding("RewindSpeed", nudRewindSpeed); + AddBinding("ShowFrameCounter", chkShowFrameCounter); AddBinding("UseAlternativeMmc3Irq", chkUseAlternativeMmc3Irq); AddBinding("AllowInvalidInput", chkAllowInvalidInput); AddBinding("RemoveSpriteLimit", chkRemoveSpriteLimit); diff --git a/GUI.NET/InteropEmu.cs b/GUI.NET/InteropEmu.cs index a562af73..463d12be 100644 --- a/GUI.NET/InteropEmu.cs +++ b/GUI.NET/InteropEmu.cs @@ -983,6 +983,7 @@ namespace Mesen.GUI EnableOamDecay = 0x80000000, UseNes101Hvc101Behavior = 0x100000000, + ShowFrameCounter = 0x200000000, Turbo = 0x2000000000, InBackground = 0x4000000000, diff --git a/Linux/BaseRenderer.cpp b/Linux/BaseRenderer.cpp index 4a77a8c6..8f4bb080 100644 --- a/Linux/BaseRenderer.cpp +++ b/Linux/BaseRenderer.cpp @@ -122,14 +122,27 @@ void BaseRenderer::ShowFpsCounter() } string fpsString = string("FPS: ") + std::to_string(_currentFPS) + " / " + std::to_string(_currentRenderedFPS); - DrawString(fpsString, (float)(_screenWidth - 120), 13, 250, 235, 215); + DrawString(fpsString, (float)(_screenWidth - 125), 13, 250, 235, 215); } void BaseRenderer::ShowLagCounter() { float yPos = EmulationSettings::CheckFlag(EmulationFlags::ShowFPS) ? 37.0f : 13.0f; string lagCounter = MessageManager::Localize("Lag") + ": " + std::to_string(Console::GetLagCounter()); - DrawString(lagCounter, (float)(_screenWidth - 120), yPos, 250, 235, 215); + DrawString(lagCounter, (float)(_screenWidth - 123), yPos, 250, 235, 215); +} + +void BaseRenderer::ShowFrameCounter() +{ + float yPos = 13.0f; + if(EmulationSettings::CheckFlag(EmulationFlags::ShowFPS)) { + yPos += 24.0f; + } + if(EmulationSettings::CheckFlag(EmulationFlags::ShowLagCounter)) { + yPos += 24.0f; + } + string lagCounter = MessageManager::Localize("Frame") + ": " + std::to_string(PPU::GetFrameCount()); + DrawString(lagCounter, (float)(_screenWidth - 146), yPos, 250, 235, 215); } bool BaseRenderer::IsMessageShown() diff --git a/Linux/BaseRenderer.h b/Linux/BaseRenderer.h index 622b6697..88bdcd5e 100644 --- a/Linux/BaseRenderer.h +++ b/Linux/BaseRenderer.h @@ -33,5 +33,6 @@ protected: virtual void DrawString(std::wstring message, int x, int y, uint8_t r = 255, uint8_t g = 255, uint8_t b = 255) = 0; void ShowFpsCounter(); - void ShowLagCounter(); + void ShowLagCounter(); + void ShowFrameCounter(); }; diff --git a/Linux/SdlRenderer.cpp b/Linux/SdlRenderer.cpp index c6374132..1fbb5228 100755 --- a/Linux/SdlRenderer.cpp +++ b/Linux/SdlRenderer.cpp @@ -133,6 +133,9 @@ void SdlRenderer::Render() if(EmulationSettings::CheckFlag(EmulationFlags::ShowLagCounter)) { ShowLagCounter(); } + if(EmulationSettings::CheckFlag(EmulationFlags::ShowFrameCounter)) { + ShowFrameCounter(); + } } DrawToasts(); diff --git a/Windows/Renderer.cpp b/Windows/Renderer.cpp index a641a4ae..3b83e852 100644 --- a/Windows/Renderer.cpp +++ b/Windows/Renderer.cpp @@ -2,6 +2,8 @@ #include "Renderer.h" #include "DirectXTK/SpriteBatch.h" #include "DirectXTK/SpriteFont.h" +#include "../Core/Console.h" +#include "../Core/PPU.h" #include "../Core/VideoRenderer.h" #include "../Core/VideoDecoder.h" #include "../Core/EmulationSettings.h" @@ -483,14 +485,27 @@ namespace NES } string fpsString = string("FPS: ") + std::to_string(_currentFPS) + " / " + std::to_string(_currentRenderedFPS); - DrawString(fpsString, (float)(_screenWidth - 120), 13, Colors::AntiqueWhite, 1.0f); + DrawString(fpsString, (float)(_screenWidth - 125), 13, Colors::AntiqueWhite, 1.0f); } void Renderer::ShowLagCounter() { float yPos = EmulationSettings::CheckFlag(EmulationFlags::ShowFPS) ? 37.0f : 13.0f; string lagCounter = MessageManager::Localize("Lag") + ": " + std::to_string(Console::GetLagCounter()); - DrawString(lagCounter, (float)(_screenWidth - 120), yPos, Colors::AntiqueWhite, 1.0f); + DrawString(lagCounter, (float)(_screenWidth - 123), yPos, Colors::AntiqueWhite, 1.0f); + } + + void Renderer::ShowFrameCounter() + { + float yPos = 13.0f; + if(EmulationSettings::CheckFlag(EmulationFlags::ShowFPS)) { + yPos += 24.0f; + } + if(EmulationSettings::CheckFlag(EmulationFlags::ShowLagCounter)) { + yPos += 24.0f; + } + string lagCounter = MessageManager::Localize("Frame") + ": " + std::to_string(PPU::GetFrameCount()); + DrawString(lagCounter, (float)(_screenWidth - 146), yPos, Colors::AntiqueWhite, 1.0f); } void Renderer::Render() @@ -518,6 +533,9 @@ namespace NES if(EmulationSettings::CheckFlag(EmulationFlags::ShowLagCounter)) { ShowLagCounter(); } + if(EmulationSettings::CheckFlag(EmulationFlags::ShowFrameCounter)) { + ShowFrameCounter(); + } } DrawToasts(); diff --git a/Windows/Renderer.h b/Windows/Renderer.h index ea269692..72092cbf 100644 --- a/Windows/Renderer.h +++ b/Windows/Renderer.h @@ -89,6 +89,7 @@ namespace NES { void ShowFpsCounter(); void ShowLagCounter(); + void ShowFrameCounter(); public: Renderer(HWND hWnd);