SDL: hotkey config system revamped. shouldn't be too difficult to write a GUI for defining hotkeys in the near future
This commit is contained in:
parent
88300c898e
commit
c32e80286f
|
@ -32,18 +32,17 @@
|
||||||
int
|
int
|
||||||
LoadCPalette(const std::string &file)
|
LoadCPalette(const std::string &file)
|
||||||
{
|
{
|
||||||
printf("Loading custom palette from file...\n");
|
|
||||||
uint8 tmpp[192];
|
uint8 tmpp[192];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
if(!(fp = FCEUD_UTF8fopen(file.c_str(), "rb"))) {
|
if(!(fp = FCEUD_UTF8fopen(file.c_str(), "rb"))) {
|
||||||
printf(" Error loading custom palette from file: %s\n", file.c_str());
|
printf(" Error loading custom palette from file: %s\n", file.c_str());
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
fread(tmpp, 1, 192, fp);
|
fread(tmpp, 1, 192, fp);
|
||||||
FCEUI_SetPaletteArray(tmpp);
|
FCEUI_SetPaletteArray(tmpp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -294,35 +293,49 @@ InitConfig()
|
||||||
DefaultFamilyKeyBoard[j]);
|
DefaultFamilyKeyBoard[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hotkeys
|
const int Hotkeys[HK_MAX] = {
|
||||||
prefix = "SDL.Hotkeys.";
|
SDLK_F1, // cheat menu
|
||||||
config->addOption(prefix + "CheatMenu", SDLK_F1);
|
SDLK_F2, // bind state
|
||||||
config->addOption(prefix + "BindState", SDLK_F2);
|
SDLK_F3, // load lua
|
||||||
#ifdef _S9XLUA_H
|
SDLK_F4, // toggleBG
|
||||||
config->addOption(prefix + "LoadLua", SDLK_F3);
|
SDLK_F5, // save state
|
||||||
#endif
|
SDLK_F6, // fds select
|
||||||
config->addOption(prefix + "RenderBG", SDLK_F4);
|
SDLK_F7, // load state
|
||||||
config->addOption(prefix + "SaveState", SDLK_F5);
|
SDLK_F8, // fds eject
|
||||||
config->addOption(prefix + "FrameAdvanceLagSkip", SDLK_LEFTBRACKET);
|
SDLK_F9, // toggle frame display
|
||||||
config->addOption(prefix + "LoadState", SDLK_F7);
|
SDLK_F10, // toggle subtitle
|
||||||
config->addOption(prefix + "LagCounterDisplay", SDLK_RIGHTBRACKET);
|
SDLK_F11, // reset
|
||||||
config->addOption(prefix + "MovieToggleFrameDisplay", SDLK_F9);
|
SDLK_F12, // screenshot
|
||||||
config->addOption(prefix + "SubtitleDisplay", SDLK_F10);
|
SDLK_PAUSE, // pause
|
||||||
config->addOption(prefix + "Reset", SDLK_F11);
|
SDLK_MINUS, // speed++
|
||||||
config->addOption(prefix + "Screenshot", SDLK_F12);
|
SDLK_EQUALS, // speed--
|
||||||
|
SDLK_BACKSLASH, //frame advnace
|
||||||
|
SDLK_TAB, // turbo
|
||||||
|
SDLK_i, // toggle input display
|
||||||
|
SDLK_o, // toggle movie RW
|
||||||
|
SDLK_p, // toggle mute capture
|
||||||
|
0, // quit
|
||||||
|
SDLK_DELETE, // frame advance lag skip
|
||||||
|
SDLK_ESCAPE, // lag counter display
|
||||||
|
SDLK_0, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5,
|
||||||
|
SDLK_6, SDLK_7, SDLK_8, SDLK_9};
|
||||||
|
|
||||||
|
prefix = "SDL.Hotkeys.";
|
||||||
|
for(int i=0; i < HK_MAX; i++)
|
||||||
|
config->addOption(prefix + HotkeyStrings[i], Hotkeys[i]);
|
||||||
|
|
||||||
|
/*
|
||||||
config->addOption(prefix + "Pause", SDLK_PAUSE);
|
config->addOption(prefix + "Pause", SDLK_PAUSE);
|
||||||
config->addOption(prefix + "DecreaseSpeed", SDLK_MINUS);
|
config->addOption(prefix + "DecreaseSpeed", SDLK_MINUS);
|
||||||
config->addOption(prefix + "IncreaseSpeed", SDLK_EQUALS);
|
config->addOption(prefix + "IncreaseSpeed", SDLK_EQUALS);
|
||||||
config->addOption(prefix + "FrameAdvance", SDLK_BACKSLASH);
|
config->addOption(prefix + "FrameAdvance", SDLK_BACKSLASH);
|
||||||
config->addOption(prefix + "FastForward", SDLK_BACKQUOTE);
|
config->addOption(prefix + "FastForward", SDLK_TAB);
|
||||||
config->addOption(prefix + "InputDisplay", SDLK_i);
|
config->addOption(prefix + "InputDisplay", SDLK_i);
|
||||||
config->addOption(prefix + "MovieToggleReadWrite", SDLK_q);
|
config->addOption(prefix + "MovieToggleReadWrite", SDLK_q);
|
||||||
#ifdef CREATE_AVI
|
#ifdef CREATE_AVI
|
||||||
config->addOption(prefix + "MuteCapture", SDLK_DELETE);
|
config->addOption(prefix + "MuteCapture", SDLK_DELETE);
|
||||||
#endif
|
#endif
|
||||||
config->addOption(prefix + "Quit", SDLK_ESCAPE);
|
config->addOption(prefix + "Quit", SDLK_ESCAPE);
|
||||||
config->addOption(prefix + "FDSSelect", SDLK_F6);
|
|
||||||
config->addOption(prefix + "FDSEject", SDLK_F8);
|
|
||||||
//config->addOption(prefix + "Power", 0);
|
//config->addOption(prefix + "Power", 0);
|
||||||
|
|
||||||
|
|
||||||
|
@ -339,7 +352,7 @@ InitConfig()
|
||||||
config->addOption(prefix + "SelectState8", SDLK_8);
|
config->addOption(prefix + "SelectState8", SDLK_8);
|
||||||
config->addOption(prefix + "SelectState9", SDLK_9);
|
config->addOption(prefix + "SelectState9", SDLK_9);
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
// All mouse devices
|
// All mouse devices
|
||||||
config->addOption("SDL.OekaKids.0.DeviceType", "Mouse");
|
config->addOption("SDL.OekaKids.0.DeviceType", "Mouse");
|
||||||
|
@ -353,7 +366,7 @@ InitConfig()
|
||||||
|
|
||||||
config->addOption("SDL.Zapper.0.DeviceType", "Mouse");
|
config->addOption("SDL.Zapper.0.DeviceType", "Mouse");
|
||||||
config->addOption("SDL.Zapper.0.DeviceNum", 0);
|
config->addOption("SDL.Zapper.0.DeviceNum", 0);
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,4 +7,45 @@ Config *InitConfig(void);
|
||||||
void UpdateEMUCore(Config *);
|
void UpdateEMUCore(Config *);
|
||||||
int LoadCPalette(const std::string &file);
|
int LoadCPalette(const std::string &file);
|
||||||
|
|
||||||
|
|
||||||
|
// hotkey definitions
|
||||||
|
const int HK_MAX = 33;
|
||||||
|
|
||||||
|
enum HOTKEY { HK_CHEAT_MENU, HK_BIND_STATE, HK_LOAD_LUA, HK_TOGGLE_BG,
|
||||||
|
HK_SAVE_STATE, HK_FDS_SELECT, HK_LOAD_STATE, HK_FDS_EJECT ,
|
||||||
|
HK_TOGGLE_FRAME_DISPLAY, HK_TOGGLE_SUBTITLE, HK_RESET, HK_SCREENSHOT,
|
||||||
|
HK_PAUSE, HK_DECREASE_SPEED, HK_INCREASE_SPEED, HK_FRAME_ADVANCE, HK_TURBO,
|
||||||
|
HK_TOGGLE_INPUT_DISPLAY, HK_MOVIE_TOGGLE_RW, HK_MUTE_CAPTURE, HK_QUIT, HK_FA_LAG_SKIP, HK_LAG_COUNTER_DISPLAY,
|
||||||
|
HK_SELECT_STATE_0, HK_SELECT_STATE_1, HK_SELECT_STATE_2, HK_SELECT_STATE_3,
|
||||||
|
HK_SELECT_STATE_4, HK_SELECT_STATE_5, HK_SELECT_STATE_6, HK_SELECT_STATE_7,
|
||||||
|
HK_SELECT_STATE_8, HK_SELECT_STATE_9};
|
||||||
|
static const char* HotkeyStrings[HK_MAX] = {
|
||||||
|
"CheatMenu",
|
||||||
|
"BindState",
|
||||||
|
"LoadLua",
|
||||||
|
"ToggleBG",
|
||||||
|
"SaveState",
|
||||||
|
"FDSSelect",
|
||||||
|
"FDSEject",
|
||||||
|
"LoadState",
|
||||||
|
|
||||||
|
"MovieToggleFrameDisplay",
|
||||||
|
"SubtitleDisplay",
|
||||||
|
"Reset",
|
||||||
|
"Screenshot",
|
||||||
|
"Pause",
|
||||||
|
"DecreaseSpeed",
|
||||||
|
"IncreaseSpeed",
|
||||||
|
"FrameAdvance",
|
||||||
|
"Turbo",
|
||||||
|
"ToggleInputDisplay",
|
||||||
|
"ToggleMovieRW",
|
||||||
|
"MuteCapture",
|
||||||
|
"Quit",
|
||||||
|
"FrameAdvanceLagSkip",
|
||||||
|
"LagCounterDisplay",
|
||||||
|
"SelectState0", "SelectState1", "SelectState2", "SelectState3",
|
||||||
|
"SelectState4", "SelectState5", "SelectState6", "SelectState7",
|
||||||
|
"SelectState8", "SelectState9" };
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -162,97 +162,19 @@ _keyonly(int a)
|
||||||
|
|
||||||
static int g_fkbEnabled = 0;
|
static int g_fkbEnabled = 0;
|
||||||
|
|
||||||
// key definitions
|
|
||||||
int cheatMenuKey;
|
|
||||||
#ifdef _S9XLUA_H
|
|
||||||
int loadLuaKey;
|
|
||||||
#endif
|
|
||||||
int renderBgKey;
|
|
||||||
int saveStateKey;
|
|
||||||
int loadStateKey;
|
|
||||||
int resetKey;
|
|
||||||
int screenshotKey;
|
|
||||||
int pauseKey;
|
|
||||||
int decreaseSpeedKey;
|
|
||||||
int increaseSpeedKey;
|
|
||||||
int frameAdvanceKey;
|
|
||||||
int ffKey;
|
|
||||||
int powerKey;
|
|
||||||
int bindStateKey;
|
|
||||||
int frameAdvanceLagSkipKey;
|
|
||||||
int quitKey;
|
|
||||||
int stateKey[10];
|
|
||||||
int movieToggleFrameDisplayKey;
|
|
||||||
int lagCounterDisplayKey;
|
|
||||||
int SubtitleDisplayKey;
|
|
||||||
int InputDisplayKey;
|
|
||||||
int movieToggleReadWriteKey;
|
|
||||||
#ifdef CREATE_AVI
|
|
||||||
int MuteCaptureKey;
|
|
||||||
#endif
|
|
||||||
int fdsSelectDiskKey;
|
|
||||||
int fdsEjectKey;
|
|
||||||
|
|
||||||
// this function loads the sdl hotkeys from the config file into the
|
// this function loads the sdl hotkeys from the config file into the
|
||||||
// global scope. this elimates the need for accessing the config file
|
// global scope. this elimates the need for accessing the config file
|
||||||
|
|
||||||
|
int Hotkeys[HK_MAX] = {0};
|
||||||
|
|
||||||
// on every cycle of keyboardinput()
|
// on every cycle of keyboardinput()
|
||||||
void setHotKeys()
|
void setHotKeys()
|
||||||
{
|
{
|
||||||
g_config->getOption("SDL.Hotkeys.CheatMenu", &cheatMenuKey);
|
std::string prefix = "SDL.Hotkeys.";
|
||||||
#ifdef _S9XLUA_H
|
for(int i=0; i<HK_MAX; i++)
|
||||||
g_config->getOption("SDL.Hotkeys.LoadLua", &loadLuaKey);
|
{
|
||||||
#endif
|
g_config->getOption(prefix + HotkeyStrings[i], &Hotkeys[i]);
|
||||||
g_config->getOption("SDL.Hotkeys.RenderBG", &renderBgKey);
|
}
|
||||||
g_config->getOption("SDL.Hotkeys.SaveState", &saveStateKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.LoadState", &loadStateKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.Reset", &resetKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.Screenshot", &screenshotKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.Pause", &pauseKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.IncreaseSpeed", &increaseSpeedKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.DecreaseSpeed", &decreaseSpeedKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.FrameAdvance", &frameAdvanceKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.FastForward", &ffKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.Power", &powerKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.Pause", &bindStateKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.FrameAdvanceLagSkip", &frameAdvanceLagSkipKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.Quit", &quitKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState0", &stateKey[0]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState1", &stateKey[1]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState2", &stateKey[2]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState3", &stateKey[3]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState4", &stateKey[4]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState5", &stateKey[5]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState6", &stateKey[6]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState7", &stateKey[7]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState8", &stateKey[8]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SelectState9", &stateKey[9]);
|
|
||||||
g_config->getOption("SDL.Hotkeys.LagCounterDisplay", &lagCounterDisplayKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.MovieToggleFrameDisplay", &movieToggleFrameDisplayKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.SubtitleDisplay", &SubtitleDisplayKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.InputDisplay", &InputDisplayKey);
|
|
||||||
g_config->getOption("SDL.Hotkeys.MovieToggleReadWrite", &movieToggleReadWriteKey);
|
|
||||||
#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);
|
|
||||||
config->addOption(prefix + "BindState", SDLK_F2);
|
|
||||||
config->addOption(prefix + "FrameAdvanceLagSkip", SDLK_F6);
|
|
||||||
config->addOption(prefix + "LagCounterDisplay", SDLK_F8);
|
|
||||||
config->addOption(prefix + "SelectState0", SDLK_0);
|
|
||||||
config->addOption(prefix + "SelectState1", SDLK_1);
|
|
||||||
config->addOption(prefix + "SelectState2", SDLK_2);
|
|
||||||
config->addOption(prefix + "SelectState3", SDLK_3);
|
|
||||||
config->addOption(prefix + "SelectState4", SDLK_4);
|
|
||||||
config->addOption(prefix + "SelectState5", SDLK_5);
|
|
||||||
config->addOption(prefix + "SelectState6", SDLK_6);
|
|
||||||
config->addOption(prefix + "SelectState7", SDLK_7);
|
|
||||||
config->addOption(prefix + "SelectState8", SDLK_8);
|
|
||||||
config->addOption(prefix + "SelectState9", SDLK_9);
|
|
||||||
*/
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,7 +430,7 @@ KeyboardCommands()
|
||||||
is_alt = 0;
|
is_alt = 0;
|
||||||
|
|
||||||
|
|
||||||
if(_keyonly(renderBgKey)) {
|
if(_keyonly(Hotkeys[HK_TOGGLE_BG])) {
|
||||||
if(is_shift) {
|
if(is_shift) {
|
||||||
FCEUI_SetRenderPlanes(true, false);
|
FCEUI_SetRenderPlanes(true, false);
|
||||||
} else {
|
} else {
|
||||||
|
@ -548,26 +470,26 @@ KeyboardCommands()
|
||||||
// Famicom disk-system games
|
// Famicom disk-system games
|
||||||
if(gametype==GIT_FDS)
|
if(gametype==GIT_FDS)
|
||||||
{
|
{
|
||||||
if(_keyonly(fdsSelectDiskKey)) {
|
if(_keyonly(Hotkeys[HK_FDS_SELECT])) {
|
||||||
FCEUI_FDSSelect();
|
FCEUI_FDSSelect();
|
||||||
}
|
}
|
||||||
if(_keyonly(fdsEjectKey)) {
|
if(_keyonly(Hotkeys[HK_FDS_EJECT])) {
|
||||||
FCEUI_FDSInsert();
|
FCEUI_FDSInsert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_keyonly(screenshotKey)) {
|
if(_keyonly(Hotkeys[HK_SCREENSHOT])) {
|
||||||
FCEUI_SaveSnapshot();
|
FCEUI_SaveSnapshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if not NES Sound Format
|
// if not NES Sound Format
|
||||||
if(gametype != GIT_NSF) {
|
if(gametype != GIT_NSF) {
|
||||||
if(_keyonly(cheatMenuKey)) {
|
if(_keyonly(Hotkeys[HK_CHEAT_MENU])) {
|
||||||
DoCheatSeq();
|
DoCheatSeq();
|
||||||
}
|
}
|
||||||
|
|
||||||
// f5 (default) save key, hold shift to save movie
|
// f5 (default) save key, hold shift to save movie
|
||||||
if(_keyonly(saveStateKey)) {
|
if(_keyonly(Hotkeys[HK_SAVE_STATE])) {
|
||||||
if(is_shift) {
|
if(is_shift) {
|
||||||
movie_fname = const_cast<char*>(FCEU_MakeFName(FCEUMKF_MOVIE, 0, 0).c_str());
|
movie_fname = const_cast<char*>(FCEU_MakeFName(FCEUMKF_MOVIE, 0, 0).c_str());
|
||||||
FCEUI_printf("Recording movie to %s\n", movie_fname);
|
FCEUI_printf("Recording movie to %s\n", movie_fname);
|
||||||
|
@ -578,7 +500,7 @@ KeyboardCommands()
|
||||||
}
|
}
|
||||||
|
|
||||||
// f7 to load state, Shift-f7 to load movie
|
// f7 to load state, Shift-f7 to load movie
|
||||||
if(_keyonly(loadStateKey)) {
|
if(_keyonly(Hotkeys[HK_LOAD_STATE])) {
|
||||||
if(is_shift) {
|
if(is_shift) {
|
||||||
FCEUI_StopMovie();
|
FCEUI_StopMovie();
|
||||||
std::string fname;
|
std::string fname;
|
||||||
|
@ -602,47 +524,47 @@ KeyboardCommands()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(_keyonly(decreaseSpeedKey)) {
|
if(_keyonly(Hotkeys[HK_DECREASE_SPEED])) {
|
||||||
DecreaseEmulationSpeed();
|
DecreaseEmulationSpeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_keyonly(increaseSpeedKey)) {
|
if(_keyonly(Hotkeys[HK_INCREASE_SPEED])) {
|
||||||
IncreaseEmulationSpeed();
|
IncreaseEmulationSpeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_keyonly(movieToggleFrameDisplayKey)) {
|
if(_keyonly(Hotkeys[HK_TOGGLE_FRAME_DISPLAY])) {
|
||||||
FCEUI_MovieToggleFrameDisplay();
|
FCEUI_MovieToggleFrameDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_keyonly(InputDisplayKey)) {
|
if(_keyonly(Hotkeys[HK_TOGGLE_INPUT_DISPLAY])) {
|
||||||
FCEUI_ToggleInputDisplay();
|
FCEUI_ToggleInputDisplay();
|
||||||
extern int input_display;
|
extern int input_display;
|
||||||
g_config->setOption("SDL.InputDisplay", input_display);
|
g_config->setOption("SDL.InputDisplay", input_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_keyonly(movieToggleReadWriteKey)) {
|
if(_keyonly(Hotkeys[HK_MOVIE_TOGGLE_RW])) {
|
||||||
FCEUI_SetMovieToggleReadOnly(!FCEUI_GetMovieToggleReadOnly());
|
FCEUI_SetMovieToggleReadOnly(!FCEUI_GetMovieToggleReadOnly());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CREATE_AVI
|
#ifdef CREATE_AVI
|
||||||
if(_keyonly(MuteCaptureKey)) {
|
if(_keyonly(Hotkeys[HK_MUTE_CAPTURE])) {
|
||||||
extern int mutecapture;
|
extern int mutecapture;
|
||||||
mutecapture ^= 1;
|
mutecapture ^= 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(_keyonly(pauseKey)) {
|
if(_keyonly(Hotkeys[HK_PAUSE])) {
|
||||||
FCEUI_ToggleEmulationPause();
|
FCEUI_ToggleEmulationPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle throttling
|
// Toggle throttling
|
||||||
NoWaiting &= ~1;
|
NoWaiting &= ~1;
|
||||||
if(g_keyState[ffKey]) {
|
if(g_keyState[Hotkeys[HK_TURBO]]) {
|
||||||
NoWaiting |= 1;
|
NoWaiting |= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool frameAdvancing = false;
|
static bool frameAdvancing = false;
|
||||||
if(g_keyState[frameAdvanceKey])
|
if(g_keyState[Hotkeys[HK_FRAME_ADVANCE]])
|
||||||
{
|
{
|
||||||
if(frameAdvancing == false)
|
if(frameAdvancing == false)
|
||||||
{
|
{
|
||||||
|
@ -659,18 +581,18 @@ KeyboardCommands()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_keyonly(resetKey)) {
|
if(_keyonly(Hotkeys[HK_RESET])) {
|
||||||
FCEUI_ResetNES();
|
FCEUI_ResetNES();
|
||||||
}
|
}
|
||||||
if(_keyonly(powerKey)) {
|
//if(_keyonly(Hotkeys[HK_POWER])) {
|
||||||
FCEUI_PowerNES();
|
// FCEUI_PowerNES();
|
||||||
}
|
//}
|
||||||
|
|
||||||
if(_keyonly(quitKey)) {
|
if(_keyonly(Hotkeys[HK_QUIT])) {
|
||||||
CloseGame();
|
CloseGame();
|
||||||
}
|
}
|
||||||
#ifdef _S9XLUA_H
|
#ifdef _S9XLUA_H
|
||||||
if(_keyonly(loadLuaKey)) {
|
if(_keyonly(Hotkeys[HK_LOAD_LUA])) {
|
||||||
std::string fname;
|
std::string fname;
|
||||||
fname = GetFilename("Open LUA script...", false, "Lua scripts|*.lua");
|
fname = GetFilename("Open LUA script...", false, "Lua scripts|*.lua");
|
||||||
if(fname != "")
|
if(fname != "")
|
||||||
|
@ -679,26 +601,26 @@ KeyboardCommands()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(int i=0; i<10; i++)
|
for(int i=0; i<10; i++)
|
||||||
if(_keyonly(stateKey[i]))
|
if(_keyonly(Hotkeys[HK_SELECT_STATE_0 + i]))
|
||||||
FCEUI_SelectState(i, 1);
|
FCEUI_SelectState(i, 1);
|
||||||
|
|
||||||
if(_keyonly(bindStateKey)) {
|
if(_keyonly(Hotkeys[HK_BIND_STATE])) {
|
||||||
bindSavestate ^= 1;
|
bindSavestate ^= 1;
|
||||||
FCEUI_DispMessage("Savestate binding to movie %sabled.",
|
FCEUI_DispMessage("Savestate binding to movie %sabled.",
|
||||||
bindSavestate ? "en" : "dis");
|
bindSavestate ? "en" : "dis");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_keyonly(frameAdvanceLagSkipKey)) {
|
if(_keyonly(Hotkeys[HK_FA_LAG_SKIP])) {
|
||||||
frameAdvanceLagSkip ^= 1;
|
frameAdvanceLagSkip ^= 1;
|
||||||
FCEUI_DispMessage("Skipping lag in Frame Advance %sabled.",
|
FCEUI_DispMessage("Skipping lag in Frame Advance %sabled.",
|
||||||
frameAdvanceLagSkip ? "en" : "dis");
|
frameAdvanceLagSkip ? "en" : "dis");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_keyonly(lagCounterDisplayKey)) {
|
if(_keyonly(Hotkeys[HK_LAG_COUNTER_DISPLAY])) {
|
||||||
lagCounterDisplay ^= 1;
|
lagCounterDisplay ^= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_keyonly(SubtitleDisplayKey)) {
|
if (_keyonly(Hotkeys[HK_TOGGLE_SUBTITLE])) {
|
||||||
extern int movieSubtitles;
|
extern int movieSubtitles;
|
||||||
movieSubtitles ^= 1;
|
movieSubtitles ^= 1;
|
||||||
FCEUI_DispMessage("Movie subtitles o%s.",
|
FCEUI_DispMessage("Movie subtitles o%s.",
|
||||||
|
@ -736,12 +658,13 @@ KeyboardCommands()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if SDL_VERSION_ATLEAST(1,3,0)
|
if (_keyonly(Hotkeys[HK_DECREASE_SPEED]))
|
||||||
// TODO: clean this shit up and make it work for 1.3
|
FCEUI_NTSCDEC();
|
||||||
#else
|
if (_keyonly(Hotkeys[HK_INCREASE_SPEED]))
|
||||||
if(KEY(KP_MINUS) || KEY(MINUS)) FCEUI_NTSCDEC();
|
FCEUI_NTSCINC();
|
||||||
if(KEY(KP_PLUS) || KEY(EQUAL)) FCEUI_NTSCINC();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if((InputType[2] == SIFC_BWORLD) || (cspec == SIS_DATACH)) {
|
if((InputType[2] == SIFC_BWORLD) || (cspec == SIS_DATACH)) {
|
||||||
if(keyonly(F8)) {
|
if(keyonly(F8)) {
|
||||||
|
|
Loading…
Reference in New Issue