Previous 199869 Revisions Next

r20440 Thursday 24th January, 2013 at 18:20:30 UTC by Carl
[mess] remove serial mouse tag lookup (nw)
[src/mess/machine]ser_mouse.c ser_mouse.h

trunk/src/mess/machine/ser_mouse.c
r20439r20440
1515serial_mouse_device::serial_mouse_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock)
1616   : device_t(mconfig, type, name, tag, owner, clock),
1717      device_rs232_port_interface(mconfig, *this),
18      device_serial_interface(mconfig, *this)
18      device_serial_interface(mconfig, *this),
19      m_x(*this, "ser_mouse_x"),
20      m_y(*this, "ser_mouse_y"),
21      m_btn(*this, "ser_mouse_btn")
1922{
2023}
2124
r20439r20440
7780   /* Do not get deltas or send packets if queue is not empty (Prevents drifting) */
7881   if (m_head==m_tail)
7982   {
80      nx = ioport("ser_mouse_x")->read();
83      nx = m_x->read();
8184
8285      dx = nx - ox;
8386      if (dx<=-0x800) dx = nx + 0x1000 - ox; /* Prevent jumping */
8487      if (dx>=0x800) dx = nx - 0x1000 - ox;
8588      ox = nx;
8689
87      ny = ioport("ser_mouse_y")->read();
90      ny = m_y->read();
8891
8992      dy = ny - oy;
9093      if (dy<=-0x800) dy = ny + 0x1000 - oy;
9194      if (dy>=0x800) dy = ny - 0x1000 - oy;
9295      oy = ny;
9396
94      nb = ioport("ser_mouse_btn")->read();
97      nb = m_btn->read();
9598      mbc = nb^m_mb;
9699      m_mb = nb;
97100
trunk/src/mess/machine/ser_mouse.h
r20439r20440
3939   emu_timer *m_timer;
4040   rs232_port_device *m_owner;
4141   bool m_enabled;
42
43   required_ioport m_x;
44   required_ioport m_y;
45   required_ioport m_btn;
4246};
4347
4448class microsoft_mouse_device : public serial_mouse_device

Previous 199869 Revisions Next


© 1997-2024 The MAME Team