示例#1
0
        private void tvwFileList_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNode selectedNode = tvwFileList.SelectedNode;

            if ((e.Button != MouseButtons.Left) || (selectedNode == null || selectedNode.Tag == null))
            {
                return;
            }

            // is selected node is a tape, launch the tape in emulator
            if (selectedNode.Tag.GetType() == typeof(TapeInfo))
            {
                mMainForm.LoadTapeInEmulator(Configuration.Persistent.DefaultMachineForTape);
            }
            // is selected node is a disk, launch it in emulator
            else if (selectedNode.Tag.GetType() == typeof(OricDiskInfo))
            {
                // determine the disk type to select the machine for emulator
                OricDiskInfo diskInfo = (OricDiskInfo)selectedNode.Tag;

                switch (diskInfo.DOSFormat)
                {
                case OricDisk.DOSFormats.Unknown:
                    mMainForm.DisplayUnknownDisk(diskInfo);
                    break;

                default:
                    mMainForm.LoadDiskInEmulator();
                    break;
                }
            }
            else if (selectedNode.Tag.GetType() == typeof(OricFileInfo))
            {
                OricProgram.SpecialMode specialMode = OricProgram.SpecialMode.None;
                if (selectedNode.Parent.Tag.GetType() == typeof(OricDiskInfo))
                {
                    OricDiskInfo diskInfo = (OricDiskInfo)(selectedNode.Parent.Tag);
                    specialMode = (diskInfo.DOSFormat == OricDisk.DOSFormats.StratSed ? OricProgram.SpecialMode.Telestrat : OricProgram.SpecialMode.None);
                }

                mMainForm.DisplayFileContents((OricFileInfo)selectedNode.Tag, specialMode);
            }
            else if (selectedNode.Tag.GetType() == typeof(RomInfo))
            {
                mMainForm.DisplayROMContents((RomInfo)selectedNode.Tag);
            }
            else if (selectedNode.Tag.GetType() == typeof(OtherFileInfo))
            {
                mMainForm.DisplayOtherFileContents((OtherFileInfo)selectedNode.Tag);
            }
        }
示例#2
0
        public void DisplayData(OricProgram.SpecialMode specialMode = OricProgram.SpecialMode.None)
        {
            DynamicByteProvider dynamicByteProvider;

            dynamicByteProvider = new DynamicByteProvider(ProgramData.ProgramData);

            hxbDump.ByteProvider   = dynamicByteProvider;
            hxbDump.LineInfoOffset = ProgramInfo.StartAddress;
            hxbDump.ReadOnly       = true;

            mMainForm.programInfoForm.DisplayProgramInformation(ProgramInfo);

            if (ShowSourceCode)
            {
                // Display the programs sourcecode
                if (ProgramInfo.Format == OricProgram.ProgramFormat.BinaryFile)
                {
                    fctSourceCode.Text = ProgramData.ListAssembler(specialMode);
                }
                else if (ProgramInfo.Format == OricProgram.ProgramFormat.BasicProgram)
                {
                    fctSourceCode.Text = ProgramData.ListBasicSourceAsText();
                }
                else if (ProgramInfo.Format == OricProgram.ProgramFormat.HyperbasicProgram)
                {
                    fctSourceCode.Text = ProgramData.ListHyperbasicSourceAsText();
                }
                else if (ProgramInfo.Format == OricProgram.ProgramFormat.TeleassSource)
                {
                    fctSourceCode.Text = ProgramData.ListTeleassSourceAsText();
                }
                else if (ProgramInfo.Format == OricProgram.ProgramFormat.OrixProgram)
                {
                    fctSourceCode.Text = ProgramData.ListAssembler(specialMode);
                }
            }

            switch (UserControl)
            {
            case UserControls.CharacterSetViewer:
                characterSetViewer.ProgramInfo = ProgramInfo;
                characterSetViewer.ProgramData = ProgramData;
                characterSetViewer.InitialiseView();
                break;

            case UserControls.DataFileViewer:
                dataFileViewer.ProgramInfo = ProgramInfo;
                dataFileViewer.ProgramData = ProgramData;
                dataFileViewer.InitialiseView();
                break;

            case UserControls.DataViewer:
                dataViewer.ProgramInfo = ProgramInfo;
                dataViewer.ProgramData = ProgramData;
                dataViewer.InitialiseView();
                break;

            case UserControls.ScreenViewer:
                screenViewer.ProgramInfo = ProgramInfo;
                screenViewer.ProgramData = ProgramData;
                screenViewer.InitialiseView();
                break;

            case UserControls.SequentialFileViewer:
                sequentialFileViewer.ProgramInfo = ProgramInfo;
                sequentialFileViewer.ProgramData = ProgramData;
                sequentialFileViewer.InitialiseView();
                break;

            case UserControls.None:
                break;

            default:
                break;
            }

            DisplayIndexAndAddress();
        }