mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
zx.cpp: Small cleanup
This commit is contained in:
parent
9ff2622a6d
commit
e78197debe
@ -18,6 +18,7 @@
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "softlist_dev.h"
|
||||
|
||||
#include "formats/tzx_cas.h"
|
||||
#include "formats/zx81_p.h"
|
||||
@ -35,14 +36,7 @@ public:
|
||||
m_speaker(*this, "speaker"),
|
||||
m_region_maincpu(*this, "maincpu"),
|
||||
m_region_gfx1(*this, "gfx1"),
|
||||
m_io_row0(*this, "ROW0"),
|
||||
m_io_row1(*this, "ROW1"),
|
||||
m_io_row2(*this, "ROW2"),
|
||||
m_io_row3(*this, "ROW3"),
|
||||
m_io_row4(*this, "ROW4"),
|
||||
m_io_row5(*this, "ROW5"),
|
||||
m_io_row6(*this, "ROW6"),
|
||||
m_io_row7(*this, "ROW7"),
|
||||
m_io_row(*this, "ROW%u", 0U),
|
||||
m_io_config(*this, "CONFIG"),
|
||||
m_screen(*this, "screen")
|
||||
{ }
|
||||
@ -98,14 +92,7 @@ private:
|
||||
optional_device<speaker_sound_device> m_speaker;
|
||||
required_memory_region m_region_maincpu;
|
||||
optional_memory_region m_region_gfx1;
|
||||
required_ioport m_io_row0;
|
||||
required_ioport m_io_row1;
|
||||
required_ioport m_io_row2;
|
||||
required_ioport m_io_row3;
|
||||
required_ioport m_io_row4;
|
||||
required_ioport m_io_row5;
|
||||
required_ioport m_io_row6;
|
||||
required_ioport m_io_row7;
|
||||
required_ioport_array<8> m_io_row;
|
||||
optional_ioport m_io_config;
|
||||
required_device<screen_device> m_screen;
|
||||
|
||||
|
@ -119,22 +119,9 @@ uint8_t zx_state::zx80_io_r(offs_t offset)
|
||||
|
||||
if (!(offset & 0x01))
|
||||
{
|
||||
if ((offset & 0x0100) == 0)
|
||||
data &= m_io_row0->read();
|
||||
if ((offset & 0x0200) == 0)
|
||||
data &= m_io_row1->read();
|
||||
if ((offset & 0x0400) == 0)
|
||||
data &= m_io_row2->read();
|
||||
if ((offset & 0x0800) == 0)
|
||||
data &= m_io_row3->read();
|
||||
if ((offset & 0x1000) == 0)
|
||||
data &= m_io_row4->read();
|
||||
if ((offset & 0x2000) == 0)
|
||||
data &= m_io_row5->read();
|
||||
if ((offset & 0x4000) == 0)
|
||||
data &= m_io_row6->read();
|
||||
if ((offset & 0x8000) == 0)
|
||||
data &= m_io_row7->read();
|
||||
for (int i = 0; i < 8; i++)
|
||||
if (!BIT(offset, i + 8))
|
||||
data &= m_io_row[i]->read();
|
||||
|
||||
if (!m_io_config->read())
|
||||
data &= ~0x40;
|
||||
@ -163,22 +150,9 @@ uint8_t zx_state::zx81_io_r(offs_t offset)
|
||||
|
||||
if (!(offset & 0x01))
|
||||
{
|
||||
if ((offset & 0x0100) == 0)
|
||||
data &= m_io_row0->read();
|
||||
if ((offset & 0x0200) == 0)
|
||||
data &= m_io_row1->read();
|
||||
if ((offset & 0x0400) == 0)
|
||||
data &= m_io_row2->read();
|
||||
if ((offset & 0x0800) == 0)
|
||||
data &= m_io_row3->read();
|
||||
if ((offset & 0x1000) == 0)
|
||||
data &= m_io_row4->read();
|
||||
if ((offset & 0x2000) == 0)
|
||||
data &= m_io_row5->read();
|
||||
if ((offset & 0x4000) == 0)
|
||||
data &= m_io_row6->read();
|
||||
if ((offset & 0x8000) == 0)
|
||||
data &= m_io_row7->read();
|
||||
for (int i = 0; i < 8; i++)
|
||||
if (!BIT(offset, i + 8))
|
||||
data &= m_io_row[i]->read();
|
||||
|
||||
if (!m_io_config->read())
|
||||
data &= ~0x40;
|
||||
@ -217,22 +191,9 @@ uint8_t zx_state::pc8300_io_r(offs_t offset)
|
||||
else
|
||||
if (offs == 0xfe)
|
||||
{
|
||||
if ((offset & 0x0100) == 0)
|
||||
data &= m_io_row0->read();
|
||||
if ((offset & 0x0200) == 0)
|
||||
data &= m_io_row1->read();
|
||||
if ((offset & 0x0400) == 0)
|
||||
data &= m_io_row2->read();
|
||||
if ((offset & 0x0800) == 0)
|
||||
data &= m_io_row3->read();
|
||||
if ((offset & 0x1000) == 0)
|
||||
data &= m_io_row4->read();
|
||||
if ((offset & 0x2000) == 0)
|
||||
data &= m_io_row5->read();
|
||||
if ((offset & 0x4000) == 0)
|
||||
data &= m_io_row6->read();
|
||||
if ((offset & 0x8000) == 0)
|
||||
data &= m_io_row7->read();
|
||||
for (int i = 0; i < 8; i++)
|
||||
if (!BIT(offset, i + 8))
|
||||
data &= m_io_row[i]->read();
|
||||
|
||||
m_cassette->output(+1.0);
|
||||
if(m_cassette_cur_level <= 0)
|
||||
@ -267,22 +228,9 @@ uint8_t zx_state::pow3000_io_r(offs_t offset)
|
||||
else
|
||||
if (offs == 0xfe)
|
||||
{
|
||||
if ((offset & 0x0100) == 0)
|
||||
data &= m_io_row0->read();
|
||||
if ((offset & 0x0200) == 0)
|
||||
data &= m_io_row1->read();
|
||||
if ((offset & 0x0400) == 0)
|
||||
data &= m_io_row2->read();
|
||||
if ((offset & 0x0800) == 0)
|
||||
data &= m_io_row3->read();
|
||||
if ((offset & 0x1000) == 0)
|
||||
data &= m_io_row4->read();
|
||||
if ((offset & 0x2000) == 0)
|
||||
data &= m_io_row5->read();
|
||||
if ((offset & 0x4000) == 0)
|
||||
data &= m_io_row6->read();
|
||||
if ((offset & 0x8000) == 0)
|
||||
data &= m_io_row7->read();
|
||||
for (int i = 0; i < 8; i++)
|
||||
if (!BIT(offset, i + 8))
|
||||
data &= m_io_row[i]->read();
|
||||
|
||||
m_cassette->output(+1.0);
|
||||
if(m_cassette_cur_level <= 0)
|
||||
|
Loading…
Reference in New Issue
Block a user