コード例 #1
0
ファイル: runloop.c プロジェクト: alerinoreis/RetroArch
/* Checks if slowmotion toggle/hold was being pressed and/or held. */
static bool runloop_check_slowmotion(bool *ptr)
{
   settings_t *settings  = config_get_ptr();
   if (!ptr)
      return false;

   runloop_slowmotion   = *ptr;

   if (!runloop_slowmotion)
      return false;

   if (settings->video.black_frame_insertion)
      video_driver_cached_frame_render();

   if (state_manager_frame_is_reversed())
      runloop_msg_queue_push(msg_hash_to_str(MSG_SLOW_MOTION_REWIND), 0, 30, true);
   else
      runloop_msg_queue_push(msg_hash_to_str(MSG_SLOW_MOTION), 0, 30, true);
   return true;
}
コード例 #2
0
ファイル: command_event.c プロジェクト: AlexFolland/RetroArch
/**
 * event_save_state
 * @path            : Path to state.
 * @s               : Message.
 * @len             : Size of @s.
 *
 * Saves a state with path being @path.
 **/
static void event_save_state(const char *path,
      char *s, size_t len)
{
   settings_t *settings = config_get_ptr();

   if (!content_ctl(CONTENT_CTL_SAVE_STATE, (void*)path))
   {
      snprintf(s, len, "%s \"%s\".",
            msg_hash_to_str(MSG_FAILED_TO_SAVE_STATE_TO),
            path);
      return;
   }

   if (settings->state_slot < 0)
      snprintf(s, len, "%s #-1 (auto).",
            msg_hash_to_str(MSG_SAVED_STATE_TO_SLOT));
   else
      snprintf(s, len, "%s #%d.", msg_hash_to_str(MSG_SAVED_STATE_TO_SLOT),
            settings->state_slot);
}
コード例 #3
0
/**
 * take_screenshot:
 *
 * Returns: true (1) if successful, otherwise false (0).
 **/
bool take_screenshot(void)
{
   global_t *global           = global_get_ptr();
   char *name_base            = strdup(global->name.base);
   bool            is_paused  = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL);
   bool             ret       = take_screenshot_choice(name_base);
   const char *msg_screenshot = ret 
      ? msg_hash_to_str(MSG_TAKING_SCREENSHOT)  :
        msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT);
   const char *msg            = msg_screenshot;

   free(name_base);

   runloop_msg_queue_push(msg, 1, is_paused ? 1 : 180, true);

   if (is_paused)
      video_driver_cached_frame_render();

   return ret;
}
コード例 #4
0
ファイル: retroarch.c プロジェクト: blackman91/RetroArch
static void print_version(void)
{
   char str[PATH_MAX_LENGTH] = {0};

   fprintf(stderr, "%s: Frontend for libretro -- v%s", msg_hash_to_str(MSG_PROGRAM), PACKAGE_VERSION);
#ifdef HAVE_GIT_VERSION
   printf(" -- %s --\n", rarch_git_version);
#endif
   rarch_info_get_capabilities(RARCH_CAPABILITIES_COMPILER, str, sizeof(str));
   fprintf(stdout, "%s", str);
   fprintf(stdout, "Built: %s\n", __DATE__);
}
コード例 #5
0
ファイル: command.c プロジェクト: jeapostrophe/RetroArch
static void parse_sub_msg(rarch_cmd_t *handle, const char *tok)
{
   const char *arg = NULL;
   unsigned index  = 0;

   if (command_get_arg(tok, &arg, &index))
   {
      if (arg)
      {
         if (!action_map[index].action(arg))
            RARCH_ERR("Command \"%s\" failed.\n", arg);
      }
      else
         handle->state[map[index].id] = true;
   }
   else
      RARCH_WARN("%s \"%s\" %s.\n",
            msg_hash_to_str(MSG_UNRECOGNIZED_COMMAND),
            tok,
            msg_hash_to_str(MSG_RECEIVED));
}
コード例 #6
0
ファイル: command_event.c プロジェクト: Tobio12/RetroArch
/**
 * event_disk_control_append_image:
 * @path                 : Path to disk image.
 *
 * Appends disk image to disk image list.
 **/
static bool event_disk_control_append_image(const char *path)
{
   unsigned new_idx;
   char msg[128]                                      = {0};
   struct retro_game_info info                        = {0};
   global_t                                  *global  = global_get_ptr();
   const struct retro_disk_control_callback *control  = NULL;
   rarch_system_info_t                       *sysinfo = NULL;

   runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &sysinfo);

   if (sysinfo)
      control = (const struct retro_disk_control_callback*)
         &sysinfo->disk_control_cb;

   if (!control)
      return false;

   event_disk_control_set_eject(true, false);

   control->add_image_index();
   new_idx = control->get_num_images();
   if (!new_idx)
      return false;
   new_idx--;

   info.path = path;
   control->replace_image_index(new_idx, &info);

   snprintf(msg, sizeof(msg), "%s: ", msg_hash_to_str(MSG_APPENDED_DISK));
   strlcat(msg, path, sizeof(msg));
   RARCH_LOG("%s\n", msg);
   runloop_msg_queue_push(msg, 0, 180, true);

   event_cmd_ctl(EVENT_CMD_AUTOSAVE_DEINIT, NULL);

   /* TODO: Need to figure out what to do with subsystems case. */
   if (!*global->subsystem)
   {
      /* Update paths for our new image.
       * If we actually use append_image, we assume that we
       * started out in a single disk case, and that this way
       * of doing it makes the most sense. */
      rarch_ctl(RARCH_CTL_SET_PATHS, (void*)path);
      rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL);
   }

   event_cmd_ctl(EVENT_CMD_AUTOSAVE_INIT, NULL);
   event_disk_control_set_index(new_idx);
   event_disk_control_set_eject(false, false);

   return true;
}
コード例 #7
0
ShaderParamsDialog::ShaderParamsDialog(QWidget *parent) :
   QDialog(parent)
   ,m_layout()
   ,m_scrollArea()
{
   setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS));
   setObjectName("shaderParamsDialog");

   resize(720, 480);

   QTimer::singleShot(0, this, SLOT(clearLayout()));
}
コード例 #8
0
QString ShaderParamsDialog::getFilterLabel(unsigned filter)
{
   QString filterString;

   switch (filter)
   {
      case 0:
         filterString = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DONT_CARE);
         break;
      case 1:
         filterString = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LINEAR);
         break;
      case 2:
         filterString = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NEAREST);
         break;
      default:
         break;
   }

   return filterString;
}
コード例 #9
0
int menu_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
      const char *path, const char *label, unsigned type, size_t idx,
      const char *menu_label,
      uint32_t label_hash)
{
   if (!cbs)
      return menu_cbs_exit();

   BIND_ACTION_RIGHT(cbs, bind_right_generic);
    
   if (type == MENU_SETTING_NO_ITEM)
   {
      if (  string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB))   ||
            string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)) ||
            string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)) ||
            string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU)) ||
            string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU)) ||
            string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS_TAB))
         )
      {
            BIND_ACTION_RIGHT(cbs, action_right_mainmenu);
            return 0;
      }
   }

   if (menu_cbs_init_bind_right_compare_label(cbs, label, label_hash, menu_label
            ) == 0)
      return 0;

   if (menu_cbs_init_bind_right_compare_type(cbs, type, menu_label ) == 0)
      return 0;

   return menu_cbs_exit();
}
コード例 #10
0
static void netplay_lan_scan_callback(void *task_data,
                               void *user_data, const char *error)
{
   unsigned i;
   unsigned menu_type                      = 0;
   const char *path                        = NULL;
   const char *label                       = NULL;
   enum msg_hash_enums enum_idx            = MSG_UNKNOWN;
   file_list_t *file_list                  = NULL;
   struct netplay_host_list *netplay_hosts = NULL;

   menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL);

   /* Don't push the results if we left the LAN scan menu */
   if (!string_is_equal(label,
         msg_hash_to_str(
            MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST)))
      return;

   if (netplay_discovery_driver_ctl(
            RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES,
            (void *) &netplay_hosts))
   {
      if (netplay_hosts->size > 0)
      {
         file_list = menu_entries_get_selection_buf_ptr(0);
         menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, file_list);
      }

      for (i = 0; i < netplay_hosts->size; i++)
      {
         struct netplay_host *host = &netplay_hosts->hosts[i];
         menu_entries_append_enum(file_list,
               host->nick,
               msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_CONNECT_TO),
               MENU_ENUM_LABEL_NETPLAY_CONNECT_TO,
               MENU_NETPLAY_LAN_SCAN, 0, 0);
      }
   }
}
コード例 #11
0
ファイル: command_event.c プロジェクト: Tobio12/RetroArch
/**
 * event_disk_control_set_eject:
 * @new_state            : Eject or close the virtual drive tray.
 *                         false (0) : Close
 *                         true  (1) : Eject
 * @print_log            : Show message onscreen.
 *
 * Ejects/closes of the virtual drive tray.
 **/
static void event_disk_control_set_eject(bool new_state, bool print_log)
{
   char msg[128]                                     = {0};
   bool error                                        = false;
   rarch_system_info_t *info                         = NULL;
   const struct retro_disk_control_callback *control = NULL;

   runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info);

   if (info)
      control = (const struct retro_disk_control_callback*)&info->disk_control_cb;

   if (!control || !control->get_num_images)
      return;

   if (control->set_eject_state(new_state))
      snprintf(msg, sizeof(msg), "%s %s",
            new_state ? "Ejected" : "Closed",
            msg_hash_to_str(MSG_VIRTUAL_DISK_TRAY));
   else
   {
      error = true;
      snprintf(msg, sizeof(msg), "%s %s %s",
            msg_hash_to_str(MSG_FAILED_TO),
            new_state ? "eject" : "close",
            msg_hash_to_str(MSG_VIRTUAL_DISK_TRAY));
   }

   if (*msg)
   {
      if (error)
         RARCH_ERR("%s\n", msg);
      else
         RARCH_LOG("%s\n", msg);

      /* Only noise in menu. */
      if (print_log)
         runloop_msg_queue_push(msg, 1, 180, true);
   }
}
コード例 #12
0
static int task_database_iterate_start(database_info_handle_t *db,
      const char *name)
{
   char msg[128] = {0};

#ifdef _WIN32
   snprintf(msg, sizeof(msg),
         "%Iu/%Iu: %s %s...\n",
         db->list_ptr,
         db->list->size,
         msg_hash_to_str(MSG_SCANNING),
         name);
#elif defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
   snprintf(msg, sizeof(msg),
         "%zu/%zu: %s %s...\n",
         db->list_ptr,
         db->list->size,
         msg_hash_to_str(MSG_SCANNING),
         name);
#else
   snprintf(msg, sizeof(msg),
         "%lu/%lu: %s %s...\n",
         (unsigned long)db->list_ptr,
         (unsigned long)db->list->size,
         msg_hash_to_str(MSG_SCANNING),
         name);
#endif

   if (!string_is_empty(msg))
      runloop_msg_queue_push(msg, 1, 180, true);

#if 0
   RARCH_LOG("msg: %s\n", msg);
#endif


   db->status = DATABASE_STATUS_ITERATE;

   return 0;
}
コード例 #13
0
ファイル: task_database.c プロジェクト: lszzy/RetroArch
static int stream_get_serial(database_state_handle_t *db_state,
      database_info_handle_t *db, intfstream_t *fd, char* serial)
{
   const char* system_name = NULL;

   /* Check if the system was not auto-detected. */
   if (detect_system(fd, &system_name) < 0)
   {
      /* Attempt to read an ASCII serial, like Wii. */
      if (detect_serial_ascii_game(fd, serial))
      {
         /* ASCII serial (Wii) was detected. */
         RARCH_LOG("%s '%s'\n",
               msg_hash_to_str(MSG_FOUND_DISK_LABEL), serial);
         return 0;
      }

      /* Any other non-system specific detection methods? */
      return 0;
   }

   if (string_is_equal_fast(system_name, "psp", 3))
   {
      if (detect_psp_game(fd, serial) == 0)
         return 0;
      RARCH_LOG("%s '%s'\n", msg_hash_to_str(MSG_FOUND_DISK_LABEL), serial);
   }
   else if (string_is_equal_fast(system_name, "ps1", 3))
   {
      if (detect_ps1_game(fd, serial) == 0)
         return 0;
      RARCH_LOG("%s '%s'\n", msg_hash_to_str(MSG_FOUND_DISK_LABEL), serial);
   }
   else
   {
      return 0;
   }

   return 1;
}
コード例 #14
0
ファイル: content.c プロジェクト: jwarby/RetroArch
/**
 * load_ram_file:
 * @path             : path of RAM state that will be loaded from.
 * @type             : type of memory
 *
 * Load a RAM state from disk to memory.
 */
static bool load_ram_file(void *data)
{
   ssize_t rc;
   retro_ctx_memory_info_t mem_info;
   void *buf       = NULL;
   ram_type_t *ram = (ram_type_t*)data;

   if (!ram)
      return false;

   mem_info.id  = ram->type;

   core_ctl(CORE_CTL_RETRO_GET_MEMORY, &mem_info);

   if (mem_info.size == 0 || !mem_info.data)
      return false;

   if (!retro_read_file(ram->path, &buf, &rc))
      return false;

   if (rc > 0)
   {
      if (rc > (ssize_t)mem_info.size)
      {
         RARCH_WARN("SRAM is larger than implementation expects, "
               "doing partial load (truncating %u %s %s %u).\n",
               (unsigned)rc,
               msg_hash_to_str(MSG_BYTES),
               msg_hash_to_str(MSG_TO),
               (unsigned)mem_info.size);
         rc = mem_info.size;
      }
      memcpy(mem_info.data, buf, rc);
   }

   if (buf)
      free(buf);

   return true;
}
コード例 #15
0
void ShaderParamsDialog::onShaderLoadPresetClicked()
{
   QString path;
   QString filter;
   QByteArray pathArray;
   struct video_shader *menu_shader = NULL;
   struct video_shader *video_shader = NULL;
   const char *pathData = NULL;
   settings_t *settings = config_get_ptr();
   enum rarch_shader_type type = RARCH_SHADER_NONE;
   bool is_preset = false;

   if (!settings)
      return;

   getShaders(&menu_shader, &video_shader);

   if (!menu_shader)
      return;

   filter = "Shader Preset (";

   /* NOTE: Maybe we should have a way to get a list of all shader types instead of hard-coding this? */
   if (video_shader_is_supported(RARCH_SHADER_CG) &&
         video_shader_get_type_from_ext(file_path_str(FILE_PATH_CGP_EXTENSION), &is_preset)
         != RARCH_SHADER_NONE)
      filter += QLatin1Literal("*") + file_path_str(FILE_PATH_CGP_EXTENSION);

   if (video_shader_is_supported(RARCH_SHADER_GLSL) &&
         video_shader_get_type_from_ext(file_path_str(FILE_PATH_GLSLP_EXTENSION), &is_preset)
         != RARCH_SHADER_NONE)
      filter += QLatin1Literal(" *") + file_path_str(FILE_PATH_GLSLP_EXTENSION);

   if (video_shader_is_supported(RARCH_SHADER_SLANG) &&
         video_shader_get_type_from_ext(file_path_str(FILE_PATH_SLANGP_EXTENSION), &is_preset)
         != RARCH_SHADER_NONE)
      filter += QLatin1Literal(" *") + file_path_str(FILE_PATH_SLANGP_EXTENSION);

   filter += ")";

   path = QFileDialog::getOpenFileName(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET), settings->paths.directory_video_shader, filter);

   if (path.isEmpty())
      return;

   pathArray = path.toUtf8();
   pathData = pathArray.constData();

   type = video_shader_parse_type(pathData, RARCH_SHADER_NONE);

   menu_shader_manager_set_preset(menu_shader, type, pathData);
}
コード例 #16
0
ファイル: menu_entries.c プロジェクト: Alcaro/RetroArch
bool menu_entries_current_core_is_no_core(void)
{
   char corename[255];
   const char *no_core_str = NULL;

   corename[0] = '\0';

   menu_entries_get_core_name(corename, sizeof(corename));

   no_core_str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);

   return string_is_equal(corename, no_core_str);
}
コード例 #17
0
ファイル: runloop.c プロジェクト: rglass01/RetroArch
/**
 * check_movie_record:
 *
 * Checks if movie is being recorded.
 *
 * Returns: true (1) if movie is being recorded, otherwise false (0).
 **/
static bool check_movie_record(global_t *global)
{
   if (!global->bsv.movie)
      return false;

   rarch_main_msg_queue_push_new(
         MSG_MOVIE_RECORD_STOPPED, 2, 180, true);
   RARCH_LOG("%s\n", msg_hash_to_str(MSG_MOVIE_RECORD_STOPPED));

   event_command(EVENT_CMD_BSV_MOVIE_DEINIT);

   return true;
}
コード例 #18
0
ファイル: content.c プロジェクト: caa1211/RetroArch
static bool content_file_free(struct string_list *temporary_content)
{
   unsigned i;

   if (!temporary_content)
      return false;

   for (i = 0; i < temporary_content->size; i++)
   {
      const char *path = temporary_content->elems[i].data;

      RARCH_LOG("%s: %s.\n",
            msg_hash_to_str(MSG_REMOVING_TEMPORARY_CONTENT_FILE), path);
      if (remove(path) < 0)
         RARCH_ERR("%s: %s.\n",
               msg_hash_to_str(MSG_FAILED_TO_REMOVE_TEMPORARY_FILE),
               path);
   }
   string_list_free(temporary_content);

   return true;
}
コード例 #19
0
ファイル: menu_entries.c プロジェクト: gouchi/RetroArch
/* Sets 's' to the name of the current core
 * (shown at the top of the UI). */
int menu_entries_get_core_title(char *s, size_t len)
{
   const char *core_name          = NULL;
   const char *core_version       = NULL;
   rarch_system_info_t      *info      = runloop_get_system_info();
   struct retro_system_info    *system = &info->info;
#if _MSC_VER == 1200
   const char *extra_version = " msvc6";
#elif _MSC_VER == 1300
   const char *extra_version = " msvc2002";
#elif _MSC_VER == 1310
   const char *extra_version = " msvc2003";
#elif _MSC_VER == 1400
   const char *extra_version = " msvc2005";
#elif _MSC_VER == 1500
   const char *extra_version = " msvc2008";
#elif _MSC_VER == 1600
   const char *extra_version = " msvc2010";
#elif _MSC_VER == 1700
   const char *extra_version = " msvc2012";
#elif _MSC_VER == 1800
   const char *extra_version = " msvc2013";
#elif _MSC_VER == 1900
   const char *extra_version = " msvc2015";
#elif _MSC_VER >= 1910 && _MSC_VER < 2000
   const char *extra_version = " msvc2017";
#else
   const char *extra_version = "";
#endif

   if (system)
   {
      core_name    = system->library_name;
      core_version = system->library_version;
   }

   if (string_is_empty(core_name) && info)
      core_name = info->info.library_name;
   if (string_is_empty(core_name))
      core_name = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);

   if (!core_version && info)
      core_version = info->info.library_version;
   if (!core_version)
      core_version = "";

   snprintf(s, len, "%s%s - %s %s", PACKAGE_VERSION, extra_version,
         core_name, core_version);

   return 0;
}
コード例 #20
0
ファイル: command_event.c プロジェクト: Gruncher/RetroArch
/**
 * event_disk_control_set_eject:
 * @new_state            : Eject or close the virtual drive tray.
 *                         false (0) : Close
 *                         true  (1) : Eject
 * @print_log            : Show message onscreen.
 *
 * Ejects/closes of the virtual drive tray.
 **/
static void event_disk_control_set_eject(bool new_state, bool print_log)
{
   char msg[PATH_MAX_LENGTH] = {0};
   bool error                = false;
   rarch_system_info_t *info = rarch_system_info_get_ptr();
   const struct retro_disk_control_callback *control =
      info ? (const struct retro_disk_control_callback*)&info->disk_control : NULL;

   if (!control || !control->get_num_images)
      return;

   *msg = '\0';

   if (control->set_eject_state(new_state))
      snprintf(msg, sizeof(msg), "%s %s",
            new_state ? "Ejected" : "Closed",
            msg_hash_to_str(MSG_VIRTUAL_DISK_TRAY));
   else
   {
      error = true;
      snprintf(msg, sizeof(msg), "%s %s %s",
            msg_hash_to_str(MSG_FAILED_TO),
            new_state ? "eject" : "close",
            msg_hash_to_str(MSG_VIRTUAL_DISK_TRAY));
   }

   if (*msg)
   {
      if (error)
         RARCH_ERR("%s\n", msg);
      else
         RARCH_LOG("%s\n", msg);

      /* Only noise in menu. */
      if (print_log)
         rarch_main_msg_queue_push(msg, 1, 180, true);
   }
}
コード例 #21
0
ファイル: driver.c プロジェクト: Skylark13/RetroArch
/**
 * driver_find_next:
 * @label              : string of driver type to be found.
 * @s                  : identifier of driver to be found.
 * @len                : size of @s.
 *
 * Find next driver in driver array.
 **/
bool driver_find_next(const char *label, char *s, size_t len)
{
   int i = driver_find_index(label, s);
   if (i >= 0 && !string_is_equal(s, "null"))
      find_driver_nonempty(label, i + 1, s, len);
   else
   {
      RARCH_WARN("%s (current one: \"%s\").\n",
            msg_hash_to_str(MSG_COULD_NOT_FIND_ANY_NEXT_DRIVER),
            s);
      return false;
   }
   return true;
}
コード例 #22
0
ファイル: task_autodetect.c プロジェクト: libretro/RetroArch
static void input_autoconfigure_disconnect_handler(retro_task_t *task)
{
   autoconfig_disconnect_t *params = (autoconfig_disconnect_t*)task->state;

   task_set_title(task, strdup(params->msg));

   task_set_finished(task, true);

   RARCH_LOG("%s: %s\n", msg_hash_to_str(MSG_AUTODETECT), params->msg);

   if (!string_is_empty(params->msg))
      free(params->msg);
   free(params);
}
コード例 #23
0
ファイル: content.c プロジェクト: blakekohler/RetroArch
/**
 * save_ram_file:
 * @path             : path of RAM state that shall be written to.
 * @type             : type of memory
 *
 * Save a RAM state from memory to disk.
 *
 * In case the file could not be written to, a fallback function
 * 'dump_to_file_desperate' will be called.
 */
void save_ram_file(const char *path, int type)
{
   size_t size = core.retro_get_memory_size(type);
   void *data  = core.retro_get_memory_data(type);

   if (!data)
      return;
   if (size == 0)
      return;

   if (!retro_write_file(path, data, size))
   {
      RARCH_ERR("%s.\n",
            msg_hash_to_str(MSG_FAILED_TO_SAVE_SRAM));
      RARCH_WARN("Attempting to recover ...\n");
      dump_to_file_desperate(data, size, type);
      return;
   }

   RARCH_LOG("%s \"%s\".\n",
         msg_hash_to_str(MSG_SAVED_SUCCESSFULLY_TO),
         path);
}
コード例 #24
0
static void menu_action_setting_disp_set_label_db_entry(
      file_list_t* list,
      unsigned *w, unsigned type, unsigned i,
      const char *label,
      char *s, size_t len,
      const char *entry_label,
      const char *path,
      char *s2, size_t len2)
{
   strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MORE), len);
   *w = 10;
   if (!string_is_empty(path))
      strlcpy(s2, path, len2);
}
コード例 #25
0
static void menu_action_setting_disp_set_label_shader_default_filter(

      file_list_t* list,
      unsigned *w, unsigned type, unsigned i,
      const char *label,
      char *s, size_t len,
      const char *entry_label,
      const char *path,
      char *s2, size_t len2)
{
   settings_t *settings = config_get_ptr();

   *s = '\0';
   *w = 19;

   if (!settings)
      return;

   if (settings->bools.video_smooth)
      strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LINEAR), len);
   else
      strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NEAREST), len);
}
コード例 #26
0
static void menu_action_setting_disp_set_label_shader_watch_for_changes(
      file_list_t* list,
      unsigned *w, unsigned type, unsigned i,
      const char *label,
      char *s, size_t len,
      const char *entry_label,
      const char *path,
      char *s2, size_t len2)
{
   settings_t *settings = config_get_ptr();

   *s = '\0';
   *w = 19;
   strlcpy(s2, path, len2);

   if (settings)
   {
      if (settings->bools.video_shader_watch_files)
         snprintf(s, len, "%s", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_TRUE));
      else
         snprintf(s, len, "%s", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FALSE));
   }
}
コード例 #27
0
static void menu_action_setting_disp_set_label_cheevos_unlocked_entry_hardcore(
      file_list_t* list,
      unsigned *w, unsigned type, unsigned i,
      const char *label,
      char *s, size_t len,
      const char *entry_label,
      const char *path,
      char *s2, size_t len2)
{
   *w = 19;
   strlcpy(s2, path, len2);
   strlcpy(s,
         msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY_HARDCORE), len);
}
コード例 #28
0
static void menu_action_setting_disp_set_label_setting_bool(file_list_t* list,
      unsigned *w, unsigned type, unsigned i,
      const char *label,
      char *s, size_t len,
      const char *entry_label,
      const char *path,
      char *s2, size_t len2)
{
   rarch_setting_t *setting = menu_setting_find(list->list[i].label);

   *s = '\0';
   *w = 19;

   if (setting)
   {
      if (*setting->value.target.boolean)
         strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON), len);
      else
         strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
   }

   strlcpy(s2, path, len2);
}
コード例 #29
0
ファイル: platform_wiiu.c プロジェクト: arakerlu/RetroArch
static int frontend_wiiu_parse_drive_list(void *data, bool load_content)
{
#ifndef IS_SALAMANDER
   file_list_t *list = (file_list_t *)data;
   enum msg_hash_enums enum_idx = load_content ?
      MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR :
      MSG_UNKNOWN;

   if (!list)
      return -1;

   menu_entries_append_enum(list, WIIU_SD_PATH,
         msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
         enum_idx,
         FILE_TYPE_DIRECTORY, 0, 0);

   menu_entries_append_enum(list, WIIU_USB_PATH,
         msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
         enum_idx,
         FILE_TYPE_DIRECTORY, 0, 0);
#endif
   return 0;
}
コード例 #30
0
ファイル: system.c プロジェクト: chungy/RetroArch
void rarch_system_info_init(void)
{
   rarch_system_info_t *system    = rarch_system_info_get_ptr();

   pretro_get_system_info(&system->info);

   if (!system->info.library_name)
      system->info.library_name = msg_hash_to_str(MSG_UNKNOWN);
   if (!system->info.library_version)
      system->info.library_version = "v0";

#ifndef RARCH_CONSOLE
   strlcpy(system->title_buf, 
         msg_hash_to_str(MSG_PROGRAM), sizeof(system->title_buf));
   strlcat(system->title_buf, " : ", sizeof(system->title_buf));
#endif
   strlcat(system->title_buf, system->info.library_name, sizeof(system->title_buf));
   strlcat(system->title_buf, " ", sizeof(system->title_buf));
   strlcat(system->title_buf, system->info.library_version, sizeof(system->title_buf));
   strlcpy(system->valid_extensions, system->info.valid_extensions ?
         system->info.valid_extensions : DEFAULT_EXT,
         sizeof(system->valid_extensions));
   system->block_extract = system->info.block_extract;
}