本文整理汇总了C++中Document::AddMemoryArea方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::AddMemoryArea方法的具体用法?C++ Document::AddMemoryArea怎么用?C++ Document::AddMemoryArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Document
的用法示例。
在下文中一共展示了Document::AddMemoryArea方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Map
void RawLoader::Map(Document& rDoc, Architecture::VectorSharedPtr const& rArchs)
{
rDoc.AddMemoryArea(new MappedMemoryArea(
"raw",
0x0, rDoc.GetBinaryStream().GetSize(),
Address(Address::FlatType, 0x0), rDoc.GetBinaryStream().GetSize(),
MemoryArea::Execute | MemoryArea::Read | MemoryArea::Write
));
}
示例2: Map
void GameBoyLoader::Map(Document& rDoc, Architecture::VectorSharedPtr const& rArchs)
{
rDoc.AddMemoryArea(new VirtualMemoryArea(
"VRAM",
Address(Address::BankType, 0, 0x8000, 8, 16), 0x2000,
MemoryArea::Read | MemoryArea::Write
));
rDoc.AddMemoryArea(new VirtualMemoryArea(
"RAM#nn",
Address(Address::BankType, 0, 0xA000, 8, 16), 0x2000,
MemoryArea::Read | MemoryArea::Write
));
rDoc.AddMemoryArea(new VirtualMemoryArea(
"RAM/IOMap",
Address(Address::BankType, 0, 0xC000, 8, 16), 0x4000,
MemoryArea::Read | MemoryArea::Write
));
rDoc.AddMemoryArea(new MappedMemoryArea(
"ROM#00",
0x0, BankSize,
Address(Address::BankType, 0, 0x0000, 8, 16), BankSize,
MemoryArea::Execute | MemoryArea::Read | MemoryArea::Write
));
// TODO: This memory area is not really located at 0:4000, but it's the default value
rDoc.AddMemoryArea(new MappedMemoryArea(
"ROM#01",
0x4000, BankSize,
Address(Address::BankType, 0, 0x4000, 8, 16), BankSize,
MemoryArea::Execute | MemoryArea::Read | MemoryArea::Write
));
BankType BankNo = GetNumberOfBank();
Log::Write("ldr_gb") << "Number of bank: " << BankNo << LogEnd;
TOffset Offset = 0x8000;
for (TBank Bank = 2; Bank < BankNo; ++Bank)
{
std::ostringstream oss;
oss << "ROM#" << std::hex << std::setw(2) << std::setfill('0') << Bank;
rDoc.AddMemoryArea(new MappedMemoryArea(
oss.str().c_str(),
Bank * BankSize, BankSize,
Address(Address::BankType, Bank, 0x4000, 8, 16), BankSize,
MemoryArea::Execute | MemoryArea::Read | MemoryArea::Write
));
}
rDoc.AddLabel(Address(Address::BankType, 0x0, 0x100, 8, 16), Label("start", Label::Code | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0x40, 8, 16), Label("VerticalBlankInterrupt", Label::Code | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0x48, 8, 16), Label("LcdStatusInterrupt", Label::Code | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0x50, 8, 16), Label("TimerInterrupt", Label::Code | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0x58, 8, 16), Label("SerialLinkInterrupt", Label::Code | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0x60, 8, 16), Label("JoypadPressInterrupt", Label::Code | Label::Global));
// Source: http://fms.komkon.org/GameBoy/Tech/Software.html
// Source: http://nocash.emubase.de/pandocs.htm
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff00, 8, 16), Label("JOYPAD", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff01, 8, 16), Label("SIODATA", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff02, 8, 16), Label("SIOCONT", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff04, 8, 16), Label("DIVIDER", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff05, 8, 16), Label("TIMECNT", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff06, 8, 16), Label("TIMEMOD", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff07, 8, 16), Label("TIMECONT", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff0f, 8, 16), Label("IFLAGS", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff10, 8, 16), Label("SNDREG10", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff11, 8, 16), Label("SNDREG11", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff12, 8, 16), Label("SNDREG12", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff13, 8, 16), Label("SNDREG13", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff14, 8, 16), Label("SNDREG14", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff16, 8, 16), Label("SNDREG21", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff17, 8, 16), Label("SNDREG22", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff18, 8, 16), Label("SNDREG23", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff19, 8, 16), Label("SNDREG24", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff1a, 8, 16), Label("SNDREG25", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff1b, 8, 16), Label("SNDREG31", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff1c, 8, 16), Label("SNDREG32", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff1d, 8, 16), Label("SNDREG33", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff1e, 8, 16), Label("SNDREG34", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff20, 8, 16), Label("SNDREG41", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff21, 8, 16), Label("SNDREG42", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff22, 8, 16), Label("SNDREG43", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff23, 8, 16), Label("SNDREG44", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff24, 8, 16), Label("SNDREG50", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff25, 8, 16), Label("SNDREG51", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff26, 8, 16), Label("SNDREG52", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff40, 8, 16), Label("LCDCONT", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff41, 8, 16), Label("LCDSTAT", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff42, 8, 16), Label("SCROLLY", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff43, 8, 16), Label("SCROLLX", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff44, 8, 16), Label("CURLINE", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff45, 8, 16), Label("CMPLINE", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff46, 8, 16), Label("DMACONT", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff47, 8, 16), Label("BGRDPAL", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff48, 8, 16), Label("OBJ0PAL", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff49, 8, 16), Label("OBJ1PAL", Label::Data | Label::Global));
rDoc.AddLabel(Address(Address::BankType, 0x0, 0xff4a, 8, 16), Label("WNDPOSY", Label::Data | Label::Global));
//.........这里部分代码省略.........