Beispiel #1
0
        public frmDataViewer(OricFileInfo fileInfo, OricProgram programData)
        {
            InitializeComponent();

            dataViewerControl             = new ctlDataViewerControl();
            dataViewerControl.ProgramInfo = fileInfo;
            dataViewerControl.ProgramData = programData;
            dataViewerControl.InitialiseView();

            this.Controls.Add(dataViewerControl);
            this.Size = new Size(dataViewerControl.Width + 15, dataViewerControl.Height + 40);

            this.Text = string.Format("Data Viewer - {0} ({1})", fileInfo.ProgramName, Path.GetFileName(fileInfo.ParentName));
        }
Beispiel #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();
        }