Lines Matching refs:fifo
729 uint8_t fifo[FD_SECTOR_LEN];
1152 FLOPPY_ERROR("unimplemented command 0x%02x\n", fdctrl->fifo[0]);
1153 fdctrl->fifo[0] = FD_SR0_INVCMD;
1201 fdctrl->fifo[0] = status0 | (cur_drv->head << 2) | GET_CUR_DRV(fdctrl);
1202 fdctrl->fifo[1] = status1;
1203 fdctrl->fifo[2] = status2;
1204 fdctrl->fifo[3] = cur_drv->ltrk;
1205 fdctrl->fifo[4] = cur_drv->head;
1206 fdctrl->fifo[5] = cur_drv->sect;
1207 fdctrl->fifo[6] = FD_SECTOR_SC;
1209 fdctrl->fifo[0], fdctrl->fifo[1], fdctrl->fifo[2], fdctrl->fifo[3],
1210 fdctrl->fifo[4], fdctrl->fifo[5], fdctrl->fifo[6]);
1232 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
1234 kt = fdctrl->fifo[2];
1235 kh = fdctrl->fifo[3];
1236 ks = fdctrl->fifo[4];
1241 fdctrl->fifo[0], fdctrl->fifo[1], fdctrl->fifo[2],
1242 fdctrl->fifo[3], fdctrl->fifo[4], fdctrl->fifo[5],
1243 fdctrl->fifo[6], fdctrl->fifo[7], fdctrl->fifo[8]);
1248 fdctrl->fifo[3] = kt;
1249 fdctrl->fifo[4] = kh;
1250 fdctrl->fifo[5] = ks;
1255 fdctrl->fifo[3] = kt;
1256 fdctrl->fifo[4] = kh;
1257 fdctrl->fifo[5] = ks;
1262 fdctrl->fifo[3] = kt;
1263 fdctrl->fifo[4] = kh;
1264 fdctrl->fifo[5] = ks;
1280 fdctrl->fifo[3] = kt;
1281 fdctrl->fifo[4] = kh;
1282 fdctrl->fifo[5] = ks;
1290 if (fdctrl->fifo[0] & 0x80)
1298 if (fdctrl->fifo[5] == 00) {
1299 fdctrl->data_len = fdctrl->fifo[8];
1302 fdctrl->data_len = 128 << (fdctrl->fifo[5] > 7 ? 7 : fdctrl->fifo[5]);
1303 tmp = (fdctrl->fifo[6] - ks + 1);
1304 if (fdctrl->fifo[0] & 0x80)
1305 tmp += fdctrl->fifo[6];
1308 fdctrl->eot = fdctrl->fifo[6];
1320 (128 << fdctrl->fifo[5]) *
1359 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
1362 kh = (fdctrl->fifo[1] & 0x04) >> 2;
1363 ns = fdctrl->fifo[3];
1364 dp = fdctrl->fifo[5];
1373 fdctrl->fifo[3] = kt;
1374 fdctrl->fifo[4] = kh;
1375 fdctrl->fifo[5] = ks;
1380 fdctrl->fifo[3] = kt;
1381 fdctrl->fifo[4] = kh;
1382 fdctrl->fifo[5] = ks;
1387 fdctrl->fifo[3] = kt;
1388 fdctrl->fifo[4] = kh;
1389 fdctrl->fifo[5] = ks;
1405 fdctrl->fifo[3] = kt;
1406 fdctrl->fifo[4] = kh;
1407 fdctrl->fifo[5] = ks;
1429 (128 << fdctrl->fifo[2]) *
1586 rc = blk_read(cur_drv, fd_sector(cur_drv), fdctrl->fifo, 1);
1590 fdctrl->fifo, 1) < 0)
1596 memset(fdctrl->fifo, 0, FD_SECTOR_LEN);
1606 fdctrl->fifo + rel_pos,
1612 DMA_write_memory (nchan, fdctrl->fifo + rel_pos,
1616 /* fdctrl->fifo + rel_pos, len); */
1624 fdctrl->fifo + rel_pos,
1630 rc = blk_write(cur_drv, fd_sector(cur_drv), fdctrl->fifo, 1);
1633 DMA_read_memory (nchan, fdctrl->fifo + rel_pos,
1636 fdctrl->fifo, 1) < 0)
1648 uint8_t eot = fdctrl->fifo[3];
1649 uint8_t filler = fdctrl->fifo[5];
1653 fdctrl->fifo + rel_pos,
1661 memset(fdctrl->fifo, filler, FD_SECTOR_LEN);
1664 rc = blk_write(cur_drv, fd_sector(cur_drv), fdctrl->fifo, 1);
1689 ret = memcmp(tmpbuf, fdctrl->fifo + rel_pos, len);
1754 rc = blk_read(cur_drv, fd_sector(cur_drv), fdctrl->fifo, 1);
1757 if (bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0)
1763 memset(fdctrl->fifo, 0, FD_SECTOR_LEN);
1767 retval = fdctrl->fifo[pos];
1793 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
1795 kt = fdctrl->fifo[6];
1796 kh = fdctrl->fifo[7];
1797 ks = fdctrl->fifo[8];
1805 fdctrl->fifo[3] = kt;
1806 fdctrl->fifo[4] = kh;
1807 fdctrl->fifo[5] = ks;
1812 fdctrl->fifo[3] = kt;
1813 fdctrl->fifo[4] = kh;
1814 fdctrl->fifo[5] = ks;
1819 fdctrl->fifo[3] = kt;
1820 fdctrl->fifo[4] = kh;
1821 fdctrl->fifo[5] = ks;
1829 memset(fdctrl->fifo, 0, FD_SECTOR_LEN);
1832 rc = blk_write(cur_drv, fd_sector(cur_drv), fdctrl->fifo, 1);
1843 bdrv_write(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) {
1865 fdctrl->lock = (fdctrl->fifo[0] & 0x80) ? 1 : 0;
1866 fdctrl->fifo[0] = fdctrl->lock << 4;
1875 fdctrl->fifo[0] = drv0(fdctrl)->track;
1876 fdctrl->fifo[1] = drv1(fdctrl)->track;
1878 fdctrl->fifo[2] = drv2(fdctrl)->track;
1879 fdctrl->fifo[3] = drv3(fdctrl)->track;
1881 fdctrl->fifo[2] = 0;
1882 fdctrl->fifo[3] = 0;
1885 fdctrl->fifo[4] = fdctrl->timer0;
1886 fdctrl->fifo[5] = (fdctrl->timer1 << 1) | (fdctrl->dor & FD_DOR_DMAEN ? 1 : 0);
1887 fdctrl->fifo[6] = cur_drv->last_sect;
1888 fdctrl->fifo[7] = (fdctrl->lock << 7) |
1890 fdctrl->fifo[8] = fdctrl->config;
1891 fdctrl->fifo[9] = fdctrl->precomp_trk;
1898 fdctrl->fifo[0] = fdctrl->version;
1904 fdctrl->fifo[0] = 0x01; /* Stepping 1 */
1913 drv0(fdctrl)->track = fdctrl->fifo[3];
1914 drv1(fdctrl)->track = fdctrl->fifo[4];
1916 drv2(fdctrl)->track = fdctrl->fifo[5];
1917 drv3(fdctrl)->track = fdctrl->fifo[6];
1920 fdctrl->timer0 = fdctrl->fifo[7];
1921 fdctrl->timer1 = fdctrl->fifo[8];
1922 cur_drv->last_sect = fdctrl->fifo[9];
1923 fdctrl->lock = fdctrl->fifo[10] >> 7;
1924 cur_drv->perpendicular = (fdctrl->fifo[10] >> 2) & 0xF;
1925 fdctrl->config = fdctrl->fifo[11];
1926 fdctrl->precomp_trk = fdctrl->fifo[12];
1927 fdctrl->pwrd = fdctrl->fifo[13];
1935 fdctrl->fifo[0] = 0;
1936 fdctrl->fifo[1] = 0;
1938 fdctrl->fifo[2] = drv0(fdctrl)->track;
1939 fdctrl->fifo[3] = drv1(fdctrl)->track;
1941 fdctrl->fifo[4] = drv2(fdctrl)->track;
1942 fdctrl->fifo[5] = drv3(fdctrl)->track;
1944 fdctrl->fifo[4] = 0;
1945 fdctrl->fifo[5] = 0;
1948 fdctrl->fifo[6] = fdctrl->timer0;
1949 fdctrl->fifo[7] = fdctrl->timer1;
1950 fdctrl->fifo[8] = cur_drv->last_sect;
1951 fdctrl->fifo[9] = (fdctrl->lock << 7) |
1953 fdctrl->fifo[10] = fdctrl->config;
1954 fdctrl->fifo[11] = fdctrl->precomp_trk;
1955 fdctrl->fifo[12] = fdctrl->pwrd;
1956 fdctrl->fifo[13] = 0;
1957 fdctrl->fifo[14] = 0;
1965 FLOPPY_DPRINTF("CMD:%02x SEL:%02x\n", fdctrl->fifo[0], fdctrl->fifo[1]);
1968 cur_drv->head = (fdctrl->fifo[1] >> 2) & 1;
1982 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
1985 ns = fdctrl->fifo[3];
1986 dp = fdctrl->fifo[5];
1991 fdctrl->fifo[0], fdctrl->fifo[1], fdctrl->fifo[2],
1992 fdctrl->fifo[3], fdctrl->fifo[4], fdctrl->fifo[5]);
1998 if (cur_drv->last_sect != ns || fdctrl->fifo[2] != 2)
2002 cur_drv->bps = fdctrl->fifo[2] > 7 ? 16384 : 128 << fdctrl->fifo[2];
2011 fdctrl->timer0 = (fdctrl->fifo[1] >> 4) & 0xF;
2012 fdctrl->timer1 = fdctrl->fifo[2] >> 1;
2013 if (fdctrl->fifo[2] & 1)
2025 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
2027 cur_drv->head = (fdctrl->fifo[1] >> 2) & 1;
2029 fdctrl->fifo[0] = (cur_drv->ro << 6) |
2042 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
2058 FLOPPY_DPRINTF("CMD:%02x\n", fdctrl->fifo[0]);
2060 fdctrl->fifo[0] =
2067 fdctrl->fifo[0] =
2071 fdctrl->fifo[0] = fdctrl->status0;
2074 fdctrl->fifo[1] = cur_drv->track;
2076 FLOPPY_DPRINTF("ST0:%02x PCN:%02x\n", fdctrl->fifo[0], fdctrl->fifo[1]);
2084 FLOPPY_DPRINTF("CMD:%02x SEL:%02x NCN:%02x\n", fdctrl->fifo[0],
2085 fdctrl->fifo[1], fdctrl->fifo[2]);
2087 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
2094 cur_drv->track = fdctrl->fifo[2];
2096 cur_drv->head = (fdctrl->fifo[1] >> 2) & 1;
2100 if (fdctrl->fifo[2] > cur_drv->max_track) {
2103 cur_drv->track = fdctrl->fifo[2];
2114 if (fdctrl->fifo[1] & 0x80)
2115 cur_drv->perpendicular = fdctrl->fifo[1] & 0x7;
2122 fdctrl->config = fdctrl->fifo[2];
2123 fdctrl->precomp_trk = fdctrl->fifo[3];
2130 fdctrl->pwrd = fdctrl->fifo[1];
2131 fdctrl->fifo[0] = fdctrl->fifo[1];
2145 if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80) {
2147 if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x40) {
2148 fdctrl->fifo[0] = fdctrl->fifo[1];
2149 fdctrl->fifo[2] = 0;
2150 fdctrl->fifo[3] = 0;
2157 fdctrl->fifo[0] = 0x80 |
2167 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
2169 if (fdctrl->fifo[2] + cur_drv->track >= cur_drv->max_track) {
2172 cur_drv->track += fdctrl->fifo[2];
2183 SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK);
2185 if (fdctrl->fifo[2] > cur_drv->track) {
2188 cur_drv->track -= fdctrl->fifo[2];
2260 fdctrl->fifo[pos] = value;
2264 blk_write(cur_drv, fd_sector(cur_drv), fdctrl->fifo, 1);
2267 fdctrl->fifo, 1);
2287 fdctrl->fifo[fdctrl->data_pos++] = value;
2297 pos = command_to_handler[fdctrl->fifo[0] & 0xff];
2401 SSMR3PutU32(pSSM, sizeof(pThis->fifo));
2402 SSMR3PutMem(pSSM, &pThis->fifo, sizeof(pThis->fifo));
2461 AssertMsgReturn(sizeof(pThis->fifo) == FD_SECTOR_LEN,
2482 SSMR3GetMem(pSSM, &pThis->fifo, FD_SECTOR_LEN);
2534 AssertMsgReturn(sizeof(pThis->fifo) == val32,
2537 SSMR3GetMem(pSSM, &pThis->fifo, sizeof(pThis->fifo));