mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-02-26 21:30:36 +00:00
SSC: Experimental support for 6551's status bits: DCD and DSR via -dcd[-invert] and -dsr[-invert] args (#386)
This commit is contained in:
parent
b377dc8afb
commit
abd99d109e
@ -1034,6 +1034,22 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
|||||||
{
|
{
|
||||||
g_bMultiMon = true;
|
g_bMultiMon = true;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(lpCmdLine, "-dcd") == 0) // GH#386
|
||||||
|
{
|
||||||
|
sg_SSC.SupportDCD(true, false);
|
||||||
|
}
|
||||||
|
else if (strcmp(lpCmdLine, "-dcd-invert") == 0) // GH#386
|
||||||
|
{
|
||||||
|
sg_SSC.SupportDCD(true, true);
|
||||||
|
}
|
||||||
|
else if (strcmp(lpCmdLine, "-dsr") == 0) // GH#386
|
||||||
|
{
|
||||||
|
sg_SSC.SupportDSR(true, false);
|
||||||
|
}
|
||||||
|
else if (strcmp(lpCmdLine, "-dsr-invert") == 0) // GH#386
|
||||||
|
{
|
||||||
|
sg_SSC.SupportDSR(true, true);
|
||||||
|
}
|
||||||
else if (strcmp(lpCmdLine, "-dtr") == 0) // GH#386
|
else if (strcmp(lpCmdLine, "-dtr") == 0) // GH#386
|
||||||
{
|
{
|
||||||
sg_SSC.SupportDTR(true, false);
|
sg_SSC.SupportDTR(true, false);
|
||||||
|
@ -721,10 +721,12 @@ BYTE __stdcall CSuperSerialCard::CommStatus(WORD, WORD, BYTE, BYTE, ULONG)
|
|||||||
if (!CheckComm())
|
if (!CheckComm())
|
||||||
return ST_DSR | ST_DCD | ST_TX_EMPTY;
|
return ST_DSR | ST_DCD | ST_TX_EMPTY;
|
||||||
|
|
||||||
#ifdef SUPPORT_MODEM
|
DWORD modemStatus = 0;
|
||||||
DWORD modemstatus = 0;
|
if ((m_hCommHandle != INVALID_HANDLE_VALUE) && (m_bCfgSupportDCD || m_bCfgSupportDSR))
|
||||||
GetCommModemStatus(m_hCommHandle,&modemstatus); // Returns 0x30 = MS_DSR_ON|MS_CTS_ON
|
{
|
||||||
#endif
|
// Do this outside of the critical section (don't know how long it takes)
|
||||||
|
GetCommModemStatus(m_hCommHandle, &modemStatus); // Returns 0x30 = MS_DSR_ON|MS_CTS_ON
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
@ -757,12 +759,28 @@ BYTE __stdcall CSuperSerialCard::CommStatus(WORD, WORD, BYTE, BYTE, ULONG)
|
|||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
BYTE DCD = 0;
|
||||||
|
BYTE DSR = 0;
|
||||||
|
|
||||||
|
if ((m_hCommHandle != INVALID_HANDLE_VALUE) && (m_bCfgSupportDCD || m_bCfgSupportDSR))
|
||||||
|
{
|
||||||
|
if (m_bCfgSupportDCD)
|
||||||
|
{
|
||||||
|
DCD = (modemStatus & MS_RLSD_ON) ? 0x00 : ST_DCD;
|
||||||
|
if (m_bCfgInvertDCD) DCD = (DCD == 0) ? ST_DCD : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_bCfgSupportDSR)
|
||||||
|
{
|
||||||
|
DSR = (modemStatus & MS_DSR_ON) ? 0x00 : ST_DSR;
|
||||||
|
if (m_bCfgInvertDSR) DSR = (DSR == 0) ? ST_DSR : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BYTE uStatus = ST_TX_EMPTY
|
BYTE uStatus = ST_TX_EMPTY
|
||||||
| ((!bComSerialBufferEmpty || !m_qTcpSerialBuffer.empty()) ? ST_RX_FULL : 0x00)
|
| ((!bComSerialBufferEmpty || !m_qTcpSerialBuffer.empty()) ? ST_RX_FULL : 0x00)
|
||||||
#ifdef SUPPORT_MODEM
|
| DCD // Need 0x00 to allow ZLink to start up
|
||||||
| ((modemstatus & MS_RLSD_ON) ? 0x00 : ST_DCD) // Need 0x00 to allow ZLink to start up
|
| DSR
|
||||||
| ((modemstatus & MS_DSR_ON) ? 0x00 : ST_DSR)
|
|
||||||
#endif
|
|
||||||
| (bIRQ ? ST_IRQ : 0x00);
|
| (bIRQ ? ST_IRQ : 0x00);
|
||||||
|
|
||||||
if (m_hCommHandle != INVALID_HANDLE_VALUE)
|
if (m_hCommHandle != INVALID_HANDLE_VALUE)
|
||||||
|
@ -43,7 +43,9 @@ public:
|
|||||||
char* GetSerialPortName() { return m_ayCurrentSerialPortName; }
|
char* GetSerialPortName() { return m_ayCurrentSerialPortName; }
|
||||||
void SetSerialPortName(const char* pSerialPortName);
|
void SetSerialPortName(const char* pSerialPortName);
|
||||||
bool IsActive() { return (m_hCommHandle != INVALID_HANDLE_VALUE) || (m_hCommListenSocket != INVALID_SOCKET); }
|
bool IsActive() { return (m_hCommHandle != INVALID_HANDLE_VALUE) || (m_hCommListenSocket != INVALID_SOCKET); }
|
||||||
void SupportDTR(bool bEnable, bool bInvert) { m_bCfgSupportDTR = bEnable; m_bCfgInvertDTR = bInvert; }
|
void SupportDCD(bool bEnable, bool bInvert) { m_bCfgSupportDCD = bEnable; m_bCfgInvertDCD = bInvert; } // Status
|
||||||
|
void SupportDSR(bool bEnable, bool bInvert) { m_bCfgSupportDSR = bEnable; m_bCfgInvertDSR = bInvert; } // Status
|
||||||
|
void SupportDTR(bool bEnable, bool bInvert) { m_bCfgSupportDTR = bEnable; m_bCfgInvertDTR = bInvert; } // Control
|
||||||
|
|
||||||
void CommTcpSerialAccept();
|
void CommTcpSerialAccept();
|
||||||
void CommTcpSerialReceive();
|
void CommTcpSerialReceive();
|
||||||
@ -141,6 +143,14 @@ private:
|
|||||||
BYTE* m_pExpansionRom;
|
BYTE* m_pExpansionRom;
|
||||||
UINT m_uSlot;
|
UINT m_uSlot;
|
||||||
|
|
||||||
|
// DCD
|
||||||
|
bool m_bCfgSupportDCD;
|
||||||
|
bool m_bCfgInvertDCD;
|
||||||
|
|
||||||
|
// DSR
|
||||||
|
bool m_bCfgSupportDSR;
|
||||||
|
bool m_bCfgInvertDSR;
|
||||||
|
|
||||||
// DTR
|
// DTR
|
||||||
UINT m_uDTR;
|
UINT m_uDTR;
|
||||||
bool m_bCfgSupportDTR;
|
bool m_bCfgSupportDTR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user