本文整理汇总了C++中markup::Node类的典型用法代码示例。如果您正苦于以下问题:C++ Node类的具体用法?C++ Node怎么用?C++ Node使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Node类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: m
void Cartridge::parse_markup_sdd1(Markup::Node root) {
if(!root) return;
has_sdd1 = true;
auto rom = root.find("rom");
auto ram = root.find("ram");
parse_markup_memory(sdd1.rom, rom(0), ID::SDD1ROM, false);
parse_markup_memory(sdd1.ram, ram(0), ID::SDD1RAM, true);
for(auto node : root.find("map")) {
if(node["id"].text() == "io") {
Mapping m({&SDD1::read, &sdd1}, {&SDD1::write, &sdd1});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].text() == "rom") {
Mapping m({&SDD1::mcurom_read, &sdd1}, {&SDD1::mcurom_write, &sdd1});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].text() == "ram") {
Mapping m({&SDD1::mcuram_read, &sdd1}, {&SDD1::mcuram_write, &sdd1});
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例2: parse_markup_sufamiturbo
void Cartridge::parse_markup_sufamiturbo(Markup::Node root, bool slot) {
if(root.exists() == false) return;
has_st_slots = true;
if(slot == 0) {
//load required slot A (will request slot B if slot A cartridge is linkable)
interface->loadRequest(ID::SufamiTurboSlotA, "Sufami Turbo - Slot A", "st");
}
for(auto& node : root.find("map")) {
SufamiTurboCartridge &cart = (slot == 0 ? sufamiturboA : sufamiturboB);
if(node["id"].data == "rom") {
if(cart.rom.size() == 0) continue;
Mapping m(cart.rom);
parse_markup_map(m, node);
if(m.size == 0) m.size = cart.rom.size();
if(m.size) mapping.append(m);
}
if(node["id"].data == "ram") {
if(cart.ram.size() == 0) continue;
Mapping m(cart.ram);
parse_markup_map(m, node);
if(m.size == 0) m.size = cart.ram.size();
if(m.size) mapping.append(m);
}
}
}
示例3: parse_markup_superfx
void Cartridge::parse_markup_superfx(Markup::Node root) {
if(!root) return;
has_superfx = true;
auto rom = root.find("rom");
auto ram = root.find("ram");
parse_markup_memory(superfx.rom, rom(0), ID::SuperFXROM, false);
parse_markup_memory(superfx.ram, ram(0), ID::SuperFXRAM, true);
for(auto node : root.find("map")) {
if(node["id"].text() == "io") {
Mapping m({&SuperFX::mmio_read, &superfx}, {&SuperFX::mmio_write, &superfx});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].text() == "rom") {
Mapping m(superfx.cpurom);
parse_markup_map(m, node);
if(m.size == 0) m.size = superfx.rom.size();
mapping.append(m);
}
if(node["id"].text() == "ram") {
Mapping m(superfx.cpuram);
parse_markup_map(m, node);
if(m.size == 0) m.size = superfx.ram.size();
mapping.append(m);
}
}
}
示例4: parse_markup_armdsp
void Cartridge::parse_markup_armdsp(Markup::Node root) {
if(!root) return;
has_armdsp = true;
auto rom = root.find("rom");
auto ram = root.find("ram");
string programROMName = rom(0)["name"].text();
string dataROMName = rom(1)["name"].text();
string dataRAMName = ram(0)["name"].text();
interface->loadRequest(ID::ArmDSPPROM, programROMName);
interface->loadRequest(ID::ArmDSPDROM, dataROMName);
if(dataRAMName.empty() == false) {
interface->loadRequest(ID::ArmDSPRAM, dataRAMName);
memory.append({ID::ArmDSPRAM, dataRAMName});
}
for(auto node : root.find("map")) {
if(node["id"].text() == "io") {
Mapping m({&ArmDSP::mmio_read, &armdsp}, {&ArmDSP::mmio_write, &armdsp});
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例5: parse_markup_necdsp
void Cartridge::parse_markup_necdsp(Markup::Node root) {
if(!root) return;
has_necdsp = true;
for(auto& word : necdsp.programROM) word = 0x000000;
for(auto& word : necdsp.dataROM) word = 0x0000;
for(auto& word : necdsp.dataRAM) word = 0x0000;
necdsp.frequency = root["frequency"].decimal();
if(necdsp.frequency == 0) necdsp.frequency = 8000000;
necdsp.revision
= root["model"].text() == "uPD7725" ? NECDSP::Revision::uPD7725
: root["model"].text() == "uPD96050" ? NECDSP::Revision::uPD96050
: NECDSP::Revision::uPD7725;
auto rom = root.find("rom");
auto ram = root.find("ram");
string programROMName = rom(0)["name"].text();
string dataROMName = rom(1)["name"].text();
string dataRAMName = ram(0)["name"].text();
if(necdsp.revision == NECDSP::Revision::uPD7725) {
interface->loadRequest(ID::Nec7725DSPPROM, programROMName);
interface->loadRequest(ID::Nec7725DSPDROM, dataROMName);
if(dataRAMName.empty() == false) {
interface->loadRequest(ID::Nec7725DSPRAM, dataRAMName);
memory.append({ID::Nec7725DSPRAM, dataRAMName});
}
}
if(necdsp.revision == NECDSP::Revision::uPD96050) {
interface->loadRequest(ID::Nec96050DSPPROM, programROMName);
interface->loadRequest(ID::Nec96050DSPDROM, dataROMName);
if(dataRAMName.empty() == false) {
interface->loadRequest(ID::Nec96050DSPRAM, dataRAMName);
memory.append({ID::Nec96050DSPRAM, dataRAMName});
}
}
for(auto node : root.find("map")) {
if(node["id"].text() == "io") {
Mapping m({&NECDSP::read, &necdsp}, {&NECDSP::write, &necdsp});
parse_markup_map(m, node);
mapping.append(m);
necdsp.Select = node["select"].decimal();
}
if(node["id"].text() == "ram") {
Mapping m({&NECDSP::ram_read, &necdsp}, {&NECDSP::ram_write, &necdsp});
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例6: m
void Cartridge::parse_markup_sdd1(Markup::Node root) {
if(root.exists() == false) return;
has_sdd1 = true;
parse_markup_memory(sdd1.rom, root["rom"], ID::SDD1ROM, false);
parse_markup_memory(sdd1.ram, root["ram"], ID::SDD1RAM, true);
for(auto& node : root) {
if(node.name != "map") continue;
if(node["id"].data == "io") {
Mapping m({&SDD1::read, &sdd1}, {&SDD1::write, &sdd1});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].data == "rom") {
Mapping m({&SDD1::mcurom_read, &sdd1}, {&SDD1::mcurom_write, &sdd1});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].data == "ram") {
Mapping m({&SDD1::mcuram_read, &sdd1}, {&SDD1::mcuram_write, &sdd1});
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例7: parse_markup_armdsp
void Cartridge::parse_markup_armdsp(Markup::Node root) {
if(root.exists() == false) return;
has_armdsp = true;
string programROMName = root["rom[0]/name"].data;
string dataROMName = root["rom[1]/name"].data;
string dataRAMName = root["ram/name"].data;
interface->loadRequest(ID::ArmDSPPROM, programROMName);
interface->loadRequest(ID::ArmDSPDROM, dataROMName);
if(dataRAMName.empty() == false) {
interface->loadRequest(ID::ArmDSPRAM, dataRAMName);
memory.append({ID::ArmDSPRAM, dataRAMName});
}
for(auto& node : root) {
if(node.name != "map") continue;
if(node["id"].data == "io") {
Mapping m({&ArmDSP::mmio_read, &armdsp}, {&ArmDSP::mmio_write, &armdsp});
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例8: parse_markup_cartridge
void Cartridge::parse_markup_cartridge(Markup::Node root) {
if(root.exists() == false) return;
parse_markup_memory(rom, root["rom"], ID::ROM, false);
parse_markup_memory(ram, root["ram"], ID::RAM, true);
for(auto& node : root) {
if(node.name != "map") continue;
if(node["id"].data == "rom") {
Mapping m(rom);
parse_markup_map(m, node);
if(m.size == 0) m.size = rom.size();
m.fastmode = Mapping::fastmode_readonly;
m.fastptr = rom.data();
mapping.append(m);
}
if(node["id"].data == "ram") {
Mapping m(ram);
parse_markup_map(m, node);
if(m.size == 0) m.size = ram.size();
m.fastmode = Mapping::fastmode_readwrite;
m.fastptr = ram.data();
mapping.append(m);
}
}
}
示例9: parse_markup_superfx
void Cartridge::parse_markup_superfx(Markup::Node root) {
if(root.exists() == false) return;
has_superfx = true;
parse_markup_memory(superfx.rom, root["rom"], ID::SuperFXROM, false);
parse_markup_memory(superfx.ram, root["ram"], ID::SuperFXRAM, true);
for(auto& node : root) {
if(node.name != "map") continue;
if(node["id"].data == "io") {
Mapping m({&SuperFX::mmio_read, &superfx}, {&SuperFX::mmio_write, &superfx});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].data == "rom") {
Mapping m(superfx.cpurom);
parse_markup_map(m, node);
if(m.size == 0) m.size = superfx.rom.size();
mapping.append(m);
}
if(node["id"].data == "ram") {
Mapping m(superfx.cpuram);
parse_markup_map(m, node);
if(m.size == 0) m.size = superfx.ram.size();
mapping.append(m);
}
}
}
示例10: parse_markup_satellaview
void Cartridge::parse_markup_satellaview(Markup::Node root) {
if(root.exists() == false) return;
has_bs_slot = true;
interface->loadRequest(ID::Satellaview, "BS-X Satellaview", "bs");
for(auto& node : root.find("map")) {
if(node["id"].data == "rom") {
if(satellaviewcartridge.memory.size() == 0) continue;
Mapping m(satellaviewcartridge);
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例11: parse_markup_bsx
void Cartridge::parse_markup_bsx(Markup::Node root) {
if(root.exists() == false) return;
has_bs_cart = true;
has_bs_slot = true;
interface->loadRequest(ID::Satellaview, "BS-X Satellaview", "bs");
parse_markup_memory(bsxcartridge.rom, root["rom"], ID::BsxROM, false);
parse_markup_memory(bsxcartridge.ram, root["ram"], ID::BsxRAM, true);
parse_markup_memory(bsxcartridge.psram, root["psram"], ID::BsxPSRAM, true);
for(auto& node : root) {
if(node.name != "map") continue;
if(node["id"].data == "rom"
|| node["id"].data == "ram") {
Mapping m({&BSXCartridge::mcu_read, &bsxcartridge}, {&BSXCartridge::mcu_write, &bsxcartridge});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].data == "io") {
Mapping m({&BSXCartridge::mmio_read, &bsxcartridge}, {&BSXCartridge::mmio_write, &bsxcartridge});
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例12: parse_markup_hitachidsp
void Cartridge::parse_markup_hitachidsp(Markup::Node root, unsigned roms) {
if(!root) return;
has_hitachidsp = true;
auto rom = root.find("rom");
auto ram = root.find("ram");
parse_markup_memory(hitachidsp.rom, rom(0), ID::HitachiDSPROM, false);
parse_markup_memory(hitachidsp.ram, ram(0), ID::HitachiDSPRAM, true);
for(auto& word : hitachidsp.dataROM) word = 0x000000;
for(auto& word : hitachidsp.dataRAM) word = 0x00;
hitachidsp.Frequency = root["frequency"].decimal();
if(hitachidsp.Frequency == 0) hitachidsp.frequency = 20000000;
hitachidsp.Roms = roms;
string dataROMName = rom(1)["name"].text();
string dataRAMName = ram(1)["name"].text();
interface->loadRequest(ID::HitachiDSPDROM, dataROMName);
if(dataRAMName.empty() == false) {
interface->loadRequest(ID::HitachiDSPDRAM, dataRAMName);
}
for(auto node : root.find("map")) {
if(node["id"].text() == "io") {
Mapping m({&HitachiDSP::dsp_read, &hitachidsp}, {&HitachiDSP::dsp_write, &hitachidsp});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].text() == "rom") {
Mapping m({&HitachiDSP::rom_read, &hitachidsp}, {&HitachiDSP::rom_write, &hitachidsp});
parse_markup_map(m, node);
if(m.size == 0) m.size = hitachidsp.rom.size();
mapping.append(m);
}
if(node["id"].text() == "ram") {
Mapping m({&HitachiDSP::ram_read, &hitachidsp}, {&HitachiDSP::ram_write, &hitachidsp});
parse_markup_map(m, node);
if(m.size == 0) m.size = hitachidsp.ram.size();
mapping.append(m);
}
}
}
示例13: parse_markup_necdsp
void Cartridge::parse_markup_necdsp(Markup::Node root) {
if(root.exists() == false) return;
if(interface->bind->altImplementation(Alt::ForDSP)==Alt::DSP::HLE)
{
parse_markup_necdsp_hle(root);
return;
}
has_necdsp = true;
for(auto& word : necdsp.programROM) word = 0x000000;
for(auto& word : necdsp.dataROM) word = 0x0000;
for(auto& word : necdsp.dataRAM) word = 0x0000;
necdsp.frequency = numeral(root["frequency"].data);
if(necdsp.frequency == 0) necdsp.frequency = 8000000;
necdsp.revision
= root["model"].data == "uPD7725" ? NECDSP::Revision::uPD7725
: root["model"].data == "uPD96050" ? NECDSP::Revision::uPD96050
: NECDSP::Revision::uPD7725;
string programROMName = root["rom[0]/name"].data;
string dataROMName = root["rom[1]/name"].data;
string dataRAMName = root["ram/name"].data;
if(necdsp.revision == NECDSP::Revision::uPD7725) {
interface->loadRequest(ID::Nec7725DSPPROM, programROMName);
interface->loadRequest(ID::Nec7725DSPDROM, dataROMName);
if(dataRAMName.empty() == false) {
interface->loadRequest(ID::Nec7725DSPRAM, dataRAMName);
memory.append({ID::Nec7725DSPRAM, dataRAMName});
}
}
if(necdsp.revision == NECDSP::Revision::uPD96050) {
interface->loadRequest(ID::Nec96050DSPPROM, programROMName);
interface->loadRequest(ID::Nec96050DSPDROM, dataROMName);
if(dataRAMName.empty() == false) {
interface->loadRequest(ID::Nec96050DSPRAM, dataRAMName);
memory.append({ID::Nec96050DSPRAM, dataRAMName});
}
}
for(auto& node : root) {
if(node.name != "map") continue;
if(node["id"].data == "io") {
Mapping m({&NECDSP::read, &necdsp}, {&NECDSP::write, &necdsp});
parse_markup_map(m, node);
mapping.append(m);
necdsp.Select = numeral(node["select"].data);
}
if(node["id"].data == "ram") {
Mapping m({&NECDSP::ram_read, &necdsp}, {&NECDSP::ram_write, &necdsp});
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例14: parse_markup_event
void Cartridge::parse_markup_event(Markup::Node root) {
if(!root) return;
has_event = true;
for(auto node : root.find("rom")) {
unsigned id = node["id"].decimal();
if(id > 3) continue;
parse_markup_memory(event.rom[id], node, ID::EventROM0 + id, false);
}
parse_markup_memory(event.ram, root["ram"], ID::EventRAM, true);
event.board = Event::Board::CampusChallenge92;
if(root["name"].text() == "Campus Challenge '92") event.board = Event::Board::CampusChallenge92;
if(root["name"].text() == "Powerfest '94") event.board = Event::Board::Powerfest94;
event.revision = root["revision"].text() == "B" ? 2 : 1;
lstring part = root["timer"].text().split<1>(":");
if(part.size() == 1) event.timer = decimal(part(0));
if(part.size() == 2) event.timer = decimal(part(0)) * 60 + decimal(part(1));
for(auto node : root.find("map")) {
if(node["id"].text() == "rom") {
Mapping m({&Event::rom_read, &event}, [](unsigned, uint8) {});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].text() == "ram") {
Mapping m({&Event::ram_read, &event}, {&Event::ram_write, &event});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].text() == "dr") {
Mapping m([](unsigned) -> uint8 { return cpu.regs.mdr; }, {&Event::dr, &event});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].text() == "sr") {
Mapping m({&Event::sr, &event}, [](unsigned, uint8) {});
parse_markup_map(m, node);
mapping.append(m);
}
}
}
示例15: parse_markup_hitachidsp
void Cartridge::parse_markup_hitachidsp(Markup::Node root, unsigned roms) {
if(root.exists() == false) return;
if(interface->bind->altImplementation(Alt::ForDSP) == Alt::DSP::HLE)
{
//this is after checking existence because we don't want to ask which DSP to use and then use none of them
parse_markup_hitachidsp_hle(root);
return;
}
has_hitachidsp = true;
parse_markup_memory(hitachidsp.rom, root["rom[0]"], ID::HitachiDSPROM, false);
parse_markup_memory(hitachidsp.ram, root["ram[0]"], ID::HitachiDSPRAM, true);
for(auto& word : hitachidsp.dataROM) word = 0x000000;
for(auto& word : hitachidsp.dataRAM) word = 0x00;
hitachidsp.Frequency = numeral(root["frequency"].data);
if(hitachidsp.Frequency == 0) hitachidsp.frequency = 20000000;
hitachidsp.Roms = roms;
string dataROMName = root["rom[1]/name"].data;
string dataRAMName = root["ram[1]/name"].data;
interface->loadRequest(ID::HitachiDSPDROM, dataROMName);
if(dataRAMName.empty() == false) {
interface->loadRequest(ID::HitachiDSPDRAM, dataRAMName);
}
for(auto& node : root) {
if(node.name != "map") continue;
if(node["id"].data == "io") {
Mapping m({&HitachiDSP::dsp_read, &hitachidsp}, {&HitachiDSP::dsp_write, &hitachidsp});
parse_markup_map(m, node);
mapping.append(m);
}
if(node["id"].data == "rom") {
Mapping m({&HitachiDSP::rom_read, &hitachidsp}, {&HitachiDSP::rom_write, &hitachidsp});
parse_markup_map(m, node);
if(m.size == 0) m.size = hitachidsp.rom.size();
mapping.append(m);
}
if(node["id"].data == "ram") {
Mapping m({&HitachiDSP::ram_read, &hitachidsp}, {&HitachiDSP::ram_write, &hitachidsp});
parse_markup_map(m, node);
if(m.size == 0) m.size = hitachidsp.ram.size();
mapping.append(m);
}
}
}