mirror of https://github.com/RPCS3/rpcs3.git
Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
This commit is contained in:
commit
4b72ecda0d
|
@ -30,6 +30,8 @@
|
||||||
*.dump
|
*.dump
|
||||||
*.wav
|
*.wav
|
||||||
|
|
||||||
|
/build
|
||||||
|
|
||||||
/libs
|
/libs
|
||||||
/ipch
|
/ipch
|
||||||
/rpcs3/Debug
|
/rpcs3/Debug
|
||||||
|
|
|
@ -0,0 +1,130 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "AutoPause.h"
|
||||||
|
|
||||||
|
using namespace Debug;
|
||||||
|
|
||||||
|
//Even different from those tutorials on webpages, i use the method similiar from Log.h
|
||||||
|
//TODO:: Question: Does such a Singleton struct get fully deallocated after its pointer?
|
||||||
|
AutoPause* gAutoPause = nullptr;
|
||||||
|
|
||||||
|
AutoPause& AutoPause::getInstance(void)
|
||||||
|
{
|
||||||
|
if (!gAutoPause)
|
||||||
|
{
|
||||||
|
gAutoPause = new AutoPause();
|
||||||
|
}
|
||||||
|
return *gAutoPause;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Still use binary format. Default Setting should be "disable all auto-pause".
|
||||||
|
AutoPause::AutoPause(void)
|
||||||
|
{
|
||||||
|
m_pause_function.reserve(16);
|
||||||
|
m_pause_syscall.reserve(16);
|
||||||
|
initialized = false;
|
||||||
|
//Reload(false, false);
|
||||||
|
Reload(true, true); //Temporarily use auto enable
|
||||||
|
}
|
||||||
|
|
||||||
|
//Notice: I would not allow to write the binary to file in this command.
|
||||||
|
AutoPause::~AutoPause(void)
|
||||||
|
{
|
||||||
|
initialized = false;
|
||||||
|
m_pause_function.clear();
|
||||||
|
m_pause_syscall.clear();
|
||||||
|
m_pause_function_enable = false;
|
||||||
|
m_pause_syscall_enable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Load Auto-Pause Configuration from file "pause.bin"
|
||||||
|
//This would be able to create in a GUI window.
|
||||||
|
void AutoPause::Reload(void)
|
||||||
|
{
|
||||||
|
if (rExists("pause.bin"))
|
||||||
|
{
|
||||||
|
m_pause_function.clear();
|
||||||
|
m_pause_function.reserve(16);
|
||||||
|
m_pause_syscall.clear();
|
||||||
|
m_pause_syscall.reserve(16);
|
||||||
|
|
||||||
|
rFile list;
|
||||||
|
list.Open("pause.bin", rFile::read);
|
||||||
|
//System calls ID and Function calls ID are all u32 iirc.
|
||||||
|
u32 num;
|
||||||
|
size_t fmax = list.Length();
|
||||||
|
size_t fcur = 0;
|
||||||
|
list.Seek(0);
|
||||||
|
while (fcur <= fmax - sizeof(u32))
|
||||||
|
{
|
||||||
|
list.Read(&num, sizeof(u32));
|
||||||
|
fcur += sizeof(u32);
|
||||||
|
if (num == 0xFFFFFFFF) break;
|
||||||
|
|
||||||
|
if (num < 1024)
|
||||||
|
{
|
||||||
|
//Less than 1024 - be regarded as a system call.
|
||||||
|
//emplace_back may not cause reductant move/copy operation.
|
||||||
|
m_pause_syscall.emplace_back(num);
|
||||||
|
LOG_WARNING(HLE, "Auto-Pause: Find System Call ID %x", num);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_pause_function.emplace_back(num);
|
||||||
|
LOG_WARNING(HLE, "Auto-Pause: Find Function Call ID %x", num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_WARNING(HLE, "No Pause ID specified in pause.bin, Auto-Pause would not act.");
|
||||||
|
}
|
||||||
|
|
||||||
|
initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AutoPause::Reload(bool enable_pause_syscall, bool enable_pause_function)
|
||||||
|
{
|
||||||
|
Reload();
|
||||||
|
m_pause_syscall_enable = enable_pause_syscall;
|
||||||
|
m_pause_function_enable = enable_pause_function;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AutoPause::TryPause(u32 code) {
|
||||||
|
if (code < 1024)
|
||||||
|
{
|
||||||
|
//Would first check Enable setting. Then the list length.
|
||||||
|
if ((!m_pause_syscall_enable)
|
||||||
|
|| (m_pause_syscall.size() <= 0))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (u32 i = 0; i < m_pause_syscall.size(); ++i)
|
||||||
|
{
|
||||||
|
if (code == m_pause_syscall[i])
|
||||||
|
{
|
||||||
|
Emu.Pause();
|
||||||
|
LOG_ERROR(HLE, "Auto-Pause Triggered: System call %x", code); //Used Error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Well similiar.. Seperate the list caused by possible setting difference.
|
||||||
|
if ((!m_pause_function_enable)
|
||||||
|
|| (m_pause_function.size() <= 0))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (u32 i = 0; i < m_pause_function.size(); ++i)
|
||||||
|
{
|
||||||
|
if (code == m_pause_function[i])
|
||||||
|
{
|
||||||
|
Emu.Pause();
|
||||||
|
LOG_ERROR(HLE, "Auto-Pause Triggered: Function call %x", code); //Used Error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
#pragma once
|
||||||
|
#include "Utilities/Log.h"
|
||||||
|
#include "Utilities/rFile.h"
|
||||||
|
#include "Emu/System.h"
|
||||||
|
|
||||||
|
//Regarded as a Debugger Enchantment
|
||||||
|
namespace Debug {
|
||||||
|
//To store the pause function/call id, and let those pause there.
|
||||||
|
//Would be with a GUI to configure those.
|
||||||
|
struct AutoPause
|
||||||
|
{
|
||||||
|
std::vector<u32> m_pause_syscall;
|
||||||
|
std::vector<u32> m_pause_function;
|
||||||
|
bool initialized;
|
||||||
|
bool m_pause_syscall_enable;
|
||||||
|
bool m_pause_function_enable;
|
||||||
|
|
||||||
|
AutoPause();
|
||||||
|
~AutoPause();
|
||||||
|
public:
|
||||||
|
static AutoPause& getInstance(void);
|
||||||
|
|
||||||
|
void Reload(bool enable_pause_syscall, bool enable_pause_function);
|
||||||
|
|
||||||
|
void Reload(void);
|
||||||
|
|
||||||
|
void TryPause(u32 code);
|
||||||
|
};
|
||||||
|
}
|
|
@ -263,7 +263,6 @@ void ModuleManager::init()
|
||||||
m_mod_init.emplace_back(0x000e, sys_fs_init);
|
m_mod_init.emplace_back(0x000e, sys_fs_init);
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
LoadFuncPauses(); //Load the list of pause functions
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleManager::ModuleManager() :
|
ModuleManager::ModuleManager() :
|
||||||
|
@ -294,17 +293,6 @@ bool ModuleManager::IsLoadedFunc(u32 id)
|
||||||
|
|
||||||
bool ModuleManager::CallFunc(u32 num)
|
bool ModuleManager::CallFunc(u32 num)
|
||||||
{
|
{
|
||||||
//Pause at specified function calls
|
|
||||||
for (u32 i = 0; i < m_funcs_pause_funcs.size(); ++i)
|
|
||||||
{
|
|
||||||
//Add Call Pause Here. This call is from BLJS10157
|
|
||||||
if (num == m_funcs_pause_funcs[i])
|
|
||||||
{
|
|
||||||
Emu.Pause(); //So it is now pause, yep.
|
|
||||||
LOG_ERROR(HLE, "AUTO PAUSE AT %x", num); //Used Error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func_caller* func = nullptr;
|
func_caller* func = nullptr;
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(m_funcs_lock);
|
std::lock_guard<std::mutex> lock(m_funcs_lock);
|
||||||
|
@ -375,9 +363,6 @@ void ModuleManager::UnloadModules()
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(m_funcs_lock);
|
std::lock_guard<std::mutex> lock(m_funcs_lock);
|
||||||
m_modules_funcs_list.clear();
|
m_modules_funcs_list.clear();
|
||||||
|
|
||||||
//unload pause list
|
|
||||||
m_funcs_pause_funcs.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Module* ModuleManager::GetModuleByName(const std::string& name)
|
Module* ModuleManager::GetModuleByName(const std::string& name)
|
||||||
|
@ -477,36 +462,4 @@ void ModuleManager::AddFunc(ModuleFunc *func)
|
||||||
{
|
{
|
||||||
m_modules_funcs_list.push_back(func);
|
m_modules_funcs_list.push_back(func);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//read pause.bin to get some function id that should auto-pause at call.
|
|
||||||
//you can make this file with Hex Editors, such as MadEdit..
|
|
||||||
//you can find the function ids in \rpcs3\rpcs3\Emu\SysCalls\FuncList.cpp
|
|
||||||
//or just by searching the function name with grep within repo.
|
|
||||||
//Example if i want it to pause at 0x1051d134, i create the file with 34D15110(Hex, start from 00).
|
|
||||||
void ModuleManager::LoadFuncPauses(void)
|
|
||||||
{
|
|
||||||
if (rExists("pause.bin"))
|
|
||||||
{
|
|
||||||
m_funcs_pause_funcs.reserve(16);
|
|
||||||
rFile list;
|
|
||||||
list.Open("pause.bin", rFile::read);
|
|
||||||
u32 num;
|
|
||||||
size_t fmax = list.Length();
|
|
||||||
size_t fcur = 0;
|
|
||||||
list.Seek(0);
|
|
||||||
while (fcur <= fmax - sizeof(u32))
|
|
||||||
{
|
|
||||||
list.Read(&num, sizeof(u32));
|
|
||||||
fcur += sizeof(u32);
|
|
||||||
if (num == 0xFFFFFFFF) break;
|
|
||||||
m_funcs_pause_funcs.push_back(num);
|
|
||||||
LOG_WARNING(HLE, "Read Pause Function ID: %x", num);
|
|
||||||
}
|
|
||||||
list.Close();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG_WARNING(HLE, "No Pause Function ID specified in pause.bin");
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -10,7 +10,6 @@ class ModuleManager
|
||||||
std::vector<ModuleFunc *> m_modules_funcs_list;
|
std::vector<ModuleFunc *> m_modules_funcs_list;
|
||||||
std::vector<Module> m_mod_init;
|
std::vector<Module> m_mod_init;
|
||||||
bool initialized;
|
bool initialized;
|
||||||
std::vector<u32> m_funcs_pause_funcs;
|
|
||||||
public:
|
public:
|
||||||
ModuleManager();
|
ModuleManager();
|
||||||
~ModuleManager();
|
~ModuleManager();
|
||||||
|
@ -25,5 +24,4 @@ public:
|
||||||
u32 GetFuncNumById(u32 id);
|
u32 GetFuncNumById(u32 id);
|
||||||
Module* GetModuleByName(const std::string& name);
|
Module* GetModuleByName(const std::string& name);
|
||||||
Module* GetModuleById(u16 id);
|
Module* GetModuleById(u16 id);
|
||||||
void LoadFuncPauses(void);
|
|
||||||
};
|
};
|
|
@ -23,12 +23,15 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
||||||
cellGame->Warning("cellGameBootCheck(type_addr=0x%x, attributes_addr=0x%x, size_addr=0x%x, dirName_addr=0x%x)",
|
cellGame->Warning("cellGameBootCheck(type_addr=0x%x, attributes_addr=0x%x, size_addr=0x%x, dirName_addr=0x%x)",
|
||||||
type.GetAddr(), attributes.GetAddr(), size.GetAddr(), dirName.GetAddr());
|
type.GetAddr(), attributes.GetAddr(), size.GetAddr(), dirName.GetAddr());
|
||||||
|
|
||||||
// TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
if (size)
|
||||||
size->hddFreeSizeKB = 40000000; // 40 GB
|
{
|
||||||
|
// TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
||||||
|
size->hddFreeSizeKB = 40000000; // 40 GB
|
||||||
|
|
||||||
// TODO: Calculate data size for HG and DG games, if necessary.
|
// TODO: Calculate data size for HG and DG games, if necessary.
|
||||||
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
|
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
|
||||||
size->sysSizeKB = 0;
|
size->sysSizeKB = 0;
|
||||||
|
}
|
||||||
|
|
||||||
vfsFile f("/app_home/PARAM.SFO");
|
vfsFile f("/app_home/PARAM.SFO");
|
||||||
if (!f.IsOpened())
|
if (!f.IsOpened())
|
||||||
|
@ -90,12 +93,15 @@ int cellGamePatchCheck(mem_ptr_t<CellGameContentSize> size, u32 reserved_addr)
|
||||||
return CELL_GAME_ERROR_PARAM;
|
return CELL_GAME_ERROR_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
if (size)
|
||||||
size->hddFreeSizeKB = 40000000; // 40 GB
|
{
|
||||||
|
// TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
||||||
|
size->hddFreeSizeKB = 40000000; // 40 GB
|
||||||
|
|
||||||
// TODO: Calculate data size for patch data, if necessary.
|
// TODO: Calculate data size for patch data, if necessary.
|
||||||
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
|
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
|
||||||
size->sysSizeKB = 0;
|
size->sysSizeKB = 0;
|
||||||
|
}
|
||||||
|
|
||||||
vfsFile f("/app_home/PARAM.SFO");
|
vfsFile f("/app_home/PARAM.SFO");
|
||||||
if (!f.IsOpened())
|
if (!f.IsOpened())
|
||||||
|
@ -135,12 +141,15 @@ int cellGameDataCheck(u32 type, const mem_list_ptr_t<u8> dirName, mem_ptr_t<Cell
|
||||||
return CELL_GAME_ERROR_PARAM;
|
return CELL_GAME_ERROR_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
if (size)
|
||||||
size->hddFreeSizeKB = 40000000; //40 GB
|
{
|
||||||
|
// TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
||||||
|
size->hddFreeSizeKB = 40000000; //40 GB
|
||||||
|
|
||||||
// TODO: Calculate data size for game data, if necessary.
|
// TODO: Calculate data size for game data, if necessary.
|
||||||
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
|
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
|
||||||
size->sysSizeKB = 0;
|
size->sysSizeKB = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (type == CELL_GAME_GAMETYPE_DISC)
|
if (type == CELL_GAME_GAMETYPE_DISC)
|
||||||
{
|
{
|
||||||
|
@ -418,23 +427,37 @@ int cellGameGetLocalWebContentPath()
|
||||||
int cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, u32 dirName_addr)
|
int cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, u32 dirName_addr)
|
||||||
{
|
{
|
||||||
cellGame->Warning("cellGameContentErrorDialog(type=%d, errNeedSizeKB=%d, dirName_addr=0x%x)", type, errNeedSizeKB, dirName_addr);
|
cellGame->Warning("cellGameContentErrorDialog(type=%d, errNeedSizeKB=%d, dirName_addr=0x%x)", type, errNeedSizeKB, dirName_addr);
|
||||||
|
|
||||||
char* dirName = (char*)Memory.VirtualToRealAddr(dirName_addr);
|
|
||||||
std::string errorName;
|
std::string errorName;
|
||||||
switch(type)
|
std::string errorMsg;
|
||||||
|
char* dirName;
|
||||||
|
|
||||||
|
if (type == CELL_GAME_ERRDIALOG_NOSPACE || type == CELL_GAME_ERRDIALOG_NOSPACE_EXIT)
|
||||||
{
|
{
|
||||||
case CELL_GAME_ERRDIALOG_BROKEN_GAMEDATA: errorName = "Game data is corrupted (can be continued)."; break;
|
dirName = (char*)Memory.VirtualToRealAddr(dirName_addr);
|
||||||
case CELL_GAME_ERRDIALOG_BROKEN_HDDGAME: errorName = "HDD boot game is corrupted (can be continued)."; break;
|
}
|
||||||
case CELL_GAME_ERRDIALOG_NOSPACE: errorName = "Not enough available space (can be continued)."; break;
|
|
||||||
case CELL_GAME_ERRDIALOG_BROKEN_EXIT_GAMEDATA: errorName = "Game data is corrupted (terminate application)."; break;
|
switch (type)
|
||||||
case CELL_GAME_ERRDIALOG_BROKEN_EXIT_HDDGAME: errorName = "HDD boot game is corrupted (terminate application)."; break;
|
{
|
||||||
case CELL_GAME_ERRDIALOG_NOSPACE_EXIT: errorName = "Not enough available space (terminate application)."; break;
|
case CELL_GAME_ERRDIALOG_BROKEN_GAMEDATA: errorName = "Game data is corrupted (can be continued)."; break;
|
||||||
default: return CELL_GAME_ERROR_PARAM;
|
case CELL_GAME_ERRDIALOG_BROKEN_HDDGAME: errorName = "HDD boot game is corrupted (can be continued)."; break;
|
||||||
|
case CELL_GAME_ERRDIALOG_NOSPACE: errorName = "Not enough available space (can be continued)."; break;
|
||||||
|
case CELL_GAME_ERRDIALOG_BROKEN_EXIT_GAMEDATA: errorName = "Game data is corrupted (terminate application)."; break;
|
||||||
|
case CELL_GAME_ERRDIALOG_BROKEN_EXIT_HDDGAME: errorName = "HDD boot game is corrupted (terminate application)."; break;
|
||||||
|
case CELL_GAME_ERRDIALOG_NOSPACE_EXIT: errorName = "Not enough available space (terminate application)."; break;
|
||||||
|
default: return CELL_GAME_ERROR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == CELL_GAME_ERRDIALOG_NOSPACE || type == CELL_GAME_ERRDIALOG_NOSPACE_EXIT)
|
||||||
|
{
|
||||||
|
errorMsg = fmt::Format("ERROR: %s\nSpace needed: %d KB\nDirectory name: %s", errorName.c_str(), errNeedSizeKB, dirName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errorMsg = fmt::Format("ERROR: %s", errorName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string errorMsg = fmt::Format("%s\nSpace needed: %d KB\nDirectory name: %s",
|
|
||||||
errorName.c_str(), errNeedSizeKB, dirName);
|
|
||||||
rMessageBox(errorMsg, "Error", rICON_ERROR | rOK);
|
rMessageBox(errorMsg, "Error", rICON_ERROR | rOK);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -440,7 +440,7 @@ s32 cellGcmSetPrepareFlip(mem_ptr_t<CellGcmContextData> ctxt, u32 id)
|
||||||
{
|
{
|
||||||
cellGcmSys->Log("cellGcmSetPrepareFlip(ctx=0x%x, id=0x%x)", ctxt.GetAddr(), id);
|
cellGcmSys->Log("cellGcmSetPrepareFlip(ctx=0x%x, id=0x%x)", ctxt.GetAddr(), id);
|
||||||
|
|
||||||
if(id >= 8)
|
if(id > 7)
|
||||||
{
|
{
|
||||||
cellGcmSys->Error("cellGcmSetPrepareFlip : CELL_GCM_ERROR_FAILURE");
|
cellGcmSys->Error("cellGcmSetPrepareFlip : CELL_GCM_ERROR_FAILURE");
|
||||||
return CELL_GCM_ERROR_FAILURE;
|
return CELL_GCM_ERROR_FAILURE;
|
||||||
|
@ -700,9 +700,18 @@ int cellGcmInitSystemMode(u64 mode)
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellGcmSetFlipImmediate()
|
int cellGcmSetFlipImmediate(u8 id)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
cellGcmSys->Todo("cellGcmSetFlipImmediate(fid=0x%x)", id);
|
||||||
|
|
||||||
|
if (id > 7)
|
||||||
|
{
|
||||||
|
cellGcmSys->Error("cellGcmSetFlipImmediate : CELL_GCM_ERROR_FAILURE");
|
||||||
|
return CELL_GCM_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
cellGcmSetFlipMode(id);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,12 +36,16 @@ int sceNpDrmIsAvailable(u32 k_licensee_addr, u32 drm_path_addr)
|
||||||
return CELL_ENOENT;
|
return CELL_ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string k_licensee_str;
|
std::string k_licensee_str = "0";
|
||||||
u8 k_licensee[0x10];
|
u8 k_licensee[0x10];
|
||||||
for(int i = 0; i < 0x10; i++)
|
|
||||||
|
if (k_licensee_addr)
|
||||||
{
|
{
|
||||||
k_licensee[i] = Memory.Read8(k_licensee_addr + i);
|
for (int i = 0; i < 0x10; i++)
|
||||||
k_licensee_str += fmt::Format("%02x", k_licensee[i]);
|
{
|
||||||
|
k_licensee[i] = Memory.Read8(k_licensee_addr + i);
|
||||||
|
k_licensee_str += fmt::Format("%02x", k_licensee[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sceNp->Warning("sceNpDrmIsAvailable: Found DRM license file at %s", drm_path.c_str());
|
sceNp->Warning("sceNpDrmIsAvailable: Found DRM license file at %s", drm_path.c_str());
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "Utilities/Log.h"
|
#include "Utilities/Log.h"
|
||||||
|
#include "Utilities/AutoPause.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/Cell/PPUThread.h"
|
||||||
|
@ -919,6 +920,9 @@ void default_syscall()
|
||||||
|
|
||||||
void SysCalls::DoSyscall(u32 code)
|
void SysCalls::DoSyscall(u32 code)
|
||||||
{
|
{
|
||||||
|
//Auto-Pause using simple singleton.
|
||||||
|
Debug::AutoPause::getInstance().TryPause(code);
|
||||||
|
|
||||||
if(code < 1024)
|
if(code < 1024)
|
||||||
{
|
{
|
||||||
(*sc_table[code])();
|
(*sc_table[code])();
|
||||||
|
|
|
@ -10,26 +10,38 @@ s32 sys_rwlock_create(mem32_t rw_lock_id, mem_ptr_t<sys_rwlock_attribute_t> attr
|
||||||
{
|
{
|
||||||
sys_rwlock.Warning("sys_rwlock_create(rw_lock_id_addr=0x%x, attr_addr=0x%x)", rw_lock_id.GetAddr(), attr.GetAddr());
|
sys_rwlock.Warning("sys_rwlock_create(rw_lock_id_addr=0x%x, attr_addr=0x%x)", rw_lock_id.GetAddr(), attr.GetAddr());
|
||||||
|
|
||||||
switch (attr->attr_protocol.ToBE())
|
if (attr)
|
||||||
{
|
{
|
||||||
case se(attr->attr_protocol, SYS_SYNC_PRIORITY): sys_rwlock.Todo("SYS_SYNC_PRIORITY"); break;
|
switch (attr->attr_protocol.ToBE())
|
||||||
case se(attr->attr_protocol, SYS_SYNC_RETRY): sys_rwlock.Error("SYS_SYNC_RETRY"); return CELL_EINVAL;
|
{
|
||||||
case se(attr->attr_protocol, SYS_SYNC_PRIORITY_INHERIT): sys_rwlock.Todo("SYS_SYNC_PRIORITY_INHERIT"); break;
|
case se(attr->attr_protocol, SYS_SYNC_PRIORITY): sys_rwlock.Todo("SYS_SYNC_PRIORITY"); break;
|
||||||
case se(attr->attr_protocol, SYS_SYNC_FIFO): break;
|
case se(attr->attr_protocol, SYS_SYNC_RETRY): sys_rwlock.Error("SYS_SYNC_RETRY"); return CELL_EINVAL;
|
||||||
default: return CELL_EINVAL;
|
case se(attr->attr_protocol, SYS_SYNC_PRIORITY_INHERIT): sys_rwlock.Todo("SYS_SYNC_PRIORITY_INHERIT"); break;
|
||||||
}
|
case se(attr->attr_protocol, SYS_SYNC_FIFO): break;
|
||||||
|
default: return CELL_EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (attr->attr_pshared.ToBE() != se32(0x200))
|
if (attr->attr_pshared.ToBE() != se32(0x200))
|
||||||
|
{
|
||||||
|
sys_rwlock.Error("Invalid attr_pshared(0x%x)", (u32)attr->attr_pshared);
|
||||||
|
return CELL_EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
rw_lock_id = sys_rwlock.GetNewId(new RWLock((u32)attr->attr_protocol, attr->name_u64));
|
||||||
|
|
||||||
|
sys_rwlock.Warning("*** rwlock created [%s] (protocol=0x%x): id = %d",
|
||||||
|
std::string(attr->name, 8).c_str(), (u32)attr->attr_protocol, rw_lock_id.GetValue());
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
sys_rwlock.Error("Invalid attr_pshared(0x%x)", (u32)attr->attr_pshared);
|
sys_rwlock.Todo("SYS_SYNC_PRIORITY");
|
||||||
return CELL_EINVAL;
|
|
||||||
|
rw_lock_id = sys_rwlock.GetNewId(new RWLock((u32)SYS_SYNC_PRIORITY, (u64)"default"));
|
||||||
|
|
||||||
|
sys_rwlock.Warning("*** rwlock created [%s] (protocol=0x%x): id = %d",
|
||||||
|
std::string("default", 8).c_str(), (u32)SYS_SYNC_PRIORITY, rw_lock_id.GetValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
rw_lock_id = sys_rwlock.GetNewId(new RWLock((u32)attr->attr_protocol, attr->name_u64));
|
|
||||||
|
|
||||||
sys_rwlock.Warning("*** rwlock created [%s] (protocol=0x%x): id = %d",
|
|
||||||
std::string(attr->name, 8).c_str(), (u32) attr->attr_protocol, rw_lock_id.GetValue());
|
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "Utilities/AutoPause.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/System.h"
|
||||||
|
@ -204,6 +205,9 @@ void GameViewer::DClick(wxListEvent& event)
|
||||||
const std::string& path = m_path + m_game_data[i].root;
|
const std::string& path = m_path + m_game_data[i].root;
|
||||||
|
|
||||||
Emu.Stop();
|
Emu.Stop();
|
||||||
|
|
||||||
|
Debug::AutoPause::getInstance().Reload();
|
||||||
|
|
||||||
Emu.GetVFS().Init(path);
|
Emu.GetVFS().Init(path);
|
||||||
std::string local_path;
|
std::string local_path;
|
||||||
if (Emu.GetVFS().GetDevice(path, local_path) && !Emu.BootGame(local_path)) {
|
if (Emu.GetVFS().GetDevice(path, local_path) && !Emu.BootGame(local_path)) {
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\Utilities\AutoPause.cpp" />
|
||||||
<ClCompile Include="..\Utilities\Log.cpp" />
|
<ClCompile Include="..\Utilities\Log.cpp" />
|
||||||
<ClCompile Include="..\Utilities\SMutex.cpp" />
|
<ClCompile Include="..\Utilities\SMutex.cpp" />
|
||||||
<ClCompile Include="..\Utilities\SSemaphore.cpp" />
|
<ClCompile Include="..\Utilities\SSemaphore.cpp" />
|
||||||
|
@ -211,6 +212,7 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\Utilities\AutoPause.h" />
|
||||||
<ClInclude Include="..\Utilities\BEType.h" />
|
<ClInclude Include="..\Utilities\BEType.h" />
|
||||||
<ClInclude Include="..\Utilities\IdManager.h" />
|
<ClInclude Include="..\Utilities\IdManager.h" />
|
||||||
<ClInclude Include="..\Utilities\MTRingbuffer.h" />
|
<ClInclude Include="..\Utilities\MTRingbuffer.h" />
|
||||||
|
|
|
@ -590,6 +590,9 @@
|
||||||
<ClCompile Include="Emu\SysCalls\lv2\sys_event_flag.cpp">
|
<ClCompile Include="Emu\SysCalls\lv2\sys_event_flag.cpp">
|
||||||
<Filter>Emu\SysCalls\lv2</Filter>
|
<Filter>Emu\SysCalls\lv2</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Utilities\AutoPause.cpp">
|
||||||
|
<Filter>Utilities</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Crypto\aes.h">
|
<ClInclude Include="Crypto\aes.h">
|
||||||
|
@ -1123,5 +1126,8 @@
|
||||||
<ClInclude Include="Emu\SysCalls\lv2\sys_event_flag.h">
|
<ClInclude Include="Emu\SysCalls\lv2\sys_event_flag.h">
|
||||||
<Filter>Emu\SysCalls\lv2</Filter>
|
<Filter>Emu\SysCalls\lv2</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Utilities\AutoPause.h">
|
||||||
|
<Filter>Utilities</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue