mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
commit
a43e03b549
@ -556,7 +556,6 @@ private:
|
||||
return m_data;
|
||||
}
|
||||
|
||||
public:
|
||||
type ToLE() const
|
||||
{
|
||||
return se_t<type, sizeof(T2)>::from_be(m_data);
|
||||
@ -572,6 +571,7 @@ public:
|
||||
m_data = se_t<type, sizeof(T2)>::to_be(value);
|
||||
}
|
||||
|
||||
public:
|
||||
static be_t MakeFromLE(const type& value)
|
||||
{
|
||||
stype data = se_t<type, sizeof(T2)>::to_be(value);
|
||||
|
@ -656,9 +656,12 @@ namespace fmt
|
||||
enum of any appropriate type in this list
|
||||
|
||||
External specializations (can be found in another headers):
|
||||
vm::ps3::ptr (vm_ptr.h) (of appropriate address type, writing .addr() for printing can be avoided)
|
||||
vm::ps3::ptr (vm_ptr.h) (with appropriate address type, using .addr() can be avoided)
|
||||
vm::ps3::bptr (vm_ptr.h)
|
||||
vm::psv::ptr (vm_ptr.h)
|
||||
vm::ps3::ref (vm_ref.h)
|
||||
vm::ps3::bref (vm_ref.h)
|
||||
vm::psv::ref (vm_ref.h)
|
||||
|
||||
Supported formatting:
|
||||
%d - decimal; only basic std::to_string() functionality
|
||||
|
@ -184,7 +184,7 @@ void decode_x64_reg_op(const u8* code, x64_op_t& decoded_op, x64_reg_t& decoded_
|
||||
}
|
||||
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]);
|
||||
throw fmt::Format("decode_x64_reg_op(%.16llXh): unsupported opcode found (0x%.2X, 0x%.2X, 0x%.2X)", code - decoded_size, op1, code[0], code[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -198,7 +198,7 @@ void _se_translator(unsigned int u, EXCEPTION_POINTERS* pExp)
|
||||
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
|
||||
if (addr - RAW_SPU_BASE_ADDR < (6 * RAW_SPU_OFFSET) && (addr % RAW_SPU_OFFSET) >= RAW_SPU_PROB_OFFSET) // RawSPU MMIO registers
|
||||
{
|
||||
// one x64 instruction is manually decoded and interpreted
|
||||
x64_op_t op;
|
||||
@ -265,15 +265,7 @@ void _se_translator(unsigned int u, EXCEPTION_POINTERS* pExp)
|
||||
// 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);
|
||||
}
|
||||
throw fmt::Format("Access violation %s location 0x%x", is_writing ? "writing" : "reading", addr);
|
||||
}
|
||||
|
||||
// else some fatal error (should crash)
|
||||
@ -296,7 +288,7 @@ void signal_handler(int sig, siginfo_t* info, void* uct)
|
||||
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
|
||||
if (addr - RAW_SPU_BASE_ADDR < (6 * RAW_SPU_OFFSET) && (addr % RAW_SPU_OFFSET) >= RAW_SPU_PROB_OFFSET) // RawSPU MMIO registers
|
||||
{
|
||||
// one x64 instruction is manually decoded and interpreted
|
||||
x64_op_t op;
|
||||
@ -363,15 +355,7 @@ void signal_handler(int sig, siginfo_t* info, void* uct)
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
throw fmt::Format("Access violation %s location 0x%x", /*is_writing ? "writing" : "reading"*/ "at", addr);
|
||||
}
|
||||
|
||||
// else some fatal error
|
||||
|
@ -67,5 +67,5 @@ public:
|
||||
void WriteHeader();
|
||||
size_t WriteData(const void* buffer, size_t size);
|
||||
void Finalize();
|
||||
const u8 GetCh() const { return (u8)m_header.FMT.NumChannels; }
|
||||
const u16 GetCh() const { return m_header.FMT.NumChannels; }
|
||||
};
|
||||
|
@ -310,12 +310,14 @@ void CPUThread::Task()
|
||||
}
|
||||
catch (const std::string& e)
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Exception: %s", e.c_str());
|
||||
LOG_ERROR(GENERAL, "Exception: %s (is_alive=%d, m_last_syscall=0x%llx (%s))", e, IsAlive(), m_last_syscall, SysCalls::GetHLEFuncName((u32)m_last_syscall));
|
||||
LOG_NOTICE(GENERAL, RegsToString());
|
||||
Emu.Pause();
|
||||
}
|
||||
catch (const char* e)
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Exception: %s", e);
|
||||
LOG_ERROR(GENERAL, "Exception: %s (is_alive=%d, m_last_syscall=0x%llx (%s))", e, IsAlive(), m_last_syscall, SysCalls::GetHLEFuncName((u32)m_last_syscall));
|
||||
LOG_NOTICE(GENERAL, RegsToString());
|
||||
Emu.Pause();
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -189,7 +189,7 @@ int FPRdouble::Cmp(PPCdouble a, PPCdouble b)
|
||||
|
||||
u64 PPUThread::GetStackArg(s32 i)
|
||||
{
|
||||
return vm::read64(GPR[1] + 0x70 + 0x8 * (i - 9));
|
||||
return vm::read64(vm::cast(GPR[1] + 0x70 + 0x8 * (i - 9)));
|
||||
}
|
||||
|
||||
u64 PPUThread::FastCall2(u32 addr, u32 rtoc)
|
||||
|
@ -40,6 +40,56 @@ namespace vm
|
||||
return *get_ptr<T>(addr);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct cast_ptr
|
||||
{
|
||||
static_assert(std::is_same<T, u32>::value, "Unsupported vm::cast() type");
|
||||
|
||||
__forceinline static u32 cast(const T& addr, const char* func)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_ptr<u32>
|
||||
{
|
||||
__forceinline static u32 cast(const u32 addr, const char* func)
|
||||
{
|
||||
return addr;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct cast_ptr<u64>
|
||||
{
|
||||
__forceinline static u32 cast(const u64 addr, const char* func)
|
||||
{
|
||||
const u32 res = (u32)addr;
|
||||
if (res != addr)
|
||||
{
|
||||
throw fmt::Format("%s(): invalid address 0x%llx", func, addr);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, typename T2>
|
||||
struct cast_ptr<be_t<T, T2>>
|
||||
{
|
||||
__forceinline static u32 cast(const be_t<T, T2>& addr, const char* func)
|
||||
{
|
||||
return cast_ptr<T>::cast(addr.value(), func);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
__forceinline static u32 cast(const T& addr, const char* func = "vm::cast")
|
||||
{
|
||||
return cast_ptr<T>::cast(addr, func);
|
||||
}
|
||||
|
||||
namespace ps3
|
||||
{
|
||||
void init();
|
||||
|
@ -11,49 +11,50 @@ namespace vm
|
||||
|
||||
public:
|
||||
typedef typename std::remove_cv<T>::type type;
|
||||
static const u32 address_size = (u32)sizeof(AT);
|
||||
|
||||
_ptr_base operator++ (int)
|
||||
{
|
||||
AT result = m_addr;
|
||||
m_addr += sizeof(AT);
|
||||
m_addr += address_size;
|
||||
return make(result);
|
||||
}
|
||||
|
||||
_ptr_base& operator++ ()
|
||||
{
|
||||
m_addr += sizeof(AT);
|
||||
m_addr += address_size;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_ptr_base operator-- (int)
|
||||
{
|
||||
AT result = m_addr;
|
||||
m_addr -= sizeof(AT);
|
||||
m_addr -= address_size;
|
||||
return make(result);
|
||||
}
|
||||
|
||||
_ptr_base& operator-- ()
|
||||
{
|
||||
m_addr -= sizeof(AT);
|
||||
m_addr -= address_size;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_ptr_base& operator += (AT count)
|
||||
{
|
||||
m_addr += count * sizeof(AT);
|
||||
m_addr += count * address_size;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_ptr_base& operator -= (AT count)
|
||||
{
|
||||
m_addr -= count * sizeof(AT);
|
||||
m_addr -= count * address_size;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_ptr_base operator + (typename remove_be_t<AT>::type count) const { return make(m_addr + count * sizeof(AT)); }
|
||||
_ptr_base operator + (typename to_be_t<AT>::type count) const { return make(m_addr + count * sizeof(AT)); }
|
||||
_ptr_base operator - (typename remove_be_t<AT>::type count) const { return make(m_addr - count * sizeof(AT)); }
|
||||
_ptr_base operator - (typename to_be_t<AT>::type count) const { return make(m_addr - count * sizeof(AT)); }
|
||||
_ptr_base operator + (typename remove_be_t<AT>::type count) const { return make(m_addr + count * address_size); }
|
||||
_ptr_base operator + (typename to_be_t<AT>::type count) const { return make(m_addr + count * address_size); }
|
||||
_ptr_base operator - (typename remove_be_t<AT>::type count) const { return make(m_addr - count * address_size); }
|
||||
_ptr_base operator - (typename to_be_t<AT>::type count) const { return make(m_addr - count * address_size); }
|
||||
|
||||
__forceinline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; }
|
||||
__forceinline bool operator <=(const _ptr_base& right) const { return m_addr <= right.m_addr; }
|
||||
@ -67,12 +68,12 @@ namespace vm
|
||||
|
||||
__forceinline _ptr_base<T, lvl - 1, std::conditional<is_be_t<T>::value, typename to_be_t<AT>::type, AT>>& operator *() const
|
||||
{
|
||||
return vm::get_ref<_ptr_base<T, lvl - 1, std::conditional<is_be_t<T>::value, typename to_be_t<AT>::type, AT>>>((u32)m_addr);
|
||||
return vm::get_ref<_ptr_base<T, lvl - 1, std::conditional<is_be_t<T>::value, typename to_be_t<AT>::type, AT>>>(vm::cast(m_addr));
|
||||
}
|
||||
|
||||
__forceinline _ptr_base<T, lvl - 1, std::conditional<is_be_t<T>::value, typename to_be_t<AT>::type, AT>>& operator [](AT index) const
|
||||
{
|
||||
return vm::get_ref<_ptr_base<T, lvl - 1, std::conditional<is_be_t<T>::value, typename to_be_t<AT>::type, AT>>>((u32)(m_addr + sizeof(AT)* index));
|
||||
return vm::get_ref<_ptr_base<T, lvl - 1, std::conditional<is_be_t<T>::value, typename to_be_t<AT>::type, AT>>>(vm::cast(m_addr + sizeof(AT)* index));
|
||||
}
|
||||
|
||||
//typedef typename invert_be_t<AT>::type AT2;
|
||||
@ -109,68 +110,69 @@ namespace vm
|
||||
|
||||
public:
|
||||
typedef typename std::remove_cv<T>::type type;
|
||||
static const u32 data_size = (u32)sizeof(T);
|
||||
|
||||
__forceinline T* const operator -> () const
|
||||
{
|
||||
return vm::get_ptr<T>((u32)m_addr);
|
||||
return vm::get_ptr<T>(vm::cast(m_addr));
|
||||
}
|
||||
|
||||
_ptr_base operator++ (int)
|
||||
{
|
||||
AT result = m_addr;
|
||||
m_addr += sizeof(T);
|
||||
m_addr += data_size;
|
||||
return make(result);
|
||||
}
|
||||
|
||||
_ptr_base& operator++ ()
|
||||
{
|
||||
m_addr += sizeof(T);
|
||||
m_addr += data_size;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_ptr_base operator-- (int)
|
||||
{
|
||||
AT result = m_addr;
|
||||
m_addr -= sizeof(T);
|
||||
m_addr -= data_size;
|
||||
return make(result);
|
||||
}
|
||||
|
||||
_ptr_base& operator-- ()
|
||||
{
|
||||
m_addr -= sizeof(T);
|
||||
m_addr -= data_size;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_ptr_base& operator += (AT count)
|
||||
{
|
||||
m_addr += count * sizeof(T);
|
||||
m_addr += count * data_size;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_ptr_base& operator -= (AT count)
|
||||
{
|
||||
m_addr -= count * sizeof(T);
|
||||
m_addr -= count * data_size;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_ptr_base operator + (typename remove_be_t<AT>::type count) const { return make(m_addr + count * sizeof(T)); }
|
||||
_ptr_base operator + (typename to_be_t<AT>::type count) const { return make(m_addr + count * sizeof(T)); }
|
||||
_ptr_base operator - (typename remove_be_t<AT>::type count) const { return make(m_addr - count * sizeof(T)); }
|
||||
_ptr_base operator - (typename to_be_t<AT>::type count) const { return make(m_addr - count * sizeof(T)); }
|
||||
_ptr_base operator + (typename remove_be_t<AT>::type count) const { return make(m_addr + count * data_size); }
|
||||
_ptr_base operator + (typename to_be_t<AT>::type count) const { return make(m_addr + count * data_size); }
|
||||
_ptr_base operator - (typename remove_be_t<AT>::type count) const { return make(m_addr - count * data_size); }
|
||||
_ptr_base operator - (typename to_be_t<AT>::type count) const { return make(m_addr - count * data_size); }
|
||||
|
||||
__forceinline T& operator *() const
|
||||
{
|
||||
return vm::get_ref<T>((u32)m_addr);
|
||||
return vm::get_ref<T>(vm::cast(m_addr));
|
||||
}
|
||||
|
||||
__forceinline T& operator [](typename remove_be_t<AT>::type index) const
|
||||
{
|
||||
return vm::get_ref<T>((u32)(m_addr + sizeof(T) * index));
|
||||
return vm::get_ref<T>(vm::cast(m_addr + data_size * index));
|
||||
}
|
||||
|
||||
__forceinline T& operator [](typename to_be_t<AT>::forced_type index) const
|
||||
{
|
||||
return vm::get_ref<T>((u32)(m_addr + sizeof(T)* index));
|
||||
return vm::get_ref<T>(vm::cast(m_addr + data_size * index));
|
||||
}
|
||||
|
||||
__forceinline bool operator <(const _ptr_base& right) const { return m_addr < right.m_addr; }
|
||||
@ -224,7 +226,7 @@ namespace vm
|
||||
|
||||
T* get_ptr() const
|
||||
{
|
||||
return vm::get_ptr<T>((u32)m_addr);
|
||||
return vm::get_ptr<T>(vm::cast(m_addr));
|
||||
}
|
||||
|
||||
static _ptr_base make(AT addr)
|
||||
@ -253,7 +255,7 @@ namespace vm
|
||||
|
||||
void* get_ptr() const
|
||||
{
|
||||
return vm::get_ptr<void>((u32)m_addr);
|
||||
return vm::get_ptr<void>(vm::cast(m_addr));
|
||||
}
|
||||
|
||||
explicit operator void*() const
|
||||
@ -313,7 +315,7 @@ namespace vm
|
||||
|
||||
const void* get_ptr() const
|
||||
{
|
||||
return vm::get_ptr<const void>((u32)m_addr);
|
||||
return vm::get_ptr<const void>(vm::cast(m_addr));
|
||||
}
|
||||
|
||||
explicit operator const void*() const
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "Emu/SysCalls/CB_FUNC.h"
|
||||
#include "Emu/SysCalls/lv2/sys_time.h"
|
||||
|
||||
#define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count, args.addr()) : args[x].ToLE())
|
||||
#define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count, args.addr()) : args[x].value())
|
||||
#define CMD_DEBUG 0
|
||||
|
||||
u32 methodRegisters[0xffff];
|
||||
|
@ -165,8 +165,9 @@ namespace vm
|
||||
template<typename AT, typename RT, typename... T>
|
||||
__forceinline RT _ptr_base<RT(*)(T...), 1, AT>::operator()(CPUThread& CPU, T... args) const
|
||||
{
|
||||
const u32 pc = vm::get_ref<be_t<u32>>((u32)m_addr);
|
||||
const u32 rtoc = vm::get_ref<be_t<u32>>((u32)m_addr + 4);
|
||||
auto data = vm::get_ptr<be_t<u32>>(vm::cast(m_addr));
|
||||
const u32 pc = data[0];
|
||||
const u32 rtoc = data[1];
|
||||
|
||||
assert(CPU.GetType() == CPU_THREAD_PPU);
|
||||
return cb_detail::_func_caller<RT, T...>::call(static_cast<PPUThread&>(CPU), pc, rtoc, args...);
|
||||
|
@ -617,7 +617,7 @@ int cellAdecStartSeq(u32 handle, u32 param_addr)
|
||||
{
|
||||
auto param = vm::ptr<const CellAdecParamMP3>::make(param_addr);
|
||||
|
||||
cellAdec->Todo("*** CellAdecParamMP3: bw_pcm=%d", param->bw_pcm.ToLE());
|
||||
cellAdec->Todo("*** CellAdecParamMP3: bw_pcm=%d", param->bw_pcm);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -356,7 +356,7 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (code.ToLE())
|
||||
switch (code.value())
|
||||
{
|
||||
case PACK_START_CODE:
|
||||
{
|
||||
@ -387,9 +387,9 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
stream.skip(4);
|
||||
stream.get(len);
|
||||
|
||||
if (!stream.check(len.ToLE()))
|
||||
if (!stream.check(len))
|
||||
{
|
||||
DMUX_ERROR("End of stream (PADDING_STREAM, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of stream (PADDING_STREAM, len=%d)", len);
|
||||
}
|
||||
stream.skip(len);
|
||||
break;
|
||||
@ -404,11 +404,11 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
stream.skip(4);
|
||||
stream.get(len);
|
||||
|
||||
cellDmux->Notice("PRIVATE_STREAM_2 (%d)", len.ToLE());
|
||||
cellDmux->Notice("PRIVATE_STREAM_2 (%d)", len);
|
||||
|
||||
if (!stream.check(len.ToLE()))
|
||||
if (!stream.check(len))
|
||||
{
|
||||
DMUX_ERROR("End of stream (PRIVATE_STREAM_2, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of stream (PRIVATE_STREAM_2, len=%d)", len);
|
||||
}
|
||||
stream.skip(len);
|
||||
break;
|
||||
@ -426,20 +426,20 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
stream.skip(4);
|
||||
stream.get(len);
|
||||
|
||||
if (!stream.check(len.ToLE()))
|
||||
if (!stream.check(len))
|
||||
{
|
||||
DMUX_ERROR("End of stream (PRIVATE_STREAM_1, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of stream (PRIVATE_STREAM_1, len=%d)", len);
|
||||
}
|
||||
|
||||
const PesHeader pes(stream);
|
||||
if (!pes.is_ok)
|
||||
{
|
||||
DMUX_ERROR("PesHeader error (PRIVATE_STREAM_1, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("PesHeader error (PRIVATE_STREAM_1, len=%d)", len);
|
||||
}
|
||||
|
||||
if (len < pes.size + 4)
|
||||
{
|
||||
DMUX_ERROR("End of block (PRIVATE_STREAM_1, PesHeader + fid_minor, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of block (PRIVATE_STREAM_1, PesHeader + fid_minor, len=%d)", len);
|
||||
}
|
||||
len -= pes.size + 4;
|
||||
|
||||
@ -462,7 +462,7 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
|
||||
if (len < 3 || !stream.check(3))
|
||||
{
|
||||
DMUX_ERROR("End of block (ATX, unknown header, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of block (ATX, unknown header, len=%d)", len);
|
||||
}
|
||||
len -= 3;
|
||||
stream.skip(3);
|
||||
@ -484,7 +484,7 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
|
||||
if (data[0] != 0x0f || data[1] != 0xd0)
|
||||
{
|
||||
DMUX_ERROR("ATX: 0x0fd0 header not found (ats=0x%llx)", ((be_t<u64>*)data)->ToLE());
|
||||
DMUX_ERROR("ATX: 0x0fd0 header not found (ats=0x%llx)", *(be_t<u64>*)data);
|
||||
}
|
||||
|
||||
u32 frame_size = ((((u32)data[2] & 0x3) << 8) | (u32)data[3]) * 8 + 8;
|
||||
@ -495,7 +495,7 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
|
||||
es.push_au(frame_size + 8, es.last_dts, es.last_pts, stream.userdata, false /* TODO: set correct value */, 0);
|
||||
|
||||
//cellDmux->Notice("ATX AU pushed (ats=0x%llx, frame_size=%d)", ((be_t<u64>*)data)->ToLE(), frame_size);
|
||||
//cellDmux->Notice("ATX AU pushed (ats=0x%llx, frame_size=%d)", *(be_t<u64>*)data, frame_size);
|
||||
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(dmux.memAddr + (cb_add ^= 16));
|
||||
esMsg->msgType = CELL_DMUX_ES_MSG_TYPE_AU_FOUND;
|
||||
@ -505,7 +505,7 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
}
|
||||
else
|
||||
{
|
||||
cellDmux->Notice("PRIVATE_STREAM_1 (len=%d, fid_minor=0x%x)", len.ToLE(), fid_minor);
|
||||
cellDmux->Notice("PRIVATE_STREAM_1 (len=%d, fid_minor=0x%x)", len, fid_minor);
|
||||
stream.skip(len);
|
||||
}
|
||||
break;
|
||||
@ -521,29 +521,29 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
|
||||
if (!stream.check(6))
|
||||
{
|
||||
DMUX_ERROR("End of stream (video, code=0x%x)", code.ToLE());
|
||||
DMUX_ERROR("End of stream (video, code=0x%x)", code);
|
||||
}
|
||||
stream.skip(4);
|
||||
stream.get(len);
|
||||
|
||||
if (!stream.check(len.ToLE()))
|
||||
if (!stream.check(len))
|
||||
{
|
||||
DMUX_ERROR("End of stream (video, code=0x%x, len=%d)", code.ToLE(), len.ToLE());
|
||||
DMUX_ERROR("End of stream (video, code=0x%x, len=%d)", code, len);
|
||||
}
|
||||
|
||||
const PesHeader pes(stream);
|
||||
if (!pes.is_ok)
|
||||
{
|
||||
DMUX_ERROR("PesHeader error (video, code=0x%x, len=%d)", code.ToLE(), len.ToLE());
|
||||
DMUX_ERROR("PesHeader error (video, code=0x%x, len=%d)", code, len);
|
||||
}
|
||||
|
||||
if (len < pes.size + 3)
|
||||
{
|
||||
DMUX_ERROR("End of block (video, code=0x%x, PesHeader)", code.ToLE());
|
||||
DMUX_ERROR("End of block (video, code=0x%x, PesHeader)", code);
|
||||
}
|
||||
len -= pes.size + 3;
|
||||
|
||||
const u32 ch = code.ToLE() % 16;
|
||||
const u32 ch = code % 16;
|
||||
if (esAVC[ch])
|
||||
{
|
||||
ElementaryStream& es = *esAVC[ch];
|
||||
@ -576,13 +576,13 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
}
|
||||
|
||||
// reconstruction of MPEG2-PS stream for vdec module
|
||||
const u32 size = (u32)len.ToLE() + pes.size + 9;
|
||||
const u32 size = len + pes.size + 9;
|
||||
stream = backup;
|
||||
es.push(stream, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
cellDmux->Notice("Video stream (code=0x%x, len=%d)", code.ToLE(), len.ToLE());
|
||||
cellDmux->Notice("Video stream (code=0x%x, len=%d)", code, len);
|
||||
stream.skip(len);
|
||||
}
|
||||
break;
|
||||
@ -590,9 +590,9 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
||||
|
||||
default:
|
||||
{
|
||||
if ((code.ToLE() & PACKET_START_CODE_MASK) == PACKET_START_CODE_PREFIX)
|
||||
if ((code & PACKET_START_CODE_MASK) == PACKET_START_CODE_PREFIX)
|
||||
{
|
||||
DMUX_ERROR("Unknown code found (0x%x)", code.ToLE());
|
||||
DMUX_ERROR("Unknown code found (0x%x)", code);
|
||||
}
|
||||
|
||||
// search
|
||||
@ -1000,7 +1000,7 @@ int cellDmuxEnableEs(u32 demuxerHandle, vm::ptr<const CellCodecEsFilterId> esFil
|
||||
*esHandle = id;
|
||||
|
||||
cellDmux->Warning("*** New ES(dmux=%d, addr=0x%x, size=0x%x, filter(0x%x, 0x%x, 0x%x, 0x%x), cb=0x%x(arg=0x%x), spec=0x%x): id = %d",
|
||||
demuxerHandle, es->memAddr, es->memSize, es->fidMajor, es->fidMinor, es->sup1, es->sup2, esCb->cbEsMsgFunc.addr().ToLE(), es->cbArg, es->spec, id);
|
||||
demuxerHandle, es->memAddr, es->memSize, es->fidMajor, es->fidMinor, es->sup1, es->sup2, esCb->cbEsMsgFunc, es->cbArg, es->spec, id);
|
||||
|
||||
DemuxerTask task(dmuxEnableEs);
|
||||
task.es.es = id;
|
||||
|
@ -20,7 +20,7 @@ int cellFontInitializeWithRevision(u64 revisionFlags, vm::ptr<CellFontConfig> co
|
||||
if (config->FileCache.size < 24)
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (config->flags != 0)
|
||||
cellFont->Warning("cellFontInitializeWithRevision: Unknown flags (0x%x)", config->flags.ToLE());
|
||||
cellFont->Warning("cellFontInitializeWithRevision: Unknown flags (0x%x)", config->flags);
|
||||
|
||||
s_fontInternalInstance->m_buffer_addr = config->FileCache.buffer_addr;
|
||||
s_fontInternalInstance->m_buffer_size = config->FileCache.size;
|
||||
@ -168,12 +168,12 @@ int cellFontOpenFontset(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::pt
|
||||
case CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_YG_DFHEI5_RSANS2_SET:
|
||||
case CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_YG_DFHEI5_VAGR2_SET:
|
||||
case CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_VAGR2_SET:
|
||||
cellFont->Warning("cellFontOpenFontset: fontType->type = %d not supported yet. RD-R-LATIN.TTF will be used instead.", fontType->type.ToLE());
|
||||
cellFont->Warning("cellFontOpenFontset: fontType->type = %d not supported yet. RD-R-LATIN.TTF will be used instead.", fontType->type);
|
||||
file = "/dev_flash/data/font/SCE-PS3-RD-R-LATIN.TTF";
|
||||
break;
|
||||
|
||||
default:
|
||||
cellFont->Warning("cellFontOpenFontset: fontType->type = %d not supported.", fontType->type.ToLE());
|
||||
cellFont->Warning("cellFontOpenFontset: fontType->type = %d not supported.", fontType->type);
|
||||
return CELL_FONT_ERROR_NO_SUPPORT_FONTSET;
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ int cellGameDataCheckCreate2(PPUThread& CPU, u32 version, vm::ptr<const char> di
|
||||
if (cbSet->setParam)
|
||||
{
|
||||
// TODO: write PARAM.SFO from cbSet
|
||||
cellGame->Todo("cellGameDataCheckCreate(2)(): writing PARAM.SFO parameters (addr=0x%x)", cbSet->setParam.addr().ToLE());
|
||||
cellGame->Todo("cellGameDataCheckCreate(2)(): writing PARAM.SFO parameters (addr=0x%x)", cbSet->setParam);
|
||||
}
|
||||
|
||||
switch ((s32)cbResult->result)
|
||||
|
@ -33,14 +33,14 @@ int cellGifDecOpen(u32 mainHandle, vm::ptr<u32> subHandle, vm::ptr<CellGifDecSrc
|
||||
switch(src->srcSelect.data())
|
||||
{
|
||||
case se32(CELL_GIFDEC_BUFFER):
|
||||
current_subHandle->fileSize = src->streamSize.ToLE();
|
||||
current_subHandle->fileSize = src->streamSize;
|
||||
break;
|
||||
|
||||
case se32(CELL_GIFDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
current_subHandle->fd = fd->ToLE();
|
||||
current_subHandle->fd = fd.value();
|
||||
if (ret != CELL_OK) return CELL_GIFDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
|
@ -39,14 +39,14 @@ int cellJpgDecOpen(u32 mainHandle, vm::ptr<u32> subHandle, vm::ptr<CellJpgDecSrc
|
||||
switch(src->srcSelect.data())
|
||||
{
|
||||
case se32(CELL_JPGDEC_BUFFER):
|
||||
current_subHandle->fileSize = src->streamSize.ToLE();
|
||||
current_subHandle->fileSize = src->streamSize;
|
||||
break;
|
||||
|
||||
case se32(CELL_JPGDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
current_subHandle->fd = fd->ToLE();
|
||||
current_subHandle->fd = fd.value();
|
||||
if (ret != CELL_OK) return CELL_JPGDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
@ -261,7 +261,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::pt
|
||||
case CELL_JPG_UPSAMPLE_ONLY:
|
||||
case CELL_JPG_GRAYSCALE_TO_ALPHA_RGBA:
|
||||
case CELL_JPG_GRAYSCALE_TO_ALPHA_ARGB:
|
||||
cellJpgDec->Error("cellJpgDecDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
cellJpgDec->Error("cellJpgDecDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -80,14 +80,14 @@ s64 pngDecOpen(
|
||||
switch (src->srcSelect.data())
|
||||
{
|
||||
case se32(CELL_PNGDEC_BUFFER):
|
||||
stream->fileSize = src->streamSize.ToLE();
|
||||
stream->fileSize = src->streamSize;
|
||||
break;
|
||||
|
||||
case se32(CELL_PNGDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
stream->fd = fd->ToLE();
|
||||
stream->fd = fd.value();
|
||||
if (ret != CELL_OK) return CELL_PNGDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
@ -223,7 +223,7 @@ s64 pngDecSetParameter(
|
||||
current_outParam.outputComponents = 4; break;
|
||||
|
||||
default:
|
||||
cellPngDec->Error("pngDecSetParameter: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
cellPngDec->Error("pngDecSetParameter: Unsupported color space (%d)", current_outParam.outputColorSpace);
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
}
|
||||
|
||||
@ -352,11 +352,11 @@ s64 pngDecodeData(
|
||||
case se32(CELL_PNGDEC_GRAYSCALE):
|
||||
case se32(CELL_PNGDEC_PALETTE):
|
||||
case se32(CELL_PNGDEC_GRAYSCALE_ALPHA):
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace);
|
||||
break;
|
||||
|
||||
default:
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace);
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
}
|
||||
|
||||
|
@ -970,11 +970,11 @@ int cellRescSetSrc(s32 idx, vm::ptr<CellRescSrc> src)
|
||||
return CELL_RESC_ERROR_BAD_ARGUMENT;
|
||||
}
|
||||
|
||||
cellResc->Log(" *** format=0x%x", src->format.ToLE());
|
||||
cellResc->Log(" *** pitch=%d", src->pitch.ToLE());
|
||||
cellResc->Log(" *** width=%d", src->width.ToLE());
|
||||
cellResc->Log(" *** height=%d", src->height.ToLE());
|
||||
cellResc->Log(" *** offset=0x%x", src->offset.ToLE());
|
||||
cellResc->Log(" *** format=0x%x", src->format);
|
||||
cellResc->Log(" *** pitch=%d", src->pitch);
|
||||
cellResc->Log(" *** width=%d", src->width);
|
||||
cellResc->Log(" *** height=%d", src->height);
|
||||
cellResc->Log(" *** offset=0x%x", src->offset);
|
||||
|
||||
s_rescInternalInstance->m_rescSrc[idx] = *src;
|
||||
|
||||
@ -1054,7 +1054,7 @@ int cellRescSetBufferAddress(vm::ptr<u32> colorBuffers, vm::ptr<u32> vertexArray
|
||||
|
||||
for (int i=0; i<GetNumColorBuffers(); i++)
|
||||
{
|
||||
s_rescInternalInstance->m_dstOffsets[i] = dstOffset->ToLE() + i * s_rescInternalInstance->m_dstBufInterval;
|
||||
s_rescInternalInstance->m_dstOffsets[i] = dstOffset.value() + i * s_rescInternalInstance->m_dstBufInterval;
|
||||
}
|
||||
|
||||
for (int i=0; i<GetNumColorBuffers(); i++)
|
||||
|
@ -163,7 +163,7 @@ int cellRtcGetTick(vm::ptr<CellRtcDateTime> pTime, vm::ptr<CellRtcTick> pTick)
|
||||
{
|
||||
cellRtc->Log("cellRtcGetTick(pTime=0x%x, pTick=0x%x)", pTime.addr(), pTick.addr());
|
||||
|
||||
rDateTime datetime = rDateTime(pTime->day, (rDateTime::Month)pTime->month.ToLE(), pTime->year, pTime->hour, pTime->minute, pTime->second, (pTime->microsecond / 1000));
|
||||
rDateTime datetime = rDateTime(pTime->day, (rDateTime::Month)pTime->month.value(), pTime->year, pTime->hour, pTime->minute, pTime->second, (pTime->microsecond / 1000));
|
||||
pTick->tick = datetime.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
@ -315,7 +315,7 @@ int cellRtcGetDosTime(vm::ptr<CellRtcDateTime> pDateTime, vm::ptr<u32> puiDosTim
|
||||
cellRtc->Log("cellRtcGetDosTime(pDateTime=0x%x, puiDosTime=0x%x)", pDateTime.addr(), puiDosTime.addr());
|
||||
|
||||
// Convert to DOS time.
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.value(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
*puiDosTime = date_time.GetAsDOS();
|
||||
|
||||
return CELL_OK;
|
||||
@ -326,7 +326,7 @@ int cellRtcGetTime_t(vm::ptr<CellRtcDateTime> pDateTime, vm::ptr<s64> piTime)
|
||||
cellRtc->Log("cellRtcGetTime_t(pDateTime=0x%x, piTime=0x%x)", pDateTime.addr(), piTime.addr());
|
||||
|
||||
// Convert to POSIX time_t.
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.value(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
*piTime = convertToUNIXTime(date_time.GetSecond(rDateTime::TZ::UTC), date_time.GetMinute(rDateTime::TZ::UTC),
|
||||
date_time.GetHour(rDateTime::TZ::UTC), date_time.GetDay(rDateTime::TZ::UTC), date_time.GetYear(rDateTime::TZ::UTC));
|
||||
|
||||
@ -338,7 +338,7 @@ int cellRtcGetWin32FileTime(vm::ptr<CellRtcDateTime> pDateTime, vm::ptr<u64> pul
|
||||
cellRtc->Log("cellRtcGetWin32FileTime(pDateTime=0x%x, pulWin32FileTime=0x%x)", pDateTime.addr(), pulWin32FileTime.addr());
|
||||
|
||||
// Convert to WIN32 FILETIME.
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.value(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
*pulWin32FileTime = convertToWin32FILETIME(date_time.GetSecond(rDateTime::TZ::UTC), date_time.GetMinute(rDateTime::TZ::UTC),
|
||||
date_time.GetHour(rDateTime::TZ::UTC), date_time.GetDay(rDateTime::TZ::UTC), date_time.GetYear(rDateTime::TZ::UTC));
|
||||
|
||||
|
@ -107,7 +107,7 @@ int cellSailDescriptorCreateDatabase(vm::ptr<CellSailDescriptor> pSelf, vm::ptr<
|
||||
break;
|
||||
}
|
||||
default:
|
||||
cellSail->Error("Unhandled stream type: %d", pSelf->streamType.ToLE());
|
||||
cellSail->Error("Unhandled stream type: %d", pSelf->streamType);
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -32,7 +32,7 @@ s64 spursCreateLv2EventQueue(vm::ptr<CellSpurs> spurs, u32& queue_id, vm::ptr<u8
|
||||
vm::var<be_t<u32>> queue;
|
||||
s32 res = cb_call<s32, vm::ptr<CellSpurs>, vm::ptr<u32>, vm::ptr<u8>, s32, u32>(GetCurrentPPUThread(), libsre + 0xB14C, libsre_rtoc,
|
||||
spurs, queue, port, size, vm::read32(libsre_rtoc - 0x7E2C));
|
||||
queue_id = queue->ToLE();
|
||||
queue_id = queue;
|
||||
return res;
|
||||
#endif
|
||||
|
||||
@ -763,7 +763,7 @@ s64 cellSpursInitializeWithAttribute(vm::ptr<CellSpurs> spurs, vm::ptr<const Cel
|
||||
attr->m.nSpus,
|
||||
attr->m.spuPriority,
|
||||
attr->m.ppuPriority,
|
||||
attr->m.flags.ToLE() | (attr->m.exitIfNoWork ? SAF_EXIT_IF_NO_WORK : 0),
|
||||
attr->m.flags | (attr->m.exitIfNoWork ? SAF_EXIT_IF_NO_WORK : 0),
|
||||
attr->m.prefix,
|
||||
attr->m.prefixSize,
|
||||
attr->m.container,
|
||||
@ -799,7 +799,7 @@ s64 cellSpursInitializeWithAttribute2(vm::ptr<CellSpurs> spurs, vm::ptr<const Ce
|
||||
attr->m.nSpus,
|
||||
attr->m.spuPriority,
|
||||
attr->m.ppuPriority,
|
||||
attr->m.flags.ToLE() | (attr->m.exitIfNoWork ? SAF_EXIT_IF_NO_WORK : 0) | SAF_SECOND_VERSION,
|
||||
attr->m.flags | (attr->m.exitIfNoWork ? SAF_EXIT_IF_NO_WORK : 0) | SAF_SECOND_VERSION,
|
||||
attr->m.prefix,
|
||||
attr->m.prefixSize,
|
||||
attr->m.container,
|
||||
@ -851,7 +851,7 @@ s64 cellSpursAttributeSetMemoryContainerForSpuThread(vm::ptr<CellSpursAttribute>
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (attr->m.flags.ToLE() & SAF_SPU_TGT_EXCLUSIVE_NON_CONTEXT)
|
||||
if (attr->m.flags & SAF_SPU_TGT_EXCLUSIVE_NON_CONTEXT)
|
||||
{
|
||||
return CELL_SPURS_CORE_ERROR_STAT;
|
||||
}
|
||||
@ -925,7 +925,7 @@ s64 cellSpursAttributeSetSpuThreadGroupType(vm::ptr<CellSpursAttribute> attr, s3
|
||||
|
||||
if (type == SYS_SPU_THREAD_GROUP_TYPE_EXCLUSIVE_NON_CONTEXT)
|
||||
{
|
||||
if (attr->m.flags.ToLE() & SAF_SPU_MEMORY_CONTAINER_SET)
|
||||
if (attr->m.flags & SAF_SPU_MEMORY_CONTAINER_SET)
|
||||
{
|
||||
return CELL_SPURS_CORE_ERROR_STAT;
|
||||
}
|
||||
@ -976,7 +976,7 @@ s64 cellSpursAttributeEnableSystemWorkload(vm::ptr<CellSpursAttribute> attr, vm:
|
||||
{
|
||||
return CELL_SPURS_CORE_ERROR_PERM;
|
||||
}
|
||||
if (attr->m.flags.ToLE() & SAF_SYSTEM_WORKLOAD_ENABLED)
|
||||
if (attr->m.flags & SAF_SYSTEM_WORKLOAD_ENABLED)
|
||||
{
|
||||
return CELL_SPURS_CORE_ERROR_BUSY;
|
||||
}
|
||||
@ -1442,7 +1442,7 @@ s32 spursAddWorkload(
|
||||
CellSpurs::_sub_str3& wkl = wnum <= 15 ? spurs->m.wklG1[wnum] : spurs->m.wklG2[wnum & 0xf];
|
||||
spurs->m.wklMskB.atomic_op_sync([spurs, &wkl, wnum, &res_wkl](be_t<u32>& v)
|
||||
{
|
||||
const u32 mask = v.ToLE() & ~(0x80000000u >> wnum);
|
||||
const u32 mask = v & ~(0x80000000u >> wnum);
|
||||
res_wkl = 0;
|
||||
|
||||
for (u32 i = 0, m = 0x80000000, k = 0; i < 32; i++, m >>= 1)
|
||||
@ -1685,7 +1685,7 @@ s64 _cellSpursWorkloadFlagReceiver(vm::ptr<CellSpurs> spurs, u32 wid, u32 is_set
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_INVAL;
|
||||
}
|
||||
if ((spurs->m.wklMskA.read_relaxed().ToLE() & (0x80000000u >> wid)) == 0)
|
||||
if ((spurs->m.wklMskA.read_relaxed() & (0x80000000u >> wid)) == 0)
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_SRCH;
|
||||
}
|
||||
@ -1797,7 +1797,7 @@ s64 cellSpursReadyCountStore(vm::ptr<CellSpurs> spurs, u32 wid, u32 value)
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_INVAL;
|
||||
}
|
||||
if ((spurs->m.wklMskA.read_relaxed().ToLE() & (0x80000000u >> wid)) == 0)
|
||||
if ((spurs->m.wklMskA.read_relaxed() & (0x80000000u >> wid)) == 0)
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_SRCH;
|
||||
}
|
||||
|
@ -940,7 +940,7 @@ s32 syncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u8> buffer, u3
|
||||
{
|
||||
return CELL_SYNC_ERROR_STAT;
|
||||
}
|
||||
old_value = old.ToLE();
|
||||
old_value = old;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1314,7 +1314,7 @@ s32 _cellSyncLFQueuePushBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm:
|
||||
#ifdef PRX_DEBUG_XXX
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>(CPU, libsre + 0x24B0, libsre_rtoc,
|
||||
queue, position_v.addr(), isBlocking, 0);
|
||||
position = position_v->ToLE();
|
||||
position = position_v.value();
|
||||
#else
|
||||
res = syncLFQueueGetPushPointer(queue, position, isBlocking, 0);
|
||||
#endif
|
||||
@ -1324,7 +1324,7 @@ s32 _cellSyncLFQueuePushBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm:
|
||||
#ifdef PRX_DEBUG
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>(CPU, libsre + 0x3050, libsre_rtoc,
|
||||
queue, position_v.addr(), isBlocking, 0);
|
||||
position = position_v->ToLE();
|
||||
position = position_v.value();
|
||||
#else
|
||||
res = syncLFQueueGetPushPointer2(queue, position, isBlocking, 0);
|
||||
#endif
|
||||
@ -1347,9 +1347,10 @@ s32 _cellSyncLFQueuePushBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm:
|
||||
}
|
||||
}
|
||||
|
||||
s32 depth = (u32)queue->m_depth;
|
||||
s32 size = (u32)queue->m_size;
|
||||
memcpy(vm::get_ptr<void>((u64)(queue->m_buffer.addr() & ~1ull) + size * (position >= depth ? position - depth : position)), buffer.get_ptr(), size);
|
||||
const s32 depth = (u32)queue->m_depth;
|
||||
const s32 size = (u32)queue->m_size;
|
||||
const u32 addr = vm::cast<u64>((queue->m_buffer.addr() & ~1ull) + size * (position >= depth ? position - depth : position));
|
||||
memcpy(vm::get_ptr<void>(addr), buffer.get_ptr(), size);
|
||||
|
||||
s32 res;
|
||||
if (queue->m_direction != CELL_SYNC_QUEUE_ANY2ANY)
|
||||
@ -1689,7 +1690,7 @@ s32 _cellSyncLFQueuePopBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm::
|
||||
#ifdef PRX_DEBUG_XXX
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64, u64>(CPU, libsre + 0x2A90, libsre_rtoc,
|
||||
queue, position_v.addr(), isBlocking, 0, 0);
|
||||
position = position_v->ToLE();
|
||||
position = position_v.value();
|
||||
#else
|
||||
res = syncLFQueueGetPopPointer(queue, position, isBlocking, 0, 0);
|
||||
#endif
|
||||
@ -1699,7 +1700,7 @@ s32 _cellSyncLFQueuePopBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm::
|
||||
#ifdef PRX_DEBUG
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>(CPU, libsre + 0x39AC, libsre_rtoc,
|
||||
queue, position_v.addr(), isBlocking, 0);
|
||||
position = position_v->ToLE();
|
||||
position = position_v.value();
|
||||
#else
|
||||
res = syncLFQueueGetPopPointer2(queue, position, isBlocking, 0);
|
||||
#endif
|
||||
@ -1722,9 +1723,10 @@ s32 _cellSyncLFQueuePopBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm::
|
||||
}
|
||||
}
|
||||
|
||||
s32 depth = (u32)queue->m_depth;
|
||||
s32 size = (u32)queue->m_size;
|
||||
memcpy(buffer.get_ptr(), vm::get_ptr<void>((u64)(queue->m_buffer.addr() & ~1ull) + size * (position >= depth ? position - depth : position)), size);
|
||||
const s32 depth = (u32)queue->m_depth;
|
||||
const s32 size = (u32)queue->m_size;
|
||||
const u32 addr = vm::cast<u64>((queue->m_buffer.addr() & ~1) + size * (position >= depth ? position - depth : position));
|
||||
memcpy(buffer.get_ptr(), vm::get_ptr<void>(addr), size);
|
||||
|
||||
s32 res;
|
||||
if (queue->m_direction != CELL_SYNC_QUEUE_ANY2ANY)
|
||||
|
@ -285,8 +285,7 @@ int cellVideoOutGetNumberOfDevice(u32 videoOut)
|
||||
|
||||
int cellVideoOutGetResolutionAvailability(u32 videoOut, u32 resolutionId, u32 aspect, u32 option)
|
||||
{
|
||||
cellSysutil->Warning("cellVideoOutGetResolutionAvailability(videoOut=%d, resolutionId=0x%x, option_addr=0x%x, aspect=%d, option=%d)",
|
||||
videoOut, resolutionId, aspect, option);
|
||||
cellSysutil->Warning("cellVideoOutGetResolutionAvailability(videoOut=%d, resolutionId=0x%x, aspect=%d, option=%d)", videoOut, resolutionId, aspect, option);
|
||||
|
||||
if (!Ini.GS3DTV.GetValue() && (resolutionId == CELL_VIDEO_OUT_RESOLUTION_720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_1024x720_3D_FRAME_PACKING ||
|
||||
resolutionId == CELL_VIDEO_OUT_RESOLUTION_960x720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_800x720_3D_FRAME_PACKING ||
|
||||
@ -311,7 +310,7 @@ struct sys_callback
|
||||
|
||||
void sysutilSendSystemCommand(u64 status, u64 param)
|
||||
{
|
||||
// TODO: check it and find the source of the return value (not sure that void becomes CELL_OK)
|
||||
// TODO: check it and find the source of the return value (void isn't equal to CELL_OK)
|
||||
for (auto& cb : g_sys_callback)
|
||||
{
|
||||
if (cb.func)
|
||||
@ -748,8 +747,8 @@ int cellHddGameCheck(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm
|
||||
|
||||
funcStat(result, get, set);
|
||||
|
||||
if (result->result.ToLE() != CELL_HDDGAME_CBRESULT_OK &&
|
||||
result->result.ToLE() != CELL_HDDGAME_CBRESULT_OK_CANCEL) {
|
||||
if (result->result != CELL_HDDGAME_CBRESULT_OK &&
|
||||
result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL) {
|
||||
return CELL_HDDGAME_ERROR_CBRESULT;
|
||||
}
|
||||
|
||||
|
@ -945,7 +945,7 @@ void fsAioRead(u32 fd, vm::ptr<CellFsAio> aio, int xid, vm::ptr<void(*)(vm::ptr<
|
||||
g_FsAioReadCur++;
|
||||
}
|
||||
|
||||
int cellFsAioRead(vm::ptr<CellFsAio> aio, vm::ref<u32> id, vm::ptr<void(*)(vm::ptr<CellFsAio> xaio, int error, int xid, u64 size)> func)
|
||||
int cellFsAioRead(vm::ptr<CellFsAio> aio, vm::ptr<u32> id, vm::ptr<void(*)(vm::ptr<CellFsAio> xaio, int error, int xid, u64 size)> func)
|
||||
{
|
||||
sys_fs->Warning("cellFsAioRead(aio=0x%x, id=0x%x, func=0x%x)", aio, id, func);
|
||||
|
||||
@ -964,7 +964,7 @@ int cellFsAioRead(vm::ptr<CellFsAio> aio, vm::ref<u32> id, vm::ptr<void(*)(vm::p
|
||||
|
||||
//get a unique id for the callback (may be used by cellFsAioCancel)
|
||||
const u32 xid = g_FsAioReadID++;
|
||||
id = xid;
|
||||
*id = xid;
|
||||
|
||||
{
|
||||
thread t("fsAioRead", std::bind(fsAioRead, fd, aio, xid, func));
|
||||
|
@ -448,7 +448,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
for(int i = 1; i < WXSIZEOF(ResolutionTable); ++i)
|
||||
{
|
||||
cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width.ToLE(), ResolutionTable[i].height.ToLE()));
|
||||
cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width.value(), ResolutionTable[i].height.value()));
|
||||
}
|
||||
|
||||
cbox_gs_aspect->Append("4:3");
|
||||
|
@ -47,7 +47,7 @@ namespace loader
|
||||
|
||||
if (m_ehdr.e_machine != MACHINE_PPC64 && m_ehdr.e_machine != MACHINE_SPU)
|
||||
{
|
||||
LOG_ERROR(LOADER, "Unknown elf64 machine type: 0x%x", m_ehdr.e_machine.ToLE());
|
||||
LOG_ERROR(LOADER, "Unknown elf64 machine type: 0x%x", m_ehdr.e_machine);
|
||||
return bad_version;
|
||||
}
|
||||
|
||||
@ -399,7 +399,7 @@ namespace loader
|
||||
{
|
||||
for (auto &phdr : m_phdrs)
|
||||
{
|
||||
switch (phdr.p_type.ToLE())
|
||||
switch (phdr.p_type.value())
|
||||
{
|
||||
case 0x00000001: //LOAD
|
||||
if (phdr.p_memsz)
|
||||
@ -442,12 +442,12 @@ namespace loader
|
||||
{
|
||||
sys_process_param_info& info = Emu.GetInfo().GetProcParam();
|
||||
/*
|
||||
LOG_NOTICE(LOADER, "*** sdk version: 0x%x", info.sdk_version.ToLE());
|
||||
LOG_NOTICE(LOADER, "*** primary prio: %d", info.primary_prio.ToLE());
|
||||
LOG_NOTICE(LOADER, "*** primary stacksize: 0x%x", info.primary_stacksize.ToLE());
|
||||
LOG_NOTICE(LOADER, "*** malloc pagesize: 0x%x", info.malloc_pagesize.ToLE());
|
||||
LOG_NOTICE(LOADER, "*** ppc seg: 0x%x", info.ppc_seg.ToLE());
|
||||
//LOG_NOTICE(LOADER, "*** crash dump param addr: 0x%x", info.crash_dump_param_addr.ToLE());
|
||||
LOG_NOTICE(LOADER, "*** sdk version: 0x%x", info.sdk_version);
|
||||
LOG_NOTICE(LOADER, "*** primary prio: %d", info.primary_prio);
|
||||
LOG_NOTICE(LOADER, "*** primary stacksize: 0x%x", info.primary_stacksize);
|
||||
LOG_NOTICE(LOADER, "*** malloc pagesize: 0x%x", info.malloc_pagesize);
|
||||
LOG_NOTICE(LOADER, "*** ppc seg: 0x%x", info.ppc_seg);
|
||||
//LOG_NOTICE(LOADER, "*** crash dump param addr: 0x%x", info.crash_dump_param_addr);
|
||||
*/
|
||||
|
||||
info = proc_param.info;
|
||||
@ -463,7 +463,7 @@ namespace loader
|
||||
|
||||
if (proc_prx_param.magic != 0x1b434cec)
|
||||
{
|
||||
LOG_ERROR(LOADER, "Bad magic! (0x%x)", proc_prx_param.magic.ToLE());
|
||||
LOG_ERROR(LOADER, "Bad magic! (0x%x)", proc_prx_param.magic);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user