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

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [emuThor/] [source/] [frmMemory.h] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 robfinch
#pragma once
2
#include "stdafx.h"
3
#include <string.h>
4
#include <stdlib.h>
5
#include <stdio.h>
6
#include <string>
7
 
8
extern clsSystem system1;
9
 
10
namespace emuThor {
11
 
12
        using namespace System;
13
        using namespace System::ComponentModel;
14
        using namespace System::Collections;
15
        using namespace System::Windows::Forms;
16
        using namespace System::Data;
17
        using namespace System::Drawing;
18
        using namespace System::Runtime::InteropServices;
19
 
20
        /// <summary>
21
        /// Summary for frmMemory
22
        /// </summary>
23
        public ref class frmMemory : public System::Windows::Forms::Form
24
        {
25
        public:
26
                frmMemory(void)
27
                {
28
                        InitializeComponent();
29
                        //
30
                        //TODO: Add the constructor code here
31
                        //
32
                }
33
 
34
        protected:
35
                /// <summary>
36
                /// Clean up any resources being used.
37
                /// </summary>
38
                ~frmMemory()
39
                {
40
                        if (components)
41
                        {
42
                                delete components;
43
                        }
44
                }
45
        private: System::Windows::Forms::TextBox^  textBoxAddr;
46
        protected:
47
 
48
        protected:
49
        private: System::Windows::Forms::Label^  label1;
50
        private: System::Windows::Forms::TextBox^  textBoxMem;
51
 
52
        private:
53
                /// <summary>
54
                /// Required designer variable.
55
                /// </summary>
56
                System::ComponentModel::Container ^components;
57
 
58
#pragma region Windows Form Designer generated code
59
                /// <summary>
60
                /// Required method for Designer support - do not modify
61
                /// the contents of this method with the code editor.
62
                /// </summary>
63
                void InitializeComponent(void)
64
                {
65
                        this->textBoxAddr = (gcnew System::Windows::Forms::TextBox());
66
                        this->label1 = (gcnew System::Windows::Forms::Label());
67
                        this->textBoxMem = (gcnew System::Windows::Forms::TextBox());
68
                        this->SuspendLayout();
69
                        // 
70
                        // textBoxAddr
71
                        // 
72
                        this->textBoxAddr->Location = System::Drawing::Point(75, 18);
73
                        this->textBoxAddr->Name = L"textBoxAddr";
74
                        this->textBoxAddr->Size = System::Drawing::Size(100, 20);
75
                        this->textBoxAddr->TabIndex = 0;
76
                        this->textBoxAddr->TextChanged += gcnew System::EventHandler(this, &frmMemory::textBox1_TextChanged);
77
                        // 
78
                        // label1
79
                        // 
80
                        this->label1->AutoSize = true;
81
                        this->label1->Location = System::Drawing::Point(24, 21);
82
                        this->label1->Name = L"label1";
83
                        this->label1->Size = System::Drawing::Size(45, 13);
84
                        this->label1->TabIndex = 1;
85
                        this->label1->Text = L"Address";
86
                        // 
87
                        // textBoxMem
88
                        // 
89
                        this->textBoxMem->Enabled = false;
90
                        this->textBoxMem->Font = (gcnew System::Drawing::Font(L"Lucida Console", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
91
                                static_cast<System::Byte>(0)));
92
                        this->textBoxMem->Location = System::Drawing::Point(27, 44);
93
                        this->textBoxMem->Multiline = true;
94
                        this->textBoxMem->Name = L"textBoxMem";
95
                        this->textBoxMem->Size = System::Drawing::Size(561, 353);
96
                        this->textBoxMem->TabIndex = 2;
97
                        // 
98
                        // frmMemory
99
                        // 
100
                        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
101
                        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
102
                        this->ClientSize = System::Drawing::Size(614, 409);
103
                        this->Controls->Add(this->textBoxMem);
104
                        this->Controls->Add(this->label1);
105
                        this->Controls->Add(this->textBoxAddr);
106
                        this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
107
                        this->Name = L"frmMemory";
108
                        this->Text = L"Memory";
109
                        this->ResumeLayout(false);
110
                        this->PerformLayout();
111
 
112
                }
113
#pragma endregion
114
        private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
115
                                 int nn;
116
                        char* str = (char*)(void*)Marshal::StringToHGlobalAnsi(this->textBoxAddr->Text);
117
                                std::string str2;
118
                                char buf[50];
119
 
120
                                str2 = "";
121
                                 for (nn = strtoul(str,NULL,16); nn < strtoul(str,NULL,16) + 512; nn++) {
122
                                         if ((nn % 16)==0) {
123
                                                 sprintf(buf, "\r\n%06X ", nn);
124
                                                 str2 += buf;
125
                                         }
126
                                         sprintf(buf, "%02X ", (system1.Read(nn,0) >> ((nn & 7)<<3)) & 0xFF);
127
                                         str2 += buf;
128
                                 }
129
                                 this->textBoxMem->Text = gcnew String(str2.c_str());
130
                         }
131
        };
132
}

powered by: WebSVN 2.1.0

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