[mess] remove serial mouse tag lookup (nw)

This commit is contained in:
cracyc 2013-01-24 18:20:30 +00:00
parent 037057f00f
commit d6b0e04d19
2 changed files with 11 additions and 4 deletions

View File

@ -15,7 +15,10 @@ const device_type MSYSTEM_SERIAL_MOUSE = &device_creator<mouse_systems_mouse_dev
serial_mouse_device::serial_mouse_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock),
device_rs232_port_interface(mconfig, *this),
device_serial_interface(mconfig, *this)
device_serial_interface(mconfig, *this),
m_x(*this, "ser_mouse_x"),
m_y(*this, "ser_mouse_y"),
m_btn(*this, "ser_mouse_btn")
{
}
@ -77,21 +80,21 @@ void serial_mouse_device::device_timer(emu_timer &timer, device_timer_id id, int
/* Do not get deltas or send packets if queue is not empty (Prevents drifting) */
if (m_head==m_tail)
{
nx = ioport("ser_mouse_x")->read();
nx = m_x->read();
dx = nx - ox;
if (dx<=-0x800) dx = nx + 0x1000 - ox; /* Prevent jumping */
if (dx>=0x800) dx = nx - 0x1000 - ox;
ox = nx;
ny = ioport("ser_mouse_y")->read();
ny = m_y->read();
dy = ny - oy;
if (dy<=-0x800) dy = ny + 0x1000 - oy;
if (dy>=0x800) dy = ny - 0x1000 - oy;
oy = ny;
nb = ioport("ser_mouse_btn")->read();
nb = m_btn->read();
mbc = nb^m_mb;
m_mb = nb;

View File

@ -39,6 +39,10 @@ private:
emu_timer *m_timer;
rs232_port_device *m_owner;
bool m_enabled;
required_ioport m_x;
required_ioport m_y;
required_ioport m_btn;
};
class microsoft_mouse_device : public serial_mouse_device