psx - add option (defaults to disabled) to use mednafen's error correction
This commit is contained in:
parent
c942350beb
commit
9df7a4d31b
|
@ -2023,7 +2023,8 @@
|
|||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>$(SolutionDir)Build\BizHawk.Build.Tool.exe NXCOMPAT --target $(TargetPath) --value 0</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">"$(SolutionDir)subwcrev.bat" "$(ProjectDir)"</PreBuildEvent>
|
||||
|
|
|
@ -2100,7 +2100,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
GlobalWin.OSD.AddMessage("Attempt to change sync-relevant settings while recording BLOCKED.");
|
||||
}
|
||||
else if (settable.HasSyncSettings && settable.PutSyncSettings(o))
|
||||
else if (settable.HasSyncSettings && settable.PutSyncSettings(o))
|
||||
{
|
||||
FlagNeedsReboot();
|
||||
}
|
||||
|
|
|
@ -62,6 +62,8 @@
|
|||
this.rbBobOffset = new System.Windows.Forms.RadioButton();
|
||||
this.rbBob = new System.Windows.Forms.RadioButton();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||
this.cbLEC = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
|
@ -70,13 +72,14 @@
|
|||
((System.ComponentModel.ISupportInitialize)(this.NTSC_LastLineNumeric)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NTSC_FirstLineNumeric)).BeginInit();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox5.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(622, 309);
|
||||
this.btnCancel.Location = new System.Drawing.Point(622, 370);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 3;
|
||||
|
@ -86,7 +89,7 @@
|
|||
// btnOk
|
||||
//
|
||||
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnOk.Location = new System.Drawing.Point(541, 309);
|
||||
this.btnOk.Location = new System.Drawing.Point(541, 370);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnOk.TabIndex = 2;
|
||||
|
@ -444,13 +447,36 @@
|
|||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Deinterlacing";
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox5.Controls.Add(this.cbLEC);
|
||||
this.groupBox5.Location = new System.Drawing.Point(12, 306);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(299, 85);
|
||||
this.groupBox5.TabIndex = 47;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Emulation";
|
||||
//
|
||||
// cbLEC
|
||||
//
|
||||
this.cbLEC.AutoSize = true;
|
||||
this.cbLEC.Location = new System.Drawing.Point(9, 19);
|
||||
this.cbLEC.Name = "cbLEC";
|
||||
this.cbLEC.Size = new System.Drawing.Size(222, 30);
|
||||
this.cbLEC.TabIndex = 0;
|
||||
this.cbLEC.Text = "Emulate Sector Error Correction\r\n(usually unneeded; breaks some patches)";
|
||||
this.cbLEC.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// PSXOptions
|
||||
//
|
||||
this.AcceptButton = this.btnOk;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(713, 344);
|
||||
this.ClientSize = new System.Drawing.Size(713, 405);
|
||||
this.Controls.Add(this.groupBox5);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
|
@ -473,6 +499,8 @@
|
|||
((System.ComponentModel.ISupportInitialize)(this.NTSC_FirstLineNumeric)).EndInit();
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -511,5 +539,7 @@
|
|||
private System.Windows.Forms.RadioButton rbWeave;
|
||||
private System.Windows.Forms.RadioButton rbBobOffset;
|
||||
private System.Windows.Forms.RadioButton rbBob;
|
||||
private System.Windows.Forms.GroupBox groupBox5;
|
||||
private System.Windows.Forms.CheckBox cbLEC;
|
||||
}
|
||||
}
|
|
@ -17,10 +17,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
//backups of the labels for string replacing
|
||||
string lblPixelPro_text, lblMednafen_text, lblTweakedMednafen_text;
|
||||
|
||||
public PSXOptions(Octoshock.Settings settings, OctoshockDll.eVidStandard vidStandard, Size currentVideoSize)
|
||||
public PSXOptions(Octoshock.Settings settings, Octoshock.SyncSettings syncSettings, OctoshockDll.eVidStandard vidStandard, Size currentVideoSize)
|
||||
{
|
||||
InitializeComponent();
|
||||
_settings = settings;
|
||||
_syncSettings = syncSettings;
|
||||
_previewVideoStandard = vidStandard;
|
||||
_previewVideoSize = currentVideoSize;
|
||||
|
||||
|
@ -40,6 +41,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
rbClipBasic.Checked = _settings.HorizontalClipping == Octoshock.eHorizontalClipping.Basic;
|
||||
rbClipToFramebuffer.Checked = _settings.HorizontalClipping == Octoshock.eHorizontalClipping.Framebuffer;
|
||||
|
||||
cbLEC.Checked = _syncSettings.EnableLEC;
|
||||
|
||||
rbWeave.Checked = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.Weave;
|
||||
rbBob.Checked = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.Bob;
|
||||
rbBobOffset.Checked = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.BobOffset;
|
||||
|
@ -53,6 +56,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Size _previewVideoSize;
|
||||
OctoshockDll.eVidStandard _previewVideoStandard;
|
||||
Octoshock.Settings _settings;
|
||||
Octoshock.SyncSettings _syncSettings;
|
||||
bool _dispSettingsSet = false;
|
||||
|
||||
private void btnNiceDisplayConfig_Click(object sender, EventArgs e)
|
||||
|
@ -68,13 +72,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
var ss = psx.GetSyncSettings();
|
||||
var vid = psx.SystemVidStandard;
|
||||
var size = psx.CurrentVideoSize;
|
||||
var dlg = new PSXOptions(s,vid,size);
|
||||
var dlg = new PSXOptions(s,ss,vid,size);
|
||||
|
||||
var result = dlg.ShowDialog(owner);
|
||||
return result;
|
||||
}
|
||||
|
||||
void SyncSettingsFromGui(Octoshock.Settings settings)
|
||||
void SyncSettingsFromGui(Octoshock.Settings settings, Octoshock.SyncSettings syncSettings)
|
||||
{
|
||||
if (rbPixelPro.Checked) settings.ResolutionMode = Octoshock.eResolutionMode.PixelPro;
|
||||
if (rbDebugMode.Checked) settings.ResolutionMode = Octoshock.eResolutionMode.Debug;
|
||||
|
@ -93,6 +97,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
settings.ScanlineEnd_NTSC = (int)NTSC_LastLineNumeric.Value;
|
||||
settings.ScanlineStart_PAL = (int)PAL_FirstLineNumeric.Value;
|
||||
settings.ScanlineEnd_PAL = (int)PAL_LastLineNumeric.Value;
|
||||
|
||||
syncSettings.EnableLEC = cbLEC.Checked;
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
|
@ -105,9 +111,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
Global.Config.DispFinalFilter = 1; //bilinear, I hope
|
||||
}
|
||||
|
||||
SyncSettingsFromGui(_settings);
|
||||
SyncSettingsFromGui(_settings, _syncSettings);
|
||||
_settings.Validate();
|
||||
GlobalWin.MainForm.PutCoreSettings(_settings);
|
||||
GlobalWin.MainForm.PutCoreSyncSettings(_syncSettings);
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
|
@ -125,7 +132,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
void SyncLabels()
|
||||
{
|
||||
var temp = _settings.Clone();
|
||||
SyncSettingsFromGui(temp);
|
||||
var syncTemp = _syncSettings.Clone();
|
||||
SyncSettingsFromGui(temp, syncTemp);
|
||||
_settings.Validate();
|
||||
|
||||
//actually, I think this is irrelevant. But it's nice in case we want to do some kind of a more detailed simulation later
|
||||
|
|
|
@ -151,7 +151,4 @@ fit gracefully in a 800x480 window.
|
|||
Using this option may result in objectionable levels of black bars, but will fix some rare quirks in games.
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -690,6 +690,8 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
|
|||
|
||||
SetInput();
|
||||
|
||||
OctoshockDll.shock_SetLEC(psx, _SyncSettings.EnableLEC);
|
||||
|
||||
var ropts = new OctoshockDll.ShockRenderOptions()
|
||||
{
|
||||
scanline_start = SystemVidStandard == OctoshockDll.eVidStandard.NTSC ? _Settings.ScanlineStart_NTSC : _Settings.ScanlineStart_PAL,
|
||||
|
@ -1057,6 +1059,8 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
|
|||
return ret;
|
||||
}
|
||||
|
||||
public bool EnableLEC;
|
||||
|
||||
public ControllerSetting[] Controllers =
|
||||
{
|
||||
new ControllerSetting
|
||||
|
@ -1186,17 +1190,22 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
|
|||
{
|
||||
_Settings.Validate();
|
||||
_Settings = o;
|
||||
//TODO
|
||||
//var native = _Settings.GetNativeSettings();
|
||||
//BizSwan.bizswan_putsettings(Core, ref native);
|
||||
|
||||
//TODO - store settings into core? or we can just keep doing it before frameadvance
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool PutSyncSettings(SyncSettings o)
|
||||
{
|
||||
var ret = !DeepEquality.DeepEquals(_SyncSettings, o);
|
||||
//check for reboot-required options (well, none right now)
|
||||
bool reboot = false;
|
||||
|
||||
_SyncSettings = o;
|
||||
return ret;
|
||||
|
||||
//TODO - store settings into core? or we can just keep doing it before frameadvance
|
||||
|
||||
return reboot;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -272,5 +272,8 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
|
|||
|
||||
[DllImport(dd, CallingConvention = cc)]
|
||||
public static extern int shock_SetTraceCallback(IntPtr psx, IntPtr opaque, ShockTraceCallback callback);
|
||||
|
||||
[DllImport(dd, CallingConvention = cc)]
|
||||
public static extern int shock_SetLEC(IntPtr psx, bool enable);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue