add GB layer toggles

This commit is contained in:
zeromus 2016-02-08 02:18:24 -06:00
parent 97998071a7
commit 89a4381d9d
16 changed files with 384 additions and 281 deletions

View File

@ -32,6 +32,8 @@
this.buttonDefaults = new System.Windows.Forms.Button();
this.buttonPalette = new System.Windows.Forms.Button();
this.checkBoxMuted = new System.Windows.Forms.CheckBox();
this.cbDisplayBG = new System.Windows.Forms.CheckBox();
this.cbDisplayOBJ = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// propertyGrid1
@ -42,7 +44,7 @@
this.propertyGrid1.Location = new System.Drawing.Point(3, 3);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.PropertySort = System.Windows.Forms.PropertySort.Alphabetical;
this.propertyGrid1.Size = new System.Drawing.Size(318, 276);
this.propertyGrid1.Size = new System.Drawing.Size(330, 276);
this.propertyGrid1.TabIndex = 0;
this.propertyGrid1.ToolbarVisible = false;
this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
@ -50,7 +52,7 @@
// buttonDefaults
//
this.buttonDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonDefaults.Location = new System.Drawing.Point(246, 285);
this.buttonDefaults.Location = new System.Drawing.Point(258, 285);
this.buttonDefaults.Name = "buttonDefaults";
this.buttonDefaults.Size = new System.Drawing.Size(75, 23);
this.buttonDefaults.TabIndex = 1;
@ -81,15 +83,41 @@
this.checkBoxMuted.UseVisualStyleBackColor = true;
this.checkBoxMuted.CheckedChanged += new System.EventHandler(this.checkBoxMuted_CheckedChanged);
//
// cbDisplayBG
//
this.cbDisplayBG.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cbDisplayBG.AutoSize = true;
this.cbDisplayBG.Location = new System.Drawing.Point(166, 289);
this.cbDisplayBG.Name = "cbDisplayBG";
this.cbDisplayBG.Size = new System.Drawing.Size(41, 17);
this.cbDisplayBG.TabIndex = 4;
this.cbDisplayBG.Text = "BG";
this.cbDisplayBG.UseVisualStyleBackColor = true;
this.cbDisplayBG.CheckedChanged += new System.EventHandler(this.cbDisplayBG_CheckedChanged);
//
// cbDisplayOBJ
//
this.cbDisplayOBJ.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cbDisplayOBJ.AutoSize = true;
this.cbDisplayOBJ.Location = new System.Drawing.Point(206, 289);
this.cbDisplayOBJ.Name = "cbDisplayOBJ";
this.cbDisplayOBJ.Size = new System.Drawing.Size(46, 17);
this.cbDisplayOBJ.TabIndex = 5;
this.cbDisplayOBJ.Text = "OBJ";
this.cbDisplayOBJ.UseVisualStyleBackColor = true;
this.cbDisplayOBJ.CheckedChanged += new System.EventHandler(this.cbDisplayOBJ_CheckedChanged);
//
// GBPrefControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.cbDisplayOBJ);
this.Controls.Add(this.cbDisplayBG);
this.Controls.Add(this.checkBoxMuted);
this.Controls.Add(this.buttonPalette);
this.Controls.Add(this.buttonDefaults);
this.Controls.Add(this.propertyGrid1);
this.Name = "GBPrefControl";
this.Size = new System.Drawing.Size(324, 311);
this.Size = new System.Drawing.Size(336, 311);
this.ResumeLayout(false);
this.PerformLayout();
@ -101,5 +129,7 @@
private System.Windows.Forms.Button buttonDefaults;
private System.Windows.Forms.Button buttonPalette;
private System.Windows.Forms.CheckBox checkBoxMuted;
private System.Windows.Forms.CheckBox cbDisplayBG;
private System.Windows.Forms.CheckBox cbDisplayOBJ;
}
}

View File

@ -34,6 +34,8 @@ namespace BizHawk.Client.EmuHawk.config.GB
propertyGrid1.SelectedObject = this.ss;
propertyGrid1.Enabled = !Global.MovieSession.Movie.IsActive;
checkBoxMuted.Checked = this.s.Muted;
cbDisplayBG.Checked = this.s.DisplayBG;
cbDisplayOBJ.Checked = this.s.DisplayOBJ;
}
public void GetSettings(out Gameboy.GambatteSettings s, out Gameboy.GambatteSyncSettings ss)
@ -66,5 +68,15 @@ namespace BizHawk.Client.EmuHawk.config.GB
{
s.Muted = (sender as CheckBox).Checked;
}
private void cbDisplayBG_CheckedChanged(object sender, EventArgs e)
{
s.DisplayBG = (sender as CheckBox).Checked;
}
private void cbDisplayOBJ_CheckedChanged(object sender, EventArgs e)
{
s.DisplayOBJ = (sender as CheckBox).Checked;
}
}
}

View File

@ -72,6 +72,7 @@
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(448, 398);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);

View File

@ -36,17 +36,10 @@
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.bmpViewBG = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewWin = new BizHawk.Client.EmuHawk.BmpView();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.bmpViewTiles1 = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewTiles2 = new BizHawk.Client.EmuHawk.BmpView();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.label7 = new System.Windows.Forms.Label();
this.bmpViewBGPal = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewSPPal = new BizHawk.Client.EmuHawk.BmpView();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.bmpViewOAM = new BizHawk.Client.EmuHawk.BmpView();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.hScrollBarScanline = new System.Windows.Forms.HScrollBar();
this.labelScanline = new System.Windows.Forms.Label();
@ -56,9 +49,7 @@
this.radioButtonRefreshFrame = new System.Windows.Forms.RadioButton();
this.groupBoxDetails = new System.Windows.Forms.GroupBox();
this.labelDetails = new System.Windows.Forms.Label();
this.bmpViewDetails = new BizHawk.Client.EmuHawk.BmpView();
this.groupBoxMemory = new System.Windows.Forms.GroupBox();
this.bmpViewMemory = new BizHawk.Client.EmuHawk.BmpView();
this.labelMemory = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.labelClipboard = new System.Windows.Forms.Label();
@ -67,6 +58,15 @@
this.buttonChangeColor = new System.Windows.Forms.Button();
this.panelSpriteBackColor = new System.Windows.Forms.Panel();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.bmpViewMemory = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewDetails = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewOAM = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewBGPal = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewSPPal = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewTiles1 = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewTiles2 = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewBG = new BizHawk.Client.EmuHawk.BmpView();
this.bmpViewWin = new BizHawk.Client.EmuHawk.BmpView();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
@ -145,32 +145,6 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Tilemaps";
//
// bmpViewBG
//
this.bmpViewBG.BackColor = System.Drawing.Color.Black;
this.bmpViewBG.Location = new System.Drawing.Point(6, 32);
this.bmpViewBG.Name = "bmpViewBG";
this.bmpViewBG.Size = new System.Drawing.Size(256, 256);
this.bmpViewBG.TabIndex = 4;
this.bmpViewBG.Text = "Background";
this.bmpViewBG.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewBG.MouseEnter += new System.EventHandler(this.bmpViewBG_MouseEnter);
this.bmpViewBG.MouseLeave += new System.EventHandler(this.bmpViewBG_MouseLeave);
this.bmpViewBG.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewBG_MouseMove);
//
// bmpViewWin
//
this.bmpViewWin.BackColor = System.Drawing.Color.Black;
this.bmpViewWin.Location = new System.Drawing.Point(268, 32);
this.bmpViewWin.Name = "bmpViewWin";
this.bmpViewWin.Size = new System.Drawing.Size(256, 256);
this.bmpViewWin.TabIndex = 5;
this.bmpViewWin.Text = "Window";
this.bmpViewWin.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewWin.MouseEnter += new System.EventHandler(this.bmpViewWin_MouseEnter);
this.bmpViewWin.MouseLeave += new System.EventHandler(this.bmpViewWin_MouseLeave);
this.bmpViewWin.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewWin_MouseMove);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label3);
@ -184,32 +158,6 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Tiles";
//
// bmpViewTiles1
//
this.bmpViewTiles1.BackColor = System.Drawing.Color.Black;
this.bmpViewTiles1.Location = new System.Drawing.Point(6, 32);
this.bmpViewTiles1.Name = "bmpViewTiles1";
this.bmpViewTiles1.Size = new System.Drawing.Size(128, 192);
this.bmpViewTiles1.TabIndex = 6;
this.bmpViewTiles1.Text = "Tiles 1";
this.bmpViewTiles1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewTiles1.MouseEnter += new System.EventHandler(this.bmpViewTiles1_MouseEnter);
this.bmpViewTiles1.MouseLeave += new System.EventHandler(this.bmpViewTiles1_MouseLeave);
this.bmpViewTiles1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewTiles1_MouseMove);
//
// bmpViewTiles2
//
this.bmpViewTiles2.BackColor = System.Drawing.Color.Black;
this.bmpViewTiles2.Location = new System.Drawing.Point(140, 32);
this.bmpViewTiles2.Name = "bmpViewTiles2";
this.bmpViewTiles2.Size = new System.Drawing.Size(128, 192);
this.bmpViewTiles2.TabIndex = 7;
this.bmpViewTiles2.Text = "Tiles 2";
this.bmpViewTiles2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewTiles2.MouseEnter += new System.EventHandler(this.bmpViewTiles2_MouseEnter);
this.bmpViewTiles2.MouseLeave += new System.EventHandler(this.bmpViewTiles2_MouseLeave);
this.bmpViewTiles2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewTiles2_MouseMove);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.label7);
@ -233,32 +181,6 @@
this.label7.TabIndex = 14;
this.label7.Text = "Left-click a palette to use it for drawing the tiles display.";
//
// bmpViewBGPal
//
this.bmpViewBGPal.BackColor = System.Drawing.Color.Black;
this.bmpViewBGPal.Location = new System.Drawing.Point(6, 32);
this.bmpViewBGPal.Name = "bmpViewBGPal";
this.bmpViewBGPal.Size = new System.Drawing.Size(128, 64);
this.bmpViewBGPal.TabIndex = 10;
this.bmpViewBGPal.Text = "Background palettes";
this.bmpViewBGPal.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewBGPal.MouseEnter += new System.EventHandler(this.bmpViewBGPal_MouseEnter);
this.bmpViewBGPal.MouseLeave += new System.EventHandler(this.bmpViewBGPal_MouseLeave);
this.bmpViewBGPal.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewBGPal_MouseMove);
//
// bmpViewSPPal
//
this.bmpViewSPPal.BackColor = System.Drawing.Color.Black;
this.bmpViewSPPal.Location = new System.Drawing.Point(140, 32);
this.bmpViewSPPal.Name = "bmpViewSPPal";
this.bmpViewSPPal.Size = new System.Drawing.Size(128, 64);
this.bmpViewSPPal.TabIndex = 11;
this.bmpViewSPPal.Text = "Sprite palettes";
this.bmpViewSPPal.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewSPPal.MouseEnter += new System.EventHandler(this.bmpViewSPPal_MouseEnter);
this.bmpViewSPPal.MouseLeave += new System.EventHandler(this.bmpViewSPPal_MouseLeave);
this.bmpViewSPPal.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewSPPal_MouseMove);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.bmpViewOAM);
@ -269,19 +191,6 @@
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Sprites";
//
// bmpViewOAM
//
this.bmpViewOAM.BackColor = System.Drawing.Color.Black;
this.bmpViewOAM.Location = new System.Drawing.Point(6, 19);
this.bmpViewOAM.Name = "bmpViewOAM";
this.bmpViewOAM.Size = new System.Drawing.Size(320, 16);
this.bmpViewOAM.TabIndex = 14;
this.bmpViewOAM.Text = "Sprites";
this.bmpViewOAM.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewOAM.MouseEnter += new System.EventHandler(this.bmpViewOAM_MouseEnter);
this.bmpViewOAM.MouseLeave += new System.EventHandler(this.bmpViewOAM_MouseLeave);
this.bmpViewOAM.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewOAM_MouseMove);
//
// groupBox5
//
this.groupBox5.Controls.Add(this.hScrollBarScanline);
@ -383,16 +292,6 @@
this.labelDetails.TabIndex = 1;
this.labelDetails.Text = "Mouse over an item to see details about it.";
//
// bmpViewDetails
//
this.bmpViewDetails.BackColor = System.Drawing.Color.Black;
this.bmpViewDetails.Location = new System.Drawing.Point(6, 19);
this.bmpViewDetails.Name = "bmpViewDetails";
this.bmpViewDetails.Size = new System.Drawing.Size(64, 128);
this.bmpViewDetails.TabIndex = 0;
this.bmpViewDetails.Text = "Details (mouseover)";
this.bmpViewDetails.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
//
// groupBoxMemory
//
this.groupBoxMemory.Controls.Add(this.bmpViewMemory);
@ -404,15 +303,6 @@
this.groupBoxMemory.TabStop = false;
this.groupBoxMemory.Text = "Details - Memory";
//
// bmpViewMemory
//
this.bmpViewMemory.BackColor = System.Drawing.Color.Black;
this.bmpViewMemory.Location = new System.Drawing.Point(6, 19);
this.bmpViewMemory.Name = "bmpViewMemory";
this.bmpViewMemory.Size = new System.Drawing.Size(64, 128);
this.bmpViewMemory.TabIndex = 1;
this.bmpViewMemory.Text = "Details (memory)";
//
// labelMemory
//
this.labelMemory.AutoSize = true;
@ -489,6 +379,116 @@
this.menuStrip1.TabIndex = 26;
this.menuStrip1.Text = "menuStrip1";
//
// bmpViewMemory
//
this.bmpViewMemory.BackColor = System.Drawing.Color.Black;
this.bmpViewMemory.Location = new System.Drawing.Point(6, 19);
this.bmpViewMemory.Name = "bmpViewMemory";
this.bmpViewMemory.Size = new System.Drawing.Size(64, 128);
this.bmpViewMemory.TabIndex = 1;
this.bmpViewMemory.Text = "Details (memory)";
//
// bmpViewDetails
//
this.bmpViewDetails.BackColor = System.Drawing.Color.Black;
this.bmpViewDetails.Location = new System.Drawing.Point(6, 19);
this.bmpViewDetails.Name = "bmpViewDetails";
this.bmpViewDetails.Size = new System.Drawing.Size(64, 128);
this.bmpViewDetails.TabIndex = 0;
this.bmpViewDetails.Text = "Details (mouseover)";
this.bmpViewDetails.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
//
// bmpViewOAM
//
this.bmpViewOAM.BackColor = System.Drawing.Color.Black;
this.bmpViewOAM.Location = new System.Drawing.Point(6, 19);
this.bmpViewOAM.Name = "bmpViewOAM";
this.bmpViewOAM.Size = new System.Drawing.Size(320, 16);
this.bmpViewOAM.TabIndex = 14;
this.bmpViewOAM.Text = "Sprites";
this.bmpViewOAM.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewOAM.MouseEnter += new System.EventHandler(this.bmpViewOAM_MouseEnter);
this.bmpViewOAM.MouseLeave += new System.EventHandler(this.bmpViewOAM_MouseLeave);
this.bmpViewOAM.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewOAM_MouseMove);
//
// bmpViewBGPal
//
this.bmpViewBGPal.BackColor = System.Drawing.Color.Black;
this.bmpViewBGPal.Location = new System.Drawing.Point(6, 32);
this.bmpViewBGPal.Name = "bmpViewBGPal";
this.bmpViewBGPal.Size = new System.Drawing.Size(128, 64);
this.bmpViewBGPal.TabIndex = 10;
this.bmpViewBGPal.Text = "Background palettes";
this.bmpViewBGPal.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewBGPal.MouseEnter += new System.EventHandler(this.bmpViewBGPal_MouseEnter);
this.bmpViewBGPal.MouseLeave += new System.EventHandler(this.bmpViewBGPal_MouseLeave);
this.bmpViewBGPal.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewBGPal_MouseMove);
//
// bmpViewSPPal
//
this.bmpViewSPPal.BackColor = System.Drawing.Color.Black;
this.bmpViewSPPal.Location = new System.Drawing.Point(140, 32);
this.bmpViewSPPal.Name = "bmpViewSPPal";
this.bmpViewSPPal.Size = new System.Drawing.Size(128, 64);
this.bmpViewSPPal.TabIndex = 11;
this.bmpViewSPPal.Text = "Sprite palettes";
this.bmpViewSPPal.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewSPPal.MouseEnter += new System.EventHandler(this.bmpViewSPPal_MouseEnter);
this.bmpViewSPPal.MouseLeave += new System.EventHandler(this.bmpViewSPPal_MouseLeave);
this.bmpViewSPPal.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewSPPal_MouseMove);
//
// bmpViewTiles1
//
this.bmpViewTiles1.BackColor = System.Drawing.Color.Black;
this.bmpViewTiles1.Location = new System.Drawing.Point(6, 32);
this.bmpViewTiles1.Name = "bmpViewTiles1";
this.bmpViewTiles1.Size = new System.Drawing.Size(128, 192);
this.bmpViewTiles1.TabIndex = 6;
this.bmpViewTiles1.Text = "Tiles 1";
this.bmpViewTiles1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewTiles1.MouseEnter += new System.EventHandler(this.bmpViewTiles1_MouseEnter);
this.bmpViewTiles1.MouseLeave += new System.EventHandler(this.bmpViewTiles1_MouseLeave);
this.bmpViewTiles1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewTiles1_MouseMove);
//
// bmpViewTiles2
//
this.bmpViewTiles2.BackColor = System.Drawing.Color.Black;
this.bmpViewTiles2.Location = new System.Drawing.Point(140, 32);
this.bmpViewTiles2.Name = "bmpViewTiles2";
this.bmpViewTiles2.Size = new System.Drawing.Size(128, 192);
this.bmpViewTiles2.TabIndex = 7;
this.bmpViewTiles2.Text = "Tiles 2";
this.bmpViewTiles2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewTiles2.MouseEnter += new System.EventHandler(this.bmpViewTiles2_MouseEnter);
this.bmpViewTiles2.MouseLeave += new System.EventHandler(this.bmpViewTiles2_MouseLeave);
this.bmpViewTiles2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewTiles2_MouseMove);
//
// bmpViewBG
//
this.bmpViewBG.BackColor = System.Drawing.Color.Black;
this.bmpViewBG.Location = new System.Drawing.Point(6, 32);
this.bmpViewBG.Name = "bmpViewBG";
this.bmpViewBG.Size = new System.Drawing.Size(256, 256);
this.bmpViewBG.TabIndex = 4;
this.bmpViewBG.Text = "Background";
this.bmpViewBG.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewBG.MouseEnter += new System.EventHandler(this.bmpViewBG_MouseEnter);
this.bmpViewBG.MouseLeave += new System.EventHandler(this.bmpViewBG_MouseLeave);
this.bmpViewBG.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewBG_MouseMove);
//
// bmpViewWin
//
this.bmpViewWin.BackColor = System.Drawing.Color.Black;
this.bmpViewWin.Location = new System.Drawing.Point(268, 32);
this.bmpViewWin.Name = "bmpViewWin";
this.bmpViewWin.Size = new System.Drawing.Size(256, 256);
this.bmpViewWin.TabIndex = 5;
this.bmpViewWin.Text = "Window";
this.bmpViewWin.MouseClick += new System.Windows.Forms.MouseEventHandler(this.bmpView_MouseClick);
this.bmpViewWin.MouseEnter += new System.EventHandler(this.bmpViewWin_MouseEnter);
this.bmpViewWin.MouseLeave += new System.EventHandler(this.bmpViewWin_MouseLeave);
this.bmpViewWin.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bmpViewWin_MouseMove);
//
// GBGPUView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -52,6 +52,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public int[] GBPalette;
public GBColors.ColorType CGBColors;
public bool DisplayBG = true, DisplayOBJ = true;
/// <summary>
/// true to mute all audio
/// </summary>
@ -63,6 +65,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
CGBColors = GBColors.ColorType.gambatte;
}
public GambatteSettings Clone()
{
var ret = (GambatteSettings)MemberwiseClone();

View File

@ -298,6 +298,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
else
tracecb = null;
LibGambatte.gambatte_settracecallback(GambatteState, tracecb);
LibGambatte.gambatte_setlayers(GambatteState, (_settings.DisplayBG ? 1 : 0) | (_settings.DisplayOBJ ? 2 : 0));
}
internal void FrameAdvancePost()

View File

@ -225,6 +225,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
[DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void gambatte_settracecallback(IntPtr core, TraceCallback callback);
/// <summary>
/// sets layers to be rendered
/// </summary>
/// <param name="core">opaque state pointer</param>
/// <param name="mask">layermask, 1=BG, 2=OBJ</param>
[DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void gambatte_setlayers(IntPtr core, int mask);
/// <summary>
/// type of the scanline callback
/// </summary>

View File

@ -85,6 +85,8 @@ public:
void blitTo(gambatte::uint_least32_t *videoBuf, int pitch);
void setLayers(unsigned mask);
/** Reset to initial state.
* Equivalent to reloading a ROM image, or turning a Game Boy Color off and on again.
*/

View File

@ -48,6 +48,11 @@ GBEXPORT void gambatte_blitto(GB *g, unsigned long *videobuf, int pitch)
g->blitTo((unsigned int *)videobuf, pitch);
}
GBEXPORT void gambatte_setlayers(GB *g, unsigned mask)
{
g->setLayers(mask);
}
GBEXPORT void gambatte_reset(GB *g, long long now)
{
g->reset(now);

View File

@ -52,6 +52,7 @@ public:
long runFor(unsigned long cycles);
void setStatePtrs(SaveState &state);
void loadState(const SaveState &state);
void setLayers(unsigned mask) { memory.setLayers(mask); }
void loadSavedata(const char *data) { memory.loadSavedata(data); }
int saveSavedataLength() {return memory.saveSavedataLength(); }

View File

@ -27,10 +27,11 @@ namespace gambatte {
struct GB::Priv {
CPU cpu;
bool gbaCgbMode;
unsigned layersMask;
uint_least32_t vbuff[160*144];
Priv() : gbaCgbMode(false)
Priv() : gbaCgbMode(false), layersMask(LAYER_MASK_BG | LAYER_MASK_OBJ)
{
}
@ -62,6 +63,11 @@ long GB::runFor(gambatte::uint_least32_t *const soundBuf, unsigned &samples) {
return cyclesSinceBlit < 0 ? cyclesSinceBlit : static_cast<long>(samples) - (cyclesSinceBlit >> 1);
}
void GB::setLayers(unsigned mask)
{
p_->cpu.setLayers(mask);
}
void GB::blitTo(gambatte::uint_least32_t *videoBuf, int pitch)
{
gambatte::uint_least32_t *src = p_->vbuff;

View File

@ -103,6 +103,8 @@ public:
bool ime() const { return intreq.ime(); }
bool halted() const { return intreq.halted(); }
unsigned long nextEventTime() const { return intreq.minEventTime(); }
void setLayers(unsigned mask) { display.setLayers(mask); }
bool isActive() const { return intreq.eventTime(END) != DISABLED_TIME; }

View File

@ -174,6 +174,7 @@ public:
void setDmgPaletteColor(unsigned palNum, unsigned colorNum, unsigned long rgb32);
void setCgbPalette(unsigned *lut);
void setVideoBuffer(uint_least32_t *videoBuf, int pitch);
void setLayers(unsigned mask) { ppu.setLayers(mask); }
int debugGetLY() const { return ppu.lyCounter().ly(); }

View File

@ -408,68 +408,71 @@ namespace M3Loop {
int i = nextSprite - 1;
if (!(p.lcdc & 2)) {
do {
const int pos = static_cast<int>(p.spriteList[i].spx) - xpos;
p.spwordList[i] >>= pos * 2 >= 0 ? 16 - pos * 2 : 16 + pos * 2;
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
} else {
do {
int n;
int pos = static_cast<int>(p.spriteList[i].spx) - xpos;
if (pos < 0) {
n = pos + 8;
pos = 0;
} else
n = 8 - pos;
const unsigned attrib = p.spriteList[i].attrib;
unsigned spword = p.spwordList[i];
const unsigned long *const spPalette = p.spPalette + (attrib >> 2 & 4);
uint_least32_t *d = dst + pos;
if (!(attrib & 0x80)) {
switch (n) {
case 8: if (spword >> 14 ) { d[7] = spPalette[spword >> 14 ]; }
case 7: if (spword >> 12 & 3) { d[6] = spPalette[spword >> 12 & 3]; }
case 6: if (spword >> 10 & 3) { d[5] = spPalette[spword >> 10 & 3]; }
case 5: if (spword >> 8 & 3) { d[4] = spPalette[spword >> 8 & 3]; }
case 4: if (spword >> 6 & 3) { d[3] = spPalette[spword >> 6 & 3]; }
case 3: if (spword >> 4 & 3) { d[2] = spPalette[spword >> 4 & 3]; }
case 2: if (spword >> 2 & 3) { d[1] = spPalette[spword >> 2 & 3]; }
case 1: if (spword & 3) { d[0] = spPalette[spword & 3]; }
}
spword >>= n * 2;
/*do {
if(p.layersMask & LAYER_MASK_OBJ)
{
if (!(p.lcdc & 2)) {
do {
const int pos = static_cast<int>(p.spriteList[i].spx) - xpos;
p.spwordList[i] >>= pos * 2 >= 0 ? 16 - pos * 2 : 16 + pos * 2;
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
} else {
do {
int n;
int pos = static_cast<int>(p.spriteList[i].spx) - xpos;
if (pos < 0) {
n = pos + 8;
pos = 0;
} else
n = 8 - pos;
const unsigned attrib = p.spriteList[i].attrib;
unsigned spword = p.spwordList[i];
const unsigned long *const spPalette = p.spPalette + (attrib >> 2 & 4);
uint_least32_t *d = dst + pos;
if (!(attrib & 0x80)) {
switch (n) {
case 8: if (spword >> 14 ) { d[7] = spPalette[spword >> 14 ]; }
case 7: if (spword >> 12 & 3) { d[6] = spPalette[spword >> 12 & 3]; }
case 6: if (spword >> 10 & 3) { d[5] = spPalette[spword >> 10 & 3]; }
case 5: if (spword >> 8 & 3) { d[4] = spPalette[spword >> 8 & 3]; }
case 4: if (spword >> 6 & 3) { d[3] = spPalette[spword >> 6 & 3]; }
case 3: if (spword >> 4 & 3) { d[2] = spPalette[spword >> 4 & 3]; }
case 2: if (spword >> 2 & 3) { d[1] = spPalette[spword >> 2 & 3]; }
case 1: if (spword & 3) { d[0] = spPalette[spword & 3]; }
}
spword >>= n * 2;
/*do {
if (spword & 3)
dst[pos] = spPalette[spword & 3];
dst[pos] = spPalette[spword & 3];
spword >>= 2;
++pos;
} while (--n);*/
} else {
unsigned tw = tileword >> pos * 2;
d += n;
n = -n;
do {
if (spword & 3) {
d[n] = tw & 3 ? p.bgPalette[tw & 3]
: spPalette[spword & 3];
}
spword >>= 2;
tw >>= 2;
} while (++n);
}
p.spwordList[i] = spword;
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
} while (--n);*/
} else {
unsigned tw = tileword >> pos * 2;
d += n;
n = -n;
do {
if (spword & 3) {
d[n] = tw & 3 ? p.bgPalette[tw & 3]
: spPalette[spword & 3];
}
spword >>= 2;
tw >>= 2;
} while (++n);
}
p.spwordList[i] = spword;
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
}
}
}
@ -491,6 +494,13 @@ namespace M3Loop {
int xpos = p.xpos;
const unsigned char *const vram = p.vram;
const unsigned tdoffset = tileline * 2 + (~p.lcdc & 0x10) * 0x100;
if(!(p.layersMask & LAYER_MASK_BG))
{
for(int x=xpos,i=0;x<xend;x++,i++)
dbufline[i] = p.bgPalette[0]; //guessing?
return;
}
do {
int nextSprite = p.nextSprite;
@ -593,103 +603,106 @@ namespace M3Loop {
dst[7] = bgPalette[ tileword >> 14];
int i = nextSprite - 1;
if (!(p.lcdc & 2)) {
do {
const int pos = static_cast<int>(p.spriteList[i].spx) - xpos;
p.spwordList[i] >>= pos * 2 >= 0 ? 16 - pos * 2 : 16 + pos * 2;
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
} else {
unsigned char idtab[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
const unsigned bgenmask = p.lcdc << 7 & 0x80;
do {
int n;
int pos = static_cast<int>(p.spriteList[i].spx) - xpos;
if (pos < 0) {
n = pos + 8;
pos = 0;
} else
n = 8 - pos;
const unsigned char id = p.spriteList[i].oampos;
const unsigned sattrib = p.spriteList[i].attrib;
unsigned spword = p.spwordList[i];
const unsigned long *const spPalette = p.spPalette + (sattrib & 7) * 4;
if (!((attrib | sattrib) & bgenmask)) {
unsigned char *const idt = idtab + pos;
uint_least32_t *const d = dst + pos;
switch (n) {
case 8: if ((spword >> 14 ) && id < idt[7]) {
idt[7] = id;
d[7] = spPalette[spword >> 14 ];
}
case 7: if ((spword >> 12 & 3) && id < idt[6]) {
idt[6] = id;
d[6] = spPalette[spword >> 12 & 3];
}
case 6: if ((spword >> 10 & 3) && id < idt[5]) {
idt[5] = id;
d[5] = spPalette[spword >> 10 & 3];
}
case 5: if ((spword >> 8 & 3) && id < idt[4]) {
idt[4] = id;
d[4] = spPalette[spword >> 8 & 3];
}
case 4: if ((spword >> 6 & 3) && id < idt[3]) {
idt[3] = id;
d[3] = spPalette[spword >> 6 & 3];
}
case 3: if ((spword >> 4 & 3) && id < idt[2]) {
idt[2] = id;
d[2] = spPalette[spword >> 4 & 3];
}
case 2: if ((spword >> 2 & 3) && id < idt[1]) {
idt[1] = id;
d[1] = spPalette[spword >> 2 & 3];
}
case 1: if ((spword & 3) && id < idt[0]) {
idt[0] = id;
d[0] = spPalette[spword & 3];
}
if(p.layersMask & LAYER_MASK_OBJ)
{
if (!(p.lcdc & 2)) {
do {
const int pos = static_cast<int>(p.spriteList[i].spx) - xpos;
p.spwordList[i] >>= pos * 2 >= 0 ? 16 - pos * 2 : 16 + pos * 2;
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
} else {
unsigned char idtab[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
const unsigned bgenmask = p.lcdc << 7 & 0x80;
do {
int n;
int pos = static_cast<int>(p.spriteList[i].spx) - xpos;
if (pos < 0) {
n = pos + 8;
pos = 0;
} else
n = 8 - pos;
const unsigned char id = p.spriteList[i].oampos;
const unsigned sattrib = p.spriteList[i].attrib;
unsigned spword = p.spwordList[i];
const unsigned long *const spPalette = p.spPalette + (sattrib & 7) * 4;
if (!((attrib | sattrib) & bgenmask)) {
unsigned char *const idt = idtab + pos;
uint_least32_t *const d = dst + pos;
switch (n) {
case 8: if ((spword >> 14 ) && id < idt[7]) {
idt[7] = id;
d[7] = spPalette[spword >> 14 ];
}
case 7: if ((spword >> 12 & 3) && id < idt[6]) {
idt[6] = id;
d[6] = spPalette[spword >> 12 & 3];
}
case 6: if ((spword >> 10 & 3) && id < idt[5]) {
idt[5] = id;
d[5] = spPalette[spword >> 10 & 3];
}
case 5: if ((spword >> 8 & 3) && id < idt[4]) {
idt[4] = id;
d[4] = spPalette[spword >> 8 & 3];
}
case 4: if ((spword >> 6 & 3) && id < idt[3]) {
idt[3] = id;
d[3] = spPalette[spword >> 6 & 3];
}
case 3: if ((spword >> 4 & 3) && id < idt[2]) {
idt[2] = id;
d[2] = spPalette[spword >> 4 & 3];
}
case 2: if ((spword >> 2 & 3) && id < idt[1]) {
idt[1] = id;
d[1] = spPalette[spword >> 2 & 3];
}
case 1: if ((spword & 3) && id < idt[0]) {
idt[0] = id;
d[0] = spPalette[spword & 3];
}
}
spword >>= n * 2;
/*do {
if ((spword & 3) && id < idtab[pos]) {
idtab[pos] = id;
dst[pos] = spPalette[spword & 3];
}
spword >>= 2;
++pos;
} while (--n);*/
} else {
unsigned tw = tileword >> pos * 2;
do {
if ((spword & 3) && id < idtab[pos]) {
idtab[pos] = id;
dst[pos] = tw & 3 ? bgPalette[tw & 3] : spPalette[spword & 3];
}
spword >>= 2;
tw >>= 2;
++pos;
} while (--n);
}
spword >>= n * 2;
/*do {
if ((spword & 3) && id < idtab[pos]) {
idtab[pos] = id;
dst[pos] = spPalette[spword & 3];
}
spword >>= 2;
++pos;
} while (--n);*/
} else {
unsigned tw = tileword >> pos * 2;
do {
if ((spword & 3) && id < idtab[pos]) {
idtab[pos] = id;
dst[pos] = tw & 3 ? bgPalette[tw & 3] : spPalette[spword & 3];
}
spword >>= 2;
tw >>= 2;
++pos;
} while (--n);
}
p.spwordList[i] = spword;
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
p.spwordList[i] = spword;
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
}
}
}
{
unsigned const tno = tileMapLine[ tileMapXpos & 0x1F ];
unsigned const nattrib = tileMapLine[(tileMapXpos & 0x1F) + 0x2000];
@ -715,7 +728,7 @@ namespace M3Loop {
if (xpos >= xend)
return;
uint_least32_t *const dbufline = p.framebuf.fbline();
const unsigned char *tileMapLine;
unsigned tileline;
@ -759,6 +772,7 @@ namespace M3Loop {
}
static void plotPixel(PPUPriv &p) {
//ZING!
const int xpos = p.xpos;
const unsigned tileword = p.tileword;
uint_least32_t *const fbline = p.framebuf.fbline();
@ -774,6 +788,11 @@ namespace M3Loop {
const unsigned twdata = tileword & ((p.lcdc & 1) | p.cgb) * 3;
unsigned long pixel = p.bgPalette[twdata + (p.attrib & 7) * 4];
int i = static_cast<int>(p.nextSprite) - 1;
if(!(p.layersMask & LAYER_MASK_BG))
{
pixel = p.bgPalette[0]; //guessing? clobber the tile that was read
}
if (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8) {
unsigned spdata = 0;
@ -793,8 +812,11 @@ namespace M3Loop {
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
if (spdata && (p.lcdc & 2) && (!((attrib | p.attrib) & 0x80) || !twdata || !(p.lcdc & 1)))
pixel = p.spPalette[(attrib & 7) * 4 + spdata];
if(p.layersMask & LAYER_MASK_OBJ)
{
if (spdata && (p.lcdc & 2) && (!((attrib | p.attrib) & 0x80) || !twdata || !(p.lcdc & 1)))
pixel = p.spPalette[(attrib & 7) * 4 + spdata];
}
} else {
do {
if (p.spwordList[i] & 3) {
@ -806,8 +828,11 @@ namespace M3Loop {
--i;
} while (i >= 0 && static_cast<int>(p.spriteList[i].spx) > xpos - 8);
if (spdata && (p.lcdc & 2) && (!(attrib & 0x80) || !twdata))
pixel = p.spPalette[(attrib >> 2 & 4) + spdata];
if(p.layersMask & LAYER_MASK_OBJ)
{
if (spdata && (p.lcdc & 2) && (!(attrib & 0x80) || !twdata))
pixel = p.spPalette[(attrib >> 2 & 4) + spdata];
}
}
}
@ -1445,6 +1470,7 @@ namespace gambatte {
PPUPriv::PPUPriv(NextM0Time &nextM0Time, const unsigned char *const oamram, const unsigned char *const vram) :
nextSprite(0),
currentSprite(0xFF),
layersMask(LAYER_MASK_BG|LAYER_MASK_OBJ),
vram(vram),
nextCallPtr(&M2::Ly0::f0_),
now(0),

View File

@ -27,6 +27,8 @@
namespace gambatte {
enum { LAYER_MASK_BG = 1, LAYER_MASK_OBJ = 2 };
class PPUFrameBuf {
uint_least32_t *buf_;
uint_least32_t *fbline_;
@ -57,6 +59,7 @@ struct PPUPriv {
unsigned short spwordList[11];
unsigned char nextSprite;
unsigned char currentSprite;
unsigned layersMask;
const unsigned char *vram;
const PPUState *nextCallPtr;
@ -129,6 +132,7 @@ public:
void speedChange(unsigned long cycleCounter);
unsigned long * spPalette() { return p_.spPalette; }
void update(unsigned long cc);
void setLayers(unsigned mask) { p_.layersMask = mask; }
template<bool isReader>void SyncState(NewState *ns);
};

Binary file not shown.