diff --git a/sim_defs.h b/sim_defs.h index d970d9af..bb8ab4e4 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -117,6 +117,7 @@ #include #undef PACKED /* avoid macro name collision */ #undef ERROR /* avoid macro name collision */ +#undef MEM_MAPPED /* avoid macro name collision */ #endif #ifndef TRUE diff --git a/sim_tmxr.c b/sim_tmxr.c index 1976550f..4eee20f8 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -1062,12 +1062,12 @@ if ((bits_to_set & ~(TMXR_MDM_OUTGOING)) || /* Assure only settable bits (bits_to_set & bits_to_clear)) /* and can't set and clear the same bits */ return SCPE_ARG; if (incoming_bits) { - if (lp->sock) + if ((lp->sock) || (lp->serport)) *incoming_bits = TMXR_MDM_DCD | TMXR_MDM_CTS | TMXR_MDM_DSR; else - *incoming_bits = lp->mp->master ? (TMXR_MDM_CTS | TMXR_MDM_DSR) : 0; + *incoming_bits = (lp->mp && lp->mp->master) ? (TMXR_MDM_CTS | TMXR_MDM_DSR) : 0; } -if (lp->mp->modem_control) { /* This API ONLY works on modem_control enabled multiplexers */ +if (lp->mp && lp->mp->modem_control) { /* This API ONLY works on modem_control enabled multiplexers */ if (lp->serport) return sim_control_serial (lp->serport, bits_to_set, bits_to_clear, incoming_bits); if (lp->sock) {