| 903 | } |
| 904 | |
| 905 | BYTE HarddiskInterfaceCard::CmdStatus(HardDiskDrive* pHDD) |
| 906 | { |
| 907 | BYTE r = 0; |
| 908 | |
| 909 | if (pHDD->m_error) |
| 910 | r = STATUS_ERROR; // Firmware requires that b0=1 for an error |
| 911 | |
| 912 | if (g_nCumulativeCycles <= m_notBusyCycle) |
| 913 | r |= STATUS_BUSY; // Firmware requires that b7=1 for busy (eg. busy doing r/w DMA operation) |
| 914 | else |
| 915 | pHDD->m_status_next = DISK_STATUS_OFF; // TODO: FIXME: ??? YELLOW ??? WARNING |
| 916 | |
| 917 | // Firmware requires that error code is [b6..1] |
| 918 | _ASSERT(pHDD->m_error <= ERRORCODE_MASK); |
| 919 | r |= (pHDD->m_error & ERRORCODE_MASK) << 1; |
| 920 | |
| 921 | return r; |
| 922 | } |
| 923 | |
| 924 | //----------------------------------------------------------------------------- |
| 925 | |