trunk/src/mess/machine/sms.c
| r23921 | r23922 | |
| 117 | 117 | // check if TH is set to input (1). |
| 118 | 118 | if (data & 0x02) |
| 119 | 119 | { |
| 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(); |
| 121 | 122 | |
| 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)) |
| 124 | 125 | latch_hcount = true; |
| 125 | 126 | } |
| 126 | 127 | |
| r23921 | r23922 | |
| 143 | 144 | // check if TH is set to input (1). |
| 144 | 145 | if (data & 0x08) |
| 145 | 146 | { |
| 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(); |
| 147 | 149 | |
| 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)) |
| 150 | 152 | latch_hcount = true; |
| 151 | 153 | } |
| 152 | 154 | |