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

Method WriteTrack

source/Disk.cpp:453–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451//===========================================================================
452
453void Disk2InterfaceCard::WriteTrack(const int drive)
454{
455 FloppyDrive* pDrive = &m_floppyDrive[ drive ];
456 FloppyDisk* pFloppy = &pDrive->m_disk;
457
458 if (ImagePhaseToTrack(pFloppy->m_imagehandle, pDrive->m_phasePrecise, false) >= ImageGetNumTracks(pFloppy->m_imagehandle))
459 {
460 _ASSERT(0); // What can cause this? Add a comment to replace this assert.
461 return;
462 }
463
464 if (pFloppy->m_bWriteProtected)
465 return;
466
467 if (pFloppy->m_trackimage && pFloppy->m_imagehandle)
468 {
469#if LOG_DISK_TRACKS
470 LOG_DISK("track $%s write\r\n", GetCurrentTrackString().c_str());
471#endif
472 ImageWriteTrack(
473 pFloppy->m_imagehandle,
474 pDrive->m_phasePrecise,
475 pFloppy->m_trackimage,
476 pFloppy->m_nibbles);
477 }
478
479 pFloppy->m_trackimagedirty = false;
480}
481
482void Disk2InterfaceCard::FlushCurrentTrack(const int drive)
483{

Callers

nothing calls this directly

Calls 3

ImagePhaseToTrackFunction · 0.85
ImageGetNumTracksFunction · 0.85
ImageWriteTrackFunction · 0.85

Tested by

no test coverage detected