MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CheckSpinning

Method CheckSpinning

source/Disk.cpp:263–284  ·  view source on GitHub ↗

Called by ControlMotor() & Enable()

Source from the content-addressed store, hash-verified

261
262// Called by ControlMotor() & Enable()
263void Disk2InterfaceCard::CheckSpinning(const bool stateChanged, const ULONG uExecutedCycles)
264{
265 bool modeChanged = m_floppyMotorOn && !m_floppyDrive[m_currDrive].m_spinning;
266
267 if (m_floppyMotorOn && IsDriveConnected(m_currDrive))
268 m_floppyDrive[m_currDrive].m_spinning = SPINNING_CYCLES;
269
270 if (modeChanged)
271 GetFrame().FrameDrawDiskLEDS();
272
273 if (modeChanged)
274 {
275 // Set m_diskLastCycle when motor changes: not spinning (ie. off for 1 sec) -> on
276 m_diskLastCycle = g_nCumulativeCycles;
277 }
278
279 if (m_floppyMotorOn && stateChanged)
280 {
281 // Set m_motorOnCycle when: motor changes to on, or the other drive is enabled (and motor is on)
282 m_floppyDrive[m_currDrive].m_motorOnCycle = g_nCumulativeCycles;
283 }
284}
285
286//===========================================================================
287

Callers

nothing calls this directly

Calls 1

FrameDrawDiskLEDSMethod · 0.80

Tested by

no test coverage detected