mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Convert GetUserPath to return a std::string instead of a const char *. This simplifies its usage in most cases.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7265 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@@ -54,12 +54,11 @@ namespace AudioCommon
|
||||
ac_Config.Update();
|
||||
if (soundStream->Start())
|
||||
{
|
||||
if (ac_Config.m_DumpAudio) {
|
||||
char audio_file_name[255];
|
||||
snprintf(audio_file_name, 255, "%saudiodump.wav", File::GetUserPath(D_DUMPAUDIO_IDX));
|
||||
File::CreateFullPath(audio_file_name);
|
||||
mixer->StartLogAudio(audio_file_name);
|
||||
//soundStream->StartLogAudio(audio_file_name);
|
||||
if (ac_Config.m_DumpAudio)
|
||||
{
|
||||
std::string audio_file_name = File::GetUserPath(D_DUMPAUDIO_IDX) + "audiodump.wav";
|
||||
File::CreateFullPath(audio_file_name.c_str());
|
||||
mixer->StartLogAudio(audio_file_name.c_str());
|
||||
}
|
||||
|
||||
return soundStream;
|
||||
|
||||
@@ -28,7 +28,7 @@ SoundStream *soundStream;
|
||||
void AudioCommonConfig::Load()
|
||||
{
|
||||
IniFile file;
|
||||
file.Load(std::string(File::GetUserPath(F_DSPCONFIG_IDX)).c_str());
|
||||
file.Load(File::GetUserPath(F_DSPCONFIG_IDX));
|
||||
|
||||
file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true);
|
||||
file.Get("Config", "EnableThrottle", &m_EnableThrottle, true);
|
||||
@@ -51,7 +51,7 @@ void AudioCommonConfig::Load()
|
||||
void AudioCommonConfig::SaveSettings()
|
||||
{
|
||||
IniFile file;
|
||||
file.Load(std::string(File::GetUserPath(F_DSPCONFIG_IDX)).c_str());
|
||||
file.Load(File::GetUserPath(F_DSPCONFIG_IDX));
|
||||
|
||||
file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic);
|
||||
file.Set("Config", "EnableThrottle", m_EnableThrottle);
|
||||
@@ -61,7 +61,7 @@ void AudioCommonConfig::SaveSettings()
|
||||
file.Set("Config", "Frequency", iFrequency);
|
||||
file.Set("Config", "Volume", m_Volume);
|
||||
|
||||
file.Save((std::string(File::GetUserPath(F_DSPCONFIG_IDX)).c_str()));
|
||||
file.Save(File::GetUserPath(F_DSPCONFIG_IDX));
|
||||
}
|
||||
|
||||
// Update according to the values (stream/mixer)
|
||||
|
||||
@@ -61,24 +61,26 @@ namespace File
|
||||
|
||||
// Remove any ending forward slashes from directory paths
|
||||
// Modifies argument.
|
||||
static char *StripTailDirSlashes(char *fname)
|
||||
static void StripTailDirSlashes(std::string &fname)
|
||||
{
|
||||
int len = (int)strlen(fname);
|
||||
int i = len - 1;
|
||||
if (len > 1)
|
||||
if (fname.length() > 1)
|
||||
{
|
||||
size_t i = fname.length() - 1;
|
||||
while (fname[i] == DIR_SEP_CHR)
|
||||
fname[i--] = '\0';
|
||||
return fname;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Returns true if file filename exists
|
||||
bool Exists(const char *filename)
|
||||
{
|
||||
struct stat64 file_info;
|
||||
|
||||
char *copy = StripTailDirSlashes(__strdup(filename));
|
||||
int result = stat64(copy, &file_info);
|
||||
free(copy);
|
||||
|
||||
std::string copy(filename);
|
||||
StripTailDirSlashes(copy);
|
||||
|
||||
int result = stat64(copy.c_str(), &file_info);
|
||||
|
||||
return (result == 0);
|
||||
}
|
||||
@@ -88,10 +90,10 @@ bool IsDirectory(const char *filename)
|
||||
{
|
||||
struct stat64 file_info;
|
||||
|
||||
char *copy = StripTailDirSlashes(__strdup(filename));
|
||||
std::string copy(filename);
|
||||
StripTailDirSlashes(copy);
|
||||
|
||||
int result = stat64(copy, &file_info);
|
||||
free(copy);
|
||||
int result = stat64(copy.c_str(), &file_info);
|
||||
|
||||
if (result < 0) {
|
||||
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s",
|
||||
@@ -622,84 +624,85 @@ std::string GetSysDirectory()
|
||||
|
||||
// Returns a pointer to a string with a Dolphin data dir or file in the user's home
|
||||
// directory. To be used in "multi-user" mode (that is, installed).
|
||||
const char *GetUserPath(int DirIDX)
|
||||
std::string &GetUserPath(int DirIDX)
|
||||
{
|
||||
static char UserDir[MAX_PATH] = {0};
|
||||
static char GCUserDir[MAX_PATH] = {0};
|
||||
static char WiiUserDir[MAX_PATH] = {0};
|
||||
static char WiiRootDir[MAX_PATH] = {0};
|
||||
static char ConfigDir[MAX_PATH] = {0};
|
||||
static char GameConfigDir[MAX_PATH] = {0};
|
||||
static char MapsDir[MAX_PATH] = {0};
|
||||
static char CacheDir[MAX_PATH] = {0};
|
||||
static char ShaderCacheDir[MAX_PATH] = {0};
|
||||
static char ShadersDir[MAX_PATH] = {0};
|
||||
static char StateSavesDir[MAX_PATH] = {0};
|
||||
static char ScreenShotsDir[MAX_PATH] = {0};
|
||||
static char OpenCLDir[MAX_PATH] = {0};
|
||||
static char HiresTexturesDir[MAX_PATH] = {0};
|
||||
static char DumpDir[MAX_PATH] = {0};
|
||||
static char DumpFramesDir[MAX_PATH] = {0};
|
||||
static char DumpAudioDir[MAX_PATH] = {0};
|
||||
static char DumpTexturesDir[MAX_PATH] = {0};
|
||||
static char DumpDSPDir[MAX_PATH] = {0};
|
||||
static char LogsDir[MAX_PATH] = {0};
|
||||
static char MailLogsDir[MAX_PATH] = {0};
|
||||
static char WiiSYSCONFDir[MAX_PATH] = {0};
|
||||
static char DolphinConfig[MAX_PATH] = {0};
|
||||
static char DSPConfig[MAX_PATH] = {0};
|
||||
static char DebuggerConfig[MAX_PATH] = {0};
|
||||
static char LoggerConfig[MAX_PATH] = {0};
|
||||
static char MainLog[MAX_PATH] = {0};
|
||||
static char WiiSYSCONF[MAX_PATH] = {0};
|
||||
static char RamDump[MAX_PATH] = {0};
|
||||
static char ARamDump[MAX_PATH] = {0};
|
||||
static char GCSRam[MAX_PATH] = {0};
|
||||
static std::string UserDir;
|
||||
static std::string GCUserDir;
|
||||
static std::string WiiUserDir;
|
||||
static std::string WiiRootDir;
|
||||
static std::string ConfigDir;
|
||||
static std::string GameConfigDir;
|
||||
static std::string MapsDir;
|
||||
static std::string CacheDir;
|
||||
static std::string ShaderCacheDir;
|
||||
static std::string ShadersDir;
|
||||
static std::string StateSavesDir;
|
||||
static std::string ScreenShotsDir;
|
||||
static std::string OpenCLDir;
|
||||
static std::string HiresTexturesDir;
|
||||
static std::string DumpDir;
|
||||
static std::string DumpFramesDir;
|
||||
static std::string DumpAudioDir;
|
||||
static std::string DumpTexturesDir;
|
||||
static std::string DumpDSPDir;
|
||||
static std::string LogsDir;
|
||||
static std::string MailLogsDir;
|
||||
static std::string WiiSYSCONFDir;
|
||||
static std::string DolphinConfig;
|
||||
static std::string DSPConfig;
|
||||
static std::string DebuggerConfig;
|
||||
static std::string LoggerConfig;
|
||||
static std::string MainLog;
|
||||
static std::string WiiSYSCONF;
|
||||
static std::string RamDump;
|
||||
static std::string ARamDump;
|
||||
static std::string GCSRam;
|
||||
static std::string Default;
|
||||
|
||||
// Set up all paths and files on the first run
|
||||
if (strlen(UserDir) == 0)
|
||||
if (UserDir.empty())
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// Keep the directory setup the way it was on windows
|
||||
snprintf(UserDir, sizeof(UserDir), ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP);
|
||||
UserDir = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP;
|
||||
#else
|
||||
if (File::Exists(ROOT_DIR DIR_SEP USERDATA_DIR))
|
||||
snprintf(UserDir, sizeof(UserDir), ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP);
|
||||
UserDir = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP;
|
||||
else
|
||||
snprintf(UserDir, sizeof(UserDir), "%s" DIR_SEP DOLPHIN_DATA_DIR DIR_SEP, getenv("HOME"));
|
||||
UserDir = std::string(getenv("HOME")) + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP;
|
||||
#endif
|
||||
INFO_LOG(COMMON, "GetUserPath: Setting user directory to %s:", UserDir);
|
||||
INFO_LOG(COMMON, "GetUserPath: Setting user directory to %s:", UserDir.c_str());
|
||||
|
||||
snprintf(GCUserDir, sizeof(GCUserDir), "%s" GC_USER_DIR DIR_SEP, UserDir);
|
||||
snprintf(WiiUserDir, sizeof(WiiUserDir), "%s" WII_USER_DIR DIR_SEP, UserDir);
|
||||
snprintf(WiiRootDir, sizeof(WiiRootDir), "%s" WII_USER_DIR, UserDir);
|
||||
snprintf(ConfigDir, sizeof(ConfigDir), "%s" CONFIG_DIR DIR_SEP, UserDir);
|
||||
snprintf(GameConfigDir, sizeof(GameConfigDir), "%s" GAMECONFIG_DIR DIR_SEP, UserDir);
|
||||
snprintf(MapsDir, sizeof(MapsDir), "%s" MAPS_DIR DIR_SEP, UserDir);
|
||||
snprintf(CacheDir, sizeof(CacheDir), "%s" CACHE_DIR DIR_SEP, UserDir);
|
||||
snprintf(ShaderCacheDir, sizeof(ShaderCacheDir), "%s" SHADERCACHE_DIR DIR_SEP, UserDir);
|
||||
snprintf(ShadersDir, sizeof(ShadersDir), "%s" SHADERS_DIR DIR_SEP, UserDir);
|
||||
snprintf(StateSavesDir, sizeof(StateSavesDir), "%s" STATESAVES_DIR DIR_SEP, UserDir);
|
||||
snprintf(ScreenShotsDir, sizeof(ScreenShotsDir), "%s" SCREENSHOTS_DIR DIR_SEP, UserDir);
|
||||
snprintf(OpenCLDir, sizeof(OpenCLDir), "%s" OPENCL_DIR DIR_SEP, UserDir);
|
||||
snprintf(HiresTexturesDir, sizeof(HiresTexturesDir), "%s" HIRES_TEXTURES_DIR DIR_SEP, UserDir);
|
||||
snprintf(DumpDir, sizeof(DumpDir), "%s" DUMP_DIR DIR_SEP, UserDir);
|
||||
snprintf(DumpFramesDir, sizeof(DumpFramesDir), "%s" DUMP_FRAMES_DIR DIR_SEP, UserDir);
|
||||
snprintf(DumpAudioDir, sizeof(DumpAudioDir), "%s" DUMP_AUDIO_DIR DIR_SEP, UserDir);
|
||||
snprintf(DumpTexturesDir, sizeof(DumpTexturesDir), "%s" DUMP_TEXTURES_DIR DIR_SEP, UserDir);
|
||||
snprintf(DumpDSPDir, sizeof(DumpDSPDir), "%s" DUMP_DSP_DIR DIR_SEP, UserDir);
|
||||
snprintf(LogsDir, sizeof(LogsDir), "%s" LOGS_DIR DIR_SEP, UserDir);
|
||||
snprintf(MailLogsDir, sizeof(MailLogsDir), "%s" MAIL_LOGS_DIR DIR_SEP, UserDir);
|
||||
snprintf(WiiSYSCONFDir, sizeof(WiiSYSCONFDir), "%s" WII_SYSCONF_DIR DIR_SEP, UserDir);
|
||||
snprintf(DolphinConfig, sizeof(DolphinConfig), "%s" DOLPHIN_CONFIG, ConfigDir);
|
||||
snprintf(DSPConfig, sizeof(DSPConfig), "%s" DSP_CONFIG, ConfigDir);
|
||||
snprintf(DebuggerConfig, sizeof(DebuggerConfig), "%s" DEBUGGER_CONFIG, ConfigDir);
|
||||
snprintf(LoggerConfig, sizeof(LoggerConfig), "%s" LOGGER_CONFIG, ConfigDir);
|
||||
snprintf(MainLog, sizeof(MainLog), "%s" MAIN_LOG, LogsDir);
|
||||
snprintf(WiiSYSCONF, sizeof(WiiSYSCONF), "%s" WII_SYSCONF, WiiSYSCONFDir);
|
||||
snprintf(RamDump, sizeof(RamDump), "%s" RAM_DUMP, DumpDir);
|
||||
snprintf(ARamDump, sizeof(ARamDump), "%s" ARAM_DUMP, DumpDir);
|
||||
snprintf(GCSRam, sizeof(GCSRam), "%s" GC_SRAM, GCUserDir);
|
||||
GCUserDir = UserDir + GC_USER_DIR DIR_SEP;
|
||||
WiiUserDir = UserDir + WII_USER_DIR DIR_SEP;
|
||||
WiiRootDir = UserDir + WII_USER_DIR;
|
||||
ConfigDir = UserDir + CONFIG_DIR DIR_SEP;
|
||||
GameConfigDir = UserDir + GAMECONFIG_DIR DIR_SEP;
|
||||
MapsDir = UserDir + MAPS_DIR DIR_SEP;
|
||||
CacheDir = UserDir + CACHE_DIR DIR_SEP;
|
||||
ShaderCacheDir = UserDir + SHADERCACHE_DIR DIR_SEP;
|
||||
ShadersDir = UserDir + SHADERS_DIR DIR_SEP;
|
||||
StateSavesDir = UserDir + STATESAVES_DIR DIR_SEP;
|
||||
ScreenShotsDir = UserDir + SCREENSHOTS_DIR DIR_SEP;
|
||||
OpenCLDir = UserDir + OPENCL_DIR DIR_SEP;
|
||||
HiresTexturesDir = UserDir + HIRES_TEXTURES_DIR DIR_SEP;
|
||||
DumpDir = UserDir + DUMP_DIR DIR_SEP;
|
||||
DumpFramesDir = UserDir + DUMP_FRAMES_DIR DIR_SEP;
|
||||
DumpAudioDir = UserDir + DUMP_AUDIO_DIR DIR_SEP;
|
||||
DumpTexturesDir = UserDir + DUMP_TEXTURES_DIR DIR_SEP;
|
||||
DumpDSPDir = UserDir + DUMP_DSP_DIR DIR_SEP;
|
||||
LogsDir = UserDir + LOGS_DIR DIR_SEP;
|
||||
MailLogsDir = UserDir + MAIL_LOGS_DIR DIR_SEP;
|
||||
WiiSYSCONFDir = UserDir + WII_SYSCONF_DIR DIR_SEP;
|
||||
DolphinConfig = ConfigDir + DOLPHIN_CONFIG;
|
||||
DSPConfig = ConfigDir + DSP_CONFIG;
|
||||
DebuggerConfig = ConfigDir + DEBUGGER_CONFIG;
|
||||
LoggerConfig = ConfigDir + LOGGER_CONFIG;
|
||||
MainLog = LogsDir + MAIN_LOG;
|
||||
WiiSYSCONF = WiiSYSCONFDir + WII_SYSCONF;
|
||||
RamDump = DumpDir + RAM_DUMP;
|
||||
ARamDump = DumpDir + ARAM_DUMP;
|
||||
GCSRam = GCUserDir + GC_SRAM;
|
||||
}
|
||||
switch (DirIDX)
|
||||
{
|
||||
@@ -766,7 +769,7 @@ const char *GetUserPath(int DirIDX)
|
||||
case F_GCSRAM_IDX:
|
||||
return GCSRam;
|
||||
default:
|
||||
return NULL;
|
||||
return Default;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ bool SetCurrentDir(const char *directory);
|
||||
|
||||
// Returns a pointer to a string with a Dolphin data dir in the user's home
|
||||
// directory. To be used in "multi-user" mode (that is, installed).
|
||||
const char *GetUserPath(int DirIDX);
|
||||
std::string &GetUserPath(int DirIDX);
|
||||
|
||||
// Returns the path to where the sys file are
|
||||
std::string GetSysDirectory();
|
||||
|
||||
@@ -84,7 +84,7 @@ LogManager::LogManager() {
|
||||
m_Log[LogTypes::MEMCARD_MANAGER] = new LogContainer("MemCard Manager", "MemCard Manager");
|
||||
m_Log[LogTypes::NETPLAY] = new LogContainer("NETPLAY", "Netplay");
|
||||
|
||||
m_fileLog = new FileLogListener(File::GetUserPath(F_MAINLOG_IDX));
|
||||
m_fileLog = new FileLogListener(File::GetUserPath(F_MAINLOG_IDX).c_str());
|
||||
m_consoleLog = new ConsoleListener();
|
||||
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) {
|
||||
|
||||
@@ -26,7 +26,8 @@ namespace Common
|
||||
std::string CreateTicketFileName(u64 _titleID)
|
||||
{
|
||||
char TicketFilename[1024];
|
||||
sprintf(TicketFilename, "%sticket/%08x/%08x.tik", File::GetUserPath(D_WIIUSER_IDX), (u32)(_titleID >> 32), (u32)_titleID);
|
||||
sprintf(TicketFilename, "%sticket/%08x/%08x.tik",
|
||||
File::GetUserPath(D_WIIUSER_IDX).c_str(), (u32)(_titleID >> 32), (u32)_titleID);
|
||||
|
||||
return TicketFilename;
|
||||
}
|
||||
@@ -34,7 +35,8 @@ std::string CreateTicketFileName(u64 _titleID)
|
||||
std::string CreateTitleDataPath(u64 _titleID)
|
||||
{
|
||||
char path[1024];
|
||||
sprintf(path, "%stitle/%08x/%08x/data", File::GetUserPath(D_WIIUSER_IDX), (u32)(_titleID >> 32), (u32)_titleID);
|
||||
sprintf(path, "%stitle/%08x/%08x/data",
|
||||
File::GetUserPath(D_WIIUSER_IDX).c_str(), (u32)(_titleID >> 32), (u32)_titleID);
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -42,7 +44,8 @@ std::string CreateTitleDataPath(u64 _titleID)
|
||||
std::string CreateTitleContentPath(u64 _titleID)
|
||||
{
|
||||
char ContentPath[1024];
|
||||
sprintf(ContentPath, "%stitle/%08x/%08x/content", File::GetUserPath(D_WIIUSER_IDX), (u32)(_titleID >> 32), (u32)_titleID);
|
||||
sprintf(ContentPath, "%stitle/%08x/%08x/content",
|
||||
File::GetUserPath(D_WIIUSER_IDX).c_str(), (u32)(_titleID >> 32), (u32)_titleID);
|
||||
|
||||
return ContentPath;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ static int write_empty(FILE* file, u64 count)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool SDCardCreate(u64 disk_size /*in MB*/, char* filename)
|
||||
bool SDCardCreate(u64 disk_size /*in MB*/, const char* filename)
|
||||
{
|
||||
int sectors_per_fat;
|
||||
int sectors_per_disk;
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
bool SDCardCreate(u64 disk_size /*in MB*/, char* filename);
|
||||
bool SDCardCreate(u64 disk_size /*in MB*/, const char* filename);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
SysConf::SysConf()
|
||||
: m_IsValid(false)
|
||||
{
|
||||
if (LoadFromFile(File::GetUserPath(F_WIISYSCONF_IDX)))
|
||||
if (LoadFromFile(File::GetUserPath(F_WIISYSCONF_IDX).c_str()))
|
||||
m_IsValid = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ std::string CBoot::GenerateMapFilename()
|
||||
u64 TitleID = Loader.GetTitleID();
|
||||
char tmpBuffer[32];
|
||||
sprintf(tmpBuffer, "%08x_%08x", (u32)(TitleID >> 32) & 0xFFFFFFFF , (u32)TitleID & 0xFFFFFFFF );
|
||||
return std::string(File::GetUserPath(D_MAPS_IDX)) + std::string(tmpBuffer) + ".map";
|
||||
return File::GetUserPath(D_MAPS_IDX) + std::string(tmpBuffer) + ".map";
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ std::string CBoot::GenerateMapFilename()
|
||||
case SCoreStartupParameter::BOOT_DOL:
|
||||
return _StartupPara.m_strFilename.substr(0, _StartupPara.m_strFilename.size()-4) + ".map";
|
||||
default:
|
||||
return std::string(File::GetUserPath(D_MAPS_IDX)) + _StartupPara.GetUniqueID() + ".map";
|
||||
return File::GetUserPath(D_MAPS_IDX) + _StartupPara.GetUniqueID() + ".map";
|
||||
}
|
||||
|
||||
return std::string("unknown map");
|
||||
|
||||
@@ -46,9 +46,10 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename)
|
||||
char Path[260+1];
|
||||
u64 TitleID = ContentLoader.GetTitleID();
|
||||
char* pTitleID = (char*)&TitleID;
|
||||
sprintf(Path, "%stitle/%02x%02x%02x%02x/%02x%02x%02x%02x/data/nocopy/", File::GetUserPath(D_WIIUSER_IDX),
|
||||
(u8)pTitleID[7], (u8)pTitleID[6], (u8)pTitleID[5], (u8)pTitleID[4],
|
||||
(u8)pTitleID[3], (u8)pTitleID[2], (u8)pTitleID[1], (u8)pTitleID[0]);
|
||||
sprintf(Path, "%stitle/%02x%02x%02x%02x/%02x%02x%02x%02x/data/nocopy/",
|
||||
File::GetUserPath(D_WIIUSER_IDX).c_str(),
|
||||
(u8)pTitleID[7], (u8)pTitleID[6], (u8)pTitleID[5], (u8)pTitleID[4],
|
||||
(u8)pTitleID[3], (u8)pTitleID[2], (u8)pTitleID[1], (u8)pTitleID[0]);
|
||||
File::CreateFullPath(Path);
|
||||
|
||||
// setup wii mem
|
||||
@@ -100,7 +101,8 @@ bool CBoot::Install_WiiWAD(const char* _pFilename)
|
||||
//copy WAD's tmd header and contents to content directory
|
||||
|
||||
char ContentPath[260+1];
|
||||
sprintf(ContentPath, "%stitle/%08x/%08x/content/", File::GetUserPath(D_WIIUSER_IDX), TitleID_HI, TitleID_LO);
|
||||
sprintf(ContentPath, "%stitle/%08x/%08x/content/",
|
||||
File::GetUserPath(D_WIIUSER_IDX).c_str(), TitleID_HI, TitleID_LO);
|
||||
File::CreateFullPath(ContentPath);
|
||||
|
||||
std::string TMDFileName(ContentPath);
|
||||
@@ -155,11 +157,12 @@ bool CBoot::Install_WiiWAD(const char* _pFilename)
|
||||
//Extract and copy WAD's ticket to ticket directory
|
||||
|
||||
char TicketPath[260+1];
|
||||
sprintf(TicketPath, "%sticket/%08x/", File::GetUserPath(D_WIIUSER_IDX), TitleID_HI);
|
||||
sprintf(TicketPath, "%sticket/%08x/", File::GetUserPath(D_WIIUSER_IDX).c_str(), TitleID_HI);
|
||||
File::CreateFullPath(TicketPath);
|
||||
|
||||
char TicketFileName[260+1];
|
||||
sprintf(TicketFileName, "%sticket/%08x/%08x.tik", File::GetUserPath(D_WIIUSER_IDX), TitleID_HI, TitleID_LO);
|
||||
sprintf(TicketFileName, "%sticket/%08x/%08x.tik",
|
||||
File::GetUserPath(D_WIIUSER_IDX).c_str(), TitleID_HI, TitleID_LO);
|
||||
|
||||
FILE* pTicketFile = fopen(TicketFileName, "wb");
|
||||
if (pTicketFile == NULL) {
|
||||
|
||||
@@ -84,7 +84,7 @@ bool BootCore(const std::string& _rFilename)
|
||||
// Load game specific settings
|
||||
IniFile game_ini;
|
||||
std::string unique_id = StartUp.GetUniqueID();
|
||||
StartUp.m_strGameIni = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + unique_id + ".ini";
|
||||
StartUp.m_strGameIni = File::GetUserPath(D_GAMECONFIG_IDX) + unique_id + ".ini";
|
||||
if (unique_id.size() == 6 && game_ini.Load(StartUp.m_strGameIni.c_str()))
|
||||
{
|
||||
config_cache.valid = true;
|
||||
|
||||
@@ -124,7 +124,7 @@ SConfig::~SConfig()
|
||||
|
||||
void SConfig::SaveSettings()
|
||||
{
|
||||
NOTICE_LOG(BOOT, "Saving settings to %s", File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
NOTICE_LOG(BOOT, "Saving settings to %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
|
||||
|
||||
@@ -239,7 +239,7 @@ void SConfig::SaveSettings()
|
||||
|
||||
void SConfig::LoadSettings()
|
||||
{
|
||||
INFO_LOG(BOOT, "Loading Settings from %s", File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
INFO_LOG(BOOT, "Loading Settings from %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
|
||||
@@ -372,14 +372,14 @@ void SConfig::LoadSettingsWii()
|
||||
{
|
||||
IniFile ini;
|
||||
//Wiimote configs
|
||||
ini.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "Dolphin.ini").c_str());
|
||||
ini.Load((File::GetUserPath(D_CONFIG_IDX) + "Dolphin.ini"));
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
char SectionName[32];
|
||||
sprintf(SectionName, "Wiimote%i", i + 1);
|
||||
ini.Get(SectionName, "AutoReconnectRealWiimote", &m_WiiAutoReconnect[i], false);
|
||||
}
|
||||
ini.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "wiimote.ini").c_str());
|
||||
ini.Load((File::GetUserPath(D_CONFIG_IDX) + "wiimote.ini"));
|
||||
ini.Get("Real", "Unpair", &m_WiiAutoUnpair, false);
|
||||
|
||||
}
|
||||
|
||||
@@ -497,11 +497,11 @@ static inline std::string GenerateScreenshotName()
|
||||
int index = 1;
|
||||
std::string tempname, name;
|
||||
std::string gameId = SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID();
|
||||
tempname = std::string(File::GetUserPath(D_SCREENSHOTS_IDX)) + gameId + DIR_SEP_CHR;
|
||||
tempname = File::GetUserPath(D_SCREENSHOTS_IDX) + gameId + DIR_SEP_CHR;
|
||||
|
||||
if (!File::CreateFullPath(tempname.c_str())) {
|
||||
//fallback to old-style screenshots, without folder.
|
||||
tempname = std::string(File::GetUserPath(D_SCREENSHOTS_IDX));
|
||||
tempname = File::GetUserPath(D_SCREENSHOTS_IDX);
|
||||
}
|
||||
//append gameId, tempname only contains the folder here.
|
||||
tempname += gameId;
|
||||
|
||||
@@ -327,7 +327,7 @@ void SCoreStartupParameter::CheckMemcardPath(std::string& memcardPath, std::stri
|
||||
{
|
||||
// Use default memcard path if there is no user defined name
|
||||
std::string defaultFilename = isSlotA ? GC_MEMCARDA : GC_MEMCARDB;
|
||||
memcardPath = std::string(File::GetUserPath(D_GCUSER_IDX)) + defaultFilename + ext;
|
||||
memcardPath = File::GetUserPath(D_GCUSER_IDX) + defaultFilename + ext;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -49,9 +49,8 @@ DSPDisassembler::DSPDisassembler(const AssemblerSettings &settings)
|
||||
DSPDisassembler::~DSPDisassembler()
|
||||
{
|
||||
// Some old code for logging unknown ops.
|
||||
char filename[MAX_PATH];
|
||||
sprintf(filename, "%sUnkOps.txt", File::GetUserPath(D_DUMPDSP_IDX));
|
||||
FILE *uo = fopen(filename, "w");
|
||||
std::string filename = File::GetUserPath(D_DUMPDSP_IDX) + "UnkOps.txt";
|
||||
FILE *uo = fopen(filename.c_str(), "w");
|
||||
if (!uo)
|
||||
return;
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ void CUCode_Rom::BootUCode()
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
char binFile[MAX_PATH];
|
||||
sprintf(binFile, "%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX), ector_crc);
|
||||
sprintf(binFile, "%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX).c_str(), ector_crc);
|
||||
|
||||
FILE* pFile = fopen(binFile, "wb");
|
||||
if (pFile)
|
||||
|
||||
@@ -146,7 +146,7 @@ void IUCode::PrepareBootUCode(u32 mail)
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
char binFile[MAX_PATH];
|
||||
sprintf(binFile, "%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX), ector_crc);
|
||||
sprintf(binFile, "%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX).c_str(), ector_crc);
|
||||
|
||||
FILE* pFile = fopen(binFile, "wb");
|
||||
if (pFile)
|
||||
|
||||
@@ -106,20 +106,14 @@ void DSPLLE::Initialize(void *hWnd, bool bWii, bool bDSPThread)
|
||||
m_bDSPThread = bDSPThread;
|
||||
m_InitMixer = false;
|
||||
bool bCanWork = true;
|
||||
char irom_file[MAX_PATH];
|
||||
char coef_file[MAX_PATH];
|
||||
std::string irom_file = File::GetSysDirectory() + GC_SYS_DIR DIR_SEP DSP_IROM;
|
||||
std::string coef_file = File::GetSysDirectory() + GC_SYS_DIR DIR_SEP DSP_COEF;
|
||||
|
||||
snprintf(irom_file, MAX_PATH, "%s%s",
|
||||
File::GetSysDirectory().c_str(), GC_SYS_DIR DIR_SEP DSP_IROM);
|
||||
if (!File::Exists(irom_file))
|
||||
snprintf(irom_file, MAX_PATH, "%s%s",
|
||||
File::GetUserPath(D_GCUSER_IDX), DIR_SEP DSP_IROM);
|
||||
snprintf(coef_file, MAX_PATH, "%s%s",
|
||||
File::GetSysDirectory().c_str(), GC_SYS_DIR DIR_SEP DSP_COEF);
|
||||
if (!File::Exists(coef_file))
|
||||
snprintf(coef_file, MAX_PATH, "%s%s",
|
||||
File::GetUserPath(D_GCUSER_IDX), DIR_SEP DSP_COEF);
|
||||
bCanWork = DSPCore_Init(irom_file, coef_file, AudioCommon::UseJIT());
|
||||
if (!File::Exists(irom_file.c_str()))
|
||||
irom_file = File::GetUserPath(D_GCUSER_IDX) + DIR_SEP DSP_IROM;
|
||||
if (!File::Exists(coef_file.c_str()))
|
||||
coef_file = File::GetUserPath(D_GCUSER_IDX) + DIR_SEP DSP_COEF;
|
||||
bCanWork = DSPCore_Init(irom_file.c_str(), coef_file.c_str(), AudioCommon::UseJIT());
|
||||
|
||||
g_dsp.cpu_ram = Memory::GetPointer(0);
|
||||
DSPCore_Reset();
|
||||
|
||||
@@ -32,8 +32,8 @@ bool DumpDSPCode(const u8 *code_be, int size_in_bytes, u32 crc)
|
||||
{
|
||||
char binFile[MAX_PATH];
|
||||
char txtFile[MAX_PATH];
|
||||
sprintf(binFile, "%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX), crc);
|
||||
sprintf(txtFile, "%sDSP_UC_%08X.txt", File::GetUserPath(D_DUMPDSP_IDX), crc);
|
||||
sprintf(binFile, "%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX).c_str(), crc);
|
||||
sprintf(txtFile, "%sDSP_UC_%08X.txt", File::GetUserPath(D_DUMPDSP_IDX).c_str(), crc);
|
||||
|
||||
FILE* pFile = fopen(binFile, "wb");
|
||||
if (pFile)
|
||||
@@ -70,9 +70,8 @@ bool DumpDSPCode(const u8 *code_be, int size_in_bytes, u32 crc)
|
||||
// TODO make this useful :p
|
||||
bool DumpCWCode(u32 _Address, u32 _Length)
|
||||
{
|
||||
char filename[256];
|
||||
sprintf(filename, "%sDSP_UCode.bin", File::GetUserPath(D_DUMPDSP_IDX));
|
||||
FILE* pFile = fopen(filename, "wb");
|
||||
std::string filename = File::GetUserPath(D_DUMPDSP_IDX) + "DSP_UCode.bin";
|
||||
FILE* pFile = fopen(filename.c_str(), "wb");
|
||||
|
||||
if (pFile != NULL)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user