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

Method DataShiftWriteWOZ

source/Disk.cpp:1536–1576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1534}
1535
1536void Disk2InterfaceCard::DataShiftWriteWOZ(WORD pc, WORD addr, ULONG uExecutedCycles)
1537{
1538 _ASSERT(m_seqFunc.function == dataShiftWrite);
1539
1540 FloppyDrive& drive = m_floppyDrive[m_currDrive];
1541 FloppyDisk& floppy = drive.m_disk;
1542
1543 const UINT bitCellRemainder = GetBitCellDelta(uExecutedCycles);
1544
1545 if (floppy.m_bWriteProtected)
1546 {
1547 _ASSERT(0); // Must be a bug in the 6502 code for this to occur!
1548 UpdateBitStreamPosition(floppy, bitCellRemainder);
1549 return;
1550 }
1551
1552 if (!drive.m_spinning)
1553 return;
1554
1555 if (!floppy.m_trackimagedata) // GH#1126
1556 return;
1557
1558#if LOG_DISK_WOZ_SHIFTWRITE
1559 LOG_DISK("T$%02X, bitOffset=%04X: %02X (%d bits)\n", drive.m_phase/2, floppy.m_bitOffset, m_shiftReg, bitCellRemainder);
1560#endif
1561
1562 for (UINT i = 0; i < bitCellRemainder; i++)
1563 {
1564 BYTE outputBit = m_shiftReg & 0x80;
1565 m_shiftReg <<= 1;
1566
1567 BYTE n = floppy.m_trackimage[floppy.m_byte];
1568 n &= ~floppy.m_bitMask;
1569 if (outputBit) n |= floppy.m_bitMask;
1570 floppy.m_trackimage[floppy.m_byte] = n;
1571
1572 IncBitStream(floppy);
1573 }
1574
1575 floppy.m_trackimagedirty = true;
1576}
1577
1578//===========================================================================
1579

Callers 2

IOReadMethod · 0.80
IOWriteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected