public byte OutSec(byte abyte) { if (listening) { if (listener_active) { sec_addr = (byte)(abyte & 0x0f); received_cmd = (IECCommandCode)(abyte & 0xf0); return sec_listen(); } } else { if (talker_active) { sec_addr = (byte)(abyte & 0x0f); received_cmd = (IECCommandCode)(abyte & 0xf0); return sec_talk(); } } return (byte)C64StatusCode.ST_TIMEOUT; }
public byte OutATN(byte abyte) { received_cmd = 0; sec_addr = 0; // Command is sent with secondary address switch ((IECATNCode)(abyte & 0xf0)) { case IECATNCode.ATN_LISTEN: listening = true; return listen(abyte & 0x0f); case IECATNCode.ATN_UNLISTEN: listening = false; return unlisten(); case IECATNCode.ATN_TALK: listening = false; return talk(abyte & 0x0f); case IECATNCode.ATN_UNTALK: listening = false; return untalk(); } return (byte)C64StatusCode.ST_TIMEOUT; }