本文整理汇总了C++中mem32_t类的典型用法代码示例。如果您正苦于以下问题:C++ mem32_t类的具体用法?C++ mem32_t怎么用?C++ mem32_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了mem32_t类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sys_mmapper_allocate_memory
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))
{
case SYS_MEMORY_PAGE_SIZE_1M:
if(size & 0xfffff)
return CELL_EALIGN;
addr = Memory.Alloc(size, 0x100000);
break;
case SYS_MEMORY_PAGE_SIZE_64K:
if(size & 0xffff)
return CELL_EALIGN;
addr = Memory.Alloc(size, 0x10000);
break;
default:
return CELL_EINVAL;
}
if(!addr)
return CELL_ENOMEM;
// Generate a new mem ID.
mem_id = sys_mmapper.GetNewId(new mmapper_info(addr, size, flags));
return CELL_OK;
}
开发者ID:Claudio1234a,项目名称:rpcs3,代码行数:35,代码来源:sys_mmapper.cpp
示例2: cellFsAioRead
int cellFsAioRead(mem_ptr_t<CellFsAio> aio, mem32_t aio_id, mem_func_ptr_t<void (*)(mem_ptr_t<CellFsAio> xaio, int error, int xid, u64 size)> func)
{
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;
}
vfsFileBase* orig_file;
u32 fd = aio->fd;
if (!sys_fs.CheckId(fd, orig_file)) return CELL_EBADF;
//get a unique id for the callback (may be used by cellFsAioCancel)
const u32 xid = g_FsAioReadID++;
aio_id = xid;
{
thread t("fsAioRead", std::bind(fsAioRead, fd, aio, xid, func));
t.detach();
}
return CELL_OK;
}
开发者ID:AMMAREN,项目名称:rpcs3,代码行数:29,代码来源:sys_fs.cpp
示例3: sys_raw_spu_create_interrupt_tag
s32 sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, mem32_t intrtag)
{
sc_spu.Warning("sys_raw_spu_create_interrupt_tag(id=%d, class_id=%d, hwthread=0x%x, intrtag_addr=0x%x)", id, class_id, hwthread, intrtag.GetAddr());
RawSPUThread* t = Emu.GetCPU().GetRawSPUThread(id);
if (!t)
{
return CELL_ESRCH;
}
if (class_id != 0 && class_id != 2)
{
return CELL_EINVAL;
}
if (!intrtag.IsGood())
{
return CELL_EFAULT;
}
if (t->m_intrtag[class_id].enabled)
{
return CELL_EAGAIN;
}
t->m_intrtag[class_id].enabled = 1;
intrtag = (id & 0xff) | (class_id << 8);
return CELL_OK;
}
开发者ID:Claudio1234a,项目名称:rpcs3,代码行数:31,代码来源:sys_spu.cpp
示例4: cellAdecOpenEx
int cellAdecOpenEx(mem_ptr_t<CellAdecType> type, mem_ptr_t<CellAdecResourceEx> res, mem_ptr_t<CellAdecCb> cb, mem32_t handle)
{
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));
return CELL_OK;
}
开发者ID:jacksonstarry,项目名称:rpcs3,代码行数:16,代码来源:cellAdec.cpp
示例5: cellGameBootCheck
int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameContentSize> size, mem_list_ptr_t<u8> dirName)
{
cellGame.Warning("cellGameBootCheck(type_addr=0x%x, attributes_addr=0x%x, size_addr=0x%x, dirName_addr=0x%x)",
type.GetAddr(), attributes.GetAddr(), size.GetAddr(), dirName.GetAddr());
if (!type.IsGood() || !attributes.IsGood() || !size.IsGood() || !dirName.IsGood())
return CELL_GAME_ERROR_PARAM;
type = CELL_GAME_GAMETYPE_DISC;
attributes = 0;
size->hddFreeSizeKB = 40000000; //40 GB, TODO: Use the free space of the computer's HDD where RPCS3 is being run.
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
size->sysSizeKB = 0;
//TODO: dirName
return CELL_OK;
}
开发者ID:benpicco,项目名称:rpcs3,代码行数:17,代码来源:cellGame.cpp
示例6: cellFsOpendir
int cellFsOpendir(u32 path_addr, mem32_t fd)
{
const wxString& path = Memory.ReadString(path_addr);
sys_fs.Error("cellFsOpendir(path_addr: 0x%x(%s), fd_addr: 0x%x)", path_addr, path.mb_str(), fd.GetAddr());
if(!Memory.IsGoodAddr(path_addr) || !fd.IsGood()) return CELL_EFAULT;
return CELL_OK;
}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:8,代码来源:SC_FileSystem.cpp
示例7: cellVdecOpenEx
int cellVdecOpenEx(const mem_ptr_t<CellVdecTypeEx> type, const mem_ptr_t<CellVdecResourceEx> res, const mem_ptr_t<CellVdecCb> cb, mem32_t handle)
{
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());
handle = vdecOpen(new VideoDecoder(type->codecType, type->profileLevel, res->memAddr, res->memSize, cb->cbFunc, cb->cbArg));
return CELL_OK;
}
开发者ID:TheGeekAndrew,项目名称:rpcs3,代码行数:9,代码来源:cellVdec.cpp
示例8: cellSpursGetTasksetId
int cellSpursGetTasksetId(mem_ptr_t<CellSpursTaskset> taskset, mem32_t workloadId)
{
cellSpurs.Error("cellSpursGetTasksetId(taskset_addr=0x%x, workloadId_addr=0x%x)", taskset.GetAddr(), workloadId.GetAddr());
if(!taskset.IsGood() || !workloadId.IsGood())
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
return CELL_OK;
}
开发者ID:darkf,项目名称:rpcs3,代码行数:9,代码来源:cellSpurs.cpp
示例9: sys_raw_spu_get_spu_cfg
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)
{
return CELL_ESRCH;
}
value = t->cfg.value;
return CELL_OK;
}
开发者ID:Smprvrd,项目名称:rpcs3,代码行数:18,代码来源:sys_spu.cpp
示例10: cellUserInfoGetList
int cellUserInfoGetList(mem32_t listNum, mem_ptr_t<CellUserInfoUserList> listBuf, mem32_t currentUserId)
{
cellUserInfo->Warning("cellUserInfoGetList(listNum_addr=0x%x, listBuf_addr=0x%x, currentUserId_addr=0x%x)",
listNum.GetAddr(), listBuf.GetAddr(), currentUserId.GetAddr());
// If only listNum is NULL, an error will be returned
if (listBuf.GetAddr() && !listNum.GetAddr())
return CELL_USERINFO_ERROR_PARAM;
if (listNum.GetAddr())
listNum = 1;
if (listBuf.GetAddr())
listBuf->userId[0] = 1;
if (currentUserId.GetAddr())
currentUserId = 1;
return CELL_OK;
}
开发者ID:Apicio,项目名称:rpcs3,代码行数:18,代码来源:cellUserInfo.cpp
示例11: cellFsOpendir
int cellFsOpendir(u32 path_addr, mem32_t fd)
{
const wxString& path = Memory.ReadString(path_addr);
sys_fs.Warning("cellFsOpendir(path=\"%s\", fd_addr=0x%x)", path.wx_str(), fd.GetAddr());
if(!Memory.IsGoodAddr(path_addr) || !fd.IsGood())
return CELL_EFAULT;
vfsDirBase* dir = Emu.GetVFS().OpenDir(path);
if(!dir || !dir->IsOpened())
{
delete dir;
return CELL_ENOENT;
}
fd = sys_fs.GetNewId(dir, IDFlag_Dir);
return CELL_OK;
}
开发者ID:pnghai,项目名称:rpcs3,代码行数:18,代码来源:SC_FileSystem.cpp
示例12: cellSpursGetSpuThreadId
int cellSpursGetSpuThreadId(mem_ptr_t<CellSpurs> spurs, mem32_t thread, mem32_t nThreads)
{
cellSpurs->Todo("cellSpursGetSpuThreadId(spurs_addr=0x%x, thread_addr=0x%x, nThreads_addr=0x%x)", spurs.GetAddr(), thread.GetAddr(), nThreads.GetAddr());
if (spurs.GetAddr() % 128 != 0)
{
cellSpurs->Error("cellSpursGetSpuThreadId : CELL_SPURS_CORE_ERROR_ALIGN");
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;
}
开发者ID:Claudio1234a,项目名称:rpcs3,代码行数:18,代码来源:cellSpurs.cpp
示例13: cellFsGetFreeSize
int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count)
{
const wxString& ps3_path = Memory.ReadString(path_addr);
sys_fs.Warning("cellFsGetFreeSize(path=\"%s\", block_size_addr=0x%x, block_count_addr=0x%x)",
ps3_path.wx_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;
// TODO: Get real values. Currently, it always returns 40 GB of free space divided in 4 KB blocks
block_size = 4096; // ?
block_count = 10485760; // ?
return CELL_OK;
}
开发者ID:pnghai,项目名称:rpcs3,代码行数:18,代码来源:SC_FileSystem.cpp
示例14: sys_event_flag_cancel
int sys_event_flag_cancel(u32 eflag_id, mem32_t num)
{
sys_event_flag.Warning("sys_event_flag_cancel(eflag_id=%d, num_addr=0x%x)", eflag_id, num.GetAddr());
EventFlag* ef;
if(!sys_event_flag.CheckId(eflag_id, ef)) return CELL_ESRCH;
Array<u32> tids;
{
SMutexLocker lock(ef->m_mutex);
tids.SetCount(ef->waiters.GetCount());
for (u32 i = 0; i < ef->waiters.GetCount(); i++)
{
tids[i] = ef->waiters[i].tid;
}
ef->waiters.Clear();
}
for (u32 i = 0; i < tids.GetCount(); i++)
{
if (Emu.IsStopped()) break;
ef->signal.lock(tids[i]);
}
if (Emu.IsStopped())
{
ConLog.Warning("sys_event_flag_cancel(id=%d) aborted", eflag_id);
return CELL_OK;
}
if (num.IsGood())
{
num = tids.GetCount();
return CELL_OK;
}
if (!num.GetAddr())
{
return CELL_OK;
}
return CELL_EFAULT;
}
开发者ID:AMMAREN,项目名称:rpcs3,代码行数:43,代码来源:SC_Event_flag.cpp
示例15: cellFontGetEffectSlant
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;
}
开发者ID:0179cool,项目名称:rpcs3,代码行数:10,代码来源:cellFont.cpp
示例16: cellFontGetEffectSlant
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;
return CELL_FONT_OK;
}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:10,代码来源:cellFont.cpp
示例17: sceNpManagerGetStatus
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
// TODO: Support different statuses
status = SCE_NP_MANAGER_STATUS_OFFLINE;
return CELL_OK;
}
开发者ID:TheGeekAndrew,项目名称:rpcs3,代码行数:10,代码来源:sceNp.cpp
示例18: cellPadGetCapabilityInfo
int cellPadGetCapabilityInfo(u32 port_no, mem32_t info_addr)
{
sys_io->Log("cellPadGetCapabilityInfo[port_no: %d, data_addr: 0x%x]", port_no, info_addr.GetAddr());
if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED;
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER;
if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE;
const std::vector<Pad>& pads = Emu.GetPadManager().GetPads();
CellCapabilityInfo data = {};
//Should return the same as device capability mask, psl1ght has it backwards in pad.h
data.info[0] = pads[port_no].m_device_capability;
Memory.WriteData(info_addr.GetAddr(), data);
return CELL_OK;
}
开发者ID:TheGeekAndrew,项目名称:rpcs3,代码行数:19,代码来源:SC_Pad.cpp
示例19: sys_mutex_create
s32 sys_mutex_create(mem32_t mutex_id, mem_ptr_t<sys_mutex_attribute> attr)
{
sys_mutex.Log("sys_mutex_create(mutex_id_addr=0x%x, attr_addr=0x%x)", mutex_id.GetAddr(), attr.GetAddr());
switch (attr->protocol.ToBE())
{
case se32(SYS_SYNC_FIFO): break;
case se32(SYS_SYNC_PRIORITY): break;
case se32(SYS_SYNC_PRIORITY_INHERIT): sys_mutex.Todo("sys_mutex_create(): SYS_SYNC_PRIORITY_INHERIT"); break;
case se32(SYS_SYNC_RETRY): sys_mutex.Error("sys_mutex_create(): SYS_SYNC_RETRY"); return CELL_EINVAL;
default: sys_mutex.Error("Unknown protocol attribute(0x%x)", (u32)attr->protocol); return CELL_EINVAL;
}
bool is_recursive;
switch (attr->recursive.ToBE())
{
case se32(SYS_SYNC_RECURSIVE): is_recursive = true; break;
case se32(SYS_SYNC_NOT_RECURSIVE): is_recursive = false; break;
default: sys_mutex.Error("Unknown recursive attribute(0x%x)", (u32)attr->recursive); return CELL_EINVAL;
}
if (attr->pshared.ToBE() != se32(0x200))
{
sys_mutex.Error("Unknown pshared attribute(0x%x)", (u32)attr->pshared);
return CELL_EINVAL;
}
u32 tid = GetCurrentPPUThread().GetId();
Mutex* mutex = new Mutex((u32)attr->protocol, is_recursive, attr->name_u64);
u32 id = sys_mutex.GetNewId(mutex, TYPE_MUTEX);
mutex->m_mutex.lock(tid);
mutex->id = id;
mutex_id = id;
mutex->m_mutex.unlock(tid);
sys_mutex.Warning("*** mutex created [%s] (protocol=0x%x, recursive=%s): id = %d",
std::string(attr->name, 8).c_str(), (u32) attr->protocol,
(is_recursive ? "true" : "false"), mutex_id.GetValue());
// TODO: unlock mutex when owner thread does exit
return CELL_OK;
}
开发者ID:TheGeekAndrew,项目名称:rpcs3,代码行数:42,代码来源:sys_mutex.cpp
示例20: sys_time_get_timezone
// Functions
s32 sys_time_get_timezone(mem32_t timezone, mem32_t summertime)
{
sys_time.Warning("sys_time_get_timezone(timezone_addr=0x%x, summertime_addr=0x%x)", timezone.GetAddr(), summertime.GetAddr());
int ret;
ret = cellSysutilGetSystemParamInt(0x0116, timezone); //0x0116 = CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE
if (ret != CELL_OK) return ret;
ret = cellSysutilGetSystemParamInt(0x0117, summertime); //0x0117 = CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE
if (ret != CELL_OK) return ret;
return CELL_OK;
}
开发者ID:Apicio,项目名称:rpcs3,代码行数:12,代码来源:sys_time.cpp
注:本文中的mem32_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论