本文整理汇总了C++中memory_region::bytes方法的典型用法代码示例。如果您正苦于以下问题:C++ memory_region::bytes方法的具体用法?C++ memory_region::bytes怎么用?C++ memory_region::bytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类memory_region
的用法示例。
在下文中一共展示了memory_region::bytes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: machine_start
void tutor_state::machine_start()
{
std::string region_tag;
m_cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str());
m_tape_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tutor_state::tape_interrupt_handler),this));
m_bank1->configure_entry(0, memregion("maincpu")->base() + 0x4000);
m_bank1->set_entry(0);
m_bank2->configure_entry(0, memregion("maincpu")->base() + 0x8000);
m_bank2->set_entry(0);
if (m_cart_rom)
{
if (m_cart_rom->bytes() > 0x4000)
{
m_bank1_switching = 1;
m_bank1->configure_entry(1, m_cart_rom->base());
m_bank1->set_entry(1);
m_bank2->configure_entry(1, m_cart_rom->base() + 0x4000);
m_bank2->set_entry(1);
}
else
{
m_bank2->configure_entry(1, m_cart_rom->base());
m_bank2->set_entry(1);
}
}
}
示例2:
debug_view_memory_source::debug_view_memory_source(const char *name, memory_region ®ion)
: debug_view_source(name),
m_space(nullptr),
m_memintf(nullptr),
m_base(region.base()),
m_length(region.bytes()),
m_offsetxor(ENDIAN_VALUE_NE_NNE(region.endianness(), 0, region.bytewidth() - 1)),
m_endianness(region.endianness()),
m_prefsize(std::min<u8>(region.bytewidth(), 8))
{
}
示例3:
debug_view_memory_source::debug_view_memory_source(const char *name, memory_region ®ion)
: debug_view_source(name),
m_space(NULL),
m_memintf(NULL),
m_base(region),
m_length(region.bytes()),
m_offsetxor(NATIVE_ENDIAN_VALUE_LE_BE(region.width() - 1, 0)),
m_endianness(region.endianness()),
m_prefsize(MIN(region.width(), 8))
{
}
示例4: set_mem_page
void tvc_state::set_mem_page(UINT8 data)
{
address_space &space = m_maincpu->space(AS_PROGRAM);
switch (data & 0x18)
{
case 0x00 : // system ROM selected
TVC_INSTALL_ROM_BANK(0, "bank1", 0x0000, 0x3fff);
membank("bank1")->set_base(m_bios_rom->base());
break;
case 0x08 : // Cart ROM selected
if (m_cart_rom)
{
TVC_INSTALL_ROM_BANK(0, "bank1", 0x0000, 0x3fff);
membank("bank1")->set_base(m_cart_rom->base());
}
break;
case 0x10 : // RAM selected
TVC_INSTALL_RAM_BANK(0, "bank1", 0x0000, 0x3fff);
membank("bank1")->set_base(m_ram->pointer());
break;
case 0x18 : // Video RAM
if (m_vram->bytes() > 0x4000)
{
// TVC 64+ only
TVC_INSTALL_RAM_BANK(0, "bank1", 0x0000, 0x3fff);
membank("bank1")->set_base(m_vram->base() + ((m_vram_bank & 0x03)<<14));
}
else
{
space.unmap_readwrite(0x0000, 0x3fff);
m_bank_type[0] = -1;
}
break;
}
if ((data & 0x20)==0) // Video RAM
{
TVC_INSTALL_RAM_BANK(2, "bank3", 0x8000, 0xbfff);
membank("bank3")->set_base(m_vram->base() + ((m_vram_bank & 0x0c)<<12));
}
else // System RAM page 3
{
if (m_ram->size() > 0x8000)
{
TVC_INSTALL_RAM_BANK(2, "bank3", 0x8000, 0xbfff);
membank("bank3")->set_base(m_ram->pointer() + 0x8000);
}
else
{
space.unmap_readwrite(0x8000, 0xbfff);
m_bank_type[2] = -1;
}
}
switch(data & 0xc0)
{
case 0x00 : // Cart ROM selected
if (m_cart_rom)
{
TVC_INSTALL_ROM_BANK(3, "bank4", 0xc000, 0xffff);
membank("bank4")->set_base(m_cart_rom->base());
}
break;
case 0x40 : // System ROM selected
TVC_INSTALL_ROM_BANK(3, "bank4", 0xc000, 0xffff);
membank("bank4")->set_base(m_bios_rom->base());
break;
case 0x80 : // RAM selected
if (m_ram->size() > 0x8000)
{
TVC_INSTALL_RAM_BANK(3, "bank4", 0xc000, 0xffff);
membank("bank4")->set_base(m_ram->pointer() + 0xc000);
}
else
{
space.unmap_readwrite(0xc000, 0xffff);
m_bank_type[3] = -1;
}
break;
case 0xc0 : // External ROM selected
TVC_INSTALL_ROM_BANK(3, "bank4", 0xc000, 0xffff);
membank("bank4")->set_base(m_ext->base());
space.install_readwrite_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(tvc_state::expansion_r), this), write8_delegate(FUNC(tvc_state::expansion_w), this), 0);
m_bank_type[3] = -1;
break;
}
}