예제 #1
0
파일: Galgsbl.cs 프로젝트: tuday2/MBBSEmu
        /// <summary>
        ///     Enable/Disable Output-Empty status codes
        ///
        ///     Signature: int btuoes(int chan,int onoff);
        /// </summary>
        private void btuoes()
        {
            var channelNumber = GetParameter(0);
            var onoff         = GetParameter(1);

            if (!ChannelDictionary.TryGetValue(channelNumber, out var channel))
            {
                Registers.AX = ERROR_CHANNEL_NOT_DEFINED;
                return;
            }

            //Notify the Session that a Status Change has occurred
            channel.OutputEmptyStatus = onoff == 1;

#if DEBUG
            _logger.Debug($"Value {onoff} for Channel {channelNumber}");
#endif

            Registers.AX = 0;
        }
예제 #2
0
파일: Galgsbl.cs 프로젝트: tuday2/MBBSEmu
        /// <summary>
        ///     Inject a status code into a channel
        ///
        ///     Signature: int btuinj(int chan,int status)
        ///     Result: AX == 0 = OK
        /// </summary>
        /// <returns></returns>
        public void btuinj()
        {
            var channelNumber = GetParameter(0);
            var status        = (EnumUserStatus)GetParameter(1);

            if (!ChannelDictionary.TryGetValue(channelNumber, out var channel))
            {
                Registers.AX = ERROR_CHANNEL_NOT_DEFINED;
                return;
            }

            //Status Change
            //Set the Memory Value
            channel.Status.Enqueue(status);
            Module.Memory.SetWord(Module.Memory.GetVariablePointer("STATUS"), (ushort)status);

#if DEBUG
            _logger.Debug($"Injecting Status {status} on channel {channelNumber}");
#endif

            Registers.AX = 0;
        }