From 41484cd73c4114228c12f6456f61cc5caa72fecf Mon Sep 17 00:00:00 2001 From: aliaspider Date: Wed, 10 Dec 2014 12:00:12 +0100 Subject: use correct save directory. --- libretro.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'libretro.c') diff --git a/libretro.c b/libretro.c index b873594..c469bf1 100644 --- a/libretro.c +++ b/libretro.c @@ -188,13 +188,13 @@ void retro_cheat_set(unsigned index, bool enabled, const char* code) {} void error_msg(const char* text) { if (log_cb) - log_cb(RETRO_LOG_ERROR, text); + log_cb(RETRO_LOG_ERROR, "[gpSP]: %s\n", text); } void info_msg(const char* text) { if (log_cb) - log_cb(RETRO_LOG_INFO, text); + log_cb(RETRO_LOG_INFO, "[gpSP]: %s\n", text); } static void extract_directory(char* buf, const char* path, size_t size) @@ -217,11 +217,7 @@ bool retro_load_game(const struct retro_game_info* info) enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565; if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) - { - if (log_cb) - log_cb(RETRO_LOG_INFO, "[TempGBA]: 0RGB1555 is not supported.\n"); - return false; - } + info_msg("RGB565 is not supported."); extract_directory(main_path, info->path, sizeof(main_path)); @@ -233,34 +229,29 @@ bool retro_load_game(const struct retro_game_info* info) strncat(filename_bios, "/gba_bios.bin", sizeof(filename_bios)); - // if (environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &dir) && dir) - // strncpy(dir_save, dir, sizeof(dir_save)); - // else - // strncpy(dir_save, main_path, sizeof(dir_save)); - - // strncat(dir_save, "/",sizeof(dir_save)); - - // strncat(main_path, "/",sizeof(main_path)); + if (environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &dir) && dir) + strncpy(save_path, dir, sizeof(save_path)); + else + strncpy(save_path, main_path, sizeof(save_path)); if (load_bios(filename_bios) != 0) { - error_msg("Could not load BIOS image file.\n"); + error_msg("Could not load BIOS image file."); return false; } if (bios_rom[0] != 0x18) { - info_msg("You have an incorrect BIOS image.\n"); - info_msg("While many games will work fine, some will not. It\n"); - info_msg("is strongly recommended that you obtain the\n"); - info_msg("correct BIOS file.\n"); + info_msg("You have an incorrect BIOS image."); + info_msg("While many games will work fine, some will not."); + info_msg("It is strongly recommended that you obtain the correct BIOS file."); } gamepak_filename[0] = 0; if (load_gamepak(info->path) != 0) { - error_msg("Could not load the game file.\n"); + error_msg("Could not load the game file."); return false; } -- cgit v1.2.3