diff --git a/Core/BaseCartridge.cpp b/Core/BaseCartridge.cpp index fe689ae..0e10dcf 100644 --- a/Core/BaseCartridge.cpp +++ b/Core/BaseCartridge.cpp @@ -631,7 +631,7 @@ bool BaseCartridge::LoadGameboy(VirtualFile &romFile, bool sgbEnabled) _headerOffset = Gameboy::HeaderOffset; if(_gameboy->IsSgb()) { - EmulationConfig cfg = _console->GetSettings()->GetEmulationConfig(); + GameboyConfig cfg = _console->GetSettings()->GetGameboyConfig(); if(FirmwareHelper::LoadSgbFirmware(_console, &_prgRom, _prgRomSize, cfg.UseSgb2)) { LoadRom(); if(_coprocessorType != CoprocessorType::SGB) { diff --git a/Core/DefaultVideoFilter.cpp b/Core/DefaultVideoFilter.cpp index 8706b62..ad729c5 100644 --- a/Core/DefaultVideoFilter.cpp +++ b/Core/DefaultVideoFilter.cpp @@ -85,15 +85,15 @@ void DefaultVideoFilter::InitLookupTable() void DefaultVideoFilter::OnBeforeApplyFilter() { VideoConfig config = _console->GetSettings()->GetVideoConfig(); - EmulationConfig emulationConfig = _console->GetSettings()->GetEmulationConfig(); + GameboyConfig gbConfig = _console->GetSettings()->GetGameboyConfig(); ConsoleType consoleType = _console->GetConsoleType(); - bool adjustColors = emulationConfig.GbcAdjustColors && consoleType == ConsoleType::GameboyColor; + bool adjustColors = gbConfig.GbcAdjustColors && consoleType == ConsoleType::GameboyColor; if(_videoConfig.Hue != config.Hue || _videoConfig.Saturation != config.Saturation || _videoConfig.Contrast != config.Contrast || _videoConfig.Brightness != config.Brightness || _gbcAdjustColors != adjustColors) { _gbcAdjustColors = adjustColors; InitLookupTable(); } - _gbBlendFrames = emulationConfig.GbBlendFrames && (consoleType == ConsoleType::Gameboy || consoleType == ConsoleType::GameboyColor); + _gbBlendFrames = gbConfig.BlendFrames && (consoleType == ConsoleType::Gameboy || consoleType == ConsoleType::GameboyColor); _videoConfig = config; } diff --git a/Core/EmuSettings.cpp b/Core/EmuSettings.cpp index 3ff8a95..b6f8ed8 100644 --- a/Core/EmuSettings.cpp +++ b/Core/EmuSettings.cpp @@ -124,6 +124,16 @@ EmulationConfig EmuSettings::GetEmulationConfig() return _emulation; } +void EmuSettings::SetGameboyConfig(GameboyConfig config) +{ + _gameboy = config; +} + +GameboyConfig EmuSettings::GetGameboyConfig() +{ + return _gameboy; +} + void EmuSettings::SetPreferences(PreferencesConfig config) { ProcessString(_saveFolder, &config.SaveFolderOverride); diff --git a/Core/EmuSettings.h b/Core/EmuSettings.h index aad216b..c951c6f 100644 --- a/Core/EmuSettings.h +++ b/Core/EmuSettings.h @@ -15,6 +15,7 @@ private: AudioConfig _audio; InputConfig _input; EmulationConfig _emulation; + GameboyConfig _gameboy; PreferencesConfig _preferences; atomic _flags; @@ -54,6 +55,9 @@ public: void SetEmulationConfig(EmulationConfig config); EmulationConfig GetEmulationConfig(); + void SetGameboyConfig(GameboyConfig config); + GameboyConfig GetGameboyConfig(); + void SetPreferences(PreferencesConfig config); PreferencesConfig GetPreferences(); diff --git a/Core/Gameboy.cpp b/Core/Gameboy.cpp index b391258..e3e8c67 100644 --- a/Core/Gameboy.cpp +++ b/Core/Gameboy.cpp @@ -63,8 +63,8 @@ void Gameboy::Init(Console* console, GbCart* cart, std::vector& romData _hasBattery = header.HasBattery(); shared_ptr settings = console->GetSettings(); - EmulationConfig cfg = settings->GetEmulationConfig(); - GameboyModel model = cfg.GbModel; + GameboyConfig cfg = settings->GetGameboyConfig(); + GameboyModel model = cfg.Model; if(model == GameboyModel::Auto) { if((header.CgbFlag & 0x80) != 0) { model = GameboyModel::GameboyColor; diff --git a/Core/GbPpu.cpp b/Core/GbPpu.cpp index 0d91d99..5c1b470 100644 --- a/Core/GbPpu.cpp +++ b/Core/GbPpu.cpp @@ -3,6 +3,7 @@ #include "GbTypes.h" #include "EventType.h" #include "Console.h" +#include "EmuSettings.h" #include "Gameboy.h" #include "VideoDecoder.h" #include "RewindManager.h" @@ -14,7 +15,6 @@ #include "../Utilities/HexUtilities.h" #include "../Utilities/Serializer.h" -constexpr uint16_t bwRgbPalette[4] = { 0x7FFF, 0x6318, 0x318C, 0x0000 }; constexpr uint16_t evtColors[6] = { 0x18C6, 0x294A, 0x108C, 0x4210, 0x3084, 0x1184 }; void GbPpu::Init(Console* console, Gameboy* gameboy, GbMemoryManager* memoryManager, GbDmaController* dmaController, uint8_t* vram, uint8_t* oam) @@ -44,14 +44,7 @@ void GbPpu::Init(Console* console, Gameboy* gameboy, GbMemoryManager* memoryMana _state.CgbEnabled = _gameboy->IsCgb(); _lastFrameTime = 0; - if(!_gameboy->IsCgb()) { - for(int i = 0; i < 4; i++) { - //Init default palette for use with DMG - _state.CgbBgPalettes[i] = bwRgbPalette[i]; - _state.CgbObjPalettes[i] = bwRgbPalette[i]; - _state.CgbObjPalettes[i+4] = bwRgbPalette[i]; - } - } + UpdatePalette(); Write(0xFF48, 0xFF); Write(0xFF49, 0xFF); @@ -630,6 +623,8 @@ void GbPpu::SendFrame() return; } + UpdatePalette(); + _console->GetNotificationManager()->SendNotification(ConsoleNotificationType::PpuFrameDone); if(_isFirstFrame) { @@ -665,6 +660,24 @@ void GbPpu::SendFrame() _currentBuffer = _currentBuffer == _outputBuffers[0] ? _outputBuffers[1] : _outputBuffers[0]; } +void GbPpu::UpdatePalette() +{ + if(!_gameboy->IsCgb()) { + GameboyConfig cfg = _console->GetSettings()->GetGameboyConfig(); + for(int i = 0; i < 4; i++) { + //Set palette based on settings (DMG) + uint16_t bgColor = ((cfg.BgColors[i] & 0xF8) << 7) | ((cfg.BgColors[i] & 0xF800) >> 6) | ((cfg.BgColors[i] & 0xF80000) >> 19); + _state.CgbBgPalettes[i] = bgColor; + + uint16_t obj0Color = ((cfg.Obj0Colors[i] & 0xF8) << 7) | ((cfg.Obj0Colors[i] & 0xF800) >> 6) | ((cfg.Obj0Colors[i] & 0xF80000) >> 19); + _state.CgbObjPalettes[i] = obj0Color; + + uint16_t obj1Color = ((cfg.Obj1Colors[i] & 0xF8) << 7) | ((cfg.Obj1Colors[i] & 0xF800) >> 6) | ((cfg.Obj1Colors[i] & 0xF80000) >> 19); + _state.CgbObjPalettes[i + 4] = obj1Color; + } + } +} + uint8_t GbPpu::Read(uint16_t addr) { switch(addr) { diff --git a/Core/GbPpu.h b/Core/GbPpu.h index 2130304..979b557 100644 --- a/Core/GbPpu.h +++ b/Core/GbPpu.h @@ -68,6 +68,9 @@ private: void UpdateStatIrq(); + void SendFrame(); + void UpdatePalette(); + void WriteCgbPalette(uint8_t& pos, uint16_t* pal, bool autoInc, uint8_t value); public: @@ -88,8 +91,6 @@ public: void Exec(); - void SendFrame(); - uint8_t Read(uint16_t addr); void Write(uint16_t addr, uint8_t value); diff --git a/Core/SettingTypes.h b/Core/SettingTypes.h index 5eea82b..74a09ea 100644 --- a/Core/SettingTypes.h +++ b/Core/SettingTypes.h @@ -305,11 +305,17 @@ struct EmulationConfig RamState RamPowerOnState = RamState::Random; int64_t BsxCustomDate = -1; +}; - GameboyModel GbModel = GameboyModel::Auto; +struct GameboyConfig +{ + GameboyModel Model = GameboyModel::Auto; bool UseSgb2 = true; - bool GbBlendFrames = true; + bool BlendFrames = true; bool GbcAdjustColors = true; + uint32_t BgColors[4] = { 0xFFFFFF, 0xB0B0B0, 0x686868, 0x000000 }; + uint32_t Obj0Colors[4] = { 0xFFFFFF, 0xB0B0B0, 0x686868, 0x000000 }; + uint32_t Obj1Colors[4] = { 0xFFFFFF, 0xB0B0B0, 0x686868, 0x000000 }; }; struct PreferencesConfig diff --git a/Core/SuperGameboy.cpp b/Core/SuperGameboy.cpp index c58b053..853b439 100644 --- a/Core/SuperGameboy.cpp +++ b/Core/SuperGameboy.cpp @@ -256,7 +256,7 @@ void SuperGameboy::Run() void SuperGameboy::UpdateClockRatio() { - bool isSgb2 = _console->GetSettings()->GetEmulationConfig().UseSgb2; + bool isSgb2 = _console->GetSettings()->GetGameboyConfig().UseSgb2; uint32_t masterRate = isSgb2 ? 20971520 : _console->GetMasterClockRate(); uint8_t divider = 5; diff --git a/InteropDLL/ConfigApiWrapper.cpp b/InteropDLL/ConfigApiWrapper.cpp index a73641a..bf7ba42 100644 --- a/InteropDLL/ConfigApiWrapper.cpp +++ b/InteropDLL/ConfigApiWrapper.cpp @@ -28,6 +28,11 @@ extern "C" { { _console->GetSettings()->SetEmulationConfig(config); } + + DllExport void __stdcall SetGameboyConfig(GameboyConfig config) + { + _console->GetSettings()->SetGameboyConfig(config); + } DllExport void __stdcall SetPreferences(PreferencesConfig config) { diff --git a/InteropDLL/EmuApiWrapper.cpp b/InteropDLL/EmuApiWrapper.cpp index fd16451..df70145 100644 --- a/InteropDLL/EmuApiWrapper.cpp +++ b/InteropDLL/EmuApiWrapper.cpp @@ -269,9 +269,9 @@ extern "C" { _console.reset(new Console()); KeyManager::SetSettings(_console->GetSettings().get()); _console->Initialize(); - EmulationConfig cfg = _console->GetSettings()->GetEmulationConfig(); - cfg.GbModel = GameboyModel::GameboyColor; - _console->GetSettings()->SetEmulationConfig(cfg); + GameboyConfig cfg = _console->GetSettings()->GetGameboyConfig(); + cfg.Model = GameboyModel::GameboyColor; + _console->GetSettings()->SetGameboyConfig(cfg); _console->LoadRom((VirtualFile)testRoms[i], VirtualFile()); if(enableDebugger) { diff --git a/Libretro/libretro.cpp b/Libretro/libretro.cpp index fcf7263..779eaea 100644 --- a/Libretro/libretro.cpp +++ b/Libretro/libretro.cpp @@ -215,10 +215,12 @@ extern "C" { void update_settings() { struct retro_variable var = { }; - VideoConfig video = _console->GetSettings()->GetVideoConfig(); - AudioConfig audio = _console->GetSettings()->GetAudioConfig(); - EmulationConfig emulation = _console->GetSettings()->GetEmulationConfig(); - InputConfig input = _console->GetSettings()->GetInputConfig(); + shared_ptr settings = _console->GetSettings(); + VideoConfig video = settings->GetVideoConfig(); + AudioConfig audio = settings->GetAudioConfig(); + EmulationConfig emulation = settings->GetEmulationConfig(); + GameboyConfig gbConfig = settings->GetGameboyConfig(); + InputConfig input = settings->GetInputConfig(); video.Brightness = 0; video.Contrast = 0; video.Hue = 0; @@ -396,19 +398,19 @@ extern "C" { if(readVariable(MesenGbModel, var)) { string value = string(var.value); if(value == "Game Boy") { - emulation.GbModel = GameboyModel::Gameboy; + gbConfig.Model = GameboyModel::Gameboy; } else if(value == "Game Boy Color") { - emulation.GbModel = GameboyModel::GameboyColor; + gbConfig.Model = GameboyModel::GameboyColor; } else if(value == "Super Game Boy") { - emulation.GbModel = GameboyModel::SuperGameboy; + gbConfig.Model = GameboyModel::SuperGameboy; } else { - emulation.GbModel = GameboyModel::Auto; + gbConfig.Model = GameboyModel::Auto; } } if(readVariable(MesenGbSgb2, var)) { string value = string(var.value); - emulation.UseSgb2 = (value == "enabled"); + gbConfig.UseSgb2 = (value == "enabled"); } auto getKeyCode = [=](int port, int retroKey) { @@ -441,10 +443,11 @@ extern "C" { input.Controllers[2].Keys = getKeyBindings(2); input.Controllers[3].Keys = getKeyBindings(3); - _console->GetSettings()->SetVideoConfig(video); - _console->GetSettings()->SetEmulationConfig(emulation); - _console->GetSettings()->SetInputConfig(input); - _console->GetSettings()->SetAudioConfig(audio); + settings->SetVideoConfig(video); + settings->SetEmulationConfig(emulation); + settings->SetInputConfig(input); + settings->SetAudioConfig(audio); + settings->SetGameboyConfig(gbConfig); retro_system_av_info avInfo = {}; _renderer->GetSystemAudioVideoInfo(avInfo); diff --git a/UI/Config/Configuration.cs b/UI/Config/Configuration.cs index d664b36..1f3271d 100644 --- a/UI/Config/Configuration.cs +++ b/UI/Config/Configuration.cs @@ -19,6 +19,7 @@ namespace Mesen.GUI.Config public AudioConfig Audio; public InputConfig Input; public EmulationConfig Emulation; + public GameboyConfig Gameboy; public PreferencesConfig Preferences; public DebugInfo Debug; public RecentItems RecentFiles; @@ -39,6 +40,7 @@ namespace Mesen.GUI.Config Audio = new AudioConfig(); Input = new InputConfig(); Emulation = new EmulationConfig(); + Gameboy = new GameboyConfig(); Preferences = new PreferencesConfig(); AviRecord = new AviRecordConfig(); MovieRecord = new MovieRecordConfig(); @@ -73,6 +75,7 @@ namespace Mesen.GUI.Config Audio.ApplyConfig(); Input.ApplyConfig(); Emulation.ApplyConfig(); + Gameboy.ApplyConfig(); Preferences.ApplyConfig(); Debug.Debugger.ApplyConfig(); } diff --git a/UI/Config/EmulationConfig.cs b/UI/Config/EmulationConfig.cs index e787c5d..2d8e763 100644 --- a/UI/Config/EmulationConfig.cs +++ b/UI/Config/EmulationConfig.cs @@ -28,11 +28,6 @@ namespace Mesen.GUI.Config public RamState RamPowerOnState = RamState.Random; public long BsxCustomDate = -1; - - public GameboyModel GbModel = GameboyModel.Auto; - [MarshalAs(UnmanagedType.I1)] public bool UseSgb2 = true; - [MarshalAs(UnmanagedType.I1)] public bool GbBlendFrames = true; - [MarshalAs(UnmanagedType.I1)] public bool GbcAdjustColors = true; public void ApplyConfig() { @@ -53,12 +48,4 @@ namespace Mesen.GUI.Config AllZeros = 1, AllOnes = 2, } - - public enum GameboyModel - { - Auto = 0, - Gameboy = 1, - GameboyColor = 2, - SuperGameboy = 3 - } } diff --git a/UI/Config/GameboyConfig.cs b/UI/Config/GameboyConfig.cs new file mode 100644 index 0000000..376d815 --- /dev/null +++ b/UI/Config/GameboyConfig.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Mesen.GUI.Config +{ + [StructLayout(LayoutKind.Sequential)] + public class GameboyConfig : BaseConfig + { + public GameboyModel Model = GameboyModel.Auto; + [MarshalAs(UnmanagedType.I1)] public bool UseSgb2 = true; + + [MarshalAs(UnmanagedType.I1)] public bool BlendFrames = true; + [MarshalAs(UnmanagedType.I1)] public bool GbcAdjustColors = true; + + public UInt32 BgColor0 = 0xFFFFFF; + public UInt32 BgColor1 = 0xB0B0B0; + public UInt32 BgColor2 = 0x686868; + public UInt32 BgColor3 = 0x000000; + public UInt32 Obj0Color0 = 0xFFFFFF; + public UInt32 Obj0Color1 = 0xB0B0B0; + public UInt32 Obj0Color2 = 0x686868; + public UInt32 Obj0Color3 = 0x000000; + public UInt32 Obj1Color0 = 0xFFFFFF; + public UInt32 Obj1Color1 = 0xB0B0B0; + public UInt32 Obj1Color2 = 0x686868; + public UInt32 Obj1Color3 = 0x000000; + + public void ApplyConfig() + { + ConfigApi.SetGameboyConfig(this); + } + } + + public enum GameboyModel + { + Auto = 0, + Gameboy = 1, + GameboyColor = 2, + SuperGameboy = 3 + } +} diff --git a/UI/Dependencies/resources.en.xml b/UI/Dependencies/resources.en.xml index 3f2258b..1c6fb9a 100644 --- a/UI/Dependencies/resources.en.xml +++ b/UI/Dependencies/resources.en.xml @@ -293,9 +293,22 @@ Show Lag Counter Reset Counter - Game Boy - Game Boy Model + OK + Cancel + +
+ General + Model Use Super Game Boy 2 timings and behavior + + Video + Game Boy (DMG) Palette + Background: + Sprites #1: + Sprites #2: + Select Preset... + + LCD Settings Enable LCD frame blending Enable GBC LCD color emulation diff --git a/UI/Forms/Config/frmEmulationConfig.Designer.cs b/UI/Forms/Config/frmEmulationConfig.Designer.cs index 5e51f4a..25fffef 100644 --- a/UI/Forms/Config/frmEmulationConfig.Designer.cs +++ b/UI/Forms/Config/frmEmulationConfig.Designer.cs @@ -49,13 +49,6 @@ this.nudRewindSpeed = new Mesen.GUI.Controls.MesenNumericUpDown(); this.lblRewindSpeedHint = new System.Windows.Forms.Label(); this.cboRegion = new System.Windows.Forms.ComboBox(); - this.tpgGameboy = new System.Windows.Forms.TabPage(); - this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); - this.lblGameboy = new System.Windows.Forms.Label(); - this.cboGameboyModel = new System.Windows.Forms.ComboBox(); - this.chkUseSgb2 = new System.Windows.Forms.CheckBox(); - this.chkGbBlendFrames = new System.Windows.Forms.CheckBox(); - this.chkGbcAdjustColors = new System.Windows.Forms.CheckBox(); this.tpgBsx = new System.Windows.Forms.TabPage(); this.grpBsxDateTime = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); @@ -89,8 +82,6 @@ this.flowLayoutPanel9.SuspendLayout(); this.flowLayoutPanel6.SuspendLayout(); this.flowLayoutPanel10.SuspendLayout(); - this.tpgGameboy.SuspendLayout(); - this.tableLayoutPanel7.SuspendLayout(); this.tpgBsx.SuspendLayout(); this.grpBsxDateTime.SuspendLayout(); this.tableLayoutPanel6.SuspendLayout(); @@ -113,7 +104,6 @@ // tabMain // this.tabMain.Controls.Add(this.tpgGeneral); - this.tabMain.Controls.Add(this.tpgGameboy); this.tabMain.Controls.Add(this.tpgBsx); this.tabMain.Controls.Add(this.tpgAdvanced); this.tabMain.Controls.Add(this.tpgOverclocking); @@ -435,90 +425,6 @@ this.cboRegion.Size = new System.Drawing.Size(121, 21); this.cboRegion.TabIndex = 18; // - // tpgGameboy - // - this.tpgGameboy.Controls.Add(this.tableLayoutPanel7); - this.tpgGameboy.Location = new System.Drawing.Point(4, 22); - this.tpgGameboy.Name = "tpgGameboy"; - this.tpgGameboy.Padding = new System.Windows.Forms.Padding(3); - this.tpgGameboy.Size = new System.Drawing.Size(437, 264); - this.tpgGameboy.TabIndex = 6; - this.tpgGameboy.Text = "Game Boy"; - this.tpgGameboy.UseVisualStyleBackColor = true; - // - // tableLayoutPanel7 - // - this.tableLayoutPanel7.ColumnCount = 2; - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel7.Controls.Add(this.lblGameboy, 0, 0); - this.tableLayoutPanel7.Controls.Add(this.cboGameboyModel, 1, 0); - this.tableLayoutPanel7.Controls.Add(this.chkUseSgb2, 0, 1); - this.tableLayoutPanel7.Controls.Add(this.chkGbBlendFrames, 0, 2); - this.tableLayoutPanel7.Controls.Add(this.chkGbcAdjustColors, 0, 3); - this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel7.Name = "tableLayoutPanel7"; - this.tableLayoutPanel7.RowCount = 5; - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel7.Size = new System.Drawing.Size(431, 258); - this.tableLayoutPanel7.TabIndex = 0; - // - // lblGameboy - // - this.lblGameboy.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblGameboy.AutoSize = true; - this.lblGameboy.Location = new System.Drawing.Point(3, 7); - this.lblGameboy.Name = "lblGameboy"; - this.lblGameboy.Size = new System.Drawing.Size(91, 13); - this.lblGameboy.TabIndex = 0; - this.lblGameboy.Text = "Game Boy Model:"; - // - // cboGameboyModel - // - this.cboGameboyModel.FormattingEnabled = true; - this.cboGameboyModel.Location = new System.Drawing.Point(100, 3); - this.cboGameboyModel.Name = "cboGameboyModel"; - this.cboGameboyModel.Size = new System.Drawing.Size(119, 21); - this.cboGameboyModel.TabIndex = 1; - // - // chkUseSgb2 - // - this.chkUseSgb2.AutoSize = true; - this.tableLayoutPanel7.SetColumnSpan(this.chkUseSgb2, 2); - this.chkUseSgb2.Location = new System.Drawing.Point(3, 30); - this.chkUseSgb2.Name = "chkUseSgb2"; - this.chkUseSgb2.Size = new System.Drawing.Size(237, 17); - this.chkUseSgb2.TabIndex = 2; - this.chkUseSgb2.Text = "Use Super Game Boy 2 timings and behavior"; - this.chkUseSgb2.UseVisualStyleBackColor = true; - // - // chkGbBlendFrames - // - this.chkGbBlendFrames.AutoSize = true; - this.tableLayoutPanel7.SetColumnSpan(this.chkGbBlendFrames, 2); - this.chkGbBlendFrames.Location = new System.Drawing.Point(3, 53); - this.chkGbBlendFrames.Name = "chkGbBlendFrames"; - this.chkGbBlendFrames.Size = new System.Drawing.Size(155, 17); - this.chkGbBlendFrames.TabIndex = 3; - this.chkGbBlendFrames.Text = "Enable LCD frame blending"; - this.chkGbBlendFrames.UseVisualStyleBackColor = true; - // - // chkGbcAdjustColors - // - this.chkGbcAdjustColors.AutoSize = true; - this.tableLayoutPanel7.SetColumnSpan(this.chkGbcAdjustColors, 2); - this.chkGbcAdjustColors.Location = new System.Drawing.Point(3, 76); - this.chkGbcAdjustColors.Name = "chkGbcAdjustColors"; - this.chkGbcAdjustColors.Size = new System.Drawing.Size(182, 17); - this.chkGbcAdjustColors.TabIndex = 4; - this.chkGbcAdjustColors.Text = "Enable GBC LCD color emulation"; - this.chkGbcAdjustColors.UseVisualStyleBackColor = true; - // // tpgBsx // this.tpgBsx.Controls.Add(this.grpBsxDateTime); @@ -935,9 +841,6 @@ this.flowLayoutPanel6.PerformLayout(); this.flowLayoutPanel10.ResumeLayout(false); this.flowLayoutPanel10.PerformLayout(); - this.tpgGameboy.ResumeLayout(false); - this.tableLayoutPanel7.ResumeLayout(false); - this.tableLayoutPanel7.PerformLayout(); this.tpgBsx.ResumeLayout(false); this.grpBsxDateTime.ResumeLayout(false); this.tableLayoutPanel6.ResumeLayout(false); @@ -1008,12 +911,5 @@ private System.Windows.Forms.RadioButton radBsxCustomTime; private System.Windows.Forms.DateTimePicker dtpBsxCustomTime; private System.Windows.Forms.DateTimePicker dtpBsxCustomDate; - private System.Windows.Forms.TabPage tpgGameboy; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7; - private System.Windows.Forms.Label lblGameboy; - private System.Windows.Forms.ComboBox cboGameboyModel; - private System.Windows.Forms.CheckBox chkUseSgb2; - private System.Windows.Forms.CheckBox chkGbBlendFrames; - private System.Windows.Forms.CheckBox chkGbcAdjustColors; } } \ No newline at end of file diff --git a/UI/Forms/Config/frmEmulationConfig.cs b/UI/Forms/Config/frmEmulationConfig.cs index 66eca18..a32c8f3 100644 --- a/UI/Forms/Config/frmEmulationConfig.cs +++ b/UI/Forms/Config/frmEmulationConfig.cs @@ -37,11 +37,6 @@ namespace Mesen.GUI.Forms.Config AddBinding(nameof(EmulationConfig.PpuExtraScanlinesBeforeNmi), nudExtraScanlinesBeforeNmi); AddBinding(nameof(EmulationConfig.PpuExtraScanlinesAfterNmi), nudExtraScanlinesAfterNmi); AddBinding(nameof(EmulationConfig.GsuClockSpeed), nudGsuClockSpeed); - - AddBinding(nameof(EmulationConfig.GbModel), cboGameboyModel); - AddBinding(nameof(EmulationConfig.UseSgb2), chkUseSgb2); - AddBinding(nameof(EmulationConfig.GbBlendFrames), chkGbBlendFrames); - AddBinding(nameof(EmulationConfig.GbcAdjustColors), chkGbcAdjustColors); long customDate = ConfigManager.Config.Emulation.BsxCustomDate; if(customDate >= 0) { diff --git a/UI/Forms/Config/frmGameboyConfig.Designer.cs b/UI/Forms/Config/frmGameboyConfig.Designer.cs new file mode 100644 index 0000000..2d19b76 --- /dev/null +++ b/UI/Forms/Config/frmGameboyConfig.Designer.cs @@ -0,0 +1,558 @@ +namespace Mesen.GUI.Forms.Config +{ + partial class frmGameboyConfig + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.tabMain = new System.Windows.Forms.TabControl(); + this.tpgGeneral = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.lblModel = new System.Windows.Forms.Label(); + this.cboGameboyModel = new System.Windows.Forms.ComboBox(); + this.chkUseSgb2 = new System.Windows.Forms.CheckBox(); + this.tpgVideo = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel8 = new System.Windows.Forms.TableLayoutPanel(); + this.lblGbObj0 = new System.Windows.Forms.Label(); + this.picGbBgPal0 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbBgPal1 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbBgPal2 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbBgPal3 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.btnSelectPreset = new System.Windows.Forms.Button(); + this.picGbObj0Pal0 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbObj0Pal1 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbObj0Pal2 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbObj0Pal3 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbObj1Pal0 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbObj1Pal1 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbObj1Pal2 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.picGbObj1Pal3 = new Mesen.GUI.Debugger.ctrlColorPicker(); + this.lblGbBackground = new System.Windows.Forms.Label(); + this.lblGbObj1 = new System.Windows.Forms.Label(); + this.chkGbcAdjustColors = new System.Windows.Forms.CheckBox(); + this.chkGbBlendFrames = new System.Windows.Forms.CheckBox(); + this.lblGameboyPalette = new System.Windows.Forms.Label(); + this.lblLcdSettings = new System.Windows.Forms.Label(); + this.ctxGbColorPresets = new System.Windows.Forms.ContextMenuStrip(this.components); + this.mnuGbColorPresetGrayscale = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuGbColorPresetGreen = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuGbColorPresetBrown = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuGbColorPresetGrayscaleConstrast = new System.Windows.Forms.ToolStripMenuItem(); + this.tabMain.SuspendLayout(); + this.tpgGeneral.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.tpgVideo.SuspendLayout(); + this.tableLayoutPanel7.SuspendLayout(); + this.tableLayoutPanel8.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picGbBgPal0)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbBgPal1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbBgPal2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbBgPal3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj0Pal0)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj0Pal1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj0Pal2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj0Pal3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj1Pal0)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj1Pal1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj1Pal2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj1Pal3)).BeginInit(); + this.ctxGbColorPresets.SuspendLayout(); + this.SuspendLayout(); + // + // baseConfigPanel + // + this.baseConfigPanel.Location = new System.Drawing.Point(0, 290); + this.baseConfigPanel.Size = new System.Drawing.Size(445, 29); + this.baseConfigPanel.TabIndex = 4; + // + // tabMain + // + this.tabMain.Controls.Add(this.tpgGeneral); + this.tabMain.Controls.Add(this.tpgVideo); + this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabMain.Location = new System.Drawing.Point(0, 0); + this.tabMain.Name = "tabMain"; + this.tabMain.SelectedIndex = 0; + this.tabMain.Size = new System.Drawing.Size(445, 290); + this.tabMain.TabIndex = 2; + // + // tpgGeneral + // + this.tpgGeneral.Controls.Add(this.tableLayoutPanel1); + this.tpgGeneral.Location = new System.Drawing.Point(4, 22); + this.tpgGeneral.Name = "tpgGeneral"; + this.tpgGeneral.Padding = new System.Windows.Forms.Padding(3); + this.tpgGeneral.Size = new System.Drawing.Size(437, 264); + this.tpgGeneral.TabIndex = 2; + this.tpgGeneral.Text = "General"; + this.tpgGeneral.UseVisualStyleBackColor = true; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.lblModel, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.cboGameboyModel, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.chkUseSgb2, 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 = 3; + 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(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(431, 258); + this.tableLayoutPanel1.TabIndex = 0; + // + // lblModel + // + this.lblModel.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblModel.AutoSize = true; + this.lblModel.Location = new System.Drawing.Point(3, 7); + this.lblModel.Name = "lblModel"; + this.lblModel.Size = new System.Drawing.Size(39, 13); + this.lblModel.TabIndex = 0; + this.lblModel.Text = "Model:"; + // + // cboGameboyModel + // + this.cboGameboyModel.FormattingEnabled = true; + this.cboGameboyModel.Location = new System.Drawing.Point(48, 3); + this.cboGameboyModel.Name = "cboGameboyModel"; + this.cboGameboyModel.Size = new System.Drawing.Size(119, 21); + this.cboGameboyModel.TabIndex = 1; + // + // chkUseSgb2 + // + this.chkUseSgb2.AutoSize = true; + this.tableLayoutPanel1.SetColumnSpan(this.chkUseSgb2, 2); + this.chkUseSgb2.Location = new System.Drawing.Point(3, 30); + this.chkUseSgb2.Name = "chkUseSgb2"; + this.chkUseSgb2.Size = new System.Drawing.Size(237, 17); + this.chkUseSgb2.TabIndex = 2; + this.chkUseSgb2.Text = "Use Super Game Boy 2 timings and behavior"; + this.chkUseSgb2.UseVisualStyleBackColor = true; + // + // tpgVideo + // + this.tpgVideo.Controls.Add(this.tableLayoutPanel7); + this.tpgVideo.Location = new System.Drawing.Point(4, 22); + this.tpgVideo.Name = "tpgVideo"; + this.tpgVideo.Padding = new System.Windows.Forms.Padding(3); + this.tpgVideo.Size = new System.Drawing.Size(437, 264); + this.tpgVideo.TabIndex = 6; + this.tpgVideo.Text = "Video"; + this.tpgVideo.UseVisualStyleBackColor = true; + // + // tableLayoutPanel7 + // + this.tableLayoutPanel7.ColumnCount = 1; + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel7.Controls.Add(this.tableLayoutPanel8, 0, 1); + this.tableLayoutPanel7.Controls.Add(this.chkGbcAdjustColors, 0, 3); + this.tableLayoutPanel7.Controls.Add(this.chkGbBlendFrames, 0, 4); + this.tableLayoutPanel7.Controls.Add(this.lblGameboyPalette, 0, 0); + this.tableLayoutPanel7.Controls.Add(this.lblLcdSettings, 0, 2); + this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel7.Name = "tableLayoutPanel7"; + this.tableLayoutPanel7.RowCount = 6; + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel7.Size = new System.Drawing.Size(431, 258); + this.tableLayoutPanel7.TabIndex = 0; + // + // tableLayoutPanel8 + // + this.tableLayoutPanel8.ColumnCount = 6; + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel8.Controls.Add(this.lblGbObj0, 0, 1); + this.tableLayoutPanel8.Controls.Add(this.picGbBgPal0, 1, 0); + this.tableLayoutPanel8.Controls.Add(this.picGbBgPal1, 2, 0); + this.tableLayoutPanel8.Controls.Add(this.picGbBgPal2, 3, 0); + this.tableLayoutPanel8.Controls.Add(this.picGbBgPal3, 4, 0); + this.tableLayoutPanel8.Controls.Add(this.btnSelectPreset, 5, 0); + this.tableLayoutPanel8.Controls.Add(this.picGbObj0Pal0, 1, 1); + this.tableLayoutPanel8.Controls.Add(this.picGbObj0Pal1, 2, 1); + this.tableLayoutPanel8.Controls.Add(this.picGbObj0Pal2, 3, 1); + this.tableLayoutPanel8.Controls.Add(this.picGbObj0Pal3, 4, 1); + this.tableLayoutPanel8.Controls.Add(this.picGbObj1Pal0, 1, 2); + this.tableLayoutPanel8.Controls.Add(this.picGbObj1Pal1, 2, 2); + this.tableLayoutPanel8.Controls.Add(this.picGbObj1Pal2, 3, 2); + this.tableLayoutPanel8.Controls.Add(this.picGbObj1Pal3, 4, 2); + this.tableLayoutPanel8.Controls.Add(this.lblGbBackground, 0, 0); + this.tableLayoutPanel8.Controls.Add(this.lblGbObj1, 0, 2); + this.tableLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel8.Location = new System.Drawing.Point(0, 20); + this.tableLayoutPanel8.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel8.Name = "tableLayoutPanel8"; + this.tableLayoutPanel8.RowCount = 4; + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel8.Size = new System.Drawing.Size(431, 83); + this.tableLayoutPanel8.TabIndex = 7; + // + // lblGbObj0 + // + this.lblGbObj0.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblGbObj0.AutoSize = true; + this.lblGbObj0.Location = new System.Drawing.Point(3, 36); + this.lblGbObj0.Name = "lblGbObj0"; + this.lblGbObj0.Size = new System.Drawing.Size(58, 13); + this.lblGbObj0.TabIndex = 21; + this.lblGbObj0.Text = "Sprites #1:"; + // + // picGbBgPal0 + // + this.picGbBgPal0.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbBgPal0.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbBgPal0.Location = new System.Drawing.Point(77, 3); + this.picGbBgPal0.Name = "picGbBgPal0"; + this.picGbBgPal0.Size = new System.Drawing.Size(21, 21); + this.picGbBgPal0.TabIndex = 10; + this.picGbBgPal0.TabStop = false; + // + // picGbBgPal1 + // + this.picGbBgPal1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbBgPal1.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbBgPal1.Location = new System.Drawing.Point(104, 3); + this.picGbBgPal1.Name = "picGbBgPal1"; + this.picGbBgPal1.Size = new System.Drawing.Size(21, 21); + this.picGbBgPal1.TabIndex = 7; + this.picGbBgPal1.TabStop = false; + // + // picGbBgPal2 + // + this.picGbBgPal2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbBgPal2.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbBgPal2.Location = new System.Drawing.Point(131, 3); + this.picGbBgPal2.Name = "picGbBgPal2"; + this.picGbBgPal2.Size = new System.Drawing.Size(21, 21); + this.picGbBgPal2.TabIndex = 8; + this.picGbBgPal2.TabStop = false; + // + // picGbBgPal3 + // + this.picGbBgPal3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbBgPal3.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbBgPal3.Location = new System.Drawing.Point(158, 3); + this.picGbBgPal3.Name = "picGbBgPal3"; + this.picGbBgPal3.Size = new System.Drawing.Size(21, 21); + this.picGbBgPal3.TabIndex = 9; + this.picGbBgPal3.TabStop = false; + // + // btnSelectPreset + // + this.btnSelectPreset.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.btnSelectPreset.AutoSize = true; + this.btnSelectPreset.Image = global::Mesen.GUI.Properties.Resources.DownArrow; + this.btnSelectPreset.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.btnSelectPreset.Location = new System.Drawing.Point(185, 3); + this.btnSelectPreset.Name = "btnSelectPreset"; + this.btnSelectPreset.Padding = new System.Windows.Forms.Padding(0, 0, 3, 0); + this.btnSelectPreset.Size = new System.Drawing.Size(99, 23); + this.btnSelectPreset.TabIndex = 11; + this.btnSelectPreset.Text = "Select Preset..."; + this.btnSelectPreset.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; + this.btnSelectPreset.UseVisualStyleBackColor = true; + this.btnSelectPreset.Click += new System.EventHandler(this.btnSelectPreset_Click); + // + // picGbObj0Pal0 + // + this.picGbObj0Pal0.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbObj0Pal0.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbObj0Pal0.Location = new System.Drawing.Point(77, 32); + this.picGbObj0Pal0.Name = "picGbObj0Pal0"; + this.picGbObj0Pal0.Size = new System.Drawing.Size(21, 21); + this.picGbObj0Pal0.TabIndex = 12; + this.picGbObj0Pal0.TabStop = false; + // + // picGbObj0Pal1 + // + this.picGbObj0Pal1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbObj0Pal1.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbObj0Pal1.Location = new System.Drawing.Point(104, 32); + this.picGbObj0Pal1.Name = "picGbObj0Pal1"; + this.picGbObj0Pal1.Size = new System.Drawing.Size(21, 21); + this.picGbObj0Pal1.TabIndex = 13; + this.picGbObj0Pal1.TabStop = false; + // + // picGbObj0Pal2 + // + this.picGbObj0Pal2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbObj0Pal2.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbObj0Pal2.Location = new System.Drawing.Point(131, 32); + this.picGbObj0Pal2.Name = "picGbObj0Pal2"; + this.picGbObj0Pal2.Size = new System.Drawing.Size(21, 21); + this.picGbObj0Pal2.TabIndex = 14; + this.picGbObj0Pal2.TabStop = false; + // + // picGbObj0Pal3 + // + this.picGbObj0Pal3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbObj0Pal3.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbObj0Pal3.Location = new System.Drawing.Point(158, 32); + this.picGbObj0Pal3.Name = "picGbObj0Pal3"; + this.picGbObj0Pal3.Size = new System.Drawing.Size(21, 21); + this.picGbObj0Pal3.TabIndex = 15; + this.picGbObj0Pal3.TabStop = false; + // + // picGbObj1Pal0 + // + this.picGbObj1Pal0.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbObj1Pal0.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbObj1Pal0.Location = new System.Drawing.Point(77, 59); + this.picGbObj1Pal0.Name = "picGbObj1Pal0"; + this.picGbObj1Pal0.Size = new System.Drawing.Size(21, 21); + this.picGbObj1Pal0.TabIndex = 16; + this.picGbObj1Pal0.TabStop = false; + // + // picGbObj1Pal1 + // + this.picGbObj1Pal1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbObj1Pal1.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbObj1Pal1.Location = new System.Drawing.Point(104, 59); + this.picGbObj1Pal1.Name = "picGbObj1Pal1"; + this.picGbObj1Pal1.Size = new System.Drawing.Size(21, 21); + this.picGbObj1Pal1.TabIndex = 17; + this.picGbObj1Pal1.TabStop = false; + // + // picGbObj1Pal2 + // + this.picGbObj1Pal2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbObj1Pal2.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbObj1Pal2.Location = new System.Drawing.Point(131, 59); + this.picGbObj1Pal2.Name = "picGbObj1Pal2"; + this.picGbObj1Pal2.Size = new System.Drawing.Size(21, 21); + this.picGbObj1Pal2.TabIndex = 18; + this.picGbObj1Pal2.TabStop = false; + // + // picGbObj1Pal3 + // + this.picGbObj1Pal3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picGbObj1Pal3.Cursor = System.Windows.Forms.Cursors.Hand; + this.picGbObj1Pal3.Location = new System.Drawing.Point(158, 59); + this.picGbObj1Pal3.Name = "picGbObj1Pal3"; + this.picGbObj1Pal3.Size = new System.Drawing.Size(21, 21); + this.picGbObj1Pal3.TabIndex = 19; + this.picGbObj1Pal3.TabStop = false; + // + // lblGbBackground + // + this.lblGbBackground.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblGbBackground.AutoSize = true; + this.lblGbBackground.Location = new System.Drawing.Point(3, 8); + this.lblGbBackground.Name = "lblGbBackground"; + this.lblGbBackground.Size = new System.Drawing.Size(68, 13); + this.lblGbBackground.TabIndex = 20; + this.lblGbBackground.Text = "Background:"; + // + // lblGbObj1 + // + this.lblGbObj1.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblGbObj1.AutoSize = true; + this.lblGbObj1.Location = new System.Drawing.Point(3, 63); + this.lblGbObj1.Name = "lblGbObj1"; + this.lblGbObj1.Size = new System.Drawing.Size(58, 13); + this.lblGbObj1.TabIndex = 22; + this.lblGbObj1.Text = "Sprites #2:"; + // + // chkGbcAdjustColors + // + this.chkGbcAdjustColors.AutoSize = true; + this.chkGbcAdjustColors.Location = new System.Drawing.Point(3, 126); + this.chkGbcAdjustColors.Name = "chkGbcAdjustColors"; + this.chkGbcAdjustColors.Size = new System.Drawing.Size(182, 17); + this.chkGbcAdjustColors.TabIndex = 4; + this.chkGbcAdjustColors.Text = "Enable GBC LCD color emulation"; + this.chkGbcAdjustColors.UseVisualStyleBackColor = true; + // + // chkGbBlendFrames + // + this.chkGbBlendFrames.AutoSize = true; + this.chkGbBlendFrames.Location = new System.Drawing.Point(3, 149); + this.chkGbBlendFrames.Name = "chkGbBlendFrames"; + this.chkGbBlendFrames.Size = new System.Drawing.Size(155, 17); + this.chkGbBlendFrames.TabIndex = 3; + this.chkGbBlendFrames.Text = "Enable LCD frame blending"; + this.chkGbBlendFrames.UseVisualStyleBackColor = true; + // + // lblGameboyPalette + // + this.lblGameboyPalette.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblGameboyPalette.AutoSize = true; + this.lblGameboyPalette.ForeColor = System.Drawing.SystemColors.GrayText; + this.lblGameboyPalette.Location = new System.Drawing.Point(0, 7); + this.lblGameboyPalette.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); + this.lblGameboyPalette.Name = "lblGameboyPalette"; + this.lblGameboyPalette.Size = new System.Drawing.Size(126, 13); + this.lblGameboyPalette.TabIndex = 27; + this.lblGameboyPalette.Text = "Game Boy (DMG) Palette"; + // + // lblLcdSettings + // + this.lblLcdSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblLcdSettings.AutoSize = true; + this.lblLcdSettings.ForeColor = System.Drawing.SystemColors.GrayText; + this.lblLcdSettings.Location = new System.Drawing.Point(0, 110); + this.lblLcdSettings.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); + this.lblLcdSettings.Name = "lblLcdSettings"; + this.lblLcdSettings.Size = new System.Drawing.Size(69, 13); + this.lblLcdSettings.TabIndex = 28; + this.lblLcdSettings.Text = "LCD Settings"; + // + // ctxGbColorPresets + // + this.ctxGbColorPresets.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuGbColorPresetGrayscale, + this.mnuGbColorPresetGrayscaleConstrast, + this.mnuGbColorPresetGreen, + this.mnuGbColorPresetBrown}); + this.ctxGbColorPresets.Name = "contextPicturePresets"; + this.ctxGbColorPresets.Size = new System.Drawing.Size(208, 114); + // + // mnuGbColorPresetGrayscale + // + this.mnuGbColorPresetGrayscale.Name = "mnuGbColorPresetGrayscale"; + this.mnuGbColorPresetGrayscale.Size = new System.Drawing.Size(207, 22); + this.mnuGbColorPresetGrayscale.Text = "Grayscale"; + this.mnuGbColorPresetGrayscale.Click += new System.EventHandler(this.mnuGbColorPresetGrayscale_Click); + // + // mnuGbColorPresetGreen + // + this.mnuGbColorPresetGreen.Name = "mnuGbColorPresetGreen"; + this.mnuGbColorPresetGreen.Size = new System.Drawing.Size(207, 22); + this.mnuGbColorPresetGreen.Text = "Green"; + this.mnuGbColorPresetGreen.Click += new System.EventHandler(this.mnuGbColorPresetGreen_Click); + // + // mnuGbColorPresetBrown + // + this.mnuGbColorPresetBrown.Name = "mnuGbColorPresetBrown"; + this.mnuGbColorPresetBrown.Size = new System.Drawing.Size(207, 22); + this.mnuGbColorPresetBrown.Text = "Brown"; + this.mnuGbColorPresetBrown.Click += new System.EventHandler(this.mnuGbColorPresetBrown_Click); + // + // mnuGbColorPresetGrayscaleConstrast + // + this.mnuGbColorPresetGrayscaleConstrast.Name = "mnuGbColorPresetGrayscaleConstrast"; + this.mnuGbColorPresetGrayscaleConstrast.Size = new System.Drawing.Size(207, 22); + this.mnuGbColorPresetGrayscaleConstrast.Text = "Grayscale (High contrast)"; + this.mnuGbColorPresetGrayscaleConstrast.Click += new System.EventHandler(this.mnuGbColorPresetGrayscaleConstrast_Click); + // + // frmGameboyConfig + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(445, 319); + this.Controls.Add(this.tabMain); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "frmGameboyConfig"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Game Boy Config"; + this.Controls.SetChildIndex(this.baseConfigPanel, 0); + this.Controls.SetChildIndex(this.tabMain, 0); + this.tabMain.ResumeLayout(false); + this.tpgGeneral.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.tpgVideo.ResumeLayout(false); + this.tableLayoutPanel7.ResumeLayout(false); + this.tableLayoutPanel7.PerformLayout(); + this.tableLayoutPanel8.ResumeLayout(false); + this.tableLayoutPanel8.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picGbBgPal0)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbBgPal1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbBgPal2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbBgPal3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj0Pal0)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj0Pal1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj0Pal2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj0Pal3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj1Pal0)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj1Pal1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj1Pal2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picGbObj1Pal3)).EndInit(); + this.ctxGbColorPresets.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TabControl tabMain; + private System.Windows.Forms.TabPage tpgGeneral; + private System.Windows.Forms.TabPage tpgVideo; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7; + private System.Windows.Forms.Label lblModel; + private System.Windows.Forms.ComboBox cboGameboyModel; + private System.Windows.Forms.CheckBox chkUseSgb2; + private System.Windows.Forms.CheckBox chkGbBlendFrames; + private System.Windows.Forms.CheckBox chkGbcAdjustColors; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel8; + private Debugger.ctrlColorPicker picGbBgPal1; + private Debugger.ctrlColorPicker picGbBgPal0; + private Debugger.ctrlColorPicker picGbBgPal2; + private Debugger.ctrlColorPicker picGbBgPal3; + private System.Windows.Forms.Button btnSelectPreset; + private System.Windows.Forms.ContextMenuStrip ctxGbColorPresets; + private System.Windows.Forms.ToolStripMenuItem mnuGbColorPresetGreen; + private System.Windows.Forms.ToolStripMenuItem mnuGbColorPresetGrayscale; + private System.Windows.Forms.ToolStripMenuItem mnuGbColorPresetBrown; + private System.Windows.Forms.Label lblGbObj0; + private Debugger.ctrlColorPicker picGbObj0Pal0; + private Debugger.ctrlColorPicker picGbObj0Pal1; + private Debugger.ctrlColorPicker picGbObj0Pal2; + private Debugger.ctrlColorPicker picGbObj0Pal3; + private Debugger.ctrlColorPicker picGbObj1Pal0; + private Debugger.ctrlColorPicker picGbObj1Pal1; + private Debugger.ctrlColorPicker picGbObj1Pal2; + private Debugger.ctrlColorPicker picGbObj1Pal3; + private System.Windows.Forms.Label lblGbBackground; + private System.Windows.Forms.Label lblGbObj1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label lblGameboyPalette; + private System.Windows.Forms.Label lblLcdSettings; + private System.Windows.Forms.ToolStripMenuItem mnuGbColorPresetGrayscaleConstrast; + } +} \ No newline at end of file diff --git a/UI/Forms/Config/frmGameboyConfig.cs b/UI/Forms/Config/frmGameboyConfig.cs new file mode 100644 index 0000000..c528706 --- /dev/null +++ b/UI/Forms/Config/frmGameboyConfig.cs @@ -0,0 +1,95 @@ +using Mesen.GUI.Config; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Mesen.GUI.Forms.Config +{ + public partial class frmGameboyConfig : BaseConfigForm + { + public frmGameboyConfig() + { + InitializeComponent(); + if(DesignMode) { + return; + } + + Entity = ConfigManager.Config.Gameboy.Clone(); + + AddBinding(nameof(GameboyConfig.Model), cboGameboyModel); + AddBinding(nameof(GameboyConfig.UseSgb2), chkUseSgb2); + AddBinding(nameof(GameboyConfig.BlendFrames), chkGbBlendFrames); + AddBinding(nameof(GameboyConfig.GbcAdjustColors), chkGbcAdjustColors); + + AddBinding(nameof(GameboyConfig.BgColor0), picGbBgPal0); + AddBinding(nameof(GameboyConfig.BgColor1), picGbBgPal1); + AddBinding(nameof(GameboyConfig.BgColor2), picGbBgPal2); + AddBinding(nameof(GameboyConfig.BgColor3), picGbBgPal3); + + AddBinding(nameof(GameboyConfig.Obj0Color0), picGbObj0Pal0); + AddBinding(nameof(GameboyConfig.Obj0Color1), picGbObj0Pal1); + AddBinding(nameof(GameboyConfig.Obj0Color2), picGbObj0Pal2); + AddBinding(nameof(GameboyConfig.Obj0Color3), picGbObj0Pal3); + + AddBinding(nameof(GameboyConfig.Obj1Color0), picGbObj1Pal0); + AddBinding(nameof(GameboyConfig.Obj1Color1), picGbObj1Pal1); + AddBinding(nameof(GameboyConfig.Obj1Color2), picGbObj1Pal2); + AddBinding(nameof(GameboyConfig.Obj1Color3), picGbObj1Pal3); + } + + protected override void OnApply() + { + ConfigManager.Config.Gameboy = (GameboyConfig)this.Entity; + ConfigManager.ApplyChanges(); + } + + private void btnSelectPreset_Click(object sender, EventArgs e) + { + ctxGbColorPresets.Show(btnSelectPreset.PointToScreen(new Point(0, btnSelectPreset.Height - 1))); + } + + private void mnuGbColorPresetGrayscale_Click(object sender, EventArgs e) + { + SetPalette(Color.FromArgb(232, 232, 232), Color.FromArgb(160, 160, 160), Color.FromArgb(88, 88, 88), Color.FromArgb(16, 16, 16)); + } + + private void mnuGbColorPresetGrayscaleConstrast_Click(object sender, EventArgs e) + { + SetPalette(Color.FromArgb(255, 255, 255), Color.FromArgb(176, 176, 176), Color.FromArgb(104, 104, 104), Color.FromArgb(0, 0, 0)); + } + + private void mnuGbColorPresetGreen_Click(object sender, EventArgs e) + { + SetPalette(Color.FromArgb(224, 248, 208), Color.FromArgb(136, 192, 112), Color.FromArgb(52, 104, 86), Color.FromArgb(8, 24, 32)); + } + + private void mnuGbColorPresetBrown_Click(object sender, EventArgs e) + { + SetPalette(Color.FromArgb(248, 224, 136), Color.FromArgb(216, 176, 88), Color.FromArgb(152, 120, 56), Color.FromArgb(72, 56, 24)); + } + + private void SetPalette(Color color0, Color color1, Color color2, Color color3) + { + picGbBgPal0.BackColor = color0; + picGbBgPal1.BackColor = color1; + picGbBgPal2.BackColor = color2; + picGbBgPal3.BackColor = color3; + + picGbObj0Pal0.BackColor = color0; + picGbObj0Pal1.BackColor = color1; + picGbObj0Pal2.BackColor = color2; + picGbObj0Pal3.BackColor = color3; + + picGbObj1Pal0.BackColor = color0; + picGbObj1Pal1.BackColor = color1; + picGbObj1Pal2.BackColor = color2; + picGbObj1Pal3.BackColor = color3; + } + } +} diff --git a/UI/Forms/Config/frmGameboyConfig.resx b/UI/Forms/Config/frmGameboyConfig.resx new file mode 100644 index 0000000..2e067af --- /dev/null +++ b/UI/Forms/Config/frmGameboyConfig.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 107, 17 + + \ No newline at end of file diff --git a/UI/Forms/EntityBinder.cs b/UI/Forms/EntityBinder.cs index a75d1f0..b9d1876 100644 --- a/UI/Forms/EntityBinder.cs +++ b/UI/Forms/EntityBinder.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Globalization; using System.Linq; using System.Reflection; @@ -87,7 +88,11 @@ namespace Mesen.GUI.Forms } else if(kvp.Value is RadioButton) { ((RadioButton)kvp.Value).Checked = (bool)value; } else if(kvp.Value is PictureBox) { - ((PictureBox)kvp.Value).BackColor = (XmlColor)value; + if(value is UInt32) { + ((PictureBox)kvp.Value).BackColor = Color.FromArgb((int)(0xFF000000 | (UInt32)value)); + } else { + ((PictureBox)kvp.Value).BackColor = (XmlColor)value; + } } else if(kvp.Value is Panel) { RadioButton radio = ((Panel)kvp.Value).Controls.OfType().FirstOrDefault(r => r.Tag.Equals(value)); if(radio != null) { @@ -234,7 +239,11 @@ namespace Mesen.GUI.Forms } else if(kvp.Value is RadioButton) { field.SetValue(Entity, ((RadioButton)kvp.Value).Checked); } else if(kvp.Value is PictureBox) { - field.SetValue(Entity, (XmlColor)((PictureBox)kvp.Value).BackColor); + if(field.FieldType == typeof(UInt32)) { + field.SetValue(Entity, (UInt32)((PictureBox)kvp.Value).BackColor.ToArgb() & 0xFFFFFF); + } else { + field.SetValue(Entity, (XmlColor)((PictureBox)kvp.Value).BackColor); + } } else if(kvp.Value is Panel) { field.SetValue(Entity, ((Panel)kvp.Value).Controls.OfType().FirstOrDefault(r => r.Checked).Tag); } else if(kvp.Value is ctrlTrackbar) { diff --git a/UI/Forms/frmMain.Designer.cs b/UI/Forms/frmMain.Designer.cs index 4554607..c56178f 100644 --- a/UI/Forms/frmMain.Designer.cs +++ b/UI/Forms/frmMain.Designer.cs @@ -110,6 +110,8 @@ this.mnuInputConfig = new System.Windows.Forms.ToolStripMenuItem(); this.mnuVideoConfig = new System.Windows.Forms.ToolStripMenuItem(); this.mnuEmulationConfig = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem22 = new System.Windows.Forms.ToolStripSeparator(); + this.mnuGameboyConfig = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); this.mnuPreferences = new System.Windows.Forms.ToolStripMenuItem(); this.mnuTools = new System.Windows.Forms.ToolStripMenuItem(); @@ -347,6 +349,8 @@ this.mnuInputConfig, this.mnuVideoConfig, this.mnuEmulationConfig, + this.toolStripMenuItem22, + this.mnuGameboyConfig, this.toolStripMenuItem3, this.mnuPreferences}); this.mnuOptions.Name = "mnuOptions"; @@ -372,7 +376,7 @@ this.mnuShowFPS}); this.mnuEmulationSpeed.Image = global::Mesen.GUI.Properties.Resources.Speed; this.mnuEmulationSpeed.Name = "mnuEmulationSpeed"; - this.mnuEmulationSpeed.Size = new System.Drawing.Size(135, 22); + this.mnuEmulationSpeed.Size = new System.Drawing.Size(180, 22); this.mnuEmulationSpeed.Text = "Speed"; this.mnuEmulationSpeed.DropDownOpening += new System.EventHandler(this.mnuEmulationSpeed_DropDownOpening); // @@ -459,7 +463,7 @@ this.mnuFullscreen}); this.mnuVideoScale.Image = global::Mesen.GUI.Properties.Resources.Fullscreen; this.mnuVideoScale.Name = "mnuVideoScale"; - this.mnuVideoScale.Size = new System.Drawing.Size(135, 22); + this.mnuVideoScale.Size = new System.Drawing.Size(180, 22); this.mnuVideoScale.Text = "Video Size"; this.mnuVideoScale.DropDownOpening += new System.EventHandler(this.mnuVideoScale_DropDownOpening); // @@ -546,7 +550,7 @@ this.mnuBlendHighResolutionModes}); this.mnuVideoFilter.Image = global::Mesen.GUI.Properties.Resources.VideoFilter; this.mnuVideoFilter.Name = "mnuVideoFilter"; - this.mnuVideoFilter.Size = new System.Drawing.Size(135, 22); + this.mnuVideoFilter.Size = new System.Drawing.Size(180, 22); this.mnuVideoFilter.Text = "Video Filter"; this.mnuVideoFilter.DropDownOpening += new System.EventHandler(this.mnuVideoFilter_DropDownOpening); // @@ -740,7 +744,7 @@ this.mnuRegionPal}); this.mnuRegion.Image = global::Mesen.GUI.Properties.Resources.WebBrowser; this.mnuRegion.Name = "mnuRegion"; - this.mnuRegion.Size = new System.Drawing.Size(135, 22); + this.mnuRegion.Size = new System.Drawing.Size(180, 22); this.mnuRegion.Text = "Region"; this.mnuRegion.DropDownOpening += new System.EventHandler(this.mnuRegion_DropDownOpening); // @@ -770,13 +774,13 @@ // toolStripMenuItem4 // this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(132, 6); + this.toolStripMenuItem4.Size = new System.Drawing.Size(177, 6); // // mnuAudioConfig // this.mnuAudioConfig.Image = global::Mesen.GUI.Properties.Resources.Audio; this.mnuAudioConfig.Name = "mnuAudioConfig"; - this.mnuAudioConfig.Size = new System.Drawing.Size(135, 22); + this.mnuAudioConfig.Size = new System.Drawing.Size(180, 22); this.mnuAudioConfig.Text = "Audio"; this.mnuAudioConfig.Click += new System.EventHandler(this.mnuAudioConfig_Click); // @@ -784,7 +788,7 @@ // this.mnuInputConfig.Image = global::Mesen.GUI.Properties.Resources.Controller; this.mnuInputConfig.Name = "mnuInputConfig"; - this.mnuInputConfig.Size = new System.Drawing.Size(135, 22); + this.mnuInputConfig.Size = new System.Drawing.Size(180, 22); this.mnuInputConfig.Text = "Input"; this.mnuInputConfig.Click += new System.EventHandler(this.mnuInputConfig_Click); // @@ -792,7 +796,7 @@ // this.mnuVideoConfig.Image = global::Mesen.GUI.Properties.Resources.VideoOptions; this.mnuVideoConfig.Name = "mnuVideoConfig"; - this.mnuVideoConfig.Size = new System.Drawing.Size(135, 22); + this.mnuVideoConfig.Size = new System.Drawing.Size(180, 22); this.mnuVideoConfig.Text = "Video"; this.mnuVideoConfig.Click += new System.EventHandler(this.mnuVideoConfig_Click); // @@ -800,20 +804,33 @@ // this.mnuEmulationConfig.Image = global::Mesen.GUI.Properties.Resources.DipSwitches; this.mnuEmulationConfig.Name = "mnuEmulationConfig"; - this.mnuEmulationConfig.Size = new System.Drawing.Size(135, 22); + this.mnuEmulationConfig.Size = new System.Drawing.Size(180, 22); this.mnuEmulationConfig.Text = "Emulation"; this.mnuEmulationConfig.Click += new System.EventHandler(this.mnuEmulationConfig_Click); // + // toolStripMenuItem22 + // + this.toolStripMenuItem22.Name = "toolStripMenuItem22"; + this.toolStripMenuItem22.Size = new System.Drawing.Size(177, 6); + // + // mnuGameboyConfig + // + this.mnuGameboyConfig.Image = global::Mesen.GUI.Properties.Resources.GameboyIcon; + this.mnuGameboyConfig.Name = "mnuGameboyConfig"; + this.mnuGameboyConfig.Size = new System.Drawing.Size(180, 22); + this.mnuGameboyConfig.Text = "Game Boy"; + this.mnuGameboyConfig.Click += new System.EventHandler(this.mnuGameboyConfig_Click); + // // toolStripMenuItem3 // this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(132, 6); + this.toolStripMenuItem3.Size = new System.Drawing.Size(177, 6); // // mnuPreferences // this.mnuPreferences.Image = global::Mesen.GUI.Properties.Resources.Settings; this.mnuPreferences.Name = "mnuPreferences"; - this.mnuPreferences.Size = new System.Drawing.Size(135, 22); + this.mnuPreferences.Size = new System.Drawing.Size(180, 22); this.mnuPreferences.Text = "Preferences"; this.mnuPreferences.Click += new System.EventHandler(this.mnuPreferences_Click); // @@ -1563,5 +1580,7 @@ private System.Windows.Forms.ToolStripMenuItem mnuGbSpriteViewer; private System.Windows.Forms.ToolStripMenuItem mnuGbPaletteViewer; private System.Windows.Forms.ToolStripMenuItem mnuGbEventViewer; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem22; + private System.Windows.Forms.ToolStripMenuItem mnuGameboyConfig; } } \ No newline at end of file diff --git a/UI/Forms/frmMain.cs b/UI/Forms/frmMain.cs index 4767efb..eda03c8 100644 --- a/UI/Forms/frmMain.cs +++ b/UI/Forms/frmMain.cs @@ -542,7 +542,15 @@ namespace Mesen.GUI.Forms } ConfigManager.Config.Emulation.ApplyConfig(); } - + + private void mnuGameboyConfig_Click(object sender, EventArgs e) + { + using(frmGameboyConfig frm = new frmGameboyConfig()) { + frm.ShowDialog(sender, this); + } + ConfigManager.Config.Gameboy.ApplyConfig(); + } + private void mnuInputConfig_Click(object sender, EventArgs e) { using(frmInputConfig frm = new frmInputConfig()) { diff --git a/UI/Interop/ConfigApi.cs b/UI/Interop/ConfigApi.cs index 02752f2..791c9ce 100644 --- a/UI/Interop/ConfigApi.cs +++ b/UI/Interop/ConfigApi.cs @@ -21,6 +21,7 @@ namespace Mesen.GUI [DllImport(DllPath)] public static extern void SetAudioConfig(AudioConfig config); [DllImport(DllPath)] public static extern void SetInputConfig(InputConfig config); [DllImport(DllPath)] public static extern void SetEmulationConfig(EmulationConfig config); + [DllImport(DllPath)] public static extern void SetGameboyConfig(GameboyConfig config); [DllImport(DllPath)] public static extern void SetPreferences(InteropPreferencesConfig config); [DllImport(DllPath)] public static extern void SetShortcutKeys([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)]ShortcutKeyInfo[] shortcuts, UInt32 count); diff --git a/UI/Properties/Resources.Designer.cs b/UI/Properties/Resources.Designer.cs index 727adbe..dc36b30 100644 --- a/UI/Properties/Resources.Designer.cs +++ b/UI/Properties/Resources.Designer.cs @@ -480,6 +480,16 @@ namespace Mesen.GUI.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap GameboyIcon { + get { + object obj = ResourceManager.GetObject("GameboyIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/UI/Properties/Resources.resx b/UI/Properties/Resources.resx index 861fe47..f71a99a 100644 --- a/UI/Properties/Resources.resx +++ b/UI/Properties/Resources.resx @@ -472,4 +472,7 @@ ..\Resources\GbDebugger.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\GameboyIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/UI/Resources/GameboyIcon.png b/UI/Resources/GameboyIcon.png new file mode 100644 index 0000000..c8cbed9 Binary files /dev/null and b/UI/Resources/GameboyIcon.png differ diff --git a/UI/UI.csproj b/UI/UI.csproj index ea08a8e..4f14cf7 100644 --- a/UI/UI.csproj +++ b/UI/UI.csproj @@ -216,6 +216,7 @@ + @@ -839,6 +840,12 @@ frmCopyFiles.cs + + Form + + + frmGameboyConfig.cs + Form @@ -1001,6 +1008,7 @@ + @@ -1253,6 +1261,9 @@ frmCopyFiles.cs + + frmGameboyConfig.cs + frmInputConfig.cs