From 0547ec7af7a6fd70ac945301d7bf00f1f6e3bc76 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Wed, 24 Feb 2010 07:52:37 +0000 Subject: [PATCH] SDL: fds eject/insert now mappable; default f6 and f8 GTK: addded insert/eject menu options NOTE: fds files are still broken in SDL (error loading auxillary fds file?) --- src/drivers/sdl/config.cpp | 6 ++++-- src/drivers/sdl/gui.cpp | 4 ++++ src/drivers/sdl/input.cpp | 14 +++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/drivers/sdl/config.cpp b/src/drivers/sdl/config.cpp index 2e1a0cb9..5f5f6169 100644 --- a/src/drivers/sdl/config.cpp +++ b/src/drivers/sdl/config.cpp @@ -303,9 +303,9 @@ InitConfig() #endif config->addOption(prefix + "RenderBG", SDLK_F4); config->addOption(prefix + "SaveState", SDLK_F5); - config->addOption(prefix + "FrameAdvanceLagSkip", SDLK_F6); + config->addOption(prefix + "FrameAdvanceLagSkip", SDLK_LEFTBRACKET); config->addOption(prefix + "LoadState", SDLK_F7); - config->addOption(prefix + "LagCounterDisplay", SDLK_F8); + config->addOption(prefix + "LagCounterDisplay", SDLK_RIGHTBRACKET); config->addOption(prefix + "MovieToggleFrameDisplay", SDLK_F9); config->addOption(prefix + "SubtitleDisplay", SDLK_F10); config->addOption(prefix + "Reset", SDLK_F11); @@ -321,6 +321,8 @@ InitConfig() config->addOption(prefix + "MuteCapture", SDLK_DELETE); #endif config->addOption(prefix + "Quit", SDLK_ESCAPE); + config->addOption(prefix + "FDSSelect", SDLK_F6); + config->addOption(prefix + "FDSEject", SDLK_F8); //config->addOption(prefix + "Power", 0); diff --git a/src/drivers/sdl/gui.cpp b/src/drivers/sdl/gui.cpp index 6aad1d5c..55695ec8 100644 --- a/src/drivers/sdl/gui.cpp +++ b/src/drivers/sdl/gui.cpp @@ -11,6 +11,7 @@ #include "../../version.h" #include "../../movie.h" #include "../../palette.h" +#include "../../fds.h" #include "../common/configSys.h" @@ -896,6 +897,9 @@ static GtkItemFactoryEntry menu_items[] = { { "/Emulator/_Reset", NULL, emuReset, 0, ""}, { "/Emulator/_Pause", NULL, emuPause, 0, ""}, { "/Emulator/R_esume", NULL, emuResume, 0, ""}, + { "/Emulator/_FDS", NULL, NULL, 0, ""}, + { "/Emulator/_FDS/_Switch Disk", NULL, FCEU_FDSSelect, 0, ""}, + { "/Emulator/_FDS/_Eject Disk", NULL, FCEU_FDSInsert, 0, ""}, { "/Options/_Gamepad Config", NULL , openGamepadConfig, 0, "", GTK_STOCK_PREFERENCES }, { "/Options/_Sound Config", NULL , openSoundConfig, 0, "" }, { "/Options/_Vound Config", NULL , openVideoConfig, 0, "" }, diff --git a/src/drivers/sdl/input.cpp b/src/drivers/sdl/input.cpp index 86fcdd4c..3e9b87f2 100644 --- a/src/drivers/sdl/input.cpp +++ b/src/drivers/sdl/input.cpp @@ -186,6 +186,8 @@ int movieToggleReadWriteKey; #ifdef CREATE_AVI int MuteCaptureKey; #endif +int fdsSelectDiskKey; +int fdsEjectKey; // this function loads the sdl hotkeys from the config file into the // global scope. this elimates the need for accessing the config file @@ -228,6 +230,8 @@ void setHotKeys() #ifdef CREATE_AVI g_config->getOption("SDL.Hotkeys.MuteCapture", &MuteCaptureKey); #endif + g_config->getOption("SDL.Hotkeys.FDSSelect", &fdsSelectDiskKey); + g_config->getOption("SDL.Hotkeys.FDSEject", &fdsEjectKey); /* config->addOption(prefix + "FrameAdvance", SDLK_BACKSLASH); config->addOption(prefix + "Power", 0); @@ -471,15 +475,15 @@ KeyboardCommands() } // Famicom disk-system games - if(gametype==GIT_FDS) - { - if(keyonly(F6)) { + //if(gametype==GIT_FDS) + //{ + if(_keyonly(fdsSelectDiskKey)) { FCEUI_FDSSelect(); } - if(keyonly(F8)) { + if(_keyonly(fdsEjectKey)) { FCEUI_FDSInsert(); } - } + //} if(_keyonly(screenshotKey)) { FCEUI_SaveSnapshot();