Compare commits

...

2 commits

Author SHA1 Message Date
rdanbrook 5763bb19ff FLTK: Add 5:4 aspect ratio 2024-05-31 21:24:00 -06:00
rdanbrook 2ba35ee0cf FLTK: Add a definition for Quit to input configuration 2024-05-31 21:05:21 -06:00
7 changed files with 21 additions and 8 deletions

View file

@ -444,7 +444,7 @@ static void fltkui_about(Fl_Widget* w, void* userdata) {
while (about.shown()) { Fl::wait(); }
}
static void quit_cb(Fl_Widget* w, void* userdata) {
void FltkUi::quit(Fl_Widget *w, void *data) {
videomgr->renderer_deinit();
nstwin->hide();
}
@ -533,7 +533,7 @@ static Fl_Menu_Item menutable[] = {
{"Load Movie...", 0, fltkui_movie_load, 0, FL_MENU_INACTIVE},
{"Record Movie...", 0, fltkui_movie_save, 0, FL_MENU_INACTIVE},
{"Stop Movie", 0, fltkui_movie_stop, 0, FL_MENU_DIVIDER|FL_MENU_INACTIVE},
{"&Quit", FL_ALT + 'q', quit_cb, 0, 0},
{"&Quit", FL_ALT + 'q', FltkUi::quit, 0, 0},
{0}, // End File
{"&Emulator", FL_ALT + 'e', 0, 0, FL_SUBMENU},
{"Pause", 0, fltkui_pause, 0, FL_MENU_DIVIDER|FL_MENU_INACTIVE},

View file

@ -43,4 +43,5 @@ public:
static void set_ffspeed(bool on);
static void show_msgbox(bool show);
static void fullscreen(Fl_Widget *w = nullptr, void *data = nullptr);
static void quit(Fl_Widget *w = nullptr, void *data = nullptr);
};

View file

@ -43,11 +43,11 @@ jg_inputinfo_t *inputinfo[5];
jg_inputstate_t uistate;
jg_inputinfo_t uiinfo;
constexpr size_t NDEFS_UI = 12;
constexpr size_t NDEFS_UI = 13;
const char *defs_ui[NDEFS_UI] = {
"ResetSoft", "ResetHard", "FDSNextSide", "FDSInsertEject",
"QuickSave1", "QuickSave2", "QuickLoad1", "QuickLoad2",
"Fullscreen", "Pause", "FastForward", "Screenshot"
"Fullscreen", "Pause", "FastForward", "Screenshot", "Quit"
};
bool uiprev[NDEFS_UI];
@ -129,7 +129,8 @@ void InputManager::assign() {
0xffbd + 6, 0xffbd + 7, 0xffbd + 8, 'f', 'p', '`', 0xffbd + 9
};
for (size_t i = 0; i < NDEFS_UI; ++i) {
// -1 to prevent "Quit" from being defined by default
for (size_t i = 0; i < NDEFS_UI - 1; ++i) {
// Keyboard/Mouse
std::string val = setmgr.get_input("ui", uiinfo.defs[i]);
if (val.empty()) {
@ -487,6 +488,9 @@ void InputManager::ui_events() {
case 11: // Screenshot
UiAdapter::screenshot();
break;
case 12: // Quit
UiAdapter::quit();
break;
}
}

View file

@ -48,9 +48,9 @@ jg_setting_t fe_settings[] = {
2, 0, 3, FLAG_FRONTEND
},
{ "v_aspect", "Aspect Ratio",
"0 = TV Correct, 1 = 1:1, 2 = 4:3",
"Set the aspect ratio to the correct TV aspect, 1:1 (square pixels), or 4:3",
0, 0, 2, FLAG_FRONTEND
"0 = Auto, 1 = 1:1, 2 = 4:3, 3 = 5:4",
"Set the aspect ratio to the correct TV aspect (Auto), 1:1 (square pixels), 4:3, or 5:4",
0, 0, 3, FLAG_FRONTEND
},
{ "v_scale", "Initial Window Scale",
"N = Window scale factor at startup",

View file

@ -48,6 +48,10 @@ void UiAdapter::pause() {
void UiAdapter::screenshot() {
}
void UiAdapter::quit() {
FltkUi::quit();
}
void UiAdapter::show_msgbox(bool show) {
FltkUi::show_msgbox(show);
}

View file

@ -9,6 +9,7 @@ public:
static void fastforward(bool ff);
static void pause();
static void screenshot();
static void quit();
static void show_msgbox(bool show);
private:

View file

@ -880,6 +880,9 @@ void VideoManager::set_aspect() {
case 2:
aspect = 4.0/3.0;
break;
case 3:
aspect = 5.0/4.0;
break;
default: break;
}
}