Ejemplo n.º 1
0
        // **********************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="_port"></param>
        /// <param name="_isvalid"></param>
        /// <returns></returns>
        // **********************************************************************
        public byte Read(eAccess _type, int _port, out bool _isvalid)
        {
            _isvalid = false;
            if (_type == eAccess.Port_Read && _port == 0xfe)
            {
                if (m_Internal)
                {
                    return(0);
                }
                m_Internal = true;
                int i = CSpect.InPort(0xfe);
                m_Internal = false;
                _isvalid   = true;
                return((byte)(i & 0xff));
            }

            switch (_port)
            {
            case PORT_CLOCK: _isvalid = true; return(0xff);

            case PORT_DATA: _isvalid = true; return(0xff);
            }
            _isvalid = false;
            return(0);
        }
Ejemplo n.º 2
0
        // **********************************************************************
        /// <summary>
        ///     Write a value to one of the registered ports
        /// </summary>
        /// <param name="_port">the port being written to</param>
        /// <param name="_value">the value to write</param>
        // **********************************************************************
        public bool Write(eAccess _type, int _port, byte _value)
        {
            switch (_port)
            {
            case PORT_CLOCK: break;

            case PORT_DATA: break;
            }
            return(true);
        }
Ejemplo n.º 3
0
        // **********************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="_port"></param>
        /// <param name="_isvalid"></param>
        /// <returns></returns>
        // **********************************************************************
        public byte Read(eAccess _type, int _port, out bool _isvalid)
        {
            switch (_port)
            {
            case PORT_CLOCK: _isvalid = true; return(0xff);

            case PORT_DATA: _isvalid = true; return(0xff);
            }
            _isvalid = false;
            return(0);
        }
Ejemplo n.º 4
0
        // **********************************************************************
        /// <summary>
        ///     Write a value to one of the registered ports
        /// </summary>
        /// <param name="_port">the port being written to</param>
        /// <param name="_value">the value to write</param>
        // **********************************************************************
        public bool Write(eAccess _type, int _port, byte _value)
        {
            //if (_type == eAccess.Port_Write && _port == 0xfe)
            //{
            //    return true;
            //}


            switch (_port)
            {
            case PORT_CLOCK: break;

            case PORT_DATA: break;

            case 0xfe:
            {
                //CSpect.Debugger(eDebugCommand.Enter);
                return(false);           // let CSpect process this
            }
            }
            return(true);
        }
Ejemplo n.º 5
0
		public ResourceValue(string name, int order = DEFAULT_ORDER, eAccess access = eAccess.ReadWrite)
		{
			this.name = name;
			this.access = access;
			this.order = order;
		}
 /// <summary>
 ///     Create a new
 /// </summary>
 /// <param name="_port"></param>
 /// <param name="_type"></param>
 public sIO(int _port, eAccess _type)
 {
     Port = _port;
     Type = _type;
 }
Ejemplo n.º 7
0
        private static PhotoAlbum[] Fetch(int? id, string username, string name, eAccess? access)
        {
            //using (var conn = Config.DB.Open())
            {
                List<PhotoAlbum> photoAlbums = new List<PhotoAlbum>();

                using (var reader = SqlHelper.GetDB().ExecuteReader("FetchPhotoAlbums",
                                                                    id, username, name, access))
                {

                    while (reader.Read())
                    {
                        PhotoAlbum photoAlbum = new PhotoAlbum();

                        photoAlbum.id = (int) reader["ID"];
                        photoAlbum.username = (string) reader["Username"];
                        photoAlbum.name = (string) reader["Name"];
                        photoAlbum.access = (eAccess) reader["Access"];
                        photoAlbum.coverPhotoID = reader["CoverPhotoID"] != DBNull.Value
                                                      ? (int?) reader["CoverPhotoID"]
                                                      : null;

                        photoAlbums.Add(photoAlbum);
                    }
                    reader.Close();
                }
                return photoAlbums.ToArray();
            }
        }
Ejemplo n.º 8
0
 /**
  * Reads the state or reads a byte from the receive fifo.
  * _isvalid is set to true if the returned value could be provided.
  * Unused.
  */
 public byte Read(eAccess _type, int _port, out bool _isvalid)
 {
     _isvalid = false;
     return(0);
 }
Ejemplo n.º 9
0
 /**
  * Writes a TX byte (_value).
  * Unused.
  */
 public bool Write(eAccess _type, int _port, byte _value)
 {
     return(true);
 }