OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [emuThor/] [source/] [frmScreen.h] - Diff between revs 30 and 32

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 30 Rev 32
Line 11... Line 11...
        using namespace System::ComponentModel;
        using namespace System::ComponentModel;
        using namespace System::Collections;
        using namespace System::Collections;
        using namespace System::Windows::Forms;
        using namespace System::Windows::Forms;
        using namespace System::Data;
        using namespace System::Data;
        using namespace System::Drawing;
        using namespace System::Drawing;
 
        using namespace System::Threading;
 
 
        /// <summary>
        /// <summary>
        /// Summary for frmScreen
        /// Summary for frmScreen
        /// </summary>
        /// </summary>
        public ref class frmScreen : public System::Windows::Forms::Form
        public ref class frmScreen : public System::Windows::Forms::Form
        {
        {
                 System::Drawing::Rectangle ur;
                 System::Drawing::Rectangle ur;
        public:
        public:
                frmScreen(void)
                Mutex^ mut;
 
                frmScreen(Mutex^ m, String^ tbs)
                {
                {
 
                        mut = m;
                        InitializeComponent();
                        InitializeComponent();
                        //
                        //
                        //TODO: Add the constructor code here
                        //TODO: Add the constructor code here
                        //
                        //
 
                        this->Text = L"emuFISA64 Test System Screen - " + tbs;
                }
                }
 
 
        protected:
        protected:
                /// <summary>
                /// <summary>
                /// Clean up any resources being used.
                /// Clean up any resources being used.
Line 38... Line 42...
                        if (components)
                        if (components)
                        {
                        {
                                delete components;
                                delete components;
                        }
                        }
                }
                }
 
        public: unsigned long *pVidMem;
 
        public: bool *pVidDirty;
        private: System::Windows::Forms::Timer^  timer1;
        private: System::Windows::Forms::Timer^  timer1;
        private: System::Windows::Forms::PictureBox^  pictureBox1;
        private: System::Windows::Forms::PictureBox^  pictureBox1;
        protected:
        protected:
        private: System::ComponentModel::IContainer^  components;
        private: System::ComponentModel::IContainer^  components;
 
 
Line 72... Line 78...
                        // pictureBox1
                        // pictureBox1
                        // 
                        // 
                        this->pictureBox1->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
                        this->pictureBox1->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
                        this->pictureBox1->Location = System::Drawing::Point(2, 0);
                        this->pictureBox1->Location = System::Drawing::Point(2, 0);
                        this->pictureBox1->Name = L"pictureBox1";
                        this->pictureBox1->Name = L"pictureBox1";
                        this->pictureBox1->Size = System::Drawing::Size(681, 266);
                        this->pictureBox1->Size = System::Drawing::Size(681, 328);
                        this->pictureBox1->TabIndex = 0;
                        this->pictureBox1->TabIndex = 0;
                        this->pictureBox1->TabStop = false;
                        this->pictureBox1->TabStop = false;
                        this->pictureBox1->Click += gcnew System::EventHandler(this, &frmScreen::pictureBox1_Click);
                        this->pictureBox1->Click += gcnew System::EventHandler(this, &frmScreen::pictureBox1_Click);
                        this->pictureBox1->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &frmScreen::pictureBox1_Paint);
                        this->pictureBox1->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &frmScreen::pictureBox1_Paint);
                        // 
                        // 
                        // frmScreen
                        // frmScreen
                        // 
                        // 
                        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
                        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
                        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
                        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
                        this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
                        this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
                        this->ClientSize = System::Drawing::Size(684, 262);
                        this->ClientSize = System::Drawing::Size(684, 332);
                        this->Controls->Add(this->pictureBox1);
                        this->Controls->Add(this->pictureBox1);
                        this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
                        this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
                        this->MaximizeBox = false;
                        this->MaximizeBox = false;
                        this->Name = L"frmScreen";
                        this->Name = L"frmScreen";
                        this->Text = L"emuFISA64 Test System Screen";
                        this->Text = L"emuFISA64 Test System Screen";
Line 119... Line 125...
                                 int maxx,maxy,minx,miny;
                                 int maxx,maxy,minx,miny;
                                 maxx = 0; maxy = 0;
                                 maxx = 0; maxy = 0;
                                 minx = 1000; miny = 1000;
                                 minx = 1000; miny = 1000;
                                 if (refscreen) {
                                 if (refscreen) {
                                         for (nn = 0; nn < 4096; nn++) {
                                         for (nn = 0; nn < 4096; nn++) {
                                                 if (system1.VideoMemDirty[nn]) {
                                                 if (pVidDirty) {
 
                                                         mut->WaitOne();
 
                                                         if (pVidDirty[nn]) {
                                                         xx = nn % 84;
                                                         xx = nn % 84;
                                                         yy = nn / 84;
                                                         yy = nn / 84;
                                                         maxx = max(xx,maxx);
                                                         maxx = max(xx,maxx);
                                                         maxy = max(yy,maxy);
                                                         maxy = max(yy,maxy);
                                                         minx = min(xx,minx);
                                                         minx = min(xx,minx);
                                                         miny = min(yy,miny);
                                                         miny = min(yy,miny);
                                                 }
                                                 }
 
                                                         mut->ReleaseMutex();
 
                                                 }
                                         }
                                         }
                                        ur.X = minx<<3;
                                        ur.X = minx<<3;
                                        ur.Y = miny<<3;
                                        ur.Y = miny * 10;
                                        ur.Width = (maxx - minx)<<3;
                                        ur.Width = (maxx - minx)<<3;
                                        ur.Height = (maxy - miny)<<3;
                                        ur.Height = (maxy - miny) * 10;
                                        this->pictureBox1->Invalidate(ur);
                                        this->pictureBox1->Invalidate(ur);
                                        refscreen = false;
                                        refscreen = false;
//                                      this->Refresh();
//                                      this->Refresh();
                                 }
                                 }
                         }
                         }
Line 156... Line 166...
                                 col = gcnew System::Drawing::Color;
                                 col = gcnew System::Drawing::Color;
                                 bkbr = gcnew System::Drawing::SolidBrush(System::Drawing::Color::Blue);
                                 bkbr = gcnew System::Drawing::SolidBrush(System::Drawing::Color::Blue);
                                 fgbr = gcnew System::Drawing::SolidBrush(System::Drawing::Color::White);
                                 fgbr = gcnew System::Drawing::SolidBrush(System::Drawing::Color::White);
                                 int xx, yy;
                                 int xx, yy;
                                 for (xx = ur.X; xx < ur.X + ur.Width; xx += 8) {
                                 for (xx = ur.X; xx < ur.X + ur.Width; xx += 8) {
                                         for (yy = ur.Y; yy < ur.Y + ur.Height; yy += 8) {
                                         for (yy = ur.Y; yy < ur.Y + ur.Height; yy += 10) {
                                                 ndx = (xx/8 + yy/8 * 84);
                                                 ndx = (xx/8 + yy/10 * 84);
//                                               if (system1.VideoMemDirty[ndx]) {
//                                               if (system1.VideoMemDirty[ndx]) {
                                                        v = system1.VideoMem[ndx];
                                                        if (pVidMem) {
 
                                                                mut->WaitOne();
 
                                                                v = pVidMem[ndx];
 
                                                                mut->ReleaseMutex();
                                                        r = ((((v >> 10) >> 9) >> 6) & 7) << 5;
                                                        r = ((((v >> 10) >> 9) >> 6) & 7) << 5;
                                                        g = ((((v >> 10) >> 9) >> 3) & 7) << 5;
                                                        g = ((((v >> 10) >> 9) >> 3) & 7) << 5;
                                                        b = ((((v >> 10) >> 9) >> 0) & 7) << 5;
                                                        b = ((((v >> 10) >> 9) >> 0) & 7) << 5;
                                                        bkbr->Color = col->FromArgb(255,r,g,b);
                                                        bkbr->Color = col->FromArgb(255,r,g,b);
                                                        gr->FillRectangle(bkbr,xx,yy,8,8);
                                                                gr->FillRectangle(bkbr,xx,yy,8,10);
                                                        r = ((((v >> 10)) >> 6) & 7) << 5;
                                                        r = ((((v >> 10)) >> 6) & 7) << 5;
                                                        g = ((((v >> 10)) >> 3) & 7)<< 5;
                                                        g = ((((v >> 10)) >> 3) & 7)<< 5;
                                                        b = ((((v >> 10)) >> 0) & 7)<< 5;
                                                        b = ((((v >> 10)) >> 0) & 7)<< 5;
                                                        fgbr->Color = col->FromArgb(255,r,g,b);
                                                        fgbr->Color = col->FromArgb(255,r,g,b);
                                                        sprintf(buf,"%c",ScreenToAscii(system1.VideoMem[ndx]&0xff));
                                                                sprintf(buf,"%c",ScreenToAscii(v&0xff));
                                                        str = std::string(buf);
                                                        str = std::string(buf);
                                                        gr->DrawString(gcnew String(str.c_str()),myfont,fgbr,xx,yy);
                                                        gr->DrawString(gcnew String(str.c_str()),myfont,fgbr,xx,yy);
                                                        system1.VideoMemDirty[ndx] = false;
                                                                if (pVidDirty) {
 
                                                                        mut->WaitOne();
 
                                                                        pVidDirty[ndx] = false;
 
                                                                        mut->ReleaseMutex();
 
                                                                }
 
                                                        }
//                                               }
//                                               }
                                         }
                                         }
                                 }
                                 }
                 }
                 }
};
};

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.