r17413 | r17414 | |
90 | 90 | { |
91 | 91 | // received data |
92 | 92 | //printf("RX %d\n",port_type); |
93 | | res = m_pad.latch[port_type] >> ((offset<<1) & 2) ? 16 : 0; |
| 93 | res = m_pad.latch[port_type] >> (((offset<<1) & 2) ? 16 : 0); |
94 | 94 | |
95 | 95 | if(((offset<<1) & 0x02) == 0) |
| 96 | { |
96 | 97 | m_pad.status[port_type] &= ~8; // clear latch on LSB read according to docs |
| 98 | //set_irq_line(11, 0); |
| 99 | } |
97 | 100 | } |
98 | 101 | |
99 | 102 | return res; |
r17413 | r17414 | |
108 | 111 | state->m_pad.status[param] |= 8; |
109 | 112 | state->m_pad.ctrl[param] &= ~1; // ack TX line |
110 | 113 | // TODO: pad IRQ |
| 114 | // state->set_irq_line(11, 1); |
111 | 115 | } |
112 | 116 | |
113 | 117 | WRITE16_MEMBER( pcfx_state::pad_w ) |
r17413 | r17414 | |
158 | 162 | xxxx ---- ---- ---- ID (0xf = 6 button pad, 0xe = tap, 0xd = ?) |
159 | 163 | */ |
160 | 164 | PORT_START("P1") |
161 | | PORT_BIT( 0xf0000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
162 | | PORT_BIT( 0x0fffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 165 | PORT_BIT( 0xf0000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ID |
| 166 | PORT_DIPNAME( 0x01000000, 0x01000000, "1" ) |
| 167 | PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) ) |
| 168 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) |
| 169 | PORT_DIPNAME( 0x02000000, 0x02000000, DEF_STR( Unknown ) ) |
| 170 | PORT_DIPSETTING( 0x02000000, DEF_STR( Off ) ) |
| 171 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) |
| 172 | PORT_DIPNAME( 0x04000000, 0x04000000, DEF_STR( Unknown ) ) |
| 173 | PORT_DIPSETTING( 0x04000000, DEF_STR( Off ) ) |
| 174 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) |
| 175 | PORT_DIPNAME( 0x08000000, 0x08000000, DEF_STR( Unknown ) ) |
| 176 | PORT_DIPSETTING( 0x08000000, DEF_STR( Off ) ) |
| 177 | PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) |
| 178 | PORT_DIPNAME( 0x010000, 0x010000, "2" ) |
| 179 | PORT_DIPSETTING( 0x010000, DEF_STR( Off ) ) |
| 180 | PORT_DIPSETTING( 0x000000, DEF_STR( On ) ) |
| 181 | PORT_DIPNAME( 0x020000, 0x020000, DEF_STR( Unknown ) ) |
| 182 | PORT_DIPSETTING( 0x020000, DEF_STR( Off ) ) |
| 183 | PORT_DIPSETTING( 0x000000, DEF_STR( On ) ) |
| 184 | PORT_DIPNAME( 0x040000, 0x040000, DEF_STR( Unknown ) ) |
| 185 | PORT_DIPSETTING( 0x040000, DEF_STR( Off ) ) |
| 186 | PORT_DIPSETTING( 0x000000, DEF_STR( On ) ) |
| 187 | PORT_DIPNAME( 0x080000, 0x080000, DEF_STR( Unknown ) ) |
| 188 | PORT_DIPSETTING( 0x080000, DEF_STR( Off ) ) |
| 189 | PORT_DIPSETTING( 0x000000, DEF_STR( On ) ) |
| 190 | PORT_DIPNAME( 0x100000, 0x100000, DEF_STR( Unknown ) ) |
| 191 | PORT_DIPSETTING( 0x100000, DEF_STR( Off ) ) |
| 192 | PORT_DIPSETTING( 0x000000, DEF_STR( On ) ) |
| 193 | PORT_DIPNAME( 0x200000, 0x200000, DEF_STR( Unknown ) ) |
| 194 | PORT_DIPSETTING( 0x200000, DEF_STR( Off ) ) |
| 195 | PORT_DIPSETTING( 0x000000, DEF_STR( On ) ) |
| 196 | PORT_DIPNAME( 0x400000, 0x400000, DEF_STR( Unknown ) ) |
| 197 | PORT_DIPSETTING( 0x400000, DEF_STR( Off ) ) |
| 198 | PORT_DIPSETTING( 0x000000, DEF_STR( On ) ) |
| 199 | PORT_DIPNAME( 0x800000, 0x800000, DEF_STR( Unknown ) ) |
| 200 | PORT_DIPSETTING( 0x800000, DEF_STR( Off ) ) |
| 201 | PORT_DIPSETTING( 0x000000, DEF_STR( On ) ) |
| 202 | PORT_DIPNAME( 0x0100, 0x0100, "3" ) |
| 203 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) |
| 204 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 205 | PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) // * |
| 206 | PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) |
| 207 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 208 | PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) // * |
| 209 | PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) |
| 210 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 211 | PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) |
| 212 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) |
| 213 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 214 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) |
| 215 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 216 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 217 | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) |
| 218 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 219 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 220 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) |
| 221 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 222 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 223 | PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) |
| 224 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 225 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 226 | PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(1) PORT_NAME("RUN button") |
| 227 | PORT_DIPNAME( 0x01, 0x01, "4" ) |
| 228 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 229 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 230 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 231 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 232 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 233 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 234 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 235 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 236 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 237 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 238 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 239 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 240 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 241 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 242 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 243 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 244 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 245 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 246 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 247 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
163 | 248 | |
164 | 249 | PORT_START("P2") |
165 | 250 | PORT_BIT( 0xf0000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
r17413 | r17414 | |
284 | 369 | { |
285 | 370 | if ( state ) |
286 | 371 | { |
287 | | printf("Setting irq line %d\n", line); |
| 372 | //printf("Setting irq line %d\n", line); |
288 | 373 | m_irq_pending |= ( 1 << ( 15 - line ) ); |
289 | 374 | } |
290 | 375 | else |
291 | 376 | { |
292 | | printf("Clearing irq line %d\n", line); |
| 377 | //printf("Clearing irq line %d\n", line); |
293 | 378 | m_irq_pending &= ~( 1 << ( 15 - line ) ); |
294 | 379 | } |
295 | 380 | check_irqs(); |