Merge pull request #417 from xsacha/master

Stdafx: More header cleaning.
This commit is contained in:
Alexandro Sánchez Bach 2014-07-12 14:03:21 +02:00
commit 64754a08b4
138 changed files with 279 additions and 509 deletions

View File

@ -1,88 +0,0 @@
#pragma once
template<typename T, size_t size> class SizedStack
{
T m_ptr[size];
uint m_count;
public:
SizedStack()
{
Clear();
}
~SizedStack()
{
Clear();
}
void Clear()
{
m_count = 0;
}
bool Pop(T& dst)
{
if(!m_count)
return false;
dst = m_ptr[--m_count];
return true;
}
bool Push(const T& src)
{
if(m_count + 1 > size)
return false;
m_ptr[m_count++] = src;
return true;
}
size_t GetFreeCount() const
{
return size - m_count;
}
size_t GetCount() const
{
return m_count;
}
size_t GetMaxCount() const
{
return size;
}
};
template<typename T> struct ScopedPtr
{
private:
T* m_ptr;
public:
ScopedPtr() : m_ptr(nullptr)
{
}
ScopedPtr(T* ptr) : m_ptr(ptr)
{
}
~ScopedPtr()
{
Swap(nullptr);
}
operator T*() { return m_ptr; }
operator const T*() const { return m_ptr; }
T* operator ->() { return m_ptr; }
const T* operator ->() const { return m_ptr; }
void Swap(T* ptr)
{
delete m_ptr;
m_ptr = ptr;
}
};

View File

@ -1,13 +1,8 @@
#include <time.h>
#include <sys/time.h>
#include "GNU.h" #include "GNU.h"
#ifdef __APPLE__ #ifdef __APPLE__
void * _aligned_malloc(size_t size, size_t alignment) { #include <time.h>
void *buffer; #include <sys/time.h>
posix_memalign(&buffer, alignment, size);
return buffer;
}
int clock_gettime(int foo, struct timespec *ts) { int clock_gettime(int foo, struct timespec *ts) {
struct timeval tv; struct timeval tv;
@ -17,4 +12,12 @@ int clock_gettime(int foo, struct timespec *ts) {
ts->tv_nsec = tv.tv_usec * 1000; ts->tv_nsec = tv.tv_usec * 1000;
return(0); return(0);
} }
#endif /* !__APPLE__ */ #endif /* __APPLE__ */
#if defined(__GNUG__)
void * _aligned_malloc(size_t size, size_t alignment) {
void *buffer;
return (posix_memalign(&buffer, alignment, size) == 0) ? buffer : 0;
}
#endif

View File

@ -28,7 +28,6 @@ void strcpy_trunc(char (&dst)[size], const std::string& src)
#define _byteswap_ushort(x) __builtin_bswap16(x) #define _byteswap_ushort(x) __builtin_bswap16(x)
#define _byteswap_ulong(x) __builtin_bswap32(x) #define _byteswap_ulong(x) __builtin_bswap32(x)
#define _byteswap_uint64(x) __builtin_bswap64(x) #define _byteswap_uint64(x) __builtin_bswap64(x)
#define Sleep(x) usleep(x * 1000)
#define mkdir(x) mkdir(x, 0777) #define mkdir(x) mkdir(x, 0777)
#define INFINITE 0xFFFFFFFF #define INFINITE 0xFFFFFFFF
#define _CRT_ALIGN(x) __attribute__((aligned(x))) #define _CRT_ALIGN(x) __attribute__((aligned(x)))
@ -61,10 +60,10 @@ inline int64_t __mulh(int64_t a, int64_t b)
return result; return result;
} }
#ifndef __APPLE__
#define _aligned_malloc(size,alignment) memalign(alignment,size)
#else
void * _aligned_malloc(size_t size, size_t alignment); void * _aligned_malloc(size_t size, size_t alignment);
#ifdef __APPLE__
int clock_gettime(int foo, struct timespec *ts); int clock_gettime(int foo, struct timespec *ts);
#define wxIsNaN(x) ((x) != (x)) #define wxIsNaN(x) ((x) != (x))
@ -72,7 +71,7 @@ int clock_gettime(int foo, struct timespec *ts);
#define CLOCK_MONOTONIC 0 #define CLOCK_MONOTONIC 0
#endif /* !CLOCK_MONOTONIC */ #endif /* !CLOCK_MONOTONIC */
#endif /* !__APPLE__ */ #endif /* __APPLE__ */
#define _aligned_free free #define _aligned_free free

View File

@ -104,7 +104,7 @@ struct FileListener : LogListener
{ {
if (!mFile.IsOpened()) if (!mFile.IsOpened())
{ {
rMessageBox("Can't create log file! (" + name + ".log)", rMessageBoxCaptionStr, rICON_ERROR); rMessageBox("Can't create log file! (" + name + ".log)", "Error", rICON_ERROR);
} }
} }

View File

@ -14,7 +14,7 @@ __forceinline void SM_Sleep()
} }
else else
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
} }

View File

@ -1,5 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/SSemaphore.h" #include "Utilities/SSemaphore.h"
#include "Emu/System.h"
void SSemaphore::wait() void SSemaphore::wait()
{ {

View File

@ -1,5 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Thread.h" #include "Thread.h"

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "Array.h"
#include <functional> #include <functional>
#include <thread> #include <thread>
#include <vector> #include <vector>
@ -8,6 +7,13 @@
#include <condition_variable> #include <condition_variable>
#include <Utilities/SSemaphore.h> #include <Utilities/SSemaphore.h>
static std::thread::id main_thread;
struct rThread
{
static bool IsMain() { std::this_thread::get_id() == main_thread; }
};
class ThreadExec; class ThreadExec;
class NamedThreadBase class NamedThreadBase
@ -171,7 +177,7 @@ private:
Step(); Step();
} }
while(!TestDestroy()) Sleep(0); while(!TestDestroy()) std::this_thread::sleep_for(std::chrono::milliseconds(0));
if(m_destroy_sem.TryWait() != wxSEMA_NO_ERROR) m_destroy_sem.Post(); if(m_destroy_sem.TryWait() != wxSEMA_NO_ERROR) m_destroy_sem.Post();
} }
@ -192,7 +198,7 @@ public:
{ {
if(!IsRunning()) return; if(!IsRunning()) return;
while(m_main_sem.TryWait() != wxSEMA_NO_ERROR) Sleep(0); while(m_main_sem.TryWait() != wxSEMA_NO_ERROR) std::this_thread::sleep_for(std::chrono::milliseconds(0));
} }
void Exit(bool wait = false) void Exit(bool wait = false)

View File

@ -1,41 +0,0 @@
#include "stdafx.h"
rTimer::rTimer()
{
handle = reinterpret_cast<void*>(new wxTimer());
}
rTimer::~rTimer()
{
delete reinterpret_cast<wxTimer*>(handle);
}
void rTimer::Start()
{
reinterpret_cast<wxTimer*>(handle)->Start();
}
void rTimer::Stop()
{
reinterpret_cast<wxTimer*>(handle)->Stop();
}
void rSleep(u32 time)
{
wxSleep(time);
}
void rMicroSleep(u64 time)
{
wxMicroSleep(time);
}
bool rThread::IsMain()
{
return wxThread::IsMain();
}
void rYieldIfNeeded()
{
wxYieldIfNeeded();
}

View File

@ -1,22 +0,0 @@
#pragma once
struct rTimer
{
rTimer();
rTimer(const rTimer& other) = delete;
~rTimer();
void Start();
void Stop();
private:
void *handle;
};
void rSleep(u32 time);
void rMicroSleep(u64 time);
struct rThread
{
static bool IsMain();
};
void rYieldIfNeeded();

View File

@ -1,6 +1,19 @@
#include "stdafx.h" #include "stdafx.h"
#include <wx/dir.h>
const int rPATH_MKDIR_FULL = wxPATH_MKDIR_FULL; #ifdef _WIN32
// Maybe in StrFmt?
std::wstring ConvertUTF8ToWString(const std::string &source) {
int len = (int)source.size();
int size = (int)MultiByteToWideChar(CP_UTF8, 0, source.c_str(), len, NULL, 0);
std::wstring str;
str.resize(size);
if (size > 0) {
MultiByteToWideChar(CP_UTF8, 0, source.c_str(), len, &str[0], size);
}
return str;
}
#endif
wxFile::OpenMode convertOpenMode(rFile::OpenMode open) wxFile::OpenMode convertOpenMode(rFile::OpenMode open)
{ {
@ -140,7 +153,13 @@ bool rFile::Open(const std::string &filename, rFile::OpenMode mode, int access)
bool rFile::Exists(const std::string &file) bool rFile::Exists(const std::string &file)
{ {
return wxFile::Exists(fmt::FromUTF8(file)); #ifdef _WIN32
std::wstring wstr = ConvertUTF8ToWString(filename);
return GetFileAttributes(wstr.c_str()) != 0xFFFFFFFF;
#else
struct stat buffer;
return (stat (file.c_str(), &buffer) == 0);
#endif
} }
bool rFile::IsOpened() const bool rFile::IsOpened() const
@ -173,14 +192,25 @@ std::string rGetCwd()
return fmt::ToUTF8(wxGetCwd()); return fmt::ToUTF8(wxGetCwd());
} }
bool rMkdir(const std::string &path) bool rMkdir(const std::string &dir)
{ {
return wxMkdir(fmt::FromUTF8(path)); return mkdir(dir.c_str());
} }
bool rRmdir(const std::string &path) bool rMkpath(const std::string& path)
{ {
return wxRmdir(fmt::FromUTF8(path)); return wxFileName::Mkdir(fmt::FromUTF8(path), 0777, wxPATH_MKDIR_FULL);
}
bool rRmdir(const std::string &dir)
{
#ifdef _WIN32
if (!RemoveDirectory(ConvertUTF8ToWString(dir).c_str())) {
ELOG("Error deleting directory %s: %i", dir, GetLastError());
}
#else
rmdir(dir.c_str());
#endif
} }
bool rDirExists(const std::string &path) bool rDirExists(const std::string &path)
@ -235,7 +265,7 @@ bool rDir::Open(const std::string& path)
bool rDir::Exists(const std::string &path) bool rDir::Exists(const std::string &path)
{ {
return wxDir::Exists(fmt::FromUTF8(path)); return rFile::Exists(path);
} }
bool rDir::GetFirst(std::string *filename) const bool rDir::GetFirst(std::string *filename) const
@ -299,11 +329,6 @@ std::string rFileName::GetFullName()
return fmt::ToUTF8(reinterpret_cast<wxFileName*>(handle)->GetFullName()); return fmt::ToUTF8(reinterpret_cast<wxFileName*>(handle)->GetFullName());
} }
bool rFileName::Mkdir(const std::string& name, int permissions , int flags )
{
return wxFileName::Mkdir(fmt::FromUTF8(name), permissions, flags);
}
bool rFileName::Normalize() bool rFileName::Normalize()
{ {
return reinterpret_cast<wxFileName*>(handle)->Normalize(); return reinterpret_cast<wxFileName*>(handle)->Normalize();

View File

@ -2,8 +2,6 @@
#include <string> #include <string>
extern const int rPATH_MKDIR_FULL;
enum rSeekMode enum rSeekMode
{ {
rFromStart, rFromStart,
@ -44,8 +42,9 @@ public:
}; };
std::string rGetCwd(); std::string rGetCwd();
bool rMkdir(const std::string &path); bool rRmdir(const std::string& dir);
bool rRmdir(const std::string &path); bool rMkdir(const std::string& dir);
bool rMkpath(const std::string& path);
bool rDirExists(const std::string &path); bool rDirExists(const std::string &path);
bool rFileExists(const std::string &path); bool rFileExists(const std::string &path);
bool rRemoveFile(const std::string &path); bool rRemoveFile(const std::string &path);
@ -77,7 +76,6 @@ struct rFileName
std::string GetPath(); std::string GetPath();
std::string GetName(); std::string GetName();
std::string GetFullName(); std::string GetFullName();
static bool Mkdir(const std::string& name, int permissions=0777, int flags=0);
bool Normalize(); bool Normalize();
void *handle; void *handle;

View File

@ -1,8 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#ifndef QT_UI
std::string rMessageBoxCaptionStr = "Message";
rMessageDialog::rMessageDialog(void *parent, const std::string& msg, const std::string& title , long style ) rMessageDialog::rMessageDialog(void *parent, const std::string& msg, const std::string& title , long style )
{ {
handle = reinterpret_cast<void*>(new wxMessageDialog( handle = reinterpret_cast<void*>(new wxMessageDialog(
@ -28,24 +26,5 @@ long rMessageBox(const std::string& message, const std::string& title, long styl
return wxMessageBox(fmt::FromUTF8(message), fmt::FromUTF8(title),style); return wxMessageBox(fmt::FromUTF8(message), fmt::FromUTF8(title),style);
} }
std::string dummyApp::GetAppName() #endif
{
if (handle)
{
return fmt::ToUTF8(reinterpret_cast<wxApp*>(handle)->GetAppName());
}
else
{
return "NULL";
}
}
dummyApp::dummyApp() : handle(nullptr)
{
}
static dummyApp app;
dummyApp& rGetApp()
{
return app;
}

View File

@ -1,34 +1,33 @@
#pragma once #pragma once
extern std::string rMessageBoxCaptionStr;// = "Message";
enum MsgBoxParams : unsigned long enum MsgBoxParams : unsigned long
{ {
rOK = 0x4 rYES_DEFAULT = 0x0,
, rYES =0x2//res rOK_DEFAULT = 0x0,
, rNO = 0x8 //res rCENTRE = 0x1,
, rID_YES = 5103 //resDialog rYES = 0x2, //res
, rCANCEL = 0x10 rOK = 0x4,
, rYES_NO = 0xA rNO = 0x8, //res
, rHELP = 0x1000 rCANCEL = 0x10,
, rNO_DEFAULT = 0x80 rYES_NO = 0xA,
, rCANCEL_DEFAULT = 0x80000000 rNO_DEFAULT = 0x80,
, rYES_DEFAULT = 0x0 rICON_EXCLAMATION = 0x100,
, rOK_DEFAULT = 0x0 rICON_ERROR = 0x200,
, rICON_NONE = 0x40000 rICON_HAND = 0x200,
, rICON_EXCLAMATION = 0x100 rICON_QUESTION = 0x400,
, rICON_ERROR = 0x200 rICON_INFORMATION = 0x800,
, rICON_HAND = 0x200 rHELP = 0x1000,
, rICON_QUESTION = 0x400 rID_CANCEL = 0x13ED,
, rICON_INFORMATION = 0x800 rID_YES = 0x13EF, //resDialog
, rICON_AUTH_NEEDED = 0x80000 rSTAY_ON_TOP = 0x8000,
, rSTAY_ON_TOP = 0x8000 rICON_NONE = 0x40000,
, rCENTRE = 0x1 rICON_AUTH_NEEDED = 0x80000,
rCANCEL_DEFAULT = 0x80000000,
}; };
struct rMessageDialog struct rMessageDialog
{ {
rMessageDialog(void *parent, const std::string& msg, const std::string& title = rMessageBoxCaptionStr, long style = rOK | rCENTRE); rMessageDialog(void *parent, const std::string& msg, const std::string& title = "RPCS3", long style = rOK | rCENTRE);
rMessageDialog(const rMessageDialog& other) = delete; rMessageDialog(const rMessageDialog& other) = delete;
~rMessageDialog(); ~rMessageDialog();
long ShowModal(); long ShowModal();
@ -37,11 +36,3 @@ struct rMessageDialog
long rMessageBox(const std::string& message, const std::string& title,long style); long rMessageBox(const std::string& message, const std::string& title,long style);
struct dummyApp
{
dummyApp();
std::string GetAppName();
void* handle;
};
dummyApp& rGetApp();

View File

@ -2,6 +2,7 @@
#include <memory> #include <memory>
#include "Utilities/rXml.h"
#include <wx/xml/xml.h> #include <wx/xml/xml.h>
rXmlNode::rXmlNode() rXmlNode::rXmlNode()

View File

@ -1,3 +1,5 @@
#pragma once
/* /*
* Copyright 2001-2004 Unicode, Inc. * Copyright 2001-2004 Unicode, Inc.
* *

View File

@ -66,8 +66,6 @@ ${wxWidgets_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR}
"${RPCS3_SRC_DIR}/../ffmpeg/${PLATFORM_ARCH}/include" "${RPCS3_SRC_DIR}/../ffmpeg/${PLATFORM_ARCH}/include"
"${RPCS3_SRC_DIR}" "${RPCS3_SRC_DIR}"
"${RPCS3_SRC_DIR}/Emu"
"${RPCS3_SRC_DIR}/Gui"
"${RPCS3_SRC_DIR}/Loader" "${RPCS3_SRC_DIR}/Loader"
"${RPCS3_SRC_DIR}/Crypto" "${RPCS3_SRC_DIR}/Crypto"
"${RPCS3_SRC_DIR}/.." "${RPCS3_SRC_DIR}/.."

View File

@ -1,3 +1,5 @@
#pragma once
/** /**
* \file aes.h * \file aes.h
* *

View File

@ -1,3 +1,4 @@
#pragma once
#include <string.h> #include <string.h>
int decode_range(unsigned int *range, unsigned int *code, unsigned char **src); int decode_range(unsigned int *range, unsigned int *code, unsigned char **src);

View File

@ -1,3 +1,4 @@
#pragma once
/** /**
* \file sha1.h * \file sha1.h
* *

View File

@ -1,5 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/System.h"
#include "rpcs3/Ini.h" #include "rpcs3/Ini.h"
#include "OpenALThread.h" #include "OpenALThread.h"

View File

@ -3,6 +3,7 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/DbgCommand.h"
#include "rpcs3/Ini.h" #include "rpcs3/Ini.h"
#include "CPUThread.h" #include "CPUThread.h"
@ -333,7 +334,7 @@ void CPUThread::Task()
if (status == CPUThread_Sleeping) if (status == CPUThread_Sleeping)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
} }
@ -368,7 +369,7 @@ s64 CPUThread::ExecAsCallback(u64 pc, bool wait, u64 a1, u64 a2, u64 a3, u64 a4)
LOG_WARNING(PPU, "ExecAsCallback() aborted"); LOG_WARNING(PPU, "ExecAsCallback() aborted");
return CELL_ECANCELED; // doesn't mean anything return CELL_ECANCELED; // doesn't mean anything
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
Stop(); Stop();
@ -394,7 +395,7 @@ s64 CPUThread::ExecAsCallback(u64 pc, bool wait, u64 a1, u64 a2, u64 a3, u64 a4)
LOG_WARNING(PPU, "ExecAsCallback(wait=%s) aborted", wait ? "true" : "false"); LOG_WARNING(PPU, "ExecAsCallback(wait=%s) aborted", wait ? "true" : "false");
return CELL_EABORT; // doesn't mean anything return CELL_EABORT; // doesn't mean anything
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
return wait * m_exit_status; return wait * m_exit_status;

View File

@ -153,7 +153,7 @@ public:
{ {
while(func(ThreadStatus())) while(func(ThreadStatus()))
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
} }

View File

@ -2,6 +2,7 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/DbgCommand.h"
#include "CPUThreadManager.h" #include "CPUThreadManager.h"
#include "Emu/Cell/PPUThread.h" #include "Emu/Cell/PPUThread.h"

View File

@ -3,7 +3,6 @@
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h" #include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/Cell/PPUDecoder.h" #include "Emu/Cell/PPUDecoder.h"

View File

@ -1,7 +1,5 @@
#ifndef PPUTHREAD_H #pragma once
#define PPUTHREAD_H
#include "Emu/Cell/PPCThread.h" #include "Emu/Cell/PPCThread.h"
#include "Emu/SysCalls/SysCalls.h"
#include <cmath> #include <cmath>
enum enum
@ -861,4 +859,4 @@ protected:
}; };
PPUThread& GetCurrentPPUThread(); PPUThread& GetCurrentPPUThread();
#endif //PPUTHREAD_H

View File

@ -105,7 +105,8 @@ bool RawSPUThread::Read32(const u64 addr, u32* value)
case SPU_In_MBox_offs: case SPU_In_MBox_offs:
{ {
LOG_ERROR(Log::SPU, "RawSPUThread[%d]: Read32(SPU_In_MBox)", m_index); LOG_ERROR(Log::SPU, "RawSPUThread[%d]: Read32(SPU_In_MBox)", m_index);
while (!SPU.In_MBox.Pop(*value) && !Emu.IsStopped()) Sleep(1); while (!SPU.In_MBox.Pop(*value) && !Emu.IsStopped())
std::this_thread::sleep_for(std::chrono::milliseconds(1));
break; break;
} }
@ -250,7 +251,8 @@ bool RawSPUThread::Write32(const u64 addr, const u32 value)
case SPU_Out_MBox_offs: case SPU_Out_MBox_offs:
{ {
LOG_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_Out_MBox, 0x%x)", m_index, value); LOG_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_Out_MBox, 0x%x)", m_index, value);
while (!SPU.Out_MBox.Push(value) && !Emu.IsStopped()) Sleep(1); while (!SPU.Out_MBox.Push(value) && !Emu.IsStopped())
std::this_thread::sleep_for(std::chrono::milliseconds(1));
break; break;
} }

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include "Emu/Memory/Memory.h"
// SPURS defines. // SPURS defines.
enum SPURSKernelInterfaces enum SPURSKernelInterfaces
{ {

View File

@ -1,11 +1,9 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/SysCalls/lv2/sys_lwmutex.h" #include "Emu/SysCalls/lv2/sys_lwmutex.h"
#include "Emu/SysCalls/lv2/sys_event.h" #include "Emu/SysCalls/lv2/sys_event.h"
#include "Emu/Cell/SPUThread.h" #include "Emu/Cell/SPUThread.h"
#include "Emu/Cell/SPUDecoder.h" #include "Emu/Cell/SPUDecoder.h"
#include "Emu/Cell/SPUInterpreter.h" #include "Emu/Cell/SPUInterpreter.h"

View File

@ -2,6 +2,8 @@
#include "PPCThread.h" #include "PPCThread.h"
#include "Emu/Event.h" #include "Emu/Event.h"
#include "Emu/SysCalls/lv2/sys_spu.h" #include "Emu/SysCalls/lv2/sys_spu.h"
#include "Emu/SysCalls/lv2/sys_event.h"
#include "Emu/SysCalls/lv2/sys_time.h"
#include "MFC.h" #include "MFC.h"
#include "Emu/SysCalls/ErrorCodes.h" #include "Emu/SysCalls/ErrorCodes.h"
#include <mutex> #include <mutex>
@ -975,7 +977,7 @@ public:
{ {
while (t->IsAlive()) while (t->IsAlive())
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
if (Emu.IsStopped()) if (Emu.IsStopped())
{ {
LOG_WARNING(Log::SPU, "%s(%s) aborted", __FUNCTION__, spu_ch_name[ch]); LOG_WARNING(Log::SPU, "%s(%s) aborted", __FUNCTION__, spu_ch_name[ch]);
@ -1106,7 +1108,7 @@ public:
case SPU_WrOutMbox: case SPU_WrOutMbox:
{ {
//ConLog.Warning("%s: %s = 0x%x", __FUNCTION__, spu_ch_name[ch], v); //ConLog.Warning("%s: %s = 0x%x", __FUNCTION__, spu_ch_name[ch], v);
while (!SPU.Out_MBox.Push(v) && !Emu.IsStopped()) Sleep(1); while (!SPU.Out_MBox.Push(v) && !Emu.IsStopped()) std::this_thread::sleep_for(std::chrono::milliseconds(1));
break; break;
} }
@ -1206,41 +1208,41 @@ public:
{ {
case SPU_RdInMbox: case SPU_RdInMbox:
{ {
while (!SPU.In_MBox.Pop(v) && !Emu.IsStopped()) Sleep(1); while (!SPU.In_MBox.Pop(v) && !Emu.IsStopped()) std::this_thread::sleep_for(std::chrono::milliseconds(1));
//ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]); //ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]);
break; break;
} }
case MFC_RdTagStat: case MFC_RdTagStat:
{ {
while (!Prxy.TagStatus.Pop(v) && !Emu.IsStopped()) Sleep(1); while (!Prxy.TagStatus.Pop(v) && !Emu.IsStopped()) std::this_thread::sleep_for(std::chrono::milliseconds(1));
//ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]); //ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]);
break; break;
} }
case SPU_RdSigNotify1: case SPU_RdSigNotify1:
{ {
while (!SPU.SNR[0].Pop(v) && !Emu.IsStopped()) Sleep(1); while (!SPU.SNR[0].Pop(v) && !Emu.IsStopped()) std::this_thread::sleep_for(std::chrono::milliseconds(1));
//ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]); //ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]);
break; break;
} }
case SPU_RdSigNotify2: case SPU_RdSigNotify2:
{ {
while (!SPU.SNR[1].Pop(v) && !Emu.IsStopped()) Sleep(1); while (!SPU.SNR[1].Pop(v) && !Emu.IsStopped()) std::this_thread::sleep_for(std::chrono::milliseconds(1));
//ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]); //ConLog.Warning("%s: 0x%x = %s", __FUNCTION__, v, spu_ch_name[ch]);
break; break;
} }
case MFC_RdAtomicStat: case MFC_RdAtomicStat:
{ {
while (!Prxy.AtomicStat.Pop(v) && !Emu.IsStopped()) Sleep(1); while (!Prxy.AtomicStat.Pop(v) && !Emu.IsStopped()) std::this_thread::sleep_for(std::chrono::milliseconds(1));
break; break;
} }
case MFC_RdListStallStat: case MFC_RdListStallStat:
{ {
while (!StallStat.Pop(v) && !Emu.IsStopped()) Sleep(1); while (!StallStat.Pop(v) && !Emu.IsStopped()) std::this_thread::sleep_for(std::chrono::milliseconds(1));
break; break;
} }
@ -1334,7 +1336,7 @@ public:
default: eq->sq.invalidate(tid); SPU.In_MBox.PushUncond(CELL_ECANCELED); return; default: eq->sq.invalidate(tid); SPU.In_MBox.PushUncond(CELL_ECANCELED); return;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
if (Emu.IsStopped()) if (Emu.IsStopped())
{ {
LOG_WARNING(Log::SPU, "sys_spu_thread_receive_event(spuq=0x%x) aborted", spuq); LOG_WARNING(Log::SPU, "sys_spu_thread_receive_event(spuq=0x%x) aborted", spuq);

View File

@ -4,6 +4,7 @@
#include "VFS.h" #include "VFS.h"
#include "Emu/HDD/HDD.h" #include "Emu/HDD/HDD.h"
#include "vfsDeviceLocalFile.h" #include "vfsDeviceLocalFile.h"
#include "Ini.h"
int sort_devices(const void* _a, const void* _b) int sort_devices(const void* _a, const void* _b)
{ {

View File

@ -1,6 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "vfsDir.h" #include "vfsDir.h"

View File

@ -1,6 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "vfsFile.h" #include "vfsFile.h"

View File

@ -40,7 +40,7 @@ bool vfsLocalDir::Open(const std::string& path)
bool vfsLocalDir::Create(const std::string& path) bool vfsLocalDir::Create(const std::string& path)
{ {
return rFileName::Mkdir(path, 0777, rPATH_MKDIR_FULL); return rMkpath(path);
} }
bool vfsLocalDir::Rename(const std::string& from, const std::string& to) bool vfsLocalDir::Rename(const std::string& from, const std::string& to)

View File

@ -1330,8 +1330,10 @@ static const std::string GetMethodName(const u32 id)
{ NV4097_SET_TRANSFORM_BRANCH_BITS, "SetTransformBranchBits" } , { NV4097_SET_TRANSFORM_BRANCH_BITS, "SetTransformBranchBits" } ,
}; };
for(auto& s: METHOD_NAME_LIST) for(auto& s: METHOD_NAME_LIST) {
if(s.id == id) return "cellGcm" + s.name; if(s.id == id)
return "cellGcm" + s.name;
}
return fmt::Format("unknown/illegal method [0x%08x]", id); return fmt::Format("unknown/illegal method [0x%08x]", id);
} }

View File

@ -51,8 +51,7 @@ void GLProgram::Create(const u32 vp, const u32 fp)
if (bufLength) if (bufLength)
{ {
char* buf = new char[bufLength+1]; char* buf = new char[bufLength+1]();
memset(buf, 0, bufLength+1);
glGetProgramInfoLog(id, bufLength, NULL, buf); glGetProgramInfoLog(id, bufLength, NULL, buf);
LOG_ERROR(RSX, "Could not link program: %s", buf); LOG_ERROR(RSX, "Could not link program: %s", buf);
delete[] buf; delete[] buf;
@ -70,8 +69,7 @@ void GLProgram::Create(const u32 vp, const u32 fp)
if (bufLength) if (bufLength)
{ {
char* buf = new char[bufLength]; char* buf = new char[bufLength]();
memset(buf, 0, bufLength);
glGetProgramInfoLog(id, bufLength, NULL, buf); glGetProgramInfoLog(id, bufLength, NULL, buf);
LOG_ERROR(RSX, "Could not link program: %s", buf); LOG_ERROR(RSX, "Could not link program: %s", buf);
delete[] buf; delete[] buf;

View File

@ -2409,7 +2409,7 @@ void RSXThread::Task()
continue; continue;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
is_vblank_stopped = true; is_vblank_stopped = true;
@ -2446,7 +2446,7 @@ void RSXThread::Task()
m_sem_flush.post_and_wait(); m_sem_flush.post_and_wait();
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
} }
@ -2510,7 +2510,7 @@ void RSXThread::Task()
while (!is_vblank_stopped) while (!is_vblank_stopped)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
LOG_NOTICE(RSX, "RSX thread ended"); LOG_NOTICE(RSX, "RSX thread ended");

View File

@ -1,4 +1,4 @@
#pragma once
//DynamicMemoryBlockBase //DynamicMemoryBlockBase
template<typename PT> template<typename PT>
DynamicMemoryBlockBase<PT>::DynamicMemoryBlockBase() DynamicMemoryBlockBase<PT>::DynamicMemoryBlockBase()

View File

@ -3,6 +3,8 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Memory.h" #include "Memory.h"
#include "Emu/System.h"
#include "Ini.h"
MemoryBase Memory; MemoryBase Memory;
@ -92,6 +94,7 @@ void MemoryBlock::Free()
void MemoryBlock::Delete() void MemoryBlock::Delete()
{ {
Free(); Free();
safe_free(mem);
Init(); Init();
} }

View File

@ -5,6 +5,7 @@
#endif #endif
#include "MemoryBlock.h" #include "MemoryBlock.h"
#include "Emu/SysCalls/Callback.h"
#include <vector> #include <vector>
using std::nullptr_t; using std::nullptr_t;

View File

@ -69,7 +69,7 @@ again:
LOG_WARNING(HLE, "Callback::Branch() aborted"); LOG_WARNING(HLE, "Callback::Branch() aborted");
return 0; return 0;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
std::lock_guard<std::mutex> lock(cb_mutex); std::lock_guard<std::mutex> lock(cb_mutex);
@ -112,7 +112,7 @@ again:
LOG_WARNING(HLE, "Callback::Branch(true) aborted (end)"); LOG_WARNING(HLE, "Callback::Branch(true) aborted (end)");
return 0; return 0;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
return thr.GetExitStatus(); return thr.GetExitStatus();

View File

@ -1,13 +1,9 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Crypto/sha1.h" #include "Crypto/sha1.h"
#include <mutex> #include <mutex>
#include "Emu/System.h"
#include "ModuleManager.h" #include "ModuleManager.h"
u32 getFunctionId(const std::string& name) u32 getFunctionId(const std::string& name)

View File

@ -1,8 +1,6 @@
#pragma once #pragma once
#include "Emu/Memory/Memory.h" #include "Emu/SysCalls/SC_FUNC.h"
#define declCPU PPUThread& CPU = GetCurrentPPUThread
//TODO //TODO
struct ModuleFunc struct ModuleFunc

View File

@ -2,11 +2,8 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/Io/Keyboard.h" #include "Emu/Io/Keyboard.h"
#include "Emu/SysCalls/SysCalls.h"
extern Module *sys_io; extern Module *sys_io;

View File

@ -2,11 +2,8 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/Io/Mouse.h" #include "Emu/Io/Mouse.h"
#include "Emu/SysCalls/SysCalls.h"
extern Module *sys_io; extern Module *sys_io;

View File

@ -2,11 +2,8 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/Io/Pad.h" #include "Emu/Io/Pad.h"
#include "Emu/SysCalls/SysCalls.h"
extern Module *sys_io; extern Module *sys_io;

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "cellPamf.h" #include "cellPamf.h"
@ -39,7 +37,7 @@ next:
LOG_WARNING(HLE, "adecRawRead(): aborted"); LOG_WARNING(HLE, "adecRawRead(): aborted");
return 0; return 0;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
switch (adec.job.Peek().type) switch (adec.job.Peek().type)
@ -212,13 +210,13 @@ u32 adecOpen(AudioDecoder* data)
if (!adec.job.GetCountUnsafe() && adec.is_running) if (!adec.job.GetCountUnsafe() && adec.is_running)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
} }
/*if (adec.frames.GetCount() >= 50) /*if (adec.frames.GetCount() >= 50)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
}*/ }*/
@ -283,8 +281,7 @@ u32 adecOpen(AudioDecoder* data)
if (size) if (size)
{ {
data = (u8*)av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); data = (u8*)av_calloc(1, size + FF_INPUT_BUFFER_PADDING_SIZE);
memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
this->size = size + FF_INPUT_BUFFER_PADDING_SIZE; this->size = size + FF_INPUT_BUFFER_PADDING_SIZE;
} }
else else
@ -618,7 +615,7 @@ int cellAdecClose(u32 handle)
LOG_WARNING(HLE, "cellAdecClose(%d) aborted", handle); LOG_WARNING(HLE, "cellAdecClose(%d) aborted", handle);
break; break;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
if (adec->adecCb) Emu.GetCPU().RemoveThread(adec->adecCb->GetId()); if (adec->adecCb) Emu.GetCPU().RemoveThread(adec->adecCb->GetId());
@ -728,7 +725,7 @@ int cellAdecGetPcm(u32 handle, u32 outBuffer_addr)
} }
// copy data // copy data
u8* out = (u8*)malloc(af.size); u8* out = (u8*)calloc(1, af.size);
// reverse byte order, extract data: // reverse byte order, extract data:
float* in_f[2]; float* in_f[2];
@ -774,7 +771,7 @@ int cellAdecGetPcmItem(u32 handle, mem32_t pcmItem_ptr)
if (adec->frames.IsEmpty()) if (adec->frames.IsEmpty())
{ {
Sleep(1); // hack std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
return CELL_ADEC_ERROR_EMPTY; return CELL_ADEC_ERROR_EMPTY;
} }

View File

@ -1,9 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Utilities/SQueue.h" #include "Utilities/SQueue.h"
@ -157,7 +155,7 @@ int cellAudioInit()
// precise time of sleeping: 5,(3) ms (or 256/48000 sec) // precise time of sleeping: 5,(3) ms (or 256/48000 sec)
if (m_config.counter * 256000000 / 48000 >= stamp0 - m_config.start_time) if (m_config.counter * 256000000 / 48000 >= stamp0 - m_config.start_time)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
} }
@ -469,7 +467,7 @@ abort:
while (!internal_finished) while (!internal_finished)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
m_config.m_is_audio_finalized = true; m_config.m_is_audio_finalized = true;
@ -483,7 +481,7 @@ abort:
LOG_WARNING(HLE, "cellAudioInit() aborted"); LOG_WARNING(HLE, "cellAudioInit() aborted");
return CELL_OK; return CELL_OK;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
return CELL_OK; return CELL_OK;
@ -502,7 +500,7 @@ int cellAudioQuit()
while (!m_config.m_is_audio_finalized) while (!m_config.m_is_audio_finalized)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
if (Emu.IsStopped()) if (Emu.IsStopped())
{ {
LOG_WARNING(HLE, "cellAudioQuit(): aborted"); LOG_WARNING(HLE, "cellAudioQuit(): aborted");

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -3,10 +3,8 @@
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h" #include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "cellPamf.h" #include "cellPamf.h"
#include "cellDmux.h" #include "cellDmux.h"
@ -148,14 +146,14 @@ u32 dmuxOpen(Demuxer* data)
if (es.isfull()) if (es.isfull())
{ {
stream = backup; stream = backup;
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
} }
/*if (es.hasunseen()) // hack, probably useless /*if (es.hasunseen()) // hack, probably useless
{ {
stream = backup; stream = backup;
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
}*/ }*/
@ -194,7 +192,7 @@ u32 dmuxOpen(Demuxer* data)
ElementaryStream& es = *esAVC[ch]; ElementaryStream& es = *esAVC[ch];
if (es.isfull()) if (es.isfull())
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
} }
@ -214,7 +212,7 @@ u32 dmuxOpen(Demuxer* data)
/*if (es.hasunseen()) // hack, probably useless /*if (es.hasunseen()) // hack, probably useless
{ {
stream = backup; stream = backup;
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
}*/ }*/
es.finish(stream); es.finish(stream);
@ -237,7 +235,7 @@ u32 dmuxOpen(Demuxer* data)
if (es.isfull()) if (es.isfull())
{ {
stream = backup; stream = backup;
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue; continue;
} }
@ -598,7 +596,7 @@ int cellDmuxClose(u32 demuxerHandle)
return CELL_OK; return CELL_OK;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
if (dmux->dmuxCb) Emu.GetCPU().RemoveThread(dmux->dmuxCb->GetId()); if (dmux->dmuxCb) Emu.GetCPU().RemoveThread(dmux->dmuxCb->GetId());
@ -629,7 +627,7 @@ int cellDmuxSetStream(u32 demuxerHandle, const u32 streamAddress, u32 streamSize
LOG_WARNING(HLE, "cellDmuxSetStream(%d) aborted (waiting)", demuxerHandle); LOG_WARNING(HLE, "cellDmuxSetStream(%d) aborted (waiting)", demuxerHandle);
return CELL_OK; return CELL_OK;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
return CELL_DMUX_ERROR_BUSY; return CELL_DMUX_ERROR_BUSY;
} }

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -3,7 +3,6 @@
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h" #include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/FS/vfsFile.h" #include "Emu/FS/vfsFile.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "cellFont.h" #include "cellFont.h"

View File

@ -2,7 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
@ -456,7 +455,7 @@ int cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, u32 dirName_addr)
std::string errorMsg = fmt::Format("%s\nSpace needed: %d KB\nDirectory name: %s", std::string errorMsg = fmt::Format("%s\nSpace needed: %d KB\nDirectory name: %s",
errorName.c_str(), errNeedSizeKB, dirName); errorName.c_str(), errNeedSizeKB, dirName);
rMessageBox(errorMsg, rGetApp().GetAppName(), rICON_ERROR | rOK); rMessageBox(errorMsg, "Error", rICON_ERROR | rOK);
return CELL_OK; return CELL_OK;
} }

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/GS/GCM.h" #include "Emu/GS/GCM.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "cellGifDec.h" #include "cellGifDec.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "cellJpgDec.h" #include "cellJpgDec.h"
#include "stblib/stb_image.h" #include "stblib/stb_image.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
// Requires GCC 4.10 apparently.. // Requires GCC 4.10 apparently..

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "rpcs3.h" #include "rpcs3.h"
@ -185,7 +183,7 @@ int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<Ce
while (!m_signal) while (!m_signal)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
while (g_msg_dialog_state == msgDialogOpen || get_system_time() < m_wait_until) while (g_msg_dialog_state == msgDialogOpen || get_system_time() < m_wait_until)
@ -195,7 +193,7 @@ int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<Ce
g_msg_dialog_state = msgDialogAbort; g_msg_dialog_state = msgDialogAbort;
break; break;
} }
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
if (callback && (g_msg_dialog_state != msgDialogAbort)) if (callback && (g_msg_dialog_state != msgDialogAbort))
@ -287,14 +285,12 @@ int cellMsgDialogOpenErrorCode(u32 errorCode, mem_func_ptr_t<CellMsgDialogCallba
default: errorMessage = "An error has occurred."; break; default: errorMessage = "An error has occurred."; break;
} }
char errorCodeHex[9]; char errorCodeHex[12];
sprintf(errorCodeHex, "%08x", errorCode); sprintf(errorCodeHex, "\n(%08x)", errorCode);
errorMessage.append("\n(");
errorMessage.append(errorCodeHex); errorMessage.append(errorCodeHex);
errorMessage.append(")\n");
u64 status; u64 status;
int res = rMessageBox(errorMessage, rGetApp().GetAppName(), rICON_ERROR | rOK); int res = rMessageBox(errorMessage, "Error", rICON_ERROR | rOK);
switch (res) switch (res)
{ {
case rOK: status = CELL_MSGDIALOG_BUTTON_OK; break; case rOK: status = CELL_MSGDIALOG_BUTTON_OK; break;

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
//void cellNetCtl_init(); //void cellNetCtl_init();

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "cellPamf.h" #include "cellPamf.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "cellPngDec.h" #include "cellPngDec.h"
#include "stblib/stb_image.h" #include "stblib/stb_image.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "cellSysutil.h" #include "cellSysutil.h"
#include "cellResc.h" #include "cellResc.h"

View File

@ -1,9 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "cellRtc.h" #include "cellRtc.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "cellSpurs.h" #include "cellSpurs.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
//void cellSync_init(); //void cellSync_init();
@ -90,7 +88,7 @@ int cellSyncMutexLock(mem_ptr_t<CellSyncMutex> mutex)
while (old_order != mutex->m_freed) while (old_order != mutex->m_freed)
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
if (Emu.IsStopped()) if (Emu.IsStopped())
{ {
LOG_WARNING(HLE, "cellSyncMutexLock(mutex=0x%x) aborted", mutex.GetAddr()); LOG_WARNING(HLE, "cellSyncMutexLock(mutex=0x%x) aborted", mutex.GetAddr());

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/ModuleManager.h" #include "Emu/SysCalls/ModuleManager.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"

View File

@ -2,9 +2,8 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/DbgCommand.h"
#include "Emu/FS/vfsFile.h" #include "Emu/FS/vfsFile.h"
#include "Emu/Audio/sysutil_audio.h" #include "Emu/Audio/sysutil_audio.h"
@ -345,7 +344,7 @@ int cellSysutilCheckCallback()
while (thr.IsAlive()) while (thr.IsAlive())
{ {
Sleep(1); std::this_thread::sleep_for(std::chrono::milliseconds(1));
if (Emu.IsStopped()) if (Emu.IsStopped())
{ {
LOG_WARNING(HLE, "cellSysutilCheckCallback() aborted"); LOG_WARNING(HLE, "cellSysutilCheckCallback() aborted");

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
//void cellSysutilAp_init(); //void cellSysutilAp_init();

View File

@ -2,8 +2,6 @@
#include "Utilities/Log.h" #include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/FS/vfsFile.h" #include "Emu/FS/vfsFile.h"
#include "Emu/FS/vfsDir.h" #include "Emu/FS/vfsDir.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#if 0 #if 0
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/SC_FUNC.h"

Some files were not shown because too many files have changed in this diff Show More