本文整理汇总了C++中GetStartAddr函数的典型用法代码示例。如果您正苦于以下问题:C++ GetStartAddr函数的具体用法?C++ GetStartAddr怎么用?C++ GetStartAddr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetStartAddr函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DDX_Radio
void CassImpTargetDialog::DoDataExchange(CDataExchange* pDX)
{
DDX_Radio(pDX, IDC_CASSIMPTARG_BAS, fFileTypeIndex);
DDX_Text(pDX, IDC_CASSIMPTARG_FILENAME, fFileName);
if (pDX->m_bSaveAndValidate) {
CString appName;
appName.LoadString(IDS_MB_APP_NAME);
if (fFileTypeIndex == kTypeBIN) {
if (GetStartAddr() < 0) {
MessageBox(L"The address field must be a valid 4-digit "
L" hexadecimal number.",
appName, MB_OK);
pDX->Fail();
return;
}
fStartAddr = (unsigned short) GetStartAddr();
}
if (fFileName.IsEmpty()) {
MessageBox(L"You must enter a filename.", appName, MB_OK);
pDX->Fail();
return;
}
} else {
CWnd* pWnd;
CString tmpStr;
pWnd = GetDlgItem(IDC_CASSIMPTARG_BINADDR);
tmpStr.Format(L"%04X", fStartAddr);
pWnd->SetWindowText(tmpStr);
}
}
示例2: GetStartAddr
bool RawSPUThread::Read64(const u64 addr, u64* value)
{
if(addr < GetStartAddr() + RAW_SPU_PROB_OFFSET)
{
return MemoryBlock::Read64(addr, value);
}
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
ConLog.Error("RawSPUThread[%d]: Read64(0x%x)", m_index, offset);
Emu.Pause();
return false;
}
示例3: assert
u32 VirtualMemoryBlock::Map(u32 realaddr, u32 size)
{
assert(size);
for (u32 addr = GetStartAddr(); addr <= GetEndAddr() - GetReservedAmount() - size;)
{
bool is_good_addr = true;
// check if address is already mapped
for (u32 i = 0; i<m_mapped_memory.size(); ++i)
{
if ((addr >= m_mapped_memory[i].addr && addr < m_mapped_memory[i].addr + m_mapped_memory[i].size) ||
(m_mapped_memory[i].addr >= addr && m_mapped_memory[i].addr < addr + size))
{
is_good_addr = false;
addr = m_mapped_memory[i].addr + m_mapped_memory[i].size;
break;
}
}
if (!is_good_addr) continue;
m_mapped_memory.emplace_back(addr, realaddr, size);
return addr;
}
return 0;
}
示例4: Reserve
bool VirtualMemoryBlock::Reserve(u32 size)
{
if(size + GetReservedAmount() > GetEndAddr() - GetStartAddr())
return false;
m_reserve_size += size;
return true;
}
示例5:
RawSPUThread::~RawSPUThread()
{
for(int i=0; i<Memory.MemoryBlocks.size(); ++i)
{
if(Memory.MemoryBlocks[i]->GetStartAddr() == GetStartAddr())
{
Memory.MemoryBlocks.erase(Memory.MemoryBlocks.begin() + i);
break;
}
}
//Close();
}
示例6: GetStartAddr
void CassImpTargetDialog::OnAddrChange(void)
{
CWnd* pWnd;
CString tmpStr;
long val;
val = GetStartAddr();
if (val < 0)
val = 0;
tmpStr.Format(L".%04X", val + fFileLength-1);
pWnd = GetDlgItem(IDC_CASSIMPTARG_RANGE);
pWnd->SetWindowText(tmpStr);
}
示例7: GetStartAddr
bool RawSPUThread::Read32(const u64 addr, u32* value)
{
const u64 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
switch (offset)
{
case MFC_CMDStatus_offs:
{
*value = MFC2.CMDStatus.GetValue();
break;
}
case MFC_QStatus_offs:
{
// TagStatus is not used: mask is written directly
*value = MFC2.QueryMask.GetValue();
break;
}
case SPU_Out_MBox_offs:
{
// if Out_MBox is empty, the result is undefined
SPU.Out_MBox.PopUncond(*value);
break;
}
case SPU_MBox_Status_offs:
{
*value = (SPU.Out_MBox.GetCount() & 0xff) | (SPU.In_MBox.GetFreeCount() << 8);
break;
}
case SPU_Status_offs:
{
*value = SPU.Status.GetValue();
break;
}
default:
{
// TODO: read value from LS if necessary (not important)
LOG_ERROR(Log::SPU, "RawSPUThread[%d]: Read32(0x%llx)", m_index, offset);
return false;
}
}
return true;
}
示例8: Map
u64 VirtualMemoryBlock::Map(u64 realaddr, u32 size, u64 addr)
{
if(addr)
{
if(!IsInMyRange(addr, size) && (IsMyAddress(addr) || IsMyAddress(addr + size - 1)))
return 0;
m_mapped_memory.emplace_back(addr, realaddr, size);
return addr;
}
else
{
for(u64 addr = GetStartAddr(); addr <= GetEndAddr() - GetReservedAmount() - size;)
{
bool is_good_addr = true;
// check if address is already mapped
for(u32 i=0; i<m_mapped_memory.size(); ++i)
{
if((addr >= m_mapped_memory[i].addr && addr < m_mapped_memory[i].addr + m_mapped_memory[i].size) ||
(m_mapped_memory[i].addr >= addr && m_mapped_memory[i].addr < addr + size))
{
is_good_addr = false;
addr = m_mapped_memory[i].addr + m_mapped_memory[i].size;
break;
}
}
if(!is_good_addr) continue;
m_mapped_memory.emplace_back(addr, realaddr, size);
return addr;
}
return 0;
}
}
示例9: GetStartAddr
bool VirtualMemoryBlock::IsInMyRange(const u64 addr)
{
return addr >= GetStartAddr() && addr < GetStartAddr() + GetSize() - GetReservedAmount();
}
示例10: GetStartAddr
u64 MemoryBlock::FixAddr(const u64 addr) const
{
return addr - GetStartAddr();
}
示例11: GetStartAddr
bool VirtualMemoryBlock::IsInMyRange(const u32 addr, const u32 size)
{
return addr >= GetStartAddr() && addr + size - 1 <= GetEndAddr() - GetReservedAmount();
}