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

Subversion Repositories thor

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

Only display areas with differences | Details | Blame | View Log

Rev 32 Rev 35
#pragma once
#pragma once
#include "stdafx.h"
#include "stdafx.h"
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <string>
#include <string>
 
 
extern clsSystem system1;
extern clsSystem system1;
 
 
namespace emuThor {
namespace emuThor {
 
 
        using namespace System;
        using namespace System;
        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::Runtime::InteropServices;
        using namespace System::Runtime::InteropServices;
        using namespace System::Threading;
        using namespace System::Threading;
 
 
        /// <summary>
        /// <summary>
        /// Summary for frmMemory
        /// Summary for frmMemory
        /// </summary>
        /// </summary>
        public ref class frmMemory : public System::Windows::Forms::Form
        public ref class frmMemory : public System::Windows::Forms::Form
        {
        {
        public:
        public:
                Mutex^ mut;
                Mutex^ mut;
                frmMemory(Mutex^ m)
                frmMemory(Mutex^ m)
                {
                {
                        mut = m;
                        mut = m;
                        InitializeComponent();
                        InitializeComponent();
                        //
                        //
                        //TODO: Add the constructor code here
                        //TODO: Add the constructor code here
                        //
                        //
                }
                }
 
 
        protected:
        protected:
                /// <summary>
                /// <summary>
                /// Clean up any resources being used.
                /// Clean up any resources being used.
                /// </summary>
                /// </summary>
                ~frmMemory()
                ~frmMemory()
                {
                {
                        if (components)
                        if (components)
                        {
                        {
                                delete components;
                                delete components;
                        }
                        }
                }
                }
        private: System::Windows::Forms::TextBox^  textBoxAddr;
        private: System::Windows::Forms::TextBox^  textBoxAddr;
        protected:
        protected:
 
 
        protected:
        protected:
        private: System::Windows::Forms::Label^  label1;
        private: System::Windows::Forms::Label^  label1;
        private: System::Windows::Forms::TextBox^  textBoxMem;
        private: System::Windows::Forms::TextBox^  textBoxMem;
 
 
        private:
        private:
                /// <summary>
                /// <summary>
                /// Required designer variable.
                /// Required designer variable.
                /// </summary>
                /// </summary>
                System::ComponentModel::Container ^components;
                System::ComponentModel::Container ^components;
 
 
#pragma region Windows Form Designer generated code
#pragma region Windows Form Designer generated code
                /// <summary>
                /// <summary>
                /// Required method for Designer support - do not modify
                /// Required method for Designer support - do not modify
                /// the contents of this method with the code editor.
                /// the contents of this method with the code editor.
                /// </summary>
                /// </summary>
                void InitializeComponent(void)
                void InitializeComponent(void)
                {
                {
                        this->textBoxAddr = (gcnew System::Windows::Forms::TextBox());
                        this->textBoxAddr = (gcnew System::Windows::Forms::TextBox());
                        this->label1 = (gcnew System::Windows::Forms::Label());
                        this->label1 = (gcnew System::Windows::Forms::Label());
                        this->textBoxMem = (gcnew System::Windows::Forms::TextBox());
                        this->textBoxMem = (gcnew System::Windows::Forms::TextBox());
                        this->SuspendLayout();
                        this->SuspendLayout();
                        // 
                        // 
                        // textBoxAddr
                        // textBoxAddr
                        // 
                        // 
                        this->textBoxAddr->Location = System::Drawing::Point(75, 18);
                        this->textBoxAddr->Location = System::Drawing::Point(75, 18);
                        this->textBoxAddr->Name = L"textBoxAddr";
                        this->textBoxAddr->Name = L"textBoxAddr";
                        this->textBoxAddr->Size = System::Drawing::Size(100, 20);
                        this->textBoxAddr->Size = System::Drawing::Size(100, 20);
                        this->textBoxAddr->TabIndex = 0;
                        this->textBoxAddr->TabIndex = 0;
                        this->textBoxAddr->TextChanged += gcnew System::EventHandler(this, &frmMemory::textBox1_TextChanged);
                        this->textBoxAddr->TextChanged += gcnew System::EventHandler(this, &frmMemory::textBox1_TextChanged);
                        // 
                        // 
                        // label1
                        // label1
                        // 
                        // 
                        this->label1->AutoSize = true;
                        this->label1->AutoSize = true;
                        this->label1->Location = System::Drawing::Point(24, 21);
                        this->label1->Location = System::Drawing::Point(24, 21);
                        this->label1->Name = L"label1";
                        this->label1->Name = L"label1";
                        this->label1->Size = System::Drawing::Size(45, 13);
                        this->label1->Size = System::Drawing::Size(45, 13);
                        this->label1->TabIndex = 1;
                        this->label1->TabIndex = 1;
                        this->label1->Text = L"Address";
                        this->label1->Text = L"Address";
                        // 
                        // 
                        // textBoxMem
                        // textBoxMem
                        // 
                        // 
                        this->textBoxMem->Enabled = false;
                        this->textBoxMem->Enabled = false;
                        this->textBoxMem->Font = (gcnew System::Drawing::Font(L"Lucida Console", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
                        this->textBoxMem->Font = (gcnew System::Drawing::Font(L"Lucida Console", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
                                static_cast<System::Byte>(0)));
                                static_cast<System::Byte>(0)));
                        this->textBoxMem->Location = System::Drawing::Point(27, 44);
                        this->textBoxMem->Location = System::Drawing::Point(27, 44);
                        this->textBoxMem->Multiline = true;
                        this->textBoxMem->Multiline = true;
                        this->textBoxMem->Name = L"textBoxMem";
                        this->textBoxMem->Name = L"textBoxMem";
                        this->textBoxMem->Size = System::Drawing::Size(561, 353);
                        this->textBoxMem->Size = System::Drawing::Size(561, 353);
                        this->textBoxMem->TabIndex = 2;
                        this->textBoxMem->TabIndex = 2;
                        // 
                        // 
                        // frmMemory
                        // frmMemory
                        // 
                        // 
                        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->ClientSize = System::Drawing::Size(614, 409);
                        this->ClientSize = System::Drawing::Size(614, 409);
                        this->Controls->Add(this->textBoxMem);
                        this->Controls->Add(this->textBoxMem);
                        this->Controls->Add(this->label1);
                        this->Controls->Add(this->label1);
                        this->Controls->Add(this->textBoxAddr);
                        this->Controls->Add(this->textBoxAddr);
                        this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
                        this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
                        this->Name = L"frmMemory";
                        this->Name = L"frmMemory";
                        this->Text = L"Memory";
                        this->Text = L"Memory";
 
                        this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &frmMemory::frmMemory_FormClosing);
                        this->ResumeLayout(false);
                        this->ResumeLayout(false);
                        this->PerformLayout();
                        this->PerformLayout();
 
 
                }
                }
#pragma endregion
#pragma endregion
        private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
        private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
                                 int nn;
                                 int nn;
                        char* str = (char*)(void*)Marshal::StringToHGlobalAnsi(this->textBoxAddr->Text);
                        char* str = (char*)(void*)Marshal::StringToHGlobalAnsi(this->textBoxAddr->Text);
                                std::string str2;
                                std::string str2;
                                char buf[50];
                                char buf[50];
 
 
                                str2 = "";
                                str2 = "";
                                 for (nn = strtoul(str,NULL,16); nn < strtoul(str,NULL,16) + 512; nn++) {
                                 for (nn = strtoul(str,NULL,16); nn < strtoul(str,NULL,16) + 512; nn++) {
                                         if ((nn % 16)==0) {
                                         if ((nn % 16)==0) {
                                                 sprintf(buf, "\r\n%06X ", nn);
                                                 sprintf(buf, "\r\n%06X ", nn);
                                                 str2 += buf;
                                                 str2 += buf;
                                         }
                                         }
                                         mut->WaitOne();
                                         mut->WaitOne();
                                         sprintf(buf, "%02X ", (system1.Read(nn,0) >> ((nn & 7)<<3)) & 0xFF);
                                         sprintf(buf, "%02X ", (system1.Read(nn,0) >> ((nn & 7)<<3)) & 0xFF);
                                         mut->ReleaseMutex();
                                         mut->ReleaseMutex();
                                         str2 += buf;
                                         str2 += buf;
                                 }
                                 }
                                 this->textBoxMem->Text = gcnew String(str2.c_str());
                                 this->textBoxMem->Text = gcnew String(str2.c_str());
                         }
                         }
 
private: System::Void frmMemory_FormClosing(System::Object^  sender, System::Windows::Forms::FormClosingEventArgs^  e) {
 
                         if (e->CloseReason==CloseReason::UserClosing)
 
                                 e->Cancel = true;
 
                 }
        };
        };
}
}
 
 

powered by: WebSVN 2.1.0

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