| 4493 | */ |
| 4494 | |
| 4495 | void POTGO (uae_u16 v) |
| 4496 | { |
| 4497 | int i, j; |
| 4498 | |
| 4499 | if (inputdevice_logging & (16 | 128)) |
| 4500 | write_log (_T("POTGO_W: %04X %08X\n"), v, M68K_GETPC); |
| 4501 | #if DONGLE_DEBUG |
| 4502 | if (M68K_GETPC < 0xe00000) |
| 4503 | write_log (_T("POTGO %04X %s\n"), v, debuginfo(0)); |
| 4504 | #endif |
| 4505 | dongle_potgo (v); |
| 4506 | potgo_value = potgo_value & 0x5500; /* keep state of data bits */ |
| 4507 | potgo_value |= v & 0xaa00; /* get new direction bits */ |
| 4508 | for (i = 0; i < 8; i += 2) { |
| 4509 | uae_u16 dir = 0x0200 << i; |
| 4510 | if (v & dir) { |
| 4511 | uae_u16 data = 0x0100 << i; |
| 4512 | potgo_value &= ~data; |
| 4513 | potgo_value |= v & data; |
| 4514 | } |
| 4515 | } |
| 4516 | if (v & 1) { |
| 4517 | for (i = 0; i < 2; i++) { |
| 4518 | for (j = 0; j < 2; j++) { |
| 4519 | pot_dat_act[i][j] = 1; |
| 4520 | pot_dat[i][j] = 0; |
| 4521 | } |
| 4522 | } |
| 4523 | } |
| 4524 | } |
| 4525 | |
| 4526 | uae_u16 POTGOR (void) |
| 4527 | { |
no test coverage detected