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

Method SetSequencerFunction

source/Disk.cpp:2124–2153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2122//===========================================================================
2123
2124void Disk2InterfaceCard::SetSequencerFunction(WORD addr, ULONG executedCycles)
2125{
2126 if ((addr & 0xf) < 0xc)
2127 return;
2128
2129 const SEQFUNC oldSeqFunc = m_seqFunc.function;
2130
2131 switch ((addr & 3) ^ 2)
2132 {
2133 case 0: m_seqFunc.writeMode = 0; break; // $C08E,X (sequence addr A3 input)
2134 case 1: m_seqFunc.writeMode = 1; break; // $C08F,X (sequence addr A3 input)
2135 case 2: m_seqFunc.loadMode = 0; break; // $C08C,X (sequence addr A2 input)
2136 case 3: m_seqFunc.loadMode = 1; break; // $C08D,X (sequence addr A2 input)
2137 }
2138
2139 if (!m_seqFunc.writeMode)
2140 m_writeStarted = false;
2141
2142 if (oldSeqFunc == checkWriteProtAndInitWrite && m_seqFunc.function != checkWriteProtAndInitWrite)
2143 {
2144 // Use up remaining cycles before switching out of "checkWriteProtAndInitWrite" mode
2145 // Done when checking write-protect, but also for bit-slip (eg. E7) copy-protections
2146 FloppyDisk& floppy = m_floppyDrive[m_currDrive].m_disk;
2147 if (ImageIsWOZ(floppy.m_imagehandle))
2148 {
2149 const UINT bitCellDelta = GetBitCellDelta(executedCycles);
2150 UpdateBitStreamPosition(floppy, bitCellDelta);
2151 }
2152 }
2153}
2154
2155BYTE __stdcall Disk2InterfaceCard::IORead(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
2156{

Callers 2

IOReadMethod · 0.80
IOWriteMethod · 0.80

Calls 1

ImageIsWOZFunction · 0.85

Tested by

no test coverage detected