mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-31 06:32:41 +00:00
IsGood() check elimination
Reasons: 1) It's unsafe - we cannot guarantee that address is still good while it is used. 2) It's wrong in many modules which are usually just compare pointer with zero.
This commit is contained in:
parent
48514b0e93
commit
8f04ab07ed
@ -148,12 +148,6 @@ void CPUThread::NextPc(u8 instr_size)
|
||||
|
||||
void CPUThread::SetBranch(const u64 pc, bool record_branch)
|
||||
{
|
||||
if(!Memory.IsGoodAddr(m_offset + pc))
|
||||
{
|
||||
LOG_ERROR(PPU, "%s branch error: bad address 0x%llx #pc: 0x%llx", GetFName().c_str(), m_offset + pc, m_offset + PC);
|
||||
Emu.Pause();
|
||||
}
|
||||
|
||||
m_is_branch = true;
|
||||
nPC = pc;
|
||||
|
||||
|
@ -337,12 +337,6 @@ private:
|
||||
void STQX(u32 rt, u32 ra, u32 rb)
|
||||
{
|
||||
u32 lsa = (CPU.GPR[ra]._u32[3] + CPU.GPR[rb]._u32[3]) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
LOG_ERROR(Log::SPU, "STQX: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
CPU.WriteLS128(lsa, CPU.GPR[rt]._u128);
|
||||
}
|
||||
@ -436,13 +430,6 @@ private:
|
||||
|
||||
u32 lsa = (a + b) & 0x3fff0;
|
||||
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
LOG_ERROR(Log::SPU, "LQX: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
CPU.GPR[rt]._u128 = CPU.ReadLS128(lsa);
|
||||
}
|
||||
void ROTQBYBI(u32 rt, u32 ra, u32 rb)
|
||||
@ -1169,12 +1156,6 @@ private:
|
||||
void STQA(u32 rt, s32 i16)
|
||||
{
|
||||
u32 lsa = (i16 << 2) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
LOG_ERROR(Log::SPU, "STQA: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
CPU.WriteLS128(lsa, CPU.GPR[rt]._u128);
|
||||
}
|
||||
@ -1220,12 +1201,6 @@ private:
|
||||
void STQR(u32 rt, s32 i16)
|
||||
{
|
||||
u32 lsa = branchTarget(CPU.PC, i16) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
LOG_ERROR(Log::SPU, "STQR: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
CPU.WriteLS128(lsa, CPU.GPR[rt]._u128);
|
||||
}
|
||||
@ -1238,12 +1213,6 @@ private:
|
||||
void LQA(u32 rt, s32 i16)
|
||||
{
|
||||
u32 lsa = (i16 << 2) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
LOG_ERROR(Log::SPU, "LQA: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
CPU.GPR[rt]._u128 = CPU.ReadLS128(lsa);
|
||||
}
|
||||
@ -1288,12 +1257,6 @@ private:
|
||||
void LQR(u32 rt, s32 i16)
|
||||
{
|
||||
u32 lsa = branchTarget(CPU.PC, i16) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
LOG_ERROR(Log::SPU, "LQR: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
CPU.GPR[rt]._u128 = CPU.ReadLS128(lsa);
|
||||
}
|
||||
@ -1377,24 +1340,13 @@ private:
|
||||
void STQD(u32 rt, s32 i10, u32 ra) //i10 is shifted left by 4 while decoding
|
||||
{
|
||||
const u32 lsa = (CPU.GPR[ra]._i32[3] + i10) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
LOG_ERROR(Log::SPU, "STQD: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
//LOG_NOTICE(Log::SPU, "STQD(lsa=0x%x): GPR[%d] (0x%llx%llx)", lsa, rt, CPU.GPR[rt]._u64[1], CPU.GPR[rt]._u64[0]);
|
||||
CPU.WriteLS128(lsa, CPU.GPR[rt]._u128);
|
||||
}
|
||||
void LQD(u32 rt, s32 i10, u32 ra) //i10 is shifted left by 4 while decoding
|
||||
{
|
||||
const u32 lsa = (CPU.GPR[ra]._i32[3] + i10) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
LOG_ERROR(Log::SPU, "LQD: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
CPU.GPR[rt]._u128 = CPU.ReadLS128(lsa);
|
||||
}
|
||||
|
@ -1333,8 +1333,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool IsGoodLSA(const u32 lsa) const { return Memory.IsGoodAddr(lsa + m_offset) && lsa < 0x40000; }
|
||||
virtual u8 ReadLS8 (const u32 lsa) const { return Memory.Read8 (lsa + m_offset); } // m_offset & 0x3fffc ?????
|
||||
virtual u8 ReadLS8 (const u32 lsa) const { return Memory.Read8 (lsa + m_offset); }
|
||||
virtual u16 ReadLS16 (const u32 lsa) const { return Memory.Read16 (lsa + m_offset); }
|
||||
virtual u32 ReadLS32 (const u32 lsa) const { return Memory.Read32 (lsa + m_offset); }
|
||||
virtual u64 ReadLS64 (const u32 lsa) const { return Memory.Read64 (lsa + m_offset); }
|
||||
|
@ -519,7 +519,7 @@ public:
|
||||
|
||||
template<typename T> bool CopyToReal(void* real, T from, u32 count)
|
||||
{
|
||||
if (!IsGoodAddr<T>(from, count)) return false;
|
||||
if (!IsGoodAddr<T>(from, count)) return false; // TODO: eliminate
|
||||
|
||||
memcpy(real, GetMemFromAddr<T>(from), count);
|
||||
|
||||
@ -528,7 +528,7 @@ public:
|
||||
|
||||
template<typename T> bool CopyFromReal(T to, const void* real, u32 count)
|
||||
{
|
||||
if (!IsGoodAddr<T>(to, count)) return false;
|
||||
if (!IsGoodAddr<T>(to, count)) return false; // TODO: eliminate
|
||||
|
||||
memcpy(GetMemFromAddr<T>(to), real, count);
|
||||
|
||||
@ -537,7 +537,7 @@ public:
|
||||
|
||||
template<typename T1, typename T2> bool Copy(T1 to, T2 from, u32 count)
|
||||
{
|
||||
if (!IsGoodAddr<T1>(to, count) || !IsGoodAddr<T2>(from, count)) return false;
|
||||
if (!IsGoodAddr<T1>(to, count) || !IsGoodAddr<T2>(from, count)) return false; // TODO: eliminate
|
||||
|
||||
memmove(GetMemFromAddr<T1>(to), GetMemFromAddr<T2>(from), count);
|
||||
|
||||
@ -574,21 +574,21 @@ public:
|
||||
*(Td*)GetMemFromAddr<T>(addr) = data;
|
||||
}
|
||||
|
||||
std::string ReadString(const u64 addr, const u64 len)
|
||||
template<typename T> std::string ReadString(const T addr, const u64 len)
|
||||
{
|
||||
std::string ret((const char *)GetMemFromAddr(addr), len);
|
||||
std::string ret((const char *)GetMemFromAddr<T>(addr), len);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string ReadString(const u64 addr)
|
||||
template<typename T> std::string ReadString(const T addr)
|
||||
{
|
||||
return std::string((const char*)GetMemFromAddr(addr));
|
||||
return std::string((const char*)GetMemFromAddr<T>(addr));
|
||||
}
|
||||
|
||||
void WriteString(const u64 addr, const std::string& str)
|
||||
template<typename T> void WriteString(const T addr, const std::string& str)
|
||||
{
|
||||
strcpy((char*)GetMemFromAddr(addr), str.c_str());
|
||||
strcpy((char*)GetMemFromAddr<T>(addr), str.c_str());
|
||||
}
|
||||
|
||||
static u64 AlignAddr(const u64 addr, const u64 align)
|
||||
|
@ -547,11 +547,6 @@ int cellAdecQueryAttr(mem_ptr_t<CellAdecType> type, mem_ptr_t<CellAdecAttr> attr
|
||||
{
|
||||
cellAdec->Warning("cellAdecQueryAttr(type_addr=0x%x, attr_addr=0x%x)", type.GetAddr(), attr.GetAddr());
|
||||
|
||||
if (!type.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_ADEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!adecCheckType(type->audioCodecType)) return CELL_ADEC_ERROR_ARG;
|
||||
|
||||
// TODO: check values
|
||||
@ -567,11 +562,6 @@ int cellAdecOpen(mem_ptr_t<CellAdecType> type, mem_ptr_t<CellAdecResource> res,
|
||||
cellAdec->Warning("cellAdecOpen(type_addr=0x%x, res_addr=0x%x, cb_addr=0x%x, handle_addr=0x%x)",
|
||||
type.GetAddr(), res.GetAddr(), cb.GetAddr(), handle.GetAddr());
|
||||
|
||||
if (!type.IsGood() || !res.IsGood() || !cb.IsGood() || !handle.IsGood())
|
||||
{
|
||||
return CELL_ADEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!adecCheckType(type->audioCodecType)) return CELL_ADEC_ERROR_ARG;
|
||||
|
||||
handle = adecOpen(new AudioDecoder(type->audioCodecType, res->startAddr, res->totalMemSize, cb->cbFunc, cb->cbArg));
|
||||
@ -584,11 +574,6 @@ int cellAdecOpenEx(mem_ptr_t<CellAdecType> type, mem_ptr_t<CellAdecResourceEx> r
|
||||
cellAdec->Warning("cellAdecOpenEx(type_addr=0x%x, res_addr=0x%x, cb_addr=0x%x, handle_addr=0x%x)",
|
||||
type.GetAddr(), res.GetAddr(), cb.GetAddr(), handle.GetAddr());
|
||||
|
||||
if (!type.IsGood() || !res.IsGood() || !cb.IsGood() || !handle.IsGood())
|
||||
{
|
||||
return CELL_ADEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!adecCheckType(type->audioCodecType)) return CELL_ADEC_ERROR_ARG;
|
||||
|
||||
handle = adecOpen(new AudioDecoder(type->audioCodecType, res->startAddr, res->totalMemSize, cb->cbFunc, cb->cbArg));
|
||||
@ -671,11 +656,6 @@ int cellAdecDecodeAu(u32 handle, mem_ptr_t<CellAdecAuInfo> auInfo)
|
||||
return CELL_ADEC_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!auInfo.IsGood())
|
||||
{
|
||||
return CELL_ADEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
AdecTask task(adecDecodeAu);
|
||||
task.au.auInfo_addr = auInfo.GetAddr();
|
||||
task.au.addr = auInfo->startAddr;
|
||||
@ -706,22 +686,9 @@ int cellAdecGetPcm(u32 handle, u32 outBuffer_addr)
|
||||
adec->frames.Pop(af);
|
||||
AVFrame* frame = af.data;
|
||||
|
||||
int result = CELL_OK;
|
||||
|
||||
if (!Memory.IsGoodAddr(outBuffer_addr, af.size))
|
||||
{
|
||||
result = CELL_ADEC_ERROR_FATAL;
|
||||
if (af.data)
|
||||
{
|
||||
av_frame_unref(af.data);
|
||||
av_frame_free(&af.data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!af.data) // fake: empty data
|
||||
{
|
||||
return result;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
// copy data
|
||||
@ -751,7 +718,7 @@ int cellAdecGetPcm(u32 handle, u32 outBuffer_addr)
|
||||
av_frame_unref(af.data);
|
||||
av_frame_free(&af.data);
|
||||
}
|
||||
return result;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellAdecGetPcmItem(u32 handle, mem32_t pcmItem_ptr)
|
||||
@ -764,11 +731,6 @@ int cellAdecGetPcmItem(u32 handle, mem32_t pcmItem_ptr)
|
||||
return CELL_ADEC_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!pcmItem_ptr.IsGood())
|
||||
{
|
||||
return CELL_ADEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (adec->frames.IsEmpty())
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
|
@ -509,11 +509,6 @@ int cellAudioPortOpen(mem_ptr_t<CellAudioPortParam> audioParam, mem32_t portNum)
|
||||
{
|
||||
cellAudio->Warning("cellAudioPortOpen(audioParam_addr=0x%x, portNum_addr=0x%x)", audioParam.GetAddr(), portNum.GetAddr());
|
||||
|
||||
if(!audioParam.IsGood() || !portNum.IsGood())
|
||||
{
|
||||
return CELL_AUDIO_ERROR_PARAM;
|
||||
}
|
||||
|
||||
if (audioParam->nChannel > 8 || audioParam->nBlock > 16)
|
||||
{
|
||||
return CELL_AUDIO_ERROR_PARAM;
|
||||
@ -562,7 +557,7 @@ int cellAudioGetPortConfig(u32 portNum, mem_ptr_t<CellAudioPortConfig> portConfi
|
||||
{
|
||||
cellAudio->Warning("cellAudioGetPortConfig(portNum=0x%x, portConfig_addr=0x%x)", portNum, portConfig.GetAddr());
|
||||
|
||||
if (!portConfig.IsGood() || portNum >= m_config.AUDIO_PORT_COUNT)
|
||||
if (portNum >= m_config.AUDIO_PORT_COUNT)
|
||||
{
|
||||
return CELL_AUDIO_ERROR_PARAM;
|
||||
}
|
||||
|
@ -460,11 +460,6 @@ int cellDmuxQueryAttr(const mem_ptr_t<CellDmuxType> demuxerType, mem_ptr_t<CellD
|
||||
{
|
||||
cellDmux->Warning("cellDmuxQueryAttr(demuxerType_addr=0x%x, demuxerAttr_addr=0x%x)", demuxerType.GetAddr(), demuxerAttr.GetAddr());
|
||||
|
||||
if (!demuxerType.IsGood() || !demuxerAttr.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (demuxerType->streamType != CELL_DMUX_STREAM_TYPE_PAMF)
|
||||
{
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
@ -478,11 +473,6 @@ int cellDmuxQueryAttr2(const mem_ptr_t<CellDmuxType2> demuxerType2, mem_ptr_t<Ce
|
||||
{
|
||||
cellDmux->Warning("cellDmuxQueryAttr2(demuxerType2_addr=0x%x, demuxerAttr_addr=0x%x)", demuxerType2.GetAddr(), demuxerAttr.GetAddr());
|
||||
|
||||
if (!demuxerType2.IsGood() || !demuxerAttr.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (demuxerType2->streamType != CELL_DMUX_STREAM_TYPE_PAMF)
|
||||
{
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
@ -498,21 +488,11 @@ int cellDmuxOpen(const mem_ptr_t<CellDmuxType> demuxerType, const mem_ptr_t<Cell
|
||||
cellDmux->Warning("cellDmuxOpen(demuxerType_addr=0x%x, demuxerResource_addr=0x%x, demuxerCb_addr=0x%x, demuxerHandle_addr=0x%x)",
|
||||
demuxerType.GetAddr(), demuxerResource.GetAddr(), demuxerCb.GetAddr(), demuxerHandle.GetAddr());
|
||||
|
||||
if (!demuxerType.IsGood() || !demuxerResource.IsGood() || !demuxerCb.IsGood() || !demuxerHandle.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (demuxerType->streamType != CELL_DMUX_STREAM_TYPE_PAMF)
|
||||
{
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(demuxerResource->memAddr, demuxerResource->memSize))
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
// TODO: check demuxerResource and demuxerCb arguments
|
||||
|
||||
demuxerHandle = dmuxOpen(new Demuxer(demuxerResource->memAddr, demuxerResource->memSize, demuxerCb->cbMsgFunc, demuxerCb->cbArg_addr));
|
||||
@ -526,21 +506,11 @@ int cellDmuxOpenEx(const mem_ptr_t<CellDmuxType> demuxerType, const mem_ptr_t<Ce
|
||||
cellDmux->Warning("cellDmuxOpenEx(demuxerType_addr=0x%x, demuxerResourceEx_addr=0x%x, demuxerCb_addr=0x%x, demuxerHandle_addr=0x%x)",
|
||||
demuxerType.GetAddr(), demuxerResourceEx.GetAddr(), demuxerCb.GetAddr(), demuxerHandle.GetAddr());
|
||||
|
||||
if (!demuxerType.IsGood() || !demuxerResourceEx.IsGood() || !demuxerCb.IsGood() || !demuxerHandle.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (demuxerType->streamType != CELL_DMUX_STREAM_TYPE_PAMF)
|
||||
{
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(demuxerResourceEx->memAddr, demuxerResourceEx->memSize))
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
// TODO: check demuxerResourceEx and demuxerCb arguments
|
||||
|
||||
demuxerHandle = dmuxOpen(new Demuxer(demuxerResourceEx->memAddr, demuxerResourceEx->memSize, demuxerCb->cbMsgFunc, demuxerCb->cbArg_addr));
|
||||
@ -554,21 +524,11 @@ int cellDmuxOpen2(const mem_ptr_t<CellDmuxType2> demuxerType2, const mem_ptr_t<C
|
||||
cellDmux->Warning("cellDmuxOpen2(demuxerType2_addr=0x%x, demuxerResource2_addr=0x%x, demuxerCb_addr=0x%x, demuxerHandle_addr=0x%x)",
|
||||
demuxerType2.GetAddr(), demuxerResource2.GetAddr(), demuxerCb.GetAddr(), demuxerHandle.GetAddr());
|
||||
|
||||
if (!demuxerType2.IsGood() || !demuxerResource2.IsGood() || !demuxerCb.IsGood() || !demuxerHandle.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (demuxerType2->streamType != CELL_DMUX_STREAM_TYPE_PAMF)
|
||||
{
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(demuxerResource2->memAddr, demuxerResource2->memSize))
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
// TODO: check demuxerType2, demuxerResource2 and demuxerCb arguments
|
||||
|
||||
demuxerHandle = dmuxOpen(new Demuxer(demuxerResource2->memAddr, demuxerResource2->memSize, demuxerCb->cbMsgFunc, demuxerCb->cbArg_addr));
|
||||
@ -615,11 +575,6 @@ int cellDmuxSetStream(u32 demuxerHandle, const u32 streamAddress, u32 streamSize
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(streamAddress, streamSize))
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (dmux->is_running)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
@ -701,17 +656,6 @@ int cellDmuxQueryEsAttr(const mem_ptr_t<CellDmuxType> demuxerType, const mem_ptr
|
||||
cellDmux->Warning("cellDmuxQueryEsAttr(demuxerType_addr=0x%x, esFilterId_addr=0x%x, esSpecificInfo_addr=0x%x, esAttr_addr=0x%x)",
|
||||
demuxerType.GetAddr(), esFilterId.GetAddr(), esSpecificInfo_addr, esAttr.GetAddr());
|
||||
|
||||
if (!demuxerType.IsGood() || !esFilterId.IsGood() || !esAttr.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(esSpecificInfo_addr, 12))
|
||||
{
|
||||
cellDmux->Error("cellDmuxQueryEsAttr: invalid specific info addr (0x%x)", esSpecificInfo_addr);
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (demuxerType->streamType != CELL_DMUX_STREAM_TYPE_PAMF)
|
||||
{
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
@ -729,17 +673,6 @@ int cellDmuxQueryEsAttr2(const mem_ptr_t<CellDmuxType2> demuxerType2, const mem_
|
||||
cellDmux->Warning("cellDmuxQueryEsAttr2(demuxerType2_addr=0x%x, esFilterId_addr=0x%x, esSpecificInfo_addr=0x%x, esAttr_addr=0x%x)",
|
||||
demuxerType2.GetAddr(), esFilterId.GetAddr(), esSpecificInfo_addr, esAttr.GetAddr());
|
||||
|
||||
if (!demuxerType2.IsGood() || !esFilterId.IsGood() || !esAttr.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(esSpecificInfo_addr, 12))
|
||||
{
|
||||
cellDmux->Error("cellDmuxQueryEsAttr2: invalid specific info addr (0x%x)", esSpecificInfo_addr);
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (demuxerType2->streamType != CELL_DMUX_STREAM_TYPE_PAMF)
|
||||
{
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
@ -759,22 +692,6 @@ int cellDmuxEnableEs(u32 demuxerHandle, const mem_ptr_t<CellCodecEsFilterId> esF
|
||||
"esSpecificInfo_addr=0x%x, esHandle_addr=0x%x)", demuxerHandle, esFilterId.GetAddr(), esResourceInfo.GetAddr(),
|
||||
esCb.GetAddr(), esSpecificInfo_addr, esHandle.GetAddr());
|
||||
|
||||
if (!esFilterId.IsGood() || !esResourceInfo.IsGood() || !esCb.IsGood() || !esHandle.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(esSpecificInfo_addr, 12))
|
||||
{
|
||||
cellDmux->Error("cellDmuxEnableEs: invalid specific info addr (0x%x)", esSpecificInfo_addr);
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(esResourceInfo->memAddr, esResourceInfo->memSize))
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
Demuxer* dmux;
|
||||
if (!Emu.GetIdManager().GetIDData(demuxerHandle, dmux))
|
||||
{
|
||||
@ -849,11 +766,6 @@ int cellDmuxGetAu(u32 esHandle, mem32_t auInfo_ptr, mem32_t auSpecificInfo_ptr)
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!auInfo_ptr.IsGood() || !auSpecificInfo_ptr.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
u32 info;
|
||||
u32 spec;
|
||||
if (!es->peek(info, true, spec, true))
|
||||
@ -877,11 +789,6 @@ int cellDmuxPeekAu(u32 esHandle, mem32_t auInfo_ptr, mem32_t auSpecificInfo_ptr)
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!auInfo_ptr.IsGood() || !auSpecificInfo_ptr.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
u32 info;
|
||||
u32 spec;
|
||||
if (!es->peek(info, true, spec, false))
|
||||
@ -905,11 +812,6 @@ int cellDmuxGetAuEx(u32 esHandle, mem32_t auInfoEx_ptr, mem32_t auSpecificInfo_p
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!auInfoEx_ptr.IsGood() || !auSpecificInfo_ptr.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
u32 info;
|
||||
u32 spec;
|
||||
if (!es->peek(info, false, spec, true))
|
||||
@ -933,11 +835,6 @@ int cellDmuxPeekAuEx(u32 esHandle, mem32_t auInfoEx_ptr, mem32_t auSpecificInfo_
|
||||
return CELL_DMUX_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!auInfoEx_ptr.IsGood() || !auSpecificInfo_ptr.IsGood())
|
||||
{
|
||||
return CELL_DMUX_ERROR_FATAL;
|
||||
}
|
||||
|
||||
u32 info;
|
||||
u32 spec;
|
||||
if (!es->peek(info, false, spec, false))
|
||||
|
@ -242,10 +242,6 @@ int cellFontInitializeWithRevision(u64 revisionFlags, mem_ptr_t<CellFontConfig>
|
||||
|
||||
if (s_fontInternalInstance->m_bInitialized)
|
||||
return CELL_FONT_ERROR_ALREADY_INITIALIZED;
|
||||
if (!config.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (!Memory.IsGoodAddr(config->FileCache.buffer_addr))
|
||||
return CELL_FONT_ERROR_INVALID_CACHE_BUFFER;
|
||||
if (config->FileCache.size < 24)
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (config->flags != 0)
|
||||
@ -299,10 +295,6 @@ int cellFontOpenFontMemory(mem_ptr_t<CellFontLibrary> library, u32 fontAddr, u32
|
||||
|
||||
if (!s_fontInternalInstance->m_bInitialized)
|
||||
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
if (!library.IsGood() || !font.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (!Memory.IsGoodAddr(fontAddr))
|
||||
return CELL_FONT_ERROR_FONT_OPEN_FAILED;
|
||||
|
||||
if (!stbtt_InitFont(&(font->stbfont), (unsigned char*)Memory.VirtualToRealAddr(fontAddr), 0))
|
||||
return CELL_FONT_ERROR_FONT_OPEN_FAILED;
|
||||
@ -336,8 +328,6 @@ int cellFontOpenFontset(mem_ptr_t<CellFontLibrary> library, mem_ptr_t<CellFontTy
|
||||
cellFont->Log("cellFontOpenFontset(library_addr=0x%x, fontType_addr=0x%x, font_addr=0x%x)",
|
||||
library.GetAddr(), fontType.GetAddr(), font.GetAddr());
|
||||
|
||||
if (!library.IsGood() || !fontType.IsGood() || !font.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (!s_fontInternalInstance->m_bInitialized)
|
||||
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
if (fontType->map != CELL_FONT_MAP_UNICODE)
|
||||
@ -421,9 +411,6 @@ int cellFontOpenFontInstance(mem_ptr_t<CellFont> openedFont, mem_ptr_t<CellFont>
|
||||
{
|
||||
cellFont->Warning("cellFontOpenFontInstance(openedFont=0x%x, font=0x%x)", openedFont.GetAddr(), font.GetAddr());
|
||||
|
||||
if (!openedFont.IsGood() || !font.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
font->renderer_addr = openedFont->renderer_addr;
|
||||
font->scale_x = openedFont->scale_x;
|
||||
font->scale_y = openedFont->scale_y;
|
||||
@ -446,8 +433,6 @@ int cellFontCreateRenderer(mem_ptr_t<CellFontLibrary> library, mem_ptr_t<CellFon
|
||||
cellFont->Warning("cellFontCreateRenderer(library_addr=0x%x, config_addr=0x%x, Renderer_addr=0x%x)",
|
||||
library.GetAddr(), config.GetAddr(), Renderer.GetAddr());
|
||||
|
||||
if (!library.IsGood() || !config.IsGood() || !Renderer.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (!s_fontInternalInstance->m_bInitialized)
|
||||
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
|
||||
@ -488,9 +473,6 @@ int cellFontSetScalePixel(mem_ptr_t<CellFont> font, float w, float h)
|
||||
h = GetCurrentPPUThread().FPR[2]; // TODO: Something is wrong with the float arguments
|
||||
cellFont->Log("cellFontSetScalePixel(font_addr=0x%x, w=%f, h=%f)", font.GetAddr(), w, h);
|
||||
|
||||
if (!font.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
font->scale_x = w;
|
||||
font->scale_y = h;
|
||||
return CELL_FONT_OK;
|
||||
@ -501,9 +483,6 @@ int cellFontGetHorizontalLayout(mem_ptr_t<CellFont> font, mem_ptr_t<CellFontHori
|
||||
cellFont->Log("cellFontGetHorizontalLayout(font_addr=0x%x, layout_addr=0x%x)",
|
||||
font.GetAddr(), layout.GetAddr());
|
||||
|
||||
if (!font.IsGood() || !layout.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
int ascent, descent, lineGap;
|
||||
float scale = stbtt_ScaleForPixelHeight(&(font->stbfont), font->scale_y);
|
||||
stbtt_GetFontVMetrics(&(font->stbfont), &ascent, &descent, &lineGap);
|
||||
@ -518,9 +497,7 @@ int cellFontBindRenderer(mem_ptr_t<CellFont> font, mem_ptr_t<CellFontRenderer> r
|
||||
{
|
||||
cellFont->Warning("cellFontBindRenderer(font_addr=0x%x, renderer_addr=0x%x)",
|
||||
font.GetAddr(), renderer.GetAddr());
|
||||
|
||||
if (!font.IsGood() || !renderer.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
if (font->renderer_addr)
|
||||
return CELL_FONT_ERROR_RENDERER_ALREADY_BIND;
|
||||
|
||||
@ -532,8 +509,6 @@ int cellFontUnbindRenderer(mem_ptr_t<CellFont> font)
|
||||
{
|
||||
cellFont->Warning("cellFontBindRenderer(font_addr=0x%x)", font.GetAddr());
|
||||
|
||||
if (!font.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (!font->renderer_addr)
|
||||
return CELL_FONT_ERROR_RENDERER_UNBIND;
|
||||
|
||||
@ -553,8 +528,6 @@ int cellFontSetupRenderScalePixel(mem_ptr_t<CellFont> font, float w, float h)
|
||||
h = GetCurrentPPUThread().FPR[2]; // TODO: Something is wrong with the float arguments
|
||||
cellFont->Log("cellFontSetupRenderScalePixel(font_addr=0x%x, w=%f, h=%f)", font.GetAddr(), w, h);
|
||||
|
||||
if (!font.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (!font->renderer_addr)
|
||||
return CELL_FONT_ERROR_RENDERER_UNBIND;
|
||||
|
||||
@ -567,8 +540,6 @@ int cellFontGetRenderCharGlyphMetrics(mem_ptr_t<CellFont> font, u32 code, mem_pt
|
||||
cellFont->Log("cellFontGetRenderCharGlyphMetrics(font_addr=0x%x, code=0x%x, metrics_addr=0x%x)",
|
||||
font.GetAddr(), code, metrics.GetAddr());
|
||||
|
||||
if (!font.IsGood() || !metrics.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (!font->renderer_addr)
|
||||
return CELL_FONT_ERROR_RENDERER_UNBIND;
|
||||
|
||||
@ -583,8 +554,6 @@ int cellFontRenderCharGlyphImage(mem_ptr_t<CellFont> font, u32 code, mem_ptr_t<C
|
||||
cellFont->Log("cellFontRenderCharGlyphImage(font_addr=0x%x, code=0x%x, surface_addr=0x%x, x=%f, y=%f, metrics_addr=0x%x, trans_addr=0x%x)",
|
||||
font.GetAddr(), code, surface.GetAddr(), x, y, metrics.GetAddr(), transInfo.GetAddr());
|
||||
|
||||
if (!font.IsGood() || !surface.IsGood() || !metrics.IsGood() || !transInfo.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
if (!font->renderer_addr)
|
||||
return CELL_FONT_ERROR_RENDERER_UNBIND;
|
||||
|
||||
@ -629,7 +598,7 @@ int cellFontSetEffectSlant(mem_ptr_t<CellFont> font, float slantParam)
|
||||
slantParam = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
|
||||
cellFont->Log("cellFontSetEffectSlant(font_addr=0x%x, slantParam=%f)", font.GetAddr(), slantParam);
|
||||
|
||||
if (!font.IsGood() || slantParam < -1.0 || slantParam > 1.0)
|
||||
if (slantParam < -1.0 || slantParam > 1.0)
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
font->slant = slantParam;
|
||||
@ -640,21 +609,15 @@ int cellFontGetEffectSlant(mem_ptr_t<CellFont> font, mem32_t slantParam)
|
||||
{
|
||||
cellFont->Warning("cellFontSetEffectSlant(font_addr=0x%x, slantParam_addr=0x%x)", font.GetAddr(), slantParam.GetAddr());
|
||||
|
||||
if (!font.IsGood() || !slantParam.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
slantParam = font->slant; //Does this conversion from be_t<float> to *mem32_t work?
|
||||
return CELL_FONT_OK;
|
||||
}
|
||||
|
||||
int cellFontGetFontIdCode(mem_ptr_t<CellFont> font, u32 code, mem32_t fontId, mem32_t fontCode)
|
||||
{
|
||||
cellFont->Log("cellFontGetFontIdCode(font_addr=0x%x, code=0x%x, fontId_addr=0x%x, fontCode_addr=0x%x",
|
||||
cellFont->Todo("cellFontGetFontIdCode(font_addr=0x%x, code=0x%x, fontId_addr=0x%x, fontCode_addr=0x%x",
|
||||
font.GetAddr(), code, fontId.GetAddr(), fontCode.GetAddr());
|
||||
|
||||
if (!font.IsGood() || !fontId.IsGood()) //fontCode isn't used
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
// TODO: ?
|
||||
return CELL_FONT_OK;
|
||||
}
|
||||
@ -663,9 +626,6 @@ int cellFontCloseFont(mem_ptr_t<CellFont> font)
|
||||
{
|
||||
cellFont->Warning("cellFontCloseFont(font_addr=0x%x)", font.GetAddr());
|
||||
|
||||
if (!font.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
if (font->origin == CELL_FONT_OPEN_FONTSET ||
|
||||
font->origin == CELL_FONT_OPEN_FONT_FILE ||
|
||||
font->origin == CELL_FONT_OPEN_MEMORY)
|
||||
@ -679,9 +639,6 @@ int cellFontGetCharGlyphMetrics(mem_ptr_t<CellFont> font, u32 code, mem_ptr_t<Ce
|
||||
cellFont->Log("cellFontGetCharGlyphMetrics(font_addr=0x%x, code=0x%x, metrics_addr=0x%x",
|
||||
font.GetAddr(), code, metrics.GetAddr());
|
||||
|
||||
if (!font.IsGood() || metrics.IsGood())
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
|
||||
int x0, y0, x1, y1;
|
||||
int advanceWidth, leftSideBearing;
|
||||
float scale = stbtt_ScaleForPixelHeight(&(font->stbfont), font->scale_y);
|
||||
|
@ -46,8 +46,6 @@ int cellFontInitLibraryFreeTypeWithRevision(u64 revisionFlags, mem_ptr_t<CellFon
|
||||
cellFontFT->Warning("cellFontInitLibraryFreeTypeWithRevision(revisionFlags=0x%llx, config_addr=0x%x, lib_addr_addr=0x%x",
|
||||
revisionFlags, config.GetAddr(), lib_addr_addr);
|
||||
|
||||
if (!config.IsGood() || !Memory.IsGoodAddr(lib_addr_addr))
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
//if (s_fontInternalInstance->m_bInitialized)
|
||||
//return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
|
||||
|
@ -23,12 +23,6 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
||||
cellGame->Warning("cellGameBootCheck(type_addr=0x%x, attributes_addr=0x%x, size_addr=0x%x, dirName_addr=0x%x)",
|
||||
type.GetAddr(), attributes.GetAddr(), size.GetAddr(), dirName.GetAddr());
|
||||
|
||||
if (!type.IsGood() || !attributes.IsGood() || !size.IsGood() || (dirName.GetAddr() && !dirName.IsGood()))
|
||||
{
|
||||
cellGame->Error("cellGameBootCheck(): CELL_GAME_ERROR_PARAM");
|
||||
return CELL_GAME_ERROR_PARAM;
|
||||
}
|
||||
|
||||
// TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
||||
size->hddFreeSizeKB = 40000000; // 40 GB
|
||||
|
||||
@ -90,7 +84,7 @@ int cellGamePatchCheck(mem_ptr_t<CellGameContentSize> size, u32 reserved_addr)
|
||||
{
|
||||
cellGame->Warning("cellGamePatchCheck(size_addr=0x%x, reserved_addr=0x%x)", size.GetAddr(), reserved_addr);
|
||||
|
||||
if (!size.IsGood() || reserved_addr != 0)
|
||||
if (reserved_addr != 0)
|
||||
{
|
||||
cellGame->Error("cellGamePatchCheck(): CELL_GAME_ERROR_PARAM");
|
||||
return CELL_GAME_ERROR_PARAM;
|
||||
@ -135,7 +129,7 @@ int cellGameDataCheck(u32 type, const mem_list_ptr_t<u8> dirName, mem_ptr_t<Cell
|
||||
{
|
||||
cellGame->Warning("cellGameDataCheck(type=0x%x, dirName_addr=0x%x, size_addr=0x%x)", type, dirName.GetAddr(), size.GetAddr());
|
||||
|
||||
if ((type - 1) >= 3 || !size.IsGood() || !dirName.IsGood())
|
||||
if ((type - 1) >= 3)
|
||||
{
|
||||
cellGame->Error("cellGameDataCheck(): CELL_GAME_ERROR_PARAM");
|
||||
return CELL_GAME_ERROR_PARAM;
|
||||
@ -181,12 +175,6 @@ int cellGameContentPermit(mem_list_ptr_t<u8> contentInfoPath, mem_list_ptr_t<u8>
|
||||
cellGame->Warning("cellGameContentPermit(contentInfoPath_addr=0x%x, usrdirPath_addr=0x%x)",
|
||||
contentInfoPath.GetAddr(), usrdirPath.GetAddr());
|
||||
|
||||
if (!contentInfoPath.IsGood() || !usrdirPath.IsGood())
|
||||
{
|
||||
cellGame->Error("cellGameContentPermit(): CELL_GAME_ERROR_PARAM");
|
||||
return CELL_GAME_ERROR_PARAM;
|
||||
}
|
||||
|
||||
if (contentInfo == "" && usrdir == "")
|
||||
{
|
||||
cellGame->Warning("cellGameContentPermit(): CELL_GAME_ERROR_FAILURE (no permission given)");
|
||||
@ -209,7 +197,7 @@ int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t<u8> dirName, u32
|
||||
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);
|
||||
|
||||
if (version != CELL_GAMEDATA_VERSION_CURRENT || !dirName.IsGood() || errDialog > 1 || !funcStat.IsGood())
|
||||
if (version != CELL_GAMEDATA_VERSION_CURRENT || errDialog > 1)
|
||||
{
|
||||
cellGame->Error("cellGameDataCheckCreate2(): CELL_GAMEDATA_ERROR_PARAM");
|
||||
return CELL_GAMEDATA_ERROR_PARAM;
|
||||
@ -336,9 +324,6 @@ int cellGameGetParamInt(u32 id, mem32_t value)
|
||||
{
|
||||
cellGame->Warning("cellGameGetParamInt(id=%d, value_addr=0x%x)", id, value.GetAddr());
|
||||
|
||||
if(!value.IsGood())
|
||||
return CELL_GAME_ERROR_PARAM;
|
||||
|
||||
// TODO: Access through cellGame***Check functions
|
||||
vfsFile f("/app_home/PARAM.SFO");
|
||||
PSFLoader psf(f);
|
||||
@ -362,9 +347,6 @@ int cellGameGetParamString(u32 id, u32 buf_addr, u32 bufsize)
|
||||
{
|
||||
cellGame->Warning("cellGameGetParamString(id=%d, buf_addr=0x%x, bufsize=%d)", id, buf_addr, bufsize);
|
||||
|
||||
if(!Memory.IsGoodAddr(buf_addr))
|
||||
return CELL_GAME_ERROR_PARAM;
|
||||
|
||||
// TODO: Access through cellGame***Check functions
|
||||
vfsFile f("/app_home/PARAM.SFO");
|
||||
PSFLoader psf(f);
|
||||
@ -437,9 +419,6 @@ int cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, u32 dirName_addr)
|
||||
{
|
||||
cellGame->Warning("cellGameContentErrorDialog(type=%d, errNeedSizeKB=%d, dirName_addr=0x%x)", type, errNeedSizeKB, dirName_addr);
|
||||
|
||||
if (Memory.IsGoodAddr(dirName_addr))
|
||||
return CELL_GAME_ERROR_PARAM;
|
||||
|
||||
char* dirName = (char*)Memory.VirtualToRealAddr(dirName_addr);
|
||||
std::string errorName;
|
||||
switch(type)
|
||||
|
@ -243,12 +243,6 @@ int cellGcmGetConfiguration(mem_ptr_t<CellGcmConfig> config)
|
||||
{
|
||||
cellGcmSys->Log("cellGcmGetConfiguration(config_addr=0x%x)", config.GetAddr());
|
||||
|
||||
if (!config.IsGood())
|
||||
{
|
||||
cellGcmSys->Error("cellGcmGetConfiguration : CELL_EFAULT");
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
*config = current_config;
|
||||
|
||||
return CELL_OK;
|
||||
@ -413,11 +407,6 @@ void cellGcmSetFlipHandler(u32 handler_addr)
|
||||
{
|
||||
cellGcmSys->Warning("cellGcmSetFlipHandler(handler_addr=%d)", handler_addr);
|
||||
|
||||
if (handler_addr != 0 && !Memory.IsGoodAddr(handler_addr))
|
||||
{
|
||||
cellGcmSys->Error("cellGcmSetFlipHandler(handler_addr=%d): invalid address", handler_addr);
|
||||
}
|
||||
|
||||
Emu.GetGSManager().GetRender().m_flip_handler.SetAddr(handler_addr);
|
||||
}
|
||||
|
||||
@ -562,11 +551,6 @@ void cellGcmSetUserHandler(u32 handler_addr)
|
||||
{
|
||||
cellGcmSys->Warning("cellGcmSetUserHandler(handler_addr=0x%x)", handler_addr);
|
||||
|
||||
if (handler_addr != 0 && !Memory.IsGoodAddr(handler_addr))
|
||||
{
|
||||
cellGcmSys->Error("cellGcmSetUserHandler(handler_addr=%d): invalid address", handler_addr);
|
||||
}
|
||||
|
||||
Emu.GetGSManager().GetRender().m_user_handler.SetAddr(handler_addr);
|
||||
}
|
||||
|
||||
@ -574,11 +558,6 @@ void cellGcmSetVBlankHandler(u32 handler_addr)
|
||||
{
|
||||
cellGcmSys->Warning("cellGcmSetVBlankHandler(handler_addr=0x%x)", handler_addr);
|
||||
|
||||
if (handler_addr != 0 && !Memory.IsGoodAddr(handler_addr))
|
||||
{
|
||||
cellGcmSys->Error("cellGcmSetVBlankHandler(handler_addr=%d): invalid address", handler_addr);
|
||||
}
|
||||
|
||||
Emu.GetGSManager().GetRender().m_vblank_handler.SetAddr(handler_addr);
|
||||
}
|
||||
|
||||
@ -673,12 +652,6 @@ int cellGcmGetCurrentDisplayBufferId(u32 id_addr)
|
||||
{
|
||||
cellGcmSys->Warning("cellGcmGetCurrentDisplayBufferId(id_addr=0x%x)", id_addr);
|
||||
|
||||
if (!Memory.IsGoodAddr(id_addr))
|
||||
{
|
||||
cellGcmSys->Error("cellGcmGetCurrentDisplayBufferId : CELL_EFAULT");
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
Memory.Write32(id_addr, Emu.GetGSManager().GetRender().m_gcm_current_buffer);
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -27,9 +27,6 @@ int cellGifDecExtCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam, u
|
||||
|
||||
int cellGifDecOpen(u32 mainHandle, mem32_t subHandle, const mem_ptr_t<CellGifDecSrc> src, mem_ptr_t<CellGifDecOpnInfo> openInfo)
|
||||
{
|
||||
if (!subHandle.IsGood() || !src.IsGood())
|
||||
return CELL_GIFDEC_ERROR_ARG;
|
||||
|
||||
CellGifDecSubHandle *current_subHandle = new CellGifDecSubHandle;
|
||||
current_subHandle->fd = 0;
|
||||
current_subHandle->src = *src;
|
||||
@ -63,9 +60,6 @@ int cellGifDecOpen(u32 mainHandle, mem32_t subHandle, const mem_ptr_t<CellGifDec
|
||||
|
||||
int cellGifDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellGifDecInfo> info)
|
||||
{
|
||||
if (!info.IsGood())
|
||||
return CELL_GIFDEC_ERROR_ARG;
|
||||
|
||||
CellGifDecSubHandle* subHandle_data;
|
||||
if(!cellGifDec->CheckId(subHandle, subHandle_data))
|
||||
return CELL_GIFDEC_ERROR_FATAL;
|
||||
@ -116,9 +110,6 @@ int cellGifDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellGifDecInfo
|
||||
|
||||
int cellGifDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellGifDecInParam> inParam, mem_ptr_t<CellGifDecOutParam> outParam)
|
||||
{
|
||||
if (!inParam.IsGood() || !outParam.IsGood())
|
||||
return CELL_GIFDEC_ERROR_ARG;
|
||||
|
||||
CellGifDecSubHandle* subHandle_data;
|
||||
if(!cellGifDec->CheckId(subHandle, subHandle_data))
|
||||
return CELL_GIFDEC_ERROR_FATAL;
|
||||
@ -146,9 +137,6 @@ int cellGifDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellGi
|
||||
|
||||
int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellGifDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellGifDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
if (!data.IsGood() || !dataCtrlParam.IsGood() || !dataOutInfo.IsGood())
|
||||
return CELL_GIFDEC_ERROR_ARG;
|
||||
|
||||
dataOutInfo->status = CELL_GIFDEC_DEC_STATUS_STOP;
|
||||
|
||||
CellGifDecSubHandle* subHandle_data;
|
||||
|
@ -33,9 +33,6 @@ int cellJpgDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t<CellJpgDecSrc> s
|
||||
cellJpgDec->Warning("cellJpgDecOpen(mainHandle=0x%x, subHandle=0x%x, src_addr=0x%x, openInfo=0x%x)",
|
||||
mainHandle, subHandle.GetAddr(), src.GetAddr(), openInfo);
|
||||
|
||||
if (!subHandle.IsGood() || !src.IsGood())
|
||||
return CELL_JPGDEC_ERROR_ARG;
|
||||
|
||||
CellJpgDecSubHandle *current_subHandle = new CellJpgDecSubHandle;
|
||||
|
||||
current_subHandle->fd = 0;
|
||||
@ -84,9 +81,6 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellJpgDecInfo
|
||||
{
|
||||
cellJpgDec->Log("cellJpgDecReadHeader(mainHandle=0x%x, subHandle=0x%x, info_addr=0x%llx)", mainHandle, subHandle, info.GetAddr());
|
||||
|
||||
if (!info.IsGood())
|
||||
return CELL_JPGDEC_ERROR_ARG;
|
||||
|
||||
CellJpgDecSubHandle* subHandle_data;
|
||||
if(!cellJpgDec->CheckId(subHandle, subHandle_data))
|
||||
return CELL_JPGDEC_ERROR_FATAL;
|
||||
@ -155,9 +149,6 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellJpgDecInfo
|
||||
|
||||
int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellJpgDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellJpgDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
if (!data.IsGood() || !dataCtrlParam.IsGood() || !dataOutInfo.IsGood())
|
||||
return CELL_JPGDEC_ERROR_ARG;
|
||||
|
||||
dataOutInfo->status = CELL_JPGDEC_DEC_STATUS_STOP;
|
||||
CellJpgDecSubHandle* subHandle_data;
|
||||
if(!cellJpgDec->CheckId(subHandle, subHandle_data))
|
||||
@ -302,9 +293,6 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
|
||||
|
||||
int cellJpgDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellJpgDecInParam> inParam, mem_ptr_t<CellJpgDecOutParam> outParam)
|
||||
{
|
||||
if (!inParam.IsGood() || !outParam.IsGood())
|
||||
return CELL_JPGDEC_ERROR_ARG;
|
||||
|
||||
CellJpgDecSubHandle* subHandle_data;
|
||||
if(!cellJpgDec->CheckId(subHandle, subHandle_data))
|
||||
return CELL_JPGDEC_ERROR_FATAL;
|
||||
|
@ -41,16 +41,13 @@ int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t
|
||||
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());
|
||||
|
||||
if (!utf16.IsGood() || !utf16_len.IsGood() || !utf8_len.IsGood())
|
||||
return SRCIllegal;
|
||||
|
||||
std::u16string wstr =(char16_t*)Memory.VirtualToRealAddr(utf16.GetAddr());
|
||||
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;
|
||||
std::string str = convert.to_bytes(wstr);
|
||||
|
||||
if (!utf8.IsGood() || utf8_len.GetValue() < str.size())
|
||||
if (utf8_len.GetValue() < str.size())
|
||||
{
|
||||
utf8_len = str.size();
|
||||
return DSTExhausted;
|
||||
@ -64,12 +61,7 @@ int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t
|
||||
|
||||
int jstrchk(mem8_ptr_t jstr)
|
||||
{
|
||||
if (!jstr.IsGood())
|
||||
cellL10n->Error("jstrchk(jstr_addr=0x%x): invalid address", jstr.GetAddr());
|
||||
else if (jstr[0])
|
||||
cellL10n->Log("jstrchk(jstr_addr=0x%x): utf-8: [%s]", jstr.GetAddr(), Memory.ReadString(jstr.GetAddr()).c_str());
|
||||
else
|
||||
cellL10n->Log("jstrchk(jstr_addr=0x%x): empty string", jstr.GetAddr());
|
||||
cellL10n->Warning("jstrchk(jstr_addr=0x%x) -> utf8", jstr.GetAddr());
|
||||
|
||||
return L10N_STR_UTF8;
|
||||
}
|
||||
|
@ -31,11 +31,6 @@ int cellMsgDialogOpen2(u32 type, mem_list_ptr_t<u8> msgString, mem_func_ptr_t<Ce
|
||||
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);
|
||||
|
||||
if (!msgString.IsGood() || !callback.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
//type |= CELL_MSGDIALOG_TYPE_PROGRESSBAR_SINGLE;
|
||||
//type |= CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO;
|
||||
|
||||
@ -356,13 +351,6 @@ int cellMsgDialogAbort()
|
||||
|
||||
int cellMsgDialogProgressBarSetMsg(u32 progressBarIndex, mem_list_ptr_t<u8> msgString)
|
||||
{
|
||||
if (!msgString.IsGood())
|
||||
{
|
||||
cellSysutil->Error("cellMsgDialogProgressBarSetMsg(progressBarIndex=%d, msgString_addr=0x%x): CELL_EFAULT",
|
||||
progressBarIndex, msgString.GetAddr());
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
cellSysutil->Warning("cellMsgDialogProgressBarSetMsg(progressBarIndex=%d, msgString_addr=0x%x): '%s'",
|
||||
progressBarIndex, msgString.GetAddr(), msgString.GetString());
|
||||
|
||||
|
@ -26,12 +26,6 @@ int cellNetCtlGetState(mem32_t state)
|
||||
{
|
||||
cellNetCtl->Log("cellNetCtlGetState(state_addr=0x%x)", state.GetAddr());
|
||||
|
||||
if (!state.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetState : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
state = CELL_NET_CTL_STATE_Disconnected; // TODO: Allow other states
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -58,12 +52,6 @@ int cellNetCtlNetStartDialogLoadAsync(mem_ptr_t<CellNetCtlNetStartDialogParam> p
|
||||
{
|
||||
cellNetCtl->Todo("cellNetCtlNetStartDialogLoadAsync(param_addr=0x%x)", param.GetAddr());
|
||||
|
||||
if (!param.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlNetStartDialogLoadAsync : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -77,12 +65,6 @@ int cellNetCtlNetStartDialogUnloadAsync(mem_ptr_t<CellNetCtlNetStartDialogResult
|
||||
{
|
||||
cellNetCtl->Todo("cellNetCtlNetStartDialogUnloadAsync(result_addr=0x%x)", result.GetAddr());
|
||||
|
||||
if (!result.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlNetStartDialogLoadAsync : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -90,12 +72,6 @@ int cellNetCtlGetNatInfo(mem_ptr_t<CellNetCtlNatInfo> natInfo)
|
||||
{
|
||||
cellNetCtl->Todo("cellNetCtlGetNatInfo(natInfo_addr=0x%x)", natInfo.GetAddr());
|
||||
|
||||
if (!natInfo.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetNatInfo : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
if (natInfo->size == 0)
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetNatInfo : CELL_NET_CTL_ERROR_INVALID_SIZE");
|
||||
|
@ -132,12 +132,6 @@ int cellPamfGetHeaderSize(mem_ptr_t<PamfHeader> pAddr, u64 fileSize, mem64_t pSi
|
||||
{
|
||||
cellPamf->Warning("cellPamfGetHeaderSize(pAddr=0x%x, fileSize=%d, pSize_addr=0x%x)", pAddr.GetAddr(), fileSize, pSize.GetAddr());
|
||||
|
||||
if (!Memory.IsGoodAddr(pAddr.GetAddr(), 2048) || !pSize.IsGood())
|
||||
{
|
||||
cellPamf->Error("cellPamfGetHeaderSize: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//if ((u32)pAddr->magic != 0x464d4150)
|
||||
//return CELL_PAMF_ERROR_UNKNOWN_TYPE;
|
||||
|
||||
@ -150,12 +144,6 @@ int cellPamfGetHeaderSize2(mem_ptr_t<PamfHeader> pAddr, u64 fileSize, u32 attrib
|
||||
{
|
||||
cellPamf->Warning("cellPamfGetHeaderSize2(pAddr=0x%x, fileSize=%d, attribute=0x%x, pSize_addr=0x%x)", pAddr.GetAddr(), fileSize, attribute, pSize.GetAddr());
|
||||
|
||||
if (!Memory.IsGoodAddr(pAddr.GetAddr(), 2048) || !pSize.IsGood())
|
||||
{
|
||||
cellPamf->Error("cellPamfGetHeaderSize2: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//if ((u32)pAddr->magic != 0x464d4150)
|
||||
//return CELL_PAMF_ERROR_UNKNOWN_TYPE;
|
||||
|
||||
@ -168,12 +156,6 @@ int cellPamfGetStreamOffsetAndSize(mem_ptr_t<PamfHeader> pAddr, u64 fileSize, me
|
||||
{
|
||||
cellPamf->Warning("cellPamfGetStreamOffsetAndSize(pAddr=0x%x, fileSize=%d, pOffset_addr=0x%x, pSize_addr=0x%x)", pAddr.GetAddr(), fileSize, pOffset.GetAddr(), pSize.GetAddr());
|
||||
|
||||
if (!Memory.IsGoodAddr(pAddr.GetAddr(), 2048) || !pOffset.IsGood() || !pSize.IsGood())
|
||||
{
|
||||
cellPamf->Error("cellPamfGetStreamOffsetAndSize: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//if ((u32)pAddr->magic != 0x464d4150)
|
||||
//return CELL_PAMF_ERROR_UNKNOWN_TYPE;
|
||||
|
||||
@ -188,12 +170,6 @@ int cellPamfVerify(mem_ptr_t<PamfHeader> pAddr, u64 fileSize)
|
||||
{
|
||||
cellPamf->Warning("cellPamfVerify(pAddr=0x%x, fileSize=%d)", pAddr.GetAddr(), fileSize);
|
||||
|
||||
if (!Memory.IsGoodAddr(pAddr.GetAddr(), 2048))
|
||||
{
|
||||
cellPamf->Error("cellPamfVerify: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -201,13 +177,6 @@ int cellPamfReaderInitialize(mem_ptr_t<CellPamfReader> pSelf, mem_ptr_t<PamfHead
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderInitialize(pSelf=0x%x, pAddr=0x%x, fileSize=%d, attribute=0x%x)", pSelf.GetAddr(), pAddr.GetAddr(), fileSize, attribute);
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pAddr.GetAddr(), 2048))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderInitialize: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
|
||||
}
|
||||
|
||||
if (fileSize)
|
||||
{
|
||||
pSelf->fileSize = fileSize;
|
||||
@ -231,12 +200,6 @@ int cellPamfReaderGetPresentationStartTime(mem_ptr_t<CellPamfReader> pSelf, mem_
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetPresentationStartTime(pSelf=0x%x, pTimeStamp_addr=0x%x)", pSelf.GetAddr(), pTimeStamp.GetAddr());
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetPresentationStartTime: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
const u32 upper = (u16)pAddr->start_pts_high;
|
||||
pTimeStamp->upper = upper;
|
||||
@ -248,12 +211,6 @@ int cellPamfReaderGetPresentationEndTime(mem_ptr_t<CellPamfReader> pSelf, mem_pt
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetPresentationEndTime(pSelf=0x%x, pTimeStamp_addr=0x%x)", pSelf.GetAddr(), pTimeStamp.GetAddr());
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetPresentationEndTime: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
const u32 upper = (u16)pAddr->end_pts_high;
|
||||
pTimeStamp->upper = upper;
|
||||
@ -265,12 +222,6 @@ int cellPamfReaderGetMuxRateBound(mem_ptr_t<CellPamfReader> pSelf)
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetMuxRateBound(pSelf=0x%x)", pSelf.GetAddr());
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetMuxRateBound: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
return pAddr->mux_rate_max;
|
||||
}
|
||||
@ -279,12 +230,6 @@ int cellPamfReaderGetNumberOfStreams(mem_ptr_t<CellPamfReader> pSelf)
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetNumberOfStreams(pSelf=0x%x)", pSelf.GetAddr());
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetNumberOfStreams: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
return pAddr->stream_count;
|
||||
}
|
||||
@ -293,12 +238,6 @@ int cellPamfReaderGetNumberOfSpecificStreams(mem_ptr_t<CellPamfReader> pSelf, u8
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetNumberOfSpecificStreams(pSelf=0x%x, streamType=%d)", pSelf.GetAddr(), streamType);
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetNumberOfSpecificStreams: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
|
||||
int counts[6] = {0, 0, 0, 0, 0, 0};
|
||||
@ -330,12 +269,6 @@ int cellPamfReaderSetStreamWithIndex(mem_ptr_t<CellPamfReader> pSelf, u8 streamI
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderSetStreamWithIndex(pSelf=0x%x, streamIndex=%d)", pSelf.GetAddr(), streamIndex);
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderSetStreamWithIndex: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
|
||||
if (streamIndex < pAddr->stream_count)
|
||||
@ -354,12 +287,6 @@ int cellPamfReaderSetStreamWithTypeAndChannel(mem_ptr_t<CellPamfReader> pSelf, u
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderSetStreamWithTypeAndChannel(pSelf=0x%x, streamType=%d, ch=%d)", pSelf.GetAddr(), streamType, ch);
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderSetStreamWithTypeAndChannel: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
|
||||
if (streamType > 5)
|
||||
@ -388,12 +315,6 @@ int cellPamfReaderSetStreamWithTypeAndIndex(mem_ptr_t<CellPamfReader> pSelf, u8
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderSetStreamWithTypeAndIndex(pSelf=0x%x, streamType=%d, streamIndex=%d)", pSelf.GetAddr(), streamType, streamIndex);
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderSetStreamWithTypeAndIndex: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
|
||||
u32 found = 0;
|
||||
@ -441,12 +362,6 @@ int cellPamfStreamTypeToEsFilterId(u8 type, u8 ch, mem_ptr_t<CellCodecEsFilterId
|
||||
{
|
||||
cellPamf->Warning("cellPamfStreamTypeToEsFilterId(type=%d, ch=%d, pEsFilterId_addr=0x%x)", type, ch, pEsFilterId.GetAddr());
|
||||
|
||||
if (!pEsFilterId.IsGood())
|
||||
{
|
||||
cellPamf->Error("cellPamfStreamTypeToEsFilterId: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
return pamfStreamTypeToEsFilterId(type, ch, pEsFilterId);
|
||||
}
|
||||
|
||||
@ -454,12 +369,6 @@ int cellPamfReaderGetStreamIndex(mem_ptr_t<CellPamfReader> pSelf)
|
||||
{
|
||||
cellPamf->Log("cellPamfReaderGetStreamIndex(pSelf=0x%x)", pSelf.GetAddr());
|
||||
|
||||
if (!pSelf.IsGood())
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetStreamIndex: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
return pSelf->stream;
|
||||
}
|
||||
|
||||
@ -467,12 +376,6 @@ int cellPamfReaderGetStreamTypeAndChannel(mem_ptr_t<CellPamfReader> pSelf, mem8_
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetStreamTypeAndChannel(pSelf=0x%x (stream=%d), pType_addr=0x%x, pCh_addr=0x%x", pSelf.GetAddr(), pSelf->stream, pType.GetAddr(), pCh.GetAddr());
|
||||
|
||||
if (!pSelf.IsGood() || !pCh.IsGood())
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetStreamTypeAndChannel: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
pType = pamfGetStreamType(pSelf, pSelf->stream);
|
||||
pCh = pamfGetStreamChannel(pSelf, pSelf->stream);
|
||||
return CELL_OK;
|
||||
@ -482,12 +385,6 @@ int cellPamfReaderGetEsFilterId(mem_ptr_t<CellPamfReader> pSelf, mem_ptr_t<CellC
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetEsFilterId(pSelf=0x%x (stream=%d), pEsFilterId_addr=0x%x)", pSelf.GetAddr(), pSelf->stream, pEsFilterId.GetAddr());
|
||||
|
||||
if (!pSelf.IsGood() || !pEsFilterId.IsGood())
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetEsFilterId: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
return pamfStreamTypeToEsFilterId(pamfGetStreamType(pSelf, pSelf->stream),
|
||||
pamfGetStreamChannel(pSelf, pSelf->stream), pEsFilterId);
|
||||
}
|
||||
@ -496,12 +393,6 @@ int cellPamfReaderGetStreamInfo(mem_ptr_t<CellPamfReader> pSelf, u32 pInfo_addr,
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetStreamInfo(pSelf=0x%x, stream=%d, pInfo_addr=0x%x, size=%d)", pSelf.GetAddr(), pSelf->stream, pInfo_addr, size);
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetStreamInfo: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
|
||||
memset(Memory + pInfo_addr, 0, size);
|
||||
@ -609,12 +500,6 @@ int cellPamfReaderGetNumberOfEp(mem_ptr_t<CellPamfReader> pSelf)
|
||||
{
|
||||
cellPamf->Warning("cellPamfReaderGetNumberOfEp(pSelf=0x%x, stream=%d)", pSelf.GetAddr(), pSelf->stream);
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetNumberOfEp: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
return pAddr->stream_headers[pSelf->stream].ep_num;
|
||||
}
|
||||
@ -623,12 +508,6 @@ int cellPamfReaderGetEpIteratorWithIndex(mem_ptr_t<CellPamfReader> pSelf, u32 ep
|
||||
{
|
||||
cellPamf->Todo("cellPamfReaderGetEpIteratorWithIndex(pSelf=0x%x, stream=%d, epIndex=%d, pIt_addr=0x%x)", pSelf.GetAddr(), pSelf->stream, epIndex, pIt.GetAddr());
|
||||
|
||||
if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr))
|
||||
{
|
||||
cellPamf->Error("cellPamfReaderGetEpIteratorWithIndex: CELL_PAMF_ERROR_INVALID_ARG");
|
||||
return CELL_PAMF_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);
|
||||
//TODO:
|
||||
return CELL_OK;
|
||||
|
@ -56,9 +56,6 @@ int cellPngDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t<CellPngDecSrc> s
|
||||
cellPngDec->Warning("cellPngDecOpen(mainHandle=0x%x, subHandle=0x%x, src_addr=0x%x, openInfo=0x%x)",
|
||||
mainHandle, subHandle.GetAddr(), src.GetAddr(), openInfo);
|
||||
|
||||
if (!subHandle.IsGood() || !src.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
CellPngDecSubHandle *current_subHandle = new CellPngDecSubHandle;
|
||||
current_subHandle->fd = 0;
|
||||
current_subHandle->src = *src;
|
||||
@ -123,9 +120,6 @@ int cellPngDecClose(u32 mainHandle, u32 subHandle)
|
||||
|
||||
int cellPngDecReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellPngDecInfo> info)
|
||||
{
|
||||
if (!info.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
cellPngDec->Warning("cellPngDecReadHeader(mainHandle=0x%x, subHandle=0x%x, info_addr=0x%x)", mainHandle, subHandle, info.GetAddr());
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec->CheckId(subHandle, subHandle_data))
|
||||
@ -195,9 +189,6 @@ int cellPngDecExtReadHeader(u32 mainHandle, u32 subHandle, mem_ptr_t<CellPngDecI
|
||||
|
||||
int cellPngDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const mem_ptr_t<CellPngDecDataCtrlParam> dataCtrlParam, mem_ptr_t<CellPngDecDataOutInfo> dataOutInfo)
|
||||
{
|
||||
if (!data.IsGood() || !dataCtrlParam.IsGood() || !dataOutInfo.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
dataOutInfo->status = CELL_PNGDEC_DEC_STATUS_STOP;
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec->CheckId(subHandle, subHandle_data))
|
||||
@ -346,9 +337,6 @@ int cellPngDecExtDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, cons
|
||||
|
||||
int cellPngDecSetParameter(u32 mainHandle, u32 subHandle, const mem_ptr_t<CellPngDecInParam> inParam, mem_ptr_t<CellPngDecOutParam> outParam)
|
||||
{
|
||||
if (!inParam.IsGood() || !outParam.IsGood())
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
|
||||
CellPngDecSubHandle* subHandle_data;
|
||||
if(!cellPngDec->CheckId(subHandle, subHandle_data))
|
||||
return CELL_PNGDEC_ERROR_FATAL;
|
||||
|
@ -640,7 +640,7 @@ int cellRescInit(mem_ptr_t<CellRescInitConfig> initConfig)
|
||||
return CELL_RESC_ERROR_REINITIALIZED;
|
||||
}
|
||||
|
||||
if (!initConfig.IsGood() || InternalVersion(initConfig.GetAddr()) == -1 || !CheckInitConfig(initConfig))
|
||||
if (InternalVersion(initConfig.GetAddr()) == -1 || !CheckInitConfig(initConfig))
|
||||
{
|
||||
cellResc->Error("cellRescInit : CELL_RESC_ERROR_BAD_ARGUMENT");
|
||||
return CELL_RESC_ERROR_BAD_ARGUMENT;
|
||||
@ -687,12 +687,6 @@ int cellRescVideoOutResolutionId2RescBufferMode(u32 resolutionId, mem32_t buffer
|
||||
{
|
||||
cellResc->Log("cellRescVideoOutResolutionId2RescBufferMode(resolutionId=%d, bufferMode_addr=0x%x)", resolutionId, bufferMode.GetAddr());
|
||||
|
||||
if (!bufferMode.IsGood())
|
||||
{
|
||||
cellResc->Error("cellRescVideoOutResolutionId2RescBufferMode : CELL_RESC_ERROR_BAD_ARGUMENT");
|
||||
return CELL_RESC_ERROR_BAD_ARGUMENT;
|
||||
}
|
||||
|
||||
switch (resolutionId)
|
||||
{
|
||||
case CELL_VIDEO_OUT_RESOLUTION_1080:
|
||||
@ -725,12 +719,6 @@ int cellRescSetDsts(u32 dstsMode, mem_ptr_t<CellRescDsts> dsts)
|
||||
return CELL_RESC_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!dsts.IsGood())
|
||||
{
|
||||
cellResc->Error("cellRescSetDst : CELL_RESC_ERROR_BAD_ARGUMENT");
|
||||
return CELL_RESC_ERROR_BAD_ARGUMENT;
|
||||
}
|
||||
|
||||
if ((dstsMode != CELL_RESC_720x480) && (dstsMode != CELL_RESC_720x576) && (dstsMode != CELL_RESC_1280x720) && (dstsMode != CELL_RESC_1920x1080))
|
||||
{
|
||||
cellResc->Error("cellRescSetDsts : CELL_RESC_ERROR_BAD_ARGUMENT");
|
||||
@ -958,17 +946,17 @@ int cellRescGetBufferSize(mem32_t colorBuffers, mem32_t vertexArray, mem32_t fra
|
||||
fragmentUcodeSize = 0x300;
|
||||
}
|
||||
|
||||
if (colorBuffers.IsGood())
|
||||
if (colorBuffers.GetAddr())
|
||||
{
|
||||
colorBuffers = colorBuffersSize;
|
||||
}
|
||||
|
||||
if (vertexArray.IsGood())
|
||||
if (vertexArray.GetAddr())
|
||||
{
|
||||
vertexArray = vertexArraySize;
|
||||
}
|
||||
|
||||
if (fragmentShader.IsGood())
|
||||
if (fragmentShader.GetAddr())
|
||||
{
|
||||
fragmentShader = fragmentUcodeSize;
|
||||
}
|
||||
@ -1001,12 +989,6 @@ int cellRescGcmSurface2RescSrc(mem_ptr_t<CellGcmSurface> gcmSurface, mem_ptr_t<C
|
||||
{
|
||||
cellResc->Log("cellRescGcmSurface2RescSrc(gcmSurface_addr=0x%x, rescSrc_addr=0x%x)", gcmSurface.GetAddr(), rescSrc.GetAddr());
|
||||
|
||||
if (!gcmSurface.IsGood() || !rescSrc.IsGood())
|
||||
{
|
||||
cellResc->Error("cellRescGcmSurface2RescSrc : CELL_RESC_ERROR_BAD_ARGUMENT");
|
||||
return CELL_RESC_ERROR_BAD_ARGUMENT;
|
||||
}
|
||||
|
||||
u8 textureFormat = GcmSurfaceFormat2GcmTextureFormat(gcmSurface->colorFormat, gcmSurface->type);
|
||||
s32 xW = 1, xH = 1;
|
||||
|
||||
@ -1044,7 +1026,7 @@ int cellRescSetSrc(s32 idx, mem_ptr_t<CellRescSrc> src)
|
||||
return CELL_RESC_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if(idx < 0 || SRC_BUFFER_NUM <= idx || !src.IsGood())
|
||||
if(idx < 0 || SRC_BUFFER_NUM <= idx)
|
||||
{
|
||||
cellResc->Error("cellRescSetSrc : CELL_RESC_ERROR_BAD_ARGUMENT");
|
||||
return CELL_RESC_ERROR_BAD_ARGUMENT;
|
||||
@ -1125,12 +1107,6 @@ int cellRescSetBufferAddress(mem32_t colorBuffers, mem32_t vertexArray, mem32_t
|
||||
return CELL_RESC_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if(!colorBuffers.IsGood() || !vertexArray.IsGood() || !fragmentShader.IsGood())
|
||||
{
|
||||
cellResc->Error("cellRescSetBufferAddress : CELL_RESC_ERROR_BAD_ARGUMENT");
|
||||
return CELL_RESC_ERROR_BAD_ARGUMENT;
|
||||
}
|
||||
|
||||
if(colorBuffers.GetAddr() % COLOR_BUFFER_ALIGNMENT || vertexArray.GetAddr() % VERTEX_BUFFER_ALIGNMENT || fragmentShader.GetAddr() % FRAGMENT_SHADER_ALIGNMENT)
|
||||
{
|
||||
cellResc->Error("cellRescSetBufferAddress : CELL_RESC_ERROR_BAD_ALIGNMENT");
|
||||
@ -1169,11 +1145,6 @@ void cellRescSetFlipHandler(u32 handler_addr)
|
||||
{
|
||||
cellResc->Warning("cellRescSetFlipHandler(handler_addr=0x%x)", handler_addr);
|
||||
|
||||
if (handler_addr != 0 && !Memory.IsGoodAddr(handler_addr))
|
||||
{
|
||||
cellResc->Error("cellRescSetFlipHandler(handler_addr=%d): invalid address", handler_addr);
|
||||
}
|
||||
|
||||
Emu.GetGSManager().GetRender().m_flip_handler.SetAddr(handler_addr);
|
||||
}
|
||||
|
||||
@ -1214,11 +1185,6 @@ void cellRescSetVBlankHandler(u32 handler_addr)
|
||||
{
|
||||
cellResc->Warning("cellRescSetVBlankHandler(handler_addr=0x%x)", handler_addr);
|
||||
|
||||
if (handler_addr != 0 && !Memory.IsGoodAddr(handler_addr))
|
||||
{
|
||||
cellResc->Error("cellRescSetVBlankHandler(handler_addr=%d): invalid address", handler_addr);
|
||||
}
|
||||
|
||||
Emu.GetGSManager().GetRender().m_vblank_handler.SetAddr(handler_addr);
|
||||
}
|
||||
|
||||
|
@ -26,9 +26,6 @@ int cellRtcGetCurrentTick(mem_ptr_t<CellRtcTick> pTick)
|
||||
{
|
||||
cellRtc->Log("cellRtcGetCurrentTick(pTick=0x%x)", pTick.GetAddr());
|
||||
|
||||
if (!pTick.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime unow = rDateTime::UNow();
|
||||
pTick->tick = unow.GetTicks();
|
||||
return CELL_OK;
|
||||
@ -38,9 +35,6 @@ int cellRtcGetCurrentClock(mem_ptr_t<CellRtcDateTime> pClock, s32 iTimeZone)
|
||||
{
|
||||
cellRtc->Log("cellRtcGetCurrentClock(pClock=0x%x, time_zone=%d)", pClock.GetAddr(), iTimeZone);
|
||||
|
||||
if (!pClock.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime unow = rDateTime::UNow();
|
||||
|
||||
// Add time_zone as offset in minutes.
|
||||
@ -62,9 +56,6 @@ int cellRtcGetCurrentClockLocalTime(mem_ptr_t<CellRtcDateTime> pClock)
|
||||
{
|
||||
cellRtc->Log("cellRtcGetCurrentClockLocalTime(pClock=0x%x)", pClock.GetAddr());
|
||||
|
||||
if (!pClock.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime unow = rDateTime::UNow();
|
||||
|
||||
pClock->year = unow.GetYear(rDateTime::TZ::Local);
|
||||
@ -82,9 +73,6 @@ int cellRtcFormatRfc2822(u32 pszDateTime_addr, mem_ptr_t<CellRtcTick> pUtc, s32
|
||||
{
|
||||
cellRtc->Log("cellRtcFormatRfc2822(pszDateTime_addr=0x%x, pUtc=0x%x, time_zone=%d)", pszDateTime_addr, pUtc.GetAddr(), iTimeZone);
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Add time_zone as offset in minutes.
|
||||
rTimeSpan tz = rTimeSpan(0, (long) iTimeZone, 0, 0);
|
||||
|
||||
@ -103,9 +91,6 @@ int cellRtcFormatRfc2822LocalTime(u32 pszDateTime_addr, mem_ptr_t<CellRtcTick> p
|
||||
{
|
||||
cellRtc->Log("cellRtcFormatRfc2822LocalTime(pszDateTime_addr=0x%x, pUtc=0x%x)", pszDateTime_addr, pUtc.GetAddr());
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Get date from ticks.
|
||||
rDateTime date = rDateTime((time_t)pUtc->tick);
|
||||
|
||||
@ -120,9 +105,6 @@ int cellRtcFormatRfc3339(u32 pszDateTime_addr, mem_ptr_t<CellRtcTick> pUtc, s32
|
||||
{
|
||||
cellRtc->Log("cellRtcFormatRfc3339(pszDateTime_addr=0x%x, pUtc=0x%x, iTimeZone=%d)", pszDateTime_addr, pUtc.GetAddr(), iTimeZone);
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Add time_zone as offset in minutes.
|
||||
rTimeSpan tz = rTimeSpan(0, (long) iTimeZone, 0, 0);
|
||||
|
||||
@ -141,9 +123,6 @@ int cellRtcFormatRfc3339LocalTime(u32 pszDateTime_addr, mem_ptr_t<CellRtcTick> p
|
||||
{
|
||||
cellRtc->Log("cellRtcFormatRfc3339LocalTime(pszDateTime_addr=0x%x, pUtc=0x%x)", pszDateTime_addr, pUtc.GetAddr());
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Get date from ticks.
|
||||
rDateTime date = rDateTime((time_t) pUtc->tick);
|
||||
|
||||
@ -158,9 +137,6 @@ int cellRtcParseDateTime(mem_ptr_t<CellRtcTick> pUtc, u32 pszDateTime_addr)
|
||||
{
|
||||
cellRtc->Log("cellRtcParseDateTime(pUtc=0x%x, pszDateTime_addr=0x%x)", pUtc.GetAddr(), pszDateTime_addr);
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Get date from formatted string.
|
||||
rDateTime date;
|
||||
const std::string& format = Memory.ReadString(pszDateTime_addr);
|
||||
@ -175,9 +151,6 @@ int cellRtcParseRfc3339(mem_ptr_t<CellRtcTick> pUtc, u32 pszDateTime_addr)
|
||||
{
|
||||
cellRtc->Log("cellRtcParseRfc3339(pUtc=0x%x, pszDateTime_addr=0x%x)", pUtc.GetAddr(), pszDateTime_addr);
|
||||
|
||||
if (!pUtc.IsGood() || !Memory.IsGoodAddr(pszDateTime_addr))
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// Get date from RFC3339 formatted string.
|
||||
rDateTime date;
|
||||
const std::string& format = Memory.ReadString(pszDateTime_addr);
|
||||
@ -192,9 +165,6 @@ int cellRtcGetTick(mem_ptr_t<CellRtcDateTime> pTime, mem_ptr_t<CellRtcTick> pTic
|
||||
{
|
||||
cellRtc->Log("cellRtcGetTick(pTime=0x%x, pTick=0x%x)", pTime.GetAddr(), pTick.GetAddr());
|
||||
|
||||
if (!pTime.IsGood() || !pTick.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime datetime = rDateTime(pTime->day, (rDateTime::Month)pTime->month.ToLE(), pTime->year, pTime->hour, pTime->minute, pTime->second, (pTime->microsecond / 1000));
|
||||
pTick->tick = datetime.GetTicks();
|
||||
|
||||
@ -205,9 +175,6 @@ int cellRtcSetTick(mem_ptr_t<CellRtcDateTime> pTime, mem_ptr_t<CellRtcTick> pTic
|
||||
{
|
||||
cellRtc->Log("cellRtcSetTick(pTime=0x%x, pTick=0x%x)", pTime.GetAddr(), pTick.GetAddr());
|
||||
|
||||
if (!pTime.IsGood() || !pTick.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick->tick);
|
||||
|
||||
pTime->year = date.GetYear(rDateTime::TZ::UTC);
|
||||
@ -225,9 +192,6 @@ int cellRtcTickAddTicks(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pT
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddTicks(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
pTick0->tick = pTick1->tick + lAdd;
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -236,9 +200,6 @@ int cellRtcTickAddMicroseconds(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcT
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddMicroseconds(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rTimeSpan microseconds = rTimeSpan(0, 0, 0, lAdd / 1000);
|
||||
date.Add(microseconds);
|
||||
@ -250,9 +211,6 @@ int cellRtcTickAddMicroseconds(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcT
|
||||
int cellRtcTickAddSeconds(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s64 lAdd)
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddSeconds(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rTimeSpan seconds = rTimeSpan(0, 0, lAdd, 0);
|
||||
@ -266,9 +224,6 @@ int cellRtcTickAddMinutes(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick>
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddMinutes(pTick0=0x%x, pTick1=0x%x, lAdd=%lld)", pTick0.GetAddr(), pTick1.GetAddr(), lAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rTimeSpan minutes = rTimeSpan(0, lAdd, 0, 0);
|
||||
date.Add(minutes);
|
||||
@ -280,9 +235,6 @@ int cellRtcTickAddMinutes(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick>
|
||||
int cellRtcTickAddHours(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddHours(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rTimeSpan hours = rTimeSpan(iAdd, 0, 0, 0);
|
||||
@ -295,9 +247,6 @@ int cellRtcTickAddHours(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pT
|
||||
int cellRtcTickAddDays(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddDays(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rDateSpan days = rDateSpan(0, 0, 0, iAdd);
|
||||
@ -310,9 +259,6 @@ int cellRtcTickAddDays(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTi
|
||||
int cellRtcTickAddWeeks(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddWeeks(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rDateSpan weeks = rDateSpan(0, 0, iAdd, 0);
|
||||
@ -325,9 +271,6 @@ int cellRtcTickAddWeeks(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pT
|
||||
int cellRtcTickAddMonths(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddMonths(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rDateSpan months = rDateSpan(0, iAdd, 0, 0);
|
||||
@ -340,9 +283,6 @@ int cellRtcTickAddMonths(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> p
|
||||
int cellRtcTickAddYears(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTick1, s32 iAdd)
|
||||
{
|
||||
cellRtc->Log("cellRtcTickAddYears(pTick0=0x%x, pTick1=0x%x, iAdd=%d)", pTick0.GetAddr(), pTick1.GetAddr(), iAdd);
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date = rDateTime((time_t)pTick1->tick);
|
||||
rDateSpan years = rDateSpan(iAdd, 0, 0, 0);
|
||||
@ -356,9 +296,6 @@ int cellRtcConvertUtcToLocalTime(mem_ptr_t<CellRtcTick> pUtc, mem_ptr_t<CellRtcT
|
||||
{
|
||||
cellRtc->Log("cellRtcConvertUtcToLocalTime(pUtc=0x%x, pLocalTime=0x%x)", pUtc.GetAddr(), pLocalTime.GetAddr());
|
||||
|
||||
if (!pUtc.IsGood() || !pLocalTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime time = rDateTime((time_t)pUtc->tick);
|
||||
rDateTime local_time = time.FromUTC(false);
|
||||
pLocalTime->tick = local_time.GetTicks();
|
||||
@ -369,9 +306,6 @@ int cellRtcConvertLocalTimeToUtc(mem_ptr_t<CellRtcTick> pLocalTime, mem_ptr_t<Ce
|
||||
{
|
||||
cellRtc->Log("cellRtcConvertLocalTimeToUtc(pLocalTime=0x%x, pUtc=0x%x)", pLocalTime.GetAddr(), pUtc.GetAddr());
|
||||
|
||||
if (!pLocalTime.IsGood() || !pUtc.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime time = rDateTime((time_t)pLocalTime->tick);
|
||||
rDateTime utc_time = time.ToUTC(false);
|
||||
pUtc->tick = utc_time.GetTicks();
|
||||
@ -382,9 +316,6 @@ int cellRtcGetDosTime(mem_ptr_t<CellRtcDateTime> pDateTime, mem32_t puiDosTime)
|
||||
{
|
||||
cellRtc->Log("cellRtcGetDosTime(pDateTime=0x%x, puiDosTime=0x%x)", pDateTime.GetAddr(), puiDosTime.GetAddr());
|
||||
|
||||
if (!pDateTime.IsGood() || !puiDosTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// 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));
|
||||
puiDosTime = date_time.GetAsDOS();
|
||||
@ -396,9 +327,6 @@ int cellRtcGetTime_t(mem_ptr_t<CellRtcDateTime> pDateTime, mem64_t piTime)
|
||||
{
|
||||
cellRtc->Log("cellRtcGetTime_t(pDateTime=0x%x, piTime=0x%x)", pDateTime.GetAddr(), piTime.GetAddr());
|
||||
|
||||
if (!pDateTime.IsGood() || !piTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// 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));
|
||||
piTime = convertToUNIXTime(date_time.GetSecond(rDateTime::TZ::UTC), date_time.GetMinute(rDateTime::TZ::UTC),
|
||||
@ -411,9 +339,6 @@ int cellRtcGetWin32FileTime(mem_ptr_t<CellRtcDateTime> pDateTime, mem64_t pulWin
|
||||
{
|
||||
cellRtc->Log("cellRtcGetWin32FileTime(pDateTime=0x%x, pulWin32FileTime=0x%x)", pDateTime.GetAddr(), pulWin32FileTime.GetAddr());
|
||||
|
||||
if (!pDateTime.IsGood() || !pulWin32FileTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
// 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));
|
||||
pulWin32FileTime = convertToWin32FILETIME(date_time.GetSecond(rDateTime::TZ::UTC), date_time.GetMinute(rDateTime::TZ::UTC),
|
||||
@ -425,9 +350,6 @@ int cellRtcGetWin32FileTime(mem_ptr_t<CellRtcDateTime> pDateTime, mem64_t pulWin
|
||||
int cellRtcSetDosTime(mem_ptr_t<CellRtcDateTime> pDateTime, u32 uiDosTime)
|
||||
{
|
||||
cellRtc->Log("cellRtcSetDosTime(pDateTime=0x%x, uiDosTime=0x%x)", pDateTime.GetAddr(), uiDosTime);
|
||||
|
||||
if (!pDateTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date_time;
|
||||
rDateTime dos_time = date_time.SetFromDOS(uiDosTime);
|
||||
@ -446,9 +368,6 @@ int cellRtcSetDosTime(mem_ptr_t<CellRtcDateTime> pDateTime, u32 uiDosTime)
|
||||
int cellRtcSetTime_t(mem_ptr_t<CellRtcDateTime> pDateTime, u64 iTime)
|
||||
{
|
||||
cellRtc->Log("cellRtcSetTime_t(pDateTime=0x%x, iTime=0x%llx)", pDateTime.GetAddr(), iTime);
|
||||
|
||||
if (!pDateTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date_time = rDateTime((time_t)iTime);
|
||||
|
||||
@ -466,9 +385,6 @@ int cellRtcSetTime_t(mem_ptr_t<CellRtcDateTime> pDateTime, u64 iTime)
|
||||
int cellRtcSetWin32FileTime(mem_ptr_t<CellRtcDateTime> pDateTime, u64 ulWin32FileTime)
|
||||
{
|
||||
cellRtc->Log("cellRtcSetWin32FileTime(pDateTime=0x%x, ulWin32FileTime=0x%llx)", pDateTime, ulWin32FileTime);
|
||||
|
||||
if (!pDateTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
rDateTime date_time = rDateTime((time_t)ulWin32FileTime);
|
||||
|
||||
@ -511,9 +427,6 @@ int cellRtcGetDayOfWeek(s32 year, s32 month, s32 day)
|
||||
int cellRtcCheckValid(mem_ptr_t<CellRtcDateTime> pTime)
|
||||
{
|
||||
cellRtc->Log("cellRtcCheckValid(pTime=0x%x)", pTime.GetAddr());
|
||||
|
||||
if (!pTime.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
if ((pTime->year < 1) || (pTime->year > 9999)) return CELL_RTC_ERROR_INVALID_YEAR;
|
||||
else if ((pTime->month < 1) || (pTime->month > 12)) return CELL_RTC_ERROR_INVALID_MONTH;
|
||||
@ -529,9 +442,6 @@ int cellRtcCompareTick(mem_ptr_t<CellRtcTick> pTick0, mem_ptr_t<CellRtcTick> pTi
|
||||
{
|
||||
cellRtc->Log("cellRtcCompareTick(pTick0=0x%x, pTick1=0x%x)", pTick0.GetAddr(), pTick1.GetAddr());
|
||||
|
||||
if (!pTick0.IsGood() || !pTick1.IsGood())
|
||||
return CELL_RTC_ERROR_INVALID_POINTER;
|
||||
|
||||
if (pTick0->tick < pTick1->tick) return -1;
|
||||
else if (pTick0->tick > pTick1->tick) return 1;
|
||||
else return CELL_OK;
|
||||
|
@ -21,12 +21,6 @@ int cellSpursInitialize(mem_ptr_t<CellSpurs> spurs, int nSpus, int spuPriority,
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursInitialize : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
SPURSManagerAttribute *attr = new SPURSManagerAttribute(nSpus, spuPriority, ppuPriority, exitIfNoWork);
|
||||
spurs->spurs = new SPURSManager(attr);
|
||||
|
||||
@ -43,12 +37,6 @@ int cellSpursFinalize(mem_ptr_t<CellSpurs> spurs)
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursFinalize : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
spurs->spurs->Finalize();
|
||||
|
||||
return CELL_OK;
|
||||
@ -64,12 +52,6 @@ int cellSpursInitializeWithAttribute(mem_ptr_t<CellSpurs> spurs, const mem_ptr_t
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || !attr.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursInitializeWithAttribute : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
spurs->spurs = new SPURSManager(attr->attr);
|
||||
|
||||
return CELL_OK;
|
||||
@ -85,12 +67,6 @@ int cellSpursInitializeWithAttribute2(mem_ptr_t<CellSpurs2> spurs, const mem_ptr
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || !attr.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursInitializeWithAttribute2 : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
spurs->spurs = new SPURSManager(attr->attr);
|
||||
|
||||
return CELL_OK;
|
||||
@ -106,12 +82,6 @@ int _cellSpursAttributeInitialize(mem_ptr_t<CellSpursAttribute> attr, int nSpus,
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!attr.IsGood())
|
||||
{
|
||||
cellSpurs->Error("_cellSpursAttributeInitialize : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
attr->attr = new SPURSManagerAttribute(nSpus, spuPriority, ppuPriority, exitIfNoWork);
|
||||
|
||||
return CELL_OK;
|
||||
@ -127,12 +97,6 @@ int cellSpursAttributeSetMemoryContainerForSpuThread(mem_ptr_t<CellSpursAttribut
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!attr.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursAttributeSetMemoryContainerForSpuThread : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
attr->attr->_setMemoryContainerForSpuThread(container);
|
||||
|
||||
return CELL_OK;
|
||||
@ -148,12 +112,6 @@ int cellSpursAttributeSetNamePrefix(mem_ptr_t<CellSpursAttribute> attr, const me
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!attr.IsGood() || !prefix.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (size > CELL_SPURS_NAME_MAX_LENGTH)
|
||||
{
|
||||
cellSpurs->Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_INVAL");
|
||||
@ -175,12 +133,6 @@ int cellSpursAttributeEnableSpuPrintfIfAvailable(mem_ptr_t<CellSpursAttribute> a
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!attr.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursAttributeEnableSpuPrintfIfAvailable : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -194,12 +146,6 @@ int cellSpursAttributeSetSpuThreadGroupType(mem_ptr_t<CellSpursAttribute> attr,
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!attr.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursAttributeSetSpuThreadGroupType : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
attr->attr->_setSpuThreadGroupType(type);
|
||||
|
||||
return CELL_OK;
|
||||
@ -216,12 +162,6 @@ int cellSpursAttributeEnableSystemWorkload(mem_ptr_t<CellSpursAttribute> attr, c
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!attr.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursAttributeEnableSystemWorkload : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
for (int i = 0; i < CELL_SPURS_MAX_SPU; i++)
|
||||
{
|
||||
if (priority[i] != 1 || maxSpu == 0)
|
||||
@ -243,12 +183,6 @@ int cellSpursGetSpuThreadGroupId(mem_ptr_t<CellSpurs> spurs, mem32_t group)
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || group.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursGetSpuThreadGroupId : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -262,12 +196,6 @@ int cellSpursGetNumSpuThread(mem_ptr_t<CellSpurs> spurs, mem32_t nThreads)
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || nThreads.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursGetNumSpuThread : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -281,12 +209,6 @@ int cellSpursGetSpuThreadId(mem_ptr_t<CellSpurs> spurs, mem32_t thread, mem32_t
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || !thread.IsGood() || nThreads.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursGetSpuThreadId : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -300,12 +222,6 @@ int cellSpursSetMaxContention(mem_ptr_t<CellSpurs> spurs, u32 workloadId, u32 ma
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursSetMaxContention : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -319,12 +235,6 @@ int cellSpursSetPriorities(mem_ptr_t<CellSpurs> spurs, u32 workloadId, const u8
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursSetPriorities : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -338,12 +248,6 @@ int cellSpursSetPriority(mem_ptr_t<CellSpurs> spurs, u32 workloadId, u32 spuId,
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursSetPriority : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -357,12 +261,6 @@ int cellSpursSetPreemptionVictimHints(mem_ptr_t<CellSpurs> spurs, const bool isP
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursSetPreemptionVictimHints : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -376,12 +274,6 @@ int cellSpursAttachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u32 queue, mem8_t p
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || !port.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursAttachLv2EventQueue : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
spurs->spurs->AttachLv2EventQueue(queue, port, isDynamic);
|
||||
|
||||
return CELL_OK;
|
||||
@ -397,12 +289,6 @@ int cellSpursDetachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u8 port)
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursDetachLv2EventQueue : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
spurs->spurs->DetachLv2EventQueue(port);
|
||||
|
||||
return CELL_OK;
|
||||
@ -418,12 +304,6 @@ int cellSpursEnableExceptionEventHandler(mem_ptr_t<CellSpurs> spurs, bool flag)
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEnableExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -437,12 +317,6 @@ int cellSpursSetGlobalExceptionEventHandler(mem_ptr_t<CellSpurs> spurs, mem_func
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || eaHandler.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursSetGlobalExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -456,12 +330,6 @@ int cellSpursUnsetGlobalExceptionEventHandler(mem_ptr_t<CellSpurs> spurs)
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursUnsetGlobalExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -475,12 +343,6 @@ int cellSpursGetInfo(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursInfo> info)
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || !info.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursGetInfo : CELL_SPURS_CORE_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -494,12 +356,6 @@ int _cellSpursEventFlagInitialize(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpur
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if ((!spurs.IsGood() && !taskset.IsGood()) || !eventFlag.IsGood())
|
||||
{
|
||||
cellSpurs->Error("_cellSpursEventFlagInitialize : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
eventFlag->eventFlag = new SPURSManagerEventFlag(flagClearMode, flagDirection);
|
||||
|
||||
return CELL_OK;
|
||||
@ -515,12 +371,6 @@ int cellSpursEventFlagAttachLv2EventQueue(mem_ptr_t<CellSpursEventFlag> eventFla
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagAttachLv2EventQueue : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -534,12 +384,6 @@ int cellSpursEventFlagDetachLv2EventQueue(mem_ptr_t<CellSpursEventFlag> eventFla
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagDetachLv2EventQueue : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -553,12 +397,6 @@ int cellSpursEventFlagWait(mem_ptr_t<CellSpursEventFlag> eventFlag, mem16_t mask
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood() || !mask.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagWait : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -572,12 +410,6 @@ int cellSpursEventFlagClear(mem_ptr_t<CellSpursEventFlag> eventFlag, u16 bits)
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagClear : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -591,12 +423,6 @@ int cellSpursEventFlagSet(mem_ptr_t<CellSpursEventFlag> eventFlag, u16 bits)
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagSet : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -610,12 +436,6 @@ int cellSpursEventFlagTryWait(mem_ptr_t<CellSpursEventFlag> eventFlag, mem16_t m
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagTryWait : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -629,12 +449,6 @@ int cellSpursEventFlagGetDirection(mem_ptr_t<CellSpursEventFlag> eventFlag, mem3
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood() || !direction.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagGetDirection : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
direction = eventFlag->eventFlag->_getDirection();
|
||||
|
||||
return CELL_OK;
|
||||
@ -650,12 +464,6 @@ int cellSpursEventFlagGetClearMode(mem_ptr_t<CellSpursEventFlag> eventFlag, mem3
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood() || !clear_mode.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagGetClearMode : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
clear_mode = eventFlag->eventFlag->_getClearMode();
|
||||
|
||||
return CELL_OK;
|
||||
@ -671,12 +479,6 @@ int cellSpursEventFlagGetTasksetAddress(mem_ptr_t<CellSpursEventFlag> eventFlag,
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!eventFlag.IsGood() || !taskset.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursEventFlagTryWait : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -952,12 +754,6 @@ int cellSpursCreateTaskset(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskse
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!spurs.IsGood() || !taskset.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursCreateTaskset : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
SPURSManagerTasksetAttribute *tattr = new SPURSManagerTasksetAttribute(args, priority, maxContention);
|
||||
taskset->taskset = new SPURSManagerTaskset(taskset.GetAddr(), tattr);
|
||||
|
||||
@ -974,12 +770,6 @@ int cellSpursJoinTaskset(mem_ptr_t<CellSpursTaskset> taskset)
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!taskset.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursJoinTaskset : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -993,12 +783,6 @@ int cellSpursGetTasksetId(mem_ptr_t<CellSpursTaskset> taskset, mem32_t workloadI
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!taskset.IsGood() || !workloadId.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursGetTasksetId : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -1012,12 +796,6 @@ int cellSpursShutdownTaskset(mem_ptr_t<CellSpursTaskset> taskset)
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!taskset.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursShutdownTaskset : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -1034,12 +812,6 @@ int cellSpursCreateTask(mem_ptr_t<CellSpursTaskset> taskset, mem32_t taskID, mem
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!taskset.IsGood())
|
||||
{
|
||||
cellSpurs->Error("cellSpursCreateTask : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -1053,12 +825,6 @@ int _cellSpursSendSignal(mem_ptr_t<CellSpursTaskset> taskset, u32 taskID)
|
||||
return CELL_SPURS_TASK_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!taskset.IsGood())
|
||||
{
|
||||
cellSpurs->Error("_cellSpursSendSignal : CELL_SPURS_TASK_ERROR_NULL_POINTER");
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,6 @@ int cellSysutilGetSystemParamInt(int id, mem32_t value)
|
||||
{
|
||||
cellSysutil->Log("cellSysutilGetSystemParamInt(id=0x%x, value_addr=0x%x)", id, value.GetAddr());
|
||||
|
||||
if(!value.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch(id)
|
||||
{
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG:
|
||||
@ -118,9 +113,6 @@ int cellSysutilGetSystemParamString(s32 id, mem_list_ptr_t<u8> buf, u32 bufsize)
|
||||
{
|
||||
cellSysutil->Log("cellSysutilGetSystemParamString(id=%d, buf_addr=0x%x, bufsize=%d)", id, buf.GetAddr(), bufsize);
|
||||
|
||||
if (!buf.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
memset(buf, 0, bufsize);
|
||||
|
||||
switch(id)
|
||||
@ -184,9 +176,6 @@ int cellVideoOutGetResolution(u32 resolutionId, mem_ptr_t<CellVideoOutResolution
|
||||
cellSysutil->Log("cellVideoOutGetResolution(resolutionId=%d, resolution_addr=0x%x)",
|
||||
resolutionId, resolution.GetAddr());
|
||||
|
||||
if (!resolution.IsGood())
|
||||
return CELL_VIDEO_OUT_ERROR_ILLEGAL_PARAMETER;
|
||||
|
||||
u32 num = ResolutionIdToNum(resolutionId);
|
||||
if(!num)
|
||||
return CELL_EINVAL;
|
||||
@ -202,11 +191,6 @@ s32 cellVideoOutConfigure(u32 videoOut, u32 config_addr, u32 option_addr, u32 wa
|
||||
cellSysutil->Warning("cellVideoOutConfigure(videoOut=%d, config_addr=0x%x, option_addr=0x%x, waitForEvent=0x%x)",
|
||||
videoOut, config_addr, option_addr, waitForEvent);
|
||||
|
||||
if(!Memory.IsGoodAddr(config_addr, sizeof(CellVideoOutConfiguration)))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
CellVideoOutConfiguration& config = (CellVideoOutConfiguration&)Memory[config_addr];
|
||||
|
||||
switch(videoOut)
|
||||
@ -243,8 +227,6 @@ int cellVideoOutGetConfiguration(u32 videoOut, u32 config_addr, u32 option_addr)
|
||||
cellSysutil->Warning("cellVideoOutGetConfiguration(videoOut=%d, config_addr=0x%x, option_addr=0x%x)",
|
||||
videoOut, config_addr, option_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(config_addr, sizeof(CellVideoOutConfiguration))) return CELL_EFAULT;
|
||||
|
||||
CellVideoOutConfiguration config = {};
|
||||
|
||||
switch(videoOut)
|
||||
@ -502,11 +484,6 @@ int cellAudioOutConfigure(u32 audioOut, mem_ptr_t<CellAudioOutConfiguration> con
|
||||
cellSysutil->Warning("cellAudioOutConfigure(audioOut=%d, config_addr=0x%x, option_addr=0x%x, (!)waitForEvent=%d)",
|
||||
audioOut, config.GetAddr(), option.GetAddr(), waitForEvent);
|
||||
|
||||
if (!config.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch(audioOut)
|
||||
{
|
||||
case CELL_AUDIO_OUT_PRIMARY:
|
||||
@ -536,8 +513,6 @@ int cellAudioOutGetConfiguration(u32 audioOut, u32 config_addr, u32 option_addr)
|
||||
cellSysutil->Warning("cellAudioOutGetConfiguration(audioOut=%d, config_addr=0x%x, option_addr=0x%x)",
|
||||
audioOut, config_addr, option_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(config_addr, sizeof(CellAudioOutConfiguration))) return CELL_EFAULT;
|
||||
|
||||
CellAudioOutConfiguration config = {};
|
||||
|
||||
switch(audioOut)
|
||||
@ -695,9 +670,6 @@ int cellHddGameCheck(u32 version, u32 dirName_addr, u32 errDialog, mem_func_ptr_
|
||||
cellSysutil->Warning("cellHddGameCheck(version=%d, dirName_addr=0x%xx, errDialog=%d, funcStat_addr=0x%x, container=%d)",
|
||||
version, dirName_addr, errDialog, funcStat, container);
|
||||
|
||||
if (!Memory.IsGoodAddr(dirName_addr) || !funcStat.IsGood())
|
||||
return CELL_HDDGAME_ERROR_PARAM;
|
||||
|
||||
std::string dirName = Memory.ReadString(dirName_addr);
|
||||
if (dirName.size() != 9)
|
||||
return CELL_HDDGAME_ERROR_PARAM;
|
||||
|
@ -146,7 +146,7 @@ void setSaveDataFixed(std::vector<SaveDataEntry>& saveEntries, mem_ptr_t<CellSav
|
||||
saveEntries.push_back(entry);
|
||||
}
|
||||
|
||||
if (fixedSet->newIcon.IsGood())
|
||||
if (fixedSet->newIcon.GetAddr())
|
||||
{
|
||||
saveEntries[0].iconBuf = Memory.VirtualToRealAddr(fixedSet->newIcon->iconBuf_addr);
|
||||
saveEntries[0].iconBufSize = fixedSet->newIcon->iconBufSize;
|
||||
@ -295,9 +295,6 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
cellSysutil->Warning("cellSaveDataListSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.GetAddr(), setBuf.GetAddr(), funcList.GetAddr(), funcStat.GetAddr(), funcFile.GetAddr(), container, userdata_addr);
|
||||
|
||||
if (!setList.IsGood() || !setBuf.IsGood() || !funcList.IsGood() || !funcStat.IsGood() || !funcFile.IsGood())
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
|
||||
MemoryAllocator<CellSaveDataCBResult> result;
|
||||
MemoryAllocator<CellSaveDataListGet> listGet;
|
||||
MemoryAllocator<CellSaveDataListSet> listSet;
|
||||
@ -340,11 +337,9 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
LOG_ERROR(HLE, "cellSaveDataListSave2: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
if (!listSet->fixedList.IsGood())
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
|
||||
setSaveDataList(saveEntries, (u32)listSet->fixedList.GetAddr(), listSet->fixedListNum);
|
||||
if (listSet->newData.IsGood())
|
||||
if (listSet->newData.GetAddr())
|
||||
addNewSaveDataEntry(saveEntries, (u32)listSet->newData.GetAddr());
|
||||
if (saveEntries.size() == 0) {
|
||||
LOG_WARNING(HLE, "cellSaveDataListSave2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
@ -363,7 +358,7 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
LOG_ERROR(HLE, "cellSaveDataListLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
/*if (statSet->setParam.GetAddr())
|
||||
addNewSaveDataEntry(saveEntries, (u32)listSet->newData.GetAddr()); // TODO: This *is* wrong
|
||||
*/
|
||||
|
||||
@ -380,9 +375,6 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
cellSysutil->Warning("cellSaveDataListLoad2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.GetAddr(), setBuf.GetAddr(), funcList.GetAddr(), funcStat.GetAddr(), funcFile.GetAddr(), container, userdata_addr);
|
||||
|
||||
if (!setList.IsGood() || !setBuf.IsGood() || !funcList.IsGood() || !funcStat.IsGood() || !funcFile.IsGood())
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
|
||||
MemoryAllocator<CellSaveDataCBResult> result;
|
||||
MemoryAllocator<CellSaveDataListGet> listGet;
|
||||
MemoryAllocator<CellSaveDataListSet> listSet;
|
||||
@ -425,11 +417,9 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
LOG_ERROR(HLE, "cellSaveDataListLoad2: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
if (!listSet->fixedList.IsGood())
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
|
||||
setSaveDataList(saveEntries, (u32)listSet->fixedList.GetAddr(), listSet->fixedListNum);
|
||||
if (listSet->newData.IsGood())
|
||||
if (listSet->newData.GetAddr())
|
||||
addNewSaveDataEntry(saveEntries, (u32)listSet->newData.GetAddr());
|
||||
if (saveEntries.size() == 0) {
|
||||
LOG_WARNING(HLE, "cellSaveDataListLoad2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
@ -448,7 +438,7 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
LOG_ERROR(HLE, "cellSaveDataListLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
/*if (statSet->setParam.GetAddr())
|
||||
// TODO: Write PARAM.SFO file
|
||||
*/
|
||||
|
||||
@ -465,9 +455,6 @@ int cellSaveDataFixedSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList,
|
||||
cellSysutil->Warning("cellSaveDataFixedSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.GetAddr(), setBuf.GetAddr(), funcFixed.GetAddr(), funcStat.GetAddr(), funcFile.GetAddr(), container, userdata_addr);
|
||||
|
||||
if (!setList.IsGood() || !setBuf.IsGood() || !funcFixed.IsGood() || !funcStat.IsGood() || !funcFile.IsGood())
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
|
||||
MemoryAllocator<CellSaveDataCBResult> result;
|
||||
MemoryAllocator<CellSaveDataListGet> listGet;
|
||||
MemoryAllocator<CellSaveDataFixedSet> fixedSet;
|
||||
@ -520,7 +507,7 @@ int cellSaveDataFixedSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList,
|
||||
LOG_ERROR(HLE, "cellSaveDataFixedSave2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
/*if (statSet->setParam.GetAddr())
|
||||
// TODO: Write PARAM.SFO file
|
||||
*/
|
||||
|
||||
@ -537,9 +524,6 @@ int cellSaveDataFixedLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList,
|
||||
cellSysutil->Warning("cellSaveDataFixedLoad2(version=%d, setList_addr=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.GetAddr(), setBuf.GetAddr(), funcFixed.GetAddr(), funcStat.GetAddr(), funcFile.GetAddr(), container, userdata_addr);
|
||||
|
||||
if (!setList.IsGood() || !setBuf.IsGood() || !funcFixed.IsGood() || !funcStat.IsGood() || !funcFile.IsGood())
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
|
||||
MemoryAllocator<CellSaveDataCBResult> result;
|
||||
MemoryAllocator<CellSaveDataListGet> listGet;
|
||||
MemoryAllocator<CellSaveDataFixedSet> fixedSet;
|
||||
@ -592,7 +576,7 @@ int cellSaveDataFixedLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList,
|
||||
LOG_ERROR(HLE, "cellSaveDataFixedLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
/*if (statSet->setParam.GetAddr())
|
||||
// TODO: Write PARAM.SFO file
|
||||
*/
|
||||
|
||||
@ -609,9 +593,6 @@ int cellSaveDataAutoSave2(u32 version, u32 dirName_addr, u32 errDialog, mem_ptr_
|
||||
cellSysutil->Warning("cellSaveDataAutoSave2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, dirName_addr, errDialog, setBuf.GetAddr(), funcStat.GetAddr(), funcFile.GetAddr(), container, userdata_addr);
|
||||
|
||||
if (!setBuf.IsGood() || !funcStat.IsGood() || !funcFile.IsGood())
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
|
||||
MemoryAllocator<CellSaveDataCBResult> result;
|
||||
MemoryAllocator<CellSaveDataStatGet> statGet;
|
||||
MemoryAllocator<CellSaveDataStatSet> statSet;
|
||||
@ -648,7 +629,7 @@ int cellSaveDataAutoSave2(u32 version, u32 dirName_addr, u32 errDialog, mem_ptr_
|
||||
LOG_ERROR(HLE, "cellSaveDataAutoSave2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
/*if (statSet->setParam.GetAddr())
|
||||
// TODO: Write PARAM.SFO file
|
||||
*/
|
||||
|
||||
@ -662,12 +643,9 @@ int cellSaveDataAutoLoad2(u32 version, u32 dirName_addr, u32 errDialog, mem_ptr_
|
||||
mem_func_ptr_t<CellSaveDataStatCallback> funcStat, mem_func_ptr_t<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, u32 userdata_addr)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataAutoLoad2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataAutoLoad2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, dirName_addr, errDialog, setBuf.GetAddr(), funcStat.GetAddr(), funcFile.GetAddr(), container, userdata_addr);
|
||||
|
||||
if (!setBuf.IsGood() || !funcStat.IsGood() || !funcFile.IsGood())
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
|
||||
MemoryAllocator<CellSaveDataCBResult> result;
|
||||
MemoryAllocator<CellSaveDataStatGet> statGet;
|
||||
MemoryAllocator<CellSaveDataStatSet> statSet;
|
||||
@ -701,7 +679,7 @@ int cellSaveDataAutoLoad2(u32 version, u32 dirName_addr, u32 errDialog, mem_ptr_
|
||||
LOG_ERROR(HLE, "cellSaveDataAutoLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
/*if (statSet->setParam.GetAddr())
|
||||
// TODO: Write PARAM.SFO file
|
||||
*/
|
||||
|
||||
|
@ -14,8 +14,6 @@ int cellUserInfoGetStat(u32 id, mem_ptr_t<CellUserInfoUserStat> stat)
|
||||
{
|
||||
cellUserInfo->Warning("cellUserInfoGetStat(id=%d, stat_addr=0x%x)", id, stat.GetAddr());
|
||||
|
||||
if (!stat.IsGood())
|
||||
return CELL_USERINFO_ERROR_PARAM;
|
||||
if (id > CELL_USERINFO_USER_MAX)
|
||||
return CELL_USERINFO_ERROR_NOUSER;
|
||||
|
||||
@ -64,14 +62,14 @@ int cellUserInfoGetList(mem32_t listNum, mem_ptr_t<CellUserInfoUserList> listBuf
|
||||
listNum.GetAddr(), listBuf.GetAddr(), currentUserId.GetAddr());
|
||||
|
||||
// If only listNum is NULL, an error will be returned
|
||||
if (listBuf.IsGood() && !listNum.IsGood())
|
||||
if (listBuf.GetAddr() && !listNum.GetAddr())
|
||||
return CELL_USERINFO_ERROR_PARAM;
|
||||
if (listNum.IsGood())
|
||||
if (listNum.GetAddr())
|
||||
listNum = 1;
|
||||
if (listBuf.IsGood())
|
||||
if (listBuf.GetAddr())
|
||||
listBuf->userId[0] = 1;
|
||||
|
||||
if (currentUserId.IsGood())
|
||||
if (currentUserId.GetAddr())
|
||||
currentUserId = 1;
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -428,11 +428,6 @@ int cellVdecQueryAttr(const mem_ptr_t<CellVdecType> type, mem_ptr_t<CellVdecAttr
|
||||
{
|
||||
cellVdec->Warning("cellVdecQueryAttr(type_addr=0x%x, attr_addr=0x%x)", type.GetAddr(), attr.GetAddr());
|
||||
|
||||
if (!type.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
return vdecQueryAttr(type->codecType, type->profileLevel, 0, attr);
|
||||
}
|
||||
|
||||
@ -440,11 +435,6 @@ int cellVdecQueryAttrEx(const mem_ptr_t<CellVdecTypeEx> type, mem_ptr_t<CellVdec
|
||||
{
|
||||
cellVdec->Warning("cellVdecQueryAttrEx(type_addr=0x%x, attr_addr=0x%x)", type.GetAddr(), attr.GetAddr());
|
||||
|
||||
if (!type.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
return vdecQueryAttr(type->codecType, type->profileLevel, type->codecSpecificInfo_addr, attr);
|
||||
}
|
||||
|
||||
@ -453,16 +443,6 @@ int cellVdecOpen(const mem_ptr_t<CellVdecType> type, const mem_ptr_t<CellVdecRes
|
||||
cellVdec->Warning("cellVdecOpen(type_addr=0x%x, res_addr=0x%x, cb_addr=0x%x, handle_addr=0x%x)",
|
||||
type.GetAddr(), res.GetAddr(), cb.GetAddr(), handle.GetAddr());
|
||||
|
||||
if (!type.IsGood() || !res.IsGood() || !cb.IsGood() || !handle.IsGood())
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(res->memAddr, res->memSize) || !Memory.IsGoodAddr(cb->cbFunc))
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
handle = vdecOpen(new VideoDecoder(type->codecType, type->profileLevel, res->memAddr, res->memSize, cb->cbFunc, cb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
@ -473,16 +453,6 @@ int cellVdecOpenEx(const mem_ptr_t<CellVdecTypeEx> type, const mem_ptr_t<CellVde
|
||||
cellVdec->Warning("cellVdecOpenEx(type_addr=0x%x, res_addr=0x%x, cb_addr=0x%x, handle_addr=0x%x)",
|
||||
type.GetAddr(), res.GetAddr(), cb.GetAddr(), handle.GetAddr());
|
||||
|
||||
if (!type.IsGood() || !res.IsGood() || !cb.IsGood() || !handle.IsGood())
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(res->memAddr, res->memSize) || !Memory.IsGoodAddr(cb->cbFunc))
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
handle = vdecOpen(new VideoDecoder(type->codecType, type->profileLevel, res->memAddr, res->memSize, cb->cbFunc, cb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
@ -599,11 +569,6 @@ int cellVdecGetPicture(u32 handle, const mem_ptr_t<CellVdecPicFormat> format, u3
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!format.IsGood())
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (vdec->frames.IsEmpty())
|
||||
{
|
||||
return CELL_VDEC_ERROR_EMPTY;
|
||||
@ -613,11 +578,6 @@ int cellVdecGetPicture(u32 handle, const mem_ptr_t<CellVdecPicFormat> format, u3
|
||||
{
|
||||
u32 buf_size = a128(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1));
|
||||
|
||||
if (!Memory.IsGoodAddr(out_addr, buf_size))
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (format->formatType != CELL_VDEC_PICFMT_YUV420_PLANAR)
|
||||
{
|
||||
cellVdec->Todo("cellVdecGetPicture: unknown formatType(%d)", (u32)format->formatType);
|
||||
@ -671,11 +631,6 @@ int cellVdecGetPicItem(u32 handle, mem32_t picItem_ptr)
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
}
|
||||
|
||||
if (!picItem_ptr.IsGood())
|
||||
{
|
||||
return CELL_VDEC_ERROR_FATAL;
|
||||
}
|
||||
|
||||
if (vdec->frames.IsEmpty())
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
|
@ -19,9 +19,6 @@ int cellVpostQueryAttr(const mem_ptr_t<CellVpostCfgParam> cfgParam, mem_ptr_t<Ce
|
||||
{
|
||||
cellVpost->Warning("cellVpostQueryAttr(cfgParam_addr=0x%x, attr_addr=0x%x)", cfgParam.GetAddr(), attr.GetAddr());
|
||||
|
||||
if (!cfgParam.IsGood()) return CELL_VPOST_ERROR_Q_ARG_CFG_NULL;
|
||||
if (!attr.IsGood()) return CELL_VPOST_ERROR_Q_ARG_ATTR_NULL;
|
||||
|
||||
// TODO: check cfgParam and output values
|
||||
|
||||
attr->delay = 0;
|
||||
@ -46,10 +43,6 @@ int cellVpostOpen(const mem_ptr_t<CellVpostCfgParam> cfgParam, const mem_ptr_t<C
|
||||
cellVpost->Warning("cellVpostOpen(cfgParam_addr=0x%x, resource_addr=0x%x, handle_addr=0x%x)",
|
||||
cfgParam.GetAddr(), resource.GetAddr(), handle.GetAddr());
|
||||
|
||||
if (!cfgParam.IsGood()) return CELL_VPOST_ERROR_O_ARG_CFG_NULL;
|
||||
if (!resource.IsGood()) return CELL_VPOST_ERROR_O_ARG_RSRC_NULL;
|
||||
if (!handle.IsGood()) return CELL_VPOST_ERROR_O_ARG_HDL_NULL;
|
||||
|
||||
// TODO: check values
|
||||
handle = vpostOpen(new VpostInstance(cfgParam->outPicFmt == CELL_VPOST_PIC_FMT_OUT_RGBA_ILV));
|
||||
return CELL_OK;
|
||||
@ -60,10 +53,6 @@ int cellVpostOpenEx(const mem_ptr_t<CellVpostCfgParam> cfgParam, const mem_ptr_t
|
||||
cellVpost->Warning("cellVpostOpenEx(cfgParam_addr=0x%x, resource_addr=0x%x, handle_addr=0x%x)",
|
||||
cfgParam.GetAddr(), resource.GetAddr(), handle.GetAddr());
|
||||
|
||||
if (!cfgParam.IsGood()) return CELL_VPOST_ERROR_O_ARG_CFG_NULL;
|
||||
if (!resource.IsGood()) return CELL_VPOST_ERROR_O_ARG_RSRC_NULL;
|
||||
if (!handle.IsGood()) return CELL_VPOST_ERROR_O_ARG_HDL_NULL;
|
||||
|
||||
// TODO: check values
|
||||
handle = vpostOpen(new VpostInstance(cfgParam->outPicFmt == CELL_VPOST_PIC_FMT_OUT_RGBA_ILV));
|
||||
return CELL_OK;
|
||||
@ -95,31 +84,11 @@ int cellVpostExec(u32 handle, const u32 inPicBuff_addr, const mem_ptr_t<CellVpos
|
||||
return CELL_VPOST_ERROR_E_ARG_HDL_INVALID;
|
||||
}
|
||||
|
||||
if (!ctrlParam.IsGood())
|
||||
{
|
||||
return CELL_VPOST_ERROR_E_ARG_CTRL_INVALID;
|
||||
}
|
||||
|
||||
s32 w = ctrlParam->inWidth;
|
||||
u32 h = ctrlParam->inHeight;
|
||||
u32 ow = ctrlParam->outWidth;
|
||||
u32 oh = ctrlParam->outHeight;
|
||||
|
||||
if (!Memory.IsGoodAddr(inPicBuff_addr, w*h*3/2))
|
||||
{
|
||||
return CELL_VPOST_ERROR_E_ARG_INPICBUF_INVALID;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(outPicBuff_addr, ow*oh*4))
|
||||
{
|
||||
return CELL_VPOST_ERROR_E_ARG_OUTPICBUF_INVALID;
|
||||
}
|
||||
|
||||
if (!picInfo.IsGood())
|
||||
{
|
||||
return CELL_VPOST_ERROR_E_ARG_PICINFO_NULL;
|
||||
}
|
||||
|
||||
ctrlParam->inWindow; // ignored
|
||||
if (ctrlParam->inWindow.x) LOG_WARNING(HLE, "*** inWindow.x = %d", (u32)ctrlParam->inWindow.x);
|
||||
if (ctrlParam->inWindow.y) LOG_WARNING(HLE, "*** inWindow.y = %d", (u32)ctrlParam->inWindow.y);
|
||||
|
@ -146,11 +146,6 @@ int cellSSPlayerCreate(mem32_t handle, mem_ptr_t<CellSSPlayerConfig> config)
|
||||
libmixer->Warning("cellSSPlayerCreate(handle_addr=0x%x, config_addr=0x%x)",
|
||||
handle.GetAddr(), config.GetAddr());
|
||||
|
||||
if (!config.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (config->outputMode != 0 || config->channels - 1 >= 2)
|
||||
{
|
||||
libmixer->Error("cellSSPlayerCreate(config.outputMode=%d, config.channels=%d): invalid parameters",
|
||||
@ -195,11 +190,6 @@ int cellSSPlayerSetWave(u32 handle, mem_ptr_t<CellSSPlayerWaveParam> waveInfo, m
|
||||
libmixer->Warning("cellSSPlayerSetWave(handle=%d, waveInfo_addr=0x%x, commonInfo_addr=0x%x)",
|
||||
handle, waveInfo.GetAddr(), commonInfo.GetAddr());
|
||||
|
||||
if (!waveInfo.IsGood() || (commonInfo.GetAddr() && !commonInfo.IsGood()))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(mixer_mutex);
|
||||
|
||||
if (handle >= ssp.size() || !ssp[handle].m_created)
|
||||
@ -223,11 +213,6 @@ int cellSSPlayerPlay(u32 handle, mem_ptr_t<CellSSPlayerRuntimeInfo> info)
|
||||
{
|
||||
libmixer->Warning("cellSSPlayerPlay(handle=%d, info_addr=0x%x)", handle, info.GetAddr());
|
||||
|
||||
if (!info.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(mixer_mutex);
|
||||
|
||||
if (handle >= ssp.size() || !ssp[handle].m_created)
|
||||
@ -271,11 +256,6 @@ int cellSSPlayerSetParam(u32 handle, mem_ptr_t<CellSSPlayerRuntimeInfo> info)
|
||||
{
|
||||
libmixer->Warning("cellSSPlayerSetParam(handle=%d, info_addr=0x%x)", handle, info.GetAddr());
|
||||
|
||||
if (!info.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(mixer_mutex);
|
||||
|
||||
if (handle >= ssp.size() || !ssp[handle].m_created)
|
||||
|
@ -119,8 +119,6 @@ int sceNpManagerGetStatus(mem32_t status)
|
||||
sceNp->Log("sceNpManagerGetStatus(status_addr=0x%x)", status.GetAddr());
|
||||
|
||||
// TODO: Check if sceNpInit() was called, if not return SCE_NP_ERROR_NOT_INITIALIZED
|
||||
if (!status.IsGood())
|
||||
return SCE_NP_ERROR_INVALID_ARGUMENT;
|
||||
|
||||
// TODO: Support different statuses
|
||||
status = SCE_NP_MANAGER_STATUS_OFFLINE;
|
||||
|
@ -96,8 +96,6 @@ int sceNpTrophyCreateContext(mem32_t context, mem_ptr_t<SceNpCommunicationId> co
|
||||
|
||||
if (!s_npTrophyInstance.m_bInitialized)
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
if (!context.IsGood())
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT;
|
||||
if (options & (~(u64)1))
|
||||
return SCE_NP_TROPHY_ERROR_NOT_SUPPORTED;
|
||||
// TODO: There are other possible errors
|
||||
@ -135,8 +133,6 @@ int sceNpTrophyCreateHandle(mem32_t handle)
|
||||
|
||||
if (!s_npTrophyInstance.m_bInitialized)
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
if (!handle.IsGood())
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT;
|
||||
// TODO: There are other possible errors
|
||||
|
||||
// TODO: ?
|
||||
@ -144,15 +140,13 @@ int sceNpTrophyCreateHandle(mem32_t handle)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int sceNpTrophyRegisterContext(u32 context, u32 handle, u32 statusCb_addr, u32 arg_addr, u64 options)
|
||||
int sceNpTrophyRegisterContext(u32 context, u32 handle, mem_func_ptr_t<SceNpTrophyStatusCallback> statusCb, u32 arg_addr, u64 options)
|
||||
{
|
||||
sceNpTrophy->Warning("sceNpTrophyRegisterContext(context=%d, handle=%d, statusCb_addr=0x%x, arg_addr=0x%x, options=0x%llx)",
|
||||
context, handle, statusCb_addr, arg_addr, options);
|
||||
context, handle, statusCb.GetAddr(), arg_addr, options);
|
||||
|
||||
if (!(s_npTrophyInstance.m_bInitialized))
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
if (!Memory.IsGoodAddr(statusCb_addr))
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT;
|
||||
if (options & (~(u64)1))
|
||||
return SCE_NP_TROPHY_ERROR_NOT_SUPPORTED;
|
||||
if (context >= s_npTrophyInstance.contexts.size())
|
||||
@ -205,6 +199,8 @@ int sceNpTrophyRegisterContext(u32 context, u32 handle, u32 statusCb_addr, u32 a
|
||||
ctxt.tropusr.reset(tropusr);
|
||||
|
||||
// TODO: Callbacks
|
||||
statusCb(context, SCE_NP_TROPHY_STATUS_INSTALLED, 100, 100, arg_addr);
|
||||
statusCb(context, SCE_NP_TROPHY_STATUS_PROCESSING_COMPLETE, 100, 100, arg_addr);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -228,8 +224,6 @@ int sceNpTrophyGetRequiredDiskSpace(u32 context, u32 handle, mem64_t reqspace, u
|
||||
|
||||
if (!s_npTrophyInstance.m_bInitialized)
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
if (!reqspace.IsGood())
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT;
|
||||
if (context >= s_npTrophyInstance.contexts.size())
|
||||
return SCE_NP_TROPHY_ERROR_UNKNOWN_CONTEXT;
|
||||
// TODO: There are other possible errors
|
||||
@ -261,8 +255,6 @@ int sceNpTrophyGetGameInfo(u32 context, u32 handle, mem_ptr_t<SceNpTrophyGameDet
|
||||
|
||||
if (!s_npTrophyInstance.m_bInitialized)
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
if (!details.IsGood() || !data.IsGood())
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT;
|
||||
// TODO: There are other possible errors
|
||||
|
||||
std::string path;
|
||||
@ -321,8 +313,6 @@ int sceNpTrophyUnlockTrophy(u32 context, u32 handle, s32 trophyId, mem32_t plati
|
||||
|
||||
if (!s_npTrophyInstance.m_bInitialized)
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
if (!platinumId.IsGood())
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT;
|
||||
// TODO: There are other possible errors
|
||||
|
||||
sceNpTrophyInternalContext& ctxt = s_npTrophyInstance.contexts[context];
|
||||
@ -354,8 +344,6 @@ int sceNpTrophyGetTrophyUnlockState(u32 context, u32 handle, mem_ptr_t<SceNpTrop
|
||||
|
||||
if (!s_npTrophyInstance.m_bInitialized)
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
if (!flags.IsGood() || !count.IsGood())
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT;
|
||||
// TODO: There are other possible errors
|
||||
|
||||
sceNpTrophyInternalContext& ctxt = s_npTrophyInstance.contexts[context];
|
||||
@ -388,10 +376,8 @@ int sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, mem_ptr_t<Sc
|
||||
|
||||
if (!s_npTrophyInstance.m_bInitialized)
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
if (!details.IsGood() || !data.IsGood())
|
||||
return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT;
|
||||
// TODO: There are other possible errors
|
||||
|
||||
|
||||
std::string path;
|
||||
rXmlDocument doc;
|
||||
sceNpTrophyInternalContext& ctxt = s_npTrophyInstance.contexts[context];
|
||||
|
@ -116,3 +116,22 @@ struct SceNpTrophyFlagArray
|
||||
{
|
||||
u32 flag_bits[SCE_NP_TROPHY_FLAG_SETSIZE >> SCE_NP_TROPHY_FLAG_BITS_SHIFT];
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SCE_NP_TROPHY_STATUS_UNKNOWN = 0,
|
||||
SCE_NP_TROPHY_STATUS_NOT_INSTALLED = 1,
|
||||
SCE_NP_TROPHY_STATUS_DATA_CORRUPT = 2,
|
||||
SCE_NP_TROPHY_STATUS_INSTALLED = 3,
|
||||
SCE_NP_TROPHY_STATUS_REQUIRES_UPDATE = 4,
|
||||
|
||||
SCE_NP_TROPHY_STATUS_PROCESSING_SETUP = 5,
|
||||
SCE_NP_TROPHY_STATUS_PROCESSING_PROGRESS = 6,
|
||||
SCE_NP_TROPHY_STATUS_PROCESSING_FINALIZE = 7,
|
||||
|
||||
SCE_NP_TROPHY_STATUS_PROCESSING_COMPLETE = 8,
|
||||
|
||||
SCE_NP_TROPHY_STATUS_CHANGES_DETECTED = 9,
|
||||
};
|
||||
|
||||
typedef s32 (*SceNpTrophyStatusCallback)(u32 context, u32 status, s32 completed, s32 total, u32 arg_addr);
|
||||
|
@ -105,11 +105,6 @@ int sys_spu_image_import(mem_ptr_t<sys_spu_image> img, u32 src, u32 type)
|
||||
{
|
||||
sysPrxForUser->Warning("sys_spu_image_import(img=0x%x, src=0x%x, type=0x%x)", img.GetAddr(), src, type);
|
||||
|
||||
if(!img.IsGood() || !Memory.IsGoodAddr(src))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
vfsStreamMemory f(src);
|
||||
u32 entry;
|
||||
u32 offset = LoadSpuImage(f, entry);
|
||||
|
@ -117,10 +117,7 @@ int cellFsSdataOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
|
||||
sys_fs->Warning("cellFsSdataOpen(path=\"%s\", flags=0x%x, fd_addr=0x%x, arg_addr=0x%x, size=0x%llx) -> cellFsOpen()",
|
||||
path.c_str(), flags, fd.GetAddr(), arg.GetAddr(), size);
|
||||
|
||||
/*if (!fd.IsGood() || (!arg.IsGood() && size))
|
||||
return CELL_EFAULT;
|
||||
|
||||
if (flags != CELL_O_RDONLY)
|
||||
/*if (flags != CELL_O_RDONLY)
|
||||
return CELL_EINVAL;
|
||||
|
||||
std::string suffix = path.substr(path.length() - 5, 5);
|
||||
@ -198,11 +195,6 @@ int cellFsAioRead(mem_ptr_t<CellFsAio> aio, mem32_t aio_id, mem_func_ptr_t<void
|
||||
{
|
||||
sys_fs->Warning("cellFsAioRead(aio_addr=0x%x, id_addr=0x%x, func_addr=0x%x)", aio.GetAddr(), aio_id.GetAddr(), func.GetAddr());
|
||||
|
||||
if (!aio.IsGood() || !aio_id.IsGood() || !func.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (!aio_init)
|
||||
{
|
||||
return CELL_ENXIO;
|
||||
|
@ -130,12 +130,6 @@ s32 cellFsRead(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nread)
|
||||
vfsStream* file;
|
||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
if (nread.GetAddr() && !nread.IsGood())
|
||||
{
|
||||
sys_fs->Error("cellFsRead(): bad nread_addr(0x%x)", nread.GetAddr());
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (nbytes != (u32)nbytes) return CELL_ENOMEM;
|
||||
|
||||
// TODO: checks
|
||||
@ -154,8 +148,6 @@ s32 cellFsWrite(u32 fd, u32 buf_addr, u64 nbytes, mem64_t nwrite)
|
||||
vfsStream* file;
|
||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
if (nwrite.GetAddr() && !nwrite.IsGood()) return CELL_EFAULT;
|
||||
|
||||
if (nbytes != (u32)nbytes) return CELL_ENOMEM;
|
||||
|
||||
// TODO: checks
|
||||
@ -182,9 +174,6 @@ s32 cellFsOpendir(u32 path_addr, mem32_t fd)
|
||||
const std::string& path = Memory.ReadString(path_addr);
|
||||
sys_fs->Warning("cellFsOpendir(path=\"%s\", fd_addr=0x%x)", path.c_str(), fd.GetAddr());
|
||||
|
||||
if(!Memory.IsGoodAddr(path_addr) || !fd.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
vfsDirBase* dir = Emu.GetVFS().OpenDir(path);
|
||||
if(!dir || !dir->IsOpened())
|
||||
{
|
||||
@ -203,8 +192,6 @@ s32 cellFsReaddir(u32 fd, mem_ptr_t<CellFsDirent> dir, mem64_t nread)
|
||||
vfsDirBase* directory;
|
||||
if(!sys_fs->CheckId(fd, directory))
|
||||
return CELL_ESRCH;
|
||||
if(!dir.IsGood() || !nread.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
const DirEntryInfo* info = directory->Read();
|
||||
if(info)
|
||||
@ -488,9 +475,6 @@ s32 cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count)
|
||||
sys_fs->Warning("cellFsGetFreeSize(path=\"%s\", block_size_addr=0x%x, block_count_addr=0x%x)",
|
||||
ps3_path.c_str(), block_size.GetAddr(), block_count.GetAddr());
|
||||
|
||||
if (!Memory.IsGoodAddr(path_addr) || !block_size.IsGood() || !block_count.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
if (ps3_path.empty())
|
||||
return CELL_EINVAL;
|
||||
|
||||
@ -508,8 +492,6 @@ s32 cellFsGetDirectoryEntries(u32 fd, mem_ptr_t<CellFsDirectoryEntry> entries, u
|
||||
vfsDirBase* directory;
|
||||
if(!sys_fs->CheckId(fd, directory))
|
||||
return CELL_ESRCH;
|
||||
if(!entries.IsGood() || !data_count.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
const DirEntryInfo* info = directory->Read();
|
||||
if(info)
|
||||
@ -546,9 +528,6 @@ s32 cellFsStReadInit(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
||||
vfsStream* file;
|
||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
if(!ringbuf.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
fs_config.m_ring_buffer = *ringbuf;
|
||||
|
||||
if(ringbuf->ringbuf_size < 0x40000000) // If the size is less than 1MB
|
||||
@ -584,9 +563,6 @@ s32 cellFsStReadGetRingBuf(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
||||
vfsStream* file;
|
||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
if(!ringbuf.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
*ringbuf = fs_config.m_ring_buffer;
|
||||
|
||||
sys_fs->Warning("*** fs stream config: block_size=0x%llx, copy=%d, ringbuf_size = 0x%llx, transfer_rate = 0x%llx",
|
||||
@ -650,8 +626,6 @@ s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize)
|
||||
vfsStream* file;
|
||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
if (rsize.GetAddr() && !rsize.IsGood()) return CELL_EFAULT;
|
||||
|
||||
fs_config.m_regid += size;
|
||||
rsize = fs_config.m_regid;
|
||||
|
||||
@ -665,8 +639,6 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size)
|
||||
vfsStream* file;
|
||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
if (!addr_addr.IsGood() && !size.IsGood()) return CELL_EFAULT;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -677,8 +649,6 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size)
|
||||
vfsStream* file;
|
||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
if (!Memory.IsGoodAddr(addr_addr)) return CELL_EFAULT;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -696,9 +666,6 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(int xfd,
|
||||
{
|
||||
sys_fs->Todo("cellFsStReadWaitCallback(fd=%d, size = 0x%llx, func_addr = 0x%x)", fd, size, func.GetAddr());
|
||||
|
||||
if (!func.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
vfsStream* file;
|
||||
if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH;
|
||||
|
||||
|
@ -14,11 +14,6 @@ s32 sys_cond_create(mem32_t cond_id, u32 mutex_id, mem_ptr_t<sys_cond_attribute>
|
||||
sys_cond.Log("sys_cond_create(cond_id_addr=0x%x, mutex_id=%d, attr_addr=0x%x)",
|
||||
cond_id.GetAddr(), mutex_id, attr.GetAddr());
|
||||
|
||||
if (!cond_id.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (attr->pshared.ToBE() != se32(0x200))
|
||||
{
|
||||
sys_cond.Error("Invalid pshared attribute(0x%x)", (u32)attr->pshared);
|
||||
|
@ -23,11 +23,6 @@ s32 sys_event_queue_create(mem32_t equeue_id, mem_ptr_t<sys_event_queue_attr> at
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if(!equeue_id.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch (attr->protocol.ToBE())
|
||||
{
|
||||
case se32(SYS_SYNC_PRIORITY): break;
|
||||
@ -114,16 +109,6 @@ s32 sys_event_queue_tryreceive(u32 equeue_id, mem_ptr_t<sys_event_data> event_ar
|
||||
sys_event.Todo("sys_event_queue_tryreceive(equeue_id=%d, event_array_addr=0x%x, size=%d, number_addr=0x%x)",
|
||||
equeue_id, event_array.GetAddr(), size, number.GetAddr());
|
||||
|
||||
if (size < 0 || !number.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (size && !Memory.IsGoodAddr(event_array.GetAddr(), sizeof(sys_event_data) * size))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
EventQueue* eq;
|
||||
if (!Emu.GetIdManager().GetIDData(equeue_id, eq))
|
||||
{
|
||||
@ -163,11 +148,6 @@ s32 sys_event_queue_receive(u32 equeue_id, mem_ptr_t<sys_event_data> event, u64
|
||||
sys_event.Log("sys_event_queue_receive(equeue_id=%d, event_addr=0x%x, timeout=%lld)",
|
||||
equeue_id, event.GetAddr(), timeout);
|
||||
|
||||
if (!event.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
EventQueue* eq;
|
||||
if (!Emu.GetIdManager().GetIDData(equeue_id, eq))
|
||||
{
|
||||
@ -252,11 +232,6 @@ s32 sys_event_port_create(mem32_t eport_id, int port_type, u64 name)
|
||||
sys_event.Warning("sys_event_port_create(eport_id_addr=0x%x, port_type=0x%x, name=0x%llx)",
|
||||
eport_id.GetAddr(), port_type, name);
|
||||
|
||||
if (!eport_id.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (port_type != SYS_EVENT_PORT_LOCAL)
|
||||
{
|
||||
sys_event.Error("sys_event_port_create: invalid port_type(0x%x)", port_type);
|
||||
@ -395,11 +370,6 @@ s32 sys_event_flag_create(mem32_t eflag_id, mem_ptr_t<sys_event_flag_attr> attr,
|
||||
sys_event.Warning("sys_event_flag_create(eflag_id_addr=0x%x, attr_addr=0x%x, init=0x%llx)",
|
||||
eflag_id.GetAddr(), attr.GetAddr(), init);
|
||||
|
||||
if(!eflag_id.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch (attr->protocol.ToBE())
|
||||
{
|
||||
case se32(SYS_SYNC_PRIORITY): break;
|
||||
@ -451,7 +421,7 @@ s32 sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64
|
||||
sys_event.Log("sys_event_flag_wait(eflag_id=%d, bitptn=0x%llx, mode=0x%x, result_addr=0x%x, timeout=%lld)",
|
||||
eflag_id, bitptn, mode, result.GetAddr(), timeout);
|
||||
|
||||
if (result.IsGood()) result = 0;
|
||||
if (result.GetAddr()) result = 0;
|
||||
|
||||
switch (mode & 0xf)
|
||||
{
|
||||
@ -500,17 +470,9 @@ s32 sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64
|
||||
ef->flags = 0;
|
||||
}
|
||||
|
||||
if (result.IsGood())
|
||||
{
|
||||
result = flags;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (!result.GetAddr())
|
||||
{
|
||||
return CELL_OK;
|
||||
}
|
||||
return CELL_EFAULT;
|
||||
if (result.GetAddr()) result = flags;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,17 +513,9 @@ s32 sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64
|
||||
ef->signal.unlock(tid);
|
||||
}
|
||||
|
||||
if (result.IsGood())
|
||||
{
|
||||
result = flags;
|
||||
return CELL_OK;
|
||||
}
|
||||
if (result.GetAddr()) result = flags;
|
||||
|
||||
if (!result.GetAddr())
|
||||
{
|
||||
return CELL_OK;
|
||||
}
|
||||
return CELL_EFAULT;
|
||||
return CELL_OK;
|
||||
}
|
||||
}
|
||||
|
||||
@ -599,7 +553,7 @@ s32 sys_event_flag_trywait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result)
|
||||
sys_event.Log("sys_event_flag_trywait(eflag_id=%d, bitptn=0x%llx, mode=0x%x, result_addr=0x%x)",
|
||||
eflag_id, bitptn, mode, result.GetAddr());
|
||||
|
||||
if (result.IsGood()) result = 0;
|
||||
if (result.GetAddr()) result = 0;
|
||||
|
||||
switch (mode & 0xf)
|
||||
{
|
||||
@ -635,17 +589,9 @@ s32 sys_event_flag_trywait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result)
|
||||
ef->flags = 0;
|
||||
}
|
||||
|
||||
if (result.IsGood())
|
||||
{
|
||||
result = flags;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (!result.GetAddr())
|
||||
{
|
||||
return CELL_OK;
|
||||
}
|
||||
return CELL_EFAULT;
|
||||
if (result.GetAddr()) result = flags;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
return CELL_EBUSY;
|
||||
@ -719,17 +665,9 @@ s32 sys_event_flag_cancel(u32 eflag_id, mem32_t num)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (num.IsGood())
|
||||
{
|
||||
num = tids.size();
|
||||
return CELL_OK;
|
||||
}
|
||||
if (num.GetAddr()) num = tids.size();
|
||||
|
||||
if (!num.GetAddr())
|
||||
{
|
||||
return CELL_OK;
|
||||
}
|
||||
return CELL_EFAULT;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_event_flag_get(u32 eflag_id, mem64_t flags)
|
||||
@ -739,11 +677,6 @@ s32 sys_event_flag_get(u32 eflag_id, mem64_t flags)
|
||||
EventFlag* ef;
|
||||
if(!sys_event.CheckId(eflag_id, ef)) return CELL_ESRCH;
|
||||
|
||||
if (!flags.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
SMutexLocker lock(ef->m_mutex);
|
||||
flags = ef->flags;
|
||||
|
||||
|
@ -41,11 +41,6 @@ s32 sys_interrupt_thread_establish(mem32_t ih, u32 intrtag, u64 intrthread, u64
|
||||
{
|
||||
sc_int.Warning("sys_interrupt_thread_establish(ih_addr=0x%x, intrtag=%d, intrthread=%lld, arg=0x%llx)", ih.GetAddr(), intrtag, intrthread, arg);
|
||||
|
||||
if (!ih.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
u32 id = intrtag & 0xff;
|
||||
u32 class_id = intrtag >> 8;
|
||||
RawSPUThread* t = Emu.GetCPU().GetRawSPUThread(id);
|
||||
|
@ -14,31 +14,10 @@ s32 sys_lwcond_create(mem_ptr_t<sys_lwcond_t> lwcond, mem_ptr_t<sys_lwmutex_t> l
|
||||
sys_lwcond.Log("sys_lwcond_create(lwcond_addr=0x%x, lwmutex_addr=0x%x, attr_addr=0x%x)",
|
||||
lwcond.GetAddr(), lwmutex.GetAddr(), attr.GetAddr());
|
||||
|
||||
if (!lwcond.IsGood() /*|| !lwmutex.IsGood()*/ || !attr.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
u32 id = sys_lwcond.GetNewId(new Lwcond(attr->name_u64));
|
||||
lwcond->lwmutex = lwmutex.GetAddr();
|
||||
lwcond->lwcond_queue = id;
|
||||
|
||||
if (lwmutex.IsGood())
|
||||
{
|
||||
if (lwmutex->attribute.ToBE() & se32(SYS_SYNC_RETRY))
|
||||
{
|
||||
sys_lwcond.Warning("Unsupported SYS_SYNC_RETRY lwmutex protocol");
|
||||
}
|
||||
if (lwmutex->attribute.ToBE() & se32(SYS_SYNC_RECURSIVE))
|
||||
{
|
||||
sys_lwcond.Warning("Recursive lwmutex(sq=%d)", (u32)lwmutex->sleep_queue);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_lwcond.Warning("Invalid lwmutex address(0x%x)", lwmutex.GetAddr());
|
||||
}
|
||||
|
||||
sys_lwcond.Warning("*** lwcond created [%s] (lwmutex_addr=0x%x): id = %d",
|
||||
std::string(attr->name, 8).c_str(), lwmutex.GetAddr(), (u32) lwcond->lwcond_queue);
|
||||
|
||||
@ -49,11 +28,6 @@ s32 sys_lwcond_destroy(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
{
|
||||
sys_lwcond.Warning("sys_lwcond_destroy(lwcond_addr=0x%x)", lwcond.GetAddr());
|
||||
|
||||
if (!lwcond.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
u32 id = lwcond->lwcond_queue;
|
||||
|
||||
Lwcond* lw;
|
||||
@ -75,11 +49,6 @@ s32 sys_lwcond_signal(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_signal(lwcond_addr=0x%x)", lwcond.GetAddr());
|
||||
|
||||
if (!lwcond.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
Lwcond* lw;
|
||||
if (!Emu.GetIdManager().GetIDData((u32)lwcond->lwcond_queue, lw))
|
||||
{
|
||||
@ -106,11 +75,6 @@ s32 sys_lwcond_signal_all(mem_ptr_t<sys_lwcond_t> lwcond)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_signal_all(lwcond_addr=0x%x)", lwcond.GetAddr());
|
||||
|
||||
if (!lwcond.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
Lwcond* lw;
|
||||
if (!Emu.GetIdManager().GetIDData((u32)lwcond->lwcond_queue, lw))
|
||||
{
|
||||
@ -137,11 +101,6 @@ s32 sys_lwcond_signal_to(mem_ptr_t<sys_lwcond_t> lwcond, u32 ppu_thread_id)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_signal_to(lwcond_addr=0x%x, ppu_thread_id=%d)", lwcond.GetAddr(), ppu_thread_id);
|
||||
|
||||
if (!lwcond.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
Lwcond* lw;
|
||||
if (!Emu.GetIdManager().GetIDData((u32)lwcond->lwcond_queue, lw))
|
||||
{
|
||||
@ -176,11 +135,6 @@ s32 sys_lwcond_wait(mem_ptr_t<sys_lwcond_t> lwcond, u64 timeout)
|
||||
{
|
||||
sys_lwcond.Log("sys_lwcond_wait(lwcond_addr=0x%x, timeout=%lld)", lwcond.GetAddr(), timeout);
|
||||
|
||||
if (!lwcond.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
Lwcond* lw;
|
||||
if (!Emu.GetIdManager().GetIDData((u32)lwcond->lwcond_queue, lw))
|
||||
{
|
||||
|
@ -13,8 +13,6 @@ s32 sys_lwmutex_create(mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwmutex_a
|
||||
sc_lwmutex.Log("sys_lwmutex_create(lwmutex_addr=0x%x, lwmutex_attr_addr=0x%x)",
|
||||
lwmutex.GetAddr(), attr.GetAddr());
|
||||
|
||||
if (!lwmutex.IsGood() || !attr.IsGood()) return CELL_EFAULT;
|
||||
|
||||
switch (attr->attr_recursive.ToBE())
|
||||
{
|
||||
case se32(SYS_SYNC_RECURSIVE): break;
|
||||
@ -51,8 +49,6 @@ s32 sys_lwmutex_destroy(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
{
|
||||
sc_lwmutex.Warning("sys_lwmutex_destroy(lwmutex_addr=0x%x)", lwmutex.GetAddr());
|
||||
|
||||
if (!lwmutex.IsGood()) return CELL_EFAULT;
|
||||
|
||||
u32 sq_id = lwmutex->sleep_queue;
|
||||
if (!Emu.GetIdManager().CheckID(sq_id)) return CELL_ESRCH;
|
||||
|
||||
@ -72,8 +68,6 @@ s32 sys_lwmutex_lock(mem_ptr_t<sys_lwmutex_t> lwmutex, u64 timeout)
|
||||
{
|
||||
sc_lwmutex.Log("sys_lwmutex_lock(lwmutex_addr=0x%x, timeout=%lld)", lwmutex.GetAddr(), timeout);
|
||||
|
||||
if (!lwmutex.IsGood()) return CELL_EFAULT;
|
||||
|
||||
//ConLog.Write("*** lock mutex (addr=0x%x, attr=0x%x, Nrec=%d, owner=%d, waiter=%d)",
|
||||
//lwmutex.GetAddr(), (u32)lwmutex->attribute, (u32)lwmutex->recursive_count, lwmutex->vars.parts.owner.GetOwner(), (u32)lwmutex->waiter);
|
||||
|
||||
@ -84,8 +78,6 @@ s32 sys_lwmutex_trylock(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
{
|
||||
sc_lwmutex.Log("sys_lwmutex_trylock(lwmutex_addr=0x%x)", lwmutex.GetAddr());
|
||||
|
||||
if (!lwmutex.IsGood()) return CELL_EFAULT;
|
||||
|
||||
return lwmutex->trylock(be_t<u32>::MakeFromLE(GetCurrentPPUThread().GetId()));
|
||||
}
|
||||
|
||||
@ -93,8 +85,6 @@ s32 sys_lwmutex_unlock(mem_ptr_t<sys_lwmutex_t> lwmutex)
|
||||
{
|
||||
sc_lwmutex.Log("sys_lwmutex_unlock(lwmutex_addr=0x%x)", lwmutex.GetAddr());
|
||||
|
||||
if (!lwmutex.IsGood()) return CELL_EFAULT;
|
||||
|
||||
//ConLog.Write("*** unlocking mutex (addr=0x%x, attr=0x%x, Nrec=%d, owner=%d, waiter=%d)",
|
||||
//lwmutex.GetAddr(), (u32)lwmutex->attribute, (u32)lwmutex->recursive_count, (u32)lwmutex->vars.parts.owner.GetOwner(), (u32)lwmutex->waiter);
|
||||
|
||||
|
@ -91,9 +91,6 @@ s32 sys_memory_get_page_attribute(u32 addr, mem_ptr_t<sys_page_attr_t> attr)
|
||||
{
|
||||
sc_mem.Warning("sys_memory_get_page_attribute(addr=0x%x, attr_addr=0x%x)", addr, attr.GetAddr());
|
||||
|
||||
if (!attr.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
// TODO: Implement per thread page attribute setting.
|
||||
attr->attribute = 0;
|
||||
attr->page_size = 0;
|
||||
@ -117,9 +114,6 @@ s32 sys_memory_container_create(mem32_t cid, u32 yield_size)
|
||||
{
|
||||
sc_mem.Warning("sys_memory_container_create(cid_addr=0x%x, yield_size=0x%x)", cid.GetAddr(), yield_size);
|
||||
|
||||
if (!cid.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
yield_size &= ~0xfffff; //round down to 1 MB granularity
|
||||
u64 addr = Memory.Alloc(yield_size, 0x100000); //1 MB alignment
|
||||
|
||||
|
@ -15,9 +15,6 @@ s32 sys_mmapper_allocate_address(u32 size, u64 flags, u32 alignment, u32 alloc_a
|
||||
sys_mmapper.Warning("sys_mmapper_allocate_address(size=0x%x, flags=0x%llx, alignment=0x%x, alloc_addr=0x%x)",
|
||||
size, flags, alignment, alloc_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(alloc_addr))
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Check for valid alignment.
|
||||
if(alignment > 0x80000000)
|
||||
return CELL_EALIGN;
|
||||
@ -61,9 +58,6 @@ s32 sys_mmapper_allocate_memory(u32 size, u64 flags, mem32_t mem_id)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_allocate_memory(size=0x%x, flags=0x%llx, mem_id_addr=0x%x)", size, flags, mem_id.GetAddr());
|
||||
|
||||
if(!mem_id.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Check page granularity.
|
||||
u32 addr;
|
||||
switch(flags & (SYS_MEMORY_PAGE_SIZE_1M | SYS_MEMORY_PAGE_SIZE_64K))
|
||||
@ -98,9 +92,6 @@ s32 sys_mmapper_allocate_memory_from_container(u32 size, u32 cid, u64 flags, mem
|
||||
sys_mmapper.Warning("sys_mmapper_allocate_memory_from_container(size=0x%x, cid=%d, flags=0x%llx, mem_id_addr=0x%x)",
|
||||
size, cid, flags, mem_id.GetAddr());
|
||||
|
||||
if(!mem_id.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Check if this container ID is valid.
|
||||
MemoryContainerInfo* ct;
|
||||
if(!sys_mmapper.CheckId(cid, ct))
|
||||
@ -139,9 +130,6 @@ s32 sys_mmapper_change_address_access_right(u32 start_addr, u64 flags)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_change_address_access_right(start_addr=0x%x, flags=0x%llx)", start_addr, flags);
|
||||
|
||||
if (!Memory.IsGoodAddr(start_addr))
|
||||
return CELL_EINVAL;
|
||||
|
||||
// TODO
|
||||
|
||||
return CELL_OK;
|
||||
@ -151,9 +139,6 @@ s32 sys_mmapper_free_address(u32 start_addr)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_free_address(start_addr=0x%x)", start_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(start_addr))
|
||||
return CELL_EINVAL;
|
||||
|
||||
// Free the address.
|
||||
Memory.Free(start_addr);
|
||||
return CELL_OK;
|
||||
@ -199,9 +184,6 @@ s32 sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, u32 alloc_
|
||||
sys_mmapper.Warning("sys_mmapper_search_and_map(start_addr=0x%x, mem_id=0x%x, flags=0x%llx, alloc_addr=0x%x)",
|
||||
start_addr, mem_id, flags, alloc_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(alloc_addr))
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Check if this mem ID is valid.
|
||||
mmapper_info* info;
|
||||
if(!sys_mmapper.CheckId(mem_id, info))
|
||||
@ -221,8 +203,7 @@ s32 sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, u32 alloc_
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the address is valid.
|
||||
if (!Memory.IsGoodAddr(addr) || !found)
|
||||
if (!found)
|
||||
return CELL_ENOMEM;
|
||||
|
||||
// Write back the start address of the allocated area.
|
||||
@ -238,12 +219,6 @@ s32 sys_mmapper_unmap_memory(u32 start_addr, u32 mem_id_addr)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_unmap_memory(start_addr=0x%x, mem_id_addr=0x%x)", start_addr, mem_id_addr);
|
||||
|
||||
if (!Memory.IsGoodAddr(start_addr))
|
||||
return CELL_EINVAL;
|
||||
|
||||
if (!Memory.IsGoodAddr(mem_id_addr))
|
||||
return CELL_EFAULT;
|
||||
|
||||
// Write back the mem ID of the unmapped area.
|
||||
u32 mem_id = mmapper_info_map.find(start_addr)->first;
|
||||
Memory.Write32(mem_id_addr, mem_id);
|
||||
@ -255,9 +230,6 @@ s32 sys_mmapper_enable_page_fault_notification(u32 start_addr, u32 q_id)
|
||||
{
|
||||
sys_mmapper.Warning("sys_mmapper_enable_page_fault_notification(start_addr=0x%x, q_id=0x%x)", start_addr, q_id);
|
||||
|
||||
if (!Memory.IsGoodAddr(start_addr))
|
||||
return CELL_EINVAL;
|
||||
|
||||
// TODO
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -13,11 +13,6 @@ s32 sys_mutex_create(mem32_t mutex_id, mem_ptr_t<sys_mutex_attribute> attr)
|
||||
{
|
||||
sys_mtx.Log("sys_mutex_create(mutex_id_addr=0x%x, attr_addr=0x%x)", mutex_id.GetAddr(), attr.GetAddr());
|
||||
|
||||
if (!mutex_id.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch (attr->protocol.ToBE())
|
||||
{
|
||||
case se32(SYS_SYNC_FIFO): break;
|
||||
|
@ -108,7 +108,6 @@ s32 sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
|
||||
|
||||
CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
|
||||
if(!thr) return CELL_ESRCH;
|
||||
if(!Memory.IsGoodAddr(prio_addr)) return CELL_EFAULT;
|
||||
|
||||
Memory.Write32(prio_addr, thr->GetPrio());
|
||||
|
||||
@ -119,8 +118,6 @@ s32 sys_ppu_thread_get_stack_information(u32 info_addr)
|
||||
{
|
||||
sysPrxForUser->Log("sys_ppu_thread_get_stack_information(info_addr=0x%x)", info_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(info_addr)) return CELL_EFAULT;
|
||||
|
||||
declCPU();
|
||||
|
||||
Memory.Write32(info_addr, CPU.GetStackAddr());
|
||||
@ -157,23 +154,10 @@ s32 sys_ppu_thread_restart(u64 thread_id)
|
||||
s32 sys_ppu_thread_create(mem64_t thread_id, u32 entry, u64 arg, s32 prio, u32 stacksize, u64 flags, u32 threadname_addr)
|
||||
{
|
||||
std::string threadname = "";
|
||||
if (Memory.IsGoodAddr(threadname_addr))
|
||||
{
|
||||
threadname = Memory.ReadString(threadname_addr);
|
||||
sysPrxForUser->Log("sys_ppu_thread_create(thread_id_addr=0x%x, entry=0x%x, arg=0x%llx, prio=%d, stacksize=0x%x, flags=0x%llx, threadname_addr=0x%x('%s'))",
|
||||
thread_id.GetAddr(), entry, arg, prio, stacksize, flags, threadname_addr, threadname.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
sysPrxForUser->Log("sys_ppu_thread_create(thread_id_addr=0x%x, entry=0x%x, arg=0x%llx, prio=%d, stacksize=0x%x, flags=0x%llx, threadname_addr=0x%x)",
|
||||
thread_id.GetAddr(), entry, arg, prio, stacksize, flags, threadname_addr);
|
||||
if (threadname_addr != 0) return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (!Memory.IsGoodAddr(entry) || !thread_id.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
if (threadname_addr) threadname = Memory.ReadString(threadname_addr);
|
||||
|
||||
sysPrxForUser->Log("sys_ppu_thread_create(thread_id_addr=0x%x, entry=0x%x, arg=0x%llx, prio=%d, stacksize=0x%x, flags=0x%llx, threadname_addr=0x%x('%s'))",
|
||||
thread_id.GetAddr(), entry, arg, prio, stacksize, flags, threadname_addr, threadname.c_str());
|
||||
|
||||
bool is_joinable = false;
|
||||
bool is_interrupt = false;
|
||||
|
@ -60,13 +60,13 @@ void sys_game_process_exitspawn(
|
||||
std::vector<std::string> env;
|
||||
|
||||
mem_ptr_t<u32> argvp(argv_addr);
|
||||
while (argvp.GetAddr() && argvp.IsGood() && *argvp)
|
||||
while (argvp.GetAddr() && *argvp)
|
||||
{
|
||||
argv.push_back(Memory.ReadString(Memory.Read32(argvp.GetAddr())));
|
||||
argvp++;
|
||||
}
|
||||
mem_ptr_t<u32> envp(envp_addr);
|
||||
while (envp.GetAddr() && envp.IsGood() && *envp)
|
||||
while (envp.GetAddr() && *envp)
|
||||
{
|
||||
env.push_back(Memory.ReadString(Memory.Read32(envp.GetAddr())));
|
||||
envp++;
|
||||
@ -108,13 +108,13 @@ void sys_game_process_exitspawn2(
|
||||
std::vector<std::string> env;
|
||||
|
||||
mem_ptr_t<u32> argvp(argv_addr);
|
||||
while (argvp.GetAddr() && argvp.IsGood() && *argvp)
|
||||
while (argvp.GetAddr() && *argvp)
|
||||
{
|
||||
argv.push_back(Memory.ReadString(Memory.Read32(argvp.GetAddr())));
|
||||
argvp++;
|
||||
}
|
||||
mem_ptr_t<u32> envp(envp_addr);
|
||||
while (envp.GetAddr() && envp.IsGood() && *envp)
|
||||
while (envp.GetAddr() && *envp)
|
||||
{
|
||||
env.push_back(Memory.ReadString(Memory.Read32(envp.GetAddr())));
|
||||
envp++;
|
||||
@ -137,9 +137,6 @@ s32 sys_process_get_number_of_object(u32 object, mem32_t nump)
|
||||
{
|
||||
sc_p.Warning("sys_process_get_number_of_object(object=%d, nump_addr=0x%x)",
|
||||
object, nump.GetAddr());
|
||||
|
||||
if (!nump.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
switch(object)
|
||||
{
|
||||
@ -234,9 +231,6 @@ s32 sys_process_get_sdk_version(u32 pid, mem32_t version)
|
||||
{
|
||||
sc_p.Warning("sys_process_get_sdk_version(pid=%d, version_addr=0x%x)", pid, version.GetAddr());
|
||||
|
||||
if (!version.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
version = 0x360001; // TODO
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -10,9 +10,6 @@ SysCallBase sys_prx("sys_prx");
|
||||
|
||||
s32 sys_prx_load_module(u32 path_addr, u64 flags, mem_ptr_t<sys_prx_load_module_option_t> pOpt)
|
||||
{
|
||||
if (!Memory.IsGoodAddr(path_addr))
|
||||
return CELL_PRX_ERROR_INVAL;
|
||||
|
||||
std::string path = Memory.ReadString(path_addr);
|
||||
sys_prx.Todo("sys_prx_load_module(path=\"%s\", flags=0x%llx, pOpt=0x%x)", path.c_str(), flags, pOpt.GetAddr());
|
||||
|
||||
@ -55,9 +52,6 @@ s32 sys_prx_start_module(s32 id, u32 args, u32 argp_addr, mem32_t modres, u64 fl
|
||||
sys_prx.Todo("sys_prx_start_module(id=%d, args=%d, argp_addr=0x%x, modres_addr=0x%x, flags=0x%llx, pOpt=0x%x)",
|
||||
id, args, argp_addr, modres.GetAddr(), flags, pOpt.GetAddr());
|
||||
|
||||
if (!modres.IsGood())
|
||||
return CELL_EINVAL;
|
||||
|
||||
sys_prx_t* prx;
|
||||
if (!Emu.GetIdManager().GetIDData(id, prx))
|
||||
return CELL_ESRCH;
|
||||
@ -73,9 +67,6 @@ s32 sys_prx_stop_module(s32 id, u32 args, u32 argp_addr, mem32_t modres, u64 fla
|
||||
sys_prx.Todo("sys_prx_stop_module(id=%d, args=%d, argp_addr=0x%x, modres_addr=0x%x, flags=0x%llx, pOpt=0x%x)",
|
||||
id, args, argp_addr, modres.GetAddr(), flags, pOpt.GetAddr());
|
||||
|
||||
if (!modres.IsGood())
|
||||
return CELL_EINVAL;
|
||||
|
||||
sys_prx_t* prx;
|
||||
if (!Emu.GetIdManager().GetIDData(id, prx))
|
||||
return CELL_ESRCH;
|
||||
|
@ -10,8 +10,6 @@ s32 sys_rwlock_create(mem32_t rw_lock_id, mem_ptr_t<sys_rwlock_attribute_t> attr
|
||||
{
|
||||
sys_rwlock.Warning("sys_rwlock_create(rw_lock_id_addr=0x%x, attr_addr=0x%x)", rw_lock_id.GetAddr(), attr.GetAddr());
|
||||
|
||||
if (!rw_lock_id.IsGood() || !attr.IsGood()) return CELL_EFAULT;
|
||||
|
||||
switch (attr->attr_protocol.ToBE())
|
||||
{
|
||||
case se(attr->attr_protocol, SYS_SYNC_PRIORITY): sys_rwlock.Todo("SYS_SYNC_PRIORITY"); break;
|
||||
|
@ -14,11 +14,6 @@ s32 sys_semaphore_create(mem32_t sem, mem_ptr_t<sys_semaphore_attribute> attr, i
|
||||
sys_sem.Warning("sys_semaphore_create(sem_addr=0x%x, attr_addr=0x%x, initial_count=%d, max_count=%d)",
|
||||
sem.GetAddr(), attr.GetAddr(), initial_count, max_count);
|
||||
|
||||
if (!sem.IsGood() || !attr.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (max_count <= 0 || initial_count > max_count || initial_count < 0)
|
||||
{
|
||||
sys_sem.Error("sys_semaphore_create(): invalid parameters (initial_count=%d, max_count=%d)", initial_count, max_count);
|
||||
@ -199,11 +194,6 @@ s32 sys_semaphore_get_value(u32 sem_id, mem32_t count)
|
||||
{
|
||||
sys_sem.Log("sys_semaphore_get_value(sem_id=%d, count_addr=0x%x)", sem_id, count.GetAddr());
|
||||
|
||||
if (!count.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
Semaphore* sem;
|
||||
if (!Emu.GetIdManager().GetIDData(sem_id, sem))
|
||||
{
|
||||
|
@ -28,14 +28,9 @@ u32 LoadSpuImage(vfsStream& stream, u32& spu_ep)
|
||||
//156
|
||||
s32 sys_spu_image_open(mem_ptr_t<sys_spu_image> img, u32 path_addr)
|
||||
{
|
||||
const std::string path = Memory.ReadString(path_addr).c_str();
|
||||
const std::string path = Memory.ReadString(path_addr);
|
||||
sc_spu.Warning("sys_spu_image_open(img_addr=0x%x, path_addr=0x%x [%s])", img.GetAddr(), path_addr, path.c_str());
|
||||
|
||||
if(!img.IsGood() || !Memory.IsGoodAddr(path_addr))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
vfsFile f(path);
|
||||
if(!f.IsOpened())
|
||||
{
|
||||
@ -66,19 +61,6 @@ s32 sys_spu_thread_initialize(mem32_t thread, u32 group, u32 spu_num, mem_ptr_t<
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if(!thread.IsGood() || !img.IsGood() || !attr.IsGood() || !arg.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (attr->name_addr)
|
||||
{
|
||||
if(!Memory.IsGoodAddr(attr->name_addr, attr->name_len))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
if(spu_num >= group_info->list.size())
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
@ -140,11 +122,6 @@ s32 sys_spu_thread_set_argument(u32 id, mem_ptr_t<sys_spu_thread_argument> arg)
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if(!arg.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
thr->SetArg(0, arg->arg1);
|
||||
thr->SetArg(1, arg->arg2);
|
||||
thr->SetArg(2, arg->arg3);
|
||||
@ -158,11 +135,6 @@ s32 sys_spu_thread_get_exit_status(u32 id, mem32_t status)
|
||||
{
|
||||
sc_spu.Warning("sys_spu_thread_get_exit_status(id=%d, status_addr=0x%x)", id, status.GetAddr());
|
||||
|
||||
if (!status.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
CPUThread* thr = Emu.GetCPU().GetThread(id);
|
||||
|
||||
if(!thr || thr->GetType() != CPU_THREAD_SPU)
|
||||
@ -286,10 +258,6 @@ s32 sys_spu_thread_group_create(mem32_t id, u32 num, int prio, mem_ptr_t<sys_spu
|
||||
sc_spu.Warning("sys_spu_thread_group_create(id_addr=0x%x, num=%d, prio=%d, attr_addr=0x%x)",
|
||||
id.GetAddr(), num, prio, attr.GetAddr());
|
||||
|
||||
if (!id.IsGood() || !attr.IsGood()) return CELL_EFAULT;
|
||||
|
||||
if (!Memory.IsGoodAddr(attr->name_addr, attr->name_len)) return CELL_EFAULT;
|
||||
|
||||
if (num > 256) return CELL_EINVAL;
|
||||
|
||||
if (prio < 16 || prio > 255) return CELL_EINVAL;
|
||||
@ -315,16 +283,6 @@ s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status)
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (cause.GetAddr() && !cause.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (status.GetAddr() && !status.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (group_info->lock.exchange(1)) // acquire lock
|
||||
{
|
||||
return CELL_EBUSY;
|
||||
@ -392,7 +350,7 @@ s32 sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type)
|
||||
return CELL_ESTAT;
|
||||
}
|
||||
|
||||
if (!(*(SPUThread*)thr).IsGoodLSA(address) || (address % type)) // +check alignment
|
||||
if (address % type) // check alignment
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -425,12 +383,7 @@ s32 sys_spu_thread_read_ls(u32 id, u32 address, mem64_t value, u32 type)
|
||||
return CELL_ESTAT;
|
||||
}
|
||||
|
||||
if(!value.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (!(*(SPUThread*)thr).IsGoodLSA(address) || (address % type)) // +check alignment
|
||||
if (address % type) // check alignment
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -687,11 +640,6 @@ s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, m
|
||||
sc_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());
|
||||
|
||||
if (!spup.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
EventQueue* eq;
|
||||
if (!Emu.GetIdManager().GetIDData(eq_id, eq))
|
||||
{
|
||||
@ -817,11 +765,6 @@ s32 sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, mem32_t
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if (!intrtag.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (t->m_intrtag[class_id].enabled)
|
||||
{
|
||||
return CELL_EAGAIN;
|
||||
@ -856,11 +799,6 @@ s32 sys_raw_spu_get_int_mask(u32 id, u32 class_id, mem64_t mask)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_get_int_mask(id=%d, class_id=%d, mask_addr=0x%x)", id, class_id, mask.GetAddr());
|
||||
|
||||
if (!mask.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
RawSPUThread* t = Emu.GetCPU().GetRawSPUThread(id);
|
||||
if (!t)
|
||||
{
|
||||
@ -899,11 +837,6 @@ s32 sys_raw_spu_get_int_stat(u32 id, u32 class_id, mem64_t stat)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_get_int_stat(id=%d, class_id=%d, stat_addr=0xx)", id, class_id, stat.GetAddr());
|
||||
|
||||
if (!stat.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
RawSPUThread* t = Emu.GetCPU().GetRawSPUThread(id);
|
||||
if (!t)
|
||||
{
|
||||
@ -923,11 +856,6 @@ s32 sys_raw_spu_read_puint_mb(u32 id, mem32_t value)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_read_puint_mb(id=%d, value_addr=0x%x)", id, value.GetAddr());
|
||||
|
||||
if (!value.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
RawSPUThread* t = Emu.GetCPU().GetRawSPUThread(id);
|
||||
if (!t)
|
||||
{
|
||||
@ -958,11 +886,6 @@ s32 sys_raw_spu_get_spu_cfg(u32 id, mem32_t value)
|
||||
{
|
||||
sc_spu.Log("sys_raw_spu_get_spu_afg(id=%d, value_addr=0x%x)", id, value.GetAddr());
|
||||
|
||||
if (!value.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
RawSPUThread* t = Emu.GetCPU().GetRawSPUThread(id);
|
||||
if (!t)
|
||||
{
|
||||
|
@ -12,8 +12,6 @@ s32 sys_timer_create(mem32_t timer_id)
|
||||
{
|
||||
sys_timer.Warning("sys_timer_create(timer_id_addr=0x%x)", timer_id.GetAddr());
|
||||
|
||||
if(!Memory.IsGoodAddr(timer_id.GetAddr())) return CELL_EFAULT;
|
||||
|
||||
timer_id = sys_timer.GetNewId(new timer);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ s32 sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr)
|
||||
s32 sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr)
|
||||
{
|
||||
if(ch > 15 || (s32)len <= 0) return CELL_EINVAL;
|
||||
if(!Memory.IsGoodAddr(buf_addr)) return CELL_EFAULT;
|
||||
|
||||
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));
|
||||
@ -27,8 +26,6 @@ s32 sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr)
|
||||
LOG_ERROR(TTY, Memory.ReadString(buf_addr, len));
|
||||
}
|
||||
|
||||
if(!Memory.IsGoodAddr(pwritelen_addr)) return CELL_EFAULT;
|
||||
|
||||
Memory.Write32(pwritelen_addr, len);
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -13,12 +13,6 @@ s32 sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, u32 a
|
||||
sc_vm.Warning("sys_vm_memory_map(vsize=0x%x,psize=0x%x,cidr=0x%x,flags=0x%llx,policy=0x%llx,addr=0x%x)",
|
||||
vsize, psize, cid, flag, policy, addr);
|
||||
|
||||
// Check output address.
|
||||
if(!Memory.IsGoodAddr(addr, 4))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
// Check virtual size.
|
||||
if((vsize < (0x100000 * 32)) || (vsize > (0x100000 * 256)))
|
||||
{
|
||||
@ -83,7 +77,7 @@ s32 sys_vm_append_memory(u32 addr, u32 size)
|
||||
sc_vm.Warning("sys_vm_append_memory(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -105,7 +99,7 @@ s32 sys_vm_return_memory(u32 addr, u32 size)
|
||||
sc_vm.Warning("sys_vm_return_memory(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -127,7 +121,7 @@ s32 sys_vm_lock(u32 addr, u32 size)
|
||||
sc_vm.Warning("sys_vm_lock(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -149,7 +143,7 @@ s32 sys_vm_unlock(u32 addr, u32 size)
|
||||
sc_vm.Warning("sys_vm_unlock(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -164,7 +158,7 @@ s32 sys_vm_touch(u32 addr, u32 size)
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_touch(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -181,7 +175,7 @@ s32 sys_vm_flush(u32 addr, u32 size)
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_flush(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -198,7 +192,7 @@ s32 sys_vm_invalidate(u32 addr, u32 size)
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_invalidate(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -215,7 +209,7 @@ s32 sys_vm_store(u32 addr, u32 size)
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_store(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -232,7 +226,7 @@ s32 sys_vm_sync(u32 addr, u32 size)
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_sync(addr=0x%x,size=0x%x)", addr, size);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -248,7 +242,7 @@ s32 sys_vm_test(u32 addr, u32 size, u32 result_addr)
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_test(addr=0x%x,size=0x%x,result_addr=0x%x)", addr, size, result_addr);
|
||||
|
||||
// Check address and size.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
if((current_ct->addr != addr) || (current_ct->size < size) || (size <= 0))
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@ -267,7 +261,7 @@ s32 sys_vm_get_statistics(u32 addr, u32 stat_addr)
|
||||
sc_vm.Warning("Unimplemented function: sys_vm_get_statistics(addr=0x%x,stat_addr=0x%x)", addr, stat_addr);
|
||||
|
||||
// Check address.
|
||||
if(!Memory.IsGoodAddr(addr, 4) || (current_ct->addr != addr))
|
||||
if(current_ct->addr != addr)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
@ -416,7 +416,8 @@ void Emulator::Stop()
|
||||
GetKeyboardManager().Close();
|
||||
GetMouseManager().Close();
|
||||
GetCallbackManager().Clear();
|
||||
GetModuleManager().UnloadModules();
|
||||
GetModuleManager().UnloadModules();
|
||||
GetSFuncManager().StaticFinalize();
|
||||
|
||||
CurGameInfo.Reset();
|
||||
Memory.Close();
|
||||
|
@ -138,7 +138,7 @@ bool ELF32Loader::LoadPhdrInfo()
|
||||
phdr_arr.back().Load(elf32_f);
|
||||
}
|
||||
|
||||
if(/*!Memory.IsGoodAddr(entry)*/ entry & 0x1)
|
||||
if(entry & 0x1)
|
||||
{
|
||||
//entry is physical, convert to virtual
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user