Previous 199869 Revisions Next

r23922 Tuesday 25th June, 2013 at 06:22:43 UTC by Fabio Priuli
(MESS) sms: fixed crash with gamegear games accessing not available controller ports, from Enik. nw.
[src/mess/machine]sms.c

trunk/src/mess/machine/sms.c
r23921r23922
117117   // check if TH is set to input (1).
118118   if (data & 0x02)
119119   {
120      UINT8 th_level = (m_port_ctrl1->port_r() & 0x40) >> 1;
120      if (!m_is_gamegear)
121         ctrl1_port_data &= ~0x40 | m_port_ctrl1->port_r();
121122
122      // check if TH pin level is high (1) and was low (0)
123      if ((th_level & 0x20) && !(m_io_ctrl_reg & 0x20))
123      // check if TH input level is high (1) and was output/low (0)
124      if ((ctrl1_port_data & 0x40) && !(m_io_ctrl_reg & 0x22))
124125         latch_hcount = true;
125126   }
126127
r23921r23922
143144   // check if TH is set to input (1).
144145   if (data & 0x08)
145146   {
146      UINT8 th_level = (m_port_ctrl2->port_r() & 0x40) << 1;
147      if (!m_is_gamegear)
148         ctrl2_port_data &= ~0x40 | m_port_ctrl2->port_r();
147149
148      // check if TH pin level is high (1) and was low (0)
149      if ((th_level & 0x80) && !(m_io_ctrl_reg & 0x80))
150      // check if TH input level is high (1) and was output/low (0)
151      if ((ctrl2_port_data & 0x40) && !(m_io_ctrl_reg & 0x88))
150152         latch_hcount = true;
151153   }
152154

Previous 199869 Revisions Next


© 1997-2024 The MAME Team