diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj
index ed3003e5f14c..c2442eba3335 100644
--- a/Common/Common.vcxproj
+++ b/Common/Common.vcxproj
@@ -27,22 +27,22 @@
StaticLibrary
true
- MultiByte
+ Unicode
StaticLibrary
true
- MultiByte
+ Unicode
StaticLibrary
false
- MultiByte
+ Unicode
StaticLibrary
false
- MultiByte
+ Unicode
diff --git a/Common/ConsoleListener.cpp b/Common/ConsoleListener.cpp
index 61fba341a29e..d719d157e17e 100644
--- a/Common/ConsoleListener.cpp
+++ b/Common/ConsoleListener.cpp
@@ -28,6 +28,7 @@
#endif
#include "thread/threadutil.h"
+#include "util/text/utf8.h"
#include "Common.h"
#include "LogManager.h" // Common
#include "ConsoleListener.h" // Common
@@ -89,7 +90,9 @@ void ConsoleListener::Open(bool Hidden, int Width, int Height, const char *Title
// Save the window handle that AllocConsole() created
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// Set the console window title
- SetConsoleTitle(Title);
+ SetConsoleTitle(ConvertUTF8ToWString(Title).c_str());
+ SetConsoleCP(CP_UTF8);
+
// Set letter space
LetterSpace(Width, LOG_MAX_DISPLAY_LINES);
//MoveWindow(GetConsoleWindow(), 200,200, 800,800, true);
@@ -415,6 +418,7 @@ void ConsoleListener::WriteToConsole(LogTypes::LOG_LEVELS Level, const char *Tex
*/
DWORD cCharsWritten;
WORD Color;
+ static wchar_t tempBuf[2048];
switch (Level)
{
@@ -441,12 +445,16 @@ void ConsoleListener::WriteToConsole(LogTypes::LOG_LEVELS Level, const char *Tex
{
// First 10 chars white
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
- WriteConsole(hConsole, Text, 10, &cCharsWritten, NULL);
+ int wlen = MultiByteToWideChar(CP_UTF8, 0, Text, (int)Len, NULL, NULL);
+ MultiByteToWideChar(CP_UTF8, 0, Text, (int)Len, tempBuf, wlen);
+ WriteConsole(hConsole, tempBuf, 10, &cCharsWritten, NULL);
Text += 10;
Len -= 10;
}
SetConsoleTextAttribute(hConsole, Color);
- WriteConsole(hConsole, Text, (DWORD)Len, &cCharsWritten, NULL);
+ int wlen = MultiByteToWideChar(CP_UTF8, 0, Text, (int)Len, NULL, NULL);
+ MultiByteToWideChar(CP_UTF8, 0, Text, (int)Len, tempBuf, wlen);
+ WriteConsole(hConsole, tempBuf, (DWORD)Len, &cCharsWritten, NULL);
}
#endif
@@ -476,7 +484,7 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool
static const int MAX_BYTES = 1024 * 16;
- std::vector> Str;
+ std::vector> Str;
std::vector> Attr;
// ReadConsoleOutputAttribute seems to have a limit at this level
diff --git a/Common/ExtendedTrace.cpp b/Common/ExtendedTrace.cpp
index 751d9b3d5435..ba884a1d1279 100644
--- a/Common/ExtendedTrace.cpp
+++ b/Common/ExtendedTrace.cpp
@@ -17,6 +17,8 @@
#include "CommonWindows.h"
#include
#include "ExtendedTrace.h"
+
+#include
using namespace std;
#include
@@ -320,7 +322,7 @@ void StackTrace( HANDLE hThread, LPCTSTR lpszMessage, FILE *file )
GetFunctionInfoFromAddresses( (ULONG)callStack.AddrPC.Offset, (ULONG)callStack.AddrFrame.Offset, symInfo );
GetSourceInfoFromAddress( (ULONG)callStack.AddrPC.Offset, srcInfo );
- etfprint(file, string(" ") + srcInfo + string(" : ") + symInfo + string("\n"));
+ etfprint(file, wstring(L" ") + srcInfo + L" : " + symInfo + L"\n");
for( ULONG index = 0; ; index++ )
{
@@ -343,7 +345,7 @@ void StackTrace( HANDLE hThread, LPCTSTR lpszMessage, FILE *file )
GetFunctionInfoFromAddresses( (ULONG)callStack.AddrPC.Offset, (ULONG)callStack.AddrFrame.Offset, symInfo );
GetSourceInfoFromAddress( (UINT)callStack.AddrPC.Offset, srcInfo );
- etfprint(file, string(" ") + srcInfo + string(" : ") + symInfo + string("\n"));
+ etfprint(file, wstring(L" ") + srcInfo + L" : " + symInfo + L"\n");
}
@@ -351,22 +353,6 @@ void StackTrace( HANDLE hThread, LPCTSTR lpszMessage, FILE *file )
ResumeThread( hThread );
}
-#ifndef UNICODE
-
-void StackTrace( HANDLE hThread, wchar_t const*lpszMessage, FILE *file, DWORD eip, DWORD esp, DWORD ebp )
-{
- // TODO: remove when Common builds as unicode
- size_t origsize = wcslen(lpszMessage) + 1;
- const size_t newsize = 100;
- size_t convertedChars = 0;
- char nstring[newsize];
- wcstombs_s(&convertedChars, nstring, origsize, lpszMessage, _TRUNCATE);
-
- StackTrace(hThread, nstring, file, eip, esp, ebp );
-}
-
-#endif
-
void StackTrace( HANDLE hThread, LPCTSTR lpszMessage, FILE *file, DWORD eip, DWORD esp, DWORD ebp )
{
STACKFRAME callStack;
@@ -397,7 +383,7 @@ void StackTrace( HANDLE hThread, LPCTSTR lpszMessage, FILE *file, DWORD eip, DWO
GetFunctionInfoFromAddresses( (ULONG)callStack.AddrPC.Offset, (ULONG)callStack.AddrFrame.Offset, symInfo );
GetSourceInfoFromAddress( (UINT)callStack.AddrPC.Offset, srcInfo );
- etfprint(file, string(" ") + srcInfo + string(" : ") + symInfo + string("\n"));
+ etfprint(file, wstring(L" ") + srcInfo + L" : " + symInfo + L"\n");
for( ULONG index = 0; ; index++ )
{
@@ -420,8 +406,7 @@ void StackTrace( HANDLE hThread, LPCTSTR lpszMessage, FILE *file, DWORD eip, DWO
GetFunctionInfoFromAddresses( (ULONG)callStack.AddrPC.Offset, (ULONG)callStack.AddrFrame.Offset, symInfo );
GetSourceInfoFromAddress( (UINT)callStack.AddrPC.Offset, srcInfo );
- etfprint(file, string(" ") + srcInfo + string(" : ") + symInfo + string("\n"));
-
+ etfprint(file, wstring(L" ") + srcInfo + L" : " + symInfo + L"\n");
}
if ( hThread != GetCurrentThread() )
@@ -443,4 +428,9 @@ void etfprint(FILE *file, const std::string &text) {
fwrite(text.data(), 1, len, file);
}
+void etfprint(FILE *file, const std::wstring &text) {
+ size_t len = text.length();
+ fwrite(text.data(), sizeof(wchar_t), len, file);
+}
+
#endif //WIN32
diff --git a/Common/ExtendedTrace.h b/Common/ExtendedTrace.h
index 433f3e6d076a..4b10a98476f6 100644
--- a/Common/ExtendedTrace.h
+++ b/Common/ExtendedTrace.h
@@ -39,6 +39,7 @@ void StackTrace( HANDLE hThread, wchar_t const* lpszMessage, FILE *file, DWORD e
// functions by Masken
void etfprintf(FILE *file, const char *format, ...);
void etfprint(FILE *file, const std::string &text);
+void etfprint(FILE *file, const std::wstring &text);
#define UEFBUFSIZE 2048
extern char g_uefbuf[UEFBUFSIZE];
diff --git a/Common/FileSearch.cpp b/Common/FileSearch.cpp
index fb620e026927..ffd78ff38fa3 100644
--- a/Common/FileSearch.cpp
+++ b/Common/FileSearch.cpp
@@ -32,6 +32,7 @@
#include "FileSearch.h"
#include "StringUtils.h"
+#include "util/text/utf8.h"
CFileSearch::CFileSearch(const CFileSearch::XStringVector& _rSearchStrings, const CFileSearch::XStringVector& _rDirectories)
@@ -53,7 +54,8 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string&
BuildCompleteFilename(GCMSearchPath, _strPath, _searchString);
#ifdef _WIN32
WIN32_FIND_DATA findData;
- HANDLE FindFirst = FindFirstFile(GCMSearchPath.c_str(), &findData);
+ std::wstring searchPathW = ConvertUTF8ToWString(GCMSearchPath);
+ HANDLE FindFirst = FindFirstFile(searchPathW.c_str(), &findData);
if (FindFirst != INVALID_HANDLE_VALUE)
{
@@ -64,7 +66,7 @@ void CFileSearch::FindFiles(const std::string& _searchString, const std::string&
if (findData.cFileName[0] != '.')
{
std::string strFilename;
- BuildCompleteFilename(strFilename, _strPath, findData.cFileName);
+ BuildCompleteFilename(strFilename, _strPath, ConvertWStringToUTF8(findData.cFileName));
m_FileNames.push_back(strFilename);
}
diff --git a/Common/FileUtil.cpp b/Common/FileUtil.cpp
index 9f93febbd8c2..080c2b8d56d3 100644
--- a/Common/FileUtil.cpp
+++ b/Common/FileUtil.cpp
@@ -41,6 +41,8 @@
#include
#endif
+#include "util/text/utf8.h"
+
#include
#include
@@ -154,7 +156,7 @@ bool Delete(const std::string &filename)
}
#ifdef _WIN32
- if (!DeleteFile(filename.c_str()))
+ if (!DeleteFile(ConvertUTF8ToWString(filename).c_str()))
{
WARN_LOG(COMMON, "Delete: DeleteFile failed on %s: %s",
filename.c_str(), GetLastErrorMsg());
@@ -176,7 +178,7 @@ bool CreateDir(const std::string &path)
{
INFO_LOG(COMMON, "CreateDir: directory %s", path.c_str());
#ifdef _WIN32
- if (::CreateDirectory(path.c_str(), NULL))
+ if (::CreateDirectory(ConvertUTF8ToWString(path).c_str(), NULL))
return true;
DWORD error = GetLastError();
if (error == ERROR_ALREADY_EXISTS)
@@ -267,7 +269,7 @@ bool DeleteDir(const std::string &filename)
}
#ifdef _WIN32
- if (::RemoveDirectory(filename.c_str()))
+ if (::RemoveDirectory(ConvertUTF8ToWString(filename).c_str()))
return true;
#else
if (rmdir(filename.c_str()) == 0)
@@ -296,7 +298,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
INFO_LOG(COMMON, "Copy: %s --> %s",
srcFilename.c_str(), destFilename.c_str());
#ifdef _WIN32
- if (CopyFile(srcFilename.c_str(), destFilename.c_str(), FALSE))
+ if (CopyFile(ConvertUTF8ToWString(srcFilename).c_str(), ConvertUTF8ToWString(destFilename).c_str(), FALSE))
return true;
ERROR_LOG(COMMON, "Copy: failed %s --> %s: %s",
@@ -461,80 +463,6 @@ bool CreateEmptyFile(const std::string &filename)
return true;
}
-
-// Scans the directory tree gets, starting from _Directory and adds the
-// results into parentEntry. Returns the number of files+directories found
-u32 ScanDirectoryTree(const std::string &directory, FSTEntry& parentEntry)
-{
- INFO_LOG(COMMON, "ScanDirectoryTree: directory %s", directory.c_str());
- // How many files + directories we found
- u32 foundEntries = 0;
-#ifdef _WIN32
- // Find the first file in the directory.
- WIN32_FIND_DATA ffd;
-
- HANDLE hFind = FindFirstFile((directory + "\\*").c_str(), &ffd);
- if (hFind == INVALID_HANDLE_VALUE)
- {
- FindClose(hFind);
- return foundEntries;
- }
- // windows loop
- do
- {
- FSTEntry entry;
- const std::string virtualName(ffd.cFileName);
-#else
- struct dirent_large { struct dirent entry; char padding[FILENAME_MAX+1]; };
- struct dirent_large diren;
- struct dirent *result = NULL;
-
- DIR *dirp = opendir(directory.c_str());
- if (!dirp)
- return 0;
-
- // non windows loop
- while (!readdir_r(dirp, (dirent*)&diren, &result) && result)
- {
- FSTEntry entry;
- const std::string virtualName(result->d_name);
-#endif
- // check for "." and ".."
- if (((virtualName[0] == '.') && (virtualName[1] == '\0')) ||
- ((virtualName[0] == '.') && (virtualName[1] == '.') &&
- (virtualName[2] == '\0')))
- continue;
- entry.virtualName = virtualName;
- entry.physicalName = directory;
- entry.physicalName += DIR_SEP + entry.virtualName;
-
- if (IsDirectory(entry.physicalName.c_str()))
- {
- entry.isDirectory = true;
- // is a directory, lets go inside
- entry.size = ScanDirectoryTree(entry.physicalName, entry);
- foundEntries += (u32)entry.size;
- }
- else
- { // is a file
- entry.isDirectory = false;
- entry.size = GetSize(entry.physicalName.c_str());
- }
- ++foundEntries;
- // Push into the tree
- parentEntry.children.push_back(entry);
-#ifdef _WIN32
- } while (FindNextFile(hFind, &ffd) != 0);
- FindClose(hFind);
-#else
- }
- closedir(dirp);
-#endif
- // Return number of entries found.
- return foundEntries;
-}
-
-
// Deletes the given directory and anything under it. Returns true on success.
bool DeleteDirRecursively(const std::string &directory)
{
@@ -542,7 +470,7 @@ bool DeleteDirRecursively(const std::string &directory)
#ifdef _WIN32
// Find the first file in the directory.
WIN32_FIND_DATA ffd;
- HANDLE hFind = FindFirstFile((directory + "\\*").c_str(), &ffd);
+ HANDLE hFind = FindFirstFile(ConvertUTF8ToWString(directory + "\\*").c_str(), &ffd);
if (hFind == INVALID_HANDLE_VALUE)
{
@@ -553,7 +481,7 @@ bool DeleteDirRecursively(const std::string &directory)
// windows loop
do
{
- const std::string virtualName = ffd.cFileName;
+ const std::string virtualName = ConvertWStringToUTF8(ffd.cFileName);
#else
struct dirent dirent, *result = NULL;
DIR *dirp = opendir(directory.c_str());
diff --git a/Common/FileUtil.h b/Common/FileUtil.h
index e11a3d40f8e5..56277f94f4a8 100644
--- a/Common/FileUtil.h
+++ b/Common/FileUtil.h
@@ -99,10 +99,6 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename);
// creates an empty file filename, returns true on success
bool CreateEmptyFile(const std::string &filename);
-// Scans the directory tree gets, starting from _Directory and adds the
-// results into parentEntry. Returns the number of files+directories found
-u32 ScanDirectoryTree(const std::string &directory, FSTEntry& parentEntry);
-
// deletes the given directory and anything under it. Returns true on success.
bool DeleteDirRecursively(const std::string &directory);
diff --git a/Common/Misc.cpp b/Common/Misc.cpp
index 37807a0f6166..f40187a77949 100644
--- a/Common/Misc.cpp
+++ b/Common/Misc.cpp
@@ -35,7 +35,7 @@ const char* GetLastErrorMsg()
#ifdef _WIN32
static __declspec(thread) char err_str[buff_size] = {};
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
+ FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
err_str, buff_size, NULL);
#else
diff --git a/Common/MsgHandler.cpp b/Common/MsgHandler.cpp
index 1bc7f4cd0cbd..4ebb401cd607 100644
--- a/Common/MsgHandler.cpp
+++ b/Common/MsgHandler.cpp
@@ -20,6 +20,7 @@
#include "Common.h" // Local
#include "StringUtils.h"
+#include "util/text/utf8.h"
bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int Style);
static MsgAlertHandler msg_handler = DefaultMsgHandler;
@@ -106,15 +107,18 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...)
bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int Style)
{
#ifdef _WIN32
- int STYLE = MB_ICONINFORMATION;
- if (Style == QUESTION) STYLE = MB_ICONQUESTION;
- if (Style == WARNING) STYLE = MB_ICONWARNING;
-
- return IDYES == MessageBox(0, text, caption, STYLE | (yes_no ? MB_YESNO : MB_OK));
-
+ int STYLE = MB_ICONINFORMATION;
+ if (Style == QUESTION) STYLE = MB_ICONQUESTION;
+ if (Style == WARNING) STYLE = MB_ICONWARNING;
+
+ std::wstring wtext = ConvertUTF8ToWString(text);
+ std::wstring wcaption = ConvertUTF8ToWString(caption);
+
+ return IDYES == MessageBox(0, wtext.c_str(), wcaption.c_str(), STYLE | (yes_no ? MB_YESNO : MB_OK));
+
#else
- printf("%s\n", text);
- return true;
+ printf("%s\n", text);
+ return true;
#endif
}
diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj
index 7600d46b7a08..190235177558 100644
--- a/Core/Core.vcxproj
+++ b/Core/Core.vcxproj
@@ -26,24 +26,24 @@
StaticLibrary
true
- MultiByte
+ Unicode
StaticLibrary
true
- MultiByte
+ Unicode
StaticLibrary
false
false
- MultiByte
+ Unicode
StaticLibrary
false
false
- MultiByte
+ Unicode
diff --git a/Core/Debugger/DebugInterface.h b/Core/Debugger/DebugInterface.h
index 7c6244333988..7a000d4df982 100644
--- a/Core/Debugger/DebugInterface.h
+++ b/Core/Debugger/DebugInterface.h
@@ -43,7 +43,7 @@ class DebugInterface
virtual const char *getDescription(unsigned int address) {return "";}
virtual const char *findSymbolForAddress(unsigned int address) { return NULL; };
virtual bool getSymbolValue(char* symbol, u32& dest) { return false; };
- virtual bool initExpression(char* exp, PostfixExpression& dest) { return false; };
+ virtual bool initExpression(const char* exp, PostfixExpression& dest) { return false; };
virtual bool parseExpression(PostfixExpression& exp, u32& dest) { return false; };
diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp
index a770fabc4cc5..d156040010ac 100644
--- a/Core/FileSystems/DirectoryFileSystem.cpp
+++ b/Core/FileSystems/DirectoryFileSystem.cpp
@@ -21,6 +21,7 @@
#include "ISOFileSystem.h"
#include "Core/HLE/sceKernel.h"
#include "file/zip_read.h"
+#include "util/text/utf8.h"
#ifdef _WIN32
#include "Common/CommonWindows.h"
@@ -184,7 +185,7 @@ bool DirectoryFileHandle::Open(std::string& basePath, std::string& fileName, Fil
openmode = OPEN_EXISTING;
}
//Let's do it!
- hFile = CreateFile(fullName.c_str(), desired, sharemode, 0, openmode, 0, 0);
+ hFile = CreateFile(ConvertUTF8ToWString(fullName).c_str(), desired, sharemode, 0, openmode, 0, 0);
bool success = hFile != INVALID_HANDLE_VALUE;
#else
// Convert flags in access parameter to fopen access mode
@@ -392,7 +393,7 @@ int DirectoryFileSystem::RenameFile(const std::string &from, const std::string &
const char * fullToC = fullTo.c_str();
#ifdef _WIN32
- bool retValue = (MoveFile(fullFrom.c_str(), fullToC) == TRUE);
+ bool retValue = (MoveFile(ConvertUTF8ToWString(fullFrom).c_str(), ConvertUTF8ToWString(fullToC).c_str()) == TRUE);
#else
bool retValue = (0 == rename(fullFrom.c_str(), fullToC));
#endif
@@ -586,7 +587,7 @@ std::vector DirectoryFileSystem::GetDirListing(std::string path) {
std::string w32path = GetLocalPath(path) + "\\*.*";
- hFind = FindFirstFile(w32path.c_str(), &findData);
+ hFind = FindFirstFile(ConvertUTF8ToWString(w32path).c_str(), &findData);
if (hFind == INVALID_HANDLE_VALUE) {
return myVector; //the empty list
@@ -603,11 +604,11 @@ std::vector DirectoryFileSystem::GetDirListing(std::string path) {
entry.access = entry.type == FILETYPE_NORMAL ? 0666 : 0777;
// TODO: is this just for .. or all subdirectories? Need to add a directory to the test
// to find out. Also why so different than the old test results?
- if (!strcmp(findData.cFileName, "..") )
+ if (!wcscmp(findData.cFileName, L"..") )
entry.size = 4096;
else
entry.size = findData.nFileSizeLow | ((u64)findData.nFileSizeHigh<<32);
- entry.name = findData.cFileName;
+ entry.name = ConvertWStringToUTF8(findData.cFileName);
tmFromFiletime(entry.atime, findData.ftLastAccessTime);
tmFromFiletime(entry.ctime, findData.ftCreationTime);
tmFromFiletime(entry.mtime, findData.ftLastWriteTime);
diff --git a/Core/FileSystems/VirtualDiscFileSystem.cpp b/Core/FileSystems/VirtualDiscFileSystem.cpp
index 54e48f6cedf0..aac0098dda76 100644
--- a/Core/FileSystems/VirtualDiscFileSystem.cpp
+++ b/Core/FileSystems/VirtualDiscFileSystem.cpp
@@ -22,6 +22,7 @@
#include "Core/FileSystems/ISOFileSystem.h"
#include "Core/HLE/sceKernel.h"
#include "file/zip_read.h"
+#include "util/text/utf8.h"
#ifdef _WIN32
#include "Common/CommonWindows.h"
@@ -599,14 +600,14 @@ std::vector VirtualDiscFileSystem::GetDirListing(std::string path)
std::string w32path = GetLocalPath(path) + "\\*.*";
- hFind = FindFirstFile(w32path.c_str(), &findData);
+ hFind = FindFirstFile(ConvertUTF8ToWString(w32path).c_str(), &findData);
if (hFind == INVALID_HANDLE_VALUE) {
return myVector; //the empty list
}
for (BOOL retval = 1; retval; retval = FindNextFile(hFind, &findData)) {
- if (!strcmp(findData.cFileName, "..") || !strcmp(findData.cFileName, ".")) {
+ if (!wcscmp(findData.cFileName, L"..") || !wcscmp(findData.cFileName, L".")) {
continue;
}
@@ -619,7 +620,7 @@ std::vector VirtualDiscFileSystem::GetDirListing(std::string path)
entry.access = FILEACCESS_READ;
entry.size = findData.nFileSizeLow | ((u64)findData.nFileSizeHigh<<32);
- entry.name = findData.cFileName;
+ entry.name = ConvertWStringToUTF8(findData.cFileName);
tmFromFiletime(entry.atime, findData.ftLastAccessTime);
tmFromFiletime(entry.ctime, findData.ftCreationTime);
tmFromFiletime(entry.mtime, findData.ftLastWriteTime);
@@ -728,7 +729,7 @@ void VirtualDiscFileSystem::HandlerLogger(void *arg, HandlerHandle handle, LogTy
VirtualDiscFileSystem::Handler::Handler(const char *filename, VirtualDiscFileSystem *const sys) {
#ifdef _WIN32
-#define dlopen(name, ignore) (void *)LoadLibrary(name)
+#define dlopen(name, ignore) (void *)LoadLibrary(ConvertUTF8ToWString(name).c_str())
#define dlsym(mod, name) GetProcAddress((HMODULE)mod, name)
#define dlclose(mod) FreeLibrary((HMODULE)mod)
#endif
diff --git a/Core/Host.h b/Core/Host.h
index ca327aeff8bb..457bd782c271 100644
--- a/Core/Host.h
+++ b/Core/Host.h
@@ -21,16 +21,14 @@
struct InputState;
-class PMixer
-{
+class PMixer {
public:
PMixer() {}
virtual ~PMixer() {}
virtual int Mix(short *stereoout, int numSamples) {memset(stereoout,0,numSamples*2*sizeof(short)); return numSamples;}
};
-class Host
-{
+class Host {
public:
virtual ~Host() {}
//virtual void StartThread()
@@ -64,6 +62,8 @@ class Host
virtual void SendGPUWait(u32 cmd, u32 addr, void* data) {}
virtual void SetGPUStep(bool value, int flag = 0, int data = 0) {}
virtual void NextGPUStep() {}
+ virtual bool CanCreateShortcut() {return false;}
+ virtual bool CreateDesktopShortcut(std::string argumentPath, std::string title) {return false;}
#ifdef _WIN32
// Implement this on your platform to grab text input from the user for whatever purpose.
diff --git a/Core/MIPS/MIPSAsm.cpp b/Core/MIPS/MIPSAsm.cpp
index 595e01ea0bd8..b1a196c35061 100644
--- a/Core/MIPS/MIPSAsm.cpp
+++ b/Core/MIPS/MIPSAsm.cpp
@@ -30,7 +30,7 @@ void SplitLine(const char* Line, char* Name, char* Arguments)
*Arguments = 0;
}
-bool MipsAssembleOpcode(char* line, DebugInterface* cpu, u32 address, u32& dest)
+bool MipsAssembleOpcode(const char* line, DebugInterface* cpu, u32 address, u32& dest)
{
char name[64],args[256];
SplitLine(line,name,args);
@@ -51,7 +51,7 @@ bool MipsAssembleOpcode(char* line, DebugInterface* cpu, u32 address, u32& dest)
return true;
}
-int MipsGetRegister(char* source, int& RetLen)
+int MipsGetRegister(const char* source, int& RetLen)
{
for (int z = 0; MipsRegister[z].name != NULL; z++)
{
@@ -69,7 +69,7 @@ int MipsGetRegister(char* source, int& RetLen)
return -1;
}
-int MipsGetFloatRegister(char* source, int& RetLen)
+int MipsGetFloatRegister(const char* source, int& RetLen)
{
for (int z = 0; MipsFloatRegister[z].name != NULL; z++)
{
@@ -87,7 +87,7 @@ int MipsGetFloatRegister(char* source, int& RetLen)
return -1;
}
-bool MipsCheckImmediate(char* Source, char* Dest, int& RetLen)
+bool MipsCheckImmediate(const char* Source, char* Dest, int& RetLen)
{
int BufferPos = 0;
int l;
diff --git a/Core/MIPS/MIPSAsm.h b/Core/MIPS/MIPSAsm.h
index 9c851c06b41b..80a3a9b73ff0 100644
--- a/Core/MIPS/MIPSAsm.h
+++ b/Core/MIPS/MIPSAsm.h
@@ -6,7 +6,7 @@
namespace MIPSAsm
{
-bool MipsAssembleOpcode(char* line, DebugInterface* cpu, u32 address, u32& dest);
+bool MipsAssembleOpcode(const char* line, DebugInterface* cpu, u32 address, u32& dest);
typedef enum eMipsImmediateType { MIPS_NOIMMEDIATE, MIPS_IMMEDIATE5,
MIPS_IMMEDIATE16, MIPS_IMMEDIATE20, MIPS_IMMEDIATE26 };
diff --git a/Core/MIPS/MIPSDebugInterface.cpp b/Core/MIPS/MIPSDebugInterface.cpp
index 052456538825..65ddc12030a7 100644
--- a/Core/MIPS/MIPSDebugInterface.cpp
+++ b/Core/MIPS/MIPSDebugInterface.cpp
@@ -171,7 +171,7 @@ bool MIPSDebugInterface::getSymbolValue(char* symbol, u32& dest)
return symbolMap.getSymbolValue(symbol,dest);
}
-bool MIPSDebugInterface::initExpression(char* exp, PostfixExpression& dest)
+bool MIPSDebugInterface::initExpression(const char* exp, PostfixExpression& dest)
{
MipsExpressionFunctions funcs(this);
return initPostfixExpression(exp,&funcs,dest);
diff --git a/Core/MIPS/MIPSDebugInterface.h b/Core/MIPS/MIPSDebugInterface.h
index 4168d66edc02..26ee3e9d6f2e 100644
--- a/Core/MIPS/MIPSDebugInterface.h
+++ b/Core/MIPS/MIPSDebugInterface.h
@@ -42,7 +42,7 @@ class MIPSDebugInterface : public DebugInterface
virtual const char *getDescription(unsigned int address);
virtual const char *findSymbolForAddress(unsigned int address);
virtual bool getSymbolValue(char* symbol, u32& dest);
- virtual bool initExpression(char* exp, PostfixExpression& dest);
+ virtual bool initExpression(const char* exp, PostfixExpression& dest);
virtual bool parseExpression(PostfixExpression& exp, u32& dest);
//overridden functions
diff --git a/Core/System.cpp b/Core/System.cpp
index 075225ffcc45..e545fbf22e9c 100644
--- a/Core/System.cpp
+++ b/Core/System.cpp
@@ -22,6 +22,7 @@
#include "native/thread/thread.h"
#include "native/thread/threadutil.h"
#include "native/base/mutex.h"
+#include "util/text/utf8.h"
#include "Core/MemMap.h"
@@ -324,13 +325,16 @@ CoreParameter &PSP_CoreParameter() {
void GetSysDirectories(std::string &memstickpath, std::string &flash0path) {
#ifdef _WIN32
- char path_buffer[_MAX_PATH], drive[_MAX_DRIVE] ,dir[_MAX_DIR], file[_MAX_FNAME], ext[_MAX_EXT];
+ wchar_t path_buffer[_MAX_PATH];
+ char drive[_MAX_DRIVE] ,dir[_MAX_DIR], file[_MAX_FNAME], ext[_MAX_EXT];
char memstickpath_buf[_MAX_PATH];
char flash0path_buf[_MAX_PATH];
- GetModuleFileName(NULL,path_buffer,sizeof(path_buffer));
+ GetModuleFileName(NULL, path_buffer, sizeof(path_buffer));
- _splitpath_s(path_buffer, drive, dir, file, ext );
+ std::string path = ConvertWStringToUTF8(path_buffer);
+
+ _splitpath_s(path.c_str(), drive, dir, file, ext );
// Mount a couple of filesystems
sprintf(memstickpath_buf, "%s%smemstick\\", drive, dir);
diff --git a/GPU/GLES/ShaderManager.cpp b/GPU/GLES/ShaderManager.cpp
index e6bc95f76832..8cc0a37b0046 100644
--- a/GPU/GLES/ShaderManager.cpp
+++ b/GPU/GLES/ShaderManager.cpp
@@ -25,6 +25,8 @@
#include