(MESS) sapi1.c: Tagmap cleanups (nw)

This commit is contained in:
Wilbert Pol 2013-02-07 21:02:50 +00:00
parent 46ef255061
commit 586d19582f
3 changed files with 25 additions and 10 deletions

View File

@ -27,7 +27,7 @@
/* switch out the rom shadow */
WRITE8_MEMBER( sapi1_state::sapi3_00_w )
{
membank("bank1")->set_entry(0);
m_bank1->set_entry(0);
}
READ8_MEMBER( sapi1_state::sapi2_keyboard_status_r)

View File

@ -19,8 +19,15 @@ class sapi1_state : public driver_device
{
public:
sapi1_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
m_sapi_video_ram(*this, "sapi_video_ram"){ }
: driver_device(mconfig, type, tag)
, m_sapi_video_ram(*this, "sapi_video_ram")
, m_bank1(*this, "bank1")
, m_line0(*this, "LINE0")
, m_line1(*this, "LINE1")
, m_line2(*this, "LINE2")
, m_line3(*this, "LINE3")
, m_line4(*this, "LINE4")
{ }
required_shared_ptr<UINT8> m_sapi_video_ram;
UINT8 m_keyboard_mask;
@ -44,6 +51,14 @@ public:
DECLARE_VIDEO_START(sapizps3);
UINT32 screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_sapizps3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
required_memory_bank m_bank1;
required_ioport m_line0;
required_ioport m_line1;
required_ioport m_line2;
required_ioport m_line3;
required_ioport m_line4;
};
#endif

View File

@ -26,11 +26,11 @@ MACHINE_START_MEMBER(sapi1_state,sapi1)
READ8_MEMBER( sapi1_state::sapi1_keyboard_r )
{
UINT8 key = 0xff;
if (BIT(m_keyboard_mask, 0)) { key &= ioport("LINE0")->read(); }
if (BIT(m_keyboard_mask, 1)) { key &= ioport("LINE1")->read(); }
if (BIT(m_keyboard_mask, 2)) { key &= ioport("LINE2")->read(); }
if (BIT(m_keyboard_mask, 3)) { key &= ioport("LINE3")->read(); }
if (BIT(m_keyboard_mask, 4)) { key &= ioport("LINE4")->read(); }
if (BIT(m_keyboard_mask, 0)) { key &= m_line0->read(); }
if (BIT(m_keyboard_mask, 1)) { key &= m_line1->read(); }
if (BIT(m_keyboard_mask, 2)) { key &= m_line2->read(); }
if (BIT(m_keyboard_mask, 3)) { key &= m_line3->read(); }
if (BIT(m_keyboard_mask, 4)) { key &= m_line4->read(); }
return key;
}
@ -43,11 +43,11 @@ WRITE8_MEMBER( sapi1_state::sapi1_keyboard_w )
MACHINE_RESET_MEMBER(sapi1_state,sapizps3)
{
m_keyboard_mask = 0;
membank("bank1")->set_entry(1);
m_bank1->set_entry(1);
}
DRIVER_INIT_MEMBER(sapi1_state,sapizps3)
{
UINT8 *RAM = memregion("maincpu")->base();
membank("bank1")->configure_entries(0, 2, &RAM[0x0000], 0xf800);
m_bank1->configure_entries(0, 2, &RAM[0x0000], 0xf800);
}