| 1965 | //=========================================================================== |
| 1966 | |
| 1967 | void Disk2InterfaceCard::Update(const ULONG cycles) |
| 1968 | { |
| 1969 | int loop = NUM_DRIVES; |
| 1970 | while (loop--) |
| 1971 | { |
| 1972 | FloppyDrive* pDrive = &m_floppyDrive[loop]; |
| 1973 | |
| 1974 | if (pDrive->m_spinning && !m_floppyMotorOn) |
| 1975 | { |
| 1976 | if (!(pDrive->m_spinning -= MIN(pDrive->m_spinning, cycles))) |
| 1977 | { |
| 1978 | GetFrame().FrameDrawDiskLEDS(); |
| 1979 | GetFrame().FrameDrawDiskStatus(); |
| 1980 | } |
| 1981 | } |
| 1982 | |
| 1983 | if (m_seqFunc.writeMode && (m_currDrive == loop) && pDrive->m_spinning) |
| 1984 | { |
| 1985 | pDrive->m_writelight = WRITELIGHT_CYCLES; |
| 1986 | } |
| 1987 | else if (pDrive->m_writelight) |
| 1988 | { |
| 1989 | if (!(pDrive->m_writelight -= MIN(pDrive->m_writelight, cycles))) |
| 1990 | { |
| 1991 | GetFrame().FrameDrawDiskLEDS(); |
| 1992 | GetFrame().FrameDrawDiskStatus(); |
| 1993 | } |
| 1994 | } |
| 1995 | |
| 1996 | if (!m_floppyMotorOn && !pDrive->m_spinning) |
| 1997 | { |
| 1998 | // Motor off and not spinning: so write back any dirty track (GH#1444) |
| 1999 | // . this also supports the power-cycle case (where m_floppyMotorOn & m_spinning are instantaneously 0) |
| 2000 | FlushCurrentTrack(loop); |
| 2001 | } |
| 2002 | } |
| 2003 | } |
| 2004 | |
| 2005 | //=========================================================================== |
| 2006 |
no test coverage detected