当前位置: 首页>>代码示例>>C++>>正文


C++ mem_ptr_t::GetAddr方法代码示例

本文整理汇总了C++中mem_ptr_t::GetAddr方法的典型用法代码示例。如果您正苦于以下问题:C++ mem_ptr_t::GetAddr方法的具体用法?C++ mem_ptr_t::GetAddr怎么用?C++ mem_ptr_t::GetAddr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mem_ptr_t的用法示例。


在下文中一共展示了mem_ptr_t::GetAddr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sys_lwmutex_unlock

int 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);

	return lwmutex->unlock(GetCurrentPPUThread().GetId());
}
开发者ID:davidlee80,项目名称:rpcs3,代码行数:11,代码来源:SC_Lwmutex.cpp

示例2: cellPamfReaderGetNumberOfEp

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))
		return CELL_PAMF_ERROR_INVALID_ARG;

	const mem_ptr_t<PamfHeader> pAddr(pSelf->pAddr);	
	return pAddr->stream_headers[pSelf->stream].ep_num;
}
开发者ID:0179cool,项目名称:rpcs3,代码行数:11,代码来源:cellPamf.cpp

示例3: sys_net_initialize_network_ex

int sys_net_initialize_network_ex(mem_ptr_t<sys_net_initialize_parameter> param)
{
	sys_net.Warning("sys_net_initialize_network_ex(param_addr=0x%x)", param.GetAddr());
	g_lastError.SetAddr(Memory.Alloc(4, 1));
#ifdef _WIN32
	WSADATA wsaData;
	WORD wVersionRequested = MAKEWORD(1,1);
	WSAStartup(wVersionRequested, &wsaData);
#endif
	return CELL_OK;
}
开发者ID:AMMAREN,项目名称:rpcs3,代码行数:11,代码来源:sys_net.cpp

示例4: sys_lwmutex_lock

int 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);

	return lwmutex->lock(GetCurrentPPUThread().GetId(), timeout ? ((timeout < 1000) ? 1 : (timeout / 1000)) : 0);
}
开发者ID:davidlee80,项目名称:rpcs3,代码行数:11,代码来源:SC_Lwmutex.cpp

示例5: cellFontRenderCharGlyphImage

int cellFontRenderCharGlyphImage(mem_ptr_t<CellFont> font, u32 code, mem_ptr_t<CellFontRenderSurface> surface, float x, float y, mem_ptr_t<CellFontGlyphMetrics> metrics, mem_ptr_t<CellFontImageTransInfo> transInfo)
{
	x = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
	y = GetCurrentPPUThread().FPR[2]; // TODO: Something is wrong with the float arguments
	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;

	// Render the character
	int width, height, xoff, yoff;
	float scale = stbtt_ScaleForPixelHeight(&(font->stbfont), font->scale_y);
	unsigned char* box = stbtt_GetCodepointBitmap(&(font->stbfont), scale, scale, code, &width, &height, &xoff, &yoff);
	if (!box) return CELL_OK;

	// Get the baseLineY value
	int baseLineY;
	int ascent, descent, lineGap;
	stbtt_GetFontVMetrics(&(font->stbfont), &ascent, &descent, &lineGap);
	baseLineY = ascent * scale;

	// Move the rendered character to the surface
	unsigned char* buffer = (unsigned char*)Memory.VirtualToRealAddr(surface->buffer_addr);
	for (u32 ypos = 0; ypos < (u32)height; ypos++){
		if ((u32)y + ypos + yoff + baseLineY >= surface->height)
			break;

		for (u32 xpos = 0; xpos < (u32)width; xpos++){
			if ((u32)x + xpos >= surface->width)
				break;

			// TODO: There are some oddities in the position of the character in the final buffer
			buffer[((int)y + ypos + yoff + baseLineY)*surface->width + (int)x+xpos] = box[ypos*width + xpos];
		}
	}
	stbtt_FreeBitmap(box, 0);
	return CELL_FONT_OK;
}
开发者ID:0179cool,项目名称:rpcs3,代码行数:41,代码来源:cellFont.cpp

示例6: cellSpursCreateTaskset

int cellSpursCreateTaskset(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskset> taskset, u64 args, mem8_t priority, u32 maxContention)
{
	cellSpurs->Todo("cellSpursCreateTaskset(spurs_addr=0x%x, taskset_addr=0x%x, args=0x%x, priority_addr=0x%x, maxContention=%u)", spurs.GetAddr(), taskset.GetAddr(), args, priority.GetAddr(), maxContention);

	if ((spurs.GetAddr() % 128 != 0) || (taskset.GetAddr() % 128 != 0))
	{
		cellSpurs->Error("cellSpursCreateTaskset : CELL_SPURS_TASK_ERROR_ALIGN");
		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);

	return CELL_OK;
}
开发者ID:Claudio1234a,项目名称:rpcs3,代码行数:21,代码来源:cellSpurs.cpp

示例7: cellFontSetScalePixel

int cellFontSetScalePixel(mem_ptr_t<CellFont> font, float w, float h)
{
	h = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
	cellFont.Warning("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;
}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:12,代码来源:cellFont.cpp

示例8: cellFontUnbindRenderer

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;

	font->renderer_addr = NULL;
	return CELL_FONT_OK;
}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:12,代码来源:cellFont.cpp

示例9: sys_lwcond_destroy

int 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;
	LWCond* lwc;
	u32 id = (u32)lwcond->lwcond_queue;
	if (!sys_lwcond.CheckId(id, lwc)) return CELL_ESRCH;

	Emu.GetIdManager().RemoveID(id);
	return CELL_OK;
}
开发者ID:Komsomilka,项目名称:rpcs3,代码行数:12,代码来源:SC_Lwcond.cpp

示例10: cellPamfReaderGetStreamTypeAndChannel

int cellPamfReaderGetStreamTypeAndChannel(mem_ptr_t<CellPamfReader> pSelf, mem8_t pType, mem8_t pCh)
{
	cellPamf.Warning("cellPamfReaderGetStreamTypeAndChannel(pSelf=0x%x (stream=%d), pType_addr=0x%x, pCh_addr=0x%x",
		pSelf.GetAddr(), pSelf->stream, pType.GetAddr(), pCh.GetAddr());

	if (!pSelf.IsGood() || !pCh.IsGood())
		return CELL_PAMF_ERROR_INVALID_ARG;

	pType = pamfGetStreamType(pSelf, pSelf->stream);
	pCh = pamfGetStreamChannel(pSelf, pSelf->stream);
	return CELL_OK;
}
开发者ID:rainsome-org1,项目名称:rpcs3,代码行数:12,代码来源:cellPamf.cpp

示例11: sceNpTrophyGetTrophyInfo

int sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, mem_ptr_t<SceNpTrophyDetails> details, mem_ptr_t<SceNpTrophyData> data)
{
	sceNpTrophy.Warning("sceNpTrophyGetTrophyInfo(context=%u, handle=%u, trophyId=%d, details_addr=0x%x, data_addr=0x%x)",
		context, handle, trophyId, details.GetAddr(), data.GetAddr());

	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

	// sceNpTrophyInternalContext& ctxt = s_npTrophyInstance.contexts[context];

	// TODO: This data is faked, implement a XML reader and get it from TROP.SFM
	memcpy(details->name, "Some Trophy", SCE_NP_TROPHY_NAME_MAX_SIZE);
	memcpy(details->description, "Hey! Implement a XML reader, and load the description from TROP.SFM", SCE_NP_TROPHY_DESCR_MAX_SIZE);
	details->hidden = false;
	details->trophyId = trophyId;
	details->trophyGrade = SCE_NP_TROPHY_GRADE_GOLD;
	return CELL_OK;
}
开发者ID:jacksonstarry,项目名称:rpcs3,代码行数:21,代码来源:sceNpTrophy.cpp

示例12: cellFsStat

int cellFsStat(const u32 path_addr, mem_ptr_t<CellFsStat> sb)
{
	const wxString& path = Memory.ReadString(path_addr);
	sys_fs.Log("cellFsStat(path: %s, sb_addr: 0x%x)", path.mb_str(), sb.GetAddr());

	sb->st_mode = 
		CELL_FS_S_IRUSR | CELL_FS_S_IWUSR | CELL_FS_S_IXUSR |
		CELL_FS_S_IRGRP | CELL_FS_S_IWGRP | CELL_FS_S_IXGRP |
		CELL_FS_S_IROTH | CELL_FS_S_IWOTH | CELL_FS_S_IXOTH;

	sb->st_uid = 0;
	sb->st_gid = 0;
	sb->st_atime_ = 0; //TODO
	sb->st_mtime_ = 0; //TODO
	sb->st_ctime_ = 0; //TODO
	sb->st_blksize = 4096;

	// Check if path is a mount point. (TODO: Add information in sb_addr)
	for(u32 i=0; i<Emu.GetVFS().m_devices.GetCount(); ++i)
	{
		if(path.CmpNoCase(Emu.GetVFS().m_devices[i].GetPs3Path().RemoveLast(1)) == 0)
		{
			sys_fs.Log("cellFsStat: '%s' is a mount point.", path.mb_str());
			sb->st_mode |= CELL_FS_S_IFDIR;
			return CELL_OK;
		}
	}

	// TODO: Temporary solution until vfsDir is implemented
	wxString real_path;
	Emu.GetVFS().GetDevice(path, real_path);
	struct stat s;
	if(stat(real_path.c_str(), &s) == 0)
	{
		if(s.st_mode & S_IFDIR)
		{
			sb->st_mode |= CELL_FS_S_IFDIR;
		}
		else if(s.st_mode & S_IFREG)
		{
			vfsFile f(path);
			sb->st_mode |= CELL_FS_S_IFREG;
			sb->st_size = f.GetSize();
		}
	}
	else
	{
		sys_fs.Warning("cellFsStat: '%s' not found.", path.mb_str());
		return CELL_ENOENT;
	}

	return CELL_OK;
}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:53,代码来源:SC_FileSystem.cpp

示例13: cellSysutilGetBgmPlaybackStatus

int cellSysutilGetBgmPlaybackStatus(mem_ptr_t<CellBgmPlaybackStatus> status)
{
	cellSysutil.Warning("cellSysutilGetBgmPlaybackStatus(status=0x%x)", status.GetAddr());

	// non-essential, so always assume background music is stopped/disabled
	status->playbackState = CELL_BGMPLAYBACK_STATUS_STOP;
	status->enabled = CELL_BGMPLAYBACK_STATUS_DISABLE;
	status->fadeRatio = 0; // volume ratio
	memset(status->contentId, 0, sizeof(status->contentId));

	return CELL_OK;
}
开发者ID:Shinsky,项目名称:rpcs3,代码行数:12,代码来源:cellSysutil.cpp

示例14: cellSpursCreateTask

int cellSpursCreateTask(mem_ptr_t<CellSpursTaskset> taskset, mem32_t taskID, mem_ptr_t<void> elf_addr,
	mem_ptr_t<void> context_addr, u32 context_size, mem_ptr_t<CellSpursTaskLsPattern> lsPattern,
	mem_ptr_t<CellSpursTaskArgument> argument)
{
	cellSpurs->Todo("cellSpursCreateTask(taskset_addr=0x%x, taskID_addr=0x%x, elf_addr_addr=0x%x, context_addr_addr=0x%x, context_size=%u, lsPattern_addr=0x%x, argument_addr=0x%x)",
		taskset.GetAddr(), taskID.GetAddr(), elf_addr.GetAddr(), context_addr.GetAddr(), context_size, lsPattern.GetAddr(), argument.GetAddr());

	if (taskset.GetAddr() % 128 != 0)
	{
		cellSpurs->Error("cellSpursCreateTask : CELL_SPURS_TASK_ERROR_ALIGN");
		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;
}
开发者ID:Claudio1234a,项目名称:rpcs3,代码行数:21,代码来源:cellSpurs.cpp

示例15: sys_lwcond_create

int sys_lwcond_create(mem_ptr_t<sys_lwcond_t> lwcond, mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwcond_attribute_t> attr)
{
	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;
	}

	lwcond->lwmutex = lwmutex.GetAddr();
	lwcond->lwcond_queue = sys_lwcond.GetNewId(new SleepQueue(attr->name_u64));

	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", 
		wxString(attr->name, 8).wx_str(), lwmutex.GetAddr(), (u32)lwcond->lwcond_queue);

	return CELL_OK;
}
开发者ID:kaderdjamal,项目名称:rpcs3,代码行数:34,代码来源:SC_Lwcond.cpp


注:本文中的mem_ptr_t::GetAddr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。