Added support for binding actions to gamepad/keyboard + Added a fast forward key (hold to fast forward)

This commit is contained in:
Souryo 2016-09-02 19:36:37 -04:00
parent 901fa5923a
commit 17b13bfc0a
32 changed files with 928 additions and 162 deletions

View file

@ -16,6 +16,7 @@
#include "NsfPpu.h"
#include "SoundMixer.h"
#include "NsfMapper.h"
#include "ShortcutKeyHandler.h"
shared_ptr<Console> Console::Instance(new Console());
@ -264,6 +265,7 @@ void Console::Run()
double targetTime;
uint32_t lastFrameNumber = -1;
ShortcutKeyHandler shortcutKeyHandler;
_autoSaveManager.reset(new AutoSaveManager());
_runLock.Acquire();

View file

@ -27,6 +27,13 @@ void ControlManager::RegisterKeyManager(IKeyManager* keyManager)
_keyManager.reset(keyManager);
}
void ControlManager::RefreshKeyState()
{
if(_keyManager != nullptr) {
return _keyManager->RefreshState();
}
}
bool ControlManager::IsKeyPressed(uint32_t keyCode)
{
if(_keyManager != nullptr) {

View file

@ -55,6 +55,7 @@ class ControlManager : public Snapshotable, public IMemoryHandler
static void UnregisterBroadcaster(IGameBroadcaster* gameBroadcaster);
static void RegisterKeyManager(IKeyManager* keyManager);
static void RefreshKeyState();
static bool IsKeyPressed(uint32_t keyCode);
static bool IsMouseButtonPressed(MouseButton button);
static uint32_t GetPressedKey();

View file

@ -542,6 +542,7 @@
<ClInclude Include="Sachen_136.h" />
<ClInclude Include="Sachen_143.h" />
<ClInclude Include="SelectControllerMessage.h" />
<ClInclude Include="ShortcutKeyHandler.h" />
<ClInclude Include="SoundMixer.h" />
<ClInclude Include="Namco108.h" />
<ClInclude Include="Namco108_154.h" />
@ -714,6 +715,7 @@
<ClCompile Include="OekaKidsTablet.cpp" />
<ClCompile Include="ReverbFilter.cpp" />
<ClCompile Include="RomLoader.cpp" />
<ClCompile Include="ShortcutKeyHandler.cpp" />
<ClCompile Include="Snapshotable.cpp" />
<ClCompile Include="SoundMixer.cpp" />
<ClCompile Include="StandardController.cpp" />

View file

@ -928,6 +928,9 @@
<ClInclude Include="AutoSaveManager.h">
<Filter>Misc</Filter>
</ClInclude>
<ClInclude Include="ShortcutKeyHandler.h">
<Filter>Misc</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
@ -1101,5 +1104,8 @@
<ClCompile Include="AutoSaveManager.cpp">
<Filter>Misc</Filter>
</ClCompile>
<ClCompile Include="ShortcutKeyHandler.cpp">
<Filter>Misc</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -25,6 +25,8 @@ NesModel EmulationSettings::_model = NesModel::Auto;
PpuModel EmulationSettings::_ppuModel = PpuModel::Ppu2C02;
uint32_t EmulationSettings::_emulationSpeed = 100;
uint32_t EmulationSettings::_turboSpeed = 300;
uint32_t EmulationSettings::_overclockRate = 100;
uint32_t EmulationSettings::_extraScanlinesBeforeNmi = 0;
uint32_t EmulationSettings::_extraScanlinesAfterNmi = 0;
@ -41,6 +43,8 @@ bool EmulationSettings::_nsfDisableApuIrqs = true;
uint32_t EmulationSettings::_autoSaveDelay = 5;
bool EmulationSettings::_autoSaveNotify = false;
EmulatorKeyMappingSet EmulationSettings::_emulatorKeys;
RamPowerOnState EmulationSettings::_ramPowerOnState = RamPowerOnState::AllZeros;
InputDisplaySettings EmulationSettings::_inputDisplaySettings = { 0, InputDisplayPosition::TopLeft, false };

View file

@ -33,6 +33,7 @@ enum EmulationFlags
SilenceTriangleHighFreq = 0x100000,
Turbo = 0x20000000,
InBackground = 0x40000000,
NsfPlayerEnabled = 0x80000000,
};
@ -202,6 +203,32 @@ struct KeyMappingSet
uint32_t TurboSpeed;
};
struct EmulatorKeyMappings
{
uint32_t FastForward;
uint32_t Pause;
uint32_t Reset;
uint32_t MoveToNextStateSlot;
uint32_t MoveToPreviousStateSlot;
uint32_t SaveState;
uint32_t LoadState;
uint32_t SwitchDiskSide;
uint32_t InsertNextDisk;
uint32_t InsertCoin1;
uint32_t InsertCoin2;
uint32_t TakeScreenshot;
};
struct EmulatorKeyMappingSet
{
EmulatorKeyMappings KeySet1 = {};
EmulatorKeyMappings KeySet2 = {};
};
enum class Language
{
SystemDefault = 0,
@ -276,6 +303,8 @@ private:
static PpuModel _ppuModel;
static uint32_t _emulationSpeed;
static uint32_t _turboSpeed;
static uint32_t _overclockRate;
static bool _overclockAdjustApu;
static bool _disableOverclocking;
@ -308,6 +337,8 @@ private:
static uint32_t _autoSaveDelay;
static bool _autoSaveNotify;
static EmulatorKeyMappingSet _emulatorKeys;
static RamPowerOnState _ramPowerOnState;
public:
@ -449,9 +480,14 @@ public:
_emulationSpeed = emulationSpeed;
}
static uint32_t GetEmulationSpeed()
static void SetTurboSpeed(uint32_t turboSpeed)
{
return _emulationSpeed;
_turboSpeed = turboSpeed;
}
static uint32_t GetEmulationSpeed(bool ignoreTurbo = false)
{
return (CheckFlag(EmulationFlags::Turbo) && !ignoreTurbo) ? _turboSpeed : _emulationSpeed;
}
static void UpdateEffectiveOverclockRate()
@ -719,6 +755,16 @@ public:
return _controllerKeys[port];
}
static void SetEmulatorKeys(EmulatorKeyMappingSet keyMappings)
{
_emulatorKeys = keyMappings;
}
static EmulatorKeyMappingSet GetEmulatorKeys()
{
return _emulatorKeys;
}
static bool NeedControllerUpdate()
{
if(_needControllerUpdate) {

View file

@ -85,8 +85,9 @@ void FDS::ProcessCpuClock()
{
if(EmulationSettings::CheckFlag(EmulationFlags::FdsFastForwardOnLoad)) {
bool enableFastforward = (_scanningDisk || _gameStarted < 2);
if(EmulationSettings::GetEmulationSpeed() > 0 || !_fastForwarding) {
_previousSpeed = EmulationSettings::GetEmulationSpeed();
uint32_t emulationSpeed = EmulationSettings::GetEmulationSpeed(true);
if(emulationSpeed > 0 || !_fastForwarding) {
_previousSpeed = emulationSpeed;
}
EmulationSettings::SetEmulationSpeed(enableFastforward ? 0 : _previousSpeed);
_fastForwarding = enableFastforward;
@ -366,12 +367,19 @@ void FDS::InsertDisk(uint32_t diskNumber)
}
}
void FDS::InsertNextDisk()
{
InsertDisk(((FDS::Instance->_diskNumber & 0xFE) + 2) % GetSideCount());
}
void FDS::SwitchDiskSide()
{
if(FDS::Instance) {
Console::Pause();
FDS::Instance->_newDiskNumber = (FDS::Instance->_diskNumber & 0x01) ? (FDS::Instance->_diskNumber & 0xFE) : (FDS::Instance->_diskNumber | 0x01);
FDS::Instance->_newDiskInsertDelay = FDS::DiskInsertDelay;
if(FDS::Instance->_newDiskInsertDelay == 0 && FDS::Instance->_diskNumber != NoDiskInserted) {
FDS::Instance->_newDiskNumber = (FDS::Instance->_diskNumber & 0x01) ? (FDS::Instance->_diskNumber & 0xFE) : (FDS::Instance->_diskNumber | 0x01);
FDS::Instance->_newDiskInsertDelay = FDS::DiskInsertDelay;
}
Console::Resume();
MessageManager::SendNotification(ConsoleNotificationType::FdsDiskChanged);

View file

@ -107,6 +107,7 @@ public:
static uint32_t GetSideCount();
static void InsertDisk(uint32_t diskNumber);
static void InsertNextDisk();
static void SwitchDiskSide();
static void EjectDisk();
};

View file

@ -53,6 +53,7 @@ std::unordered_map<string, string> MessageManager::_enResources = {
{ "SaveStateLoaded", u8"State #%1 loaded." },
{ "SaveStateNewerVersion", u8"Cannot load save states created by a more recent version of Mesen. Please download the latest version." },
{ "SaveStateSaved", u8"State #%1 saved." },
{ "SaveStateSlotSelected", u8"Slot #%1 selected." },
{ "ScanlineTimingWarning", u8"PPU timing has been changed." },
{ "ServerStarted", u8"Server started (Port: %1)" },
{ "ServerStopped", u8"Server stopped" },
@ -116,6 +117,7 @@ std::unordered_map<string, string> MessageManager::_frResources = {
{ "SaveStateLoaded", u8"Sauvegarde #%1 chargée." },
{ "SaveStateNewerVersion", u8"Impossible de charger une sauvegarde qui a été créée avec une version plus récente de Mesen. Veuillez mettre à jour Mesen." },
{ "SaveStateSaved", u8"Sauvegarde #%1 sauvegardée." },
{ "SaveStateSlotSelected", u8"Position de sauvegarde #%1 choisie." },
{ "ScanlineTimingWarning", u8"Le timing du PPU a été modifié." },
{ "ServerStarted", u8"Le serveur a été démarré (Port : %1)" },
{ "ServerStopped", u8"Le serveur a été arrêté" },
@ -179,6 +181,7 @@ std::unordered_map<string, string> MessageManager::_jaResources = {
{ "SaveStateLoaded", u8"クイックセーブ%1をロードしました。" },
{ "SaveStateNewerVersion", u8"クイックセーブデータは使用中のMesenより新しいバージョンで作られたため、ロードできません。 Mesenのサイトで最新のバージョンをダウンロードしてください。" },
{ "SaveStateSaved", u8"クイックセーブ%1をセーブしました。" },
{ "SaveStateSlotSelected", u8"クイックセーブスロット%1。" },
{ "ServerStarted", u8"サーバは起動しました (ポート: %1)" },
{ "ServerStopped", u8"サーバは停止しました。" },
{ "ScanlineTimingWarning", u8"PPUのタイミングは変更されました。" },

View file

@ -7,6 +7,7 @@
#include "EmulationSettings.h"
const uint32_t SaveStateManager::FileFormatVersion;
atomic<uint32_t> SaveStateManager::_lastIndex = 1;
string SaveStateManager::GetStateFilepath(int stateIndex)
{
@ -27,12 +28,36 @@ uint64_t SaveStateManager::GetStateInfo(int stateIndex)
return 0;
}
void SaveStateManager::MoveToNextSlot()
{
_lastIndex = (_lastIndex % MaxIndex) + 1;
MessageManager::DisplayMessage("SaveStates", "SaveStateSlotSelected", std::to_string(_lastIndex));
}
void SaveStateManager::MoveToPreviousSlot()
{
_lastIndex = (_lastIndex == 1 ? SaveStateManager::MaxIndex : (_lastIndex - 1));
MessageManager::DisplayMessage("SaveStates", "SaveStateSlotSelected", std::to_string(_lastIndex));
}
void SaveStateManager::SaveState()
{
SaveState(_lastIndex);
}
bool SaveStateManager::LoadState()
{
return LoadState(_lastIndex);
}
void SaveStateManager::SaveState(int stateIndex, bool displayMessage)
{
string filepath = SaveStateManager::GetStateFilepath(stateIndex);
ofstream file(filepath, ios::out | ios::binary);
if(file) {
_lastIndex = stateIndex;
Console::Pause();
uint32_t emuVersion = EmulationSettings::GetMesenVersion();
@ -74,6 +99,8 @@ bool SaveStateManager::LoadState(int stateIndex)
return false;
}
_lastIndex = stateIndex;
Console::Pause();
Console::LoadState(file);
Console::Resume();

View file

@ -5,12 +5,22 @@
class SaveStateManager
{
private:
static string GetStateFilepath(int stateIndex);
static const uint32_t MaxIndex = 5;
static atomic<uint32_t> _lastIndex;
static string GetStateFilepath(int stateIndex);
public:
static const uint32_t FileFormatVersion = 5;
static uint64_t GetStateInfo(int stateIndex);
static void SaveState();
static bool LoadState();
static void SaveState(int stateIndex, bool displayMessage = true);
static bool LoadState(int stateIndex);
static void MoveToNextSlot();
static void MoveToPreviousSlot();
};

114
Core/ShortcutKeyHandler.cpp Normal file
View file

@ -0,0 +1,114 @@
#include "stdafx.h"
#include "ShortcutKeyHandler.h"
#include "EmulationSettings.h"
#include "ControlManager.h"
#include "VideoDecoder.h"
#include "VsControlManager.h"
#include "FDS.h"
#include "SaveStateManager.h"
ShortcutKeyHandler::ShortcutKeyHandler()
{
_stopThread = false;
_thread = std::thread([=]() {
while(!_stopThread) {
ProcessKeys(EmulationSettings::GetEmulatorKeys());
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(50));
}
});
}
ShortcutKeyHandler::~ShortcutKeyHandler()
{
_stopThread = true;
_thread.join();
}
bool ShortcutKeyHandler::DetectKeyPress(uint32_t keyCode)
{
if(ControlManager::IsKeyPressed(keyCode)) {
_keysDown.emplace(keyCode);
if(_prevKeysDown.find(keyCode) == _prevKeysDown.end()) {
return true;
}
}
return false;
}
void ShortcutKeyHandler::CheckMappedKeys(EmulatorKeyMappings mappings)
{
if(ControlManager::IsKeyPressed(mappings.FastForward)) {
_turboEnabled = true;
}
if(DetectKeyPress(mappings.TakeScreenshot)) {
VideoDecoder::GetInstance()->TakeScreenshot();
}
if(DetectKeyPress(mappings.InsertCoin1)) {
if(VsControlManager::GetInstance()) {
VsControlManager::GetInstance()->InsertCoin(0);
}
}
if(DetectKeyPress(mappings.InsertCoin2)) {
if(VsControlManager::GetInstance()) {
VsControlManager::GetInstance()->InsertCoin(1);
}
}
if(DetectKeyPress(mappings.SwitchDiskSide)) {
FDS::SwitchDiskSide();
}
if(DetectKeyPress(mappings.InsertNextDisk)) {
FDS::InsertNextDisk();
}
if(DetectKeyPress(mappings.MoveToNextStateSlot)) {
SaveStateManager::MoveToNextSlot();
}
if(DetectKeyPress(mappings.MoveToPreviousStateSlot)) {
SaveStateManager::MoveToPreviousSlot();
}
if(DetectKeyPress(mappings.SaveState)) {
SaveStateManager::SaveState();
}
if(DetectKeyPress(mappings.LoadState)) {
SaveStateManager::LoadState();
}
if(DetectKeyPress(mappings.Reset)) {
Console::Reset(true);
}
if(DetectKeyPress(mappings.Pause)) {
if(EmulationSettings::CheckFlag(EmulationFlags::Paused)) {
EmulationSettings::ClearFlags(EmulationFlags::Paused);
} else {
EmulationSettings::SetFlags(EmulationFlags::Paused);
}
}
}
void ShortcutKeyHandler::ProcessKeys(EmulatorKeyMappingSet mappings)
{
ControlManager::RefreshKeyState();
_keysDown.clear();
_turboEnabled = false;
CheckMappedKeys(mappings.KeySet1);
CheckMappedKeys(mappings.KeySet2);
if(_turboEnabled) {
EmulationSettings::SetFlags(EmulationFlags::Turbo);
} else {
EmulationSettings::ClearFlags(EmulationFlags::Turbo);
}
_prevKeysDown = _keysDown;
}

24
Core/ShortcutKeyHandler.h Normal file
View file

@ -0,0 +1,24 @@
#pragma once
#include "stdafx.h"
#include <thread>
#include <unordered_set>
#include "EmulationSettings.h"
class ShortcutKeyHandler
{
private:
std::thread _thread;
atomic<bool> _stopThread;
std::unordered_set<uint32_t> _keysDown;
std::unordered_set<uint32_t> _prevKeysDown;
bool _turboEnabled;
void CheckMappedKeys(EmulatorKeyMappings mappings);
void ProcessKeys(EmulatorKeyMappingSet mappings);
bool DetectKeyPress(uint32_t keyCode);
public:
ShortcutKeyHandler();
~ShortcutKeyHandler();
};

View file

@ -58,6 +58,7 @@ namespace Mesen.GUI.Config
public void InitializeDefaults()
{
InputInfo.InitializeDefaults();
PreferenceInfo.InitializeDefaults();
}
public void AddRecentFile(string filepath, string romName, int archiveFileIndex)

View file

@ -30,6 +30,7 @@ namespace Mesen.GUI.Config
public bool ShowLagCounter = false;
public UInt32 EmulationSpeed = 100;
public UInt32 TurboSpeed = 300;
public EmulationInfo()
{
@ -40,6 +41,7 @@ namespace Mesen.GUI.Config
EmulationInfo emulationInfo = ConfigManager.Config.EmulationInfo;
InteropEmu.SetEmulationSpeed(emulationInfo.EmulationSpeed);
InteropEmu.SetTurboSpeed(emulationInfo.TurboSpeed);
InteropEmu.SetFlag(EmulationFlags.Mmc3IrqAltBehavior, emulationInfo.UseAlternativeMmc3Irq);
InteropEmu.SetFlag(EmulationFlags.AllowInvalidInput, emulationInfo.AllowInvalidInput);

View file

@ -52,12 +52,30 @@ namespace Mesen.GUI.Config
public bool CloudSaveIntegration = false;
public DateTime CloudLastSync = DateTime.MinValue;
public EmulatorKeyMappings? EmulatorKeySet1;
public EmulatorKeyMappings? EmulatorKeySet2;
public bool DisableGameDatabase = false;
public PreferenceInfo()
{
}
public void InitializeDefaults()
{
if(EmulatorKeySet1 == null) {
EmulatorKeySet1 = new EmulatorKeyMappings() {
FastForward = InteropEmu.GetKeyCode("Tab")
};
}
if(EmulatorKeySet2 == null) {
EmulatorKeySet2 = new EmulatorKeyMappings() {
FastForward = InteropEmu.GetKeyCode("Pad1 R2")
};
}
}
static private void UpdateFileAssociation(string extension, bool associate)
{
string key = @"HKEY_CURRENT_USER\Software\Classes\." + extension;
@ -97,6 +115,7 @@ namespace Mesen.GUI.Config
InteropEmu.NsfSetNsfConfig(preferenceInfo.NsfAutoDetectSilence ? preferenceInfo.NsfAutoDetectSilenceDelay : 0, preferenceInfo.NsfMoveToNextTrackAfterTime ? preferenceInfo.NsfMoveToNextTrackTime : -1, preferenceInfo.NsfDisableApuIrqs);
InteropEmu.SetAutoSaveOptions(preferenceInfo.AutoSave ? (uint)preferenceInfo.AutoSaveDelay : 0, preferenceInfo.AutoSaveNotify);
InteropEmu.SetEmulatorKeys(new EmulatorKeyMappingSet() { KeySet1 = preferenceInfo.EmulatorKeySet1.Value, KeySet2 = preferenceInfo.EmulatorKeySet2.Value });
}
}
}

View file

@ -52,6 +52,19 @@
<Message ID="InvalidCheatFile">The selected file ({0}) is not a valid cheat file.</Message>
<Message ID="InvalidXmlFile">The selected file ({0}) is not a valid XML file.</Message>
<Message ID="NoMatchingCheats">The selected cheat file ({0}) contains no cheats that match the selected game.</Message>
<Message ID="EmulatorShortcutMappings_FastForward">Fast Forward</Message>
<Message ID="EmulatorShortcutMappings_Pause">Pause</Message>
<Message ID="EmulatorShortcutMappings_Reset">Reset</Message>
<Message ID="EmulatorShortcutMappings_TakeScreenshot">Take Screenshot</Message>
<Message ID="EmulatorShortcutMappings_SwitchDiskSide">FDS - Switch Side</Message>
<Message ID="EmulatorShortcutMappings_InsertNextDisk">FDS - Insert Next Disk</Message>
<Message ID="EmulatorShortcutMappings_InsertCoin1">VS - Insert Coin 1</Message>
<Message ID="EmulatorShortcutMappings_InsertCoin2">VS - Insert Coin 2</Message>
<Message ID="EmulatorShortcutMappings_MoveToNextStateSlot">Select Next Save Slot</Message>
<Message ID="EmulatorShortcutMappings_MoveToPreviousStateSlot">Select Previous Save Slot</Message>
<Message ID="EmulatorShortcutMappings_SaveState">Save State</Message>
<Message ID="EmulatorShortcutMappings_LoadState">Load State</Message>
</Messages>
<Enums>
<Enum ID="ControllerType">

View file

@ -247,6 +247,8 @@
<Control ID="tpgGeneral">Général</Control>
<Control ID="lblEmuSpeedHint">% (0 = Vitesse maximale)</Control>
<Control ID="lblEmulationSpeed">Vitesse d'émulation :</Control>
<Control ID="lblTurboSpeedHint">% (0 = Vitesse maximale)</Control>
<Control ID="lblTurboSpeed">Vitesse d'avance rapide:</Control>
<Control ID="tpgAdvanced">Avancé</Control>
<Control ID="chkUseAlternativeMmc3Irq">Utiliser la version alternative du comportement des IRQs du MMC3</Control>
@ -295,6 +297,11 @@
<Control ID="chkFdsAutoLoadDisk">Insérer le côté A du disque 1 lors du chargement d'un jeu de FDS</Control>
<Control ID="chkFdsFastForwardOnLoad">Augmenter la vitesse d'émulation pendant le chargement des jeux FDS</Control>
<Control ID="tpgShortcuts">Raccourcis</Control>
<Control ID="colAction">Action</Control>
<Control ID="colBinding1">Raccourci #1</Control>
<Control ID="colBinding2">Raccourci #2</Control>
<Control ID="tpgSaveData">Sauvegardes</Control>
<Control ID="grpAutomaticSaves">Sauvegarde d'état automatique</Control>
<Control ID="chkAutoSave">Créer une sauvegarde d'état à chaque</Control>
@ -497,6 +504,19 @@
<Message ID="InvalidCheatFile">Le fichier sélectionné ({0}) n'est pas un fichier de codes valide.</Message>
<Message ID="InvalidXmlFile">Le fichier sélectionné ({0}) n'est pas un fichier XML valide.</Message>
<Message ID="NoMatchingCheats">Le fichier sélectionné ({0}) ne contient aucun code correspondant au jeu sélectionné.</Message>
<Message ID="EmulatorShortcutMappings_FastForward">Avance rapide</Message>
<Message ID="EmulatorShortcutMappings_Pause">Pause</Message>
<Message ID="EmulatorShortcutMappings_Reset">Reset</Message>
<Message ID="EmulatorShortcutMappings_TakeScreenshot">Capture d'écran</Message>
<Message ID="EmulatorShortcutMappings_SwitchDiskSide">FDS - Changer le disque de côté</Message>
<Message ID="EmulatorShortcutMappings_InsertNextDisk">FDS - Insérer le disque suivant</Message>
<Message ID="EmulatorShortcutMappings_InsertCoin1">VS - Insérer une pièce (1)</Message>
<Message ID="EmulatorShortcutMappings_InsertCoin2">VS - Insérer une pièce (2)</Message>
<Message ID="EmulatorShortcutMappings_MoveToNextStateSlot">Position de sauvegarde suivante</Message>
<Message ID="EmulatorShortcutMappings_MoveToPreviousStateSlot">Position de sauvegarde précédente</Message>
<Message ID="EmulatorShortcutMappings_SaveState">Sauvegarder l'état à la position courante</Message>
<Message ID="EmulatorShortcutMappings_LoadState">Charger l'état de la position courante</Message>
</Messages>
<Enums>
<Enum ID="ControllerType">

View file

@ -247,6 +247,8 @@
<Control ID="tpgGeneral">全般</Control>
<Control ID="lblEmuSpeedHint">% (0 = 最高速度)</Control>
<Control ID="lblEmulationSpeed">エミュレーションの速度:</Control>
<Control ID="lblTurboSpeedHint">% (0 = 最高速度)</Control>
<Control ID="lblTurboSpeed">早送りの速度:</Control>
<Control ID="tpgAdvanced">詳細設定</Control>
<Control ID="chkUseAlternativeMmc3Irq">MMC3AのIRQ仕様を使う</Control>
@ -294,6 +296,11 @@
<Control ID="chkFdsAutoLoadDisk">ファミコンディスクシステムのゲームをロードする時に自動的にディスクのA面を入れる</Control>
<Control ID="chkFdsFastForwardOnLoad">ファミコンディスクシステムのゲームをディスクからロードする時に自動的に最高速度にする</Control>
<Control ID="tpgShortcuts"> ショートカットキー </Control>
<Control ID="colAction">機能</Control>
<Control ID="colBinding1">ショートカットキー1</Control>
<Control ID="colBinding2">ショートカットキー2</Control>
<Control ID="tpgSaveData">セーブデータ</Control>
<Control ID="grpAutomaticSaves">オートクイックセーブ</Control>
<Control ID="chkAutoSave">オートクイックセーブを</Control>
@ -479,6 +486,19 @@
<Message ID="InvalidCheatFile">このファイル({0})にはチートコードを見つかりませんでした。</Message>
<Message ID="InvalidXmlFile">このファイル({0}はXMLファイルではないため読めませんでした.</Message>
<Message ID="NoMatchingCheats">このファイル({0})に選択されたゲームに該当するチートコードを見つかりませんでした。</Message>
<Message ID="EmulatorShortcutMappings_FastForward">早送り</Message>
<Message ID="EmulatorShortcutMappings_Pause">ポーズ</Message>
<Message ID="EmulatorShortcutMappings_Reset">リセット</Message>
<Message ID="EmulatorShortcutMappings_TakeScreenshot">スクリーンショットを撮る</Message>
<Message ID="EmulatorShortcutMappings_SwitchDiskSide">FDS - A面B面切り替え</Message>
<Message ID="EmulatorShortcutMappings_InsertNextDisk">FDS - 次のディスクを入れる</Message>
<Message ID="EmulatorShortcutMappings_InsertCoin1">VS - インサートコイン 1</Message>
<Message ID="EmulatorShortcutMappings_InsertCoin2">VS - インサートコイン 2</Message>
<Message ID="EmulatorShortcutMappings_MoveToNextStateSlot">次のクイックセーブスロットを選ぶ</Message>
<Message ID="EmulatorShortcutMappings_MoveToPreviousStateSlot">前のクイックセーブスロットを選ぶ</Message>
<Message ID="EmulatorShortcutMappings_SaveState">選択中スロットにクイックセーブ</Message>
<Message ID="EmulatorShortcutMappings_LoadState">選択中スロットからクイックロード</Message>
</Messages>
<Enums>
<Enum ID="ControllerType">

View file

@ -0,0 +1,100 @@
namespace Mesen.GUI.Forms.Config
{
partial class ctrlEmulatorShortcuts
{
/// <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 Component 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.gridShortcuts = new System.Windows.Forms.DataGridView();
this.colAction = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colBinding1 = new System.Windows.Forms.DataGridViewButtonColumn();
this.colBinding2 = new System.Windows.Forms.DataGridViewButtonColumn();
((System.ComponentModel.ISupportInitialize)(this.gridShortcuts)).BeginInit();
this.SuspendLayout();
//
// gridShortcuts
//
this.gridShortcuts.AllowUserToAddRows = false;
this.gridShortcuts.AllowUserToDeleteRows = false;
this.gridShortcuts.AllowUserToResizeColumns = false;
this.gridShortcuts.AllowUserToResizeRows = false;
this.gridShortcuts.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
this.gridShortcuts.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridShortcuts.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colAction,
this.colBinding1,
this.colBinding2});
this.gridShortcuts.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridShortcuts.Location = new System.Drawing.Point(0, 0);
this.gridShortcuts.MultiSelect = false;
this.gridShortcuts.Name = "gridShortcuts";
this.gridShortcuts.RowHeadersVisible = false;
this.gridShortcuts.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.gridShortcuts.Size = new System.Drawing.Size(448, 248);
this.gridShortcuts.TabIndex = 2;
this.gridShortcuts.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridShortcuts_CellContentClick);
//
// colAction
//
this.colAction.HeaderText = "Action";
this.colAction.Name = "colAction";
this.colAction.ReadOnly = true;
this.colAction.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.colAction.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.colAction.Width = 250;
//
// colBinding1
//
this.colBinding1.HeaderText = "Binding #1";
this.colBinding1.Name = "colBinding1";
this.colBinding1.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.colBinding1.Width = 110;
//
// colBinding2
//
this.colBinding2.HeaderText = "Binding #2";
this.colBinding2.Name = "colBinding2";
this.colBinding2.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.colBinding2.Width = 110;
//
// ctrlEmulatorShortcuts
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.gridShortcuts);
this.Name = "ctrlEmulatorShortcuts";
this.Size = new System.Drawing.Size(448, 248);
((System.ComponentModel.ISupportInitialize)(this.gridShortcuts)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView gridShortcuts;
private System.Windows.Forms.DataGridViewTextBoxColumn colAction;
private System.Windows.Forms.DataGridViewButtonColumn colBinding1;
private System.Windows.Forms.DataGridViewButtonColumn colBinding2;
}
}

View file

@ -0,0 +1,67 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
using Mesen.GUI.Config;
using System.Reflection;
namespace Mesen.GUI.Forms.Config
{
public partial class ctrlEmulatorShortcuts : UserControl
{
public ctrlEmulatorShortcuts()
{
InitializeComponent();
if(LicenseManager.UsageMode != LicenseUsageMode.Designtime) {
InitializeGrid();
}
}
private void InitializeGrid()
{
FieldInfo[] fields = typeof(EmulatorKeyMappings).GetFields();
foreach(FieldInfo fieldInfo in fields) {
int index = gridShortcuts.Rows.Add();
gridShortcuts.Rows[index].Cells[0].Tag = fieldInfo;
gridShortcuts.Rows[index].Cells[0].Value = ResourceHelper.GetMessage("EmulatorShortcutMappings_" + fieldInfo.Name);
UInt32 keyCode = (UInt32)fieldInfo.GetValue(ConfigManager.Config.PreferenceInfo.EmulatorKeySet1);
gridShortcuts.Rows[index].Cells[1].Value = InteropEmu.GetKeyName(keyCode);
gridShortcuts.Rows[index].Cells[1].Tag = keyCode;
keyCode = (UInt32)fieldInfo.GetValue(ConfigManager.Config.PreferenceInfo.EmulatorKeySet2);
gridShortcuts.Rows[index].Cells[2].Value = InteropEmu.GetKeyName(keyCode);
gridShortcuts.Rows[index].Cells[2].Tag = keyCode;
}
}
public void UpdateConfig()
{
//Need to box the structs into objects for SetValue to work properly
object keySet1 = new EmulatorKeyMappings();
object keySet2 = new EmulatorKeyMappings();
for(int i = gridShortcuts.Rows.Count - 1; i >= 0; i--) {
FieldInfo field = (FieldInfo)gridShortcuts.Rows[i].Cells[0].Tag;
field.SetValue(keySet1, gridShortcuts.Rows[i].Cells[1].Tag);
field.SetValue(keySet2, gridShortcuts.Rows[i].Cells[2].Tag);
}
ConfigManager.Config.PreferenceInfo.EmulatorKeySet1 = (EmulatorKeyMappings)keySet1;
ConfigManager.Config.PreferenceInfo.EmulatorKeySet2 = (EmulatorKeyMappings)keySet2;
}
private void gridShortcuts_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if(gridShortcuts.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) {
DataGridViewButtonCell button = gridShortcuts.Rows[e.RowIndex].Cells[e.ColumnIndex] as DataGridViewButtonCell;
if(button != null) {
frmGetKey frm = new frmGetKey();
frm.ShowDialog();
button.Value = frm.BindedKeyName;
button.Tag = frm.BindedKeyCode;
}
}
}
}
}

View file

@ -0,0 +1,129 @@
<?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="colAction.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBinding1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBinding2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View file

@ -31,6 +31,9 @@
this.tabMain = new System.Windows.Forms.TabControl();
this.tpgGeneral = new System.Windows.Forms.TabPage();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel9 = new System.Windows.Forms.FlowLayoutPanel();
this.nudTurboSpeed = new System.Windows.Forms.NumericUpDown();
this.lblTurboSpeed = new System.Windows.Forms.Label();
this.flowLayoutPanel6 = new System.Windows.Forms.FlowLayoutPanel();
this.nudEmulationSpeed = new System.Windows.Forms.NumericUpDown();
this.lblEmuSpeedHint = new System.Windows.Forms.Label();
@ -72,9 +75,12 @@
this.chkShowLagCounter = new System.Windows.Forms.CheckBox();
this.btnResetLagCounter = new System.Windows.Forms.Button();
this.tmrUpdateClockRate = new System.Windows.Forms.Timer(this.components);
this.lblTurboSpeedHint = new System.Windows.Forms.Label();
this.tabMain.SuspendLayout();
this.tpgGeneral.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
this.flowLayoutPanel9.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudTurboSpeed)).BeginInit();
this.flowLayoutPanel6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudEmulationSpeed)).BeginInit();
this.tpgAdvanced.SuspendLayout();
@ -129,27 +135,64 @@
this.tableLayoutPanel4.ColumnCount = 2;
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.flowLayoutPanel9, 1, 1);
this.tableLayoutPanel4.Controls.Add(this.lblTurboSpeed, 0, 1);
this.tableLayoutPanel4.Controls.Add(this.flowLayoutPanel6, 1, 0);
this.tableLayoutPanel4.Controls.Add(this.lblEmulationSpeed, 0, 0);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 2;
this.tableLayoutPanel4.RowCount = 3;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(473, 267);
this.tableLayoutPanel4.TabIndex = 0;
//
// flowLayoutPanel9
//
this.flowLayoutPanel9.AutoSize = true;
this.flowLayoutPanel9.Controls.Add(this.nudTurboSpeed);
this.flowLayoutPanel9.Controls.Add(this.lblTurboSpeedHint);
this.flowLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel9.Location = new System.Drawing.Point(111, 26);
this.flowLayoutPanel9.Margin = new System.Windows.Forms.Padding(0);
this.flowLayoutPanel9.Name = "flowLayoutPanel9";
this.flowLayoutPanel9.Size = new System.Drawing.Size(362, 26);
this.flowLayoutPanel9.TabIndex = 14;
//
// nudTurboSpeed
//
this.nudTurboSpeed.Location = new System.Drawing.Point(3, 3);
this.nudTurboSpeed.Maximum = new decimal(new int[] {
500,
0,
0,
0});
this.nudTurboSpeed.Name = "nudTurboSpeed";
this.nudTurboSpeed.Size = new System.Drawing.Size(48, 20);
this.nudTurboSpeed.TabIndex = 1;
//
// lblTurboSpeed
//
this.lblTurboSpeed.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblTurboSpeed.AutoSize = true;
this.lblTurboSpeed.Location = new System.Drawing.Point(3, 32);
this.lblTurboSpeed.Name = "lblTurboSpeed";
this.lblTurboSpeed.Size = new System.Drawing.Size(105, 13);
this.lblTurboSpeed.TabIndex = 13;
this.lblTurboSpeed.Text = "Fast Forward Speed:";
//
// flowLayoutPanel6
//
this.flowLayoutPanel6.AutoSize = true;
this.flowLayoutPanel6.Controls.Add(this.nudEmulationSpeed);
this.flowLayoutPanel6.Controls.Add(this.lblEmuSpeedHint);
this.flowLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel6.Location = new System.Drawing.Point(96, 0);
this.flowLayoutPanel6.Location = new System.Drawing.Point(111, 0);
this.flowLayoutPanel6.Margin = new System.Windows.Forms.Padding(0);
this.flowLayoutPanel6.Name = "flowLayoutPanel6";
this.flowLayoutPanel6.Size = new System.Drawing.Size(377, 26);
this.flowLayoutPanel6.Size = new System.Drawing.Size(362, 26);
this.flowLayoutPanel6.TabIndex = 11;
//
// nudEmulationSpeed
@ -636,6 +679,16 @@
this.tmrUpdateClockRate.Enabled = true;
this.tmrUpdateClockRate.Tick += new System.EventHandler(this.tmrUpdateClockRate_Tick);
//
// lblTurboSpeedHint
//
this.lblTurboSpeedHint.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblTurboSpeedHint.AutoSize = true;
this.lblTurboSpeedHint.Location = new System.Drawing.Point(57, 6);
this.lblTurboSpeedHint.Name = "lblTurboSpeedHint";
this.lblTurboSpeedHint.Size = new System.Drawing.Size(121, 13);
this.lblTurboSpeedHint.TabIndex = 2;
this.lblTurboSpeedHint.Text = "% (0 = Maximum speed)";
//
// frmEmulationConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -655,6 +708,9 @@
this.tpgGeneral.ResumeLayout(false);
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel4.PerformLayout();
this.flowLayoutPanel9.ResumeLayout(false);
this.flowLayoutPanel9.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudTurboSpeed)).EndInit();
this.flowLayoutPanel6.ResumeLayout(false);
this.flowLayoutPanel6.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudEmulationSpeed)).EndInit();
@ -733,5 +789,9 @@
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel8;
private System.Windows.Forms.Label lblRamPowerOnState;
private System.Windows.Forms.ComboBox cboRamPowerOnState;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel9;
private System.Windows.Forms.NumericUpDown nudTurboSpeed;
private System.Windows.Forms.Label lblTurboSpeed;
private System.Windows.Forms.Label lblTurboSpeedHint;
}
}

View file

@ -21,6 +21,7 @@ namespace Mesen.GUI.Forms.Config
Entity = ConfigManager.Config.EmulationInfo;
AddBinding("EmulationSpeed", nudEmulationSpeed);
AddBinding("TurboSpeed", nudTurboSpeed);
AddBinding("UseAlternativeMmc3Irq", chkUseAlternativeMmc3Irq);
AddBinding("AllowInvalidInput", chkAllowInvalidInput);

View file

@ -15,6 +15,8 @@ namespace Mesen.GUI.Forms.Config
const int WM_KEYDOWN = 0x100;
const int WM_KEYUP = 0x101;
private string[] _invalidKeys = new string[] { "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12" };
public frmGetKey()
{
InitializeComponent();
@ -53,7 +55,7 @@ namespace Mesen.GUI.Forms.Config
{
UInt32 scanCode = InteropEmu.GetPressedKey();
string pressedKey = InteropEmu.GetKeyName(scanCode);
if(!string.IsNullOrWhiteSpace(pressedKey)) {
if(!string.IsNullOrWhiteSpace(pressedKey) && !_invalidKeys.Contains(pressedKey)) {
BindedKeyName = pressedKey;
BindedKeyCode = scanCode;
this.Close();

View file

@ -44,6 +44,8 @@
this.tabMain = new System.Windows.Forms.TabControl();
this.tpgGeneral = new System.Windows.Forms.TabPage();
this.tpgSaveData = new System.Windows.Forms.TabPage();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.grpCloudSaves = new System.Windows.Forms.GroupBox();
this.tlpCloudSaves = new System.Windows.Forms.TableLayoutPanel();
this.tlpCloudSaveDesc = new System.Windows.Forms.TableLayoutPanel();
this.lblGoogleDriveIntegration = new System.Windows.Forms.Label();
@ -57,6 +59,13 @@
this.lblLastSync = new System.Windows.Forms.Label();
this.lblLastSyncDateTime = new System.Windows.Forms.Label();
this.btnResync = new System.Windows.Forms.Button();
this.grpAutomaticSaves = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.chkAutoSaveNotify = new System.Windows.Forms.CheckBox();
this.flpAutoSave = new System.Windows.Forms.FlowLayoutPanel();
this.chkAutoSave = new System.Windows.Forms.CheckBox();
this.nudAutoSave = new System.Windows.Forms.NumericUpDown();
this.lblAutoSave = new System.Windows.Forms.Label();
this.tpgNsf = new System.Windows.Forms.TabPage();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel7 = new System.Windows.Forms.FlowLayoutPanel();
@ -84,26 +93,25 @@
this.chkFdsAutoLoadDisk = new System.Windows.Forms.CheckBox();
this.chkFdsFastForwardOnLoad = new System.Windows.Forms.CheckBox();
this.tmrSyncDateTime = new System.Windows.Forms.Timer(this.components);
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.grpCloudSaves = new System.Windows.Forms.GroupBox();
this.grpAutomaticSaves = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.flpAutoSave = new System.Windows.Forms.FlowLayoutPanel();
this.chkAutoSave = new System.Windows.Forms.CheckBox();
this.nudAutoSave = new System.Windows.Forms.NumericUpDown();
this.lblAutoSave = new System.Windows.Forms.Label();
this.chkAutoSaveNotify = new System.Windows.Forms.CheckBox();
this.tpgShortcuts = new System.Windows.Forms.TabPage();
this.ctrlEmulatorShortcuts = new Mesen.GUI.Forms.Config.ctrlEmulatorShortcuts();
this.tlpMain.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.tabMain.SuspendLayout();
this.tpgGeneral.SuspendLayout();
this.tpgSaveData.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.grpCloudSaves.SuspendLayout();
this.tlpCloudSaves.SuspendLayout();
this.tlpCloudSaveDesc.SuspendLayout();
this.tlpCloudSaveEnabled.SuspendLayout();
this.flowLayoutPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picOK)).BeginInit();
this.flowLayoutPanel4.SuspendLayout();
this.grpAutomaticSaves.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
this.flpAutoSave.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudAutoSave)).BeginInit();
this.tpgNsf.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.flowLayoutPanel7.SuspendLayout();
@ -115,12 +123,7 @@
this.tlpFileFormat.SuspendLayout();
this.tpgAdvanced.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.grpCloudSaves.SuspendLayout();
this.grpAutomaticSaves.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
this.flpAutoSave.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudAutoSave)).BeginInit();
this.tpgShortcuts.SuspendLayout();
this.SuspendLayout();
//
// baseConfigPanel
@ -155,7 +158,7 @@
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.Size = new System.Drawing.Size(473, 223);
this.tlpMain.Size = new System.Drawing.Size(473, 337);
this.tlpMain.TabIndex = 1;
//
// chkSingleInstance
@ -232,7 +235,7 @@
// btnOpenMesenFolder
//
this.btnOpenMesenFolder.AutoSize = true;
this.btnOpenMesenFolder.Location = new System.Drawing.Point(3, 197);
this.btnOpenMesenFolder.Location = new System.Drawing.Point(3, 311);
this.btnOpenMesenFolder.Name = "btnOpenMesenFolder";
this.btnOpenMesenFolder.Size = new System.Drawing.Size(117, 23);
this.btnOpenMesenFolder.TabIndex = 16;
@ -272,6 +275,7 @@
// tabMain
//
this.tabMain.Controls.Add(this.tpgGeneral);
this.tabMain.Controls.Add(this.tpgShortcuts);
this.tabMain.Controls.Add(this.tpgSaveData);
this.tabMain.Controls.Add(this.tpgNsf);
this.tabMain.Controls.Add(this.tpgFileAssociations);
@ -289,7 +293,7 @@
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(479, 229);
this.tpgGeneral.Size = new System.Drawing.Size(479, 343);
this.tpgGeneral.TabIndex = 0;
this.tpgGeneral.Text = "General";
this.tpgGeneral.UseVisualStyleBackColor = true;
@ -305,6 +309,32 @@
this.tpgSaveData.Text = "Save Data";
this.tpgSaveData.UseVisualStyleBackColor = true;
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 1;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Controls.Add(this.grpCloudSaves, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.grpAutomaticSaves, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(473, 337);
this.tableLayoutPanel3.TabIndex = 1;
//
// grpCloudSaves
//
this.grpCloudSaves.Controls.Add(this.tlpCloudSaves);
this.grpCloudSaves.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpCloudSaves.Location = new System.Drawing.Point(3, 76);
this.grpCloudSaves.Name = "grpCloudSaves";
this.grpCloudSaves.Size = new System.Drawing.Size(467, 258);
this.grpCloudSaves.TabIndex = 2;
this.grpCloudSaves.TabStop = false;
this.grpCloudSaves.Text = "Cloud Saves";
//
// tlpCloudSaves
//
this.tlpCloudSaves.ColumnCount = 1;
@ -462,13 +492,108 @@
this.btnResync.UseVisualStyleBackColor = true;
this.btnResync.Click += new System.EventHandler(this.btnResync_Click);
//
// grpAutomaticSaves
//
this.grpAutomaticSaves.Controls.Add(this.tableLayoutPanel4);
this.grpAutomaticSaves.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpAutomaticSaves.Location = new System.Drawing.Point(3, 3);
this.grpAutomaticSaves.Name = "grpAutomaticSaves";
this.grpAutomaticSaves.Size = new System.Drawing.Size(467, 67);
this.grpAutomaticSaves.TabIndex = 3;
this.grpAutomaticSaves.TabStop = false;
this.grpAutomaticSaves.Text = "Automatic Save States";
//
// tableLayoutPanel4
//
this.tableLayoutPanel4.ColumnCount = 1;
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.chkAutoSaveNotify, 0, 2);
this.tableLayoutPanel4.Controls.Add(this.flpAutoSave, 0, 0);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 3;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(461, 48);
this.tableLayoutPanel4.TabIndex = 0;
//
// chkAutoSaveNotify
//
this.chkAutoSaveNotify.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.chkAutoSaveNotify.AutoSize = true;
this.chkAutoSaveNotify.Location = new System.Drawing.Point(15, 27);
this.chkAutoSaveNotify.Margin = new System.Windows.Forms.Padding(15, 3, 3, 3);
this.chkAutoSaveNotify.Name = "chkAutoSaveNotify";
this.chkAutoSaveNotify.Size = new System.Drawing.Size(240, 17);
this.chkAutoSaveNotify.TabIndex = 1;
this.chkAutoSaveNotify.Text = "Notify when an automatic save state is saved";
this.chkAutoSaveNotify.UseVisualStyleBackColor = true;
//
// flpAutoSave
//
this.flpAutoSave.Controls.Add(this.chkAutoSave);
this.flpAutoSave.Controls.Add(this.nudAutoSave);
this.flpAutoSave.Controls.Add(this.lblAutoSave);
this.flpAutoSave.Dock = System.Windows.Forms.DockStyle.Fill;
this.flpAutoSave.Location = new System.Drawing.Point(0, 0);
this.flpAutoSave.Margin = new System.Windows.Forms.Padding(0);
this.flpAutoSave.Name = "flpAutoSave";
this.flpAutoSave.Size = new System.Drawing.Size(461, 23);
this.flpAutoSave.TabIndex = 0;
//
// chkAutoSave
//
this.chkAutoSave.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.chkAutoSave.AutoSize = true;
this.chkAutoSave.Location = new System.Drawing.Point(3, 4);
this.chkAutoSave.Name = "chkAutoSave";
this.chkAutoSave.Size = new System.Drawing.Size(211, 17);
this.chkAutoSave.TabIndex = 0;
this.chkAutoSave.Text = "Automatically create a save state every";
this.chkAutoSave.UseVisualStyleBackColor = true;
this.chkAutoSave.CheckedChanged += new System.EventHandler(this.chkAutoSave_CheckedChanged);
//
// nudAutoSave
//
this.nudAutoSave.Location = new System.Drawing.Point(220, 3);
this.nudAutoSave.Maximum = new decimal(new int[] {
600,
0,
0,
0});
this.nudAutoSave.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.nudAutoSave.Name = "nudAutoSave";
this.nudAutoSave.Size = new System.Drawing.Size(42, 20);
this.nudAutoSave.TabIndex = 1;
this.nudAutoSave.Value = new decimal(new int[] {
5,
0,
0,
0});
//
// lblAutoSave
//
this.lblAutoSave.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblAutoSave.AutoSize = true;
this.lblAutoSave.Location = new System.Drawing.Point(268, 6);
this.lblAutoSave.Name = "lblAutoSave";
this.lblAutoSave.Size = new System.Drawing.Size(99, 13);
this.lblAutoSave.TabIndex = 2;
this.lblAutoSave.Text = "minutes (F6 to load)";
//
// tpgNsf
//
this.tpgNsf.Controls.Add(this.tableLayoutPanel2);
this.tpgNsf.Location = new System.Drawing.Point(4, 22);
this.tpgNsf.Name = "tpgNsf";
this.tpgNsf.Padding = new System.Windows.Forms.Padding(3);
this.tpgNsf.Size = new System.Drawing.Size(479, 259);
this.tpgNsf.Size = new System.Drawing.Size(479, 343);
this.tpgNsf.TabIndex = 4;
this.tpgNsf.Text = "NSF / NSFe";
this.tpgNsf.UseVisualStyleBackColor = true;
@ -487,7 +612,7 @@
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(473, 253);
this.tableLayoutPanel2.Size = new System.Drawing.Size(473, 337);
this.tableLayoutPanel2.TabIndex = 0;
//
// flowLayoutPanel7
@ -611,7 +736,7 @@
this.tpgFileAssociations.Location = new System.Drawing.Point(4, 22);
this.tpgFileAssociations.Name = "tpgFileAssociations";
this.tpgFileAssociations.Padding = new System.Windows.Forms.Padding(3);
this.tpgFileAssociations.Size = new System.Drawing.Size(479, 259);
this.tpgFileAssociations.Size = new System.Drawing.Size(479, 343);
this.tpgFileAssociations.TabIndex = 2;
this.tpgFileAssociations.Text = "File Associations";
this.tpgFileAssociations.UseVisualStyleBackColor = true;
@ -622,7 +747,7 @@
this.grpFileAssociations.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpFileAssociations.Location = new System.Drawing.Point(3, 3);
this.grpFileAssociations.Name = "grpFileAssociations";
this.grpFileAssociations.Size = new System.Drawing.Size(473, 253);
this.grpFileAssociations.Size = new System.Drawing.Size(473, 337);
this.grpFileAssociations.TabIndex = 12;
this.grpFileAssociations.TabStop = false;
this.grpFileAssociations.Text = "File Associations";
@ -648,7 +773,7 @@
this.tlpFileFormat.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpFileFormat.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpFileFormat.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpFileFormat.Size = new System.Drawing.Size(467, 234);
this.tlpFileFormat.Size = new System.Drawing.Size(467, 318);
this.tlpFileFormat.TabIndex = 0;
//
// chkNsfeFormat
@ -728,7 +853,7 @@
this.tpgAdvanced.Location = new System.Drawing.Point(4, 22);
this.tpgAdvanced.Name = "tpgAdvanced";
this.tpgAdvanced.Padding = new System.Windows.Forms.Padding(3);
this.tpgAdvanced.Size = new System.Drawing.Size(479, 259);
this.tpgAdvanced.Size = new System.Drawing.Size(479, 343);
this.tpgAdvanced.TabIndex = 1;
this.tpgAdvanced.Text = "Advanced";
this.tpgAdvanced.UseVisualStyleBackColor = true;
@ -788,126 +913,24 @@
this.tmrSyncDateTime.Enabled = true;
this.tmrSyncDateTime.Tick += new System.EventHandler(this.tmrSyncDateTime_Tick);
//
// tableLayoutPanel3
// tpgShortcuts
//
this.tableLayoutPanel3.ColumnCount = 1;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Controls.Add(this.grpCloudSaves, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.grpAutomaticSaves, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(473, 337);
this.tableLayoutPanel3.TabIndex = 1;
this.tpgShortcuts.Controls.Add(this.ctrlEmulatorShortcuts);
this.tpgShortcuts.Location = new System.Drawing.Point(4, 22);
this.tpgShortcuts.Name = "tpgShortcuts";
this.tpgShortcuts.Padding = new System.Windows.Forms.Padding(3);
this.tpgShortcuts.Size = new System.Drawing.Size(479, 343);
this.tpgShortcuts.TabIndex = 7;
this.tpgShortcuts.Text = "Shortcut Keys";
this.tpgShortcuts.UseVisualStyleBackColor = true;
//
// grpCloudSaves
// ctrlEmulatorShortcuts
//
this.grpCloudSaves.Controls.Add(this.tlpCloudSaves);
this.grpCloudSaves.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpCloudSaves.Location = new System.Drawing.Point(3, 76);
this.grpCloudSaves.Name = "grpCloudSaves";
this.grpCloudSaves.Size = new System.Drawing.Size(467, 258);
this.grpCloudSaves.TabIndex = 2;
this.grpCloudSaves.TabStop = false;
this.grpCloudSaves.Text = "Cloud Saves";
//
// grpAutomaticSaves
//
this.grpAutomaticSaves.Controls.Add(this.tableLayoutPanel4);
this.grpAutomaticSaves.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpAutomaticSaves.Location = new System.Drawing.Point(3, 3);
this.grpAutomaticSaves.Name = "grpAutomaticSaves";
this.grpAutomaticSaves.Size = new System.Drawing.Size(467, 67);
this.grpAutomaticSaves.TabIndex = 3;
this.grpAutomaticSaves.TabStop = false;
this.grpAutomaticSaves.Text = "Automatic Save States";
//
// tableLayoutPanel4
//
this.tableLayoutPanel4.ColumnCount = 1;
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.chkAutoSaveNotify, 0, 2);
this.tableLayoutPanel4.Controls.Add(this.flpAutoSave, 0, 0);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 3;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(461, 48);
this.tableLayoutPanel4.TabIndex = 0;
//
// flpAutoSave
//
this.flpAutoSave.Controls.Add(this.chkAutoSave);
this.flpAutoSave.Controls.Add(this.nudAutoSave);
this.flpAutoSave.Controls.Add(this.lblAutoSave);
this.flpAutoSave.Dock = System.Windows.Forms.DockStyle.Fill;
this.flpAutoSave.Location = new System.Drawing.Point(0, 0);
this.flpAutoSave.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.flpAutoSave.Name = "flpAutoSave";
this.flpAutoSave.Size = new System.Drawing.Size(461, 23);
this.flpAutoSave.TabIndex = 0;
//
// chkAutoSave
//
this.chkAutoSave.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.chkAutoSave.AutoSize = true;
this.chkAutoSave.Location = new System.Drawing.Point(3, 4);
this.chkAutoSave.Name = "chkAutoSave";
this.chkAutoSave.Size = new System.Drawing.Size(211, 17);
this.chkAutoSave.TabIndex = 0;
this.chkAutoSave.Text = "Automatically create a save state every";
this.chkAutoSave.UseVisualStyleBackColor = true;
this.chkAutoSave.CheckedChanged += new System.EventHandler(this.chkAutoSave_CheckedChanged);
//
// nudAutoSave
//
this.nudAutoSave.Location = new System.Drawing.Point(220, 3);
this.nudAutoSave.Maximum = new decimal(new int[] {
600,
0,
0,
0});
this.nudAutoSave.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.nudAutoSave.Name = "nudAutoSave";
this.nudAutoSave.Size = new System.Drawing.Size(42, 20);
this.nudAutoSave.TabIndex = 1;
this.nudAutoSave.Value = new decimal(new int[] {
5,
0,
0,
0});
//
// lblAutoSave
//
this.lblAutoSave.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblAutoSave.AutoSize = true;
this.lblAutoSave.Location = new System.Drawing.Point(268, 6);
this.lblAutoSave.Name = "lblAutoSave";
this.lblAutoSave.Size = new System.Drawing.Size(99, 13);
this.lblAutoSave.TabIndex = 2;
this.lblAutoSave.Text = "minutes (F6 to load)";
//
// chkAutoSaveNotify
//
this.chkAutoSaveNotify.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.chkAutoSaveNotify.AutoSize = true;
this.chkAutoSaveNotify.Location = new System.Drawing.Point(15, 27);
this.chkAutoSaveNotify.Margin = new System.Windows.Forms.Padding(15, 3, 3, 3);
this.chkAutoSaveNotify.Name = "chkAutoSaveNotify";
this.chkAutoSaveNotify.Size = new System.Drawing.Size(240, 17);
this.chkAutoSaveNotify.TabIndex = 1;
this.chkAutoSaveNotify.Text = "Notify when an automatic save state is saved";
this.chkAutoSaveNotify.UseVisualStyleBackColor = true;
this.ctrlEmulatorShortcuts.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlEmulatorShortcuts.Location = new System.Drawing.Point(3, 3);
this.ctrlEmulatorShortcuts.Name = "ctrlEmulatorShortcuts";
this.ctrlEmulatorShortcuts.Size = new System.Drawing.Size(473, 337);
this.ctrlEmulatorShortcuts.TabIndex = 0;
//
// frmPreferences
//
@ -931,6 +954,8 @@
this.tabMain.ResumeLayout(false);
this.tpgGeneral.ResumeLayout(false);
this.tpgSaveData.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.grpCloudSaves.ResumeLayout(false);
this.tlpCloudSaves.ResumeLayout(false);
this.tlpCloudSaveDesc.ResumeLayout(false);
this.tlpCloudSaveDesc.PerformLayout();
@ -940,6 +965,12 @@
((System.ComponentModel.ISupportInitialize)(this.picOK)).EndInit();
this.flowLayoutPanel4.ResumeLayout(false);
this.flowLayoutPanel4.PerformLayout();
this.grpAutomaticSaves.ResumeLayout(false);
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel4.PerformLayout();
this.flpAutoSave.ResumeLayout(false);
this.flpAutoSave.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudAutoSave)).EndInit();
this.tpgNsf.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
@ -956,14 +987,7 @@
this.tpgAdvanced.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel3.ResumeLayout(false);
this.grpCloudSaves.ResumeLayout(false);
this.grpAutomaticSaves.ResumeLayout(false);
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel4.PerformLayout();
this.flpAutoSave.ResumeLayout(false);
this.flpAutoSave.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudAutoSave)).EndInit();
this.tpgShortcuts.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -1034,5 +1058,7 @@
private System.Windows.Forms.NumericUpDown nudAutoSave;
private System.Windows.Forms.Label lblAutoSave;
private System.Windows.Forms.CheckBox chkAutoSaveNotify;
private System.Windows.Forms.TabPage tpgShortcuts;
private ctrlEmulatorShortcuts ctrlEmulatorShortcuts;
}
}

View file

@ -56,6 +56,12 @@ namespace Mesen.GUI.Forms.Config
UpdateCloudDisplay();
}
protected override void UpdateConfig()
{
base.UpdateConfig();
ctrlEmulatorShortcuts.UpdateConfig();
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
base.OnFormClosed(e);

View file

@ -142,9 +142,11 @@ namespace Mesen.GUI.Forms
name = ((ToolStripItem)ctrl).Name;
} else if(ctrl is ColumnHeader) {
name = ((ColumnHeader)ctrl).Name;
} else if(ctrl is DataGridViewColumn) {
name = ((DataGridViewColumn)ctrl).Name;
}
var controlNode = baseNode.SelectSingleNode("Control[@ID='" + name + "']");
var controlNode = baseNode.SelectSingleNode("Control[@ID='" + name + "']");
if(controlNode != null) {
if(ctrl is Control) {
((Control)ctrl).Text = controlNode.InnerText;
@ -155,10 +157,14 @@ namespace Mesen.GUI.Forms
}
} else if(ctrl is ColumnHeader) {
((ColumnHeader)ctrl).Text = controlNode.InnerText;
} else if(ctrl is DataGridViewColumn) {
((DataGridViewColumn)ctrl).HeaderText = controlNode.InnerText;
}
}
if(ctrl is MenuStrip) {
if(ctrl is DataGridView) {
ApplyResources(baseNode, ((DataGridView)ctrl).Columns);
} else if(ctrl is MenuStrip) {
ApplyResources(baseNode, ((MenuStrip)ctrl).Items);
} else if(ctrl is ContextMenuStrip) {
ApplyResources(baseNode, ((ContextMenuStrip)ctrl).Items);

View file

@ -414,6 +414,12 @@
<Compile Include="Forms\Config\ctrlDipSwitch.Designer.cs">
<DependentUpon>ctrlDipSwitch.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Config\ctrlEmulatorShortcuts.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\Config\ctrlEmulatorShortcuts.Designer.cs">
<DependentUpon>ctrlEmulatorShortcuts.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Config\ctrlInputPortConfig.cs">
<SubType>UserControl</SubType>
</Compile>
@ -635,6 +641,9 @@
<EmbeddedResource Include="Forms\Config\ctrlDipSwitch.resx">
<DependentUpon>ctrlDipSwitch.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Config\ctrlEmulatorShortcuts.resx">
<DependentUpon>ctrlEmulatorShortcuts.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Config\ctrlInputPortConfig.resx">
<DependentUpon>ctrlInputPortConfig.cs</DependentUpon>
</EmbeddedResource>

View file

@ -41,6 +41,7 @@ namespace Mesen.GUI
[DllImport(DLLPath)] public static extern void SetControllerKeys(int port, KeyMappingSet mapping);
[DllImport(DLLPath)] public static extern void SetExpansionDevice(ExpansionPortDevice device);
[DllImport(DLLPath)] public static extern void SetConsoleType(ConsoleType type);
[DllImport(DLLPath)] public static extern void SetEmulatorKeys(EmulatorKeyMappingSet mappings);
[DllImport(DLLPath)] public static extern ControllerType GetControllerType(int port);
[DllImport(DLLPath)] public static extern ExpansionPortDevice GetExpansionDevice();
@ -135,6 +136,7 @@ namespace Mesen.GUI
[DllImport(DLLPath)] public static extern void SetReverbParameters(double strength, double delay);
[DllImport(DLLPath)] public static extern void SetNesModel(NesModel model);
[DllImport(DLLPath)] public static extern void SetEmulationSpeed(UInt32 emulationSpeed);
[DllImport(DLLPath)] public static extern void SetTurboSpeed(UInt32 turboSpeed);
[DllImport(DLLPath)] public static extern void SetOverclockRate(UInt32 overclockRate, [MarshalAs(UnmanagedType.I1)]bool adjustApu);
[DllImport(DLLPath)] public static extern void SetPpuNmiConfig(UInt32 extraScanlinesBeforeNmi, UInt32 extraScanlineAfterNmi);
[DllImport(DLLPath)] public static extern void SetOverscanDimensions(UInt32 left, UInt32 right, UInt32 top, UInt32 bottom);
@ -700,6 +702,32 @@ namespace Mesen.GUI
}
};
public struct EmulatorKeyMappingSet
{
public EmulatorKeyMappings KeySet1;
public EmulatorKeyMappings KeySet2;
}
public struct EmulatorKeyMappings
{
public UInt32 FastForward;
public UInt32 Pause;
public UInt32 Reset;
public UInt32 MoveToNextStateSlot;
public UInt32 MoveToPreviousStateSlot;
public UInt32 SaveState;
public UInt32 LoadState;
public UInt32 SwitchDiskSide;
public UInt32 InsertNextDisk;
public UInt32 InsertCoin1;
public UInt32 InsertCoin2;
public UInt32 TakeScreenshot;
}
public struct InteropCheatInfo
{
public CheatType CheatType;

View file

@ -102,6 +102,7 @@ namespace InteropEmu {
DllExport void __stdcall SetControllerKeys(uint32_t port, KeyMappingSet mappings) { EmulationSettings::SetControllerKeys(port, mappings); }
DllExport void __stdcall SetExpansionDevice(ExpansionPortDevice device) { EmulationSettings::SetExpansionDevice(device); }
DllExport void __stdcall SetConsoleType(ConsoleType type) { EmulationSettings::SetConsoleType(type); }
DllExport void __stdcall SetEmulatorKeys(EmulatorKeyMappingSet mappings) { EmulationSettings::SetEmulatorKeys(mappings); }
DllExport ControllerType __stdcall GetControllerType(uint32_t port) { return EmulationSettings::GetControllerType(port); }
DllExport ExpansionPortDevice GetExpansionDevice() { return EmulationSettings::GetExpansionDevice(); }
@ -335,6 +336,7 @@ namespace InteropEmu {
DllExport void __stdcall SetNesModel(uint32_t model) { EmulationSettings::SetNesModel((NesModel)model); }
DllExport void __stdcall SetOverscanDimensions(uint32_t left, uint32_t right, uint32_t top, uint32_t bottom) { EmulationSettings::SetOverscanDimensions(left, right, top, bottom); }
DllExport void __stdcall SetEmulationSpeed(uint32_t emulationSpeed) { EmulationSettings::SetEmulationSpeed(emulationSpeed); }
DllExport void __stdcall SetTurboSpeed(uint32_t turboSpeed) { EmulationSettings::SetTurboSpeed(turboSpeed); }
DllExport void __stdcall SetOverclockRate(uint32_t overclockRate, bool adjustApu) { EmulationSettings::SetOverclockRate(overclockRate, adjustApu); }
DllExport void __stdcall SetPpuNmiConfig(uint32_t extraScanlinesBeforeNmi, uint32_t extraScanlinesAfterNmi) { EmulationSettings::SetPpuNmiConfig(extraScanlinesBeforeNmi, extraScanlinesAfterNmi); }
DllExport void __stdcall SetVideoScale(double scale) { EmulationSettings::SetVideoScale(scale); }