mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-10 13:29:56 +00:00
WOZ: Small refactor to call DataLatchReadWriteWOZ() for any WOZ data-latch access
This commit is contained in:
parent
d973fb6b97
commit
1af12fbbb1
@ -1098,12 +1098,8 @@ UINT Disk2InterfaceCard::DataLatchReadWriteCommonWOZ(ULONG uExecutedCycles)
|
|||||||
return bitCellRemainder;
|
return bitCellRemainder;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __stdcall Disk2InterfaceCard::DataLatchReadWOZ(WORD pc, WORD addr, BYTE d, ULONG uExecutedCycles)
|
void Disk2InterfaceCard::DataLatchReadWOZ(WORD pc, WORD addr, UINT bitCellRemainder)
|
||||||
{
|
{
|
||||||
const UINT bitCellRemainder = DataLatchReadWriteCommonWOZ(uExecutedCycles);
|
|
||||||
if (!bitCellRemainder)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// m_diskLastReadLatchCycle = g_nCumulativeCycles; // Not used by WOZ (only by NIB)
|
// m_diskLastReadLatchCycle = g_nCumulativeCycles; // Not used by WOZ (only by NIB)
|
||||||
|
|
||||||
#if LOG_DISK_NIBBLES_READ
|
#if LOG_DISK_NIBBLES_READ
|
||||||
@ -1216,20 +1212,12 @@ void __stdcall Disk2InterfaceCard::DataLatchReadWOZ(WORD pc, WORD addr, BYTE d,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Show track status (GH#201) - NB. Prevent flooding of forcing UI to redraw!!!
|
|
||||||
if ((floppy.m_byte & 0xFF) == 0)
|
|
||||||
FrameDrawDiskStatus((HDC)0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __stdcall Disk2InterfaceCard::DataLatchWriteWOZ(WORD pc, WORD addr, BYTE d, ULONG uExecutedCycles)
|
void Disk2InterfaceCard::DataLatchWriteWOZ(WORD pc, WORD addr, BYTE d, UINT bitCellRemainder)
|
||||||
{
|
{
|
||||||
_ASSERT(m_floppyWriteMode);
|
_ASSERT(m_floppyWriteMode);
|
||||||
|
|
||||||
const UINT bitCellRemainder = DataLatchReadWriteCommonWOZ(uExecutedCycles);
|
|
||||||
if (!bitCellRemainder)
|
|
||||||
return;
|
|
||||||
|
|
||||||
FloppyDrive& drive = m_floppyDrive[m_currDrive];
|
FloppyDrive& drive = m_floppyDrive[m_currDrive];
|
||||||
FloppyDisk& floppy = drive.m_disk;
|
FloppyDisk& floppy = drive.m_disk;
|
||||||
|
|
||||||
@ -1237,9 +1225,21 @@ void __stdcall Disk2InterfaceCard::DataLatchWriteWOZ(WORD pc, WORD addr, BYTE d,
|
|||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void __stdcall Disk2InterfaceCard::DataLatchReadWriteWOZ(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles)
|
||||||
|
{
|
||||||
|
const UINT bitCellRemainder = DataLatchReadWriteCommonWOZ(uExecutedCycles);
|
||||||
|
if (!bitCellRemainder)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!bWrite)
|
||||||
|
DataLatchReadWOZ(pc, addr, bitCellRemainder);
|
||||||
|
else
|
||||||
|
DataLatchWriteWOZ(pc, addr, d, bitCellRemainder);
|
||||||
|
|
||||||
// Show track status (GH#201) - NB. Prevent flooding of forcing UI to redraw!!!
|
// Show track status (GH#201) - NB. Prevent flooding of forcing UI to redraw!!!
|
||||||
if ((floppy.m_byte & 0xFF) == 0)
|
if ((m_floppyDrive[m_currDrive].m_disk.m_byte & 0xFF) == 0)
|
||||||
FrameDrawDiskStatus((HDC)0);
|
FrameDrawDiskStatus((HDC)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1687,7 +1687,7 @@ BYTE __stdcall Disk2InterfaceCard::IORead(WORD pc, WORD addr, BYTE bWrite, BYTE
|
|||||||
if (!(addr & 1))
|
if (!(addr & 1))
|
||||||
{
|
{
|
||||||
if (isWOZ)
|
if (isWOZ)
|
||||||
pCard->DataLatchReadWOZ(pc, addr, d, nExecutedCycles);
|
pCard->DataLatchReadWriteWOZ(pc, addr, bWrite, d, nExecutedCycles);
|
||||||
|
|
||||||
return pCard->m_floppyLatch;
|
return pCard->m_floppyLatch;
|
||||||
}
|
}
|
||||||
@ -1729,7 +1729,7 @@ BYTE __stdcall Disk2InterfaceCard::IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE
|
|||||||
pCard->m_floppyLatch = d;
|
pCard->m_floppyLatch = d;
|
||||||
|
|
||||||
if (isWOZ)
|
if (isWOZ)
|
||||||
pCard->DataLatchWriteWOZ(pc, addr, d, nExecutedCycles);
|
pCard->DataLatchReadWriteWOZ(pc, addr, bWrite, d, nExecutedCycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -189,6 +189,8 @@ private:
|
|||||||
void UpdateBitStreamPosition(FloppyDisk& floppy, const ULONG bitCellDelta);
|
void UpdateBitStreamPosition(FloppyDisk& floppy, const ULONG bitCellDelta);
|
||||||
void UpdateBitStreamOffsets(FloppyDisk& floppy);
|
void UpdateBitStreamOffsets(FloppyDisk& floppy);
|
||||||
UINT DataLatchReadWriteCommonWOZ(ULONG uExecutedCycles);
|
UINT DataLatchReadWriteCommonWOZ(ULONG uExecutedCycles);
|
||||||
|
void DataLatchReadWOZ(WORD pc, WORD addr, UINT bitCellRemainder);
|
||||||
|
void DataLatchWriteWOZ(WORD pc, WORD addr, BYTE d, UINT bitCellRemainder);
|
||||||
void DumpSectorWOZ(FloppyDisk floppy);
|
void DumpSectorWOZ(FloppyDisk floppy);
|
||||||
void DumpTrackWOZ(FloppyDisk floppy);
|
void DumpTrackWOZ(FloppyDisk floppy);
|
||||||
|
|
||||||
@ -203,8 +205,7 @@ private:
|
|||||||
void __stdcall ControlMotor(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
void __stdcall ControlMotor(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
||||||
void __stdcall Enable(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
void __stdcall Enable(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles);
|
||||||
void __stdcall ReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles);
|
void __stdcall ReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles);
|
||||||
void __stdcall DataLatchReadWOZ(WORD pc, WORD addr, BYTE d, ULONG uExecutedCycles);
|
void __stdcall DataLatchReadWriteWOZ(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG uExecutedCycles);
|
||||||
void __stdcall DataLatchWriteWOZ(WORD pc, WORD addr, BYTE d, ULONG uExecutedCycles);
|
|
||||||
void __stdcall LoadWriteProtect(WORD, WORD, BYTE write, BYTE value, ULONG);
|
void __stdcall LoadWriteProtect(WORD, WORD, BYTE write, BYTE value, ULONG);
|
||||||
void __stdcall SetReadMode(WORD, WORD, BYTE, BYTE, ULONG);
|
void __stdcall SetReadMode(WORD, WORD, BYTE, BYTE, ULONG);
|
||||||
void __stdcall SetWriteMode(WORD, WORD, BYTE, BYTE, ULONG uExecutedCycles);
|
void __stdcall SetWriteMode(WORD, WORD, BYTE, BYTE, ULONG uExecutedCycles);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user