trunk/src/mame/machine/amiga.c
| r30739 | r30740 | |
| 337 | 337 | m_cia_0->tod_w(0); |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | // pot counters (start counting at 7 (ntsc) or 8 (pal)) |
| 341 | if (BIT(CUSTOM_REG(REG_POTGO), 0) && (scanline /2 ) > 7) |
| 342 | { |
| 343 | m_pot0x += !(m_potgo_port->read() & 0x0100); |
| 344 | m_pot0y += !(m_potgo_port->read() & 0x0400); |
| 345 | m_pot1x += !(m_potgo_port->read() & 0x1000); |
| 346 | m_pot1y += !(m_potgo_port->read() & 0x4000); |
| 347 | } |
| 348 | |
| 340 | 349 | // render up to this scanline |
| 341 | 350 | if (!m_screen->update_partial(scanline)) |
| 342 | 351 | { |
| r30739 | r30740 | |
| 1237 | 1246 | return joy1dat_r(); |
| 1238 | 1247 | |
| 1239 | 1248 | case REG_POTGOR: |
| 1240 | | if (state->m_potgo_port) return state->m_potgo_port->read(); |
| 1241 | | else return 0x5500; |
| 1249 | if (state->m_potgo_port) |
| 1250 | return state->m_potgo_port->read(); |
| 1251 | else |
| 1252 | return 0x5500; |
| 1242 | 1253 | |
| 1243 | 1254 | case REG_POT0DAT: |
| 1244 | | if (state->m_pot0dat_port) return state->m_pot0dat_port->read(); |
| 1245 | | else return 0x0000; |
| 1255 | if (state->m_pot0dat_port) |
| 1256 | { |
| 1257 | return state->m_pot0dat_port->read(); |
| 1258 | } |
| 1259 | else |
| 1260 | { |
| 1261 | int scale = m_agnus_id & 0x10 ? 525 : 625; |
| 1246 | 1262 | |
| 1263 | m_pot0dat = (int) ((double) m_pot0x / scale) * 0xff; |
| 1264 | m_pot0dat |= (int)(((double) m_pot0y / scale) * 0xff) << 8; |
| 1265 | |
| 1266 | return m_pot0dat; |
| 1267 | } |
| 1268 | |
| 1247 | 1269 | case REG_POT1DAT: |
| 1248 | | if (state->m_pot1dat_port) return state->m_pot1dat_port->read(); |
| 1249 | | else return 0x0000; |
| 1270 | if (state->m_pot1dat_port) |
| 1271 | { |
| 1272 | return state->m_pot1dat_port->read(); |
| 1273 | } |
| 1274 | else |
| 1275 | { |
| 1276 | int scale = m_agnus_id & 0x10 ? 525 : 625; |
| 1250 | 1277 | |
| 1278 | m_pot1dat = (int) ((double) m_pot1x / scale) * 0xff; |
| 1279 | m_pot1dat |= (int)(((double) m_pot1y / scale) * 0xff) << 8; |
| 1280 | |
| 1281 | return m_pot1dat; |
| 1282 | } |
| 1283 | |
| 1251 | 1284 | case REG_DSKBYTR: |
| 1252 | 1285 | return state->m_fdc->dskbytr_r(); |
| 1253 | 1286 | |
| r30739 | r30740 | |
| 1330 | 1363 | break; |
| 1331 | 1364 | |
| 1332 | 1365 | case REG_POTGO: |
| 1366 | if (BIT(data, 0)) |
| 1367 | { |
| 1368 | // start counters |
| 1369 | m_pot0x = 0; |
| 1370 | m_pot0y = 0; |
| 1371 | m_pot1x = 0; |
| 1372 | m_pot1y = 0; |
| 1373 | } |
| 1333 | 1374 | potgo_w(data); |
| 1334 | 1375 | break; |
| 1335 | 1376 | |
trunk/src/mess/drivers/amiga.c
| r30739 | r30740 | |
| 1151 | 1151 | PORT_BIT(0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1152 | 1152 | |
| 1153 | 1153 | PORT_START("potgo") |
| 1154 | | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_UNUSED) |
| 1154 | PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(1) |
| 1155 | 1155 | PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(1) |
| 1156 | | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_UNUSED) |
| 1156 | PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(2) |
| 1157 | 1157 | PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2) |
| 1158 | 1158 | PORT_BIT(0xaaff, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1159 | 1159 | |