本文整理汇总了C++中optional_device::read方法的典型用法代码示例。如果您正苦于以下问题:C++ optional_device::read方法的具体用法?C++ optional_device::read怎么用?C++ optional_device::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类optional_device
的用法示例。
在下文中一共展示了optional_device::read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal)
{
int cs0 = 1, cs1 = 1, c1l = 1, c1h = 1, c2l = 1, c2h = 1;
UINT8 data = m_ted->read(space, offset, cs0, cs1);
//logerror("offset %04x user %u 6551 %u addr_clk %u keyport %u kernal %u cs0 %u cs1 %u\n", offset,user,_6551,addr_clk,keyport,kernal,cs0,cs1);
if (!scs && m_vslsi)
{
data = m_vslsi->read(space, offset & 0x03);
}
else if (!user)
{
if (m_spi_user)
{
data = m_spi_user->read(space, 0);
}
data &= ~0x04;
data |= m_cassette->sense_r() << 2;
}
else if (!_6551 && m_acia)
{
data = m_acia->read(space, offset & 0x03);
}
else if (!keyport)
{
data = m_spi_kb->read(space, 0);
}
else if (!cs0)
{
switch (m_addr & 0x03)
{
case CS0_BASIC:
data = m_kernal->base()[offset & 0x7fff];
break;
case CS0_FUNCTION_LO:
if (m_function != nullptr)
{
data = m_function->base()[offset & 0x7fff];
}
break;
case CS0_C1_LOW:
c1l = 0;
break;
case CS0_C2_LOW:
c2l = 0;
if (m_c2 != nullptr)
{
data = m_c2->base()[offset & 0x7fff];
}
break;
}
}
else if (!cs1)
{
if (kernal)
{
data = m_kernal->base()[offset & 0x7fff];
}
else
{
switch ((m_addr >> 2) & 0x03)
{
case CS1_KERNAL:
data = m_kernal->base()[offset & 0x7fff];
break;
case CS1_FUNCTION_HI:
if (m_function != nullptr)
{
data = m_function->base()[offset & 0x7fff];
}
break;
case CS1_C1_HIGH:
c1h = 0;
break;
case CS1_C2_HIGH:
c2h = 0;
if (m_c2 != nullptr)
{
data = m_c2->base()[offset & 0x7fff];
}
break;
}
}
}
else if (offset < 0xfd00 || offset >= 0xff20)