本文整理汇总了C++中PSPPointer::IsValid方法的典型用法代码示例。如果您正苦于以下问题:C++ PSPPointer::IsValid方法的具体用法?C++ PSPPointer::IsValid怎么用?C++ PSPPointer::IsValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PSPPointer
的用法示例。
在下文中一共展示了PSPPointer::IsValid方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteBuffer
void WriteBuffer(u32 srcPtr, u32 len)
{
Memory::Memcpy(bufAddr + (bufSize - freeSize), srcPtr, len);
freeSize -= len;
if (transferredBytes.IsValid())
*transferredBytes += len;
}
示例2: ReadBuffer
void ReadBuffer(u32 destPtr, u32 len)
{
Memory::Memcpy(destPtr, bufAddr + bufSize - freeSize, len);
freeSize -= len;
if (transferredBytes.IsValid())
*transferredBytes += len;
}
示例3:
Psmf *getPsmf(u32 psmf)
{
PSPPointer<PsmfData> psmfstruct;
psmfstruct = psmf;
if (!psmfstruct.IsValid())
return 0;
auto iter = psmfMap.find(psmfstruct->headerOffset);
if (iter != psmfMap.end())
return iter->second;
else
return 0;
}
示例4: __CtrlReadSingleBuffer
static int __CtrlReadSingleBuffer(PSPPointer<_ctrl_data> data, bool negative)
{
if (data.IsValid())
{
*data = ctrlBufs[ctrlBufRead];
ctrlBufRead = (ctrlBufRead + 1) % NUM_CTRL_BUFFERS;
if (negative)
data->buttons = ~data->buttons;
return 1;
}
return 0;
}
示例5: sceMpegRingbufferAvailableSize
int sceMpegRingbufferAvailableSize(u32 ringbufferAddr)
{
PSPPointer<SceMpegRingBuffer> ringbuffer;
ringbuffer = ringbufferAddr;
if (!ringbuffer.IsValid()) {
ERROR_LOG(HLE, "sceMpegRingbufferAvailableSize(%08x) - bad address", ringbufferAddr);
return -1;
}
MpegContext *ctx = getMpegCtx(ringbuffer->mpeg);
if (!ctx) {
ERROR_LOG(HLE, "sceMpegRingbufferAvailableSize(%08x) - bad mpeg", ringbufferAddr);
return -1;
}
hleEatCycles(2020);
DEBUG_LOG(HLE, "%i=sceMpegRingbufferAvailableSize(%08x)", ringbuffer->packetsFree, ringbufferAddr);
return ringbuffer->packetsFree;
}
示例6: if
void PSPOskDialog::ConvertUCS2ToUTF8(std::string& _string, const PSPPointer<u16_le> em_address)
{
if (!em_address.IsValid())
{
_string = "";
return;
}
char stringBuffer[2048];
char *string = stringBuffer;
auto input = em_address;
int c;
while ((c = *input++) != 0)
{
if (c < 0x80)
*string++ = c;
else if (c < 0x800) {
*string++ = 0xC0 | (c >> 6);
*string++ = 0x80 | (c & 0x3F);
} else {
示例7: if
void PSPOskDialog::ConvertUCS2ToUTF8(std::string& _string, const PSPPointer<u16_le>& em_address)
{
if (!em_address.IsValid())
{
_string = "";
return;
}
const size_t maxLength = 2047;
char stringBuffer[maxLength + 1];
char *string = stringBuffer;
u16_le *input = &em_address[0];
int c;
while ((c = *input++) != 0 && string < stringBuffer + maxLength)
{
if (c < 0x80)
*string++ = c;
else if (c < 0x800) {
*string++ = 0xC0 | (c >> 6);
*string++ = 0x80 | (c & 0x3F);
} else {