diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index d0612e61a0..3d6a3e9a25 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -630,7 +630,7 @@ bool Delete(const Path &filename, bool quiet) { } // Returns true if successful, or path already exists. -bool CreateDir(const Path &path) { +bool CreateDir(const Path &path, bool quiet) { if (SIMULATE_SLOW_IO) { sleep_ms(100, "slow-io-sim"); INFO_LOG(Log::IO, "CreateDir %s", path.c_str()); @@ -651,11 +651,15 @@ bool CreateDir(const Path &path) { AndroidContentURI uri(path.ToString()); std::string newDirName = uri.GetLastPart(); if (uri.NavigateUp()) { - INFO_LOG(Log::IO, "Calling Android_CreateDirectory(%s, %s)", uri.ToString().c_str(), newDirName.c_str()); + if (!quiet) { + INFO_LOG(Log::IO, "Calling Android_CreateDirectory(%s, %s)", uri.ToString().c_str(), newDirName.c_str()); + } return Android_CreateDirectory(uri.ToString(), newDirName) == StorageError::SUCCESS; } else { // Bad path - can't create this directory. - WARN_LOG(Log::IO, "CreateDir failed: '%s'", path.c_str()); + if (!quiet) { + WARN_LOG(Log::IO, "CreateDir failed: '%s'", path.c_str()); + } return false; } break; @@ -686,10 +690,14 @@ bool CreateDir(const Path &path) { DWORD error = GetLastError(); if (error == ERROR_ALREADY_EXISTS) { - DEBUG_LOG(Log::IO, "CreateDir: CreateDirectory failed on %s: already exists", path.c_str()); + if (!quiet) { + DEBUG_LOG(Log::IO, "CreateDir: CreateDirectory failed on %s: already exists", path.c_str()); + } return true; } - ERROR_LOG(Log::IO, "CreateDir: CreateDirectory failed on %s: %08x %s", path.c_str(), (uint32_t)error, GetStringErrorMsg(error).c_str()); + if (!quiet) { + ERROR_LOG(Log::IO, "CreateDir: CreateDirectory failed on %s: %08x %s", path.c_str(), (uint32_t)error, GetStringErrorMsg(error).c_str()); + } return false; #else if (mkdir(path.ToString().c_str(), 0755) == 0) { @@ -698,11 +706,15 @@ bool CreateDir(const Path &path) { int err = errno; if (err == EEXIST) { - DEBUG_LOG(Log::IO, "CreateDir: mkdir failed on %s: already exists", path.c_str()); + if (!quiet) { + DEBUG_LOG(Log::IO, "CreateDir: mkdir failed on %s: already exists", path.c_str()); + } return true; } - ERROR_LOG(Log::IO, "CreateDir: mkdir failed on %s: %s", path.c_str(), strerror(err)); + if (!quiet) { + ERROR_LOG(Log::IO, "CreateDir: mkdir failed on %s: %s", path.c_str(), strerror(err)); + } return false; #endif } diff --git a/Common/File/FileUtil.h b/Common/File/FileUtil.h index 7d078d8167..054b6c9d33 100644 --- a/Common/File/FileUtil.h +++ b/Common/File/FileUtil.h @@ -86,7 +86,7 @@ uint64_t GetFileSize(FILE *f); uint64_t ComputeRecursiveDirectorySize(const Path &path); // Returns true if successful, or path already exists. -bool CreateDir(const Path &filename); +bool CreateDir(const Path &filename, bool quiet = false); void ChangeMTime(const Path &path, time_t mtime); diff --git a/Common/Log/LogManager.cpp b/Common/Log/LogManager.cpp index fc1cdab996..c6e6ca32f0 100644 --- a/Common/Log/LogManager.cpp +++ b/Common/Log/LogManager.cpp @@ -69,50 +69,50 @@ void GenericLog(Log type, LogLevel level, const char *file, int line, const char // NOTE: Needs to be kept in sync with the Log enum. static const char * const g_logTypeNames[] = { - "SYSTEM", - "BOOT", - "COMMON", + "System", + "Boot", + "Common", "CPU", - "FILESYS", + "FileSystem", "G3D", - "TEXCACHE", + "TexCache", "HLE", "JIT", - "LOADER", - "MPEG", - "ATRAC", - "ME", // Rest of the media Engine - "MEMMAP", - "SASMIX", - "SAVESTATE", - "FRAMEBUF", - "AUDIO", + "Loader", + "Mpeg", + "Atrac", + "ME", + "MemMap", + "SasMix", + "SaveState", + "FrameBuf", + "Audio", "IO", - "ACHIEVEMENTS", + "Achievements", "HTTP", - "PRINTF", - "TEXREPLACE", - "DEBUGGER", - "GEDEBUGGER", + "Printf", + "TexReplacement", + "Debugger", + "GeDebugger", "UI", "IAP", - "CWCHEATS", - "NET", - "SCEAUDIO", - "SCECTRL", - "SCEDISP", - "SCEFONT", - "SCEGE", - "SCEINTC", - "SCEIO", - "SCEKERNEL", - "SCEMODULE", - "SCENET", - "SCERTC", - "SCESAS", - "SCEUTIL", - "SCEMISC", - "SCEREG", + "CwCheats", + "Net", + "sceAudio", + "sceCtrl", + "sceDisplay", + "sceFont", + "sceGe", + "sceIntc", + "sceIo", + "sceKernel", + "sceModule", + "sceNet", + "sceRtc", + "sceSas", + "sceUtility", + "sceMisc", + "sceReg", }; const char *LogManager::GetLogTypeName(Log type) { diff --git a/Core/CmdLine.cpp b/Core/CmdLine.cpp index 225d60dc7d..6e7508aa02 100644 --- a/Core/CmdLine.cpp +++ b/Core/CmdLine.cpp @@ -213,8 +213,14 @@ int CommandLineOptions::PrintUsage(const char *progname, const char *situationTe } } - PRINT_STDOUT("Usage: %s [options] [FILE]\n\n", progname); - PRINT_STDOUT("Launches FILE (e.g. ISO image) if present.\n"); + if (mode == CmdLineMode::Application) { + PRINT_STDOUT("Usage: %s [options] [FILE]\n\n", progname); + } else { + PRINT_STDOUT("Usage: %s [options] [FILE1] [FILE2] [FILE3]...\n\n", progname); + } + + PRINT_STDOUT("Launches FILE (for example, an ISO image) if present.\n"); + PRINT_STDOUT("See headless/README.md for more details.\n\n"); PRINT_STDOUT("Options:\n"); PRINT_STDOUT(" -h, --help show this message and exit\n"); PRINT_STDOUT(" --version show version information and exit\n"); diff --git a/Core/HLE/sceReg.cpp b/Core/HLE/sceReg.cpp index 8eb36ee349..4c8331eaec 100644 --- a/Core/HLE/sceReg.cpp +++ b/Core/HLE/sceReg.cpp @@ -60,6 +60,7 @@ struct KeyValue { // TODO: /DATA/FONT/PROPERTY could just be generated from our fontRegistry in sceFont.cpp. // Partial dump of the PSP registry using tests/misc/reg.prx in pspautotests +// TODO: We will need something more dynamic if we want to support writes, too. // Dump of /DATA/FONT/PROPERTY/INFO0 static const KeyValue tree_DATA_FONT_PROPERTY_INFO0[] = { diff --git a/headless/Headless.cpp b/headless/Headless.cpp index dd7d75cc54..ecb652749a 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -1,6 +1,6 @@ // Headless version of PPSSPP, for testing using http://code.google.com/p/pspautotests/ . -// See headless.txt. +// See headless/README.md. // To build on non-windows systems, just run CMake in the SDL directory, it will build both a normal ppsspp and the headless version. // // Example command line to run a test in the VS debugger (useful to debug failures): @@ -134,7 +134,6 @@ int printUsage(const CommandLineOptions &options, const char *progname, const ch fprintf(stderr, " --max-mse=NUMBER maximum allowed MSE error for screenshot\n"); fprintf(stderr, " --timeout=SECONDS abort test it if takes longer than SECONDS\n"); fprintf(stderr, " --ir use ir interpreter\n"); - fprintf(stderr, "\nSee headless.txt for details.\n"); return 1; } @@ -615,7 +614,7 @@ int main(int argc, const char* argv[]) { #if PPSSPP_PLATFORM(WINDOWS) // Mount a filesystem g_Config.memStickDirectory = exePath / "memstick"; - File::CreateDir(g_Config.memStickDirectory); + File::CreateDir(g_Config.memStickDirectory, true); CreateSysDirectories(); #elif !PPSSPP_PLATFORM(ANDROID) g_Config.memStickDirectory = Path(std::string(getenv("HOME"))) / ".ppsspp";