BSNES Region Override (#3169)

* region override for bsnes

* hook up SnesInitData right. still needs region override sync setting

* settings stuff, also need to make sure sameboy is using the right region for sgb

* and build

* clearer struct definition; move struct to header file

Co-authored-by: Morilli <35152647+Morilli@users.noreply.github.com>
This commit is contained in:
CasualPokePlayer 2022-03-04 05:21:53 -08:00 committed by GitHub
parent 8e233a0e3b
commit 114124c82e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 787 additions and 712 deletions

Binary file not shown.

View File

@ -28,324 +28,347 @@
/// </summary>
private void InitializeComponent()
{
this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.cbDoubleSize = new System.Windows.Forms.CheckBox();
this.lblDoubleSize = new BizHawk.WinForms.Controls.LocLabelEx();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblPriority1 = new BizHawk.WinForms.Controls.LocLabelEx();
this.lblPriority0 = new BizHawk.WinForms.Controls.LocLabelEx();
this.Bg4_0Checkbox = new System.Windows.Forms.CheckBox();
this.Bg3_0Checkbox = new System.Windows.Forms.CheckBox();
this.Bg2_0Checkbox = new System.Windows.Forms.CheckBox();
this.Bg1_0Checkbox = new System.Windows.Forms.CheckBox();
this.Bg4_1Checkbox = new System.Windows.Forms.CheckBox();
this.Bg3_1Checkbox = new System.Windows.Forms.CheckBox();
this.Bg2_1Checkbox = new System.Windows.Forms.CheckBox();
this.Bg1_1Checkbox = new System.Windows.Forms.CheckBox();
this.Obj4Checkbox = new System.Windows.Forms.CheckBox();
this.Obj3Checkbox = new System.Windows.Forms.CheckBox();
this.Obj2Checkbox = new System.Windows.Forms.CheckBox();
this.Obj1Checkbox = new System.Windows.Forms.CheckBox();
this.EntropyBox = new System.Windows.Forms.ComboBox();
this.lblEntropy = new BizHawk.WinForms.Controls.LocLabelEx();
this.cbGameHotfixes = new System.Windows.Forms.CheckBox();
this.cbFastPPU = new System.Windows.Forms.CheckBox();
this.cbCropSGBFrame = new System.Windows.Forms.CheckBox();
this.cbUseSGB2 = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// 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(136, 303);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 0;
this.btnOk.Text = "OK";
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.BtnOk_Click);
//
// 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(217, 303);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.BtnCancel_Click);
//
// cbDoubleSize
//
this.cbDoubleSize.AutoSize = true;
this.cbDoubleSize.Location = new System.Drawing.Point(18, 16);
this.cbDoubleSize.Name = "cbDoubleSize";
this.cbDoubleSize.Size = new System.Drawing.Size(178, 17);
this.cbDoubleSize.TabIndex = 6;
this.cbDoubleSize.Text = "Always Double-Size Framebuffer";
this.cbDoubleSize.UseVisualStyleBackColor = true;
//
// lblDoubleSize
//
this.lblDoubleSize.Location = new System.Drawing.Point(33, 34);
this.lblDoubleSize.MaximumSize = new System.Drawing.Size(260, 0);
this.lblDoubleSize.Name = "lblDoubleSize";
this.lblDoubleSize.Text = "Some games are changing the resolution constantly (e.g. SD3) so this option can f" +
"orce the SNES output to stay double-size always.";
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.lblPriority1);
this.groupBox1.Controls.Add(this.lblPriority0);
this.groupBox1.Controls.Add(this.Bg4_0Checkbox);
this.groupBox1.Controls.Add(this.Bg3_0Checkbox);
this.groupBox1.Controls.Add(this.Bg2_0Checkbox);
this.groupBox1.Controls.Add(this.Bg1_0Checkbox);
this.groupBox1.Controls.Add(this.Bg4_1Checkbox);
this.groupBox1.Controls.Add(this.Bg3_1Checkbox);
this.groupBox1.Controls.Add(this.Bg2_1Checkbox);
this.groupBox1.Controls.Add(this.Bg1_1Checkbox);
this.groupBox1.Controls.Add(this.Obj4Checkbox);
this.groupBox1.Controls.Add(this.Obj3Checkbox);
this.groupBox1.Controls.Add(this.Obj2Checkbox);
this.groupBox1.Controls.Add(this.Obj1Checkbox);
this.groupBox1.Location = new System.Drawing.Point(18, 165);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(274, 132);
this.groupBox1.TabIndex = 11;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Display";
//
// lblPriority1
//
this.lblPriority1.Location = new System.Drawing.Point(220, 14);
this.lblPriority1.MaximumSize = new System.Drawing.Size(100, 0);
this.lblPriority1.Name = "lblPriority1";
this.lblPriority1.Text = "Priority 1";
//
// lblPriority0
//
this.lblPriority0.Location = new System.Drawing.Point(162, 14);
this.lblPriority0.MaximumSize = new System.Drawing.Size(100, 0);
this.lblPriority0.Name = "lblPriority0";
this.lblPriority0.Text = "Priority 0";
this.lblPriority0.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Bg4_0Checkbox
//
this.Bg4_0Checkbox.AutoSize = true;
this.Bg4_0Checkbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Bg4_0Checkbox.Location = new System.Drawing.Point(128, 99);
this.Bg4_0Checkbox.Name = "Bg4_0Checkbox";
this.Bg4_0Checkbox.Size = new System.Drawing.Size(62, 17);
this.Bg4_0Checkbox.TabIndex = 11;
this.Bg4_0Checkbox.Text = "BG 4 ";
this.Bg4_0Checkbox.UseVisualStyleBackColor = true;
//
// Bg3_0Checkbox
//
this.Bg3_0Checkbox.AutoSize = true;
this.Bg3_0Checkbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Bg3_0Checkbox.Location = new System.Drawing.Point(128, 76);
this.Bg3_0Checkbox.Name = "Bg3_0Checkbox";
this.Bg3_0Checkbox.Size = new System.Drawing.Size(62, 17);
this.Bg3_0Checkbox.TabIndex = 10;
this.Bg3_0Checkbox.Text = "BG 3 ";
this.Bg3_0Checkbox.UseVisualStyleBackColor = true;
//
// Bg2_0Checkbox
//
this.Bg2_0Checkbox.AutoSize = true;
this.Bg2_0Checkbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Bg2_0Checkbox.Location = new System.Drawing.Point(128, 53);
this.Bg2_0Checkbox.Name = "Bg2_0Checkbox";
this.Bg2_0Checkbox.Size = new System.Drawing.Size(62, 17);
this.Bg2_0Checkbox.TabIndex = 9;
this.Bg2_0Checkbox.Text = "BG 2 ";
this.Bg2_0Checkbox.UseVisualStyleBackColor = true;
//
// Bg1_0Checkbox
//
this.Bg1_0Checkbox.AutoSize = true;
this.Bg1_0Checkbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Bg1_0Checkbox.Location = new System.Drawing.Point(128, 30);
this.Bg1_0Checkbox.Name = "Bg1_0Checkbox";
this.Bg1_0Checkbox.Size = new System.Drawing.Size(62, 17);
this.Bg1_0Checkbox.TabIndex = 8;
this.Bg1_0Checkbox.Text = "BG 1 ";
this.Bg1_0Checkbox.UseVisualStyleBackColor = true;
//
// Bg4_1Checkbox
//
this.Bg4_1Checkbox.AutoSize = true;
this.Bg4_1Checkbox.Location = new System.Drawing.Point(234, 100);
this.Bg4_1Checkbox.Name = "Bg4_1Checkbox";
this.Bg4_1Checkbox.Size = new System.Drawing.Size(15, 14);
this.Bg4_1Checkbox.TabIndex = 7;
this.Bg4_1Checkbox.UseVisualStyleBackColor = true;
//
// Bg3_1Checkbox
//
this.Bg3_1Checkbox.AutoSize = true;
this.Bg3_1Checkbox.Location = new System.Drawing.Point(234, 77);
this.Bg3_1Checkbox.Name = "Bg3_1Checkbox";
this.Bg3_1Checkbox.Size = new System.Drawing.Size(15, 14);
this.Bg3_1Checkbox.TabIndex = 6;
this.Bg3_1Checkbox.UseVisualStyleBackColor = true;
//
// Bg2_1Checkbox
//
this.Bg2_1Checkbox.AutoSize = true;
this.Bg2_1Checkbox.Location = new System.Drawing.Point(234, 54);
this.Bg2_1Checkbox.Name = "Bg2_1Checkbox";
this.Bg2_1Checkbox.Size = new System.Drawing.Size(15, 14);
this.Bg2_1Checkbox.TabIndex = 5;
this.Bg2_1Checkbox.UseVisualStyleBackColor = true;
//
// Bg1_1Checkbox
//
this.Bg1_1Checkbox.AutoSize = true;
this.Bg1_1Checkbox.Location = new System.Drawing.Point(234, 31);
this.Bg1_1Checkbox.Name = "Bg1_1Checkbox";
this.Bg1_1Checkbox.Size = new System.Drawing.Size(15, 14);
this.Bg1_1Checkbox.TabIndex = 4;
this.Bg1_1Checkbox.UseVisualStyleBackColor = true;
//
// Obj4Checkbox
//
this.Obj4Checkbox.AutoSize = true;
this.Obj4Checkbox.Location = new System.Drawing.Point(21, 99);
this.Obj4Checkbox.Name = "Obj4Checkbox";
this.Obj4Checkbox.Size = new System.Drawing.Size(55, 17);
this.Obj4Checkbox.TabIndex = 3;
this.Obj4Checkbox.Text = "OBJ 4";
this.Obj4Checkbox.UseVisualStyleBackColor = true;
//
// Obj3Checkbox
//
this.Obj3Checkbox.AutoSize = true;
this.Obj3Checkbox.Location = new System.Drawing.Point(21, 76);
this.Obj3Checkbox.Name = "Obj3Checkbox";
this.Obj3Checkbox.Size = new System.Drawing.Size(55, 17);
this.Obj3Checkbox.TabIndex = 2;
this.Obj3Checkbox.Text = "OBJ 3";
this.Obj3Checkbox.UseVisualStyleBackColor = true;
//
// Obj2Checkbox
//
this.Obj2Checkbox.AutoSize = true;
this.Obj2Checkbox.Location = new System.Drawing.Point(21, 53);
this.Obj2Checkbox.Name = "Obj2Checkbox";
this.Obj2Checkbox.Size = new System.Drawing.Size(55, 17);
this.Obj2Checkbox.TabIndex = 1;
this.Obj2Checkbox.Text = "OBJ 2";
this.Obj2Checkbox.UseVisualStyleBackColor = true;
//
// Obj1Checkbox
//
this.Obj1Checkbox.AutoSize = true;
this.Obj1Checkbox.Location = new System.Drawing.Point(21, 30);
this.Obj1Checkbox.Name = "Obj1Checkbox";
this.Obj1Checkbox.Size = new System.Drawing.Size(55, 17);
this.Obj1Checkbox.TabIndex = 0;
this.Obj1Checkbox.Text = "OBJ 1";
this.Obj1Checkbox.UseVisualStyleBackColor = true;
//
// EntropyBox
//
this.EntropyBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.EntropyBox.FormattingEnabled = true;
this.EntropyBox.Items.AddRange(new object[] {
"None",
"Low",
"High"});
this.EntropyBox.Location = new System.Drawing.Point(164, 138);
this.EntropyBox.Name = "EntropyBox";
this.EntropyBox.Size = new System.Drawing.Size(128, 21);
this.EntropyBox.TabIndex = 14;
//
// lblEntropy
//
this.lblEntropy.Location = new System.Drawing.Point(249, 117);
this.lblEntropy.Name = "lblEntropy";
this.lblEntropy.Text = "Entropy";
//
// cbGameHotfixes
//
this.cbGameHotfixes.AutoSize = true;
this.cbGameHotfixes.Location = new System.Drawing.Point(18, 111);
this.cbGameHotfixes.Name = "cbGameHotfixes";
this.cbGameHotfixes.Size = new System.Drawing.Size(93, 17);
this.cbGameHotfixes.TabIndex = 22;
this.cbGameHotfixes.Text = "Game hotfixes";
this.cbGameHotfixes.UseVisualStyleBackColor = true;
//
// cbFastPPU
//
this.cbFastPPU.AutoSize = true;
this.cbFastPPU.Location = new System.Drawing.Point(18, 138);
this.cbFastPPU.Name = "cbFastPPU";
this.cbFastPPU.Size = new System.Drawing.Size(90, 17);
this.cbFastPPU.TabIndex = 23;
this.cbFastPPU.Text = "Use fast PPU";
this.cbFastPPU.UseVisualStyleBackColor = true;
this.cbFastPPU.CheckedChanged += new System.EventHandler(this.FastPPU_CheckedChanged);
//
// cbCropSGBFrame
//
this.cbCropSGBFrame.AutoSize = true;
this.cbCropSGBFrame.Location = new System.Drawing.Point(18, 84);
this.cbCropSGBFrame.Name = "cbCropSGBFrame";
this.cbCropSGBFrame.Size = new System.Drawing.Size(105, 17);
this.cbCropSGBFrame.TabIndex = 27;
this.cbCropSGBFrame.Text = "Crop SGB Frame";
this.cbCropSGBFrame.UseVisualStyleBackColor = true;
//
// cbUseSGB2
//
this.cbUseSGB2.AutoSize = true;
this.cbUseSGB2.Location = new System.Drawing.Point(129, 84);
this.cbUseSGB2.Name = "cbUseSGB2";
this.cbUseSGB2.Size = new System.Drawing.Size(76, 17);
this.cbUseSGB2.TabIndex = 30;
this.cbUseSGB2.Text = "Use SGB2";
this.cbUseSGB2.UseVisualStyleBackColor = true;
//
// BSNESOptions
//
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(304, 338);
this.Controls.Add(this.cbUseSGB2);
this.Controls.Add(this.cbCropSGBFrame);
this.Controls.Add(this.cbFastPPU);
this.Controls.Add(this.cbGameHotfixes);
this.Controls.Add(this.lblEntropy);
this.Controls.Add(this.EntropyBox);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.lblDoubleSize);
this.Controls.Add(this.cbDoubleSize);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "BSNESOptions";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "BSNES Options";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.cbDoubleSize = new System.Windows.Forms.CheckBox();
this.lblDoubleSize = new BizHawk.WinForms.Controls.LocLabelEx();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblPriority1 = new BizHawk.WinForms.Controls.LocLabelEx();
this.lblPriority0 = new BizHawk.WinForms.Controls.LocLabelEx();
this.Bg4_0Checkbox = new System.Windows.Forms.CheckBox();
this.Bg3_0Checkbox = new System.Windows.Forms.CheckBox();
this.Bg2_0Checkbox = new System.Windows.Forms.CheckBox();
this.Bg1_0Checkbox = new System.Windows.Forms.CheckBox();
this.Bg4_1Checkbox = new System.Windows.Forms.CheckBox();
this.Bg3_1Checkbox = new System.Windows.Forms.CheckBox();
this.Bg2_1Checkbox = new System.Windows.Forms.CheckBox();
this.Bg1_1Checkbox = new System.Windows.Forms.CheckBox();
this.Obj4Checkbox = new System.Windows.Forms.CheckBox();
this.Obj3Checkbox = new System.Windows.Forms.CheckBox();
this.Obj2Checkbox = new System.Windows.Forms.CheckBox();
this.Obj1Checkbox = new System.Windows.Forms.CheckBox();
this.EntropyBox = new System.Windows.Forms.ComboBox();
this.lblEntropy = new BizHawk.WinForms.Controls.LocLabelEx();
this.RegionBox = new System.Windows.Forms.ComboBox();
this.lblRegion = new BizHawk.WinForms.Controls.LocLabelEx();
this.cbGameHotfixes = new System.Windows.Forms.CheckBox();
this.cbFastPPU = new System.Windows.Forms.CheckBox();
this.cbCropSGBFrame = new System.Windows.Forms.CheckBox();
this.cbUseSGB2 = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// 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(136, 321);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 0;
this.btnOk.Text = "OK";
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.BtnOk_Click);
//
// 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(217, 321);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.BtnCancel_Click);
//
// cbDoubleSize
//
this.cbDoubleSize.AutoSize = true;
this.cbDoubleSize.Location = new System.Drawing.Point(18, 16);
this.cbDoubleSize.Name = "cbDoubleSize";
this.cbDoubleSize.Size = new System.Drawing.Size(178, 17);
this.cbDoubleSize.TabIndex = 6;
this.cbDoubleSize.Text = "Always Double-Size Framebuffer";
this.cbDoubleSize.UseVisualStyleBackColor = true;
//
// lblDoubleSize
//
this.lblDoubleSize.Location = new System.Drawing.Point(33, 34);
this.lblDoubleSize.MaximumSize = new System.Drawing.Size(260, 0);
this.lblDoubleSize.Name = "lblDoubleSize";
this.lblDoubleSize.Text = "Some games are changing the resolution constantly (e.g. SD3) so this option can f" +
"orce the SNES output to stay double-size always.";
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.lblPriority1);
this.groupBox1.Controls.Add(this.lblPriority0);
this.groupBox1.Controls.Add(this.Bg4_0Checkbox);
this.groupBox1.Controls.Add(this.Bg3_0Checkbox);
this.groupBox1.Controls.Add(this.Bg2_0Checkbox);
this.groupBox1.Controls.Add(this.Bg1_0Checkbox);
this.groupBox1.Controls.Add(this.Bg4_1Checkbox);
this.groupBox1.Controls.Add(this.Bg3_1Checkbox);
this.groupBox1.Controls.Add(this.Bg2_1Checkbox);
this.groupBox1.Controls.Add(this.Bg1_1Checkbox);
this.groupBox1.Controls.Add(this.Obj4Checkbox);
this.groupBox1.Controls.Add(this.Obj3Checkbox);
this.groupBox1.Controls.Add(this.Obj2Checkbox);
this.groupBox1.Controls.Add(this.Obj1Checkbox);
this.groupBox1.Location = new System.Drawing.Point(18, 183);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(274, 132);
this.groupBox1.TabIndex = 11;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Display";
//
// lblPriority1
//
this.lblPriority1.Location = new System.Drawing.Point(220, 14);
this.lblPriority1.MaximumSize = new System.Drawing.Size(100, 0);
this.lblPriority1.Name = "lblPriority1";
this.lblPriority1.Text = "Priority 1";
//
// lblPriority0
//
this.lblPriority0.Location = new System.Drawing.Point(162, 14);
this.lblPriority0.MaximumSize = new System.Drawing.Size(100, 0);
this.lblPriority0.Name = "lblPriority0";
this.lblPriority0.Text = "Priority 0";
this.lblPriority0.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Bg4_0Checkbox
//
this.Bg4_0Checkbox.AutoSize = true;
this.Bg4_0Checkbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Bg4_0Checkbox.Location = new System.Drawing.Point(128, 99);
this.Bg4_0Checkbox.Name = "Bg4_0Checkbox";
this.Bg4_0Checkbox.Size = new System.Drawing.Size(62, 17);
this.Bg4_0Checkbox.TabIndex = 11;
this.Bg4_0Checkbox.Text = "BG 4 ";
this.Bg4_0Checkbox.UseVisualStyleBackColor = true;
//
// Bg3_0Checkbox
//
this.Bg3_0Checkbox.AutoSize = true;
this.Bg3_0Checkbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Bg3_0Checkbox.Location = new System.Drawing.Point(128, 76);
this.Bg3_0Checkbox.Name = "Bg3_0Checkbox";
this.Bg3_0Checkbox.Size = new System.Drawing.Size(62, 17);
this.Bg3_0Checkbox.TabIndex = 10;
this.Bg3_0Checkbox.Text = "BG 3 ";
this.Bg3_0Checkbox.UseVisualStyleBackColor = true;
//
// Bg2_0Checkbox
//
this.Bg2_0Checkbox.AutoSize = true;
this.Bg2_0Checkbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Bg2_0Checkbox.Location = new System.Drawing.Point(128, 53);
this.Bg2_0Checkbox.Name = "Bg2_0Checkbox";
this.Bg2_0Checkbox.Size = new System.Drawing.Size(62, 17);
this.Bg2_0Checkbox.TabIndex = 9;
this.Bg2_0Checkbox.Text = "BG 2 ";
this.Bg2_0Checkbox.UseVisualStyleBackColor = true;
//
// Bg1_0Checkbox
//
this.Bg1_0Checkbox.AutoSize = true;
this.Bg1_0Checkbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Bg1_0Checkbox.Location = new System.Drawing.Point(128, 30);
this.Bg1_0Checkbox.Name = "Bg1_0Checkbox";
this.Bg1_0Checkbox.Size = new System.Drawing.Size(62, 17);
this.Bg1_0Checkbox.TabIndex = 8;
this.Bg1_0Checkbox.Text = "BG 1 ";
this.Bg1_0Checkbox.UseVisualStyleBackColor = true;
//
// Bg4_1Checkbox
//
this.Bg4_1Checkbox.AutoSize = true;
this.Bg4_1Checkbox.Location = new System.Drawing.Point(234, 100);
this.Bg4_1Checkbox.Name = "Bg4_1Checkbox";
this.Bg4_1Checkbox.Size = new System.Drawing.Size(15, 14);
this.Bg4_1Checkbox.TabIndex = 7;
this.Bg4_1Checkbox.UseVisualStyleBackColor = true;
//
// Bg3_1Checkbox
//
this.Bg3_1Checkbox.AutoSize = true;
this.Bg3_1Checkbox.Location = new System.Drawing.Point(234, 77);
this.Bg3_1Checkbox.Name = "Bg3_1Checkbox";
this.Bg3_1Checkbox.Size = new System.Drawing.Size(15, 14);
this.Bg3_1Checkbox.TabIndex = 6;
this.Bg3_1Checkbox.UseVisualStyleBackColor = true;
//
// Bg2_1Checkbox
//
this.Bg2_1Checkbox.AutoSize = true;
this.Bg2_1Checkbox.Location = new System.Drawing.Point(234, 54);
this.Bg2_1Checkbox.Name = "Bg2_1Checkbox";
this.Bg2_1Checkbox.Size = new System.Drawing.Size(15, 14);
this.Bg2_1Checkbox.TabIndex = 5;
this.Bg2_1Checkbox.UseVisualStyleBackColor = true;
//
// Bg1_1Checkbox
//
this.Bg1_1Checkbox.AutoSize = true;
this.Bg1_1Checkbox.Location = new System.Drawing.Point(234, 31);
this.Bg1_1Checkbox.Name = "Bg1_1Checkbox";
this.Bg1_1Checkbox.Size = new System.Drawing.Size(15, 14);
this.Bg1_1Checkbox.TabIndex = 4;
this.Bg1_1Checkbox.UseVisualStyleBackColor = true;
//
// Obj4Checkbox
//
this.Obj4Checkbox.AutoSize = true;
this.Obj4Checkbox.Location = new System.Drawing.Point(21, 99);
this.Obj4Checkbox.Name = "Obj4Checkbox";
this.Obj4Checkbox.Size = new System.Drawing.Size(55, 17);
this.Obj4Checkbox.TabIndex = 3;
this.Obj4Checkbox.Text = "OBJ 4";
this.Obj4Checkbox.UseVisualStyleBackColor = true;
//
// Obj3Checkbox
//
this.Obj3Checkbox.AutoSize = true;
this.Obj3Checkbox.Location = new System.Drawing.Point(21, 76);
this.Obj3Checkbox.Name = "Obj3Checkbox";
this.Obj3Checkbox.Size = new System.Drawing.Size(55, 17);
this.Obj3Checkbox.TabIndex = 2;
this.Obj3Checkbox.Text = "OBJ 3";
this.Obj3Checkbox.UseVisualStyleBackColor = true;
//
// Obj2Checkbox
//
this.Obj2Checkbox.AutoSize = true;
this.Obj2Checkbox.Location = new System.Drawing.Point(21, 53);
this.Obj2Checkbox.Name = "Obj2Checkbox";
this.Obj2Checkbox.Size = new System.Drawing.Size(55, 17);
this.Obj2Checkbox.TabIndex = 1;
this.Obj2Checkbox.Text = "OBJ 2";
this.Obj2Checkbox.UseVisualStyleBackColor = true;
//
// Obj1Checkbox
//
this.Obj1Checkbox.AutoSize = true;
this.Obj1Checkbox.Location = new System.Drawing.Point(21, 30);
this.Obj1Checkbox.Name = "Obj1Checkbox";
this.Obj1Checkbox.Size = new System.Drawing.Size(55, 17);
this.Obj1Checkbox.TabIndex = 0;
this.Obj1Checkbox.Text = "OBJ 1";
this.Obj1Checkbox.UseVisualStyleBackColor = true;
//
// EntropyBox
//
this.EntropyBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.EntropyBox.FormattingEnabled = true;
this.EntropyBox.Items.AddRange(new object[] {
"None",
"Low",
"High"});
this.EntropyBox.Location = new System.Drawing.Point(18, 150);
this.EntropyBox.Name = "EntropyBox";
this.EntropyBox.Size = new System.Drawing.Size(128, 21);
this.EntropyBox.TabIndex = 14;
//
// lblEntropy
//
this.lblEntropy.Location = new System.Drawing.Point(15, 134);
this.lblEntropy.Name = "lblEntropy";
this.lblEntropy.Text = "Entropy";
//
// RegionBox
//
this.RegionBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.RegionBox.FormattingEnabled = true;
this.RegionBox.Items.AddRange(new object[] {
"Auto",
"NTSC",
"PAL"});
this.RegionBox.Location = new System.Drawing.Point(159, 150);
this.RegionBox.Name = "RegionBox";
this.RegionBox.Size = new System.Drawing.Size(128, 21);
this.RegionBox.TabIndex = 15;
//
// lblRegion
//
this.lblRegion.Location = new System.Drawing.Point(156, 134);
this.lblRegion.Name = "lblRegion";
this.lblRegion.Text = "Region";
//
// cbGameHotfixes
//
this.cbGameHotfixes.AutoSize = true;
this.cbGameHotfixes.Location = new System.Drawing.Point(18, 107);
this.cbGameHotfixes.Name = "cbGameHotfixes";
this.cbGameHotfixes.Size = new System.Drawing.Size(93, 17);
this.cbGameHotfixes.TabIndex = 22;
this.cbGameHotfixes.Text = "Game hotfixes";
this.cbGameHotfixes.UseVisualStyleBackColor = true;
//
// cbFastPPU
//
this.cbFastPPU.AutoSize = true;
this.cbFastPPU.Location = new System.Drawing.Point(159, 107);
this.cbFastPPU.Name = "cbFastPPU";
this.cbFastPPU.Size = new System.Drawing.Size(90, 17);
this.cbFastPPU.TabIndex = 23;
this.cbFastPPU.Text = "Use fast PPU";
this.cbFastPPU.UseVisualStyleBackColor = true;
this.cbFastPPU.CheckedChanged += new System.EventHandler(this.FastPPU_CheckedChanged);
//
// cbCropSGBFrame
//
this.cbCropSGBFrame.AutoSize = true;
this.cbCropSGBFrame.Location = new System.Drawing.Point(18, 84);
this.cbCropSGBFrame.Name = "cbCropSGBFrame";
this.cbCropSGBFrame.Size = new System.Drawing.Size(105, 17);
this.cbCropSGBFrame.TabIndex = 27;
this.cbCropSGBFrame.Text = "Crop SGB Frame";
this.cbCropSGBFrame.UseVisualStyleBackColor = true;
//
// cbUseSGB2
//
this.cbUseSGB2.AutoSize = true;
this.cbUseSGB2.Location = new System.Drawing.Point(159, 84);
this.cbUseSGB2.Name = "cbUseSGB2";
this.cbUseSGB2.Size = new System.Drawing.Size(76, 17);
this.cbUseSGB2.TabIndex = 30;
this.cbUseSGB2.Text = "Use SGB2";
this.cbUseSGB2.UseVisualStyleBackColor = true;
//
// BSNESOptions
//
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(304, 356);
this.Controls.Add(this.cbUseSGB2);
this.Controls.Add(this.cbCropSGBFrame);
this.Controls.Add(this.cbFastPPU);
this.Controls.Add(this.cbGameHotfixes);
this.Controls.Add(this.lblEntropy);
this.Controls.Add(this.EntropyBox);
this.Controls.Add(this.lblRegion);
this.Controls.Add(this.RegionBox);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.lblDoubleSize);
this.Controls.Add(this.cbDoubleSize);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "BSNESOptions";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "BSNES Options";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -366,6 +389,8 @@
private System.Windows.Forms.CheckBox Obj1Checkbox;
private System.Windows.Forms.ComboBox EntropyBox;
private WinForms.Controls.LocLabelEx lblEntropy;
private System.Windows.Forms.ComboBox RegionBox;
private WinForms.Controls.LocLabelEx lblRegion;
private System.Windows.Forms.CheckBox cbGameHotfixes;
private System.Windows.Forms.CheckBox cbFastPPU;
private System.Windows.Forms.CheckBox Bg1_0Checkbox;

View File

@ -20,6 +20,7 @@ namespace BizHawk.Client.EmuHawk
AlwaysDoubleSize = s.AlwaysDoubleSize,
CropSGBFrame = s.CropSGBFrame,
Entropy = ss.Entropy,
RegionOverride = ss.RegionOverride,
Hotfixes = ss.Hotfixes,
FastPPU = ss.FastPPU,
UseSGB2 = ss.UseSGB2,
@ -43,6 +44,7 @@ namespace BizHawk.Client.EmuHawk
s.AlwaysDoubleSize = dlg.AlwaysDoubleSize;
s.CropSGBFrame = dlg.CropSGBFrame;
ss.Entropy = dlg.Entropy;
ss.RegionOverride = dlg.RegionOverride;
ss.Hotfixes = dlg.Hotfixes;
ss.FastPPU = dlg.FastPPU;
ss.UseSGB2 = dlg.UseSGB2;
@ -100,6 +102,12 @@ namespace BizHawk.Client.EmuHawk
init => EntropyBox.SelectedIndex = (int) value;
}
private BsnesApi.REGION_OVERRIDE RegionOverride
{
get => (BsnesApi.REGION_OVERRIDE)RegionBox.SelectedIndex;
init => RegionBox.SelectedIndex = (int)value;
}
private bool ShowObj1 { get => Obj1Checkbox.Checked; init => Obj1Checkbox.Checked = value; }
private bool ShowObj2 { get => Obj2Checkbox.Checked; init => Obj2Checkbox.Checked = value; }
private bool ShowObj3 { get => Obj3Checkbox.Checked; init => Obj3Checkbox.Checked = value; }

View File

@ -39,8 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
public abstract void snes_set_callbacks(IntPtr[] snesCallbacks);
[BizImport(CallingConvention.Cdecl)]
public abstract void snes_init(BsnesApi.ENTROPY entropy, BsnesApi.BSNES_INPUT_DEVICE left,
BsnesApi.BSNES_INPUT_DEVICE right, ushort mergedBools);// bool hotfixes, bool fastPPU);
public abstract void snes_init(ref BsnesApi.SnesInitData initData);
[BizImport(CallingConvention.Cdecl)]
public abstract void snes_power();
[BizImport(CallingConvention.Cdecl)]
@ -216,6 +215,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
}
}
[StructLayout(LayoutKind.Sequential)]
public struct SnesInitData
{
public ENTROPY entropy;
public BSNES_INPUT_DEVICE left_port;
public BSNES_INPUT_DEVICE right_port;
public bool hotfixes;
public bool fast_ppu;
public REGION_OVERRIDE region_override;
}
public void Seal()
{
exe.Seal();

View File

@ -61,5 +61,12 @@
NTSC = 0,
PAL = 1
}
public enum REGION_OVERRIDE : uint
{
Auto,
NTSC,
PAL
}
}
}

View File

@ -27,6 +27,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
|| o.RightPort != _syncSettings.RightPort
|| o.LimitAnalogChangeSensitivity != _syncSettings.LimitAnalogChangeSensitivity
|| o.Entropy != _syncSettings.Entropy
|| o.RegionOverride != _syncSettings.RegionOverride
|| o.Hotfixes != _syncSettings.Hotfixes
|| o.FastPPU != _syncSettings.FastPPU
|| o.UseSGB2 != _syncSettings.UseSGB2;
@ -72,6 +73,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
public BsnesApi.ENTROPY Entropy { get; set; } = BsnesApi.ENTROPY.Low;
public BsnesApi.REGION_OVERRIDE RegionOverride { get; set; } = BsnesApi.REGION_OVERRIDE.Auto;
public bool Hotfixes { get; set; } = true;
public bool FastPPU { get; set; } = true;

View File

@ -71,8 +71,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
generate_palette();
// TODO: massive random hack till waterboxhost gets fixed to support 5+ args
ushort mergedBools = (ushort) ((_syncSettings.Hotfixes ? 1 << 8 : 0) | (_syncSettings.FastPPU ? 1 : 0));
Api.core.snes_init(_syncSettings.Entropy, _syncSettings.LeftPort, _syncSettings.RightPort, mergedBools);
BsnesApi.SnesInitData snesInitData = new()
{
entropy = _syncSettings.Entropy,
left_port = _syncSettings.LeftPort,
right_port = _syncSettings.RightPort,
hotfixes = _syncSettings.Hotfixes,
fast_ppu = _syncSettings.FastPPU,
region_override = _syncSettings.RegionOverride,
};
Api.core.snes_init(ref snesInitData);
Api.SetCallbacks(callbacks);
// start up audio resampler

View File

@ -84,7 +84,7 @@ auto ICD::load() -> bool {
GB_random_set_enabled(configuration.hacks.entropy != "None");
if(Frequency == 0) {
GB_init(&sameboy, GB_MODEL_SGB_NO_SFC);
GB_init(&sameboy, Region::PAL() ? GB_MODEL_SGB_PAL_NO_SFC : GB_MODEL_SGB_NTSC_NO_SFC);
GB_load_boot_rom_from_buffer(&sameboy, (const unsigned char*)&SGB1BootROM[0], 256);
} else {
GB_init(&sameboy, GB_MODEL_SGB2_NO_SFC);

View File

@ -122,16 +122,14 @@ EXPORT void snes_set_callbacks(SnesCallbacks* callbacks)
snesCallbacks = SnesCallbacks(*callbacks);
}
EXPORT void snes_init(int entropy, uint left_port, uint right_port, uint16_t merged_bools)// bool hotfixes, bool fast_ppu)
EXPORT void snes_init(SnesInitData* init_data)
{
bool hotfixes = merged_bools >> 8;
bool fast_ppu = merged_bools & 1;
fprintf(stderr, "snes_init was called!\n");
emulator = new SuperFamicom::Interface;
program = new Program;
string entropy_string;
switch (entropy)
switch (init_data->entropy)
{
case 0: entropy_string = "None"; break;
case 1: entropy_string = "Low"; break;
@ -139,15 +137,17 @@ EXPORT void snes_init(int entropy, uint left_port, uint right_port, uint16_t mer
}
emulator->configure("Hacks/Entropy", entropy_string);
emulator->connect(ID::Port::Controller1, left_port);
emulator->connect(ID::Port::Controller2, right_port);
emulator->connect(ID::Port::Controller1, init_data->left_port);
emulator->connect(ID::Port::Controller2, init_data->right_port);
emulator->configure("Hacks/Hotfixes", hotfixes);
emulator->configure("Hacks/PPU/Fast", fast_ppu);
emulator->configure("Hacks/Hotfixes", init_data->hotfixes);
emulator->configure("Hacks/PPU/Fast", init_data->fast_ppu);
emulator->configure("Video/BlurEmulation", false); // blurs the video when not using fast ppu. I don't like it so I disable it here :)
// needed in order to get audio sync working. should probably figure out what exactly this does or how to change that properly
Emulator::audio.setFrequency(SAMPLE_RATE);
program->regionOverride = init_data->region_override;
}
EXPORT void snes_power(void)

View File

@ -28,6 +28,15 @@ enum SNES_MEMORY {
};
struct SnesInitData {
int entropy;
unsigned left_port;
unsigned right_port;
bool hotfixes;
bool fast_ppu;
int region_override;
};
struct LayerEnables
{
bool BG1_Prio0, BG1_Prio1;

View File

@ -42,6 +42,7 @@ struct Program : Emulator::Platform
bool overscan = false;
uint16_t backdropColor;
int regionOverride = 0;
public:
struct Game {
@ -361,7 +362,11 @@ auto Program::loadSuperFamicom() -> bool
auto heuristics = Heuristics::SuperFamicom(rom, superFamicom.location);
superFamicom.title = heuristics.title();
superFamicom.region = heuristics.videoRegion();
switch (regionOverride) {
case 0: superFamicom.region = heuristics.videoRegion(); break;
case 1: superFamicom.region = "NTSC"; break;
case 2: superFamicom.region = "PAL"; break;
}
superFamicom.manifest = heuristics.manifest();
hackPatchMemory(rom);