GB: Added palette configuration options

+ Split GB options to a separate window
This commit is contained in:
Sour 2020-06-22 19:12:25 -04:00
parent ef930104e6
commit 06135f10de
29 changed files with 995 additions and 174 deletions

View file

@ -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) {

View file

@ -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;
}

View file

@ -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);

View file

@ -15,6 +15,7 @@ private:
AudioConfig _audio;
InputConfig _input;
EmulationConfig _emulation;
GameboyConfig _gameboy;
PreferencesConfig _preferences;
atomic<uint32_t> _flags;
@ -54,6 +55,9 @@ public:
void SetEmulationConfig(EmulationConfig config);
EmulationConfig GetEmulationConfig();
void SetGameboyConfig(GameboyConfig config);
GameboyConfig GetGameboyConfig();
void SetPreferences(PreferencesConfig config);
PreferencesConfig GetPreferences();

View file

@ -63,8 +63,8 @@ void Gameboy::Init(Console* console, GbCart* cart, std::vector<uint8_t>& romData
_hasBattery = header.HasBattery();
shared_ptr<EmuSettings> 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;

View file

@ -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) {

View file

@ -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);

View file

@ -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

View file

@ -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;

View file

@ -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)
{

View file

@ -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) {

View file

@ -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<EmuSettings> 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);

View file

@ -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();
}

View file

@ -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
}
}

View file

@ -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<GameboyConfig>
{
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
}
}

View file

@ -293,9 +293,22 @@
<Control ID="chkShowLagCounter">Show Lag Counter</Control>
<Control ID="btnResetLagCounter">Reset Counter</Control>
<Control ID="tpgGameboy">Game Boy</Control>
<Control ID="lblGameboy">Game Boy Model</Control>
<Control ID="btnOK">OK</Control>
<Control ID="btnCancel">Cancel</Control>
</Form>
<Form ID="frmGameboyConfig" Title="Game Boy Config">
<Control ID="tpgGeneral">General</Control>
<Control ID="lblModel">Model</Control>
<Control ID="chkUseSgb2">Use Super Game Boy 2 timings and behavior</Control>
<Control ID="tpgVideo">Video</Control>
<Control ID="lblGameboyPalette">Game Boy (DMG) Palette</Control>
<Control ID="lblGbBackground">Background:</Control>
<Control ID="lblGbObj0">Sprites #1:</Control>
<Control ID="lblGbObj1">Sprites #2:</Control>
<Control ID="btnSelectPreset">Select Preset...</Control>
<Control ID="lblLcdSettings">LCD Settings</Control>
<Control ID="chkGbBlendFrames">Enable LCD frame blending</Control>
<Control ID="chkGbcAdjustColors">Enable GBC LCD color emulation</Control>

View file

@ -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;
}
}

View file

@ -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) {

View file

@ -0,0 +1,558 @@
namespace Mesen.GUI.Forms.Config
{
partial class frmGameboyConfig
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View file

@ -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;
}
}
}

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ctxGbColorPresets.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
</metadata>
</root>

View file

@ -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<RadioButton>().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<RadioButton>().FirstOrDefault(r => r.Checked).Tag);
} else if(kvp.Value is ctrlTrackbar) {

View file

@ -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;
}
}

View file

@ -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()) {

View file

@ -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);

View file

@ -480,6 +480,16 @@ namespace Mesen.GUI.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap GameboyIcon {
get {
object obj = ResourceManager.GetObject("GameboyIcon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View file

@ -472,4 +472,7 @@
<data name="GbDebugger" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\GbDebugger.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GameboyIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\GameboyIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

View file

@ -216,6 +216,7 @@
<Compile Include="Config\Configuration.cs" />
<Compile Include="Config\ConfigManager.cs" />
<Compile Include="Config\CheatCodes.cs" />
<Compile Include="Config\GameboyConfig.cs" />
<Compile Include="Config\InputConfig.cs" />
<Compile Include="Config\FileAssociationHelper.cs" />
<Compile Include="Config\CheatWindowConfig.cs" />
@ -839,6 +840,12 @@
<Compile Include="Forms\Config\frmCopyFiles.Designer.cs">
<DependentUpon>frmCopyFiles.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Config\frmGameboyConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\Config\frmGameboyConfig.Designer.cs">
<DependentUpon>frmGameboyConfig.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Config\frmInputConfig.cs">
<SubType>Form</SubType>
</Compile>
@ -1001,6 +1008,7 @@
<Compile Include="Utilities\RandomGameHelper.cs" />
<Compile Include="Utilities\RomTestHelper.cs" />
<Compile Include="Utilities\XmlColor.cs" />
<None Include="Resources\GameboyIcon.png" />
<None Include="Resources\GbDebugger.png" />
<None Include="Resources\Cx4Debugger.png" />
<None Include="Resources\NecDspDebugger.png" />
@ -1253,6 +1261,9 @@
<EmbeddedResource Include="Forms\Config\frmCopyFiles.resx">
<DependentUpon>frmCopyFiles.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Config\frmGameboyConfig.resx">
<DependentUpon>frmGameboyConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Config\frmInputConfig.resx">
<DependentUpon>frmInputConfig.cs</DependentUpon>
</EmbeddedResource>