diff --git a/libretro.cpp b/libretro.cpp index 2b33079a..02fce1ce 100644 --- a/libretro.cpp +++ b/libretro.cpp @@ -86,6 +86,7 @@ static retro_input_state_t input_state_cb; static unsigned frame_count = 0; static unsigned internal_frame_count = 0; static bool display_internal_framerate = false; +static bool display_notifications = true; static bool allow_frame_duping = false; static bool failed_init = false; static unsigned image_offset = 0; @@ -3986,6 +3987,17 @@ static void check_variables(bool startup) else display_internal_framerate = false; + var.key = BEETLE_OPT(display_osd); + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + if (strcmp(var.value, "enabled") == 0) + display_notifications = true; + else if (strcmp(var.value, "disabled") == 0) + display_notifications = false; + } + else + display_notifications = true; + var.key = BEETLE_OPT(crop_overscan); if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { @@ -5292,27 +5304,30 @@ void MDFND_DispMessage( enum retro_message_target target, enum retro_message_type type, const char *str) { - if (libretro_msg_interface_version >= 1) + if (display_notifications) { - struct retro_message_ext msg = { - str, - 3000, - priority, - level, - target, - type, - -1 - }; - environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE_EXT, &msg); - } - else - { - struct retro_message msg = + if (libretro_msg_interface_version >= 1) { - str, - 180 - }; - environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, &msg); + struct retro_message_ext msg = { + str, + 3000, + priority, + level, + target, + type, + -1 + }; + environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE_EXT, &msg); + } + else + { + struct retro_message msg = + { + str, + 180 + }; + environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, &msg); + } } } diff --git a/libretro_core_options.h b/libretro_core_options.h index bc73764d..b997b041 100644 --- a/libretro_core_options.h +++ b/libretro_core_options.h @@ -352,6 +352,20 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, "disabled" }, + { + BEETLE_OPT(display_osd), + "Display OSD Messages", + NULL, + "Display OSD messages generated by the core.", + NULL, + "osd", + { + { "enabled", NULL }, + { "disabled", NULL }, + { NULL, NULL }, + }, + "enabled" + }, #if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(HAVE_VULKAN) { BEETLE_OPT(display_vram),