mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-16 16:21:03 +00:00
Merge pull request #954 from Nekotekina/master
PKG installer fix + experimental optimization
This commit is contained in:
commit
5ffc6ffca5
@ -1,10 +1,15 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Log.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Thread.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <signal.h>
|
||||
#include <ucontext.h>
|
||||
#endif
|
||||
|
||||
void SetCurrentThreadDebugName(const char* threadName)
|
||||
@ -35,6 +40,352 @@ void SetCurrentThreadDebugName(const char* threadName)
|
||||
#endif
|
||||
}
|
||||
|
||||
enum x64_reg_t : u32
|
||||
{
|
||||
X64R_EAX,
|
||||
X64R_ECX,
|
||||
X64R_EDX,
|
||||
X64R_EBX,
|
||||
X64R_ESP,
|
||||
X64R_EBP,
|
||||
X64R_ESI,
|
||||
X64R_EDI,
|
||||
X64R_R8D,
|
||||
X64R_R9D,
|
||||
X64R_R10D,
|
||||
X64R_R11D,
|
||||
X64R_R12D,
|
||||
X64R_R13D,
|
||||
X64R_R14D,
|
||||
X64R_R15D,
|
||||
X64R32 = X64R_EAX,
|
||||
|
||||
X64_IMM32,
|
||||
};
|
||||
|
||||
enum x64_op_t : u32
|
||||
{
|
||||
X64OP_LOAD, // obtain and put the value into x64 register (from Memory.ReadMMIO32, for example)
|
||||
X64OP_STORE, // take the value from x64 register or an immediate and use it (pass in Memory.WriteMMIO32, for example)
|
||||
// example: add eax,[rax] -> X64OP_LOAD_ADD (add the value to x64 register)
|
||||
// example: add [rax],eax -> X64OP_LOAD_ADD_STORE (this will probably never happen for MMIO registers)
|
||||
};
|
||||
|
||||
void decode_x64_reg_op(const u8* code, x64_op_t& decoded_op, x64_reg_t& decoded_reg, size_t& decoded_size)
|
||||
{
|
||||
// simple analysis of x64 code allows to reinterpret MOV or other instructions in any desired way
|
||||
decoded_size = 0;
|
||||
|
||||
u8 rex = 0;
|
||||
u8 reg = 0; // set to 8 by REX prefix
|
||||
u8 pg2 = 0;
|
||||
|
||||
// check prefixes:
|
||||
for (;; code++, decoded_size++)
|
||||
{
|
||||
switch (const u8 prefix = *code)
|
||||
{
|
||||
case 0xf0: throw fmt::Format("decode_x64_reg_op(%.16llXh): 0x%.2X (LOCK prefix) found", code - decoded_size, prefix); // group 1
|
||||
case 0xf2: throw fmt::Format("decode_x64_reg_op(%.16llXh): 0x%.2X (REPNE/REPNZ prefix) found", code - decoded_size, prefix); // group 1
|
||||
case 0xf3: throw fmt::Format("decode_x64_reg_op(%.16llXh): 0x%.2X (REP/REPE/REPZ prefix) found", code - decoded_size, prefix); // group 1
|
||||
|
||||
case 0x2e: // group 2
|
||||
case 0x36:
|
||||
case 0x3e:
|
||||
case 0x26:
|
||||
case 0x64:
|
||||
case 0x65:
|
||||
{
|
||||
if (!pg2)
|
||||
{
|
||||
pg2 = prefix; // probably, segment register
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw fmt::Format("decode_x64_reg_op(%.16llXh): 0x%.2X (group 2 prefix) found after 0x%.2X", code - decoded_size, prefix, pg2);
|
||||
}
|
||||
}
|
||||
|
||||
case 0x66: throw fmt::Format("decode_x64_reg_op(%.16llXh): 0x%.2X (operand-size override prefix) found", code - decoded_size, prefix); // group 3
|
||||
case 0x67: throw fmt::Format("decode_x64_reg_op(%.16llXh): 0x%.2X (address-size override prefix) found", code - decoded_size, prefix); // group 4
|
||||
|
||||
default:
|
||||
{
|
||||
if ((prefix & 0xf0) == 0x40) // check REX prefix
|
||||
{
|
||||
if (rex)
|
||||
{
|
||||
throw fmt::Format("decode_x64_reg_op(%.16llXh): 0x%.2X (REX prefix) found after 0x%.2X", code - decoded_size, prefix, rex);
|
||||
}
|
||||
if (prefix & 0x80) // check REX.W bit
|
||||
{
|
||||
throw fmt::Format("decode_x64_reg_op(%.16llXh): 0x%.2X (REX.W bit) found", code - decoded_size, prefix);
|
||||
}
|
||||
if (prefix & 0x04) // check REX.R bit
|
||||
{
|
||||
reg = 8;
|
||||
}
|
||||
rex = prefix;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
auto get_modRM_r32 = [](const u8* code, const u8 reg_base) -> x64_reg_t
|
||||
{
|
||||
return (x64_reg_t)((((*code & 0x38) >> 3) | reg_base) + X64R32);
|
||||
};
|
||||
|
||||
auto get_modRM_size = [](const u8* code) -> size_t
|
||||
{
|
||||
switch (*code >> 6) // check Mod
|
||||
{
|
||||
case 0: return (*code & 0x07) == 4 ? 2 : 1; // check SIB
|
||||
case 1: return (*code & 0x07) == 4 ? 3 : 2; // check SIB (disp8)
|
||||
case 2: return (*code & 0x07) == 4 ? 6 : 5; // check SIB (disp32)
|
||||
default: return 1;
|
||||
}
|
||||
};
|
||||
|
||||
decoded_size++;
|
||||
switch (const u8 op1 = *code++)
|
||||
{
|
||||
case 0x89: // MOV r/m32, r32
|
||||
{
|
||||
decoded_op = X64OP_STORE;
|
||||
decoded_reg = get_modRM_r32(code, reg);
|
||||
decoded_size += get_modRM_size(code);
|
||||
return;
|
||||
}
|
||||
case 0x8b: // MOV r32, r/m32
|
||||
{
|
||||
decoded_op = X64OP_LOAD;
|
||||
decoded_reg = get_modRM_r32(code, reg);
|
||||
decoded_size += get_modRM_size(code);
|
||||
return;
|
||||
}
|
||||
case 0xc7:
|
||||
{
|
||||
if (get_modRM_r32(code, 0) == X64R_EAX) // MOV r/m32, imm32 (not tested)
|
||||
{
|
||||
decoded_op = X64OP_STORE;
|
||||
decoded_reg = X64_IMM32;
|
||||
decoded_size = get_modRM_size(code) + 4;
|
||||
return;
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
throw fmt::Format("decode_x64_reg_op(%.16llX): unsupported opcode found (0x%.2X, 0x%.2X, 0x%.2X)", code - decoded_size, op1, code[0], code[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
void _se_translator(unsigned int u, EXCEPTION_POINTERS* pExp)
|
||||
{
|
||||
const u64 addr64 = (u64)pExp->ExceptionRecord->ExceptionInformation[1] - (u64)Memory.GetBaseAddr();
|
||||
const bool is_writing = pExp->ExceptionRecord->ExceptionInformation[0] != 0;
|
||||
if (u == EXCEPTION_ACCESS_VIOLATION && addr64 < 0x100000000ull)
|
||||
{
|
||||
const u32 addr = (u32)addr64;
|
||||
if (addr >= RAW_SPU_BASE_ADDR && (addr % RAW_SPU_OFFSET) >= RAW_SPU_PROB_OFFSET) // RawSPU MMIO registers
|
||||
{
|
||||
// one x64 instruction is manually decoded and interpreted
|
||||
x64_op_t op;
|
||||
x64_reg_t reg;
|
||||
size_t size;
|
||||
decode_x64_reg_op((const u8*)pExp->ContextRecord->Rip, op, reg, size);
|
||||
|
||||
// get x64 reg value (for store operations)
|
||||
u64 reg_value;
|
||||
if (reg - X64R32 < 16)
|
||||
{
|
||||
// load the value from x64 register
|
||||
reg_value = (u32)(&pExp->ContextRecord->Rax)[reg - X64R32];
|
||||
}
|
||||
else if (reg == X64_IMM32)
|
||||
{
|
||||
// load the immediate value (assuming it's at the end of the instruction)
|
||||
reg_value = *(u32*)(pExp->ContextRecord->Rip + size - 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(!"Invalid x64_reg_t value");
|
||||
}
|
||||
|
||||
bool save_reg = false;
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case X64OP_LOAD:
|
||||
{
|
||||
assert(!is_writing);
|
||||
reg_value = re32(Memory.ReadMMIO32(addr));
|
||||
save_reg = true;
|
||||
break;
|
||||
}
|
||||
case X64OP_STORE:
|
||||
{
|
||||
assert(is_writing);
|
||||
Memory.WriteMMIO32(addr, re32((u32)reg_value));
|
||||
break;
|
||||
}
|
||||
default: assert(!"Invalid x64_op_t value");
|
||||
}
|
||||
|
||||
// save x64 reg value (for load operations)
|
||||
if (save_reg)
|
||||
{
|
||||
if (reg - X64R32 < 16)
|
||||
{
|
||||
// store the value into x64 register
|
||||
(&pExp->ContextRecord->Rax)[reg - X64R32] = (u32)reg_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(!"Invalid x64_reg_t value (saving)");
|
||||
}
|
||||
}
|
||||
|
||||
// skip decoded instruction
|
||||
pExp->ContextRecord->Rip += size;
|
||||
// restore context (further code shouldn't be reached)
|
||||
RtlRestoreContext(pExp->ContextRecord, nullptr);
|
||||
|
||||
// it's dangerous because destructors won't be executed
|
||||
}
|
||||
// TODO: allow recovering from a page fault as a feature of PS3 virtual memory
|
||||
if (CPUThread* t = GetCurrentCPUThread())
|
||||
{
|
||||
throw fmt::Format("Access violation %s location 0x%x (is_alive=%d, last_syscall=0x%llx (%s))", is_writing ? "writing" : "reading", (u32)addr,
|
||||
t->IsAlive() ? 1 : 0, t->m_last_syscall, SysCalls::GetHLEFuncName((u32)t->m_last_syscall).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw fmt::Format("Access violation %s location 0x%x", is_writing ? "writing" : "reading", (u32)addr);
|
||||
}
|
||||
}
|
||||
|
||||
// else some fatal error (should crash)
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
typedef decltype(REG_RIP) reg_table_t;
|
||||
static const reg_table_t reg_table[16] =
|
||||
{
|
||||
REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
|
||||
REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15
|
||||
};
|
||||
|
||||
void signal_handler(int sig, siginfo_t* info, void* uct)
|
||||
{
|
||||
ucontext_t* const ctx = (ucontext_t*)uct;
|
||||
const u64 addr64 = (u64)info->si_addr - (u64)Memory.GetBaseAddr();
|
||||
//const bool is_writing = false; // TODO: get it correctly
|
||||
if (addr64 < 0x100000000ull)
|
||||
{
|
||||
const u32 addr = (u32)addr64;
|
||||
if (addr >= RAW_SPU_BASE_ADDR && (addr % RAW_SPU_OFFSET) >= RAW_SPU_PROB_OFFSET) // RawSPU MMIO registers
|
||||
{
|
||||
// one x64 instruction is manually decoded and interpreted
|
||||
x64_op_t op;
|
||||
x64_reg_t reg;
|
||||
size_t size;
|
||||
decode_x64_reg_op((const u8*)ctx->uc_mcontext.gregs[REG_RIP], op, reg, size);
|
||||
|
||||
// get x64 reg value (for store operations)
|
||||
u64 reg_value;
|
||||
if (reg - X64R32 < 16)
|
||||
{
|
||||
// load the value from x64 register
|
||||
reg_value = (u32)ctx->uc_mcontext.gregs[reg_table[reg - X64R32]];
|
||||
}
|
||||
else if (reg == X64_IMM32)
|
||||
{
|
||||
// load the immediate value (assuming it's at the end of the instruction)
|
||||
reg_value = *(u32*)(ctx->uc_mcontext.gregs[REG_RIP] + size - 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(!"Invalid x64_reg_t value");
|
||||
}
|
||||
|
||||
bool save_reg = false;
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case X64OP_LOAD:
|
||||
{
|
||||
//assert(!is_writing);
|
||||
reg_value = re32(Memory.ReadMMIO32(addr));
|
||||
save_reg = true;
|
||||
break;
|
||||
}
|
||||
case X64OP_STORE:
|
||||
{
|
||||
//assert(is_writing);
|
||||
Memory.WriteMMIO32(addr, re32((u32)reg_value));
|
||||
break;
|
||||
}
|
||||
default: assert(!"Invalid x64_op_t value");
|
||||
}
|
||||
|
||||
// save x64 reg value (for load operations)
|
||||
if (save_reg)
|
||||
{
|
||||
if (reg - X64R32 < 16)
|
||||
{
|
||||
// store the value into x64 register
|
||||
ctx->uc_mcontext.gregs[reg_table[reg - X64R32]] = (u32)reg_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(!"Invalid x64_reg_t value (saving)");
|
||||
}
|
||||
}
|
||||
|
||||
// skip decoded instruction
|
||||
ctx->uc_mcontext.gregs[REG_RIP] += size;
|
||||
|
||||
return; // now execution should proceed
|
||||
//setcontext(ctx);
|
||||
}
|
||||
|
||||
// TODO: allow recovering from a page fault as a feature of PS3 virtual memory
|
||||
if (CPUThread* t = GetCurrentCPUThread())
|
||||
{
|
||||
throw fmt::Format("Access violation %s location 0x%x (is_alive=%d, last_syscall=0x%llx (%s))", /*is_writing ? "writing" : "reading"*/ "at", (u32)addr,
|
||||
t->IsAlive() ? 1 : 0, t->m_last_syscall, SysCalls::GetHLEFuncName((u32)t->m_last_syscall).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw fmt::Format("Access violation %s location 0x%x", /*is_writing ? "writing" : "reading"*/ "at", (u32)addr);
|
||||
}
|
||||
}
|
||||
|
||||
// else some fatal error (not sure what will happen)
|
||||
//exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
const int sigaction_result = []() -> int
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_sigaction = signal_handler;
|
||||
return sigaction(SIGSEGV, &sa, NULL);
|
||||
}();
|
||||
|
||||
#endif
|
||||
|
||||
thread_local NamedThreadBase* g_tls_this_thread = nullptr;
|
||||
std::atomic<u32> g_thread_count(0);
|
||||
|
||||
@ -119,6 +470,12 @@ void ThreadBase::Start()
|
||||
{
|
||||
SetCurrentThreadDebugName(GetThreadName().c_str());
|
||||
|
||||
#ifdef _WIN32
|
||||
auto old_se_translator = _set_se_translator(_se_translator);
|
||||
#else
|
||||
if (sigaction_result == -1) assert(!"sigaction() failed");
|
||||
#endif
|
||||
|
||||
SetCurrentNamedThread(this);
|
||||
g_thread_count++;
|
||||
|
||||
@ -138,6 +495,10 @@ void ThreadBase::Start()
|
||||
m_alive = false;
|
||||
SetCurrentNamedThread(nullptr);
|
||||
g_thread_count--;
|
||||
|
||||
#ifdef _WIN32
|
||||
_set_se_translator(old_se_translator);
|
||||
#endif
|
||||
});
|
||||
}
|
||||
|
||||
@ -208,6 +569,12 @@ void thread::start(std::function<void()> func)
|
||||
{
|
||||
SetCurrentThreadDebugName(name.c_str());
|
||||
|
||||
#ifdef _WIN32
|
||||
auto old_se_translator = _set_se_translator(_se_translator);
|
||||
#else
|
||||
if (sigaction_result == -1) assert(!"sigaction() failed");
|
||||
#endif
|
||||
|
||||
NamedThreadBase info(name);
|
||||
SetCurrentNamedThread(&info);
|
||||
g_thread_count++;
|
||||
@ -227,6 +594,10 @@ void thread::start(std::function<void()> func)
|
||||
|
||||
SetCurrentNamedThread(nullptr);
|
||||
g_thread_count--;
|
||||
|
||||
#ifdef _WIN32
|
||||
_set_se_translator(old_se_translator);
|
||||
#endif
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -158,24 +158,31 @@ bool LoadEntries(rFile& dec_pkg_f, PKGHeader* m_header, PKGEntry *m_entries)
|
||||
|
||||
bool UnpackEntry(rFile& dec_pkg_f, const PKGEntry& entry, std::string dir)
|
||||
{
|
||||
u8 buf[BUF_SIZE];
|
||||
char buf[BUF_SIZE];
|
||||
|
||||
dec_pkg_f.Seek(entry.name_offset);
|
||||
dec_pkg_f.Read(buf, entry.name_size);
|
||||
buf[entry.name_size] = 0;
|
||||
|
||||
switch (entry.type & (0xff))
|
||||
switch (entry.type.ToBE() >> 24)
|
||||
{
|
||||
case PKG_FILE_ENTRY_NPDRM:
|
||||
case PKG_FILE_ENTRY_NPDRMEDAT:
|
||||
case PKG_FILE_ENTRY_SDAT:
|
||||
case PKG_FILE_ENTRY_REGULAR:
|
||||
case PKG_FILE_ENTRY_NPDRM:
|
||||
case PKG_FILE_ENTRY_NPDRMEDAT:
|
||||
case PKG_FILE_ENTRY_SDAT:
|
||||
case PKG_FILE_ENTRY_REGULAR:
|
||||
{
|
||||
rFile out;
|
||||
auto path = dir + std::string(buf, entry.name_size);
|
||||
if (rExists(path))
|
||||
{
|
||||
LOG_WARNING(LOADER, "PKG Loader: File is overwritten: %s", path.c_str());
|
||||
}
|
||||
|
||||
if (out.Create(path, true /* overwriting */))
|
||||
{
|
||||
rFile out;
|
||||
out.Create(dir + std::string(reinterpret_cast<char *>(buf), entry.name_size));
|
||||
dec_pkg_f.Seek(entry.file_offset);
|
||||
|
||||
for (u64 size = 0; size < entry.file_size; ) {
|
||||
for (u64 size = 0; size < entry.file_size;) {
|
||||
size += dec_pkg_f.Read(buf, BUF_SIZE);
|
||||
if (size > entry.file_size)
|
||||
out.Write(buf, BUF_SIZE - (size - entry.file_size));
|
||||
@ -183,14 +190,33 @@ bool UnpackEntry(rFile& dec_pkg_f, const PKGEntry& entry, std::string dir)
|
||||
out.Write(buf, BUF_SIZE);
|
||||
}
|
||||
out.Close();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(LOADER, "PKG Loader: Could not create file: %s", path.c_str());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case PKG_FILE_ENTRY_FOLDER:
|
||||
rMkdir(dir + std::string(reinterpret_cast<char *>(buf), entry.name_size));
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
||||
case PKG_FILE_ENTRY_FOLDER:
|
||||
{
|
||||
auto path = dir + std::string(buf, entry.name_size);
|
||||
if (!rExists(path) && !rMkdir(path))
|
||||
{
|
||||
LOG_ERROR(LOADER, "PKG Loader: Could not create directory: %s", path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
LOG_ERROR(LOADER, "PKG Loader: unknown PKG file entry: 0x%x", entry.type.ToLE());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Unpack(rFile& pkg_f, std::string src, std::string dst)
|
||||
|
@ -254,27 +254,6 @@ void CPUThread::ExecOnce()
|
||||
SendDbgCommand(DID_PAUSED_THREAD, this);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void _se_translator(unsigned int u, EXCEPTION_POINTERS* pExp)
|
||||
{
|
||||
const u64 addr = (u64)pExp->ExceptionRecord->ExceptionInformation[1] - (u64)Memory.GetBaseAddr();
|
||||
CPUThread* t = GetCurrentCPUThread();
|
||||
if (u == EXCEPTION_ACCESS_VIOLATION && addr < 0x100000000 && t)
|
||||
{
|
||||
// TODO: allow recovering from a page fault
|
||||
throw fmt::Format("Access violation: addr = 0x%x (is_alive=%d, last_syscall=0x%llx (%s))",
|
||||
(u32)addr, t->IsAlive() ? 1 : 0, t->m_last_syscall, SysCalls::GetHLEFuncName((u32)t->m_last_syscall).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
// some fatal error (should crash)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// TODO: linux version
|
||||
#endif
|
||||
|
||||
void CPUThread::Task()
|
||||
{
|
||||
if (Ini.HLELogging.GetValue()) LOG_NOTICE(GENERAL, "%s enter", CPUThread::GetFName().c_str());
|
||||
@ -292,12 +271,6 @@ void CPUThread::Task()
|
||||
|
||||
std::vector<u32> trace;
|
||||
|
||||
#ifdef _WIN32
|
||||
auto old_se_translator = _set_se_translator(_se_translator);
|
||||
#else
|
||||
// TODO: linux version
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
@ -346,12 +319,6 @@ void CPUThread::Task()
|
||||
Emu.Pause();
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
_set_se_translator(old_se_translator);
|
||||
#else
|
||||
// TODO: linux version
|
||||
#endif
|
||||
|
||||
if (trace.size())
|
||||
{
|
||||
LOG_NOTICE(GENERAL, "Trace begin (%d elements)", trace.size());
|
||||
|
@ -170,28 +170,29 @@ void MemoryBase::Close()
|
||||
MemoryBlocks.clear();
|
||||
}
|
||||
|
||||
bool MemoryBase::WriteMMIO32(u32 addr, const u32 data)
|
||||
void MemoryBase::WriteMMIO32(u32 addr, const u32 data)
|
||||
{
|
||||
LV2_LOCK(0);
|
||||
|
||||
if (RawSPUMem[(addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET] && ((RawSPUThread*)RawSPUMem[(addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET])->Write32(addr, data))
|
||||
{
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
return false;
|
||||
throw fmt::Format("%s(addr=0x%x, data=0x%x) failed", __FUNCTION__, addr, data);
|
||||
}
|
||||
|
||||
bool MemoryBase::ReadMMIO32(u32 addr, u32& res)
|
||||
u32 MemoryBase::ReadMMIO32(u32 addr)
|
||||
{
|
||||
LV2_LOCK(0);
|
||||
|
||||
u32 res;
|
||||
if (RawSPUMem[(addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET] && ((RawSPUThread*)RawSPUMem[(addr - RAW_SPU_BASE_ADDR) / RAW_SPU_OFFSET])->Read32(addr, &res))
|
||||
{
|
||||
return true;
|
||||
return res;
|
||||
}
|
||||
|
||||
return false;
|
||||
throw fmt::Format("%s(addr=0x%x) failed", __FUNCTION__, addr);
|
||||
}
|
||||
|
||||
bool MemoryBase::Map(const u64 addr, const u32 size)
|
||||
|
@ -127,9 +127,9 @@ public:
|
||||
|
||||
void Close();
|
||||
|
||||
__noinline bool WriteMMIO32(u32 addr, const u32 data);
|
||||
__noinline void WriteMMIO32(u32 addr, const u32 data);
|
||||
|
||||
__noinline bool ReadMMIO32(u32 addr, u32& res);
|
||||
__noinline u32 ReadMMIO32(u32 addr);
|
||||
|
||||
u32 GetUserMemTotalSize()
|
||||
{
|
||||
|
@ -64,20 +64,12 @@ namespace vm
|
||||
|
||||
static u32 read32(u32 addr)
|
||||
{
|
||||
u32 res;
|
||||
if (addr < RAW_SPU_BASE_ADDR || (addr % RAW_SPU_OFFSET) < RAW_SPU_PROB_OFFSET || !Memory.ReadMMIO32((u32)addr, res))
|
||||
{
|
||||
res = re32(*(u32*)((u8*)g_base_addr + addr));
|
||||
}
|
||||
return res;
|
||||
return re32(*(u32*)((u8*)g_base_addr + addr));;
|
||||
}
|
||||
|
||||
static void write32(u32 addr, be_t<u32> value)
|
||||
{
|
||||
if (addr < RAW_SPU_BASE_ADDR || (addr % RAW_SPU_OFFSET) < RAW_SPU_PROB_OFFSET || !Memory.WriteMMIO32((u32)addr, value))
|
||||
{
|
||||
*(be_t<u32>*)((u8*)g_base_addr + addr) = value;
|
||||
}
|
||||
*(be_t<u32>*)((u8*)g_base_addr + addr) = value;
|
||||
}
|
||||
|
||||
static u64 read64(u32 addr)
|
||||
|
@ -306,7 +306,7 @@ s32 modifySaveDataFiles(vm::ptr<CellSaveDataFileCallback> funcFile, vm::ptr<Cell
|
||||
break;
|
||||
|
||||
case CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC:
|
||||
cellSysutil->Warning("modifySaveDataFiles: File operation CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC not yet implemented");
|
||||
cellSysutil->Todo("modifySaveDataFiles: CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC");
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -317,16 +317,22 @@ s32 modifySaveDataFiles(vm::ptr<CellSaveDataFileCallback> funcFile, vm::ptr<Cell
|
||||
if (file && file->IsOpened())
|
||||
file->Close();
|
||||
}
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
// Functions
|
||||
int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataListSave2(
|
||||
u32 version,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataListSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataListSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
@ -380,8 +386,8 @@ int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
||||
if (listSet->newData)
|
||||
addNewSaveDataEntry(saveEntries, vm::ptr<CellSaveDataListNewData>::make(listSet->newData.addr()));
|
||||
if (saveEntries.size() == 0) {
|
||||
cellSysutil->Warning("cellSaveDataListSave2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Error("cellSaveDataListSave2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||
@ -407,11 +413,17 @@ int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataListLoad2(
|
||||
u32 version,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataListLoad2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataListLoad2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
@ -466,8 +478,8 @@ int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
||||
if (listSet->newData)
|
||||
addNewSaveDataEntry(saveEntries, vm::ptr<CellSaveDataListNewData>::make(listSet->newData.addr()));
|
||||
if (saveEntries.size() == 0) {
|
||||
cellSysutil->Warning("cellSaveDataListLoad2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Error("cellSaveDataListLoad2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||
@ -493,11 +505,17 @@ int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataFixedSave2(
|
||||
u32 version,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataFixedSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataFixedSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
@ -563,11 +581,17 @@ int cellSaveDataFixedSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, v
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataFixedLoad2(
|
||||
u32 version,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataFixedLoad2(version=%d, setList_addr=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataFixedLoad2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
@ -633,11 +657,17 @@ int cellSaveDataFixedLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, v
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cellSaveDataAutoSave2(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataAutoSave2(
|
||||
u32 version,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataAutoSave2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataAutoSave2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, dirName.addr(), errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
@ -685,14 +715,20 @@ int cellSaveDataAutoSave2(u32 version, vm::ptr<const char> dirName, u32 errDialo
|
||||
// Enter the loop where the save files are read/created/deleted.
|
||||
s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
|
||||
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataAutoLoad2(
|
||||
u32 version,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataAutoLoad2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataAutoLoad2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, dirName.addr(), errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
@ -715,7 +751,7 @@ int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialo
|
||||
|
||||
// The target entry does not exist
|
||||
if (saveEntries.size() == 0) {
|
||||
cellSysutil->Warning("cellSaveDataAutoLoad2: Couldn't find save entry (%s)", dirN.c_str());
|
||||
cellSysutil->Error("cellSaveDataAutoLoad2: Couldn't find save entry (%s)", dirN.c_str());
|
||||
return CELL_OK; // TODO: Can anyone check the actual behaviour of a PS3 when saves are not found?
|
||||
}
|
||||
|
||||
@ -735,13 +771,21 @@ int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialo
|
||||
// Enter the loop where the save files are read/created/deleted.
|
||||
s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
|
||||
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataListAutoSave(
|
||||
u32 version,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataListAutoSave(version=%d, errDialog=%d, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Todo("cellSaveDataListAutoSave(version=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
//vm::var<CellSaveDataCBResult> result;
|
||||
@ -792,19 +836,10 @@ int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSet
|
||||
// return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
//}
|
||||
|
||||
//setSaveDataList(saveEntries, (u32)listSet->fixedList.addr(), listSet->fixedListNum);
|
||||
//if (listSet->newData)
|
||||
// addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr());
|
||||
//if (saveEntries.size() == 0) {
|
||||
// cellSysutil->Warning("cellSaveDataListAutoSave: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
// return CELL_SAVEDATA_RET_OK;
|
||||
//}
|
||||
|
||||
//u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||
//// TODO: Display the dialog here
|
||||
//u32 selectedIndex = focusIndex; // TODO: Until the dialog is implemented, select always the focused entry
|
||||
//getSaveDataStat(saveEntries[selectedIndex], statGet.addr());
|
||||
//result->userdata_addr = userdata_addr;
|
||||
//setSaveDataFixed(saveEntries, fixedSet);
|
||||
//getSaveDataStat(saveEntries[0], statGet); // There should be only one element in this list
|
||||
//// TODO: Display the Yes|No dialog here
|
||||
//result->userdata = userdata;
|
||||
|
||||
//funcStat(result, statGet, statSet);
|
||||
//Memory.Free(statGet->fileList.addr());
|
||||
@ -814,19 +849,27 @@ int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSet
|
||||
//}
|
||||
|
||||
///*if (statSet->setParam)
|
||||
//addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr()); // TODO: This *is* wrong
|
||||
//// TODO: Write PARAM.SFO file
|
||||
//*/
|
||||
|
||||
//// Enter the loop where the save files are read/created/deleted.
|
||||
//s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataListAutoLoad(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataListAutoLoad(
|
||||
u32 version,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
cellSysutil->Todo("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
//vm::var<CellSaveDataCBResult> result;
|
||||
//vm::var<CellSaveDataListGet> listGet;
|
||||
@ -876,193 +919,411 @@ int cellSaveDataListAutoLoad(u32 version, u32 errDialog, vm::ptr<CellSaveDataSet
|
||||
// return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
//}
|
||||
|
||||
//setSaveDataList(saveEntries, (u32)listSet->fixedList.addr(), listSet->fixedListNum);
|
||||
//if (listSet->newData)
|
||||
// addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr());
|
||||
//if (saveEntries.size() == 0) {
|
||||
// cellSysutil->Warning("cellSaveDataListAutoLoad: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
// return CELL_SAVEDATA_RET_OK;
|
||||
//}
|
||||
//setSaveDataFixed(saveEntries, fixedSet);
|
||||
//getSaveDataStat(saveEntries[0], statGet); // There should be only one element in this list
|
||||
//// TODO: Display the Yes|No dialog here
|
||||
//result->userdata = userdata;
|
||||
|
||||
//u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||
//// TODO: Display the dialog here
|
||||
//u32 selectedIndex = focusIndex; // TODO: Until the dialog is implemented, select always the focused entry
|
||||
//getSaveDataStat(saveEntries[selectedIndex], statGet.addr());
|
||||
//result->userdata_addr = userdata_addr;
|
||||
|
||||
//funcStat(result.addr(), statGet.addr(), statSet.addr());
|
||||
//funcStat(result, statGet, statSet);
|
||||
//Memory.Free(statGet->fileList.addr());
|
||||
|
||||
//if (result->result < 0) {
|
||||
// cellSysutil->Error("cellSaveDataListAutoLoad: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
// cellSysutil->Error("cellSaveDataFixedLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
// return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
//}
|
||||
|
||||
///*if (statSet->setParam)
|
||||
//// TODO: Write PARAM.SFO file
|
||||
//*/
|
||||
|
||||
//// Enter the loop where the save files are read/created/deleted.
|
||||
//s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataDelete2(u32 container)
|
||||
s32 cellSaveDataDelete2(u32 container)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataDelete2(container=0x%x)", container);
|
||||
cellSysutil->Todo("cellSaveDataDelete2(container=%d)", container);
|
||||
|
||||
return CELL_SAVEDATA_RET_CANCEL;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedDelete(vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataFixedDelete(
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataFixedDelete(setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcDone=0x%x, container=0x%x, userdata_addr=0x%x)", setList.addr(), setBuf.addr(), funcFixed.addr(),
|
||||
funcDone.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataFixedDelete(setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcDone_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
setList.addr(), setBuf.addr(), funcFixed.addr(), funcDone.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListSave(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserListSave(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserListSave(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserListSave(version=%d, userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListLoad(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserListLoad(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserListLoad(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserListLoad(version=%d, userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedSave(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserFixedSave(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserFixedSave(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserFixedSave(version=%d, userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedLoad(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserFixedLoad(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserFixedLoad(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserFixedLoad(version=%d, userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserAutoSave(u32 version, u32 userId, u32 dirName_addr, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserAutoSave(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserAutoSave(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, dirName_addr, errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserAutoSave(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf_addr=0x%x, funcStat_addr=0x%x, funcFile=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, dirName.addr(), errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserAutoLoad(u32 version, u32 userId, u32 dirName_addr, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserAutoLoad(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, dirName_addr, errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf_addr=0x%x, funcStat_addr=0x%x, funcFile=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, dirName.addr(), errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListAutoSave(u32 version, u32 userId, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserListAutoSave(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListAutoLoad(u32 version, u32 userId, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserListAutoLoad(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%D, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedDelete() //CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataFixedCallback funcFixed, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserFixedDelete(
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserFixedDelete(userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcDone_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcDone.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
//void cellSaveDataEnableOverlay(); //int enable
|
||||
void cellSaveDataEnableOverlay(s32 enable)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataEnableOverlay(enable=%d)", enable);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Functions (Extensions)
|
||||
int cellSaveDataListDelete() //CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataListCallback funcList, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataListDelete(
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataListImport() //CellSaveDataSetList *setList, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataListImport(
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataListExport() //CellSaveDataSetList *setList, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataListExport(
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedImport() //const char *dirName, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataFixedImport(
|
||||
vm::ptr<const char> dirName,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedExport() //const char *dirName, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataFixedExport(
|
||||
vm::ptr<const char> dirName,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataGetListItem() //const char *dirName, CellSaveDataDirStat *dir, CellSaveDataSystemFileParam *sysFileParam, vm::ptr<u32> bind, vm::ptr<u32> sizeKB
|
||||
s32 cellSaveDataGetListItem(
|
||||
vm::ptr<const char> dirName,
|
||||
vm::ptr<CellSaveDataDirStat> dir,
|
||||
vm::ptr<CellSaveDataSystemFileParam> sysFileParam,
|
||||
vm::ptr<u32> bind,
|
||||
vm::ptr<u32> sizeKB)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListDelete() //CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataListCallback funcList, CellSaveDataDoneCallback funcDone,sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserListDelete(
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListImport() //CellSysutilUserId userId, CellSaveDataSetList *setList, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserListImport(
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListExport() //CellSysutilUserId userId, CellSaveDataSetList *setList, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserListExport(
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedImport() //CellSysutilUserId userId, const char *dirName, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserFixedImport(
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedExport() //CellSysutilUserId userId, const char *dirName, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserFixedExport(
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserGetListItem() //CellSysutilUserId userId, const char *dirName, CellSaveDataDirStat *dir, CellSaveDataSystemFileParam *sysFileParam, vm::ptr<u32> bind, vm::ptr<u32> sizeKB
|
||||
s32 cellSaveDataUserGetListItem(
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
vm::ptr<CellSaveDataDirStat> dir,
|
||||
vm::ptr<CellSaveDataSystemFileParam> sysFileParam,
|
||||
vm::ptr<u32> bind,
|
||||
vm::ptr<u32> sizeKB)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void cellSysutil_SaveData_init()
|
||||
{
|
||||
// libsysutil functions:
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataEnableOverlay);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataDelete2);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataDelete);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedDelete);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedDelete);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedSave);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedLoad2);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedSave2);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataFixedLoad);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataFixedSave);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListSave);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListLoad2);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListSave2);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataListLoad);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataListSave);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListAutoLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListAutoSave);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListAutoLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListAutoSave);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserAutoLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserAutoSave);
|
||||
REG_FUNC(cellSysutil, cellSaveDataAutoLoad2);
|
||||
REG_FUNC(cellSysutil, cellSaveDataAutoSave2);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataAutoLoad);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataAutoSave);
|
||||
|
||||
// libsysutil_savedata functions:
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserGetListItem);
|
||||
REG_FUNC(cellSysutil, cellSaveDataGetListItem);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListDelete);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListDelete);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedExport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedImport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListExport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListImport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedExport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedImport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListExport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListImport);
|
||||
|
||||
// libsysutil_savedata_psp functions:
|
||||
}
|
||||
|
@ -257,10 +257,10 @@ struct CellSaveDataDoneGet
|
||||
|
||||
// Callback Functions
|
||||
typedef void(*CellSaveDataFixedCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataListGet> get, vm::ptr<CellSaveDataFixedSet> set);
|
||||
typedef void(*CellSaveDataListCallback) (vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataListGet> get, vm::ptr<CellSaveDataListSet> set);
|
||||
typedef void(*CellSaveDataStatCallback) (vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataStatGet> get, vm::ptr<CellSaveDataStatSet> set);
|
||||
typedef void(*CellSaveDataFileCallback) (vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataFileGet> get, vm::ptr<CellSaveDataFileSet> set);
|
||||
typedef void(*CellSaveDataDoneCallback) (vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataDoneGet> get);
|
||||
typedef void(*CellSaveDataListCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataListGet> get, vm::ptr<CellSaveDataListSet> set);
|
||||
typedef void(*CellSaveDataStatCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataStatGet> get, vm::ptr<CellSaveDataStatSet> set);
|
||||
typedef void(*CellSaveDataFileCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataFileGet> get, vm::ptr<CellSaveDataFileSet> set);
|
||||
typedef void(*CellSaveDataDoneCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataDoneGet> get);
|
||||
|
||||
|
||||
// Auxiliary Structs
|
||||
@ -279,35 +279,3 @@ struct SaveDataEntry
|
||||
u32 iconBufSize;
|
||||
bool isNew;
|
||||
};
|
||||
|
||||
|
||||
// Function declarations
|
||||
int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataFixedSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataFixedLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataAutoSave2(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataListAutoLoad(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata);
|
@ -18,7 +18,6 @@
|
||||
#include "cellMsgDialog.h"
|
||||
#include "cellGame.h"
|
||||
#include "cellSysutil.h"
|
||||
#include "cellSaveData.h"
|
||||
|
||||
typedef void (*CellHddGameStatCallback)(vm::ptr<CellHddGameCBResult> cbResult, vm::ptr<CellHddGameStatGet> get, vm::ptr<CellHddGameStatSet> set);
|
||||
|
||||
@ -842,6 +841,8 @@ extern int cellGameDataCheckCreate2(u32 version, vm::ptr<const char> dirName, u3
|
||||
extern int cellGameDataCheckCreate(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
vm::ptr<void(*)(vm::ptr<CellGameDataCBResult> cbResult, vm::ptr<CellGameDataStatGet> get, vm::ptr<CellGameDataStatSet> set)> funcStat, u32 container);
|
||||
|
||||
extern void cellSysutil_SaveData_init();
|
||||
|
||||
void cellSysutil_init(Module *pxThis)
|
||||
{
|
||||
cellSysutil = pxThis;
|
||||
@ -894,36 +895,13 @@ void cellSysutil_init(Module *pxThis)
|
||||
//cellSysutil->AddFunc(0x9ca9ffa7, cellHddGameSetSystemVer);
|
||||
//cellSysutil->AddFunc(0xafd605b3, cellHddGameExitBroken);
|
||||
|
||||
//cellSysutil_SaveData
|
||||
//cellSysutil->AddFunc(0x04c06fc2, cellSaveDataGetListItem);
|
||||
//cellSysutil->AddFunc(0x273d116a, cellSaveDataUserListExport);
|
||||
//cellSysutil->AddFunc(0x27cb8bc2, cellSaveDataListDelete);
|
||||
//cellSysutil->AddFunc(0x39d6ee43, cellSaveDataUserListImport);
|
||||
//cellSysutil->AddFunc(0x46a2d878, cellSaveDataFixedExport);
|
||||
//cellSysutil->AddFunc(0x491cc554, cellSaveDataListExport);
|
||||
//cellSysutil->AddFunc(0x52541151, cellSaveDataFixedImport);
|
||||
//cellSysutil->AddFunc(0x529231b0, cellSaveDataUserFixedImport);
|
||||
//cellSysutil->AddFunc(0x6b4e0de6, cellSaveDataListImport);
|
||||
//cellSysutil->AddFunc(0x7048a9ba, cellSaveDataUserListDelete);
|
||||
//cellSysutil->AddFunc(0x95ae2cde, cellSaveDataUserFixedExport);
|
||||
//cellSysutil->AddFunc(0xf6482036, cellSaveDataUserGetListItem);
|
||||
cellSysutil->AddFunc(0x2de0d663, cellSaveDataListSave2);
|
||||
cellSysutil->AddFunc(0x1dfbfdd6, cellSaveDataListLoad2);
|
||||
cellSysutil->AddFunc(0x2aae9ef5, cellSaveDataFixedSave2);
|
||||
cellSysutil->AddFunc(0x2a8eada2, cellSaveDataFixedLoad2);
|
||||
cellSysutil->AddFunc(0x8b7ed64b, cellSaveDataAutoSave2);
|
||||
cellSysutil->AddFunc(0xfbd5c856, cellSaveDataAutoLoad2);
|
||||
cellSysutil->AddFunc(0x4dd03a4e, cellSaveDataListAutoSave);
|
||||
cellSysutil->AddFunc(0x21425307, cellSaveDataListAutoLoad);
|
||||
//cellSysutil->AddFunc(0xedadd797, cellSaveDataDelete2);
|
||||
//cellSysutil->AddFunc(0x0f03cfb0, cellSaveDataUserListSave);
|
||||
//cellSysutil->AddFunc(0x39dd8425, cellSaveDataUserListLoad);
|
||||
//cellSysutil->AddFunc(0x40b34847, cellSaveDataUserFixedSave);
|
||||
//cellSysutil->AddFunc(0x6e7264ed, cellSaveDataUserFixedLoad);
|
||||
//cellSysutil->AddFunc(0x52aac4fa, cellSaveDataUserAutoSave);
|
||||
//cellSysutil->AddFunc(0xcdc6aefd, cellSaveDataUserAutoLoad);
|
||||
//cellSysutil->AddFunc(0x0e091c36, cellSaveDataUserListAutoSave);
|
||||
//cellSysutil->AddFunc(0xe7fa820b, cellSaveDataEnableOverlay);
|
||||
//cellSysutil->AddFunc(0x886D0747, cellSysutilRegisterCallbackDispatcher);
|
||||
//cellSysutil->AddFunc(0xA2720DF2, cellSysutilPacketWrite);
|
||||
//cellSysutil->AddFunc(0x75AA7373, doc.write);
|
||||
//cellSysutil->AddFunc(0x2D96313F, packet_read);
|
||||
|
||||
// cellSaveData functions
|
||||
cellSysutil_SaveData_init();
|
||||
|
||||
cellSysutil->AddFunc(0x6d087930, cellWebBrowserEstimate2);
|
||||
|
||||
|
@ -15,6 +15,12 @@ s32 sys_rwlock_create(vm::ptr<u32> rw_lock_id, vm::ptr<sys_rwlock_attribute_t> a
|
||||
{
|
||||
sys_rwlock.Warning("sys_rwlock_create(rw_lock_id_addr=0x%x, attr_addr=0x%x)", rw_lock_id.addr(), attr.addr());
|
||||
|
||||
if (!attr)
|
||||
{
|
||||
sys_rwlock.Error("sys_rwlock_create(): null attr address");
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch (attr->protocol.ToBE())
|
||||
{
|
||||
case se32(SYS_SYNC_PRIORITY): break;
|
||||
|
@ -28,16 +28,13 @@ bool PKGLoader::Install(std::string dest)
|
||||
std::string titleID = std::string(title_id).substr(7, 9);
|
||||
|
||||
if (rExists(dest + titleID)) {
|
||||
rMessageDialog d_overwrite(NULL, "Another installation was found. Do you want to overwrite it?", "PKG Decrypter / Installer", rYES_NO|rCENTRE);
|
||||
rMessageDialog d_overwrite(NULL, "Another installation found. Do you want to overwrite it?", "PKG Decrypter / Installer", rYES_NO|rCENTRE);
|
||||
if (d_overwrite.ShowModal() != rID_YES) {
|
||||
LOG_ERROR(LOADER, "PKG Loader: Another installation found in: %s", titleID.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
rRmdir(dest + titleID);
|
||||
}
|
||||
if (!rMkdir(dest + titleID)) {
|
||||
LOG_ERROR(LOADER, "PKG Loader: Could not make the installation directory: %s", titleID.c_str());
|
||||
} else if (!rMkdir(dest + titleID)) {
|
||||
LOG_ERROR(LOADER, "PKG Loader: Could not create the installation directory: %s", titleID.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user