From 135b636bd42b2ec01cb4cb2dd42f1f7dc4d901c0 Mon Sep 17 00:00:00 2001 From: Zoran Vuckovic Date: Thu, 5 Oct 2017 05:18:53 +0200 Subject: [PATCH 01/24] Add "absolute" mouse support --- input/drivers/udev_input.c | 372 ++++++++++++++++++++++++------------- 1 file changed, 245 insertions(+), 127 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index ed49f07ca0..04baa09b70 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2015 - Hans-Kristian Arntzen * Copyright (C) 2011-2017 - Daniel De Matteis - * + * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. @@ -82,18 +82,17 @@ static const char *g_dev_type_str[] = typedef struct { - int16_t x, y, dlt_x, dlt_y; + /* If device is "absolute" coords will be in device specific units + and axis min value will be less than max, otherwise coords will be + relative to full viewport and min and max values will be zero. */ + __s32 x_abs, y_abs; + __s32 x_min, y_min; + __s32 x_max, y_max; + __s32 x_rel, y_rel; bool l, r, m; bool wu, wd, whu, whd; } udev_input_mouse_t; -typedef struct -{ - struct input_absinfo info_x; - struct input_absinfo info_y; - udev_input_mouse_t mouse; /* touch-pad will be presented to RA/core as mouse */ -} udev_input_touchpad_t; - struct udev_input_device { int fd; @@ -103,11 +102,7 @@ struct udev_input_device char devnode[PATH_MAX_LENGTH]; enum udev_input_dev_type type; - union - { - udev_input_mouse_t mouse; - udev_input_touchpad_t touchpad; - } state; + udev_input_mouse_t mouse; }; typedef void (*device_handle_cb)(void *data, @@ -129,6 +124,10 @@ struct udev_input #ifdef UDEV_XKB_HANDLING bool xkb_handling; #endif + + /* OS pointer coords (zeros if we don't have X11) */ + int pointer_x; + int pointer_y; }; #ifdef UDEV_XKB_HANDLING @@ -216,10 +215,7 @@ static udev_input_mouse_t *udev_get_mouse(struct udev_input *udev, unsigned port if (mouse_index == settings->uints.input_mouse_index[port]) { - if (udev->devices[i]->type == UDEV_INPUT_MOUSE) - mouse = &udev->devices[i]->state.mouse; - else - mouse = &udev->devices[i]->state.touchpad.mouse; + mouse = &udev->devices[i]->mouse; break; } @@ -229,54 +225,166 @@ static udev_input_mouse_t *udev_get_mouse(struct udev_input *udev, unsigned port return mouse; } -static void udev_handle_touchpad(void *data, - const struct input_event *event, udev_input_device_t *dev) +static void udev_mouse_set_x(udev_input_mouse_t *mouse, __s32 x, bool abs) { - int16_t pos; - unsigned width = 0; - unsigned height = 0; - udev_input_touchpad_t *touchpad = &dev->state.touchpad; - udev_input_mouse_t *mouse = &dev->state.touchpad.mouse; + video_viewport_t vp; - switch (event->type) + if (abs) { - case EV_ABS: - video_driver_get_size(&width, &height); - switch (event->code) - { - case ABS_X: - pos = (float)(event->value - touchpad->info_x.minimum) / - (touchpad->info_x.maximum - touchpad->info_x.minimum) * width; - mouse->dlt_x += pos - mouse->x; - mouse->x = pos; - break; - case ABS_Y: - pos = (float)(event->value - touchpad->info_y.minimum) / - (touchpad->info_y.maximum - touchpad->info_y.minimum) * height; - mouse->dlt_y += pos - mouse->y; - mouse->y = pos; - } - break; - - case EV_KEY: - switch (event->code) - { - case BTN_LEFT: - mouse->l = event->value; - break; - case BTN_MIDDLE: - mouse->m = event->value; - break; - case BTN_RIGHT: - mouse->r = event->value; - } + mouse->x_rel += x - mouse->x_abs; + mouse->x_abs = x; } + else + { + mouse->x_rel += x; + if (video_driver_get_viewport_info(&vp)) + { + mouse->x_abs += x; + + if (mouse->x_abs < vp.x) + mouse->x_abs = vp.x; + else if (mouse->x_abs >= vp.x + vp.full_width) + mouse->x_abs = vp.x + vp.full_width - 1; + } + } +} + +static int16_t udev_mouse_get_x(const udev_input_mouse_t *mouse) +{ + video_viewport_t vp; + double src_width; + double x; + + if (!video_driver_get_viewport_info(&vp)) + return 0; + + if (mouse->x_min < mouse->x_max) /* mouse coords are absolute */ + src_width = mouse->x_max - mouse->x_min + 1; + else + src_width = vp.full_width; + + x = (double)vp.width / src_width * mouse->x_rel; + + return x + (x < 0 ? -0.5 : 0.5); +} + +static void udev_mouse_set_y(udev_input_mouse_t *mouse, __s32 y, bool abs) +{ + video_viewport_t vp; + + if (abs) + { + mouse->y_rel += y - mouse->y_abs; + mouse->y_abs = y; + } + else + { + mouse->y_rel += y; + if (video_driver_get_viewport_info(&vp)) + { + mouse->y_abs += y; + + if (mouse->y_abs < vp.y) + mouse->y_abs = vp.y; + else if (mouse->y_abs >= vp.y + vp.full_height) + mouse->y_abs = vp.y + vp.full_height - 1; + } + } +} + +static int16_t udev_mouse_get_y(const udev_input_mouse_t *mouse) +{ + video_viewport_t vp; + double src_height; + double y; + + if (!video_driver_get_viewport_info(&vp)) + return 0; + + if (mouse->y_min < mouse->y_max) /* mouse coords are absolute */ + src_height = mouse->y_max - mouse->y_min + 1; + else + src_height = vp.full_height; + + y = (double)vp.height / src_height * mouse->y_rel; + + return y + (y < 0 ? -0.5 : 0.5); +} + +static int16_t udev_mouse_get_pointer_x(const udev_input_mouse_t *mouse, bool screen) +{ + video_viewport_t vp; + double src_min; + double src_width; + int32_t x; + + if (!video_driver_get_viewport_info(&vp)) + return 0; + + if (mouse->x_min < mouse->x_max) /* mouse coords are absolute */ + { + src_min = mouse->x_min; + src_width = mouse->x_max - mouse->x_min + 1; + } + else /* mouse coords are viewport relative */ + { + src_min = vp.x; + if (screen) + src_width = vp.full_width; + else + src_width = vp.width; + } + + x = -32767.0 + 65535.0 / src_width * (mouse->x_abs - src_min); + x += (x < 0 ? -0.5 : 0.5); + + if (x < -0x7fff) + x = -0x7fff; + else if(x > 0x7fff) + x = 0x7fff; + + return x; +} + +static int16_t udev_mouse_get_pointer_y(const udev_input_mouse_t *mouse, bool screen) +{ + video_viewport_t vp; + double src_min; + double src_height; + int32_t y; + + if (!video_driver_get_viewport_info(&vp)) + return 0; + + if (mouse->y_min < mouse->y_max) /* mouse coords are absolute */ + { + src_min = mouse->y_min; + src_height = mouse->y_max - mouse->y_min + 1; + } + else /* mouse coords are viewport relative */ + { + src_min = vp.y; + if (screen) + src_height = vp.full_height; + else + src_height = vp.height; + } + + y = -32767.0 + 65535.0 / src_height * (mouse->y_abs - src_min); + y += (y < 0 ? -0.5 : 0.5); + + if (y < -0x7fff) + y = -0x7fff; + else if(y > 0x7fff) + y = 0x7fff; + + return y; } static void udev_handle_mouse(void *data, const struct input_event *event, udev_input_device_t *dev) { - udev_input_mouse_t *mouse = &dev->state.mouse; + udev_input_mouse_t *mouse = &dev->mouse; switch (event->type) { @@ -303,10 +411,10 @@ static void udev_handle_mouse(void *data, switch (event->code) { case REL_X: - mouse->dlt_x += event->value; + udev_mouse_set_x(mouse, event->value, false); break; case REL_Y: - mouse->dlt_y += event->value; + udev_mouse_set_y(mouse, event->value, false); break; case REL_WHEEL: if (event->value == 1) @@ -321,6 +429,19 @@ static void udev_handle_mouse(void *data, mouse->whd = 1; break; } + break; + + case EV_ABS: + switch (event->code) + { + case ABS_X: + udev_mouse_set_x(mouse, event->value, true); + break; + case ABS_Y: + udev_mouse_set_y(mouse, event->value, true); + break; + } + break; } } @@ -330,6 +451,7 @@ static bool udev_input_add_device(udev_input_t *udev, int fd; struct stat st; struct epoll_event event; + struct input_absinfo absinfo; udev_input_device_t **tmp; udev_input_device_t *device = NULL; @@ -354,10 +476,38 @@ static bool udev_input_add_device(udev_input_t *udev, strlcpy(device->devnode, devnode, sizeof(device->devnode)); /* Touchpads report in absolute coords. */ - if (type == UDEV_INPUT_TOUCHPAD && - (ioctl(fd, EVIOCGABS(ABS_X), &device->state.touchpad.info_x) < 0 || - ioctl(fd, EVIOCGABS(ABS_Y), &device->state.touchpad.info_y) < 0)) - goto error; + if (type == UDEV_INPUT_TOUCHPAD) + { + if (ioctl(fd, EVIOCGABS(ABS_X), &absinfo) < 0 || + absinfo.minimum >= absinfo.maximum) + goto error; + + device->mouse.x_min = absinfo.minimum; + device->mouse.x_max = absinfo.maximum; + + if (ioctl(fd, EVIOCGABS(ABS_Y), &absinfo) < 0 || + absinfo.minimum >= absinfo.maximum) + goto error; + + device->mouse.y_min = absinfo.minimum; + device->mouse.y_max = absinfo.maximum; + } + /* UDEV_INPUT_MOUSE may report in absolute coords too */ + else if (type == UDEV_INPUT_MOUSE && ioctl(fd, EVIOCGABS(ABS_X), &absinfo) >= 0) + { + if (absinfo.minimum >= absinfo.maximum) + goto error; + + device->mouse.x_min = absinfo.minimum; + device->mouse.x_max = absinfo.maximum; + + if (ioctl(fd, EVIOCGABS(ABS_Y), &absinfo) < 0 || + absinfo.minimum >= absinfo.maximum) + goto error; + + device->mouse.y_min = absinfo.minimum; + device->mouse.y_max = absinfo.maximum; + } tmp = ( udev_input_device_t**)realloc(udev->devices, (udev->num_devices + 1) * sizeof(*udev->devices)); @@ -440,7 +590,7 @@ static void udev_input_handle_hotplug(udev_input_t *udev) else if (val_touchpad && string_is_equal_fast(val_touchpad, "1", 1) && devnode) { dev_type = UDEV_INPUT_TOUCHPAD; - cb = udev_handle_touchpad; + cb = udev_handle_mouse; } else goto end; @@ -477,11 +627,11 @@ static void udev_input_get_pointer_position(int *x, int *y) static bool udev_input_poll_hotplug_available(struct udev_monitor *dev) { - struct pollfd fds; + struct pollfd fds; - fds.fd = udev_monitor_get_fd(dev); - fds.events = POLLIN; - fds.revents = 0; + fds.fd = udev_monitor_get_fd(dev); + fds.events = POLLIN; + fds.revents = 0; return (poll(&fds, 1, 0) == 1) && (fds.revents & POLLIN); } @@ -491,30 +641,22 @@ static void udev_input_poll(void *data) int i, ret; struct epoll_event events[32]; udev_input_mouse_t *mouse = NULL; - int x = 0; - int y = 0; udev_input_t *udev = (udev_input_t*)data; #ifdef HAVE_X11 if (video_driver_display_type_get() == RARCH_DISPLAY_X11) - udev_input_get_pointer_position(&x, &y); + udev_input_get_pointer_position(&udev->pointer_x, &udev->pointer_y); #endif for (i = 0; i < udev->num_devices; ++i) { - if (udev->devices[i]->type == UDEV_INPUT_MOUSE) - { - mouse = &udev->devices[i]->state.mouse; - mouse->x = x; - mouse->y = y; - } - else if (udev->devices[i]->type == UDEV_INPUT_TOUCHPAD) - mouse = &udev->devices[i]->state.touchpad.mouse; - else + if (udev->devices[i]->type == UDEV_INPUT_KEYBOARD) continue; - mouse->dlt_x = 0; - mouse->dlt_y = 0; + mouse = &udev->devices[i]->mouse; + + mouse->x_rel = 0; + mouse->y_rel = 0; mouse->wu = false; mouse->wd = false; mouse->whu = false; @@ -548,18 +690,22 @@ static void udev_input_poll(void *data) udev->joypad->poll(); } -static bool udev_pointer_is_off_window(udev_input_mouse_t *mouse) +static bool udev_pointer_is_off_window(const udev_input_t *udev) { +#ifdef HAVE_X11 struct video_viewport view; bool r = video_driver_get_viewport_info(&view); if (r) - r = mouse->x < view.x || - mouse->x >= view.x + view.width || - mouse->y < view.y || - mouse->y >= view.y + view.height; + r = udev->pointer_x < view.x || + udev->pointer_x >= view.x + view.width || + udev->pointer_y < view.y || + udev->pointer_y >= view.y + view.height; return r; +#else + return false; +#endif } static int16_t udev_mouse_state(udev_input_t *udev, @@ -571,15 +717,15 @@ static int16_t udev_mouse_state(udev_input_t *udev, return 0; if (id != RETRO_DEVICE_ID_MOUSE_X && id != RETRO_DEVICE_ID_MOUSE_Y && - udev_pointer_is_off_window(mouse)) + udev_pointer_is_off_window(udev)) return 0; switch (id) { case RETRO_DEVICE_ID_MOUSE_X: - return screen ? mouse->x : mouse->dlt_x; + return screen ? udev->pointer_x : udev_mouse_get_x(mouse); case RETRO_DEVICE_ID_MOUSE_Y: - return screen ? mouse->y : mouse->dlt_y; + return screen ? udev->pointer_y : udev_mouse_get_y(mouse); case RETRO_DEVICE_ID_MOUSE_LEFT: return mouse->l; case RETRO_DEVICE_ID_MOUSE_RIGHT: @@ -610,9 +756,9 @@ static int16_t udev_lightgun_state(udev_input_t *udev, switch (id) { case RETRO_DEVICE_ID_LIGHTGUN_X: - return mouse->dlt_x; + return udev_mouse_get_x(mouse); case RETRO_DEVICE_ID_LIGHTGUN_Y: - return mouse->dlt_y; + return udev_mouse_get_y(mouse); case RETRO_DEVICE_ID_LIGHTGUN_TRIGGER: return mouse->l; case RETRO_DEVICE_ID_LIGHTGUN_CURSOR: @@ -638,11 +784,11 @@ static int16_t udev_analog_pressed(const struct retro_keybind *binds, input_conv_analog_id_to_bind_id(idx, id, &id_minus, &id_plus); - if ( binds[id_minus].valid + if ( binds[id_minus].valid && BIT_GET(udev_key_state, rarch_keysym_lut[binds[id_minus].key])) pressed_minus = -0x7fff; - if ( binds[id_plus].valid + if ( binds[id_plus].valid && BIT_GET(udev_key_state, rarch_keysym_lut[binds[id_plus].key])) pressed_plus = 0x7fff; @@ -653,45 +799,17 @@ static int16_t udev_analog_pressed(const struct retro_keybind *binds, static int16_t udev_pointer_state(udev_input_t *udev, unsigned port, unsigned id, bool screen) { - struct video_viewport vp; - bool inside = false; - int16_t res_x = 0; - int16_t res_y = 0; - int16_t res_screen_x = 0; - int16_t res_screen_y = 0; - udev_input_mouse_t *mouse = udev_get_mouse(udev, port); - - vp.x = 0; - vp.y = 0; - vp.width = 0; - vp.height = 0; - vp.full_width = 0; - vp.full_height = 0; + udev_input_mouse_t *mouse = udev_get_mouse(udev, port); if (!mouse) return 0; - if (!(video_driver_translate_coord_viewport_wrap(&vp, - mouse->x, mouse->y, &res_x, &res_y, &res_screen_x, &res_screen_y))) - return 0; - - if (screen) - { - res_x = res_screen_x; - res_y = res_screen_y; - } - - inside = (res_x >= -0x7fff) && (res_y >= -0x7fff); - - if (!inside) - return 0; - switch (id) { case RETRO_DEVICE_ID_POINTER_X: - return res_x; + return udev_mouse_get_pointer_x(mouse, screen); case RETRO_DEVICE_ID_POINTER_Y: - return res_y; + return udev_mouse_get_pointer_y(mouse, screen); case RETRO_DEVICE_ID_POINTER_PRESSED: return mouse->l; } @@ -878,13 +996,13 @@ static void *udev_input_init(const char *joypad_driver) goto error; } - if (!open_devices(udev, UDEV_INPUT_TOUCHPAD, udev_handle_touchpad)) + if (!open_devices(udev, UDEV_INPUT_TOUCHPAD, udev_handle_mouse)) { RARCH_ERR("Failed to open touchpads.\n"); goto error; } - /* If using KMS and we forgot this, + /* If using KMS and we forgot this, * we could lock ourselves out completely. */ if (!udev->num_devices) RARCH_WARN("[udev]: Couldn't open any keyboard, mouse or touchpad. Are permissions set correctly for /dev/input/event*?\n"); From 982901930648b3242f76e0a6cfdbc38df95cb163 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Oct 2017 05:23:54 +0200 Subject: [PATCH 02/24] Update --- menu/widgets/menu_entry.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/menu/widgets/menu_entry.c b/menu/widgets/menu_entry.c index 3c3fc7335f..dab51248ff 100644 --- a/menu/widgets/menu_entry.c +++ b/menu/widgets/menu_entry.c @@ -375,11 +375,13 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, entry->idx = (unsigned)i; - if (path && !use_representation) + if (!string_is_empty(path) && !use_representation) strlcpy(newpath, path, sizeof(newpath)); else if (cbs && cbs->setting && cbs->setting->enum_value_idx != MSG_UNKNOWN && !cbs->setting->dont_use_enum_idx_representation) - strlcpy(newpath, msg_hash_to_str(cbs->setting->enum_value_idx), sizeof(newpath)); + strlcpy(newpath, + msg_hash_to_str(cbs->setting->enum_value_idx), + sizeof(newpath)); if (!string_is_empty(newpath)) entry->path = strdup(newpath); From 489acabdf478745db06debd0e68e19de74fa7679 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Oct 2017 05:26:46 +0200 Subject: [PATCH 03/24] Update --- menu/widgets/menu_entry.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/menu/widgets/menu_entry.c b/menu/widgets/menu_entry.c index dab51248ff..22a4368ebd 100644 --- a/menu/widgets/menu_entry.c +++ b/menu/widgets/menu_entry.c @@ -310,8 +310,9 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, if (!list) return; - menu_entries_get_at_offset(list, i, &path, &entry_label, &entry->type, - &entry->entry_idx, NULL); + file_list_get_at_offset(list, i, &path, &entry_label, &entry->type, + &entry->entry_idx); + file_list_get_alt_at_offset(list, i, NULL); cbs = (menu_file_list_cbs_t*)file_list_get_actiondata_at_offset(list, i); @@ -330,7 +331,8 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, tmp[0] = '\0'; cbs->action_get_value(list, - &entry->spacing, entry->type, (unsigned)i, label, + &entry->spacing, entry->type, + (unsigned)i, label, tmp, sizeof(tmp), entry_label, path, From 856fccd65c6d2052de7568a816770646fb9cca38 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Oct 2017 05:27:43 +0200 Subject: [PATCH 04/24] Update --- menu/widgets/menu_entry.c | 1 - 1 file changed, 1 deletion(-) diff --git a/menu/widgets/menu_entry.c b/menu/widgets/menu_entry.c index 22a4368ebd..381abd9e41 100644 --- a/menu/widgets/menu_entry.c +++ b/menu/widgets/menu_entry.c @@ -312,7 +312,6 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, file_list_get_at_offset(list, i, &path, &entry_label, &entry->type, &entry->entry_idx); - file_list_get_alt_at_offset(list, i, NULL); cbs = (menu_file_list_cbs_t*)file_list_get_actiondata_at_offset(list, i); From cc3b64f951eda7aa503a2bd5f786438e1e5ae9c7 Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Thu, 5 Oct 2017 09:14:05 +0200 Subject: [PATCH 05/24] Implemented setting for showing/hiding the "Load Core" option in XMB. --- config.def.h | 1 + configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.h | 6 +++++- intl/msg_hash_cht.h | 6 +++++- intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 6 +++++- intl/msg_hash_ko.h | 6 +++++- intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 6 +++++- intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 6 +++++- menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/drivers/xmb.c | 7 +++++-- menu/menu_displaylist.c | 4 ++++ menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 23 files changed, 98 insertions(+), 8 deletions(-) diff --git a/config.def.h b/config.def.h index 418b48244c..de3adea607 100644 --- a/config.def.h +++ b/config.def.h @@ -237,6 +237,7 @@ static const bool display_keyboard_overlay = false; static bool default_block_config_read = true; static bool menu_show_online_updater = true; +static bool menu_show_load_core = true; #if defined(HAVE_LAKKA) || defined(VITA) static bool menu_show_core_updater = false; diff --git a/configuration.c b/configuration.c index 37d11a47d2..4c415f0390 100644 --- a/configuration.c +++ b/configuration.c @@ -1202,6 +1202,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("xmb_show_images", &settings->bools.menu_xmb_show_images, true, xmb_show_images, false); #endif SETTING_BOOL("xmb_show_music", &settings->bools.menu_xmb_show_music, true, xmb_show_music, false); + SETTING_BOOL("menu_show_load_core", &settings->bools.menu_show_load_core, true, menu_show_load_core, false); SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false); SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false); #ifdef HAVE_FFMPEG diff --git a/configuration.h b/configuration.h index 92cb30c583..49dec93958 100644 --- a/configuration.h +++ b/configuration.h @@ -126,6 +126,7 @@ typedef struct settings bool menu_linear_filter; bool menu_horizontal_animation; bool menu_show_online_updater; + bool menu_show_load_core; bool menu_show_core_updater; bool menu_materialui_icons_enable; bool menu_xmb_shadows_enable; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index a4349587d8..fd1543bf07 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -1,4 +1,4 @@ -MSG_HASH( +MSG_HASH( MSG_COMPILER, "编译器" ) @@ -3063,3 +3063,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 10c8d09ed9..547b97414f 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -1,4 +1,4 @@ -MSG_HASH( +MSG_HASH( MSG_COMPILER, "編譯器" ) @@ -3063,3 +3063,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 895c3b6603..85348b73ba 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3057,3 +3057,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index f66683ce80..84ab3e7531 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2926,3 +2926,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index c649015bad..681fdc0479 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3095,3 +3095,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 07bf6d836b..7289568cc3 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3149,3 +3149,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 5cfa72b792..0217cc6b35 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -1,4 +1,4 @@ -#if defined(_MSC_VER) && !defined(_XBOX) +#if defined(_MSC_VER) && !defined(_XBOX) /* https://support.microsoft.com/en-us/kb/980263 */ #pragma execution_character_set("utf-8") #endif @@ -3065,3 +3065,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "エントリーの名前変更を許す") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 8beb280dd3..764c96a18b 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -1,4 +1,4 @@ -MSG_HASH( +MSG_HASH( MSG_COMPILER, "컴파일러" ) @@ -3058,3 +3058,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 4f68ded6b4..cbd7c9d842 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1305,3 +1305,5 @@ MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE, "materialui_icons_enable") MSG_HASH(MENU_ENUM_LABEL_RENAME_ENTRY, "rename_entry") +MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE, + "menu_show_load_core") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index c169236324..e84c6d66bd 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2926,3 +2926,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 9bf4a82bdd..6dc2c0783c 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -3988,3 +3988,9 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 2c884831fc..7a15fcd2b8 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3033,3 +3033,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 0726662c72..ce2115778d 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -1,4 +1,4 @@ -#if defined(_MSC_VER) && !defined(_XBOX) +#if defined(_MSC_VER) && !defined(_XBOX) /* https://support.microsoft.com/en-us/kb/980263 */ #pragma execution_character_set("utf-8") #endif @@ -3116,3 +3116,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 38eb3ecdb9..a918f38951 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3151,3 +3151,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_RENAME_ENTRY, "Rename the title of the entry.") MSG_HASH(MENU_ENUM_LABEL_VALUE_RENAME_ENTRY, "Rename") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index f829d18fc2..9e9e3faf89 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -1,4 +1,4 @@ -MSG_HASH( +MSG_HASH( MSG_COMPILER, "Compiler" ) @@ -3087,3 +3087,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_PLAYLIST_ENTRY_RENAME, "Allow the user to rename entries in collections.") MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME, "Allow to rename entries") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + "Show Load Core") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, + "Show/hide the 'Load Core' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index d9e2741f4f..e995bab5b3 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -291,6 +291,7 @@ default_sublabel_macro(action_bind_sublabel_menu_ribbon_enable, default_sublabel_macro(action_bind_sublabel_menu_font, MENU_ENUM_SUBLABEL_XMB_FONT) default_sublabel_macro(action_bind_sublabel_menu_favorites_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_FAVORITES) default_sublabel_macro(action_bind_sublabel_menu_images_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_IMAGES) +default_sublabel_macro(action_bind_sublabel_menu_show_load_core, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_show_core_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_music_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_MUSIC) @@ -600,6 +601,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_XMB_SHOW_MUSIC: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_music_tab); break; + case MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_load_core); + break; case MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_online_updater); break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 4a232ca9a0..aa2d3de5ed 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4322,8 +4322,11 @@ static int xmb_list_push(void *data, void *userdata, if (frontend_driver_has_fork()) #endif { - entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST; - menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + if (settings->bools.menu_show_load_core) + { + entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST; + menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + } } entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_LIST; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 3b0fe4b3ab..730881b0f9 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5278,6 +5278,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) case DISPLAYLIST_MENU_VIEWS_SETTINGS_LIST: menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE, + PARSE_ONLY_BOOL, false); + #if defined(HAVE_NETWORKING) && !defined(HAVE_LAKKA) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index d970384af1..454e7eb761 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5379,6 +5379,21 @@ static bool setting_append_list( general_read_handler); menu_settings_list_current_add_range(list, list_info, 0, XMB_THEME_LAST-1, 1, true, true); + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_show_load_core, + MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE, + MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, + menu_show_load_core, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + CONFIG_BOOL( list, list_info, &settings->bools.menu_xmb_show_settings, diff --git a/msg_hash.h b/msg_hash.h index e2a9cb0be1..8836c9b4c0 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -672,6 +672,7 @@ enum msg_hash_enums /* Menu settings */ + MENU_LABEL(MENU_SHOW_LOAD_CORE), MENU_LABEL(MENU_SHOW_ONLINE_UPDATER), MENU_LABEL(MENU_SHOW_CORE_UPDATER), MENU_LABEL(RUN_MUSIC), From 0eb5566dea8e00e3a8a4fd9d7d8867ad712c766f Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Thu, 5 Oct 2017 09:26:25 +0200 Subject: [PATCH 06/24] Implemented setting for showing/hiding the "Load Content" option in XMB. --- config.def.h | 1 + configuration.c | 1 + configuration.h | 3 ++- intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/drivers/xmb.c | 7 +++++-- menu/menu_displaylist.c | 4 ++++ menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 23 files changed, 93 insertions(+), 3 deletions(-) diff --git a/config.def.h b/config.def.h index de3adea607..a183446ed8 100644 --- a/config.def.h +++ b/config.def.h @@ -238,6 +238,7 @@ static bool default_block_config_read = true; static bool menu_show_online_updater = true; static bool menu_show_load_core = true; +static bool menu_show_load_content = true; #if defined(HAVE_LAKKA) || defined(VITA) static bool menu_show_core_updater = false; diff --git a/configuration.c b/configuration.c index 4c415f0390..684a050a38 100644 --- a/configuration.c +++ b/configuration.c @@ -1203,6 +1203,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, #endif SETTING_BOOL("xmb_show_music", &settings->bools.menu_xmb_show_music, true, xmb_show_music, false); SETTING_BOOL("menu_show_load_core", &settings->bools.menu_show_load_core, true, menu_show_load_core, false); + SETTING_BOOL("menu_show_load_content", &settings->bools.menu_show_load_content, true, menu_show_load_content, false); SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false); SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false); #ifdef HAVE_FFMPEG diff --git a/configuration.h b/configuration.h index 49dec93958..4201c17274 100644 --- a/configuration.h +++ b/configuration.h @@ -126,8 +126,9 @@ typedef struct settings bool menu_linear_filter; bool menu_horizontal_animation; bool menu_show_online_updater; - bool menu_show_load_core; bool menu_show_core_updater; + bool menu_show_load_core; + bool menu_show_load_content; bool menu_materialui_icons_enable; bool menu_xmb_shadows_enable; bool menu_xmb_show_settings; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index fd1543bf07..1297f39646 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3067,3 +3067,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 547b97414f..9b4c6c1765 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3067,3 +3067,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 85348b73ba..05cc56f83a 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3061,3 +3061,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 84ab3e7531..3c795534e0 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2930,3 +2930,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 681fdc0479..1a388cdfa9 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3099,3 +3099,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 7289568cc3..6b711ccf70 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3153,3 +3153,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 0217cc6b35..7b030c20fd 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3069,3 +3069,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 764c96a18b..4546bf035d 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3062,3 +3062,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index cbd7c9d842..df024a45b8 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1307,3 +1307,5 @@ MSG_HASH(MENU_ENUM_LABEL_RENAME_ENTRY, "rename_entry") MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE, "menu_show_load_core") +MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT, + "menu_show_load_content") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index e84c6d66bd..be72a0c6df 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2930,3 +2930,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 6dc2c0783c..82d9819898 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -3994,3 +3994,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 7a15fcd2b8..725a434862 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3037,3 +3037,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index ce2115778d..11c665374e 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3120,3 +3120,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index a918f38951..c7ee0c364c 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3155,3 +3155,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 9e9e3faf89..96b021ede8 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3091,3 +3091,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE, "Show Load Core") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE, "Show/hide the 'Load Core' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + "Show Load Content") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, + "Show/hide the 'Load Content' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index e995bab5b3..141ff7b37d 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -292,6 +292,7 @@ default_sublabel_macro(action_bind_sublabel_menu_font, default_sublabel_macro(action_bind_sublabel_menu_favorites_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_FAVORITES) default_sublabel_macro(action_bind_sublabel_menu_images_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_IMAGES) default_sublabel_macro(action_bind_sublabel_menu_show_load_core, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE) +default_sublabel_macro(action_bind_sublabel_menu_show_load_content, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_show_core_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_music_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_MUSIC) @@ -604,6 +605,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_load_core); break; + case MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_load_content); + break; case MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_online_updater); break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index aa2d3de5ed..c8e21a465b 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4329,8 +4329,11 @@ static int xmb_list_push(void *data, void *userdata, } } - entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_LIST; - menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + if (settings->bools.menu_show_load_content) + { + entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_LIST; + menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + } entry.enum_idx = MENU_ENUM_LABEL_ADD_CONTENT_LIST; menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 730881b0f9..55d86f3f80 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5282,6 +5282,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE, PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT, + PARSE_ONLY_BOOL, false); + #if defined(HAVE_NETWORKING) && !defined(HAVE_LAKKA) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 454e7eb761..b0e4918ce4 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5394,6 +5394,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_show_load_content, + MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT, + MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, + menu_show_load_content, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + CONFIG_BOOL( list, list_info, &settings->bools.menu_xmb_show_settings, diff --git a/msg_hash.h b/msg_hash.h index 8836c9b4c0..7680ac96fe 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -673,6 +673,7 @@ enum msg_hash_enums /* Menu settings */ MENU_LABEL(MENU_SHOW_LOAD_CORE), + MENU_LABEL(MENU_SHOW_LOAD_CONTENT), MENU_LABEL(MENU_SHOW_ONLINE_UPDATER), MENU_LABEL(MENU_SHOW_CORE_UPDATER), MENU_LABEL(RUN_MUSIC), From 12d0f4107a0bd6c74fcb2fe58adef95423385909 Mon Sep 17 00:00:00 2001 From: Zoran Vuckovic Date: Thu, 5 Oct 2017 10:00:20 +0200 Subject: [PATCH 07/24] Use int32_t instead of __s32 --- input/drivers/udev_input.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index 04baa09b70..89a4e5da95 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -85,10 +85,10 @@ typedef struct /* If device is "absolute" coords will be in device specific units and axis min value will be less than max, otherwise coords will be relative to full viewport and min and max values will be zero. */ - __s32 x_abs, y_abs; - __s32 x_min, y_min; - __s32 x_max, y_max; - __s32 x_rel, y_rel; + int32_t x_abs, y_abs; + int32_t x_min, y_min; + int32_t x_max, y_max; + int32_t x_rel, y_rel; bool l, r, m; bool wu, wd, whu, whd; } udev_input_mouse_t; @@ -225,7 +225,7 @@ static udev_input_mouse_t *udev_get_mouse(struct udev_input *udev, unsigned port return mouse; } -static void udev_mouse_set_x(udev_input_mouse_t *mouse, __s32 x, bool abs) +static void udev_mouse_set_x(udev_input_mouse_t *mouse, int32_t x, bool abs) { video_viewport_t vp; @@ -268,7 +268,7 @@ static int16_t udev_mouse_get_x(const udev_input_mouse_t *mouse) return x + (x < 0 ? -0.5 : 0.5); } -static void udev_mouse_set_y(udev_input_mouse_t *mouse, __s32 y, bool abs) +static void udev_mouse_set_y(udev_input_mouse_t *mouse, int32_t y, bool abs) { video_viewport_t vp; From 1e3da091a543d832804066fa3ced9b56709ec38a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Oct 2017 11:44:11 +0200 Subject: [PATCH 08/24] Get rid of some hashes --- menu/cbs/menu_cbs_ok.c | 4 ---- msg_hash.h | 5 ----- 2 files changed, 9 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index f4ff0bf626..9c0eeccc3c 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -4724,10 +4724,6 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs, case MENU_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS: BIND_ACTION_OK(cbs, action_ok_push_accounts_cheevos_list); break; - case MENU_LABEL_SCAN_FILE: - BIND_ACTION_OK(cbs, action_ok_push_scan_file); - break; - case MENU_LABEL_SCAN_DIRECTORY: case MENU_LABEL_FAVORITES: BIND_ACTION_OK(cbs, action_ok_push_content_list); break; diff --git a/msg_hash.h b/msg_hash.h index e2a9cb0be1..152faeff81 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1703,11 +1703,6 @@ enum msg_hash_enums #define MENU_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST 0xb4f82700U -/* Scan values */ -#define MENU_LABEL_SCAN_THIS_DIRECTORY 0x6921b775U -#define MENU_LABEL_SCAN_DIRECTORY 0x57de303eU -#define MENU_LABEL_SCAN_FILE 0xd5d1eee9U - /* Online updater settings */ #define MENU_LABEL_UPDATE_LAKKA 0x19b51eebU From 19b313c22101012e0db764c287932f455127f2a8 Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Thu, 5 Oct 2017 14:30:15 +0200 Subject: [PATCH 09/24] Implemented setting for showing/hiding the "Information" option in XMB. --- config.def.h | 1 + configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/drivers/xmb.c | 8 ++++++-- menu/menu_displaylist.c | 5 +++++ menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 23 files changed, 94 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index a183446ed8..a8134cf740 100644 --- a/config.def.h +++ b/config.def.h @@ -239,6 +239,7 @@ static bool default_block_config_read = true; static bool menu_show_online_updater = true; static bool menu_show_load_core = true; static bool menu_show_load_content = true; +static bool menu_show_information = true; #if defined(HAVE_LAKKA) || defined(VITA) static bool menu_show_core_updater = false; diff --git a/configuration.c b/configuration.c index 684a050a38..d74681b7bb 100644 --- a/configuration.c +++ b/configuration.c @@ -1204,6 +1204,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("xmb_show_music", &settings->bools.menu_xmb_show_music, true, xmb_show_music, false); SETTING_BOOL("menu_show_load_core", &settings->bools.menu_show_load_core, true, menu_show_load_core, false); SETTING_BOOL("menu_show_load_content", &settings->bools.menu_show_load_content, true, menu_show_load_content, false); + SETTING_BOOL("menu_show_information", &settings->bools.menu_show_information, true, menu_show_information, false); SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false); SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false); #ifdef HAVE_FFMPEG diff --git a/configuration.h b/configuration.h index 4201c17274..af6bf1196e 100644 --- a/configuration.h +++ b/configuration.h @@ -129,6 +129,7 @@ typedef struct settings bool menu_show_core_updater; bool menu_show_load_core; bool menu_show_load_content; + bool menu_show_information; bool menu_materialui_icons_enable; bool menu_xmb_shadows_enable; bool menu_xmb_show_settings; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 1297f39646..5ed0503e9a 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3071,3 +3071,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 9b4c6c1765..e1d65640c7 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3071,3 +3071,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 05cc56f83a..54d30cea4d 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3065,3 +3065,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 3c795534e0..0fb01a7c76 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2934,3 +2934,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 1a388cdfa9..576da72d2f 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3103,3 +3103,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 6b711ccf70..4f0fe73486 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3157,3 +3157,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 7b030c20fd..1a4a76ef08 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3073,3 +3073,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 4546bf035d..7e543738f4 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3066,3 +3066,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index df024a45b8..3b8509ccc2 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1309,3 +1309,5 @@ MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE, "menu_show_load_core") MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT, "menu_show_load_content") +MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_INFORMATION, + "menu_show_information") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index be72a0c6df..532b8b3049 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2934,3 +2934,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 82d9819898..de0c5ef025 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -4000,3 +4000,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 725a434862..a38b9fcf05 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3041,3 +3041,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 11c665374e..8b90ffeb65 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3124,3 +3124,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index c7ee0c364c..3e8c0d28a7 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3159,3 +3159,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 96b021ede8..23db161931 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3095,3 +3095,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT, "Show Load Content") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT, "Show/hide the 'Load Content' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + "Show Information") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, + "Show/hide the 'Information' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 141ff7b37d..3af26d5996 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -293,6 +293,7 @@ default_sublabel_macro(action_bind_sublabel_menu_favorites_tab, default_sublabel_macro(action_bind_sublabel_menu_images_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_IMAGES) default_sublabel_macro(action_bind_sublabel_menu_show_load_core, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE) default_sublabel_macro(action_bind_sublabel_menu_show_load_content, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT) +default_sublabel_macro(action_bind_sublabel_menu_show_information , MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_show_core_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_music_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_MUSIC) @@ -608,6 +609,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_load_content); break; + case MENU_ENUM_LABEL_MENU_SHOW_INFORMATION: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_information); + break; case MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_online_updater); break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index c8e21a465b..0d840fb12d 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4353,8 +4353,12 @@ static int xmb_list_push(void *data, void *userdata, menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); } - entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST; - menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + if (settings->bools.menu_show_information) + { + entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST; + menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + } + #ifndef HAVE_DYNAMIC entry.enum_idx = MENU_ENUM_LABEL_RESTART_RETROARCH; menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 55d86f3f80..c3c7e61208 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5294,6 +5294,11 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_MENU_SHOW_CORE_UPDATER, PARSE_ONLY_BOOL, false); #endif + + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_MENU_SHOW_INFORMATION, + PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_XMB_SHOW_SETTINGS, PARSE_ONLY_BOOL, false); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index b0e4918ce4..f70fd4c03c 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5409,6 +5409,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_show_information, + MENU_ENUM_LABEL_MENU_SHOW_INFORMATION, + MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, + menu_show_information, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + CONFIG_BOOL( list, list_info, &settings->bools.menu_xmb_show_settings, diff --git a/msg_hash.h b/msg_hash.h index 7680ac96fe..9e564d5d72 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -674,6 +674,7 @@ enum msg_hash_enums /* Menu settings */ MENU_LABEL(MENU_SHOW_LOAD_CORE), MENU_LABEL(MENU_SHOW_LOAD_CONTENT), + MENU_LABEL(MENU_SHOW_INFORMATION), MENU_LABEL(MENU_SHOW_ONLINE_UPDATER), MENU_LABEL(MENU_SHOW_CORE_UPDATER), MENU_LABEL(RUN_MUSIC), From 76283edd07c9a195d2ca7730723680bcc33b05cf Mon Sep 17 00:00:00 2001 From: Alcaro Date: Fri, 6 Oct 2017 01:53:00 +0200 Subject: [PATCH 10/24] fix buncha ignored errors and whatever --- deps/libFLAC/bitreader.c | 20 ++++++++++---------- libretro-common/formats/libchdr/chd.c | 20 ++++++++++++++------ libretro-common/formats/libchdr/huffman.c | 1 + 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/deps/libFLAC/bitreader.c b/deps/libFLAC/bitreader.c index fc6e89f671..d54350cf23 100644 --- a/deps/libFLAC/bitreader.c +++ b/deps/libFLAC/bitreader.c @@ -119,20 +119,20 @@ static INLINE void crc16_update_word_(FLAC__BitReader *br, brword word) register unsigned crc = br->read_crc16; #if FLAC__BYTES_PER_WORD == 4 switch(br->crc16_align) { - case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 24), crc); - case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); - case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); + case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 24), crc); // fallthrough + case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); // fallthrough + case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); // fallthrough case 24: br->read_crc16 = FLAC__CRC16_UPDATE((unsigned)(word & 0xff), crc); } #elif FLAC__BYTES_PER_WORD == 8 switch(br->crc16_align) { - case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 56), crc); - case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 48) & 0xff), crc); - case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 40) & 0xff), crc); - case 24: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 32) & 0xff), crc); - case 32: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 24) & 0xff), crc); - case 40: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); - case 48: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); + case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 56), crc); // fallthrough + case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 48) & 0xff), crc); // fallthrough + case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 40) & 0xff), crc); // fallthrough + case 24: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 32) & 0xff), crc); // fallthrough + case 32: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 24) & 0xff), crc); // fallthrough + case 40: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); // fallthrough + case 48: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); // fallthrough case 56: br->read_crc16 = FLAC__CRC16_UPDATE((unsigned)(word & 0xff), crc); } #else diff --git a/libretro-common/formats/libchdr/chd.c b/libretro-common/formats/libchdr/chd.c index 72169a1c94..8ad9f609f0 100644 --- a/libretro-common/formats/libchdr/chd.c +++ b/libretro-common/formats/libchdr/chd.c @@ -621,6 +621,8 @@ chd_error cdlz_codec_decompress(void *codec, const uint8_t *src, uint32_t comple /* reset and decode */ lzma_codec_decompress(&cdlz->base_decompressor, &src[header_bytes], complen_base, &cdlz->buffer[0], frames * CD_MAX_SECTOR_DATA); #ifdef WANT_SUBCODE + if (header_bytes + complen_base >= complen) + return CHDERR_DECOMPRESSION_ERROR; zlib_codec_decompress(&cdlz->subcode_decompressor, &src[header_bytes + complen_base], complen - complen_base - header_bytes, &cdlz->buffer[frames * CD_MAX_SECTOR_DATA], frames * CD_MAX_SUBCODE_DATA); #endif @@ -2073,7 +2075,8 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des case V34_MAP_ENTRY_TYPE_COMPRESSED: /* read it into the decompression buffer */ - core_fseek(chd->file, entry->offset, SEEK_SET); + if (core_fseek(chd->file, entry->offset, SEEK_SET) != 0) + return CHDERR_READ_ERROR; bytes = core_fread(chd->file, chd->compressed, entry->length); if (bytes != entry->length) return CHDERR_READ_ERROR; @@ -2089,7 +2092,8 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des /* uncompressed data */ case V34_MAP_ENTRY_TYPE_UNCOMPRESSED: - core_fseek(chd->file, entry->offset, SEEK_SET); + if (core_fseek(chd->file, entry->offset, SEEK_SET) != 0) + return CHDERR_READ_ERROR; bytes = core_fread(chd->file, dest, chd->header.hunkbytes); if (bytes != chd->header.hunkbytes) return CHDERR_READ_ERROR; @@ -2158,8 +2162,10 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des case COMPRESSION_TYPE_1: case COMPRESSION_TYPE_2: case COMPRESSION_TYPE_3: - core_fseek(chd->file, blockoffs, SEEK_SET); - core_fread(chd->file, chd->compressed, blocklen); + if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0); + return CHDERR_READ_ERROR; + if (core_fread(chd->file, chd->compressed, blocklen) != blocklen) + return CHDERR_READ_ERROR; switch (chd->codecintf[rawmap[0]]->compression) { case CHD_CODEC_CD_LZMA: @@ -2186,8 +2192,10 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des return CHDERR_NONE; case COMPRESSION_NONE: - core_fseek(chd->file, blockoffs, SEEK_SET); - core_fread(chd->file, dest, chd->header.hunkbytes); + if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0) + return CHDERR_READ_ERROR; + if (core_fread(chd->file, dest, chd->header.hunkbytes) != chd->header.hunkbytes) + return CHDERR_READ_ERROR; #ifdef VERIFY_BLOCK_CRC if (crc16(dest, chd->header.hunkbytes) != blockcrc) return CHDERR_DECOMPRESSION_ERROR; diff --git a/libretro-common/formats/libchdr/huffman.c b/libretro-common/formats/libchdr/huffman.c index 3478ad9210..8eafca01cd 100644 --- a/libretro-common/formats/libchdr/huffman.c +++ b/libretro-common/formats/libchdr/huffman.c @@ -304,6 +304,7 @@ enum huffman_error huffman_import_tree_huffman(struct huffman_decoder* decoder, /* build the lookup table */ huffman_build_lookup_table(decoder); + delete_huffman_decoder(smallhuff); /* determine final input length and report errors */ return bitstream_overflow(bitbuf) ? HUFFERR_INPUT_BUFFER_TOO_SMALL : HUFFERR_NONE; From bd206f7744279635bdc1427f00fd1989168d6054 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 6 Oct 2017 01:55:18 +0200 Subject: [PATCH 11/24] C comments --- deps/libFLAC/bitreader.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/deps/libFLAC/bitreader.c b/deps/libFLAC/bitreader.c index d54350cf23..e374476f2c 100644 --- a/deps/libFLAC/bitreader.c +++ b/deps/libFLAC/bitreader.c @@ -119,20 +119,20 @@ static INLINE void crc16_update_word_(FLAC__BitReader *br, brword word) register unsigned crc = br->read_crc16; #if FLAC__BYTES_PER_WORD == 4 switch(br->crc16_align) { - case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 24), crc); // fallthrough - case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); // fallthrough - case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); // fallthrough + case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 24), crc); /* fallthrough */ + case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); /* fallthrough */ + case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); /* fallthrough */ case 24: br->read_crc16 = FLAC__CRC16_UPDATE((unsigned)(word & 0xff), crc); } #elif FLAC__BYTES_PER_WORD == 8 switch(br->crc16_align) { - case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 56), crc); // fallthrough - case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 48) & 0xff), crc); // fallthrough - case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 40) & 0xff), crc); // fallthrough - case 24: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 32) & 0xff), crc); // fallthrough - case 32: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 24) & 0xff), crc); // fallthrough - case 40: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); // fallthrough - case 48: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); // fallthrough + case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 56), crc); /* fallthrough */ + case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 48) & 0xff), crc); /* fallthrough */ + case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 40) & 0xff), crc); /* fallthrough */ + case 24: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 32) & 0xff), crc); /* fallthrough */ + case 32: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 24) & 0xff), crc); /* fallthrough */ + case 40: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); /* fallthrough */ + case 48: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); /* fallthrough */ case 56: br->read_crc16 = FLAC__CRC16_UPDATE((unsigned)(word & 0xff), crc); } #else From 6013e25b2ba0530a0066d5629511f6d22c397904 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 6 Oct 2017 01:59:16 +0200 Subject: [PATCH 12/24] Cleanups --- libretro-common/formats/libchdr/chd.c | 279 +++++++++++++------------- 1 file changed, 140 insertions(+), 139 deletions(-) diff --git a/libretro-common/formats/libchdr/chd.c b/libretro-common/formats/libchdr/chd.c index 8ad9f609f0..b342d89845 100644 --- a/libretro-common/formats/libchdr/chd.c +++ b/libretro-common/formats/libchdr/chd.c @@ -2049,176 +2049,177 @@ static chd_error hunk_read_into_cache(chd_file *chd, UINT32 hunknum) static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *dest) { - chd_error err; + chd_error err; - /* punt if no file */ - if (chd->file == NULL) - return CHDERR_INVALID_FILE; + /* punt if no file */ + if (chd->file == NULL) + return CHDERR_INVALID_FILE; - /* return an error if out of range */ - if (hunknum >= chd->header.totalhunks) - return CHDERR_HUNK_OUT_OF_RANGE; + /* return an error if out of range */ + if (hunknum >= chd->header.totalhunks) + return CHDERR_HUNK_OUT_OF_RANGE; - if (dest == NULL) - return CHDERR_INVALID_PARAMETER; + if (dest == NULL) + return CHDERR_INVALID_PARAMETER; - if (chd->header.version < 5) - { - void* codec; - map_entry *entry = &chd->map[hunknum]; - UINT32 bytes; + if (chd->header.version < 5) + { + void* codec; + map_entry *entry = &chd->map[hunknum]; + UINT32 bytes; - /* switch off the entry type */ - switch (entry->flags & MAP_ENTRY_FLAG_TYPE_MASK) - { - /* compressed data */ - case V34_MAP_ENTRY_TYPE_COMPRESSED: + /* switch off the entry type */ + switch (entry->flags & MAP_ENTRY_FLAG_TYPE_MASK) + { + /* compressed data */ + case V34_MAP_ENTRY_TYPE_COMPRESSED: - /* read it into the decompression buffer */ - if (core_fseek(chd->file, entry->offset, SEEK_SET) != 0) - return CHDERR_READ_ERROR; - bytes = core_fread(chd->file, chd->compressed, entry->length); - if (bytes != entry->length) - return CHDERR_READ_ERROR; + /* read it into the decompression buffer */ + if (core_fseek(chd->file, entry->offset, SEEK_SET) != 0) + return CHDERR_READ_ERROR; + bytes = core_fread(chd->file, chd->compressed, entry->length); + if (bytes != entry->length) + return CHDERR_READ_ERROR; - /* now decompress using the codec */ - err = CHDERR_NONE; - codec = &chd->zlib_codec_data; - if (chd->codecintf[0]->decompress != NULL) - err = (*chd->codecintf[0]->decompress)(codec, chd->compressed, entry->length, dest, chd->header.hunkbytes); - if (err != CHDERR_NONE) - return err; - break; + /* now decompress using the codec */ + err = CHDERR_NONE; + codec = &chd->zlib_codec_data; + if (chd->codecintf[0]->decompress != NULL) + err = (*chd->codecintf[0]->decompress)(codec, chd->compressed, entry->length, dest, chd->header.hunkbytes); + if (err != CHDERR_NONE) + return err; + break; - /* uncompressed data */ - case V34_MAP_ENTRY_TYPE_UNCOMPRESSED: - if (core_fseek(chd->file, entry->offset, SEEK_SET) != 0) - return CHDERR_READ_ERROR; - bytes = core_fread(chd->file, dest, chd->header.hunkbytes); - if (bytes != chd->header.hunkbytes) - return CHDERR_READ_ERROR; - break; + /* uncompressed data */ + case V34_MAP_ENTRY_TYPE_UNCOMPRESSED: + if (core_fseek(chd->file, entry->offset, SEEK_SET) != 0) + return CHDERR_READ_ERROR; + bytes = core_fread(chd->file, dest, chd->header.hunkbytes); + if (bytes != chd->header.hunkbytes) + return CHDERR_READ_ERROR; + break; - /* mini-compressed data */ - case V34_MAP_ENTRY_TYPE_MINI: - put_bigendian_uint64(&dest[0], entry->offset); - for (bytes = 8; bytes < chd->header.hunkbytes; bytes++) - dest[bytes] = dest[bytes - 8]; - break; + /* mini-compressed data */ + case V34_MAP_ENTRY_TYPE_MINI: + put_bigendian_uint64(&dest[0], entry->offset); + for (bytes = 8; bytes < chd->header.hunkbytes; bytes++) + dest[bytes] = dest[bytes - 8]; + break; - /* self-referenced data */ - case V34_MAP_ENTRY_TYPE_SELF_HUNK: + /* self-referenced data */ + case V34_MAP_ENTRY_TYPE_SELF_HUNK: #ifdef NEED_CACHE_HUNK - if (chd->cachehunk == entry->offset && dest == chd->cache) - break; + if (chd->cachehunk == entry->offset && dest == chd->cache) + break; #endif - return hunk_read_into_memory(chd, entry->offset, dest); + return hunk_read_into_memory(chd, entry->offset, dest); - /* parent-referenced data */ - case V34_MAP_ENTRY_TYPE_PARENT_HUNK: - err = hunk_read_into_memory(chd->parent, entry->offset, dest); - if (err != CHDERR_NONE) - return err; - break; - } - return CHDERR_NONE; - } - else - { - void* codec = NULL; - /* get a pointer to the map entry */ - uint64_t blockoffs; - uint32_t blocklen; + /* parent-referenced data */ + case V34_MAP_ENTRY_TYPE_PARENT_HUNK: + err = hunk_read_into_memory(chd->parent, entry->offset, dest); + if (err != CHDERR_NONE) + return err; + break; + } + return CHDERR_NONE; + } + else + { + void* codec = NULL; + /* get a pointer to the map entry */ + uint64_t blockoffs; + uint32_t blocklen; #ifdef VERIFY_BLOCK_CRC - uint16_t blockcrc; + uint16_t blockcrc; #endif - uint8_t *rawmap = &chd->header.rawmap[chd->header.mapentrybytes * hunknum]; + uint8_t *rawmap = &chd->header.rawmap[chd->header.mapentrybytes * hunknum]; - /* uncompressed case */ - /* TODO - if (!compressed()) - { - blockoffs = uint64_t(be_read(rawmap, 4)) * uint64_t(m_hunkbytes); - if (blockoffs != 0) - file_read(blockoffs, dest, m_hunkbytes); - else if (m_parent_missing) - throw CHDERR_REQUIRES_PARENT; - else if (m_parent != nullptr) - m_parent->read_hunk(hunknum, dest); - else - memset(dest, 0, m_hunkbytes); - return CHDERR_NONE; - }*/ + /* uncompressed case */ + /* TODO + if (!compressed()) + { + blockoffs = uint64_t(be_read(rawmap, 4)) * uint64_t(m_hunkbytes); + if (blockoffs != 0) + file_read(blockoffs, dest, m_hunkbytes); + else if (m_parent_missing) + throw CHDERR_REQUIRES_PARENT; + else if (m_parent != nullptr) + m_parent->read_hunk(hunknum, dest); + else + memset(dest, 0, m_hunkbytes); + return CHDERR_NONE; + }*/ - /* compressed case */ - blocklen = get_bigendian_uint24(&rawmap[1]); - blockoffs = get_bigendian_uint48(&rawmap[4]); + /* compressed case */ + blocklen = get_bigendian_uint24(&rawmap[1]); + blockoffs = get_bigendian_uint48(&rawmap[4]); #ifdef VERIFY_BLOCK_CRC - blockcrc = get_bigendian_uint16(&rawmap[10]); + blockcrc = get_bigendian_uint16(&rawmap[10]); #endif - switch (rawmap[0]) - { - case COMPRESSION_TYPE_0: - case COMPRESSION_TYPE_1: - case COMPRESSION_TYPE_2: - case COMPRESSION_TYPE_3: - if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0); - return CHDERR_READ_ERROR; - if (core_fread(chd->file, chd->compressed, blocklen) != blocklen) - return CHDERR_READ_ERROR; - switch (chd->codecintf[rawmap[0]]->compression) - { - case CHD_CODEC_CD_LZMA: - codec = &chd->cdlz_codec_data; - break; + switch (rawmap[0]) + { + case COMPRESSION_TYPE_0: + case COMPRESSION_TYPE_1: + case COMPRESSION_TYPE_2: + case COMPRESSION_TYPE_3: + if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0); + return CHDERR_READ_ERROR; + if (core_fread(chd->file, chd->compressed, blocklen) != blocklen) + return CHDERR_READ_ERROR; + switch (chd->codecintf[rawmap[0]]->compression) + { + case CHD_CODEC_CD_LZMA: + codec = &chd->cdlz_codec_data; + break; - case CHD_CODEC_CD_ZLIB: - codec = &chd->cdzl_codec_data; - break; + case CHD_CODEC_CD_ZLIB: + codec = &chd->cdzl_codec_data; + break; - case CHD_CODEC_CD_FLAC: - codec = &chd->cdfl_codec_data; - break; - } - if (codec==NULL) - return CHDERR_CODEC_ERROR; - err = (*chd->codecintf[rawmap[0]]->decompress)(codec, chd->compressed, blocklen, dest, chd->header.hunkbytes); - if (err != CHDERR_NONE) - return err; + case CHD_CODEC_CD_FLAC: + codec = &chd->cdfl_codec_data; + break; + } + if (codec==NULL) + return CHDERR_CODEC_ERROR; + err = (*chd->codecintf[rawmap[0]]->decompress)(codec, chd->compressed, blocklen, dest, chd->header.hunkbytes); + if (err != CHDERR_NONE) + return err; #ifdef VERIFY_BLOCK_CRC - if (crc16(dest, chd->header.hunkbytes) != blockcrc) - return CHDERR_DECOMPRESSION_ERROR; + if (crc16(dest, chd->header.hunkbytes) != blockcrc) + return CHDERR_DECOMPRESSION_ERROR; #endif - return CHDERR_NONE; + return CHDERR_NONE; - case COMPRESSION_NONE: - if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0) - return CHDERR_READ_ERROR; - if (core_fread(chd->file, dest, chd->header.hunkbytes) != chd->header.hunkbytes) - return CHDERR_READ_ERROR; + case COMPRESSION_NONE: + if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0) + return CHDERR_READ_ERROR; + if (core_fread(chd->file, dest, chd->header.hunkbytes) != chd->header.hunkbytes) + return CHDERR_READ_ERROR; #ifdef VERIFY_BLOCK_CRC - if (crc16(dest, chd->header.hunkbytes) != blockcrc) - return CHDERR_DECOMPRESSION_ERROR; + if (crc16(dest, chd->header.hunkbytes) != blockcrc) + return CHDERR_DECOMPRESSION_ERROR; #endif - return CHDERR_NONE; + return CHDERR_NONE; - case COMPRESSION_SELF: - return hunk_read_into_memory(chd, blockoffs, dest); + case COMPRESSION_SELF: + return hunk_read_into_memory(chd, blockoffs, dest); - case COMPRESSION_PARENT: - /* TODO */ + case COMPRESSION_PARENT: + /* TODO */ #if 0 - if (m_parent_missing) - return CHDERR_REQUIRES_PARENT; - return m_parent->read_bytes(uint64_t(blockoffs) * uint64_t(m_parent->unit_bytes()), dest, m_hunkbytes); + if (m_parent_missing) + return CHDERR_REQUIRES_PARENT; + return m_parent->read_bytes(uint64_t(blockoffs) * uint64_t(m_parent->unit_bytes()), dest, m_hunkbytes); #endif - return CHDERR_DECOMPRESSION_ERROR; - } - return CHDERR_NONE; - } + return CHDERR_DECOMPRESSION_ERROR; + } - /* We should not reach this code */ - return CHDERR_DECOMPRESSION_ERROR; + return CHDERR_NONE; + } + + /* We should not reach this code */ + return CHDERR_DECOMPRESSION_ERROR; } From 3d9d5320adaeee5c6cbbff4245a2fb817685d8b7 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Fri, 6 Oct 2017 02:15:49 +0200 Subject: [PATCH 13/24] typo --- libretro-common/formats/libchdr/chd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretro-common/formats/libchdr/chd.c b/libretro-common/formats/libchdr/chd.c index b342d89845..0e2124ac31 100644 --- a/libretro-common/formats/libchdr/chd.c +++ b/libretro-common/formats/libchdr/chd.c @@ -2162,7 +2162,7 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des case COMPRESSION_TYPE_1: case COMPRESSION_TYPE_2: case COMPRESSION_TYPE_3: - if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0); + if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0) return CHDERR_READ_ERROR; if (core_fread(chd->file, chd->compressed, blocklen) != blocklen) return CHDERR_READ_ERROR; From 608bc4538806298e449615d55f86eb324f1a6ee0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 6 Oct 2017 05:25:05 +0200 Subject: [PATCH 14/24] Prevent another memory leak --- libretro-common/formats/libchdr/huffman.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretro-common/formats/libchdr/huffman.c b/libretro-common/formats/libchdr/huffman.c index 8eafca01cd..09b3e62026 100644 --- a/libretro-common/formats/libchdr/huffman.c +++ b/libretro-common/formats/libchdr/huffman.c @@ -300,7 +300,10 @@ enum huffman_error huffman_import_tree_huffman(struct huffman_decoder* decoder, /* assign canonical codes for all nodes based on their code lengths */ error = huffman_assign_canonical_codes(decoder); if (error != HUFFERR_NONE) + { + delete_huffman_decoder(smallhuff); return error; + } /* build the lookup table */ huffman_build_lookup_table(decoder); From 20da0f0666750fef88c80e29f0e852b8eb116d29 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 6 Oct 2017 05:28:35 +0200 Subject: [PATCH 15/24] Cleanups --- libretro-common/formats/libchdr/chd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libretro-common/formats/libchdr/chd.c b/libretro-common/formats/libchdr/chd.c index 0e2124ac31..08650d1030 100644 --- a/libretro-common/formats/libchdr/chd.c +++ b/libretro-common/formats/libchdr/chd.c @@ -2163,9 +2163,10 @@ static chd_error hunk_read_into_memory(chd_file *chd, UINT32 hunknum, UINT8 *des case COMPRESSION_TYPE_2: case COMPRESSION_TYPE_3: if (core_fseek(chd->file, blockoffs, SEEK_SET) != 0) - return CHDERR_READ_ERROR; + return CHDERR_READ_ERROR; if (core_fread(chd->file, chd->compressed, blocklen) != blocklen) - return CHDERR_READ_ERROR; + return CHDERR_READ_ERROR; + switch (chd->codecintf[rawmap[0]]->compression) { case CHD_CODEC_CD_LZMA: From b67e6dc1eef876562e24fef739115519efc11b85 Mon Sep 17 00:00:00 2001 From: Conn O'Griofa Date: Wed, 4 Oct 2017 01:52:55 +0100 Subject: [PATCH 16/24] config: Raspberry Pi: use videocore pkgconfig & fix fallback detection Recent Raspberry Pi firmware images have renamed the vendor graphics libraries (brcmEGL, brcmGLESv2, brcmOpenVG) to distinguish from the standard VC4 Mesa driver. * When videocore is selected, first try to use pkgconfig for the new library names (brcmEGL, brcmGLESv2, brcmOpenVG). * Ensure that non-pkgconfig fallback detection also checks the new library names. This should resolve compile issues in stretch whilst maintaining compatibility with jessie firmwares later than 1.20160921-1 (the first package that includes the renamed libraries). The PKG_CONFIG_PATH must be set in your build environment in order for the pkgconfig to be utilized, which will be included in the next firmware (1.20170811-2 or later). --- qb/config.libs.sh | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/qb/config.libs.sh b/qb/config.libs.sh index bd8ed4dc28..9ceb60426a 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -38,16 +38,28 @@ add_define_make DYLIB_LIB "$DYLIB" check_lib SYSTEMD -lsystemd sd_get_machine_names if [ "$HAVE_VIDEOCORE" != "no" ]; then - [ -d /opt/vc/lib ] && add_library_dirs /opt/vc/lib && add_library_dirs /opt/vc/lib/GL - check_lib VIDEOCORE -lbcm_host bcm_host_init "-lvcos -lvchiq_arm" + check_pkgconf VC_TEST bcm_host + + # use fallback if pkgconfig is not available + if [ ! "$VC_TEST_LIBS" ]; then + [ -d /opt/vc/lib ] && add_library_dirs /opt/vc/lib && add_library_dirs /opt/vc/lib/GL + check_lib VIDEOCORE -lbcm_host bcm_host_init "-lvcos -lvchiq_arm" + else + HAVE_VIDEOCORE="$HAVE_VC_TEST" + fi fi if [ "$HAVE_VIDEOCORE" = 'yes' ]; then - [ -d /opt/vc/include ] && add_include_dirs /opt/vc/include - [ -d /opt/vc/include/interface/vcos/pthreads ] && add_include_dirs /opt/vc/include/interface/vcos/pthreads - [ -d /opt/vc/include/interface/vmcs_host/linux ] && add_include_dirs /opt/vc/include/interface/vmcs_host/linux HAVE_OPENGLES='auto' - EXTRA_GL_LIBS="-lbrcmEGL -lbrcmGLESv2 -lbcm_host -lvcos -lvchiq_arm" + VC_PREFIX="brcm" + + # use fallback if pkgconfig is not available + if [ ! "$VC_TEST_LIBS" ]; then + [ -d /opt/vc/include ] && add_include_dirs /opt/vc/include + [ -d /opt/vc/include/interface/vcos/pthreads ] && add_include_dirs /opt/vc/include/interface/vcos/pthreads + [ -d /opt/vc/include/interface/vmcs_host/linux ] && add_include_dirs /opt/vc/include/interface/vmcs_host/linux + EXTRA_GL_LIBS="-lbrcmEGL -lbrcmGLESv2 -lbcm_host -lvcos -lvchiq_arm" + fi fi if [ "$HAVE_NEON" = "yes" ]; then @@ -101,11 +113,11 @@ if [ "$HAVE_SSE" = "yes" ]; then fi if [ "$HAVE_EGL" != "no" -a "$OS" != 'Win32' ]; then - check_pkgconf EGL egl + check_pkgconf EGL "$VC_PREFIX"egl # some systems have EGL libs, but no pkgconfig if [ "$HAVE_EGL" = "no" ]; then - HAVE_EGL=auto && check_lib EGL "-lEGL $EXTRA_GL_LIBS" - [ "$HAVE_EGL" = "yes" ] && EGL_LIBS=-lEGL + HAVE_EGL=auto && check_lib EGL "-l"$VC_PREFIX"EGL $EXTRA_GL_LIBS" + [ "$HAVE_EGL" = "yes" ] && EGL_LIBS=-l"$VC_PREFIX"EGL else EGL_LIBS="$EGL_LIBS $EXTRA_GL_LIBS" fi @@ -378,15 +390,15 @@ if [ "$HAVE_EGL" = "yes" ]; then add_define_make OPENGLES_LIBS "$OPENGLES_LIBS" add_define_make OPENGLES_CFLAGS "$OPENGLES_CFLAGS" else - HAVE_OPENGLES=auto check_pkgconf OPENGLES glesv2 - [ "$HAVE_OPENGLES" = "no" ] && HAVE_OPENGLES=auto check_lib OPENGLES "-lGLESv2 $EXTRA_GL_LIBS" && add_define_make OPENGLES_LIBS "-lGLESv2 $EXTRA_GL_LIBS" + HAVE_OPENGLES=auto check_pkgconf OPENGLES "$VC_PREFIX"glesv2 + [ "$HAVE_OPENGLES" = "no" ] && HAVE_OPENGLES=auto check_lib OPENGLES "-l"$VC_PREFIX"GLESv2 $EXTRA_GL_LIBS" && add_define_make OPENGLES_LIBS "-l"$VC_PREFIX"GLESv2 $EXTRA_GL_LIBS" fi fi if [ "$HAVE_VG" != "no" ]; then - check_pkgconf VG vg + check_pkgconf VG "$VC_PREFIX"vg if [ "$HAVE_VG" = "no" ]; then - HAVE_VG=auto check_lib VG "-lOpenVG $EXTRA_GL_LIBS" - [ "$HAVE_VG" = "yes" ] && VG_LIBS=-lOpenVG + HAVE_VG=auto check_lib VG "-l"$VC_PREFIX"OpenVG $EXTRA_GL_LIBS" + [ "$HAVE_VG" = "yes" ] && VG_LIBS=-l"$VC_PREFIX"OpenVG fi fi else From 7ee1797fa1ad7ada5228742ccdb5798a254b5e3f Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Fri, 6 Oct 2017 08:18:39 +0200 Subject: [PATCH 17/24] Implemented setting for showing/hiding the "Configurations" option in XMB. --- config.def.h | 1 + configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 10 +++++++--- menu/drivers/xmb.c | 8 ++++++-- menu/menu_displaylist.c | 4 ++++ menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 23 files changed, 96 insertions(+), 5 deletions(-) diff --git a/config.def.h b/config.def.h index a8134cf740..cee950639b 100644 --- a/config.def.h +++ b/config.def.h @@ -240,6 +240,7 @@ static bool menu_show_online_updater = true; static bool menu_show_load_core = true; static bool menu_show_load_content = true; static bool menu_show_information = true; +static bool menu_show_configurations = true; #if defined(HAVE_LAKKA) || defined(VITA) static bool menu_show_core_updater = false; diff --git a/configuration.c b/configuration.c index d74681b7bb..02118fa972 100644 --- a/configuration.c +++ b/configuration.c @@ -1205,6 +1205,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("menu_show_load_core", &settings->bools.menu_show_load_core, true, menu_show_load_core, false); SETTING_BOOL("menu_show_load_content", &settings->bools.menu_show_load_content, true, menu_show_load_content, false); SETTING_BOOL("menu_show_information", &settings->bools.menu_show_information, true, menu_show_information, false); + SETTING_BOOL("menu_show_configurations", &settings->bools.menu_show_configurations, true, menu_show_configurations, false); SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false); SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false); #ifdef HAVE_FFMPEG diff --git a/configuration.h b/configuration.h index af6bf1196e..e6271e0b87 100644 --- a/configuration.h +++ b/configuration.h @@ -130,6 +130,7 @@ typedef struct settings bool menu_show_load_core; bool menu_show_load_content; bool menu_show_information; + bool menu_show_configurations; bool menu_materialui_icons_enable; bool menu_xmb_shadows_enable; bool menu_xmb_show_settings; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 5ed0503e9a..f0db79df23 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3075,3 +3075,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index e1d65640c7..ce965f00f3 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3075,3 +3075,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 54d30cea4d..4bc8bf2cfe 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3069,3 +3069,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 0fb01a7c76..f4611f33c3 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2938,3 +2938,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 576da72d2f..55bd99ea6b 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3107,3 +3107,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 4f0fe73486..161a6f94df 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3161,3 +3161,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 1a4a76ef08..91eac0202a 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3077,3 +3077,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 7e543738f4..32eeb85525 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3070,3 +3070,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 3b8509ccc2..4830eeb8ab 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1311,3 +1311,5 @@ MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT, "menu_show_load_content") MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_INFORMATION, "menu_show_information") +MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, + "menu_show_configurations") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 532b8b3049..46efe1600d 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2938,3 +2938,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index de0c5ef025..df35ab7ae5 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -4006,3 +4006,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index a38b9fcf05..1258b9e630 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3045,3 +3045,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 8b90ffeb65..ad137e2b13 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3128,3 +3128,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 3e8c0d28a7..cecfeb67a0 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3163,3 +3163,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 23db161931..268e94d5a4 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3099,3 +3099,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_INFORMATION, "Show Information") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION, "Show/hide the 'Information' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + "Show Configurations") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, + "Show/hide the 'Configurations' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 3af26d5996..609427f86d 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -286,16 +286,17 @@ default_sublabel_macro(action_bind_sublabel_xmb_icon_theme, default_sublabel_macro(action_bind_sublabel_xmb_shadows_enable, MENU_ENUM_SUBLABEL_XMB_SHADOWS_ENABLE) default_sublabel_macro(action_bind_sublabel_menu_color_theme, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_COLOR_THEME) default_sublabel_macro(action_bind_sublabel_menu_wallpaper_opacity, MENU_ENUM_SUBLABEL_MENU_WALLPAPER_OPACITY) -default_sublabel_macro(action_bind_sublabel_menu_framebuffer_opacity, MENU_ENUM_SUBLABEL_MENU_FRAMEBUFFER_OPACITY) +default_sublabel_macro(action_bind_sublabel_menu_framebuffer_opacity, MENU_ENUM_SUBLABEL_MENU_FRAMEBUFFER_OPACITY) default_sublabel_macro(action_bind_sublabel_menu_ribbon_enable, MENU_ENUM_SUBLABEL_XMB_RIBBON_ENABLE) default_sublabel_macro(action_bind_sublabel_menu_font, MENU_ENUM_SUBLABEL_XMB_FONT) default_sublabel_macro(action_bind_sublabel_menu_favorites_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_FAVORITES) default_sublabel_macro(action_bind_sublabel_menu_images_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_IMAGES) default_sublabel_macro(action_bind_sublabel_menu_show_load_core, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE) default_sublabel_macro(action_bind_sublabel_menu_show_load_content, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT) -default_sublabel_macro(action_bind_sublabel_menu_show_information , MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION) +default_sublabel_macro(action_bind_sublabel_menu_show_information, MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION) +default_sublabel_macro(action_bind_sublabel_menu_show_configurations, MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) -default_sublabel_macro(action_bind_sublabel_menu_show_core_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER) +default_sublabel_macro(action_bind_sublabel_menu_show_core_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_music_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_MUSIC) default_sublabel_macro(action_bind_sublabel_menu_video_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_VIDEO) default_sublabel_macro(action_bind_sublabel_menu_netplay_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_NETPLAY) @@ -612,6 +613,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MENU_SHOW_INFORMATION: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_information); break; + case MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_configurations); + break; case MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_online_updater); break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 0d840fb12d..e9afd587e5 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4363,8 +4363,12 @@ static int xmb_list_push(void *data, void *userdata, entry.enum_idx = MENU_ENUM_LABEL_RESTART_RETROARCH; menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); #endif - entry.enum_idx = MENU_ENUM_LABEL_CONFIGURATIONS_LIST; - menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + + if (settings->bools.menu_show_configurations) + { + entry.enum_idx = MENU_ENUM_LABEL_CONFIGURATIONS_LIST; + menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + } entry.enum_idx = MENU_ENUM_LABEL_HELP_LIST; menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index c3c7e61208..ac097ece22 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5299,6 +5299,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_MENU_SHOW_INFORMATION, PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, + PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_XMB_SHOW_SETTINGS, PARSE_ONLY_BOOL, false); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index f70fd4c03c..6c328c5093 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5424,6 +5424,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_show_configurations, + MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, + MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, + menu_show_configurations, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_LAKKA_ADVANCED); + CONFIG_BOOL( list, list_info, &settings->bools.menu_xmb_show_settings, diff --git a/msg_hash.h b/msg_hash.h index 9e564d5d72..7b7f484bc5 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -675,6 +675,7 @@ enum msg_hash_enums MENU_LABEL(MENU_SHOW_LOAD_CORE), MENU_LABEL(MENU_SHOW_LOAD_CONTENT), MENU_LABEL(MENU_SHOW_INFORMATION), + MENU_LABEL(MENU_SHOW_CONFIGURATIONS), MENU_LABEL(MENU_SHOW_ONLINE_UPDATER), MENU_LABEL(MENU_SHOW_CORE_UPDATER), MENU_LABEL(RUN_MUSIC), From 082629ccd5b3de8df061b04414d8aeed53a680cf Mon Sep 17 00:00:00 2001 From: Zoran Vuckovic Date: Fri, 6 Oct 2017 08:19:22 +0200 Subject: [PATCH 18/24] Add lightgun device capability --- input/drivers/winraw_input.c | 49 +++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/input/drivers/winraw_input.c b/input/drivers/winraw_input.c index 6ea23df806..bb44a0b92e 100644 --- a/input/drivers/winraw_input.c +++ b/input/drivers/winraw_input.c @@ -323,6 +323,49 @@ static void winraw_init_mouse_xy_mapping() } } +static int16_t winraw_lightgun_state(winraw_input_t *wr, + unsigned port, unsigned id) +{ + unsigned i; + settings_t *settings = config_get_ptr(); + winraw_mouse_t *mouse = NULL; + + if (port >= MAX_USERS) + return 0; + + for (i = 0; i < g_mouse_cnt; ++i) + { + if (i == settings->uints.input_mouse_index[port]) + { + mouse = &wr->mice[i]; + break; + } + } + + if (!mouse) + return 0; + + switch (id) + { + case RETRO_DEVICE_ID_LIGHTGUN_X: + return mouse->dlt_x; + case RETRO_DEVICE_ID_LIGHTGUN_Y: + return mouse->dlt_y; + case RETRO_DEVICE_ID_LIGHTGUN_TRIGGER: + return mouse->btn_l ? 1 : 0; + case RETRO_DEVICE_ID_LIGHTGUN_CURSOR: + return mouse->btn_m ? 1 : 0; + case RETRO_DEVICE_ID_LIGHTGUN_TURBO: + return mouse->btn_r ? 1 : 0; + case RETRO_DEVICE_ID_LIGHTGUN_START: + return (mouse->btn_m && mouse->btn_r) ? 1 : 0; + case RETRO_DEVICE_ID_LIGHTGUN_PAUSE: + return mouse->btn_m && mouse->btn_l ? 1 : 0; + } + + return 0; +} + static void winraw_update_mouse_state(winraw_mouse_t *mouse, RAWMOUSE *state) { POINT crs_pos; @@ -555,6 +598,9 @@ static int16_t winraw_input_state(void *d, if (binds[port]) return input_joypad_analog(wr->joypad, joypad_info, port, index, id, binds[port]); + break; + case RETRO_DEVICE_LIGHTGUN: + return winraw_lightgun_state(wr, port, id); } return 0; @@ -587,7 +633,8 @@ static uint64_t winraw_get_capabilities(void *u) return (1 << RETRO_DEVICE_KEYBOARD) | (1 << RETRO_DEVICE_MOUSE) | (1 << RETRO_DEVICE_JOYPAD) | - (1 << RETRO_DEVICE_ANALOG); + (1 << RETRO_DEVICE_ANALOG) | + (1 << RETRO_DEVICE_LIGHTGUN); } static void winraw_grab_mouse(void *d, bool grab) From f073d5167afe92e6c90c0879a3899e90a510c125 Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Fri, 6 Oct 2017 08:28:45 +0200 Subject: [PATCH 19/24] Implemented setting for showing/hiding the "Help" option in XMB. --- config.def.h | 1 + configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/drivers/xmb.c | 8 ++++++-- menu/menu_displaylist.c | 4 ++++ menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 23 files changed, 93 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index cee950639b..e6179239dd 100644 --- a/config.def.h +++ b/config.def.h @@ -241,6 +241,7 @@ static bool menu_show_load_core = true; static bool menu_show_load_content = true; static bool menu_show_information = true; static bool menu_show_configurations = true; +static bool menu_show_help = true; #if defined(HAVE_LAKKA) || defined(VITA) static bool menu_show_core_updater = false; diff --git a/configuration.c b/configuration.c index 02118fa972..74f58691e8 100644 --- a/configuration.c +++ b/configuration.c @@ -1206,6 +1206,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("menu_show_load_content", &settings->bools.menu_show_load_content, true, menu_show_load_content, false); SETTING_BOOL("menu_show_information", &settings->bools.menu_show_information, true, menu_show_information, false); SETTING_BOOL("menu_show_configurations", &settings->bools.menu_show_configurations, true, menu_show_configurations, false); + SETTING_BOOL("menu_show_help", &settings->bools.menu_show_help, true, menu_show_help, false); SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false); SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false); #ifdef HAVE_FFMPEG diff --git a/configuration.h b/configuration.h index e6271e0b87..9d22c13957 100644 --- a/configuration.h +++ b/configuration.h @@ -131,6 +131,7 @@ typedef struct settings bool menu_show_load_content; bool menu_show_information; bool menu_show_configurations; + bool menu_show_help; bool menu_materialui_icons_enable; bool menu_xmb_shadows_enable; bool menu_xmb_show_settings; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index f0db79df23..fb2401229f 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3079,3 +3079,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index ce965f00f3..5325346cfc 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3079,3 +3079,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 4bc8bf2cfe..5982dcaf6d 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3073,3 +3073,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index f4611f33c3..c266ae7a1d 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2942,3 +2942,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 55bd99ea6b..f91c903962 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3111,3 +3111,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 161a6f94df..4ace0b71a5 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3165,3 +3165,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 91eac0202a..d174d166f8 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3081,3 +3081,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 32eeb85525..586da82360 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3074,3 +3074,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 4830eeb8ab..941d9885c3 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1313,3 +1313,5 @@ MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_INFORMATION, "menu_show_information") MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, "menu_show_configurations") +MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_HELP, + "menu_show_help") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 46efe1600d..49e94e74b0 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2942,3 +2942,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index df35ab7ae5..ccd8055111 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -4012,3 +4012,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 1258b9e630..ef16c2d259 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3049,3 +3049,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index ad137e2b13..a262bc0bce 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3132,3 +3132,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index cecfeb67a0..ec4478ef68 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3167,3 +3167,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 268e94d5a4..627de0e9be 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3103,3 +3103,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIGURATIONS, "Show Configurations") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS, "Show/hide the 'Configurations' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + "Show Help") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, + "Show/hide the 'Help' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 609427f86d..151b2a96e5 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -295,6 +295,7 @@ default_sublabel_macro(action_bind_sublabel_menu_show_load_core, default_sublabel_macro(action_bind_sublabel_menu_show_load_content, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT) default_sublabel_macro(action_bind_sublabel_menu_show_information, MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION) default_sublabel_macro(action_bind_sublabel_menu_show_configurations, MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS) +default_sublabel_macro(action_bind_sublabel_menu_show_help, MENU_ENUM_SUBLABEL_MENU_SHOW_HELP) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_show_core_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_music_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_MUSIC) @@ -616,6 +617,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_configurations); break; + case MENU_ENUM_LABEL_MENU_SHOW_HELP: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_help); + break; case MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_online_updater); break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index e9afd587e5..88306615ae 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4370,8 +4370,12 @@ static int xmb_list_push(void *data, void *userdata, menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); } - entry.enum_idx = MENU_ENUM_LABEL_HELP_LIST; - menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + if (settings->bools.menu_show_help) + { + entry.enum_idx = MENU_ENUM_LABEL_HELP_LIST; + menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + } + #if !defined(IOS) entry.enum_idx = MENU_ENUM_LABEL_QUIT_RETROARCH; menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index ac097ece22..b2ab173ecf 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5303,6 +5303,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_MENU_SHOW_HELP, + PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_XMB_SHOW_SETTINGS, PARSE_ONLY_BOOL, false); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 6c328c5093..4bef442601 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5439,6 +5439,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_LAKKA_ADVANCED); + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_show_help, + MENU_ENUM_LABEL_MENU_SHOW_HELP, + MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, + menu_show_help, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_LAKKA_ADVANCED); + CONFIG_BOOL( list, list_info, &settings->bools.menu_xmb_show_settings, diff --git a/msg_hash.h b/msg_hash.h index 7b7f484bc5..c43c328df8 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -676,6 +676,7 @@ enum msg_hash_enums MENU_LABEL(MENU_SHOW_LOAD_CONTENT), MENU_LABEL(MENU_SHOW_INFORMATION), MENU_LABEL(MENU_SHOW_CONFIGURATIONS), + MENU_LABEL(MENU_SHOW_HELP), MENU_LABEL(MENU_SHOW_ONLINE_UPDATER), MENU_LABEL(MENU_SHOW_CORE_UPDATER), MENU_LABEL(RUN_MUSIC), From 9db0e9dbc6610546b717ad1851f892b79cb59314 Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Fri, 6 Oct 2017 09:27:42 +0200 Subject: [PATCH 20/24] Implemented setting for showing/hiding the "Quit RetroArch" option in XMB. The setting is only shown on Lakka. --- config.def.h | 1 + configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/drivers/xmb.c | 7 +++++-- menu/menu_displaylist.c | 6 ++++++ menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 23 files changed, 94 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index e6179239dd..d9090f2a1c 100644 --- a/config.def.h +++ b/config.def.h @@ -242,6 +242,7 @@ static bool menu_show_load_content = true; static bool menu_show_information = true; static bool menu_show_configurations = true; static bool menu_show_help = true; +static bool menu_show_quit_retroarch = true; #if defined(HAVE_LAKKA) || defined(VITA) static bool menu_show_core_updater = false; diff --git a/configuration.c b/configuration.c index 74f58691e8..c682b702f7 100644 --- a/configuration.c +++ b/configuration.c @@ -1207,6 +1207,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("menu_show_information", &settings->bools.menu_show_information, true, menu_show_information, false); SETTING_BOOL("menu_show_configurations", &settings->bools.menu_show_configurations, true, menu_show_configurations, false); SETTING_BOOL("menu_show_help", &settings->bools.menu_show_help, true, menu_show_help, false); + SETTING_BOOL("menu_show_quit_retroarch", &settings->bools.menu_show_quit_retroarch, true, menu_show_quit_retroarch, false); SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false); SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false); #ifdef HAVE_FFMPEG diff --git a/configuration.h b/configuration.h index 9d22c13957..43c54e88d5 100644 --- a/configuration.h +++ b/configuration.h @@ -132,6 +132,7 @@ typedef struct settings bool menu_show_information; bool menu_show_configurations; bool menu_show_help; + bool menu_show_quit_retroarch; bool menu_materialui_icons_enable; bool menu_xmb_shadows_enable; bool menu_xmb_show_settings; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index fb2401229f..80eda193ef 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3083,3 +3083,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 5325346cfc..ce10c5326b 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3083,3 +3083,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 5982dcaf6d..3eabccf4ee 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3077,3 +3077,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index c266ae7a1d..7500caa643 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2946,3 +2946,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index f91c903962..0344491dcb 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3115,3 +3115,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 4ace0b71a5..ff5dc77ff3 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3169,3 +3169,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index d174d166f8..58ab796678 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3085,3 +3085,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 586da82360..5fe3086e48 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3078,3 +3078,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 941d9885c3..397b78d2c7 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1315,3 +1315,5 @@ MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_CONFIGURATIONS, "menu_show_configurations") MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_HELP, "menu_show_help") +MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH, + "menu_show_quit_retroarch") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 49e94e74b0..7aa9cab089 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2946,3 +2946,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index ccd8055111..871a3e35d2 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -4018,3 +4018,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index ef16c2d259..108444d325 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3053,3 +3053,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index a262bc0bce..a70f13fcc1 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3136,3 +3136,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index ec4478ef68..731ea7587b 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3171,3 +3171,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 627de0e9be..fffff6b38b 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3107,3 +3107,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_HELP, "Show Help") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_HELP, "Show/hide the 'Help' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + "Show Quit RetroArch") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, + "Show/hide the 'Quit RetroArch' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 151b2a96e5..3325833008 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -296,6 +296,7 @@ default_sublabel_macro(action_bind_sublabel_menu_show_load_content, default_sublabel_macro(action_bind_sublabel_menu_show_information, MENU_ENUM_SUBLABEL_MENU_SHOW_INFORMATION) default_sublabel_macro(action_bind_sublabel_menu_show_configurations, MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS) default_sublabel_macro(action_bind_sublabel_menu_show_help, MENU_ENUM_SUBLABEL_MENU_SHOW_HELP) +default_sublabel_macro(action_bind_sublabel_menu_show_quit_retroarch, MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_show_core_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_music_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_MUSIC) @@ -620,6 +621,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MENU_SHOW_HELP: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_help); break; + case MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_quit_retroarch); + break; case MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_online_updater); break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 88306615ae..41d2e46be2 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4377,8 +4377,11 @@ static int xmb_list_push(void *data, void *userdata, } #if !defined(IOS) - entry.enum_idx = MENU_ENUM_LABEL_QUIT_RETROARCH; - menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + if (settings->bools.menu_show_quit_retroarch) + { + entry.enum_idx = MENU_ENUM_LABEL_QUIT_RETROARCH; + menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + } #endif entry.enum_idx = MENU_ENUM_LABEL_REBOOT; menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index b2ab173ecf..42a410c972 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5307,6 +5307,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_MENU_SHOW_HELP, PARSE_ONLY_BOOL, false); +#if defined(HAVE_LAKKA) + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH, + PARSE_ONLY_BOOL, false); +#endif + menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_XMB_SHOW_SETTINGS, PARSE_ONLY_BOOL, false); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 4bef442601..bff186e7d7 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5454,6 +5454,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_LAKKA_ADVANCED); + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_show_quit_retroarch, + MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH, + MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, + menu_show_quit_retroarch, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + CONFIG_BOOL( list, list_info, &settings->bools.menu_xmb_show_settings, diff --git a/msg_hash.h b/msg_hash.h index c43c328df8..6d83271e99 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -677,6 +677,7 @@ enum msg_hash_enums MENU_LABEL(MENU_SHOW_INFORMATION), MENU_LABEL(MENU_SHOW_CONFIGURATIONS), MENU_LABEL(MENU_SHOW_HELP), + MENU_LABEL(MENU_SHOW_QUIT_RETROARCH), MENU_LABEL(MENU_SHOW_ONLINE_UPDATER), MENU_LABEL(MENU_SHOW_CORE_UPDATER), MENU_LABEL(RUN_MUSIC), From 83991d6c3607bd70003e744e08dbc9509bd01064 Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Fri, 6 Oct 2017 09:40:41 +0200 Subject: [PATCH 21/24] Implemented setting for showing/hiding the "Reboot" option in XMB. The setting is only shown on Lakka. --- config.def.h | 1 + configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/drivers/xmb.c | 8 ++++++-- menu/menu_displaylist.c | 4 ++++ menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 23 files changed, 93 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index d9090f2a1c..1a62bd6b5e 100644 --- a/config.def.h +++ b/config.def.h @@ -243,6 +243,7 @@ static bool menu_show_information = true; static bool menu_show_configurations = true; static bool menu_show_help = true; static bool menu_show_quit_retroarch = true; +static bool menu_show_reboot = true; #if defined(HAVE_LAKKA) || defined(VITA) static bool menu_show_core_updater = false; diff --git a/configuration.c b/configuration.c index c682b702f7..b10864ea69 100644 --- a/configuration.c +++ b/configuration.c @@ -1208,6 +1208,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("menu_show_configurations", &settings->bools.menu_show_configurations, true, menu_show_configurations, false); SETTING_BOOL("menu_show_help", &settings->bools.menu_show_help, true, menu_show_help, false); SETTING_BOOL("menu_show_quit_retroarch", &settings->bools.menu_show_quit_retroarch, true, menu_show_quit_retroarch, false); + SETTING_BOOL("menu_show_reboot", &settings->bools.menu_show_reboot, true, menu_show_reboot, false); SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false); SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false); #ifdef HAVE_FFMPEG diff --git a/configuration.h b/configuration.h index 43c54e88d5..f539bcf7f4 100644 --- a/configuration.h +++ b/configuration.h @@ -133,6 +133,7 @@ typedef struct settings bool menu_show_configurations; bool menu_show_help; bool menu_show_quit_retroarch; + bool menu_show_reboot; bool menu_materialui_icons_enable; bool menu_xmb_shadows_enable; bool menu_xmb_show_settings; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 80eda193ef..a726b0090d 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3087,3 +3087,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index ce10c5326b..f57afd44e2 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3087,3 +3087,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 3eabccf4ee..a449d09abe 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3081,3 +3081,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 7500caa643..b17474899d 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2950,3 +2950,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 0344491dcb..e152d427f9 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3119,3 +3119,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index ff5dc77ff3..4bf367169e 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3173,3 +3173,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 58ab796678..269189209b 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3089,3 +3089,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 5fe3086e48..f96a19285f 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3082,3 +3082,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 397b78d2c7..6884a57d90 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1317,3 +1317,5 @@ MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_HELP, "menu_show_help") MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH, "menu_show_quit_retroarch") +MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_REBOOT, + "menu_show_reboot") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 7aa9cab089..58426fee8d 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2950,3 +2950,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 871a3e35d2..616d7ed9b2 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -4024,3 +4024,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 108444d325..9d7ba6ca0e 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3057,3 +3057,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index a70f13fcc1..b33c9e0629 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3140,3 +3140,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 731ea7587b..e6d133105e 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3175,3 +3175,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index fffff6b38b..82bff00906 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3111,3 +3111,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_QUIT_RETROARCH, "Show Quit RetroArch") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH, "Show/hide the 'Quit RetroArch' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + "Show Reboot") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT, + "Show/hide the 'Reboot' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 3325833008..e7572c2680 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -297,6 +297,7 @@ default_sublabel_macro(action_bind_sublabel_menu_show_information, default_sublabel_macro(action_bind_sublabel_menu_show_configurations, MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIGURATIONS) default_sublabel_macro(action_bind_sublabel_menu_show_help, MENU_ENUM_SUBLABEL_MENU_SHOW_HELP) default_sublabel_macro(action_bind_sublabel_menu_show_quit_retroarch, MENU_ENUM_SUBLABEL_MENU_SHOW_QUIT_RETROARCH) +default_sublabel_macro(action_bind_sublabel_menu_show_reboot, MENU_ENUM_SUBLABEL_MENU_SHOW_REBOOT) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_show_core_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER) default_sublabel_macro(action_bind_sublabel_menu_music_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_MUSIC) @@ -624,6 +625,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_quit_retroarch); break; + case MENU_ENUM_LABEL_MENU_SHOW_REBOOT: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_reboot); + break; case MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_online_updater); break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 41d2e46be2..ef6b4a71fa 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4383,8 +4383,12 @@ static int xmb_list_push(void *data, void *userdata, menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); } #endif - entry.enum_idx = MENU_ENUM_LABEL_REBOOT; - menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + + if (settings->bools.menu_show_reboot) + { + entry.enum_idx = MENU_ENUM_LABEL_REBOOT; + menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); + } entry.enum_idx = MENU_ENUM_LABEL_SHUTDOWN; menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 42a410c972..33adef9feb 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5311,6 +5311,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_MENU_SHOW_QUIT_RETROARCH, PARSE_ONLY_BOOL, false); + + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_MENU_SHOW_REBOOT, + PARSE_ONLY_BOOL, false); #endif menu_displaylist_parse_settings_enum(menu, info, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index bff186e7d7..3e2fee6e1a 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5469,6 +5469,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_show_reboot, + MENU_ENUM_LABEL_MENU_SHOW_REBOOT, + MENU_ENUM_LABEL_VALUE_MENU_SHOW_REBOOT, + menu_show_reboot, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + CONFIG_BOOL( list, list_info, &settings->bools.menu_xmb_show_settings, diff --git a/msg_hash.h b/msg_hash.h index 6d83271e99..93ca531ba4 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -678,6 +678,7 @@ enum msg_hash_enums MENU_LABEL(MENU_SHOW_CONFIGURATIONS), MENU_LABEL(MENU_SHOW_HELP), MENU_LABEL(MENU_SHOW_QUIT_RETROARCH), + MENU_LABEL(MENU_SHOW_REBOOT), MENU_LABEL(MENU_SHOW_ONLINE_UPDATER), MENU_LABEL(MENU_SHOW_CORE_UPDATER), MENU_LABEL(RUN_MUSIC), From 5c46e176d5836dce4d6df2644544fae65850d0f6 Mon Sep 17 00:00:00 2001 From: Zoran Vuckovic Date: Sat, 7 Oct 2017 06:59:45 +0200 Subject: [PATCH 22/24] Add keyboard/mouse device index logging --- input/drivers/udev_input.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index 89a4e5da95..01600ecdea 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -903,6 +903,7 @@ static bool open_devices(udev_input_t *udev, struct udev_list_entry *devs = NULL; struct udev_list_entry *item = NULL; struct udev_enumerate *enumerate = udev_enumerate_new(udev->udev); + int device_index = 0; if (!enumerate) return false; @@ -926,11 +927,13 @@ static bool open_devices(udev_input_t *udev, if (fd != -1) { - RARCH_LOG("[udev] Adding device %s as type %s.\n", - devnode, type_str); if (!udev_input_add_device(udev, type, devnode, cb)) RARCH_ERR("[udev] Failed to open device: %s (%s).\n", devnode, strerror(errno)); + else + RARCH_LOG("[udev]: %s #%d (%s).\n", + type == UDEV_INPUT_KEYBOARD ? "Keyboard" : "Mouse", + device_index++, devnode); close(fd); } } From 84701efd243fc10058f685fe3b148c54e05b03fc Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Sat, 7 Oct 2017 13:50:31 +0200 Subject: [PATCH 23/24] Don't hide option for showing/hiding "Online Updater" on Lakka. --- menu/menu_displaylist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 33adef9feb..c981a315d7 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5286,13 +5286,15 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT, PARSE_ONLY_BOOL, false); -#if defined(HAVE_NETWORKING) && !defined(HAVE_LAKKA) +#if defined(HAVE_NETWORKING) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER, PARSE_ONLY_BOOL, false); +#if !defined(HAVE_LAKKA) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_MENU_SHOW_CORE_UPDATER, PARSE_ONLY_BOOL, false); +#endif #endif menu_displaylist_parse_settings_enum(menu, info, From 6a5ad56bc6a918a853b4140ba3a5ed1f98eefbd3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 7 Oct 2017 17:19:20 +0200 Subject: [PATCH 24/24] Start undoing C++ comments --- gfx/include/d3d9.h | 8 +- gfx/include/d3d9/d3dx9.h | 29 ++- gfx/include/d3d9/d3dx9anim.h | 361 ++++++++++++++++++----------------- 3 files changed, 197 insertions(+), 201 deletions(-) diff --git a/gfx/include/d3d9.h b/gfx/include/d3d9.h index 45ee23e02f..9c9991080e 100644 --- a/gfx/include/d3d9.h +++ b/gfx/include/d3d9.h @@ -12,9 +12,9 @@ #ifndef DIRECT3D_VERSION #define DIRECT3D_VERSION 0x0900 -#endif //DIRECT3D_VERSION +#endif /* DIRECT3D_VERSION */ -// include this file content only if compiling for DX9 interfaces +/* include this file content only if compiling for DX9 interfaces */ #if(DIRECT3D_VERSION >= 0x0900) @@ -51,11 +51,11 @@ DEFINE_GUID(IID_IDirect3D9, 0x81bdcbca, 0x64d4, 0x426d, 0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c); /* IID_IDirect3DDevice9 */ -// {D0223B96-BF7A-43fd-92BD-A43B0D82B9EB} */ +/* {D0223B96-BF7A-43fd-92BD-A43B0D82B9EB} */ DEFINE_GUID(IID_IDirect3DDevice9, 0xd0223b96, 0xbf7a, 0x43fd, 0x92, 0xbd, 0xa4, 0x3b, 0xd, 0x82, 0xb9, 0xeb); /* IID_IDirect3DResource9 */ -// {05EEC05D-8F7D-4362-B999-D1BAF357C704} +/* {05EEC05D-8F7D-4362-B999-D1BAF357C704} */ DEFINE_GUID(IID_IDirect3DResource9, 0x5eec05d, 0x8f7d, 0x4362, 0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x4); /* IID_IDirect3DBaseTexture9 */ diff --git a/gfx/include/d3d9/d3dx9.h b/gfx/include/d3d9/d3dx9.h index f1a00bb971..e2d40f1aff 100644 --- a/gfx/include/d3d9/d3dx9.h +++ b/gfx/include/d3d9/d3dx9.h @@ -1,11 +1,11 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9.h -// Content: D3DX utility library -// -////////////////////////////////////////////////////////////////////////////// +/* + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3dx9.h + * Content: D3DX utility library + * + */ #ifdef __D3DX_INTERNAL__ #error Incorrect D3DX header used @@ -14,8 +14,7 @@ #ifndef __D3DX9_H__ #define __D3DX9_H__ - -// Defines +/* Defines */ #include #define D3DX_DEFAULT ((UINT) -1) @@ -40,9 +39,7 @@ #endif #endif - - -// Includes +/* Includes */ #include "d3d9.h" #include "d3dx9math.h" #include "d3dx9core.h" @@ -55,9 +52,7 @@ #include "d3dx9shape.h" #include "d3dx9anim.h" - - -// Errors +/* Errors */ #define _FACDD 0x876 #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) @@ -74,4 +69,4 @@ enum _D3DXERR { }; -#endif //__D3DX9_H__ +#endif /*__D3DX9_H__ */ diff --git a/gfx/include/d3d9/d3dx9anim.h b/gfx/include/d3d9/d3dx9anim.h index 33d52eb0ee..ecdabdc52c 100644 --- a/gfx/include/d3d9/d3dx9anim.h +++ b/gfx/include/d3d9/d3dx9anim.h @@ -1,28 +1,27 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dx9anim.h -// Content: D3DX mesh types and functions -// -////////////////////////////////////////////////////////////////////////////// +/* + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3dx9anim.h + * Content: D3DX mesh types and functions + */ #ifndef __D3DX9ANIM_H__ #define __D3DX9ANIM_H__ -// {698CFB3F-9289-4d95-9A57-33A94B5A65F9} +/* {698CFB3F-9289-4d95-9A57-33A94B5A65F9} */ DEFINE_GUID(IID_ID3DXAnimationSet, 0x698cfb3f, 0x9289, 0x4d95, 0x9a, 0x57, 0x33, 0xa9, 0x4b, 0x5a, 0x65, 0xf9); -// {FA4E8E3A-9786-407d-8B4C-5995893764AF} +/* {FA4E8E3A-9786-407d-8B4C-5995893764AF} */ DEFINE_GUID(IID_ID3DXKeyframedAnimationSet, 0xfa4e8e3a, 0x9786, 0x407d, 0x8b, 0x4c, 0x59, 0x95, 0x89, 0x37, 0x64, 0xaf); -// {6CC2480D-3808-4739-9F88-DE49FACD8D4C} +/* {6CC2480D-3808-4739-9F88-DE49FACD8D4C} */ DEFINE_GUID(IID_ID3DXCompressedAnimationSet, 0x6cc2480d, 0x3808, 0x4739, 0x9f, 0x88, 0xde, 0x49, 0xfa, 0xcd, 0x8d, 0x4c); -// {AC8948EC-F86D-43e2-96DE-31FC35F96D9E} +/* {AC8948EC-F86D-43e2-96DE-31FC35F96D9E} */ DEFINE_GUID(IID_ID3DXAnimationController, 0xac8948ec, 0xf86d, 0x43e2, 0x96, 0xde, 0x31, 0xfc, 0x35, 0xf9, 0x6d, 0x9e); @@ -134,20 +133,20 @@ DECLARE_INTERFACE(ID3DXSaveUserData) LPD3DXFILESAVEOBJECT pXofSave, LPD3DXFILESAVEDATA pXofMeshData) PURE; - // NOTE: this is called once per Save. All top level objects should be added using the - // provided interface. One call adds objects before the frame hierarchy, the other after + /* NOTE: this is called once per Save. All top level objects should be added using the + * provided interface. One call adds objects before the frame hierarchy, the other after */ STDMETHOD(AddTopLevelDataObjectsPre)(LPD3DXFILESAVEOBJECT pXofSave) PURE; STDMETHOD(AddTopLevelDataObjectsPost)(LPD3DXFILESAVEOBJECT pXofSave) PURE; - // callbacks for the user to register and then save templates to the XFile + /* callbacks for the user to register and then save templates to the XFile */ STDMETHOD(RegisterTemplates)(LPD3DXFILE pXFileApi) PURE; STDMETHOD(SaveTemplates)(LPD3DXFILESAVEOBJECT pXofSave) PURE; }; typedef enum _D3DXCALLBACK_SEARCH_FLAGS { - D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION = 0x01, // exclude callbacks at the initial position from the search - D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION = 0x02, // reverse the callback search direction + D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION = 0x01, /* exclude callbacks at the initial position from the search */ + D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION = 0x02, /* reverse the callback search direction */ D3DXCALLBACK_SEARCH_FORCE_DWORD = 0x7fffffff, } D3DXCALLBACK_SEARCH_FLAGS; @@ -160,37 +159,37 @@ typedef interface ID3DXAnimationSet *LPD3DXANIMATIONSET; DECLARE_INTERFACE_(ID3DXAnimationSet, IUnknown) { - // IUnknown + /* IUnknown */ STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; - // Name + /* Name */ STDMETHOD_(LPCSTR, GetName)(THIS) PURE; - // Period + /* Period */ STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; - STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; /* Maps position into animation period */ - // Animation names + /* Animation names */ STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; - // SRT + /* SRT */ STDMETHOD(GetSRT)(THIS_ - DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) - UINT Animation, // Animation index - D3DXVECTOR3 *pScale, // Returns the scale - D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion - D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + DOUBLE PeriodicPosition, /* Position mapped to period (use GetPeriodicPosition) */ + UINT Animation, /* Animation index */ + D3DXVECTOR3 *pScale, /* Returns the scale */ + D3DXQUATERNION *pRotation, /* Returns the rotation as a quaternion */ + D3DXVECTOR3 *pTranslation) PURE; /* Returns the translation */ - // Callbacks + /* Callbacks */ STDMETHOD(GetCallback)(THIS_ - DOUBLE Position, // Position from which to find callbacks - DWORD Flags, // Callback search flags - DOUBLE *pCallbackPosition, // Returns the position of the callback - LPVOID *ppCallbackData) PURE; // Returns the callback data pointer + DOUBLE Position, /* Position from which to find callbacks */ + DWORD Flags, /* Callback search flags */ + DOUBLE *pCallbackPosition, /* Returns the position of the callback */ + LPVOID *ppCallbackData) PURE; /* Returns the callback data pointer */ }; typedef enum _D3DXPLAYBACK_TYPE @@ -235,98 +234,98 @@ typedef interface ID3DXKeyframedAnimationSet *LPD3DXKEYFRAMEDANIMATIONSET; DECLARE_INTERFACE_(ID3DXKeyframedAnimationSet, ID3DXAnimationSet) { - // ID3DXAnimationSet + /* ID3DXAnimationSet */ STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; - // Name + /* Name */ STDMETHOD_(LPCSTR, GetName)(THIS) PURE; - // Period + /* Period */ STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; - STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; /* Maps position into animation period */ - // Animation names + /* Animation names */ STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; - // SRT + /* SRT */ STDMETHOD(GetSRT)(THIS_ - DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) - UINT Animation, // Animation index - D3DXVECTOR3 *pScale, // Returns the scale - D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion - D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + DOUBLE PeriodicPosition, /* Position mapped to period (use GetPeriodicPosition) */ + UINT Animation, /* Animation index */ + D3DXVECTOR3 *pScale, /* Returns the scale */ + D3DXQUATERNION *pRotation, /* Returns the rotation as a quaternion */ + D3DXVECTOR3 *pTranslation) PURE; /* Returns the translation */ - // Callbacks + /* Callbacks */ STDMETHOD(GetCallback)(THIS_ - DOUBLE Position, // Position from which to find callbacks - DWORD Flags, // Callback search flags - DOUBLE *pCallbackPosition, // Returns the position of the callback - LPVOID *ppCallbackData) PURE; // Returns the callback data pointer + DOUBLE Position, /* Position from which to find callbacks */ + DWORD Flags, /* Callback search flags */ + DOUBLE *pCallbackPosition, /* Returns the position of the callback */ + LPVOID *ppCallbackData) PURE; /* Returns the callback data pointer */ - // Playback + /* Playback */ STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; - // Scale keys + /* Scale keys */ STDMETHOD_(UINT, GetNumScaleKeys)(THIS_ UINT Animation) PURE; STDMETHOD(GetScaleKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pScaleKeys) PURE; STDMETHOD(GetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE; STDMETHOD(SetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE; - // Rotation keys + /* Rotation keys */ STDMETHOD_(UINT, GetNumRotationKeys)(THIS_ UINT Animation) PURE; STDMETHOD(GetRotationKeys)(THIS_ UINT Animation, LPD3DXKEY_QUATERNION pRotationKeys) PURE; STDMETHOD(GetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE; STDMETHOD(SetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE; - // Translation keys + /* Translation keys */ STDMETHOD_(UINT, GetNumTranslationKeys)(THIS_ UINT Animation) PURE; STDMETHOD(GetTranslationKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pTranslationKeys) PURE; STDMETHOD(GetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE; STDMETHOD(SetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE; - // Callback keys + /* Callback keys */ STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE; STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE; STDMETHOD(GetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE; STDMETHOD(SetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE; - // Key removal methods. These are slow, and should not be used once the animation starts playing + /* Key removal methods. These are slow, and should not be used once the animation starts playing */ STDMETHOD(UnregisterScaleKey)(THIS_ UINT Animation, UINT Key) PURE; STDMETHOD(UnregisterRotationKey)(THIS_ UINT Animation, UINT Key) PURE; STDMETHOD(UnregisterTranslationKey)(THIS_ UINT Animation, UINT Key) PURE; - // One-time animaton SRT keyframe registration + /* One-time animaton SRT keyframe registration */ STDMETHOD(RegisterAnimationSRTKeys)(THIS_ - LPCSTR pName, // Animation name - UINT NumScaleKeys, // Number of scale keys - UINT NumRotationKeys, // Number of rotation keys - UINT NumTranslationKeys, // Number of translation keys - CONST D3DXKEY_VECTOR3 *pScaleKeys, // Array of scale keys - CONST D3DXKEY_QUATERNION *pRotationKeys, // Array of rotation keys - CONST D3DXKEY_VECTOR3 *pTranslationKeys, // Array of translation keys - DWORD *pAnimationIndex) PURE; // Returns the animation index + LPCSTR pName, /* Animation name */ + UINT NumScaleKeys, /* Number of scale keys */ + UINT NumRotationKeys, /* Number of rotation keys */ + UINT NumTranslationKeys, /* Number of translation keys */ + CONST D3DXKEY_VECTOR3 *pScaleKeys, /* Array of scale keys */ + CONST D3DXKEY_QUATERNION *pRotationKeys, /* Array of rotation keys */ + CONST D3DXKEY_VECTOR3 *pTranslationKeys, /* Array of translation keys */ + DWORD *pAnimationIndex) PURE; /* Returns the animation index */ - // Compression + /* Compression */ STDMETHOD(Compress)(THIS_ - DWORD Flags, // Compression flags (use D3DXCOMPRESS_STRONG for better results) - FLOAT Lossiness, // Compression loss ratio in the [0, 1] range - LPD3DXFRAME pHierarchy, // Frame hierarchy (optional) - LPD3DXBUFFER *ppCompressedData) PURE; // Returns the compressed animation set + DWORD Flags, /* Compression flags (use D3DXCOMPRESS_STRONG for better results) */ + FLOAT Lossiness, /* Compression loss ratio in the [0, 1] range */ + LPD3DXFRAME pHierarchy, /* Frame hierarchy (optional) */ + LPD3DXBUFFER *ppCompressedData) PURE; /* Returns the compressed animation set */ STDMETHOD(UnregisterAnimation)(THIS_ UINT Index) PURE; }; -//---------------------------------------------------------------------------- -// ID3DXCompressedAnimationSet: -// ---------------------------- -// This interface implements a compressed keyframed animation set. -//---------------------------------------------------------------------------- +/* + * ID3DXCompressedAnimationSet: + * ---------------------------- + * This interface implements a compressed keyframed animation set. + */ typedef interface ID3DXCompressedAnimationSet ID3DXCompressedAnimationSet; typedef interface ID3DXCompressedAnimationSet *LPD3DXCOMPRESSEDANIMATIONSET; @@ -335,54 +334,54 @@ typedef interface ID3DXCompressedAnimationSet *LPD3DXCOMPRESSEDANIMATIONSET; DECLARE_INTERFACE_(ID3DXCompressedAnimationSet, ID3DXAnimationSet) { - // ID3DXAnimationSet + /* ID3DXAnimationSet */ STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; - // Name + /* Name */ STDMETHOD_(LPCSTR, GetName)(THIS) PURE; - // Period + /* Period */ STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; - STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; /* Maps position into animation period */ - // Animation names + /* Animation names */ STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; - // SRT + /* SRT */ STDMETHOD(GetSRT)(THIS_ - DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) - UINT Animation, // Animation index - D3DXVECTOR3 *pScale, // Returns the scale - D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion - D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + DOUBLE PeriodicPosition, /* Position mapped to period (use GetPeriodicPosition) */ + UINT Animation, /* Animation index */ + D3DXVECTOR3 *pScale, /* Returns the scale */ + D3DXQUATERNION *pRotation, /* Returns the rotation as a quaternion */ + D3DXVECTOR3 *pTranslation) PURE; /* Returns the translation */ - // Callbacks + /* Callbacks */ STDMETHOD(GetCallback)(THIS_ - DOUBLE Position, // Position from which to find callbacks - DWORD Flags, // Callback search flags - DOUBLE *pCallbackPosition, // Returns the position of the callback - LPVOID *ppCallbackData) PURE; // Returns the callback data pointer + DOUBLE Position, /* Position from which to find callbacks */ + DWORD Flags, /* Callback search flags */ + DOUBLE *pCallbackPosition, /* Returns the position of the callback */ + LPVOID *ppCallbackData) PURE; /* Returns the callback data pointer */ - // Playback + /* Playback */ STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; - // Scale keys + /* Scale keys */ STDMETHOD(GetCompressedData)(THIS_ LPD3DXBUFFER *ppCompressedData) PURE; - // Callback keys + /* Callback keys */ STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE; STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE; }; typedef enum _D3DXPRIORITY_TYPE { - D3DXPRIORITY_LOW = 0, // This track should be blended with all low priority tracks before mixed with the high priority result - D3DXPRIORITY_HIGH = 1, // This track should be blended with all high priority tracks before mixed with the low priority result + D3DXPRIORITY_LOW = 0, /* This track should be blended with all low priority tracks before mixed with the high priority result */ + D3DXPRIORITY_HIGH = 1, /* This track should be blended with all high priority tracks before mixed with the low priority result */ D3DXPRIORITY_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ } D3DXPRIORITY_TYPE; @@ -453,18 +452,18 @@ typedef interface ID3DXAnimationController *LPD3DXANIMATIONCONTROLLER; DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) { - // IUnknown + /* IUnknown */ STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; - // Max sizes + /* Max sizes */ STDMETHOD_(UINT, GetMaxNumAnimationOutputs)(THIS) PURE; STDMETHOD_(UINT, GetMaxNumAnimationSets)(THIS) PURE; STDMETHOD_(UINT, GetMaxNumTracks)(THIS) PURE; STDMETHOD_(UINT, GetMaxNumEvents)(THIS) PURE; - // Animation output registration + /* Animation output registration */ STDMETHOD(RegisterAnimationOutput)(THIS_ LPCSTR pName, D3DXMATRIX *pMatrix, @@ -472,7 +471,7 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) D3DXQUATERNION *pRotation, D3DXVECTOR3 *pTranslation) PURE; - // Animation set registration + /* Animation set registration */ STDMETHOD(RegisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE; STDMETHOD(UnregisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE; @@ -480,12 +479,12 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) STDMETHOD(GetAnimationSet)(THIS_ UINT Index, LPD3DXANIMATIONSET *ppAnimationSet) PURE; STDMETHOD(GetAnimationSetByName)(THIS_ LPCSTR szName, LPD3DXANIMATIONSET *ppAnimationSet) PURE; - // Global time + /* Global time */ STDMETHOD(AdvanceTime)(THIS_ DOUBLE TimeDelta, LPD3DXANIMATIONCALLBACKHANDLER pCallbackHandler) PURE; STDMETHOD(ResetTime)(THIS) PURE; STDMETHOD_(DOUBLE, GetTime)(THIS) PURE; - // Tracks + /* Tracks */ STDMETHOD(SetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET pAnimSet) PURE; STDMETHOD(GetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET *ppAnimSet) PURE; @@ -499,11 +498,11 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) STDMETHOD(SetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE; STDMETHOD(GetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE; - // Priority blending + /* Priority blending */ STDMETHOD(SetPriorityBlend)(THIS_ FLOAT BlendWeight) PURE; STDMETHOD_(FLOAT, GetPriorityBlend)(THIS) PURE; - // Event keying + /* Event keying */ STDMETHOD_(D3DXEVENTHANDLE, KeyTrackSpeed)(THIS_ UINT Track, FLOAT NewSpeed, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; STDMETHOD_(D3DXEVENTHANDLE, KeyTrackWeight)(THIS_ UINT Track, FLOAT NewWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; STDMETHOD_(D3DXEVENTHANDLE, KeyTrackPosition)(THIS_ UINT Track, DOUBLE NewPosition, DOUBLE StartTime) PURE; @@ -511,13 +510,13 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) STDMETHOD_(D3DXEVENTHANDLE, KeyPriorityBlend)(THIS_ FLOAT NewBlendWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; - // Event unkeying + /* Event unkeying */ STDMETHOD(UnkeyEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE; STDMETHOD(UnkeyAllTrackEvents)(THIS_ UINT Track) PURE; STDMETHOD(UnkeyAllPriorityBlends)(THIS) PURE; - // Event enumeration + /* Event enumeration */ STDMETHOD_(D3DXEVENTHANDLE, GetCurrentTrackEvent)(THIS_ UINT Track, D3DXEVENT_TYPE EventType) PURE; STDMETHOD_(D3DXEVENTHANDLE, GetCurrentPriorityBlend)(THIS) PURE; @@ -528,7 +527,7 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) STDMETHOD(GetEventDesc)(THIS_ D3DXEVENTHANDLE hEvent, LPD3DXEVENT_DESC pDesc) PURE; - // Cloning + /* Cloning */ STDMETHOD(CloneAnimationController)(THIS_ UINT MaxNumAnimationOutputs, UINT MaxNumAnimationSets, @@ -539,7 +538,7 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) #ifdef __cplusplus extern "C" { -#endif //__cplusplus +#endif /* __cplusplus */ HRESULT WINAPI D3DXLoadMeshHierarchyFromXA @@ -638,38 +637,38 @@ D3DXFrameRegisterNamedMatrices LPD3DXANIMATIONCONTROLLER pAnimController ); -//---------------------------------------------------------------------------- -// D3DXFrameNumNamedMatrices: -// -------------------------- -// Counts number of frames in a subtree that have non-null names -// -// Parameters: -// pFrameRoot -// Pointer to the root node of the subtree -// Return Value: -// Count of frames -// -//---------------------------------------------------------------------------- +/* + * D3DXFrameNumNamedMatrices: + * -------------------------- + * Counts number of frames in a subtree that have non-null names + * + * Parameters: + * pFrameRoot + * Pointer to the root node of the subtree + * Return Value: + * Count of frames + * + */ UINT WINAPI D3DXFrameNumNamedMatrices ( CONST D3DXFRAME *pFrameRoot ); -//---------------------------------------------------------------------------- -// D3DXFrameCalculateBoundingSphere: -// --------------------------------- -// Computes the bounding sphere of all the meshes in the frame hierarchy. -// -// Parameters: -// pFrameRoot -// Pointer to the root node -// pObjectCenter -// Returns the center of the bounding sphere -// pObjectRadius -// Returns the radius of the bounding sphere -// -//---------------------------------------------------------------------------- +/* + * D3DXFrameCalculateBoundingSphere: + * --------------------------------- + * Computes the bounding sphere of all the meshes in the frame hierarchy. + * + * Parameters: + * pFrameRoot + * Pointer to the root node + * pObjectCenter + * Returns the center of the bounding sphere + * pObjectRadius + * Returns the radius of the bounding sphere + * + */ HRESULT WINAPI D3DXFrameCalculateBoundingSphere ( @@ -679,28 +678,29 @@ D3DXFrameCalculateBoundingSphere ); -//---------------------------------------------------------------------------- -// D3DXCreateKeyframedAnimationSet: -// -------------------------------- -// This function creates a compressable keyframed animations set interface. -// -// Parameters: -// pName -// Name of the animation set -// TicksPerSecond -// Number of keyframe ticks that elapse per second -// Playback -// Playback mode of keyframe looping -// NumAnimations -// Number of SRT animations -// NumCallbackKeys -// Number of callback keys -// pCallbackKeys -// Array of callback keys -// ppAnimationSet -// Returns the animation set interface -// -//----------------------------------------------------------------------------- +/* + * D3DXCreateKeyframedAnimationSet: + * -------------------------------- + * This function creates a compressable keyframed animations set interface. + * + * Parameters: + * pName + * Name of the animation set + * TicksPerSecond + * Number of keyframe ticks that elapse per second + * Playback + * Playback mode of keyframe looping + * NumAnimations + * Number of SRT animations + * NumCallbackKeys + * Number of callback keys + * pCallbackKeys + * Array of callback keys + * ppAnimationSet + * Returns the animation set interface + * + */ + HRESULT WINAPI D3DXCreateKeyframedAnimationSet ( @@ -714,29 +714,30 @@ D3DXCreateKeyframedAnimationSet ); -//---------------------------------------------------------------------------- -// D3DXCreateCompressedAnimationSet: -// -------------------------------- -// This function creates a compressed animations set interface from -// compressed data. -// -// Parameters: -// pName -// Name of the animation set -// TicksPerSecond -// Number of keyframe ticks that elapse per second -// Playback -// Playback mode of keyframe looping -// pCompressedData -// Compressed animation SRT data -// NumCallbackKeys -// Number of callback keys -// pCallbackKeys -// Array of callback keys -// ppAnimationSet -// Returns the animation set interface -// -//----------------------------------------------------------------------------- +/* + * D3DXCreateCompressedAnimationSet: + * -------------------------------- + * This function creates a compressed animations set interface from + * compressed data. + * + * Parameters: + * pName + * Name of the animation set + * TicksPerSecond + * Number of keyframe ticks that elapse per second + * Playback + * Playback mode of keyframe looping + * pCompressedData + * Compressed animation SRT data + * NumCallbackKeys + * Number of callback keys + * pCallbackKeys + * Array of callback keys + * ppAnimationSet + * Returns the animation set interface + * + */ + HRESULT WINAPI D3DXCreateCompressedAnimationSet ( @@ -762,6 +763,6 @@ D3DXCreateAnimationController #ifdef __cplusplus } -#endif //__cplusplus +#endif /*__cplusplus */ -#endif //__D3DX9ANIM_H__ +#endif /*__D3DX9ANIM_H__ */