Skip to content

Commit dbfc95d

Browse files
committed
handle video settings
Signed-off-by: Vincent-FK <[email protected]>
1 parent cc1f5d1 commit dbfc95d

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

src/drivers/dingux-sdl/gui/video_settings.cpp

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ extern Config *g_config;
55
/* MENU COMMANDS */
66

77
// Fullscreen mode
8-
/*static char *scale_tag[] = {
8+
static char *scale_tag[] = {
99
"Original",
1010
"Aspect",
1111
"FS Fast",
1212
"FS Smooth"
13-
};*/
13+
};
1414

1515
// Use PAL or NTSC rate
1616
static void pal_update(unsigned long key) {
@@ -281,9 +281,31 @@ int RunVideoSettings()
281281
DrawText(gui_screen, vd_menu[i].name, 60, y);
282282

283283
g_config->getOption(vd_menu[i].option, &itmp);
284-
/*if (!strncmp(vd_menu[i].name, "Video scaling", 5)) {
284+
if (!strncmp(vd_menu[i].name, "Video scaling", 5)) {
285285
sprintf(tmp, "%s", scale_tag[itmp]);
286286
}
287+
else if (!strncmp(vd_menu[i].name, "Custom palette", 6)) {
288+
std::string palname;
289+
g_config->getOption(vd_menu[i].option, &palname);
290+
291+
// Remove path of string
292+
const int sz = static_cast<int> (palname.size());
293+
const int path_sz = palname.rfind("/", palname.size());
294+
295+
if (path_sz == sz)
296+
strncpy(tmp, palname.c_str(), 32);
297+
else
298+
strncpy(tmp, palname.substr(path_sz + 1, sz - 1
299+
- path_sz).c_str(), 32);
300+
}
301+
else if (
302+
!strncmp(vd_menu[i].name, "Clip sides", 10)
303+
|| !strncmp(vd_menu[i].name, "New PPU", 7)
304+
|| !strncmp(vd_menu[i].name, "NTSC Palette", 12)
305+
|| !strcmp(vd_menu[i].name, "Show FPS")
306+
|| !strcmp(vd_menu[i].name, "FPS Throttle")
307+
|| !strcmp(vd_menu[i].name, "PAL timing")
308+
) {
287309
sprintf(tmp, "%s", itmp ? "on" : "off");
288310
}
289311
else if (

0 commit comments

Comments
 (0)