1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 12:12:50 +01:00

File utility improved

+ minor fixes
This commit is contained in:
Nekotekina 2016-01-06 02:52:48 +03:00
parent 5029dff73a
commit b3e3c68f15
75 changed files with 839 additions and 964 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,8 @@
#pragma once #pragma once
enum class fsm : u32 // file seek mode
{
begin,
cur,
end,
};
namespace fom // file open mode namespace fom // file open mode
{ {
enum : u32 enum open_mode : u32
{ {
read = 1 << 0, // enable reading read = 1 << 0, // enable reading
write = 1 << 1, // enable writing write = 1 << 1, // enable writing
@ -18,19 +11,18 @@ namespace fom // file open mode
trunc = 1 << 4, // clear opened file if it's not empty trunc = 1 << 4, // clear opened file if it's not empty
excl = 1 << 5, // failure if the file already exists (used with `create`) excl = 1 << 5, // failure if the file already exists (used with `create`)
rewrite = write | create | trunc, // write + create + trunc rewrite = write | create | trunc,
}; };
}; };
enum class fse : u32 // filesystem (file or dir) error
{
ok, // no error
invalid_arguments,
};
namespace fs namespace fs
{ {
thread_local extern fse g_tls_error; enum seek_mode : u32 // file seek mode
{
seek_set,
seek_cur,
seek_end,
};
struct stat_t struct stat_t
{ {
@ -42,6 +34,9 @@ namespace fs
s64 ctime; s64 ctime;
}; };
// Get parent directory for the path (returns empty string on failure)
std::string get_parent_dir(const std::string& path);
// Get file information // Get file information
bool stat(const std::string& path, stat_t& info); bool stat(const std::string& path, stat_t& info);
@ -49,16 +44,16 @@ namespace fs
bool exists(const std::string& path); bool exists(const std::string& path);
// Check whether the file exists and is NOT a directory // Check whether the file exists and is NOT a directory
bool is_file(const std::string& file); bool is_file(const std::string& path);
// Check whether the directory exists and is NOT a file // Check whether the directory exists and is NOT a file
bool is_dir(const std::string& dir); bool is_dir(const std::string& path);
// Delete empty directory // Delete empty directory
bool remove_dir(const std::string& dir); bool remove_dir(const std::string& path);
// Create directory // Create directory
bool create_dir(const std::string& dir); bool create_dir(const std::string& path);
// Create directories // Create directories
bool create_path(const std::string& path); bool create_path(const std::string& path);
@ -70,10 +65,10 @@ namespace fs
bool copy_file(const std::string& from, const std::string& to, bool overwrite); bool copy_file(const std::string& from, const std::string& to, bool overwrite);
// Delete file // Delete file
bool remove_file(const std::string& file); bool remove_file(const std::string& path);
// Change file size (possibly appending zeros) // Change file size (possibly appending zeros)
bool truncate_file(const std::string& file, u64 length); bool truncate_file(const std::string& path, u64 length);
class file final class file final
{ {
@ -83,14 +78,15 @@ namespace fs
handle_type m_fd = null; handle_type m_fd = null;
friend class file_ptr; friend class file_read_map;
friend class file_write_map;
public: public:
file() = default; file() = default;
explicit file(const std::string& filename, u32 mode = fom::read) explicit file(const std::string& path, u32 mode = fom::read)
{ {
open(filename, mode); open(path, mode);
} }
file(file&& other) file(file&& other)
@ -120,7 +116,7 @@ namespace fs
} }
// Open specified file with specified mode // Open specified file with specified mode
bool open(const std::string& filename, u32 mode = fom::read); bool open(const std::string& path, u32 mode = fom::read);
// Change file size (possibly appending zero bytes) // Change file size (possibly appending zero bytes)
bool trunc(u64 size) const; bool trunc(u64 size) const;
@ -129,7 +125,7 @@ namespace fs
bool stat(stat_t& info) const; bool stat(stat_t& info) const;
// Close the file explicitly (destructor automatically closes the file) // Close the file explicitly (destructor automatically closes the file)
bool close(); void close();
// Read the data from the file and return the amount of data written in buffer // Read the data from the file and return the amount of data written in buffer
u64 read(void* buffer, u64 count) const; u64 read(void* buffer, u64 count) const;
@ -138,92 +134,148 @@ namespace fs
u64 write(const void* buffer, u64 count) const; u64 write(const void* buffer, u64 count) const;
// Move file pointer // Move file pointer
u64 seek(s64 offset, fsm seek_mode = fsm::begin) const; u64 seek(s64 offset, seek_mode whence = seek_set) const;
// Get file size // Get file size
u64 size() const; u64 size() const;
// Write std::string // Write std::string unconditionally
const file& operator <<(const std::string& str) const const file& write(const std::string& str) const
{ {
CHECK_ASSERTION(write(str.data(), str.size()) == str.size()); CHECK_ASSERTION(write(str.data(), str.size()) == str.size());
return *this; return *this;
} }
// Write POD // Write POD unconditionally
template<typename T> template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, const file&> operator <<(const T& data) const std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, const file&> write(const T& data) const
{ {
CHECK_ASSERTION(write(std::addressof(data), sizeof(T)) == sizeof(T)); CHECK_ASSERTION(write(std::addressof(data), sizeof(T)) == sizeof(T));
return *this; return *this;
} }
// Write POD std::vector // Write POD std::vector unconditionally
template<typename T> template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, const file&> operator <<(const std::vector<T>& vec) const std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, const file&> write(const std::vector<T>& vec) const
{ {
CHECK_ASSERTION(write(vec.data(), vec.size() * sizeof(T)) == vec.size() * sizeof(T)); CHECK_ASSERTION(write(vec.data(), vec.size() * sizeof(T)) == vec.size() * sizeof(T));
return *this; return *this;
} }
// Read std::string // Read std::string, size must be set by resize() method
bool read(std::string& str) const bool read(std::string& str) const
{ {
return read(&str[0], str.size()) == str.size(); return read(&str[0], str.size()) == str.size();
} }
// Read POD // Read POD, sizeof(T) is used
template<typename T> template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(T& data) const std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(T& data) const
{ {
return read(&data, sizeof(T)) == sizeof(T); return read(&data, sizeof(T)) == sizeof(T);
} }
// Read POD std::vector // Read POD std::vector, size must be set by resize() method
template<typename T> template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(std::vector<T>& vec) const std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, bool> read(std::vector<T>& vec) const
{ {
return read(vec.data(), sizeof(T) * vec.size()) == sizeof(T) * vec.size(); return read(vec.data(), sizeof(T) * vec.size()) == sizeof(T) * vec.size();
} }
// Convert to std::string // Read POD (experimental)
operator std::string() const template<typename T>
std::enable_if_t<std::is_pod<T>::value && !std::is_pointer<T>::value, T> read() const
{
T result;
CHECK_ASSERTION(read(result));
return result;
}
// Read full file to std::string
std::string to_string() const
{ {
std::string result; std::string result;
result.resize(size() - seek(0, fsm::cur)); result.resize(size());
CHECK_ASSERTION(read(result)); CHECK_ASSERTION(seek(0) != -1 && read(result));
return result; return result;
} }
}; };
class file_ptr final // TODO
class file_read_map final
{ {
char* m_ptr = nullptr; char* m_ptr = nullptr;
u64 m_size; u64 m_size;
public: public:
file_ptr() = default; file_read_map() = default;
file_ptr(file_ptr&& right) file_read_map(file_read_map&& right)
: m_ptr(right.m_ptr) : m_ptr(right.m_ptr)
, m_size(right.m_size) , m_size(right.m_size)
{ {
right.m_ptr = 0; right.m_ptr = 0;
} }
file_ptr& operator =(file_ptr&& right) file_read_map& operator =(file_read_map&& right)
{ {
std::swap(m_ptr, right.m_ptr); std::swap(m_ptr, right.m_ptr);
std::swap(m_size, right.m_size); std::swap(m_size, right.m_size);
return *this; return *this;
} }
file_ptr(const file& f) file_read_map(const file& f)
{ {
reset(f); reset(f);
} }
~file_ptr() ~file_read_map()
{
reset();
}
// Open file mapping
void reset(const file& f);
// Close file mapping
void reset();
// Get pointer
operator const char*() const
{
return m_ptr;
}
};
// TODO
class file_write_map final
{
char* m_ptr = nullptr;
u64 m_size;
public:
file_write_map() = default;
file_write_map(file_write_map&& right)
: m_ptr(right.m_ptr)
, m_size(right.m_size)
{
right.m_ptr = 0;
}
file_write_map& operator =(file_write_map&& right)
{
std::swap(m_ptr, right.m_ptr);
std::swap(m_size, right.m_size);
return *this;
}
file_write_map(const file& f)
{
reset(f);
}
~file_write_map()
{ {
reset(); reset();
} }
@ -285,7 +337,7 @@ namespace fs
bool open(const std::string& dirname); bool open(const std::string& dirname);
// Close the directory explicitly (destructor automatically closes the directory) // Close the directory explicitly (destructor automatically closes the directory)
bool close(); void close();
// Get next directory entry (UTF-8 name and file stat) // Get next directory entry (UTF-8 name and file stat)
bool read(std::string& name, stat_t& info); bool read(std::string& name, stat_t& info);
@ -318,18 +370,16 @@ namespace fs
return; return;
} }
bool is_ok;
if (mode_ == mode::from_first) if (mode_ == mode::from_first)
{ {
is_ok = m_parent->first(m_entry.name, m_entry.info); m_parent->first(m_entry.name, m_entry.info);
} }
else else
{ {
is_ok = m_parent->read(m_entry.name, m_entry.info); m_parent->read(m_entry.name, m_entry.info);
} }
if (!is_ok) if (m_entry.name.empty())
{ {
m_parent = nullptr; m_parent = nullptr;
} }
@ -364,8 +414,8 @@ namespace fs
}; };
// Get configuration directory // Get configuration directory
std::string get_config_dir(); const std::string& get_config_dir();
// Get executable directory // Get executable directory
std::string get_executable_dir(); const std::string& get_executable_dir();
} }

View File

@ -126,7 +126,7 @@ struct FileListener : LogListener
} }
} }
mFile << text; mFile.write(text);
} }
}; };
@ -261,25 +261,5 @@ void log_message(Log::LogType type, Log::Severity sev, const char* text)
void log_message(Log::LogType type, Log::Severity sev, std::string text) void log_message(Log::LogType type, Log::Severity sev, std::string text)
{ {
if (g_log_manager)
{
g_log_manager->log({ type, sev, std::move(text) }); g_log_manager->log({ type, sev, std::move(text) });
}
else
{
const auto severity =
sev == Severity::Notice ? "Notice" :
sev == Severity::Warning ? "Warning" :
sev == Severity::Success ? "Success" :
sev == Severity::Error ? "Error" : "Unknown";
#ifdef _WIN32
MessageBoxA(0, text.c_str(), severity,
sev == Severity::Notice ? MB_ICONINFORMATION :
sev == Severity::Warning ? MB_ICONEXCLAMATION :
sev == Severity::Error ? MB_ICONERROR : MB_ICONINFORMATION);
#else
std::printf("[Log:%s] %s\n", severity, text.c_str());
#endif
}
} }

View File

@ -19,7 +19,7 @@
#include <ucontext.h> #include <ucontext.h>
#endif #endif
void report_fatal_error(const std::string& msg) static void report_fatal_error(const std::string& msg)
{ {
#ifdef _WIN32 #ifdef _WIN32
const auto& text = msg + "\n\nPlease report this error to the developers. Press (Ctrl+C) to copy this message."; const auto& text = msg + "\n\nPlease report this error to the developers. Press (Ctrl+C) to copy this message.";
@ -1148,7 +1148,7 @@ void prepare_throw_access_violation(x64_context* context, const char* cause, u32
#ifdef _WIN32 #ifdef _WIN32
const auto g_exception_handler = AddVectoredExceptionHandler(1, [](PEXCEPTION_POINTERS pExp) -> LONG static LONG exception_handler(PEXCEPTION_POINTERS pExp)
{ {
const u64 addr64 = pExp->ExceptionRecord->ExceptionInformation[1] - (u64)vm::base(0); const u64 addr64 = pExp->ExceptionRecord->ExceptionInformation[1] - (u64)vm::base(0);
const bool is_writing = pExp->ExceptionRecord->ExceptionInformation[0] != 0; const bool is_writing = pExp->ExceptionRecord->ExceptionInformation[0] != 0;
@ -1161,9 +1161,9 @@ const auto g_exception_handler = AddVectoredExceptionHandler(1, [](PEXCEPTION_PO
{ {
return EXCEPTION_CONTINUE_SEARCH; return EXCEPTION_CONTINUE_SEARCH;
} }
}); }
const auto g_exception_filter = SetUnhandledExceptionFilter([](PEXCEPTION_POINTERS pExp) -> LONG static LONG exception_filter(PEXCEPTION_POINTERS pExp)
{ {
std::string msg = fmt::format("Unhandled Win32 exception 0x%08X.\n", pExp->ExceptionRecord->ExceptionCode); std::string msg = fmt::format("Unhandled Win32 exception 0x%08X.\n", pExp->ExceptionRecord->ExceptionCode);
@ -1191,16 +1191,36 @@ const auto g_exception_filter = SetUnhandledExceptionFilter([](PEXCEPTION_POINTE
} }
} }
msg += fmt::format("Instruction address: %p.\n", pExp->ContextRecord->Rip);
msg += fmt::format("Image base: %p.", GetModuleHandle(NULL)); msg += fmt::format("Image base: %p.", GetModuleHandle(NULL));
// TODO: print registers and the callstack
// Report fatal error // Report fatal error
report_fatal_error(msg); report_fatal_error(msg);
return EXCEPTION_CONTINUE_SEARCH; return EXCEPTION_CONTINUE_SEARCH;
}); }
const bool g_exception_handler_set = []() -> bool
{
if (!AddVectoredExceptionHandler(1, (PVECTORED_EXCEPTION_HANDLER)exception_handler))
{
report_fatal_error("AddVectoredExceptionHandler() failed.");
std::abort();
}
if (!SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)exception_filter))
{
report_fatal_error("SetUnhandledExceptionFilter() failed.");
std::abort();
}
return true;
}();
#else #else
void signal_handler(int sig, siginfo_t* info, void* uct) static void signal_handler(int sig, siginfo_t* info, void* uct)
{ {
x64_context* context = (ucontext_t*)uct; x64_context* context = (ucontext_t*)uct;
@ -1230,17 +1250,21 @@ void signal_handler(int sig, siginfo_t* info, void* uct)
} }
} }
int setup_signal_handler() const bool g_exception_handler_set = []() -> bool
{ {
struct sigaction sa; struct ::sigaction sa;
sa.sa_flags = SA_SIGINFO; sa.sa_flags = SA_SIGINFO;
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_sigaction = signal_handler; sa.sa_sigaction = signal_handler;
return sigaction(SIGSEGV, &sa, NULL);
}
const int g_sigaction_result = setup_signal_handler(); if (::sigaction(SIGSEGV, &sa, NULL) == -1)
{
std::printf("sigaction() failed (0x%x).", errno);
std::abort();
}
return true;
}();
#endif #endif
@ -1253,16 +1277,6 @@ void thread_ctrl::initialize()
{ {
SetCurrentThreadDebugName(g_tls_this_thread->m_name().c_str()); SetCurrentThreadDebugName(g_tls_this_thread->m_name().c_str());
#ifdef _WIN32
if (!g_exception_handler || !g_exception_filter)
#else
if (g_sigaction_result == -1)
#endif
{
report_fatal_error("Exception handler is not set correctly.");
std::abort();
}
// TODO // TODO
g_thread_count++; g_thread_count++;
} }

View File

@ -30,14 +30,14 @@ namespace convert
{ {
static bool func(const std::string& value) static bool func(const std::string& value)
{ {
return value == "true" ? true : false; return value == "true" ? true : value == "false" ? false : throw std::invalid_argument(__FUNCTION__);
} }
}; };
template<> template<>
struct to_impl_t<std::string, char> struct to_impl_t<std::string, signed char>
{ {
static std::string func(char value) static std::string func(signed char value)
{ {
return std::to_string(value); return std::to_string(value);
} }

View File

@ -10,7 +10,6 @@
#ifndef _WIN32 #ifndef _WIN32
#include <dirent.h> #include <dirent.h>
#include <errno.h>
#endif #endif
#include "rPlatform.h" #include "rPlatform.h"

View File

@ -139,12 +139,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrc", "wxWidgets\build\msw\
{24C45343-FD20-5C92-81C1-35A2AE841E79} = {24C45343-FD20-5C92-81C1-35A2AE841E79} {24C45343-FD20-5C92-81C1-35A2AE841E79} = {24C45343-FD20-5C92-81C1-35A2AE841E79}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "stblib", "stblib", "{9D839DFB-76E6-4F10-8EED-BA2AC7CC3FB6}"
ProjectSection(SolutionItems) = preProject
stblib\stb_image.c = stblib\stb_image.c
stblib\stb_image.h = stblib\stb_image.h
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ribbon", "wxWidgets\build\msw\wx_ribbon.vcxproj", "{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ribbon", "wxWidgets\build\msw\wx_ribbon.vcxproj", "{87B42A9C-3F5C-53D7-9017-2B1CAE39457D}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{24C45343-FD20-5C92-81C1-35A2AE841E79} = {24C45343-FD20-5C92-81C1-35A2AE841E79} {24C45343-FD20-5C92-81C1-35A2AE841E79} = {24C45343-FD20-5C92-81C1-35A2AE841E79}
@ -181,8 +175,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_custom_build", "wxWidgets\
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_setup_h", "rpcs3\copy_setup_h.vcxproj", "{00D36322-6188-4A66-B514-3B3F183E998D}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_setup_h", "rpcs3\copy_setup_h.vcxproj", "{00D36322-6188-4A66-B514-3B3F183E998D}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GSRender", "GSRender", "{1A43FD7A-C7DD-4D04-A4D6-FAA194AAD9D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3D12GSRender", "rpcs3\D3D12GSRender.vcxproj", "{FAC9B17B-F4B8-4B75-8AEB-C8C7CB92B078}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "D3D12GSRender", "rpcs3\D3D12GSRender.vcxproj", "{FAC9B17B-F4B8-4B75-8AEB-C8C7CB92B078}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3-tests", "rpcs3-tests\rpcs3-tests.vcxproj", "{AB222E8A-00CA-4ACF-A87E-5251C16C0587}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3-tests", "rpcs3-tests\rpcs3-tests.vcxproj", "{AB222E8A-00CA-4ACF-A87E-5251C16C0587}"

View File

@ -156,6 +156,7 @@ GLOB_RECURSE
RPCS3_SRC RPCS3_SRC
"${RPCS3_SRC_DIR}/rpcs3.cpp" "${RPCS3_SRC_DIR}/rpcs3.cpp"
"${RPCS3_SRC_DIR}/config.cpp" "${RPCS3_SRC_DIR}/config.cpp"
"${RPCS3_SRC_DIR}/stb_image.cpp"
"${RPCS3_SRC_DIR}/../Utilities/GNU.cpp" "${RPCS3_SRC_DIR}/../Utilities/GNU.cpp"
"${RPCS3_SRC_DIR}/Emu/*" "${RPCS3_SRC_DIR}/Emu/*"
"${RPCS3_SRC_DIR}/Gui/*" "${RPCS3_SRC_DIR}/Gui/*"

View File

@ -62,7 +62,7 @@ bool pkg_install(const fs::file& pkg_f, const std::string& dir, volatile f64& pr
const std::size_t BUF_SIZE = 8192 * 1024; // 8 MB const std::size_t BUF_SIZE = 8192 * 1024; // 8 MB
// Save current file offset (probably zero) // Save current file offset (probably zero)
const u64 start_offset = pkg_f.seek(0, fsm::cur); const u64 start_offset = pkg_f.seek(0, fs::seek_cur);
// Get basic PKG information // Get basic PKG information
PKGHeader header; PKGHeader header;

View File

@ -1330,6 +1330,8 @@ bool CheckDebugSelf(const std::string& self, const std::string& elf)
bool DecryptSelf(const std::string& elf, const std::string& self) bool DecryptSelf(const std::string& elf, const std::string& self)
{ {
LOG_NOTICE(GENERAL, "Decrypting %s", self);
// Check for a debug SELF first. // Check for a debug SELF first.
if (!CheckDebugSelf(self, elf)) if (!CheckDebugSelf(self, elf))
{ {

View File

@ -61,66 +61,7 @@
<Import Project="..\rpcs3_llvm.props" /> <Import Project="..\rpcs3_llvm.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'"> <ItemDefinitionGroup>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<AdditionalDependencies />
<AdditionalLibraryDirectories />
</Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<AdditionalDependencies />
<AdditionalLibraryDirectories />
</Lib>
<ClCompile> <ClCompile>
<TreatWarningAsError>true</TreatWarningAsError> <TreatWarningAsError>true</TreatWarningAsError>
</ClCompile> </ClCompile>

View File

@ -1,24 +1,10 @@
#include "stdafx.h" #include "stdafx.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "AudioManager.h" #include "AudioManager.h"
#include "Emu/state.h"
AudioManager::AudioManager() : m_audio_out(nullptr)
{
}
AudioManager::~AudioManager()
{
Close();
}
void AudioManager::Init() void AudioManager::Init()
{ {
if (m_audio_out) return; if (!m_audio_out) m_audio_out = Emu.GetCallbacks().get_audio();
m_audio_info.Init();
m_audio_out = Emu.GetCallbacks().get_audio();
} }
void AudioManager::Close() void AudioManager::Close()

View File

@ -2,29 +2,13 @@
#include "AudioThread.h" #include "AudioThread.h"
// it cannot be configured currently, and it must NOT use cellSysutil definitions
struct AudioInfo
{
AudioInfo()
{
}
void Init()
{
}
};
class AudioManager class AudioManager
{ {
AudioInfo m_audio_info;
std::shared_ptr<AudioThread> m_audio_out; std::shared_ptr<AudioThread> m_audio_out;
public:
AudioManager();
~AudioManager();
public:
void Init(); void Init();
void Close(); void Close();
AudioThread& GetAudioOut() { assert(m_audio_out); return *m_audio_out; } AudioThread& GetAudioOut() { return *m_audio_out; }
AudioInfo& GetInfo() { return m_audio_info; }
}; };

View File

@ -3,9 +3,11 @@
#include "Emu/Audio/AudioThread.h" #include "Emu/Audio/AudioThread.h"
#pragma push_macro("_WIN32_WINNT")
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0601 // This is to be sure that correct (2.7) header is included #define _WIN32_WINNT 0x0601 // This is to be sure that correct (2.7) header is included
#include "minidx9/Include/XAudio2.h" // XAudio2 2.8 available only on Win8+, used XAudio2 2.7 from dxsdk #include "minidx9/Include/XAudio2.h" // XAudio2 2.8 available only on Win8+, used XAudio2 2.7 from dxsdk
#undef _WIN32_WINNT #pragma pop_macro("_WIN32_WINNT")
class XAudio2Thread : public AudioThread class XAudio2Thread : public AudioThread
{ {

View File

@ -1017,6 +1017,8 @@ enum : u32
{ {
MFF_FORCED_HLE = (1 << 0), // always call HLE function MFF_FORCED_HLE = (1 << 0), // always call HLE function
MFF_NO_RETURN = (1 << 1), // uses EIF_USE_BRANCH flag with LLE, ignored with MFF_FORCED_HLE MFF_NO_RETURN = (1 << 1), // uses EIF_USE_BRANCH flag with LLE, ignored with MFF_FORCED_HLE
MFF_PERFECT = /* 0 */ MFF_FORCED_HLE, // can be set for fully implemented functions with LLE compatibility
}; };
// flags passed with index // flags passed with index

View File

@ -31,7 +31,7 @@ spu_recompiler::spu_recompiler()
LOG_SUCCESS(SPU, "SPU Recompiler (ASMJIT) created..."); LOG_SUCCESS(SPU, "SPU Recompiler (ASMJIT) created...");
fs::file(fs::get_config_dir() + "SPUJIT.log", fom::rewrite) << fmt::format("SPU JIT initialization...\n\nTitle: %s\nTitle ID: %s\n\n", Emu.GetTitle().c_str(), Emu.GetTitleID().c_str()); fs::file(fs::get_config_dir() + "SPUJIT.log", fom::rewrite).write(fmt::format("SPU JIT initialization...\n\nTitle: %s\nTitle ID: %s\n\n", Emu.GetTitle().c_str(), Emu.GetTitleID().c_str()));
} }
void spu_recompiler::compile(spu_function_t& f) void spu_recompiler::compile(spu_function_t& f)
@ -216,7 +216,7 @@ void spu_recompiler::compile(spu_function_t& f)
log += "\n\n\n"; log += "\n\n\n";
// Append log file // Append log file
fs::file(fs::get_config_dir() + "SPUJIT.log", fom::write | fom::append) << log; fs::file(fs::get_config_dir() + "SPUJIT.log", fom::write | fom::append).write(log);
} }
spu_recompiler::XmmLink spu_recompiler::XmmAlloc() // get empty xmm register spu_recompiler::XmmLink spu_recompiler::XmmAlloc() // get empty xmm register

View File

@ -26,11 +26,9 @@ bool vfsFile::Open(const std::string& path, u32 mode)
return m_stream && m_stream->IsOpened(); return m_stream && m_stream->IsOpened();
} }
bool vfsFile::Close() void vfsFile::Close()
{ {
m_stream.reset(); m_stream.reset();
return true;
} }
u64 vfsFile::GetSize() const u64 vfsFile::GetSize() const
@ -48,9 +46,9 @@ u64 vfsFile::Read(void* dst, u64 size)
return m_stream->Read(dst, size); return m_stream->Read(dst, size);
} }
u64 vfsFile::Seek(s64 offset, fsm mode) u64 vfsFile::Seek(s64 offset, fs::seek_mode whence)
{ {
return m_stream->Seek(offset, mode); return m_stream->Seek(offset, whence);
} }
u64 vfsFile::Tell() const u64 vfsFile::Tell() const

View File

@ -12,14 +12,14 @@ public:
vfsFile(const std::string& path, u32 mode = fom::read); vfsFile(const std::string& path, u32 mode = fom::read);
virtual bool Open(const std::string& path, u32 mode = fom::read) override; virtual bool Open(const std::string& path, u32 mode = fom::read) override;
virtual bool Close() override; virtual void Close() override;
virtual u64 GetSize() const override; virtual u64 GetSize() const override;
virtual u64 Write(const void* src, u64 size) override; virtual u64 Write(const void* src, u64 size) override;
virtual u64 Read(void* dst, u64 size) override; virtual u64 Read(void* dst, u64 size) override;
virtual u64 Seek(s64 offset, fsm seek_mode = fsm::begin) override; virtual u64 Seek(s64 offset, fs::seek_mode whence = fs::seek_set) override;
virtual u64 Tell() const override; virtual u64 Tell() const override;
virtual bool IsOpened() const override; virtual bool IsOpened() const override;

View File

@ -20,11 +20,10 @@ bool vfsFileBase::Open(const std::string& path, u32 mode)
return true; return true;
} }
bool vfsFileBase::Close() void vfsFileBase::Close()
{ {
m_path = ""; m_path = "";
vfsStream::Close();
return vfsStream::Close();
} }
std::string vfsFileBase::GetPath() const std::string vfsFileBase::GetPath() const

View File

@ -16,7 +16,7 @@ public:
virtual ~vfsFileBase() override; virtual ~vfsFileBase() override;
virtual bool Open(const std::string& path, u32 mode); virtual bool Open(const std::string& path, u32 mode);
virtual bool Close() override; virtual void Close() override;
virtual bool IsOpened() const override { return !m_path.empty(); } virtual bool IsOpened() const override { return !m_path.empty(); }
std::string GetPath() const; std::string GetPath() const;

View File

@ -20,7 +20,7 @@ bool vfsLocalDir::Open(const std::string& path)
std::string name; std::string name;
fs::stat_t file_info; fs::stat_t file_info;
while (m_dir.read(name, file_info)) while (m_dir.read(name, file_info) && name.size())
{ {
m_entries.emplace_back(); m_entries.emplace_back();

View File

@ -12,9 +12,10 @@ bool vfsLocalFile::Open(const std::string& path, u32 mode)
return m_file.open(path, mode) && vfsFileBase::Open(path, mode); return m_file.open(path, mode) && vfsFileBase::Open(path, mode);
} }
bool vfsLocalFile::Close() void vfsLocalFile::Close()
{ {
return m_file.close() && vfsFileBase::Close(); m_file.close();
vfsFileBase::Close();
} }
u64 vfsLocalFile::GetSize() const u64 vfsLocalFile::GetSize() const
@ -32,14 +33,14 @@ u64 vfsLocalFile::Read(void* dst, u64 size)
return m_file.read(dst, size); return m_file.read(dst, size);
} }
u64 vfsLocalFile::Seek(s64 offset, fsm mode) u64 vfsLocalFile::Seek(s64 offset, fs::seek_mode whence)
{ {
return m_file.seek(offset, mode); return m_file.seek(offset, whence);
} }
u64 vfsLocalFile::Tell() const u64 vfsLocalFile::Tell() const
{ {
return m_file.seek(0, fsm::cur); return m_file.seek(0, fs::seek_cur);
} }
bool vfsLocalFile::IsOpened() const bool vfsLocalFile::IsOpened() const

View File

@ -11,14 +11,14 @@ public:
vfsLocalFile(vfsDevice* device); vfsLocalFile(vfsDevice* device);
virtual bool Open(const std::string& path, u32 mode = fom::read) override; virtual bool Open(const std::string& path, u32 mode = fom::read) override;
virtual bool Close() override; virtual void Close() override;
virtual u64 GetSize() const override; virtual u64 GetSize() const override;
virtual u64 Write(const void* src, u64 size) override; virtual u64 Write(const void* src, u64 size) override;
virtual u64 Read(void* dst, u64 size) override; virtual u64 Read(void* dst, u64 size) override;
virtual u64 Seek(s64 offset, fsm seek_mode = fsm::begin) override; virtual u64 Seek(s64 offset, fs::seek_mode whence = fs::seek_set) override;
virtual u64 Tell() const override; virtual u64 Tell() const override;
virtual bool IsOpened() const override; virtual bool IsOpened() const override;

View File

@ -9,9 +9,8 @@ struct vfsStream
Close(); Close();
} }
virtual bool Close() virtual void Close()
{ {
return true;
} }
virtual u64 GetSize() const = 0; virtual u64 GetSize() const = 0;
@ -30,7 +29,7 @@ struct vfsStream
return Read(&data, count) == count; return Read(&data, count) == count;
} }
virtual u64 Seek(s64 offset, fsm seek_mode = fsm::begin) = 0; virtual u64 Seek(s64 offset, fs::seek_mode whence = fs::seek_set) = 0;
virtual u64 Tell() const = 0; virtual u64 Tell() const = 0;

View File

@ -31,16 +31,16 @@ public:
virtual u64 Read(void* dst, u64 count) override; virtual u64 Read(void* dst, u64 count) override;
virtual u64 Seek(s64 offset, fsm seek_mode = fsm::begin) override virtual u64 Seek(s64 offset, fs::seek_mode whence) override
{ {
switch (seek_mode) switch (whence)
{ {
case fsm::begin: return m_pos = offset; case fs::seek_set: return m_pos = offset;
case fsm::cur: return m_pos += offset; case fs::seek_cur: return m_pos += offset;
case fsm::end: return m_pos = m_size + offset; case fs::seek_end: return m_pos = m_size + offset;
} }
throw EXCEPTION("Unknown seek_mode (0x%x)", seek_mode); throw EXCEPTION("Unknown seek_mode (0x%x)", whence);
} }
virtual u64 Tell() const override virtual u64 Tell() const override

View File

@ -787,16 +787,16 @@ u64 vfsHDD::Read(void* dst, u64 size)
return m_file.Read(dst, size); // ??? return m_file.Read(dst, size); // ???
} }
u64 vfsHDD::Seek(s64 offset, fsm seek_mode) u64 vfsHDD::Seek(s64 offset, fs::seek_mode whence)
{ {
switch (seek_mode) switch (whence)
{ {
case fsm::begin: return m_file.Seek(offset); case fs::seek_set: return m_file.Seek(offset);
case fsm::cur: return m_file.Seek(Tell() + offset); case fs::seek_cur: return m_file.Seek(Tell() + offset);
case fsm::end: return m_file.Seek(m_file.GetSize() + offset); case fs::seek_end: return m_file.Seek(m_file.GetSize() + offset);
} }
throw EXCEPTION("Unknown seek_mode(0x%x)", seek_mode); throw EXCEPTION("Unknown whence (0x%x)", whence);
} }
u64 vfsHDD::Tell() const u64 vfsHDD::Tell() const

View File

@ -196,7 +196,7 @@ public:
virtual u64 Read(void* dst, u64 count) override; virtual u64 Read(void* dst, u64 count) override;
virtual u64 Seek(s64 offset, fsm seek_mode = fsm::begin) override; virtual u64 Seek(s64 offset, fs::seek_mode whence = fs::seek_set) override;
virtual u64 Tell() const override; virtual u64 Tell() const override;

View File

@ -15,7 +15,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <errno.h>
/* OS X uses MAP_ANON instead of MAP_ANONYMOUS */ /* OS X uses MAP_ANON instead of MAP_ANONYMOUS */
#ifndef MAP_ANONYMOUS #ifndef MAP_ANONYMOUS
@ -239,13 +238,10 @@ namespace vm
catch (...) catch (...)
{ {
// capture any exception possibly thrown by predicate // capture any exception possibly thrown by predicate
pred = [exception = std::current_exception()] pred = [exception = std::current_exception()]() -> bool
{ {
// new predicate will throw the captured exception from the original thread // new predicate will throw the captured exception from the original thread
std::rethrow_exception(exception); std::rethrow_exception(exception);
// dummy return value, remove when std::rethrow_exception gains [[noreturn]] attribute in MSVC
return true;
}; };
} }

View File

@ -166,7 +166,7 @@ struct D3D12Traits
} }
} }
fs::file(fs::get_config_dir() + "FragmentProgram" + std::to_string(ID) + ".hlsl", fom::rewrite) << shader; fs::file(fs::get_config_dir() + "FragmentProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shader);
fragmentProgramData.id = (u32)ID; fragmentProgramData.id = (u32)ID;
} }
@ -177,7 +177,7 @@ struct D3D12Traits
std::string shaderCode = VS.Decompile(); std::string shaderCode = VS.Decompile();
vertexProgramData.Compile(shaderCode, Shader::SHADER_TYPE::SHADER_TYPE_VERTEX); vertexProgramData.Compile(shaderCode, Shader::SHADER_TYPE::SHADER_TYPE_VERTEX);
vertexProgramData.vertex_shader_inputs = VS.input_slots; vertexProgramData.vertex_shader_inputs = VS.input_slots;
fs::file(fs::get_config_dir() + "VertexProgram" + std::to_string(ID) + ".hlsl", fom::rewrite) << shaderCode; fs::file(fs::get_config_dir() + "VertexProgram" + std::to_string(ID) + ".hlsl", fom::rewrite).write(shaderCode);
vertexProgramData.id = (u32)ID; vertexProgramData.id = (u32)ID;
} }

View File

@ -979,7 +979,7 @@ namespace rsx
template<typename AT, typename ...T> template<typename AT, typename ...T>
static size_t make_command(vm::ps3::ptr<u32, AT> &dst, u32 start_register, T... values) static size_t make_command(vm::ps3::ptr<u32, AT> &dst, u32 start_register, T... values)
{ {
for (u32 command : { (start_register << 2) | u32(sizeof...(values) << 18), u32(values)... }) for (u32 command : { (start_register << 2) | u32(sizeof...(values) << 18), static_cast<u32>(values)... })
{ {
*dst++ = command; *dst++ = command;
} }

View File

@ -17,7 +17,7 @@ struct GLTraits
fragmentProgramData.Compile(); fragmentProgramData.Compile();
//checkForGlError("m_fragment_prog.Compile"); //checkForGlError("m_fragment_prog.Compile");
fs::file(fs::get_config_dir() + "FragmentProgram.txt", fom::rewrite) << fragmentProgramData.shader; fs::file(fs::get_config_dir() + "FragmentProgram.txt", fom::rewrite).write(fragmentProgramData.shader);
} }
static static
@ -27,7 +27,7 @@ struct GLTraits
vertexProgramData.Compile(); vertexProgramData.Compile();
//checkForGlError("m_vertex_prog.Compile"); //checkForGlError("m_vertex_prog.Compile");
fs::file(fs::get_config_dir() + "VertexProgram.txt", fom::rewrite) << vertexProgramData.shader; fs::file(fs::get_config_dir() + "VertexProgram.txt", fom::rewrite).write(vertexProgramData.shader);
} }
static static

View File

@ -53,14 +53,14 @@ namespace rsx
if (fmt::match(entry.name, "*.fs." + lang_name)) if (fmt::match(entry.name, "*.fs." + lang_name))
{ {
fs::file file{ path + entry.name }; fs::file file{ path + entry.name };
decompiled_fragment_shaders.insert(hash, { (const std::string)file }); decompiled_fragment_shaders.insert(hash, { file.to_string() });
continue; continue;
} }
if (fmt::match(entry.name, "*.vs." + lang_name)) if (fmt::match(entry.name, "*.vs." + lang_name))
{ {
fs::file file{ path + entry.name }; fs::file file{ path + entry.name };
decompiled_vertex_shaders.insert(hash, { (const std::string)file }); decompiled_vertex_shaders.insert(hash, { file.to_string() });
continue; continue;
} }
} }

View File

@ -1058,24 +1058,24 @@ Module<> cellFs("cellFs", []()
REG_FUNC(cellFs, cellFsOpen); REG_FUNC(cellFs, cellFsOpen);
REG_FUNC(cellFs, cellFsSdataOpen); REG_FUNC(cellFs, cellFsSdataOpen);
REG_FUNC(cellFs, cellFsSdataOpenByFd); REG_FUNC(cellFs, cellFsSdataOpenByFd);
REG_FUNC(cellFs, cellFsRead); REG_FUNC(cellFs, cellFsRead, MFF_PERFECT);
REG_FUNC(cellFs, cellFsWrite); REG_FUNC(cellFs, cellFsWrite, MFF_PERFECT);
REG_FUNC(cellFs, cellFsClose); REG_FUNC(cellFs, cellFsClose, MFF_PERFECT);
REG_FUNC(cellFs, cellFsOpendir); REG_FUNC(cellFs, cellFsOpendir);
REG_FUNC(cellFs, cellFsReaddir); REG_FUNC(cellFs, cellFsReaddir, MFF_PERFECT);
REG_FUNC(cellFs, cellFsClosedir); REG_FUNC(cellFs, cellFsClosedir, MFF_PERFECT);
REG_FUNC(cellFs, cellFsStat); REG_FUNC(cellFs, cellFsStat);
REG_FUNC(cellFs, cellFsFstat); REG_FUNC(cellFs, cellFsFstat, MFF_PERFECT);
REG_FUNC(cellFs, cellFsMkdir); REG_FUNC(cellFs, cellFsMkdir);
REG_FUNC(cellFs, cellFsRename); REG_FUNC(cellFs, cellFsRename);
REG_FUNC(cellFs, cellFsChmod); REG_FUNC(cellFs, cellFsChmod);
REG_FUNC(cellFs, cellFsFsync); REG_FUNC(cellFs, cellFsFsync);
REG_FUNC(cellFs, cellFsRmdir); REG_FUNC(cellFs, cellFsRmdir);
REG_FUNC(cellFs, cellFsUnlink); REG_FUNC(cellFs, cellFsUnlink);
REG_FUNC(cellFs, cellFsLseek); REG_FUNC(cellFs, cellFsLseek, MFF_PERFECT);
REG_FUNC(cellFs, cellFsFtruncate); REG_FUNC(cellFs, cellFsFtruncate, MFF_PERFECT);
REG_FUNC(cellFs, cellFsTruncate); REG_FUNC(cellFs, cellFsTruncate);
REG_FUNC(cellFs, cellFsFGetBlockSize); REG_FUNC(cellFs, cellFsFGetBlockSize, MFF_PERFECT);
REG_FUNC(cellFs, cellFsAioInit); REG_FUNC(cellFs, cellFsAioInit);
REG_FUNC(cellFs, cellFsAioFinish); REG_FUNC(cellFs, cellFsAioFinish);
REG_FUNC(cellFs, cellFsAioRead); REG_FUNC(cellFs, cellFsAioRead);

View File

@ -7,7 +7,6 @@
extern "C" extern "C"
{ {
#include "stblib/stb_image.h" #include "stblib/stb_image.h"
#include "stblib/stb_image.c"
} }
#include "Emu/FS/VFS.h" #include "Emu/FS/VFS.h"

View File

@ -593,7 +593,7 @@ never_inline s32 savedata_op(PPUThread& ppu, u32 operation, u32 version, vm::cpt
fs::file file(local_path, fom::write | fom::create); fs::file file(local_path, fom::write | fom::create);
file.seek(fileSet->fileOffset); file.seek(fileSet->fileOffset);
fileGet->excSize = static_cast<u32>(file.write(fileSet->fileBuf.get_ptr(), std::min<u32>(fileSet->fileSize, fileSet->fileBufSize))); fileGet->excSize = static_cast<u32>(file.write(fileSet->fileBuf.get_ptr(), std::min<u32>(fileSet->fileSize, fileSet->fileBufSize)));
file.trunc(file.seek(0, fsm::cur)); // truncate file.trunc(file.seek(0, fs::seek_cur)); // truncate
break; break;
} }

View File

@ -5,6 +5,8 @@
#include "sys_net.h" #include "sys_net.h"
#ifdef _WIN32 #ifdef _WIN32
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0601
#include <winsock2.h> #include <winsock2.h>
#include <WS2tcpip.h> #include <WS2tcpip.h>
#else #else

View File

@ -430,7 +430,7 @@ s32 sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ptr<u64> pos)
std::lock_guard<std::mutex> lock(file->mutex); std::lock_guard<std::mutex> lock(file->mutex);
*pos = file->file->Seek(offset, (fsm)whence); *pos = file->file->Seek(offset, (fs::seek_mode)whence);
return CELL_OK; return CELL_OK;
} }

View File

@ -122,36 +122,31 @@ void Emulator::CreateConfig(const std::string& name)
bool Emulator::BootGame(const std::string& path, bool direct) bool Emulator::BootGame(const std::string& path, bool direct)
{ {
static const char* elf_path[6] = static const char* boot_list[] =
{ {
"/PS3_GAME/USRDIR/BOOT.BIN", "/PS3_GAME/USRDIR/BOOT.BIN",
"/USRDIR/BOOT.BIN", "/USRDIR/BOOT.BIN",
"/BOOT.BIN", "/BOOT.BIN",
"/PS3_GAME/USRDIR/EBOOT.BIN", "/PS3_GAME/USRDIR/EBOOT.BIN",
"/USRDIR/EBOOT.BIN", "/USRDIR/EBOOT.BIN",
"/EBOOT.BIN" "/EBOOT.BIN",
}; };
auto curpath = path; if (direct && fs::is_file(path))
if (direct)
{ {
if (fs::is_file(curpath)) SetPath(path);
{
SetPath(curpath);
Load(); Load();
return true; return true;
} }
}
for (int i = 0; i < sizeof(elf_path) / sizeof(*elf_path); i++) for (std::string elf : boot_list)
{ {
curpath = path + elf_path[i]; elf = path + elf;
if (fs::is_file(curpath)) if (fs::is_file(elf))
{ {
SetPath(curpath); SetPath(elf);
Load(); Load();
return true; return true;
@ -171,36 +166,28 @@ void Emulator::Load()
return; return;
} }
const std::string elf_dir = m_path.substr(0, m_path.find_last_of("/\\", std::string::npos, 2) + 1); const std::string& elf_dir = fs::get_parent_dir(m_path);
if (IsSelf(m_path)) if (IsSelf(m_path))
{ {
const std::string full_name = m_path.substr(elf_dir.length()); const std::size_t elf_ext_pos = m_path.find_last_of('.');
const std::string& elf_ext = fmt::toupper(m_path.substr(elf_ext_pos != -1 ? elf_ext_pos : m_path.size()));
const std::string& elf_name = m_path.substr(elf_dir.size());
const std::string base_name = full_name.substr(0, full_name.find_last_of('.', std::string::npos)); if (elf_name.compare(elf_name.find_last_of("/\\", -1, 2) + 1, 9, "EBOOT.BIN", 9) == 0)
const std::string ext = full_name.substr(base_name.length());
if (fmt::toupper(full_name) == "EBOOT.BIN")
{ {
m_path = elf_dir + "BOOT.BIN"; m_path.erase(m_path.size() - 9, 1); // change EBOOT.BIN to BOOT.BIN
} }
else if (fmt::toupper(ext) == ".SELF") else if (elf_ext == ".SELF" || elf_ext == ".SPRX")
{ {
m_path = elf_dir + base_name + ".elf"; m_path.erase(m_path.size() - 4, 1); // change *.self to *.elf, *.sprx to *.prx
}
else if (fmt::toupper(ext) == ".SPRX")
{
m_path = elf_dir + base_name + ".prx";
} }
else else
{ {
m_path = elf_dir + base_name + ".decrypted" + ext; m_path += ".decrypted.elf";
} }
LOG_NOTICE(LOADER, "Decrypting '%s%s'...", elf_dir, full_name); if (!DecryptSelf(m_path, elf_dir + elf_name))
if (!DecryptSelf(m_path, elf_dir + full_name))
{ {
m_status = Stopped; m_status = Stopped;
return; return;
@ -223,7 +210,7 @@ void Emulator::Load()
Emu.GetVFS().Mount("/dev_bdvd/", bdvd, new vfsDeviceLocalFile()); Emu.GetVFS().Mount("/dev_bdvd/", bdvd, new vfsDeviceLocalFile());
} }
else if (fs::is_file(elf_dir + "../../PS3_DISC.SFB")) // guess loading disc game else if (fs::is_file(elf_dir + "/../../PS3_DISC.SFB")) // guess loading disc game
{ {
const auto dir_list = fmt::split(elf_dir, { "/", "\\" }); const auto dir_list = fmt::split(elf_dir, { "/", "\\" });
@ -242,27 +229,6 @@ void Emulator::Load()
LOG_NOTICE(LOADER, "%s -> %s", GetVFS().m_devices[i]->GetPs3Path().c_str(), GetVFS().m_devices[i]->GetLocalPath().c_str()); LOG_NOTICE(LOADER, "%s -> %s", GetVFS().m_devices[i]->GetPs3Path().c_str(), GetVFS().m_devices[i]->GetLocalPath().c_str());
} }
LOG_NOTICE(LOADER, "");
/*LOG_NOTICE(LOADER, "Settings:");
LOG_NOTICE(LOADER, "CPU: %s", Ini.CPUIdToString(Ini.CPUDecoderMode.GetValue()));
LOG_NOTICE(LOADER, "SPU: %s", Ini.SPUIdToString(Ini.SPUDecoderMode.GetValue()));
LOG_NOTICE(LOADER, "Renderer: %s", Ini.RendererIdToString(Ini.GSRenderMode.GetValue()));
if (Ini.GSRenderMode.GetValue() == 2)
{
LOG_NOTICE(LOADER, "D3D Adapter: %s", Ini.AdapterIdToString(Ini.GSD3DAdaptater.GetValue()));
}
LOG_NOTICE(LOADER, "Resolution: %s", Ini.ResolutionIdToString(Ini.GSResolution.GetValue()));
LOG_NOTICE(LOADER, "Write Depth Buffer: %s", Ini.GSDumpDepthBuffer.GetValue() ? "Yes" : "No");
LOG_NOTICE(LOADER, "Write Color Buffers: %s", Ini.GSDumpColorBuffers.GetValue() ? "Yes" : "No");
LOG_NOTICE(LOADER, "Read Color Buffers: %s", Ini.GSReadColorBuffers.GetValue() ? "Yes" : "No");
LOG_NOTICE(LOADER, "Read Depth Buffer: %s", Ini.GSReadDepthBuffer.GetValue() ? "Yes" : "No");
LOG_NOTICE(LOADER, "Audio Out: %s", Ini.AudioOutIdToString(Ini.AudioOutMode.GetValue()));
LOG_NOTICE(LOADER, "Log Everything: %s", Ini.HLELogging.GetValue() ? "Yes" : "No");
LOG_NOTICE(LOADER, "RSX Logging: %s", Ini.RSXLogging.GetValue() ? "Yes" : "No");*/
LOG_NOTICE(LOADER, ""); LOG_NOTICE(LOADER, "");
f.Open("/app_home/../PARAM.SFO"); f.Open("/app_home/../PARAM.SFO");
const PSFLoader psf(f); const PSFLoader psf(f);
@ -505,11 +471,11 @@ void Emulator::SavePoints(const std::string& path)
const u32 marked_count = size32(m_marked_points); const u32 marked_count = size32(m_marked_points);
fs::file(path, fom::rewrite) fs::file(path, fom::rewrite)
<< bpdb_version .write(bpdb_version)
<< break_count .write(break_count)
<< marked_count .write(marked_count)
<< m_break_points .write(m_break_points)
<< m_marked_points; .write(m_marked_points);
} }
bool Emulator::LoadPoints(const std::string& path) bool Emulator::LoadPoints(const std::string& path)

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include "config.h" #include "config.h"
namespace rpcs3 namespace rpcs3

View File

@ -61,55 +61,6 @@
<Import Project="..\rpcs3_llvm.props" /> <Import Project="..\rpcs3_llvm.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<AdditionalDependencies />
<AdditionalLibraryDirectories />
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<AdditionalDependencies />
<AdditionalLibraryDirectories />
</Lib>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="emucore.vcxproj"> <ProjectReference Include="emucore.vcxproj">
<Project>{c4a10229-4712-4bd2-b63e-50d93c67a038}</Project> <Project>{c4a10229-4712-4bd2-b63e-50d93c67a038}</Project>

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <wx/wx.h>
enum CgDisasmIds enum CgDisasmIds
{ {
id_open_file, id_open_file,

View File

@ -1,9 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "stdafx_gui.h" #include "stdafx_gui.h"
#include <wx/listctrl.h>
#include <wx/clipbrd.h>
#include "Emu/state.h" #include "Emu/state.h"
#include "Gui/ConLogFrame.h" #include "Gui/ConLogFrame.h"

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include <wx/dataobj.h>
namespace Log namespace Log
{ {

View File

@ -1,6 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "stdafx_gui.h" #include "stdafx_gui.h"
#include <wx/statline.h>
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"

View File

@ -9,7 +9,6 @@
#include "GameViewer.h" #include "GameViewer.h"
#include "Loader/PSF.h" #include "Loader/PSF.h"
#include "SettingsDialog.h" #include "SettingsDialog.h"
#include <wx/dir.h>
static const std::string m_class_name = "GameViewer"; static const std::string m_class_name = "GameViewer";

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <wx/listctrl.h>
#include <wx/imaglist.h>
#include <wx/log.h>
#include "Emu/GameInfo.h" #include "Emu/GameInfo.h"
#include "Emu/state.h" #include "Emu/state.h"

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <wx/treectrl.h>
class KernelExplorer : public wxDialog class KernelExplorer : public wxDialog
{ {
wxTreeCtrl* m_tree; wxTreeCtrl* m_tree;

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "Gui/FrameBase.h" #include "Gui/FrameBase.h"
#include <wx/checklst.h>
class LLEModulesManagerFrame : public wxDialog class LLEModulesManagerFrame : public wxDialog
{ {

View File

@ -24,8 +24,6 @@
#include "Gui/LLEModulesManager.h" #include "Gui/LLEModulesManager.h"
#include "Gui/CgDisasm.h" #include "Gui/CgDisasm.h"
#include "Crypto/unpkg.h" #include "Crypto/unpkg.h"
#include <wx/dynlib.h>
#include <wx/progdlg.h>
#ifndef _WIN32 #ifndef _WIN32
#include "frame_icon.xpm" #include "frame_icon.xpm"
@ -255,7 +253,7 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event))
fs::file pkg_f(ctrl.GetPath().ToStdString()); fs::file pkg_f(ctrl.GetPath().ToStdString());
// Open file mapping (test) // Open file mapping (test)
fs::file_ptr pkg_ptr(pkg_f); fs::file_read_map pkg_ptr(pkg_f);
if (!pkg_f || !pkg_ptr) if (!pkg_f || !pkg_ptr)
{ {
@ -265,7 +263,7 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event))
// Append title ID to the path // Append title ID to the path
local_path += '/'; local_path += '/';
local_path += { pkg_ptr + 55, 9 }; local_path.append(pkg_ptr + 55, 9);
if (!fs::create_dir(local_path)) if (!fs::create_dir(local_path))
{ {
@ -289,7 +287,7 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event))
volatile f64 progress = 0.0; volatile f64 progress = 0.0;
// Run PKG unpacking asynchronously // Run PKG unpacking asynchronously
auto result = std::async(std::launch::async, WRAP_EXPR(pkg_install(pkg_f, local_path + "/", progress))); auto result = std::async(std::launch::async, WRAP_EXPR(pkg_install(pkg_f, local_path + '/', progress)));
// Wait for the completion // Wait for the completion
while (result.wait_for(15ms) != std::future_status::ready) while (result.wait_for(15ms) != std::future_status::ready)

View File

@ -4,8 +4,6 @@
#include "Gui/ConLogFrame.h" #include "Gui/ConLogFrame.h"
#include "Gui/FrameBase.h" #include "Gui/FrameBase.h"
#include <wx/aui/aui.h>
class GameViewer; class GameViewer;
class MainFrame : public FrameBase class MainFrame : public FrameBase

View File

@ -6,8 +6,6 @@
#include "MemoryStringSearcher.h" #include "MemoryStringSearcher.h"
#include <wx/notebook.h>
MemoryStringSearcher::MemoryStringSearcher(wxWindow* parent) MemoryStringSearcher::MemoryStringSearcher(wxWindow* parent)
: wxDialog(parent, wxID_ANY, "String Searcher", wxDefaultPosition, wxSize(545, 64)) : wxDialog(parent, wxID_ANY, "String Searcher", wxDefaultPosition, wxSize(545, 64))
, exit(false) , exit(false)

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include <wx/listctrl.h>
class MemoryStringSearcher : public wxDialog class MemoryStringSearcher : public wxDialog
{ {

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <wx/listctrl.h>
class MemoryViewerPanel : public wxDialog class MemoryViewerPanel : public wxDialog
{ {
u32 m_addr; u32 m_addr;

View File

@ -15,8 +15,6 @@
#include "MemoryViewer.h" #include "MemoryViewer.h"
#include <wx/notebook.h>
// TODO: Clear the object when restarting the emulator // TODO: Clear the object when restarting the emulator
std::vector<RSXDebuggerProgram> m_debug_programs; std::vector<RSXDebuggerProgram> m_debug_programs;
@ -569,7 +567,7 @@ void RSXDebugger::GetMemory()
dump += '\n'; dump += '\n';
} }
fs::file(fs::get_config_dir() + "command_dump.log", fom::rewrite) << dump; fs::file(fs::get_config_dir() + "command_dump.log", fom::rewrite).write(dump);
for (u32 i = 0;i < frame_debug.draw_calls.size(); i++) for (u32 i = 0;i < frame_debug.draw_calls.size(); i++)
m_list_captured_draw_calls->InsertItem(i, frame_debug.draw_calls[i].name); m_list_captured_draw_calls->InsertItem(i, frame_debug.draw_calls[i].name);

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <wx/listctrl.h>
class RSXDebugger : public wxDialog class RSXDebugger : public wxDialog
{ {
u32 m_addr; u32 m_addr;

View File

@ -5,7 +5,6 @@
#include "Emu/state.h" #include "Emu/state.h"
#include "Emu/SysCalls/Modules/cellVideoOut.h" #include "Emu/SysCalls/Modules/cellVideoOut.h"
#include "SettingsDialog.h" #include "SettingsDialog.h"
#include <wx/radiobox.h>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>

View File

@ -3,7 +3,6 @@
#include "VHDDManager.h" #include "VHDDManager.h"
#include "TextInputDialog.h" #include "TextInputDialog.h"
#include "Emu/state.h" #include "Emu/state.h"
#include <wx/busyinfo.h>
VHDDListDropTarget::VHDDListDropTarget(wxListView* parent) : m_parent(parent) VHDDListDropTarget::VHDDListDropTarget(wxListView* parent) : m_parent(parent)
{ {

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <wx/dnd.h>
#include "Emu/HDD/HDD.h" #include "Emu/HDD/HDD.h"
class VHDDListDropTarget : public wxDropTarget class VHDDListDropTarget : public wxDropTarget

View File

@ -239,14 +239,12 @@ bool TROPUSRLoader::UnlockTrophy(u32 id, u64 timestamp1, u64 timestamp2)
return true; return true;
} }
bool TROPUSRLoader::Close() void TROPUSRLoader::Close()
{ {
if (m_file && m_file->Close()) if (m_file)
{ {
m_file->Close();
delete m_file; delete m_file;
m_file = nullptr; m_file = nullptr;
return true;
} }
return false;
} }

View File

@ -74,7 +74,7 @@ public:
virtual bool Load(const std::string& filepath, const std::string& configpath); virtual bool Load(const std::string& filepath, const std::string& configpath);
virtual bool Save(const std::string& filepath); virtual bool Save(const std::string& filepath);
virtual bool Close(); virtual void Close();
virtual u32 GetTrophiesCount(); virtual u32 GetTrophiesCount();

View File

@ -124,7 +124,7 @@ void TRPLoader::RenameEntry(const char *oldname, const char *newname)
} }
} }
bool TRPLoader::Close() void TRPLoader::Close()
{ {
return trp_f.Close(); trp_f.Close();
} }

View File

@ -39,5 +39,5 @@ public:
virtual void RemoveEntry(const char *filename); virtual void RemoveEntry(const char *filename);
virtual void RenameEntry(const char *oldname, const char *newname); virtual void RenameEntry(const char *oldname, const char *newname);
virtual bool Close(); virtual void Close();
}; };

View File

@ -62,54 +62,9 @@
<Import Project="..\rpcs3_llvm.props" /> <Import Project="..\rpcs3_llvm.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'"> <ItemDefinitionGroup>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>.\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>.\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>

View File

@ -61,55 +61,11 @@
<Import Project="..\rpcs3_llvm.props" /> <Import Project="..\rpcs3_llvm.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'"> <ItemDefinitionGroup>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'" Label="Configuration">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>..\minidx9\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\minidx9\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\minidx9\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\minidx9\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\minidx9\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\minidx9\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'" Label="Configuration">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="emucore.vcxproj"> <ProjectReference Include="emucore.vcxproj">
<Project>{c4a10229-4712-4bd2-b63e-50d93c67a038}</Project> <Project>{c4a10229-4712-4bd2-b63e-50d93c67a038}</Project>

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="Fichiers sources"> <Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\rpcs3\Emu\Audio\XAudio2\XAudio2Thread.cpp"> <ClCompile Include="..\rpcs3\Emu\Audio\XAudio2\XAudio2Thread.cpp">
<Filter>Fichiers sources</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\rpcs3\Emu\Audio\XAudio2\XAudio2Thread.h"> <ClInclude Include="..\rpcs3\Emu\Audio\XAudio2\XAudio2Thread.h">
<Filter>Fichiers sources</Filter> <Filter>Source Files</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -34,12 +34,12 @@ namespace rpcs3
fs::file file(m_path, fom::create | fom::read); fs::file file(m_path, fom::create | fom::read);
if (file) if (file)
from_string((const std::string)file); from_string(file.to_string());
} }
void config_t::save() const void config_t::save() const
{ {
fs::file(m_path, fom::rewrite) << to_string(); fs::file(m_path, fom::rewrite).write(to_string());
} }
config_t config{ fs::get_config_dir() + "rpcs3.new.ini" }; config_t config{ fs::get_config_dir() + "rpcs3.new.ini" };

View File

@ -58,47 +58,8 @@
<Import Project="..\rpcs3_release.props" /> <Import Project="..\rpcs3_release.props" />
<Import Project="..\rpcs3_llvm.props" /> <Import Project="..\rpcs3_llvm.props" />
</ImportGroup> </ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\stblib\stb_image.c" />
<ClCompile Include="..\Utilities\AutoPause.cpp" /> <ClCompile Include="..\Utilities\AutoPause.cpp" />
<ClCompile Include="..\Utilities\config_context.cpp" /> <ClCompile Include="..\Utilities\config_context.cpp" />
<ClCompile Include="..\Utilities\Log.cpp" /> <ClCompile Include="..\Utilities\Log.cpp" />
@ -150,11 +111,7 @@
<ClCompile Include="Crypto\ec.cpp" /> <ClCompile Include="Crypto\ec.cpp" />
<ClCompile Include="Crypto\key_vault.cpp" /> <ClCompile Include="Crypto\key_vault.cpp" />
<ClCompile Include="Crypto\lz.cpp"> <ClCompile Include="Crypto\lz.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">NotUsing</PrecompiledHeader>
</ClCompile> </ClCompile>
<ClCompile Include="Crypto\sha1.cpp" /> <ClCompile Include="Crypto\sha1.cpp" />
<ClCompile Include="Crypto\unedat.cpp" /> <ClCompile Include="Crypto\unedat.cpp" />
@ -391,15 +348,13 @@
<ClCompile Include="Loader\TROPUSR.cpp" /> <ClCompile Include="Loader\TROPUSR.cpp" />
<ClCompile Include="Loader\TRP.cpp" /> <ClCompile Include="Loader\TRP.cpp" />
<ClCompile Include="Emu\Cell\PPULLVMRecompiler.cpp" /> <ClCompile Include="Emu\Cell\PPULLVMRecompiler.cpp" />
<ClCompile Include="stb_image.cpp" />
<ClCompile Include="stdafx.cpp"> <ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">Create</PrecompiledHeader> <PrecompiledHeader>Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">Create</PrecompiledHeader>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\stblib\stb_image.h" />
<ClInclude Include="..\Utilities\Atomic.h" /> <ClInclude Include="..\Utilities\Atomic.h" />
<ClInclude Include="..\Utilities\AutoPause.h" /> <ClInclude Include="..\Utilities\AutoPause.h" />
<ClInclude Include="..\Utilities\BEType.h" /> <ClInclude Include="..\Utilities\BEType.h" />
@ -686,26 +641,6 @@
<ClInclude Include="stdafx.h" /> <ClInclude Include="stdafx.h" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

View File

@ -930,6 +930,9 @@
<ClCompile Include="Emu\RSX\rsx_methods.cpp"> <ClCompile Include="Emu\RSX\rsx_methods.cpp">
<Filter>Emu\GPU\RSX</Filter> <Filter>Emu\GPU\RSX</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="stb_image.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp"> <ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@ -1788,5 +1791,11 @@
<ClInclude Include="Emu\RSX\rsx_methods.h"> <ClInclude Include="Emu\RSX\rsx_methods.h">
<Filter>Emu\GPU\RSX</Filter> <Filter>Emu\GPU\RSX</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\stblib\stb_image.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\stblib\stb_image.c">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -61,43 +61,26 @@
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>.\;..\wxWidgets\include;..\SDL-1.3.0-5538\include;..\SDL_image-1.2.10;..\pthreads-2.8.0;..\;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;.\OpenAL\include;$(IncludePath);..\asmjit\src\asmjit;$(UniversalCRT_IncludePath);..\minidx12\Include</IncludePath>
<OutDir>$(SolutionDir)bin\</OutDir> <OutDir>$(SolutionDir)bin\</OutDir>
<LibraryPath>$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath)</LibraryPath>
<TargetName>$(ProjectName)-dbg</TargetName> <TargetName>$(ProjectName)-dbg</TargetName>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<IncludePath>.\;..\wxWidgets\include;..\SDL-1.3.0-5538\include;..\SDL_image-1.2.10;..\pthreads-2.8.0;..\;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;.\OpenAL\include;$(IncludePath);..\asmjit\src\asmjit;$(UniversalCRT_IncludePath);..\minidx12\Include</IncludePath>
<OutDir>$(SolutionDir)bin\</OutDir> <OutDir>$(SolutionDir)bin\</OutDir>
<LibraryPath>$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(SolutionDir)lib\Debug-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath);$(SolutionDir)lib\$(Configuration)-$(Platform)\</LibraryPath>
<TargetName>$(ProjectName)-dbg</TargetName> <TargetName>$(ProjectName)-dbg</TargetName>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
<IncludePath>.\;..\wxWidgets\include;..\SDL-1.3.0-5538\include;..\SDL_image-1.2.10;..\pthreads-2.8.0;..\;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;.\OpenAL\include;$(UniversalCRT_IncludePath);$(IncludePath);..\minidx12\Include</IncludePath>
<OutDir>$(SolutionDir)bin\</OutDir> <OutDir>$(SolutionDir)bin\</OutDir>
<LibraryPath>$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(SolutionDir)lib\Debug-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath);$(SolutionDir)lib\$(Configuration)-$(Platform)\</LibraryPath>
<TargetName>$(ProjectName)-dbg</TargetName> <TargetName>$(ProjectName)-dbg</TargetName>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>.\;..\wxWidgets\include;..\SDL-1.3.0-5538\include;..\SDL_image-1.2.10;..\pthreads-2.8.0;..\;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;.\OpenAL\include;$(IncludePath);..\asmjit\src\asmjit;$(UniversalCRT_IncludePath);..\minidx12\Include</IncludePath>
<OutDir>$(SolutionDir)bin\</OutDir> <OutDir>$(SolutionDir)bin\</OutDir>
<LibraryPath>$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath)</LibraryPath>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<RunCodeAnalysis>false</RunCodeAnalysis> <RunCodeAnalysis>false</RunCodeAnalysis>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>.\;..\wxWidgets\include;..\SDL-1.3.0-5538\include;..\SDL_image-1.2.10;..\pthreads-2.8.0;..\;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;.\OpenAL\include;$(IncludePath);..\asmjit\src\asmjit;$(UniversalCRT_IncludePath);..\minidx12\Include</IncludePath>
<OutDir>$(SolutionDir)bin\</OutDir> <OutDir>$(SolutionDir)bin\</OutDir>
<LibraryPath>$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(SolutionDir)lib\Release-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath)</LibraryPath>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<RunCodeAnalysis>false</RunCodeAnalysis> <RunCodeAnalysis>false</RunCodeAnalysis>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<PreBuildEvent> <PreBuildEvent>
@ -108,34 +91,10 @@
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs> <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference> </ProjectReference>
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">..\minidx9\Include;..\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\minidx9\Include;..\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClCompile>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">..\minidx9\Include;..\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClCompile>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\minidx9\Include;..\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClCompile>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\minidx9\Include;..\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ClCompile>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">..\minidx9\Include;..\OpenAL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">..\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>..\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">..\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">..\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>

9
rpcs3/stb_image.cpp Normal file
View File

@ -0,0 +1,9 @@
#include "stdafx.h"
extern "C"
{
#pragma warning(push, 0)
#include "stblib/stb_image.h"
#include "stblib/stb_image.c"
#pragma warning(pop)
}

View File

@ -25,6 +25,7 @@
#include <cstdint> #include <cstdint>
#include <climits> #include <climits>
#include <cmath> #include <cmath>
#include <cerrno>
#include <atomic> #include <atomic>
#include <mutex> #include <mutex>
#include <thread> #include <thread>
@ -78,7 +79,7 @@ public:
{ {
} }
operator bool() const //template<typename T, typename = std::enable_if_t<std::is_integral<T>::value>> operator T() const operator bool() const
{ {
return m_value != 0; return m_value != 0;
} }
@ -86,13 +87,15 @@ public:
CHECK_SIZE_ALIGN(b8, 1, 1); CHECK_SIZE_ALIGN(b8, 1, 1);
template<typename T, typename = std::enable_if_t<std::is_integral<T>::value>> inline T align(const T& value, u64 align) template<typename T, typename = std::enable_if_t<std::is_integral<T>::value>>
inline T align(const T& value, u64 align)
{ {
return static_cast<T>((value + (align - 1)) & ~(align - 1)); return static_cast<T>((value + (align - 1)) & ~(align - 1));
} }
// copy null-terminated string from std::string to char array with truncation // copy null-terminated string from std::string to char array with truncation
template<std::size_t N> inline void strcpy_trunc(char(&dst)[N], const std::string& src) template<std::size_t N>
inline void strcpy_trunc(char(&dst)[N], const std::string& src)
{ {
const std::size_t count = src.size() >= N ? N - 1 : src.size(); const std::size_t count = src.size() >= N ? N - 1 : src.size();
std::memcpy(dst, src.c_str(), count); std::memcpy(dst, src.c_str(), count);
@ -100,7 +103,8 @@ template<std::size_t N> inline void strcpy_trunc(char(&dst)[N], const std::strin
} }
// copy null-terminated string from char array to char array with truncation // copy null-terminated string from char array to char array with truncation
template<std::size_t N, std::size_t N2> inline void strcpy_trunc(char(&dst)[N], const char(&src)[N2]) template<std::size_t N, std::size_t N2>
inline void strcpy_trunc(char(&dst)[N], const char(&src)[N2])
{ {
const std::size_t count = N2 >= N ? N - 1 : N2; const std::size_t count = N2 >= N ? N - 1 : N2;
std::memcpy(dst, src, count); std::memcpy(dst, src, count);
@ -108,13 +112,15 @@ template<std::size_t N, std::size_t N2> inline void strcpy_trunc(char(&dst)[N],
} }
// returns true if all array elements are unique and sorted in ascending order // returns true if all array elements are unique and sorted in ascending order
template<typename T, std::size_t N> constexpr bool is_ascending(const T(&array)[N], std::size_t from = 0) template<typename T, std::size_t N>
constexpr bool is_ascending(const T(&array)[N], std::size_t from = 0)
{ {
return from >= N - 1 ? true : array[from] < array[from + 1] ? is_ascending(array, from + 1) : false; return from >= N - 1 ? true : array[from] < array[from + 1] ? is_ascending(array, from + 1) : false;
} }
// get (first) array element equal to `value` or nullptr if not found // get (first) array element equal to `value` or nullptr if not found
template<typename T, std::size_t N, typename T2> constexpr const T* static_search(const T(&array)[N], const T2& value, std::size_t from = 0) template<typename T, std::size_t N, typename T2>
constexpr const T* static_search(const T(&array)[N], const T2& value, std::size_t from = 0)
{ {
return from >= N ? nullptr : array[from] == value ? array + from : static_search(array, value, from + 1); return from >= N ? nullptr : array[from] == value ? array + from : static_search(array, value, from + 1);
} }
@ -135,7 +141,8 @@ struct explicit_bool_t
} }
}; };
template<typename T1, typename T2, typename T3 = const char*> struct triplet_t template<typename T1, typename T2, typename T3 = const char*>
struct triplet_t
{ {
T1 first; T1 first;
T2 second; T2 second;
@ -154,18 +161,28 @@ template<typename T1, typename T2, typename T3 = const char*> struct triplet_t
#define alignof32(type) static_cast<u32>(alignof(type)) #define alignof32(type) static_cast<u32>(alignof(type))
// return 32 bit .size() for container // return 32 bit .size() for container
template<typename T> inline auto size32(const T& container) -> decltype(static_cast<u32>(container.size())) template<typename T>
inline auto size32(const T& container) -> decltype(static_cast<u32>(container.size()))
{ {
const auto size = container.size(); const auto size = container.size();
return size >= 0 && size <= UINT32_MAX ? static_cast<u32>(size) : throw std::length_error(__FUNCTION__); return size >= 0 && size <= UINT32_MAX ? static_cast<u32>(size) : throw std::length_error(__FUNCTION__);
} }
// return 32 bit size for an array // return 32 bit size for an array
template<typename T, std::size_t Size> constexpr u32 size32(const T(&)[Size]) template<typename T, std::size_t Size>
constexpr u32 size32(const T(&)[Size])
{ {
return Size >= 0 && Size <= UINT32_MAX ? static_cast<u32>(Size) : throw std::length_error(__FUNCTION__); return Size >= 0 && Size <= UINT32_MAX ? static_cast<u32>(Size) : throw std::length_error(__FUNCTION__);
} }
#define CONCATENATE_DETAIL(x, y) x ## y
#define CONCATENATE(x, y) CONCATENATE_DETAIL(x, y)
#define SWITCH(expr) for (const auto& CONCATENATE(_switch_, __LINE__) = (expr);;) { const auto& _switch_ = CONCATENATE(_switch_, __LINE__);
#define CCASE(value) } constexpr std::remove_reference_t<decltype(_switch_)> CONCATENATE(_value_, __LINE__) = value; if (_switch_ == CONCATENATE(_value_, __LINE__)) {
#define VCASE(value) } if (_switch_ == (value)) {
#define DEFAULT } /* must be the last one */
#define WRAP_EXPR(expr) [&]{ return expr; } #define WRAP_EXPR(expr) [&]{ return expr; }
#define COPY_EXPR(expr) [=]{ return expr; } #define COPY_EXPR(expr) [=]{ return expr; }
#define PURE_EXPR(expr) [] { return expr; } #define PURE_EXPR(expr) [] { return expr; }
@ -174,8 +191,8 @@ template<typename T, std::size_t Size> constexpr u32 size32(const T(&)[Size])
#define IS_INTEGRAL(t) (std::is_integral<t>::value || std::is_same<std::decay_t<t>, u128>::value) #define IS_INTEGRAL(t) (std::is_integral<t>::value || std::is_same<std::decay_t<t>, u128>::value)
#define IS_INTEGER(t) (std::is_integral<t>::value || std::is_enum<t>::value || std::is_same<std::decay_t<t>, u128>::value) #define IS_INTEGER(t) (std::is_integral<t>::value || std::is_enum<t>::value || std::is_same<std::decay_t<t>, u128>::value)
#define IS_BINARY_COMPARABLE(t1, t2) (IS_INTEGER(t1) && IS_INTEGER(t2) && sizeof(t1) == sizeof(t2)) #define IS_BINARY_COMPARABLE(t1, t2) (IS_INTEGER(t1) && IS_INTEGER(t2) && sizeof(t1) == sizeof(t2))
#define CHECK_ASSERTION(expr) if (expr) {} else throw EXCEPTION("Assertion failed: " #expr) #define CHECK_ASSERTION(expr) if (expr) {} else throw EXCEPTION("Assertion failed: %s", #expr)
#define CHECK_SUCCESS(expr) if (s32 _r = (expr)) throw EXCEPTION(#expr " failed (0x%x)", _r) #define CHECK_SUCCESS(expr) if (s32 _r = (expr)) throw EXCEPTION("Failure: %s -> 0x%x", #expr, _r)
// Some forward declarations for the ID manager // Some forward declarations for the ID manager
template<typename T> struct id_traits; template<typename T> struct id_traits;

View File

@ -3,9 +3,13 @@
#include "restore_new.h" #include "restore_new.h"
#ifndef QT_UI #ifndef QT_UI
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(push, 0) #pragma warning(push, 0)
#else
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif #endif
#include <wx/wx.h>
#include <wx/wxprec.h> #include <wx/wxprec.h>
#include <wx/config.h> #include <wx/config.h>
#include <wx/string.h> #include <wx/string.h>
@ -22,12 +26,26 @@
#include <wx/msgdlg.h> #include <wx/msgdlg.h>
#include <wx/gauge.h> #include <wx/gauge.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/statline.h>
#include <wx/scrolbar.h> #include <wx/scrolbar.h>
#include <wx/frame.h> #include <wx/frame.h>
#include <wx/combobox.h> #include <wx/combobox.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/checklst.h>
#include <wx/listctrl.h> #include <wx/listctrl.h>
#include <wx/treectrl.h>
#include <wx/clipbrd.h>
#include <wx/notebook.h>
#include <wx/radiobox.h>
#include <wx/aui/aui.h>
#include <wx/aui/auibook.h> #include <wx/aui/auibook.h>
#include <wx/dataobj.h>
#include <wx/imaglist.h>
#include <wx/log.h>
#include <wx/dynlib.h>
#include <wx/progdlg.h>
#include <wx/busyinfo.h>
#include <wx/dnd.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif

View File

@ -2,8 +2,15 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" /> <ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup /> <PropertyGroup>
<OutDir>$(SolutionDir)lib\$(Configuration)-$(Platform)\</OutDir>
<LibraryPath>$(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath)</LibraryPath>
<IntDir>$(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<Lib>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
<ClCompile> <ClCompile>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalIncludeDirectories>.\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);..\llvm\include;..\llvm_build\include;$(UniversalCRT_IncludePath);..\minidx12\Include;..\glm;..\GSL\include</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>.\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);..\llvm\include;..\llvm_build\include;$(UniversalCRT_IncludePath);..\minidx12\Include;..\glm;..\GSL\include</AdditionalIncludeDirectories>