コード例 #1
0
        /// <summary>
        /// New - Resets the program settings and clears out the program data
        /// </summary>
        /// <returns></returns>
        public void New()
        {
            // Reset the address values
            StartAddress = 0;
            EndAddress   = 0;
            ExeAddress   = 0;

            // Reset the program format
            Format = 0;

            // Reset the program status flag
            m_protectionStatus = ProtectionStatus.Unprotected;

            m_programFormat = ProgramFormat.UnknownFile;

            // Reset the AutoRun flag
            AutoRun = AutoRunFlag.Disabled;

            // Reset the program name
            ProgramName = "";

            // Reset the program data
            if (m_programData != null)
            {
                m_programData.Initialize();
            }
        }
コード例 #2
0
ファイル: Preview.cs プロジェクト: Yicker419/OricExplorer
        public Preview(Boolean bPreview)
        {
            m_ui16DataLength   = 0;
            m_ui16StartAddress = 0;

            // Set initial format to HIRES
            m_scrnFormat = OricProgram.ProgramFormat.HiresScreen;

            // Initialise the screen buffer
            bScrnData = new Byte[8000];

            // Load the standard character set
            BuildCharSet();

            cScrnPaper = 0;
            cScrnInk   = 7;

            m_bDisablePaper      = false;
            m_bDisableInk        = false;
            m_bDisableAttributes = false;

            m_bFlash = true;

            m_bWidthBytes = 40;

            if (bPreview)
            {
                screenImage = new Bitmap(480, 448);
            }
        }
コード例 #3
0
ファイル: SedOric.cs プロジェクト: Yicker419/OricExplorer
        private static OricProgram.ProgramFormat GetFileFormat(Byte[] FileDescriptor)
        {
            OricProgram.ProgramFormat programFormat = OricProgram.ProgramFormat.UnknownFile;

            UInt16 tmpStartAddr = (UInt16)(FileDescriptor[0x04] + (FileDescriptor[0x05] * 256));

            Byte formatFlag = FileDescriptor[0x03];

            if ((formatFlag & 0x08) == 0x08)
            {
                programFormat = OricProgram.ProgramFormat.DirectAccessFile;
            }
            else if ((formatFlag & 0x10) == 0x10)
            {
                programFormat = OricProgram.ProgramFormat.SequentialFile;
            }
            else if ((formatFlag & 0x20) == 0x20)
            {
                programFormat = OricProgram.ProgramFormat.WindowFile;
            }
            else if ((formatFlag & 0x40) == 0x40)
            {
                programFormat = OricProgram.ProgramFormat.CodeFile;
            }
            else if ((formatFlag & 0x80) == 0x80)
            {
                programFormat = OricProgram.ProgramFormat.BasicProgram;
            }
            else
            {
                programFormat = OricProgram.ProgramFormat.UnknownFile;
            }

            if (programFormat == OricProgram.ProgramFormat.CodeFile)
            {
                switch (tmpStartAddr)
                {
                case 0xBB80: programFormat = OricProgram.ProgramFormat.TextScreen; break;

                case 0xBBA8: programFormat = OricProgram.ProgramFormat.TextScreen; break;

                case 0xA000: programFormat = OricProgram.ProgramFormat.HiresScreen; break;

                case 0xB400: programFormat = OricProgram.ProgramFormat.CharacterSet; break;

                case 0xB500: programFormat = OricProgram.ProgramFormat.CharacterSet; break;

                default: programFormat = OricProgram.ProgramFormat.CodeFile; break;
                }
            }

            return(programFormat);
        }
コード例 #4
0
ファイル: ScreenImage.cs プロジェクト: assinie/OricExplorer
        public void DrawScreenImage(ScreenImageSize imageSize, ScreenImageFormat imageFormat)
        {
            screenImageSize   = imageSize;
            screenImageFormat = imageFormat;

            // Set the image and pixel dimensions
            if (screenImageSize == ScreenImageSize.IMAGE_SIZE_NORMAL)
            {
                imageWidth  = 240;
                imageHeight = 224;
                pixelWidth  = 1;
                pixelHeight = 1;
            }
            else if (screenImageSize == ScreenImageSize.IMAGE_SIZE_ENLARGED)
            {
                imageWidth  = 480;
                imageHeight = 448;
                pixelWidth  = 2;
                pixelHeight = 2;
            }

            if (screenImageFormat == ScreenImageFormat.IMAGE_FORMAT_TEXT)
            {
                m_scrnFormat = OricProgram.ProgramFormat.TextScreen;
            }
            else if (screenImageFormat == ScreenImageFormat.IMAGE_FORMAT_HIRES)
            {
                m_scrnFormat = OricProgram.ProgramFormat.HiresScreen;
            }
            else
            {
                m_scrnFormat = OricProgram.ProgramFormat.UnknownFile;
            }

            screenImageData = new Bitmap(imageWidth, imageHeight);

            switch (m_scrnFormat)
            {
            case OricProgram.ProgramFormat.HiresScreen:
                if (m_ui16DataLength > 8000)
                {
                    m_ui16DisplayBytes = 8000;
                }
                else
                {
                    m_ui16DisplayBytes = m_ui16DataLength;
                }

                DrawHiresScreen();
                break;

            case OricProgram.ProgramFormat.WindowFile:
            case OricProgram.ProgramFormat.TextScreen:
                if (m_ui16DataLength > 1120)
                {
                    m_ui16DisplayBytes = 1120;
                }
                else
                {
                    m_ui16DisplayBytes = m_ui16DataLength;
                }

                DrawTextScreen();
                break;

            default:
                DrawNoImageMessage();
                break;
            }
        }