1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-25 22:09:35 +00:00

Add "buffer swap mode" option to GUI.

This commit is contained in:
Sergey Lipskiy 2015-12-14 21:47:54 +06:00
parent 2f4abc2bd9
commit aeda4bf410
3 changed files with 56 additions and 25 deletions

View File

@ -114,6 +114,7 @@ void ConfigDialog::_init()
ui->enableShadersStorageCheckBox->setChecked(config.generalEmulation.enableShadersStorage != 0);
ui->customSettingsCheckBox->setChecked(config.generalEmulation.enableCustomSettings != 0);
ui->bufferSwapComboBox->setCurrentIndex(config.frameBufferEmulation.bufferSwapMode);
ui->frameBufferGroupBox->setChecked(config.frameBufferEmulation.enable != 0);
switch (config.frameBufferEmulation.copyToRDRAM) {
case Config::ctDisable:
@ -293,6 +294,7 @@ void ConfigDialog::accept()
config.generalEmulation.enableShadersStorage = ui->enableShadersStorageCheckBox->isChecked() ? 1 : 0;
config.generalEmulation.enableCustomSettings = ui->customSettingsCheckBox->isChecked() ? 1 : 0;
config.frameBufferEmulation.bufferSwapMode = ui->bufferSwapComboBox->currentIndex();
config.frameBufferEmulation.enable = ui->frameBufferGroupBox->isChecked() ? 1 : 0;
if (ui->copyBufferDisableRadioButton->isChecked())
config.frameBufferEmulation.copyToRDRAM = Config::ctDisable;

View File

@ -51,6 +51,8 @@ void _loadSettings(QSettings & settings)
config.frameBufferEmulation.copyFromRDRAM = settings.value("copyFromRDRAM", config.frameBufferEmulation.copyFromRDRAM).toInt();
config.frameBufferEmulation.N64DepthCompare = settings.value("N64DepthCompare", config.frameBufferEmulation.N64DepthCompare).toInt();
config.frameBufferEmulation.aspect = settings.value("aspect", config.frameBufferEmulation.aspect).toInt();
config.frameBufferEmulation.bufferSwapMode = settings.value("bufferSwapMode", config.frameBufferEmulation.bufferSwapMode).toInt();
settings.endGroup();
settings.beginGroup("textureFilter");
@ -153,6 +155,7 @@ void writeSettings(const QString & _strIniFolder)
settings.setValue("copyFromRDRAM", config.frameBufferEmulation.copyFromRDRAM);
settings.setValue("N64DepthCompare", config.frameBufferEmulation.N64DepthCompare);
settings.setValue("aspect", config.frameBufferEmulation.aspect);
settings.setValue("bufferSwapMode", config.frameBufferEmulation.bufferSwapMode);
settings.endGroup();
settings.beginGroup("textureFilter");

View File

@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>372</width>
<height>531</height>
<width>493</width>
<height>612</height>
</rect>
</property>
<property name="sizePolicy">
@ -640,6 +640,42 @@
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<layout class="QHBoxLayout" name="bufferSwapHorizontalLayout">
<item>
<widget class="QLabel" name="label_24">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Buffer swap mode:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;With this option you may control how often plugin will update main frame buffer. There are three modes:&lt;/p&gt;&lt;p&gt;* on Vertical Interrupt. Number of buffer updates will be equal to Vertical Interrupts per Second (VI/s). VI/s is 50 for PAL and 60 for NTSC games. This is most compatible option. Use it if your system can handle it.&lt;/p&gt;&lt;p&gt;* on Video Interface origin change. The origin change means that game switched to another color buffer and buffers swap needed. This mode corresponds to Frames Per Seconds (FPS). FPS is between 20 and 30 for most games, thus buffers swap less often than in the first mode. This mode works well if game uses double or triple buffering. If game uses single buffer (very rare case), it does not work.&lt;/p&gt;&lt;p&gt;* on color image change. Buffers will swap only if frame buffer is actually modified. This mode is optimal for performance because it eliminates empty swaps. However, there are rare cases, where it does not work.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Buffer swap mode:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="bufferSwapComboBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Buffer swap mode:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;With this option you may control how often plugin will update main frame buffer. There are three modes:&lt;/p&gt;&lt;p&gt;* on Vertical Interrupt. Number of buffer updates will be equal to Vertical Interrupts per Second (VI/s). VI/s is 50 for PAL and 60 for NTSC games. This is most compatible option. Use it if your system can handle it.&lt;/p&gt;&lt;p&gt;* on Video Interface origin change. The origin change means that game switched to another color buffer and buffers swap needed. This mode corresponds to Frames Per Seconds (FPS). FPS is between 20 and 30 for most games, thus buffers swap less often than in the first mode. This mode works well if game uses double or triple buffering. If game uses single buffer (very rare case), it does not work.&lt;/p&gt;&lt;p&gt;* on color image change. Buffers will swap only if frame buffer is actually modified. This mode is optimal for performance because it eliminates empty swaps. However, there are rare cases, where it does not work.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>On Vertical Interrupt</string>
</property>
</item>
<item>
<property name="text">
<string>On VI origin change</string>
</property>
</item>
<item>
<property name="text">
<string>On color buffer change</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
@ -693,26 +729,6 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="RenderFBCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Render N64 frame buffer as texture:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;When this option is enabled, content of each N64 frame buffer is rendered as texture over the frame, rendered by the plugin. This prevents graphics lost, but may cause slowdowns and various glitches in some games.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;mostly off&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Render frame buffer as texture</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="detectCPUWritesCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Detect CPU write to the N64 frame buffer:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This option works as the previous options, but the plugin is trying to detect, when game uses CPU writes to N64 frame buffer. The N64 frame buffer is rendered only when CPU writes is detected. Use this option for those games, in which you see still image or no image at all for some time with no reason.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;mostly off&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Detect CPU writes to the frame buffer</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CopyDepthCheckBox">
<property name="toolTip">
@ -723,6 +739,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="RenderFBCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Render N64 frame buffer as texture:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;When this option is enabled, content of each N64 frame buffer is rendered as texture over the frame, rendered by the plugin. This prevents graphics lost, but may cause slowdowns and various glitches in some games.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;mostly off&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Render frame buffer as texture</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="n64DepthCompareCheckBox">
<property name="toolTip">
@ -1386,10 +1412,10 @@
</connection>
</connections>
<buttongroups>
<buttongroup name="bilinearButtonGroup"/>
<buttongroup name="screenshotButtonGroup"/>
<buttongroup name="bloomBlendModeButtonGroup"/>
<buttongroup name="aspectButtonGroup"/>
<buttongroup name="screenshotButtonGroup"/>
<buttongroup name="bilinearButtonGroup"/>
<buttongroup name="bloomBlendModeButtonGroup"/>
<buttongroup name="copyFrameBufferButtonGroup"/>
</buttongroups>
</ui>