mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
vm::ptr for u8/char types, mem_list_ptr_t removed
This commit is contained in:
parent
ebc4fa3e81
commit
a8cfefac07
31 changed files with 208 additions and 362 deletions
|
@ -108,8 +108,8 @@ void PPUThread::InitRegs()
|
|||
m_stack_point -= 0xc + 4 * argc;
|
||||
u64 argv = m_stack_point;
|
||||
|
||||
mem64_ptr_t argv_list((u32)argv);
|
||||
for(int i=0; i<argc; ++i) argv_list += m_argv_addr[i];
|
||||
auto argv_list = vm::ptr<be_t<u64>>::make((u32)argv);
|
||||
for(int i=0; i<argc; ++i) argv_list[i] = m_argv_addr[i];
|
||||
|
||||
GPR[3] = argc;
|
||||
GPR[4] = argv;
|
||||
|
|
|
@ -40,7 +40,7 @@ SPURSManagerEventFlag::SPURSManagerEventFlag(u32 flagClearMode, u32 flagDirectio
|
|||
this->flagDirection = flagDirection;
|
||||
}
|
||||
|
||||
SPURSManagerTasksetAttribute::SPURSManagerTasksetAttribute(u64 args, mem8_t priority, u32 maxContention)
|
||||
SPURSManagerTasksetAttribute::SPURSManagerTasksetAttribute(u64 args, vm::ptr<const u8> priority, u32 maxContention)
|
||||
{
|
||||
this->args = args;
|
||||
this->maxContention = maxContention;
|
||||
|
@ -56,7 +56,7 @@ void SPURSManager::Finalize()
|
|||
delete this->attr;
|
||||
}
|
||||
|
||||
void SPURSManager::AttachLv2EventQueue(u32 queue, mem8_t port, int isDynamic)
|
||||
void SPURSManager::AttachLv2EventQueue(u32 queue, vm::ptr<u8> port, int isDynamic)
|
||||
{
|
||||
//TODO:
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ protected:
|
|||
class SPURSManagerTasksetAttribute
|
||||
{
|
||||
public:
|
||||
SPURSManagerTasksetAttribute(u64 args, mem8_t priority, u32 maxContention);
|
||||
SPURSManagerTasksetAttribute(u64 args, vm::ptr<const u8> priority, u32 maxContention);
|
||||
|
||||
protected:
|
||||
be_t<u64> args;
|
||||
|
@ -71,7 +71,7 @@ public:
|
|||
SPURSManager(SPURSManagerAttribute *attr);
|
||||
|
||||
void Finalize();
|
||||
void AttachLv2EventQueue(u32 queue, mem8_t port, int isDynamic);
|
||||
void AttachLv2EventQueue(u32 queue, vm::ptr<u8> port, int isDynamic);
|
||||
void DetachLv2EventQueue(u8 port);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -689,55 +689,6 @@ public:
|
|||
mem_t& operator >>= (T right) { return *this = (*this) >> right; }
|
||||
};
|
||||
|
||||
template<typename T, typename AT = u32> class mem_list_ptr_t : public mem_base_t<T, AT>
|
||||
{
|
||||
public:
|
||||
mem_list_ptr_t(u32 addr) : mem_base_t<T>(addr)
|
||||
{
|
||||
}
|
||||
|
||||
void operator = (T right)
|
||||
{
|
||||
(be_t<T>&)Memory[this->m_addr] = right;
|
||||
}
|
||||
|
||||
u32 operator += (T right)
|
||||
{
|
||||
*this = right;
|
||||
this->m_addr += sizeof(T);
|
||||
return this->m_addr;
|
||||
}
|
||||
|
||||
u32 AppendRawBytes(const u8 *bytes, size_t count)
|
||||
{
|
||||
memmove(Memory + this->m_addr, bytes, count);
|
||||
this->m_addr += (u32)count;
|
||||
return this->m_addr;
|
||||
}
|
||||
|
||||
u32 Skip(const u32 offset) { return this->m_addr += offset; }
|
||||
|
||||
operator be_t<T>*() { return GetPtr(); }
|
||||
operator void*() { return GetPtr(); }
|
||||
operator be_t<T>*() const { return GetPtr(); }
|
||||
operator void*() const { return GetPtr(); }
|
||||
|
||||
const char* GetString() const
|
||||
{
|
||||
return (const char*)&Memory[this->m_addr];
|
||||
}
|
||||
|
||||
be_t<T>* GetPtr()
|
||||
{
|
||||
return (be_t<T>*)&Memory[this->m_addr];
|
||||
}
|
||||
|
||||
const be_t<T>* GetPtr() const
|
||||
{
|
||||
return (const be_t<T>*)&Memory[this->m_addr];
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct _func_arg
|
||||
{
|
||||
|
@ -758,7 +709,6 @@ struct _func_arg<mem_base_t<T, u32>>
|
|||
|
||||
template<typename T, int lvl> struct _func_arg<mem_ptr_t<T, lvl, u32>> : public _func_arg<mem_base_t<T, u32>> {};
|
||||
template<int lvl> struct _func_arg<mem_ptr_t<void, lvl, u32>> : public _func_arg<mem_base_t<u8, u32>>{};
|
||||
template<typename T> struct _func_arg<mem_list_ptr_t<T, u32>> : public _func_arg<mem_base_t<T, u32>> {};
|
||||
template<typename T> struct _func_arg<mem_t<T, u32>> : public _func_arg<mem_base_t<T, u32>> {};
|
||||
|
||||
template<typename T>
|
||||
|
@ -818,139 +768,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
/*
|
||||
template<typename T>
|
||||
class MemoryAllocator
|
||||
{
|
||||
u32 m_addr;
|
||||
u32 m_size;
|
||||
T* m_ptr;
|
||||
|
||||
public:
|
||||
MemoryAllocator(u32 size = sizeof(T), u32 align = 1)
|
||||
: m_size(size)
|
||||
, m_addr((u32)Memory.Alloc(size, align))
|
||||
, m_ptr((T*)&Memory[m_addr])
|
||||
{
|
||||
}
|
||||
|
||||
~MemoryAllocator()
|
||||
{
|
||||
Memory.Free(m_addr);
|
||||
}
|
||||
|
||||
T* operator -> ()
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
T* GetPtr()
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
const T* GetPtr() const
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
const T* operator -> () const
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
u32 GetAddr() const
|
||||
{
|
||||
return m_addr;
|
||||
}
|
||||
|
||||
u32 GetSize() const
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
||||
bool IsGood() const
|
||||
{
|
||||
return Memory.IsGoodAddr(m_addr, sizeof(T));
|
||||
}
|
||||
|
||||
template<typename T1>
|
||||
operator const T1() const
|
||||
{
|
||||
return T1(*m_ptr);
|
||||
}
|
||||
|
||||
template<typename T1>
|
||||
operator T1()
|
||||
{
|
||||
return T1(*m_ptr);
|
||||
}
|
||||
|
||||
operator const T&() const
|
||||
{
|
||||
return *m_ptr;
|
||||
}
|
||||
|
||||
operator T&()
|
||||
{
|
||||
return *m_ptr;
|
||||
}
|
||||
|
||||
operator const T*() const
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
operator T*()
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
T operator [](int index)
|
||||
{
|
||||
return *(m_ptr + index);
|
||||
}
|
||||
|
||||
template<typename T1>
|
||||
operator const mem_t<T1>() const
|
||||
{
|
||||
return GetAddr();
|
||||
}
|
||||
|
||||
operator const mem_ptr_t<T>() const
|
||||
{
|
||||
return GetAddr();
|
||||
}
|
||||
|
||||
template<typename NT>
|
||||
NT* To(uint offset = 0)
|
||||
{
|
||||
return (NT*)(m_ptr + offset);
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
typedef mem_t<u8, u32> mem8_t;
|
||||
typedef mem_t<u16, u32> mem16_t;
|
||||
typedef mem_t<u32, u32> mem32_t;
|
||||
typedef mem_t<u64, u32> mem64_t;
|
||||
|
||||
/*
|
||||
typedef mem_ptr_t<be_t<u8>> mem8_ptr_t;
|
||||
typedef mem_ptr_t<be_t<u16>> mem16_ptr_t;
|
||||
typedef mem_ptr_t<be_t<u32>> mem32_ptr_t;
|
||||
typedef mem_ptr_t<be_t<u64>> mem64_ptr_t;
|
||||
|
||||
typedef mem_list_ptr_t<u8> mem8_lptr_t;
|
||||
typedef mem_list_ptr_t<u16> mem16_lptr_t;
|
||||
typedef mem_list_ptr_t<u32> mem32_lptr_t;
|
||||
typedef mem_list_ptr_t<u64> mem64_lptr_t;
|
||||
*/
|
||||
|
||||
typedef mem_list_ptr_t<u8, u32> mem8_ptr_t;
|
||||
typedef mem_list_ptr_t<u16, u32> mem16_ptr_t;
|
||||
typedef mem_list_ptr_t<u32, u32> mem32_ptr_t;
|
||||
typedef mem_list_ptr_t<u64, u32> mem64_ptr_t;
|
||||
|
||||
#include "vm.h"
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace vm
|
|||
return m_addr;
|
||||
}
|
||||
|
||||
static ptr make(u32 addr)
|
||||
static ptr make(AT addr)
|
||||
{
|
||||
return (ptr&)addr;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ namespace vm
|
|||
return vm::get_ptr<T>(m_addr);
|
||||
}
|
||||
|
||||
static ptr make(u32 addr)
|
||||
static ptr make(AT addr)
|
||||
{
|
||||
return (ptr&)addr;
|
||||
}
|
||||
|
@ -230,7 +230,34 @@ namespace vm
|
|||
return m_addr != 0;
|
||||
}
|
||||
|
||||
static ptr make(u32 addr)
|
||||
static ptr make(AT addr)
|
||||
{
|
||||
return (ptr&)addr;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename AT>
|
||||
class ptr<const void, 1, AT>
|
||||
{
|
||||
AT m_addr;
|
||||
|
||||
public:
|
||||
AT addr() const
|
||||
{
|
||||
return m_addr;
|
||||
}
|
||||
|
||||
const void* const get_ptr() const
|
||||
{
|
||||
return vm::get_ptr<const void>(m_addr);
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return m_addr != 0;
|
||||
}
|
||||
|
||||
static ptr make(AT addr)
|
||||
{
|
||||
return (ptr&)addr;
|
||||
}
|
||||
|
@ -276,7 +303,7 @@ namespace vm
|
|||
return m_addr != 0;
|
||||
}
|
||||
|
||||
static ptr make(u32 addr)
|
||||
static ptr make(AT addr)
|
||||
{
|
||||
return (ptr&)addr;
|
||||
}
|
||||
|
@ -350,7 +377,7 @@ namespace vm
|
|||
return m_addr != 0;
|
||||
}
|
||||
|
||||
static ptr make(u32 addr)
|
||||
static ptr make(AT addr)
|
||||
{
|
||||
return (ptr&)addr;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace vm
|
|||
return m_addr;
|
||||
}
|
||||
|
||||
static _ref_base make(u32 addr)
|
||||
static _ref_base make(AT addr)
|
||||
{
|
||||
return (_ref_base&)addr;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ std::string GLFragmentDecompilerThread::AddConst()
|
|||
return name;
|
||||
}
|
||||
|
||||
mem32_ptr_t data(m_addr + m_size + m_offset);
|
||||
auto data = vm::ptr<be_t<u32>>::make(m_addr + m_size + m_offset);
|
||||
|
||||
m_offset += 4 * 4;
|
||||
u32 x = GetData(data[0]);
|
||||
|
@ -279,7 +279,7 @@ std::string GLFragmentDecompilerThread::BuildCode()
|
|||
|
||||
void GLFragmentDecompilerThread::Task()
|
||||
{
|
||||
mem32_ptr_t data(m_addr);
|
||||
auto data = vm::ptr<be_t<u32>>::make(m_addr);
|
||||
m_size = 0;
|
||||
m_location = 0;
|
||||
m_loop_count = 0;
|
||||
|
@ -314,7 +314,7 @@ void GLFragmentDecompilerThread::Task()
|
|||
src1.HEX = GetData(data[2]);
|
||||
src2.HEX = GetData(data[3]);
|
||||
|
||||
m_offset = 4 * 4;
|
||||
m_offset = 4 * sizeof(u32);
|
||||
|
||||
const u32 opcode = dst.opcode | (src1.opcode_is_branch << 6);
|
||||
|
||||
|
@ -439,7 +439,8 @@ void GLFragmentDecompilerThread::Task()
|
|||
|
||||
if(dst.end) break;
|
||||
|
||||
data.Skip(m_offset);
|
||||
assert(m_offset % sizeof(u32) == 0);
|
||||
data += m_offset / sizeof(u32);
|
||||
}
|
||||
|
||||
// flush m_code_level
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "RSXThread.h"
|
||||
#include "Emu/SysCalls/lv2/sys_time.h"
|
||||
|
||||
#define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count, args.GetAddr()) : args[x].ToLE())
|
||||
#define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count, args.addr()) : args[x].ToLE())
|
||||
|
||||
u32 methodRegisters[0xffff];
|
||||
|
||||
|
@ -142,7 +142,7 @@ u32 RSXVertexData::GetTypeSize()
|
|||
|
||||
u32 RSXThread::OutOfArgsCount(const uint x, const u32 cmd, const u32 count, const u32 args_addr)
|
||||
{
|
||||
mem32_ptr_t args(args_addr);
|
||||
auto args = vm::ptr<be_t<u32>>::make(args_addr);
|
||||
std::string debug = GetMethodName(cmd);
|
||||
debug += "(";
|
||||
for(u32 i=0; i<count; ++i) debug += (i ? ", " : "") + fmt::Format("0x%x", ARGS(i));
|
||||
|
@ -209,7 +209,7 @@ u32 RSXThread::OutOfArgsCount(const uint x, const u32 cmd, const u32 count, cons
|
|||
|
||||
void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const u32 count)
|
||||
{
|
||||
mem32_ptr_t args(args_addr);
|
||||
auto args = vm::ptr<be_t<u32>>::make(args_addr);
|
||||
|
||||
#if CMD_DEBUG
|
||||
std::string debug = GetMethodName(cmd);
|
||||
|
@ -2234,14 +2234,14 @@ void RSXThread::Task()
|
|||
continue;
|
||||
}
|
||||
|
||||
mem32_ptr_t args((u32)Memory.RSXIOMem.RealAddr(Memory.RSXIOMem.GetStartAddr() + get + 4));
|
||||
auto args = vm::ptr<be_t<u32>>::make((u32)Memory.RSXIOMem.RealAddr(Memory.RSXIOMem.GetStartAddr() + get + 4));
|
||||
|
||||
for(u32 i=0; i<count; i++)
|
||||
{
|
||||
methodRegisters[(cmd & 0xffff) + (i*4*inc)] = ARGS(i);
|
||||
}
|
||||
|
||||
DoCmd(cmd, cmd & 0x3ffff, args.GetAddr(), count);
|
||||
DoCmd(cmd, cmd & 0x3ffff, args.addr(), count);
|
||||
|
||||
m_ctrl->get = get + (count + 1) * 4;
|
||||
//memset(Memory.GetMemFromAddr(p.m_ioAddress + get), 0, (count + 1) * 4);
|
||||
|
|
|
@ -87,9 +87,9 @@ int cellFontOpenFontMemory(mem_ptr_t<CellFontLibrary> library, u32 fontAddr, u32
|
|||
return CELL_FONT_OK;
|
||||
}
|
||||
|
||||
int cellFontOpenFontFile(mem_ptr_t<CellFontLibrary> library, mem8_ptr_t fontPath, u32 subNum, s32 uniqueId, mem_ptr_t<CellFont> font)
|
||||
int cellFontOpenFontFile(mem_ptr_t<CellFontLibrary> library, vm::ptr<const char> fontPath, u32 subNum, s32 uniqueId, mem_ptr_t<CellFont> font)
|
||||
{
|
||||
std::string fp(fontPath.GetString());
|
||||
std::string fp(fontPath.get_ptr());
|
||||
cellFont->Warning("cellFontOpenFontFile(library_addr=0x%x, fontPath=\"%s\", subNum=%d, uniqueId=%d, font_addr=0x%x)",
|
||||
library.GetAddr(), fp.c_str(), subNum, uniqueId, font.GetAddr());
|
||||
|
||||
|
@ -181,11 +181,10 @@ int cellFontOpenFontset(mem_ptr_t<CellFontLibrary> library, mem_ptr_t<CellFontTy
|
|||
return CELL_FONT_ERROR_NO_SUPPORT_FONTSET;
|
||||
}
|
||||
|
||||
u32 file_addr = (u32)Memory.Alloc((u32)file.length() + 1, 1);
|
||||
Memory.WriteString(file_addr, file);
|
||||
int ret = cellFontOpenFontFile(library.GetAddr(), file_addr, 0, 0, font.GetAddr()); //TODO: Find the correct values of subNum, uniqueId
|
||||
vm::var<const char> f((u32)file.length() + 1, 1);
|
||||
Memory.WriteString(f.addr(), file);
|
||||
int ret = cellFontOpenFontFile(library.GetAddr(), vm::ptr<const char>::make(f.addr()), 0, 0, font.GetAddr()); //TODO: Find the correct values of subNum, uniqueId
|
||||
font->origin = CELL_FONT_OPEN_FONTSET;
|
||||
Memory.Free(file_addr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,10 +16,10 @@ Module *cellGame = nullptr;
|
|||
std::string contentInfo = "";
|
||||
std::string usrdir = "";
|
||||
|
||||
int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameContentSize> size, mem_list_ptr_t<u8> dirName)
|
||||
int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameContentSize> size, vm::ptr<char> dirName)
|
||||
{
|
||||
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.addr());
|
||||
|
||||
if (size)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
|||
{
|
||||
type = CELL_GAME_GAMETYPE_DISC;
|
||||
attributes = 0; // TODO
|
||||
if (dirName.GetAddr()) Memory.WriteString(dirName.GetAddr(), ""); // ???
|
||||
if (dirName) Memory.WriteString(dirName.addr(), ""); // ???
|
||||
contentInfo = "/dev_bdvd/PS3_GAME";
|
||||
usrdir = "/dev_bdvd/PS3_GAME/USRDIR";
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
|||
std::string titleId = psf.GetString("TITLE_ID");
|
||||
type = CELL_GAME_GAMETYPE_HDD;
|
||||
attributes = 0; // TODO
|
||||
if (dirName.GetAddr()) Memory.WriteString(dirName.GetAddr(), titleId);
|
||||
if (dirName) Memory.WriteString(dirName.addr(), titleId);
|
||||
contentInfo = "/dev_hdd0/game/" + titleId;
|
||||
usrdir = "/dev_hdd0/game/" + titleId + "/USRDIR";
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
|||
std::string titleId = psf.GetString("TITLE_ID");
|
||||
type = CELL_GAME_GAMETYPE_DISC;
|
||||
attributes = CELL_GAME_ATTRIBUTE_PATCH; // TODO
|
||||
if (dirName.GetAddr()) Memory.WriteString(dirName.GetAddr(), titleId); // ???
|
||||
if (dirName) Memory.WriteString(dirName.addr(), titleId); // ???
|
||||
contentInfo = "/dev_bdvd/PS3_GAME";
|
||||
usrdir = "/dev_bdvd/PS3_GAME/USRDIR";
|
||||
}
|
||||
|
@ -129,9 +129,9 @@ int cellGamePatchCheck(mem_ptr_t<CellGameContentSize> size, u32 reserved_addr)
|
|||
return CELL_GAME_RET_OK;
|
||||
}
|
||||
|
||||
int cellGameDataCheck(u32 type, const mem_list_ptr_t<u8> dirName, mem_ptr_t<CellGameContentSize> size)
|
||||
int cellGameDataCheck(u32 type, vm::ptr<const char> dirName, mem_ptr_t<CellGameContentSize> size)
|
||||
{
|
||||
cellGame->Warning("cellGameDataCheck(type=0x%x, dirName_addr=0x%x, size_addr=0x%x)", type, dirName.GetAddr(), size.GetAddr());
|
||||
cellGame->Warning("cellGameDataCheck(type=0x%x, dirName_addr=0x%x, size_addr=0x%x)", type, dirName.addr(), size.GetAddr());
|
||||
|
||||
if ((type - 1) >= 3)
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ int cellGameDataCheck(u32 type, const mem_list_ptr_t<u8> dirName, mem_ptr_t<Cell
|
|||
}
|
||||
else
|
||||
{
|
||||
std::string dir = "/dev_hdd0/game/" + std::string(dirName.GetString());
|
||||
const std::string dir = std::string("/dev_hdd0/game/") + dirName.get_ptr();
|
||||
|
||||
if (!Emu.GetVFS().ExistsDir(dir))
|
||||
{
|
||||
|
@ -177,10 +177,10 @@ int cellGameDataCheck(u32 type, const mem_list_ptr_t<u8> dirName, mem_ptr_t<Cell
|
|||
return CELL_GAME_RET_OK;
|
||||
}
|
||||
|
||||
int cellGameContentPermit(mem_list_ptr_t<u8> contentInfoPath, mem_list_ptr_t<u8> usrdirPath)
|
||||
int cellGameContentPermit(vm::ptr<char> contentInfoPath, vm::ptr<char> usrdirPath)
|
||||
{
|
||||
cellGame->Warning("cellGameContentPermit(contentInfoPath_addr=0x%x, usrdirPath_addr=0x%x)",
|
||||
contentInfoPath.GetAddr(), usrdirPath.GetAddr());
|
||||
contentInfoPath.addr(), usrdirPath.addr());
|
||||
|
||||
if (contentInfo == "" && usrdir == "")
|
||||
{
|
||||
|
@ -189,8 +189,8 @@ int cellGameContentPermit(mem_list_ptr_t<u8> contentInfoPath, mem_list_ptr_t<u8>
|
|||
}
|
||||
|
||||
// TODO: make it better
|
||||
Memory.WriteString(contentInfoPath.GetAddr(), contentInfo);
|
||||
Memory.WriteString(usrdirPath.GetAddr(), usrdir);
|
||||
Memory.WriteString(contentInfoPath.addr(), contentInfo);
|
||||
Memory.WriteString(usrdirPath.addr(), usrdir);
|
||||
|
||||
contentInfo = "";
|
||||
usrdir = "";
|
||||
|
@ -198,11 +198,11 @@ int cellGameContentPermit(mem_list_ptr_t<u8> contentInfoPath, mem_list_ptr_t<u8>
|
|||
return CELL_GAME_RET_OK;
|
||||
}
|
||||
|
||||
int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t<u8> dirName, u32 errDialog,
|
||||
int cellGameDataCheckCreate2(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
mem_func_ptr_t<void(*)(mem_ptr_t<CellGameDataCBResult> cbResult, mem_ptr_t<CellGameDataStatGet> get, mem_ptr_t<CellGameDataStatSet> set)> funcStat, u32 container)
|
||||
{
|
||||
cellGame->Warning("cellGameDataCheckCreate2(version=0x%x, dirName_addr=0x%x, errDialog=0x%x, funcStat_addr=0x%x, container=%d)",
|
||||
version, dirName.GetAddr(), errDialog, funcStat.GetAddr(), container);
|
||||
version, dirName.addr(), errDialog, funcStat.GetAddr(), container);
|
||||
|
||||
if (version != CELL_GAMEDATA_VERSION_CURRENT || errDialog > 1)
|
||||
{
|
||||
|
@ -212,7 +212,7 @@ int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t<u8> dirName, u32
|
|||
|
||||
// TODO: output errors (errDialog)
|
||||
|
||||
const std::string dir = "/dev_hdd0/game/" + std::string(dirName.GetString());
|
||||
const std::string dir = std::string("/dev_hdd0/game/") + dirName.get_ptr();
|
||||
|
||||
if (!Emu.GetVFS().ExistsDir(dir))
|
||||
{
|
||||
|
@ -304,17 +304,17 @@ int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t<u8> dirName, u32
|
|||
}
|
||||
}
|
||||
|
||||
int cellGameDataCheckCreate(u32 version, const mem_list_ptr_t<u8> dirName, u32 errDialog,
|
||||
int cellGameDataCheckCreate(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
mem_func_ptr_t<void(*)(mem_ptr_t<CellGameDataCBResult> cbResult, mem_ptr_t<CellGameDataStatGet> get, mem_ptr_t<CellGameDataStatSet> set)> funcStat, u32 container)
|
||||
{
|
||||
// TODO: almost identical, the only difference is that this function will always calculate the size of game data
|
||||
return cellGameDataCheckCreate2(version, dirName, errDialog, funcStat, container);
|
||||
}
|
||||
|
||||
int cellGameCreateGameData(mem_ptr_t<CellGameSetInitParams> init, mem_list_ptr_t<u8> tmp_contentInfoPath, mem_list_ptr_t<u8> tmp_usrdirPath)
|
||||
int cellGameCreateGameData(mem_ptr_t<CellGameSetInitParams> init, vm::ptr<char> tmp_contentInfoPath, vm::ptr<char> tmp_usrdirPath)
|
||||
{
|
||||
cellGame->Todo("cellGameCreateGameData(init_addr=0x%x, tmp_contentInfoPath_addr=0x%x, tmp_usrdirPath_addr=0x%x)",
|
||||
init.GetAddr(), tmp_contentInfoPath.GetAddr(), tmp_usrdirPath.GetAddr());
|
||||
init.GetAddr(), tmp_contentInfoPath.addr(), tmp_usrdirPath.addr());
|
||||
|
||||
// TODO: create temporary game directory, set initial PARAM.SFO parameters
|
||||
// cellGameContentPermit should then move files in non-temporary location and return their non-temporary displacement
|
||||
|
|
|
@ -139,10 +139,10 @@ int cellGifDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellGi
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellGifDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellGifDecDataOutInfo> dataOutInfo)
|
||||
int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, const mem_ptr_t<CellGifDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellGifDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
cellGifDec->Warning("cellGifDecDecodeData(mainHandle=0x%x, subHandle=0x%x, data_addr=0x%x, dataCtrlParam_addr=0x%x, dataOutInfo_addr=0x%x)",
|
||||
mainHandle, subHandle, data.GetAddr(), dataCtrlParam.GetAddr(), dataOutInfo.GetAddr());
|
||||
mainHandle, subHandle, data.addr(), dataCtrlParam.GetAddr(), dataOutInfo.GetAddr());
|
||||
|
||||
dataOutInfo->status = CELL_GIFDEC_DEC_STATUS_STOP;
|
||||
|
||||
|
@ -196,12 +196,12 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
{
|
||||
const int dstOffset = i * bytesPerLine;
|
||||
const int srcOffset = width * nComponents * i;
|
||||
memcpy(Memory + (data.GetAddr() + dstOffset), &image.get()[srcOffset], linesize);
|
||||
memcpy(Memory + (data.addr() + dstOffset), &image.get()[srcOffset], linesize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(Memory + data.GetAddr(), image.get(), image_size);
|
||||
memcpy(Memory + data.addr(), image.get(), image_size);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -224,15 +224,15 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
output[j + 2] = image.get()[srcOffset + j + 1];
|
||||
output[j + 3] = image.get()[srcOffset + j + 2];
|
||||
}
|
||||
memcpy(Memory + (data.GetAddr() + dstOffset), output, linesize);
|
||||
memcpy(Memory + (data.addr() + dstOffset), output, linesize);
|
||||
}
|
||||
free(output);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint* dest = (uint*)new char[image_size];
|
||||
uint* img = (uint*)new char[image_size];
|
||||
uint* source_current = (uint*)&(image.get()[0]);
|
||||
uint* dest_current = dest;
|
||||
uint* dest_current = img;
|
||||
for (uint i = 0; i < image_size / nComponents; i++)
|
||||
{
|
||||
uint val = *source_current;
|
||||
|
@ -240,9 +240,8 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
source_current++;
|
||||
dest_current++;
|
||||
}
|
||||
// NOTE: AppendRawBytes has diff side-effect vs Memory.CopyFromReal
|
||||
data.AppendRawBytes((u8*)dest, image_size);
|
||||
delete[] dest;
|
||||
memcpy(data.get_ptr(), img, image_size);
|
||||
delete[] img;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -147,10 +147,10 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellJpgDecInfo
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellJpgDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellJpgDecDataOutInfo> dataOutInfo)
|
||||
int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, const mem_ptr_t<CellJpgDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellJpgDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
cellJpgDec->Log("cellJpgDecDecodeData(mainHandle=0x%x, subHandle=0x%x, data_addr=0x%x, dataCtrlParam_addr=0x%x, dataOutInfo_addr=0x%x)",
|
||||
mainHandle, subHandle, data.GetAddr(), dataCtrlParam.GetAddr(), dataOutInfo.GetAddr());
|
||||
mainHandle, subHandle, data.addr(), dataCtrlParam.GetAddr(), dataOutInfo.GetAddr());
|
||||
|
||||
dataOutInfo->status = CELL_JPGDEC_DEC_STATUS_STOP;
|
||||
CellJpgDecSubHandle* subHandle_data;
|
||||
|
@ -206,12 +206,12 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
{
|
||||
const int dstOffset = i * bytesPerLine;
|
||||
const int srcOffset = width * nComponents * (flip ? height - i - 1 : i);
|
||||
memcpy(Memory + (data.GetAddr() + dstOffset), &image.get()[srcOffset], linesize);
|
||||
memcpy(Memory + (data.addr() + dstOffset), &image.get()[srcOffset], linesize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(Memory + data.GetAddr(), image.get(), image_size);
|
||||
memcpy(Memory + data.addr(), image.get(), image_size);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -236,15 +236,15 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
output[j + 2] = image.get()[srcOffset + j + 1];
|
||||
output[j + 3] = image.get()[srcOffset + j + 2];
|
||||
}
|
||||
memcpy(Memory + (data.GetAddr() + dstOffset), output, linesize);
|
||||
memcpy(Memory + (data.addr() + dstOffset), output, linesize);
|
||||
}
|
||||
free(output);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint* dest = (uint*)new char[image_size];
|
||||
uint* img = (uint*)new char[image_size];
|
||||
uint* source_current = (uint*)&(image.get()[0]);
|
||||
uint* dest_current = dest;
|
||||
uint* dest_current = img;
|
||||
for (uint i = 0; i < image_size / nComponents; i++)
|
||||
{
|
||||
uint val = *source_current;
|
||||
|
@ -252,9 +252,8 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
source_current++;
|
||||
dest_current++;
|
||||
}
|
||||
// NOTE: AppendRawBytes has diff side-effect vs Memory.CopyFromReal
|
||||
data.AppendRawBytes((u8*)dest, image_size);
|
||||
delete[] dest;
|
||||
memcpy(data.get_ptr(), img, image_size);
|
||||
delete[] img;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
//Module cellL10n(0x001e, cellL10n_init);
|
||||
Module *cellL10n = nullptr;
|
||||
|
||||
int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t utf8_len)
|
||||
int UTF16stoUTF8s(vm::ptr<const be_t<u16>> utf16, mem64_t utf16_len, vm::ptr<char> utf8, mem64_t utf8_len)
|
||||
{
|
||||
cellL10n->Warning("UTF16stoUTF8s(utf16_addr=0x%x, utf16_len_addr=0x%x, utf8_addr=0x%x, utf8_len_addr=0x%x)",
|
||||
utf16.GetAddr(), utf16_len.GetAddr(), utf8.GetAddr(), utf8_len.GetAddr());
|
||||
utf16.addr(), utf16_len.GetAddr(), utf8.addr(), utf8_len.GetAddr());
|
||||
|
||||
std::u16string wstr =(char16_t*)Memory.VirtualToRealAddr(utf16.GetAddr());
|
||||
std::u16string wstr =(char16_t*)utf16.get_ptr();
|
||||
wstr.resize(utf16_len.GetValue()); // TODO: Is this really the role of utf16_len in this function?
|
||||
#ifdef _MSC_VER
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert;
|
||||
|
@ -36,14 +36,14 @@ int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t
|
|||
}
|
||||
|
||||
utf8_len = str.size();
|
||||
Memory.WriteString(utf8, str.c_str());
|
||||
Memory.WriteString(utf8.addr(), str);
|
||||
#endif
|
||||
return ConversionOK;
|
||||
}
|
||||
|
||||
int jstrchk(mem8_ptr_t jstr)
|
||||
int jstrchk(vm::ptr<const char> jstr)
|
||||
{
|
||||
cellL10n->Warning("jstrchk(jstr_addr=0x%x) -> utf8", jstr.GetAddr());
|
||||
cellL10n->Warning("jstrchk(jstr_addr=0x%x) -> utf8", jstr.addr());
|
||||
|
||||
return L10N_STR_UTF8;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ int _L10nConvertStr(int src_code, const void *src, size_t * src_len, int dst_cod
|
|||
|
||||
if (target.length() > *dst_len) return DSTExhausted;
|
||||
|
||||
Memory.WriteString(dst, target.c_str());
|
||||
Memory.WriteString(dst.addr(), target);
|
||||
|
||||
return ConversionOK;
|
||||
}
|
||||
|
@ -283,11 +283,11 @@ int _L10nConvertStr(int src_code, const void* src, size_t * src_len, int dst_cod
|
|||
#endif
|
||||
|
||||
//TODO: Check the code in emulation. If support for UTF8/UTF16/UTF32/UCS2/UCS4 should use wider chars.. awful.
|
||||
int L10nConvertStr(int src_code, mem8_ptr_t src, mem64_t src_len, int dst_code, mem8_ptr_t dst, mem64_t dst_len)
|
||||
int L10nConvertStr(int src_code, vm::ptr<const void> src, mem32_t src_len, int dst_code, vm::ptr<void> dst, mem32_t dst_len)
|
||||
{
|
||||
cellL10n->Todo("L10nConvertStr(src_code=%d,src=0x%x,src_len=%ld,dst_code=%d,dst=0x%x,dst_len=%ld)",
|
||||
src_code, src.GetAddr(), src_len.GetValue(), dst_code, dst.GetAddr(), dst_len.GetValue());
|
||||
cellL10n->Todo("L10nConvertStr: 1st char at dst: %x(Hex)", *((char*)Memory.VirtualToRealAddr(src.GetAddr())));
|
||||
src_code, src.addr(), src_len.GetValue(), dst_code, dst.addr(), dst_len.GetValue());
|
||||
cellL10n->Todo("L10nConvertStr: 1st char at dst: %x(Hex)", *((char*)src.get_ptr()));
|
||||
#ifdef _MSC_VER
|
||||
unsigned int srcCode = 0, dstCode = 0; //OEM code pages
|
||||
bool src_page_converted = _L10nCodeParse(src_code, srcCode); //Check if code is in list.
|
||||
|
@ -298,14 +298,14 @@ int L10nConvertStr(int src_code, mem8_ptr_t src, mem64_t src_len, int dst_code,
|
|||
return ConverterUnknown;
|
||||
|
||||
//if (strnlen_s((char*)src, *src_len) != *src_len) return SRCIllegal;
|
||||
std::string wrapped_source = (char*)Memory.VirtualToRealAddr(src.GetAddr());
|
||||
std::string wrapped_source = (char*)src.get_ptr();
|
||||
//std::string wrapped_source((char*)src);
|
||||
if (wrapped_source.length() != src_len.GetValue()) return SRCIllegal;
|
||||
std::string target = _OemToOem(srcCode, dstCode, wrapped_source);
|
||||
|
||||
if (target.length() > dst_len.GetValue()) return DSTExhausted;
|
||||
|
||||
Memory.WriteString(dst, target.c_str());
|
||||
Memory.WriteString(dst.addr(), target);
|
||||
|
||||
return ConversionOK;
|
||||
#else
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/Modules.h"
|
||||
|
||||
#include "Utilities/Log.h"
|
||||
#include "Utilities/rMsgBox.h"
|
||||
#include "Emu/SysCalls/lv2/sys_time.h"
|
||||
#include "cellSysutil.h"
|
||||
|
@ -59,10 +60,10 @@ void MsgDialogClose()
|
|||
g_msg_dialog_wait_until = get_system_time();
|
||||
}
|
||||
|
||||
int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<CellMsgDialogCallback> callback, u32 userData, u32 extParam)
|
||||
int cellMsgDialogOpen2(u32 type, vm::ptr<const char> msgString, mem_func_ptr_t<CellMsgDialogCallback> callback, u32 userData, u32 extParam)
|
||||
{
|
||||
cellSysutil->Warning("cellMsgDialogOpen2(type=0x%x, msgString_addr=0x%x, callback_addr=0x%x, userData=0x%x, extParam=0x%x)",
|
||||
type, msgString.GetAddr(), callback.GetAddr(), userData, extParam);
|
||||
type, msgString.addr(), callback.GetAddr(), userData, extParam);
|
||||
|
||||
//type |= CELL_MSGDIALOG_TYPE_PROGRESSBAR_SINGLE | CELL_MSGDIALOG_TYPE_BG_INVISIBLE;
|
||||
//type |= CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO | CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO;
|
||||
|
@ -82,12 +83,14 @@ int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<Ce
|
|||
default: g_msg_dialog_progress_bar_count = 0; break; // ???
|
||||
}
|
||||
|
||||
thread t("MsgDialog thread", [=]()
|
||||
std::string msg = msgString.get_ptr();
|
||||
|
||||
thread t("MsgDialog thread", [type, msg, callback, userData, extParam]()
|
||||
{
|
||||
switch (type & CELL_MSGDIALOG_TYPE_SE_TYPE)
|
||||
{
|
||||
case CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL: cellSysutil->Warning("Message: \n%s", msgString.GetString()); break;
|
||||
case CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR: cellSysutil->Error("Message: \n%s", msgString.GetString()); break;
|
||||
case CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL: LOG_WARNING(TTY, "%s", msg.c_str()); break;
|
||||
case CELL_MSGDIALOG_TYPE_SE_TYPE_ERROR: LOG_ERROR(TTY, "%s", msg.c_str()); break;
|
||||
}
|
||||
|
||||
switch (type & CELL_MSGDIALOG_TYPE_SE_MUTE) // TODO
|
||||
|
@ -99,9 +102,9 @@ int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<Ce
|
|||
u64 status = CELL_MSGDIALOG_BUTTON_NONE;
|
||||
|
||||
volatile bool m_signal = false;
|
||||
CallAfter([&]()
|
||||
CallAfter([type, msg, &status, &m_signal]()
|
||||
{
|
||||
MsgDialogCreate(type, (char*)msgString.GetPtr(), status);
|
||||
MsgDialogCreate(type, msg.c_str(), status);
|
||||
|
||||
m_signal = true;
|
||||
});
|
||||
|
@ -124,7 +127,7 @@ int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<Ce
|
|||
if (callback && (g_msg_dialog_state != msgDialogAbort))
|
||||
callback.async((s32)status, userData); // TODO: this callback should be registered
|
||||
|
||||
CallAfter([&]()
|
||||
CallAfter([]()
|
||||
{
|
||||
MsgDialogDestroy();
|
||||
});
|
||||
|
@ -136,9 +139,9 @@ int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<Ce
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellMsgDialogOpenErrorCode(u32 errorCode, mem_func_ptr_t<CellMsgDialogCallback> callback, mem_ptr_t<void> userData, u32 extParam)
|
||||
int cellMsgDialogOpenErrorCode(u32 errorCode, mem_func_ptr_t<CellMsgDialogCallback> callback, u32 userData, u32 extParam)
|
||||
{
|
||||
cellSysutil->Warning("cellMsgDialogOpenErrorCode(errorCode=0x%x, callback_addr=0x%x, userData=%d, extParam=%d)",
|
||||
cellSysutil->Warning("cellMsgDialogOpenErrorCode(errorCode=0x%x, callback_addr=0x%x, userData=0x%x, extParam=%d)",
|
||||
errorCode, callback.GetAddr(), userData, extParam);
|
||||
|
||||
std::string errorMessage;
|
||||
|
@ -278,10 +281,10 @@ int cellMsgDialogAbort()
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, mem_list_ptr_t<u8> msgString)
|
||||
int cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, vm::ptr<const char> msgString)
|
||||
{
|
||||
cellSysutil->Warning("cellMsgDialogProgressBarSetMsg(progressBarIndex=%d, msgString_addr=0x%x): '%s'",
|
||||
progressBarIndex, msgString.GetAddr(), msgString.GetString());
|
||||
cellSysutil->Warning("cellMsgDialogProgressBarSetMsg(progressBarIndex=%d, msgString_addr=0x%x ['%s'])",
|
||||
progressBarIndex, msgString.addr(), msgString.get_ptr());
|
||||
|
||||
if (g_msg_dialog_state != msgDialogOpen)
|
||||
{
|
||||
|
@ -293,7 +296,7 @@ int cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, mem_list_ptr_t<u8> msgS
|
|||
return CELL_MSGDIALOG_ERROR_PARAM;
|
||||
}
|
||||
|
||||
std::string text(msgString.GetString());
|
||||
std::string text = msgString.get_ptr();
|
||||
|
||||
CallAfter([text, progressBarIndex]()
|
||||
{
|
||||
|
|
|
@ -81,10 +81,10 @@ enum
|
|||
|
||||
typedef void(*CellMsgDialogCallback)(int buttonType, u32 userData);
|
||||
|
||||
int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<CellMsgDialogCallback> callback, u32 userData, u32 extParam);
|
||||
int cellMsgDialogOpenErrorCode(u32 errorCode, mem_func_ptr_t<CellMsgDialogCallback> callback, mem_ptr_t<void> userData, u32 extParam);
|
||||
int cellMsgDialogOpen2(u32 type, vm::ptr<const char> msgString, mem_func_ptr_t<CellMsgDialogCallback> callback, u32 userData, u32 extParam);
|
||||
int cellMsgDialogOpenErrorCode(u32 errorCode, mem_func_ptr_t<CellMsgDialogCallback> callback, u32 userData, u32 extParam);
|
||||
|
||||
int cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, mem_list_ptr_t<u8> msgString);
|
||||
int cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, vm::ptr<const char> msgString);
|
||||
int cellMsgDialogProgressBarReset(u32 progressBarIndex);
|
||||
int cellMsgDialogProgressBarInc(u32 progressBarIndex, u32 delta);
|
||||
int cellMsgDialogClose(float delay);
|
||||
|
|
|
@ -368,12 +368,13 @@ int cellPamfReaderGetStreamIndex(mem_ptr_t<CellPamfReader> pSelf)
|
|||
return pSelf->stream;
|
||||
}
|
||||
|
||||
int cellPamfReaderGetStreamTypeAndChannel(mem_ptr_t<CellPamfReader> pSelf, mem8_t pType, mem8_t pCh)
|
||||
int cellPamfReaderGetStreamTypeAndChannel(mem_ptr_t<CellPamfReader> pSelf, vm::ptr<u8> pType, vm::ptr<u8> pCh)
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetStreamTypeAndChannel(pSelf=0x%x (stream=%d), pType_addr=0x%x, pCh_addr=0x%x", pSelf.GetAddr(), pSelf->stream, pType.GetAddr(), pCh.GetAddr());
|
||||
cellPamf->Warning("cellPamfReaderGetStreamTypeAndChannel(pSelf=0x%x (stream=%d), pType_addr=0x%x, pCh_addr=0x%x",
|
||||
pSelf.GetAddr(), pSelf->stream, pType.addr(), pCh.addr());
|
||||
|
||||
pType = pamfGetStreamType(pSelf, pSelf->stream);
|
||||
pCh = pamfGetStreamChannel(pSelf, pSelf->stream);
|
||||
*pType = pamfGetStreamType(pSelf, pSelf->stream);
|
||||
*pCh = pamfGetStreamChannel(pSelf, pSelf->stream);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -184,10 +184,10 @@ int cellPngDecExtReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellPngDecI
|
|||
return cellPngDecReadHeader(mainHandle, subHandle, info);
|
||||
}
|
||||
|
||||
int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellPngDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellPngDecDataOutInfo> dataOutInfo)
|
||||
int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, const mem_ptr_t<CellPngDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellPngDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
cellPngDec->Warning("cellPngDecDecodeData(mainHandle=0x%x, subHandle=0x%x, data_addr=0x%x, dataCtrlParam_addr=0x%x, dataOutInfo_addr=0x%x)",
|
||||
mainHandle, subHandle, data.GetAddr(), dataCtrlParam.GetAddr(), dataOutInfo.GetAddr());
|
||||
mainHandle, subHandle, data.addr(), dataCtrlParam.GetAddr(), dataOutInfo.GetAddr());
|
||||
|
||||
dataOutInfo->status = CELL_PNGDEC_DEC_STATUS_STOP;
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
|
@ -241,12 +241,12 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
{
|
||||
const int dstOffset = i * bytesPerLine;
|
||||
const int srcOffset = width * nComponents * (flip ? height - i - 1 : i);
|
||||
memcpy(Memory + (data.GetAddr() + dstOffset), &image.get()[srcOffset], linesize);
|
||||
memcpy(Memory + (data.addr() + dstOffset), &image.get()[srcOffset], linesize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(Memory + data.GetAddr(), image.get(), image_size);
|
||||
memcpy(Memory + data.addr(), image.get(), image_size);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -271,15 +271,15 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
output[j + 2] = image.get()[srcOffset + j + 1];
|
||||
output[j + 3] = image.get()[srcOffset + j + 2];
|
||||
}
|
||||
memcpy(Memory + (data.GetAddr() + dstOffset), output, linesize);
|
||||
memcpy(Memory + (data.addr() + dstOffset), output, linesize);
|
||||
}
|
||||
free(output);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint* dest = (uint*)new char[image_size];
|
||||
uint* img = (uint*)new char[image_size];
|
||||
uint* source_current = (uint*)&(image.get()[0]);
|
||||
uint* dest_current = dest;
|
||||
uint* dest_current = img;
|
||||
for (uint i = 0; i < image_size / nComponents; i++)
|
||||
{
|
||||
uint val = *source_current;
|
||||
|
@ -287,9 +287,8 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
source_current++;
|
||||
dest_current++;
|
||||
}
|
||||
// NOTE: AppendRawBytes has diff side-effect vs Memory.CopyFromReal
|
||||
data.AppendRawBytes((u8*)dest, image_size);
|
||||
delete[] dest;
|
||||
memcpy(data.get_ptr(), img, image_size);
|
||||
delete[] img;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -309,11 +308,11 @@ int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellPngDecExtDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellPngDecDataCtrlParam> dataCtrlParam,
|
||||
int cellPngDecExtDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, const mem_ptr_t<CellPngDecDataCtrlParam> dataCtrlParam,
|
||||
mem_ptr_t<CellPngDecDataOutInfo> dataOutInfo, mem_ptr_t<CellPngDecCbCtrlDisp> cbCtrlDisp, mem_ptr_t<CellPngDecDispParam> dispParam)
|
||||
{
|
||||
cellPngDec->Warning("cellPngDecExtDecodeData(mainHandle=0x%x, subHandle=0x%x, data_addr=0x%x, dataCtrlParam_addr=0x%x, dataOutInfo_addr=0x%x, cbCtrlDisp_addr=0x%x, dispParam=0x%x)",
|
||||
mainHandle, subHandle, data.GetAddr(), dataCtrlParam.GetAddr(), dataOutInfo.GetAddr(), cbCtrlDisp.GetAddr(), dispParam.GetAddr());
|
||||
mainHandle, subHandle, data.addr(), dataCtrlParam.GetAddr(), dataOutInfo.GetAddr(), cbCtrlDisp.GetAddr(), dispParam.GetAddr());
|
||||
|
||||
if (cbCtrlDisp.GetAddr()) cellPngDec->Warning("*** cbCtrlDisp->cbCtrlDispFunc_addr=0x%x", (u32)cbCtrlDisp->cbCtrlDispFunc_addr);
|
||||
|
||||
|
|
|
@ -1136,8 +1136,8 @@ int CreateInterlaceTable(u32 ea_addr, float srcH, float dstH, CellRescTableEleme
|
|||
float bandwidth = 0.5f / (srcH / dstH);
|
||||
float phi_b = 2.f * PI * bandwidth;
|
||||
float window[4];
|
||||
mem16_ptr_t buf16(ea_addr);
|
||||
mem32_ptr_t buf32(ea_addr);
|
||||
auto buf16 = vm::ptr<be_t<u16>>::make(ea_addr);
|
||||
auto buf32 = vm::ptr<be_t<float>>::make(ea_addr);
|
||||
|
||||
blackman(window);
|
||||
|
||||
|
@ -1165,7 +1165,8 @@ int CreateInterlaceTable(u32 ea_addr, float srcH, float dstH, CellRescTableEleme
|
|||
buf16[3] = FloatToHalf(transient[3] / total4);
|
||||
buf16 += 4;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
buf32[0] = transient[0] / total4;
|
||||
buf32[1] = transient[1] / total4;
|
||||
buf32[2] = transient[2] / total4;
|
||||
|
|
|
@ -94,9 +94,9 @@ s64 cellSpursAttributeSetMemoryContainerForSpuThread(mem_ptr_t<CellSpursAttribut
|
|||
#endif
|
||||
}
|
||||
|
||||
s64 cellSpursAttributeSetNamePrefix(mem_ptr_t<CellSpursAttribute> attr, const mem8_t prefix, u32 size)
|
||||
s64 cellSpursAttributeSetNamePrefix(mem_ptr_t<CellSpursAttribute> attr, vm::ptr<const char> prefix, u32 size)
|
||||
{
|
||||
cellSpurs->Warning("cellSpursAttributeSetNamePrefix(attr_addr=0x%x, prefix_addr=0x%x, size=0x%x)", attr.GetAddr(), prefix.GetAddr(), size);
|
||||
cellSpurs->Warning("cellSpursAttributeSetNamePrefix(attr_addr=0x%x, prefix_addr=0x%x, size=0x%x)", attr.GetAddr(), prefix.addr(), size);
|
||||
|
||||
#ifdef PRX_DEBUG
|
||||
return GetCurrentPPUThread().FastCall2(libsre + 0x7234, libsre_rtoc);
|
||||
|
@ -107,7 +107,7 @@ s64 cellSpursAttributeSetNamePrefix(mem_ptr_t<CellSpursAttribute> attr, const me
|
|||
return CELL_SPURS_CORE_ERROR_INVAL;
|
||||
}
|
||||
|
||||
attr->attr->_setNamePrefix(Memory.ReadString(prefix.GetAddr(), size).c_str(), size);
|
||||
attr->attr->_setNamePrefix(prefix.get_ptr(), size);
|
||||
|
||||
return CELL_OK;
|
||||
#endif
|
||||
|
@ -137,10 +137,10 @@ s64 cellSpursAttributeSetSpuThreadGroupType(mem_ptr_t<CellSpursAttribute> attr,
|
|||
#endif
|
||||
}
|
||||
|
||||
s64 cellSpursAttributeEnableSystemWorkload(mem_ptr_t<CellSpursAttribute> attr, mem8_ptr_t priority, u32 maxSpu, mem8_ptr_t isPreemptible)
|
||||
s64 cellSpursAttributeEnableSystemWorkload(mem_ptr_t<CellSpursAttribute> attr, vm::ptr<const u8> priority, u32 maxSpu, vm::ptr<const bool> isPreemptible)
|
||||
{
|
||||
cellSpurs->Warning("cellSpursAttributeEnableSystemWorkload(attr_addr=0x%x, priority_addr=0x%x, maxSpu=%d, isPreemptible_addr=0x%x)",
|
||||
attr.GetAddr(), priority.GetAddr(), maxSpu, isPreemptible.GetAddr());
|
||||
attr.GetAddr(), priority.addr(), maxSpu, isPreemptible.addr());
|
||||
|
||||
#ifdef PRX_DEBUG
|
||||
return GetCurrentPPUThread().FastCall2(libsre + 0xF410, libsre_rtoc);
|
||||
|
@ -201,10 +201,10 @@ s64 cellSpursSetMaxContention(mem_ptr_t<CellSpurs> spurs, u32 workloadId, u32 ma
|
|||
#endif
|
||||
}
|
||||
|
||||
s64 cellSpursSetPriorities(mem_ptr_t<CellSpurs> spurs, u32 workloadId, const mem8_ptr_t priorities)
|
||||
s64 cellSpursSetPriorities(mem_ptr_t<CellSpurs> spurs, u32 workloadId, vm::ptr<const u8> priorities)
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSpurs->Warning("cellSpursSetPriorities(spurs_addr=0x%x, workloadId=%d, priorities_addr=0x%x)", spurs.GetAddr(), workloadId, priorities.GetAddr());
|
||||
cellSpurs->Warning("cellSpursSetPriorities(spurs_addr=0x%x, workloadId=%d, priorities_addr=0x%x)", spurs.GetAddr(), workloadId, priorities.addr());
|
||||
return GetCurrentPPUThread().FastCall2(libsre + 0x8BC0, libsre_rtoc);
|
||||
#else
|
||||
UNIMPLEMENTED_FUNC(cellSpurs);
|
||||
|
@ -212,10 +212,10 @@ s64 cellSpursSetPriorities(mem_ptr_t<CellSpurs> spurs, u32 workloadId, const mem
|
|||
#endif
|
||||
}
|
||||
|
||||
s64 cellSpursSetPreemptionVictimHints(mem_ptr_t<CellSpurs> spurs, mem8_ptr_t isPreemptible)
|
||||
s64 cellSpursSetPreemptionVictimHints(mem_ptr_t<CellSpurs> spurs, vm::ptr<const bool> isPreemptible)
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSpurs->Warning("cellSpursSetPreemptionVictimHints(spurs_addr=0x%x, isPreemptible_addr=0x%x)", spurs.GetAddr(), isPreemptible.GetAddr());
|
||||
cellSpurs->Warning("cellSpursSetPreemptionVictimHints(spurs_addr=0x%x, isPreemptible_addr=0x%x)", spurs.GetAddr(), isPreemptible.addr());
|
||||
return GetCurrentPPUThread().FastCall2(libsre + 0xF5A4, libsre_rtoc);
|
||||
#else
|
||||
UNIMPLEMENTED_FUNC(cellSpurs);
|
||||
|
@ -223,11 +223,11 @@ s64 cellSpursSetPreemptionVictimHints(mem_ptr_t<CellSpurs> spurs, mem8_ptr_t isP
|
|||
#endif
|
||||
}
|
||||
|
||||
s64 cellSpursAttachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u32 queue, mem8_t port, s32 isDynamic)
|
||||
s64 cellSpursAttachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u32 queue, vm::ptr<u8> port, s32 isDynamic)
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
cellSpurs->Warning("cellSpursAttachLv2EventQueue(spurs_addr=0x%x, queue=%d, port_addr=0x%x, isDynamic=%d)",
|
||||
spurs.GetAddr(), queue, port.GetAddr(), isDynamic);
|
||||
spurs.GetAddr(), queue, port.addr(), isDynamic);
|
||||
return GetCurrentPPUThread().FastCall2(libsre + 0xAFE0, libsre_rtoc);
|
||||
#else
|
||||
UNIMPLEMENTED_FUNC(cellSpurs);
|
||||
|
@ -710,10 +710,10 @@ s64 cellSpursCreateTasksetWithAttribute()
|
|||
#endif
|
||||
}
|
||||
|
||||
s64 cellSpursCreateTaskset(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskset> taskset, u64 args, mem8_t priority, u32 maxContention)
|
||||
s64 cellSpursCreateTaskset(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskset> taskset, u64 args, vm::ptr<const u8> priority, u32 maxContention)
|
||||
{
|
||||
cellSpurs->Warning("cellSpursCreateTaskset(spurs_addr=0x%x, taskset_addr=0x%x, args=0x%llx, priority_addr=0x%x, maxContention=%d)",
|
||||
spurs.GetAddr(), taskset.GetAddr(), args, priority.GetAddr(), maxContention);
|
||||
spurs.GetAddr(), taskset.GetAddr(), args, priority.addr(), maxContention);
|
||||
|
||||
#ifdef PRX_DEBUG
|
||||
return GetCurrentPPUThread().FastCall2(libsre + 0x14CB8, libsre_rtoc);
|
||||
|
|
|
@ -2126,30 +2126,30 @@ s32 cellSyncLFQueueGetEntrySize(vm::ptr<CellSyncLFQueue> queue, mem32_t entry_si
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 syncLFQueueAttachLv2EventQueue(mem32_ptr_t spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
|
||||
s32 syncLFQueueAttachLv2EventQueue(vm::ptr<be_t<u32>> spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
|
||||
{
|
||||
// TODO
|
||||
assert(0);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 _cellSyncLFQueueAttachLv2EventQueue(mem32_ptr_t spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
|
||||
s32 _cellSyncLFQueueAttachLv2EventQueue(vm::ptr<be_t<u32>> spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
|
||||
{
|
||||
cellSync->Todo("_cellSyncLFQueueAttachLv2EventQueue(spus_addr=0x%x, num=%d, queue_addr=0x%x)", spus.GetAddr(), num, queue.addr());
|
||||
cellSync->Todo("_cellSyncLFQueueAttachLv2EventQueue(spus_addr=0x%x, num=%d, queue_addr=0x%x)", spus.addr(), num, queue.addr());
|
||||
|
||||
return syncLFQueueAttachLv2EventQueue(spus, num, queue);
|
||||
}
|
||||
|
||||
s32 syncLFQueueDetachLv2EventQueue(mem32_ptr_t spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
|
||||
s32 syncLFQueueDetachLv2EventQueue(vm::ptr<be_t<u32>> spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
|
||||
{
|
||||
// TODO
|
||||
assert(0);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 _cellSyncLFQueueDetachLv2EventQueue(mem32_ptr_t spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
|
||||
s32 _cellSyncLFQueueDetachLv2EventQueue(vm::ptr<be_t<u32>> spus, u32 num, vm::ptr<CellSyncLFQueue> queue)
|
||||
{
|
||||
cellSync->Todo("_cellSyncLFQueueDetachLv2EventQueue(spus_addr=0x%x, num=%d, queue_addr=0x%x)", spus.GetAddr(), num, queue.addr());
|
||||
cellSync->Todo("_cellSyncLFQueueDetachLv2EventQueue(spus_addr=0x%x, num=%d, queue_addr=0x%x)", spus.addr(), num, queue.addr());
|
||||
|
||||
return syncLFQueueDetachLv2EventQueue(spus, num, queue);
|
||||
}
|
||||
|
|
|
@ -112,22 +112,22 @@ int cellSysutilGetSystemParamInt(int id, mem32_t value)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSysutilGetSystemParamString(s32 id, mem_list_ptr_t<u8> buf, u32 bufsize)
|
||||
int cellSysutilGetSystemParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
|
||||
{
|
||||
cellSysutil->Log("cellSysutilGetSystemParamString(id=%d, buf_addr=0x%x, bufsize=%d)", id, buf.GetAddr(), bufsize);
|
||||
cellSysutil->Log("cellSysutilGetSystemParamString(id=%d, buf_addr=0x%x, bufsize=%d)", id, buf.addr(), bufsize);
|
||||
|
||||
memset(buf, 0, bufsize);
|
||||
memset(buf.get_ptr(), 0, bufsize);
|
||||
|
||||
switch(id)
|
||||
{
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME:
|
||||
cellSysutil->Warning("cellSysutilGetSystemParamString: CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME");
|
||||
memcpy(buf, "Unknown", 8); //for example
|
||||
memcpy(buf.get_ptr(), "Unknown", 8); // for example
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME:
|
||||
cellSysutil->Warning("cellSysutilGetSystemParamString: CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME");
|
||||
memcpy(buf, "Unknown", 8);
|
||||
memcpy(buf.get_ptr(), "Unknown", 8);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -807,9 +807,9 @@ int cellSysutilGetBgmPlaybackStatus2(mem_ptr_t<CellSysutilBgmPlaybackStatus2> st
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellWebBrowserEstimate2(mem8_ptr_t _config, mem32_ptr_t memSize)
|
||||
int cellWebBrowserEstimate2(const vm::ptr<const u8> _config, vm::ptr<be_t<u32>> memSize)
|
||||
{
|
||||
cellSysutil->Warning("cellWebBrowserEstimate2(config_addr=0x%x, memSize_addr=0x%x)", _config.GetAddr(), memSize.GetAddr());
|
||||
cellSysutil->Warning("cellWebBrowserEstimate2(config_addr=0x%x, memSize_addr=0x%x)", _config.addr(), memSize.addr());
|
||||
|
||||
// TODO: When cellWebBrowser stuff is implemented, change this to some real
|
||||
// needed memory buffer size.
|
||||
|
@ -817,10 +817,10 @@ int cellWebBrowserEstimate2(mem8_ptr_t _config, mem32_ptr_t memSize)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
extern int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t<u8> dirName, u32 errDialog,
|
||||
extern int cellGameDataCheckCreate2(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
mem_func_ptr_t<void(*)(mem_ptr_t<CellGameDataCBResult> cbResult, mem_ptr_t<CellGameDataStatGet> get, mem_ptr_t<CellGameDataStatSet> set)> funcStat, u32 container);
|
||||
|
||||
extern int cellGameDataCheckCreate(u32 version, const mem_list_ptr_t<u8> dirName, u32 errDialog,
|
||||
extern int cellGameDataCheckCreate(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
mem_func_ptr_t<void(*)(mem_ptr_t<CellGameDataCBResult> cbResult, mem_ptr_t<CellGameDataStatGet> get, mem_ptr_t<CellGameDataStatSet> set)> funcStat, u32 container);
|
||||
|
||||
void cellSysutil_init()
|
||||
|
|
|
@ -236,18 +236,16 @@ int cellFsAioWrite(mem_ptr_t<CellFsAio> aio, mem32_t aio_id, mem_func_ptr_t<void
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsAioInit(mem8_ptr_t mount_point)
|
||||
int cellFsAioInit(vm::ptr<const char> mount_point)
|
||||
{
|
||||
std::string mp = Memory.ReadString(mount_point.GetAddr());
|
||||
sys_fs->Warning("cellFsAioInit(mount_point_addr=0x%x (%s))", mount_point.GetAddr(), mp.c_str());
|
||||
sys_fs->Warning("cellFsAioInit(mount_point_addr=0x%x (%s))", mount_point.addr(), mount_point.get_ptr());
|
||||
aio_init = true;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellFsAioFinish(mem8_ptr_t mount_point)
|
||||
int cellFsAioFinish(vm::ptr<const char> mount_point)
|
||||
{
|
||||
std::string mp = Memory.ReadString(mount_point.GetAddr());
|
||||
sys_fs->Warning("cellFsAioFinish(mount_point_addr=0x%x (%s))", mount_point.GetAddr(), mp.c_str());
|
||||
sys_fs->Warning("cellFsAioFinish(mount_point_addr=0x%x (%s))", mount_point.addr(), mount_point.get_ptr());
|
||||
aio_init = false;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
|
@ -169,11 +169,10 @@ int getsockopt()
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sys_net_inet_addr(mem8_ptr_t cp)
|
||||
int sys_net_inet_addr(vm::ptr<const char> cp)
|
||||
{
|
||||
std::string cp_ = Memory.ReadString(cp.GetAddr());
|
||||
sys_net->Warning("inet_addr(cp=\"%s\")", cp_.c_str());
|
||||
return htonl(inet_addr(cp_.c_str())); // return a big-endian IP address
|
||||
sys_net->Warning("inet_addr(cp_addr=0x%x['%s'])", cp.addr(), cp.get_ptr());
|
||||
return htonl(inet_addr(cp.get_ptr())); // return a big-endian IP address
|
||||
}
|
||||
|
||||
int inet_aton()
|
||||
|
|
|
@ -168,10 +168,10 @@ s32 sys_process_get_number_of_object(u32 object, mem32_t nump)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_size)
|
||||
s32 sys_process_get_id(u32 object, vm::ptr<be_t<u32>> buffer, u32 size, mem32_t set_size)
|
||||
{
|
||||
sys_process.Todo("sys_process_get_id(object=%d, buffer_addr=0x%x, size=%d, set_size_addr=0x%x)",
|
||||
object, buffer.GetAddr(), size, set_size.GetAddr());
|
||||
object, buffer.addr(), size, set_size.GetAddr());
|
||||
|
||||
switch(object)
|
||||
{
|
||||
|
@ -212,9 +212,9 @@ s32 sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_siz
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_process_get_paramsfo(mem8_ptr_t buffer)
|
||||
s32 sys_process_get_paramsfo(vm::ptr<u8> buffer)
|
||||
{
|
||||
sys_process.Todo("sys_process_get_paramsfo(buffer_addr=0x%x) -> CELL_ENOENT", buffer.GetAddr());
|
||||
sys_process.Todo("sys_process_get_paramsfo(buffer_addr=0x%x) -> CELL_ENOENT", buffer.addr());
|
||||
return CELL_ENOENT;
|
||||
|
||||
/*//Before uncommenting this code, we should check if it is actually working.
|
||||
|
|
|
@ -31,8 +31,8 @@ s32 process_get_sdk_version(u32 pid, s32& ver);
|
|||
s32 sys_process_getpid();
|
||||
s32 sys_process_getppid();
|
||||
s32 sys_process_get_number_of_object(u32 object, mem32_t nump);
|
||||
s32 sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_size);
|
||||
s32 sys_process_get_paramsfo(mem8_ptr_t buffer);
|
||||
s32 sys_process_get_id(u32 object, vm::ptr<be_t<u32>> buffer, u32 size, mem32_t set_size);
|
||||
s32 sys_process_get_paramsfo(vm::ptr<u8> buffer);
|
||||
s32 sys_process_get_sdk_version(u32 pid, mem32_t version);
|
||||
s32 sys_process_get_status(u64 unk);
|
||||
s32 sys_process_exit(s32 errorcode);
|
||||
|
|
|
@ -796,10 +796,10 @@ s32 sys_spu_thread_unbind_queue(u32 id, u32 spuq_num)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, mem8_t spup)
|
||||
s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, vm::ptr<u8> spup)
|
||||
{
|
||||
sys_spu.Warning("sys_spu_thread_group_connect_event_all_threads(id=%d, eq_id=%d, req=0x%llx, spup_addr=0x%x)",
|
||||
id, eq_id, req, spup.GetAddr());
|
||||
id, eq_id, req, spup.addr());
|
||||
|
||||
EventQueue* eq;
|
||||
if (!Emu.GetIdManager().GetIDData(eq_id, eq))
|
||||
|
@ -854,7 +854,7 @@ s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, m
|
|||
t->SPUPs[i].eq = eq;
|
||||
}
|
||||
sys_spu.Warning("*** spup -> %d", i);
|
||||
spup = (u8)i;
|
||||
*spup = (u8)i;
|
||||
}
|
||||
|
||||
for (auto& t : threads) t->SPUPs[i].m_mutex.unlock();
|
||||
|
|
|
@ -124,7 +124,7 @@ s32 sys_spu_thread_create(mem32_t thread_id, mem32_t entry, u64 arg, int prio, u
|
|||
s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status);
|
||||
s32 sys_spu_thread_group_connect_event(u32 id, u32 eq, u32 et);
|
||||
s32 sys_spu_thread_group_disconnect_event(u32 id, u32 et);
|
||||
s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, mem8_t spup);
|
||||
s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, vm::ptr<u8> spup);
|
||||
s32 sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup);
|
||||
s32 sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type);
|
||||
s32 sys_spu_thread_read_ls(u32 id, u32 address, mem64_t value, u32 type);
|
||||
|
|
|
@ -26,10 +26,10 @@ s32 sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr)
|
|||
if(ch > 15 || (s32)len <= 0) return CELL_EINVAL;
|
||||
|
||||
if (ch == SYS_TTYP_PPU_STDOUT || ch == SYS_TTYP_SPU_STDOUT || (ch >= SYS_TTYP_USER1 && ch <= SYS_TTYP_USER13)) {
|
||||
LOG_NOTICE(TTY, Memory.ReadString(buf_addr, len));
|
||||
LOG_NOTICE(TTY, "%s", Memory.ReadString(buf_addr, len).c_str());
|
||||
}
|
||||
if (ch == SYS_TTYP_PPU_STDERR) {
|
||||
LOG_ERROR(TTY, Memory.ReadString(buf_addr, len));
|
||||
LOG_ERROR(TTY, "%s", Memory.ReadString(buf_addr, len).c_str());
|
||||
}
|
||||
|
||||
Memory.Write32(pwritelen_addr, len);
|
||||
|
|
|
@ -347,24 +347,24 @@ void Emulator::Load()
|
|||
m_rsx_callback = (u32)Memory.MainMem.AllocAlign(4 * 4) + 4;
|
||||
Memory.Write32(m_rsx_callback - 4, m_rsx_callback);
|
||||
|
||||
mem32_ptr_t callback_data(m_rsx_callback);
|
||||
callback_data += ADDI(11, 0, 0x3ff);
|
||||
callback_data += SC(2);
|
||||
callback_data += BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
auto callback_data = vm::ptr<be_t<u32>>::make(m_rsx_callback);
|
||||
callback_data[0] = ADDI(11, 0, 0x3ff);
|
||||
callback_data[1] = SC(2);
|
||||
callback_data[2] = BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
|
||||
m_ppu_thr_exit = (u32)Memory.MainMem.AllocAlign(4 * 4);
|
||||
|
||||
mem32_ptr_t ppu_thr_exit_data(m_ppu_thr_exit);
|
||||
auto ppu_thr_exit_data = vm::ptr<be_t<u32>>::make(m_ppu_thr_exit);
|
||||
//ppu_thr_exit_data += ADDI(3, 0, 0); // why it kills return value (GPR[3]) ?
|
||||
ppu_thr_exit_data += ADDI(11, 0, 41);
|
||||
ppu_thr_exit_data += SC(2);
|
||||
ppu_thr_exit_data += BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
ppu_thr_exit_data[0] = ADDI(11, 0, 41);
|
||||
ppu_thr_exit_data[1] = SC(2);
|
||||
ppu_thr_exit_data[2] = BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
|
||||
m_ppu_thr_stop = (u32)Memory.MainMem.AllocAlign(2 * 4);
|
||||
|
||||
mem32_ptr_t ppu_thr_stop_data(m_ppu_thr_stop);
|
||||
ppu_thr_stop_data += SC(4);
|
||||
ppu_thr_exit_data += BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
auto ppu_thr_stop_data = vm::ptr<be_t<u32>>::make(m_ppu_thr_stop);
|
||||
ppu_thr_stop_data[0] = SC(4);
|
||||
ppu_thr_exit_data[1] = BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
|
||||
Memory.Write64(Memory.PRXMem.AllocAlign(0x10000), 0xDEADBEEFABADCAFE);
|
||||
}
|
||||
|
|
|
@ -830,7 +830,7 @@ wxString RSXDebugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA
|
|||
}
|
||||
else if(!(cmd & (CELL_GCM_METHOD_FLAG_JUMP | CELL_GCM_METHOD_FLAG_CALL)) && cmd != CELL_GCM_METHOD_FLAG_RETURN)
|
||||
{
|
||||
mem32_ptr_t args(currentAddr + 4);
|
||||
auto args = vm::ptr<be_t<u32>>::make(currentAddr + 4);
|
||||
|
||||
u32 index = 0;
|
||||
switch(cmd & 0x3ffff)
|
||||
|
|
|
@ -464,14 +464,14 @@ bool ELF64Loader::LoadPhdrData(u64 offset)
|
|||
#endif
|
||||
Memory.Write32(stub.s_text + i*4, (u32)tbl + i*8);
|
||||
|
||||
mem32_ptr_t out_tbl((u32)tbl + i*8);
|
||||
out_tbl += (u32)dst + i*section;
|
||||
out_tbl += Emu.GetModuleManager().GetFuncNumById(nid);
|
||||
auto out_tbl = vm::ptr<be_t<u32>>::make((u32)tbl + i * 8);
|
||||
out_tbl[0] = (u32)dst + i*section;
|
||||
out_tbl[1] = Emu.GetModuleManager().GetFuncNumById(nid);
|
||||
|
||||
mem32_ptr_t out_dst((u32)dst + i*section);
|
||||
out_dst += OR(11, 2, 2, 0);
|
||||
out_dst += SC(2);
|
||||
out_dst += BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
auto out_dst = vm::ptr<be_t<u32>>::make((u32)dst + i*section);
|
||||
out_dst[0] = OR(11, 2, 2, 0);
|
||||
out_dst[1] = SC(2);
|
||||
out_dst[2] = BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
#ifdef LOADER_DEBUG
|
||||
|
|
Loading…
Add table
Reference in a new issue