Exemplo n.º 1
0
 public BlockInfo(wCpuBlock block)
 {
     InitializeComponent();
     Text                  = "Block Information - " + block.ToString();
     txtBlock.Text         = block.ToString();
     txtName.Text          = block.name;
     txtAuthor.Text        = block.author;
     txtFamily.Text        = block.family;
     txtLanguage.Text      = block.language.ToString();
     txtLocalData.Text     = block.localData.ToString();
     txtLoadSize.Text      = block.loadSize.ToString() + " bytes";
     txtMC7Size.Text       = block.MC7Size.ToString() + " bytes";
     txtSBBLength.Text     = block.SBBLength.ToString() + " bytes";
     txtCodeDate.Text      = block.codeDate;
     txtInterfaceDate.Text = block.interfaceDate;
     //Format checksum as hex (ab cd)
     txtChecksum.Text = block.checksum.ToString("x4").Insert(2, " ");
     txtFlags.Text    = block.blockFlags.ToString("x4").Insert(2, " ");
     txtVersion.Text  = block.version.ToString("x4").Insert(2, " ");
     //TODO Fix this shit
     if (block.data != null && false)
     {
         ByteViewer bv = new ByteViewer();
         bv.SetBytes(block.data);
         bv.Location = new Point(12, 148);
         bv.Size     = new Size(419, 222);
         Controls.Add(bv);
         byte[] data = new byte[block.loadSize - 10];
         Array.Copy(block.data, data, data.Length);
         txtTestChecksum.Text = Crc16.ComputeChecksum(data).ToString("x4").Insert(2, " ");
     }
     else
     {
     }
 }
Exemplo n.º 2
0
        private void blockList_ItemActivate(object sender, EventArgs e)
        {
            string    blockName = lstBlockList.SelectedItems[0].Text;
            wCpuBlock block     = MyCpu.blocks.Find(b => b.ToString() == blockName);
            BlockInfo bi        = new BlockInfo(block);

            bi.Show();
        }