-
Notifications
You must be signed in to change notification settings - Fork 1
/
Form1.cs
159 lines (141 loc) · 4.87 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
namespace NESDEV
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
}
private async void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog OFD = new OpenFileDialog();
OFD.Filter = "6502 Assembly|*.asm";
OFD.ShowDialog();
if (OFD.FileName != "")
{
Hiddentxt.Text = OFD.FileName;
FileLabel.Text = $"File: {Path.GetFileName(OFD.FileName)}";
using (StreamReader SR = new StreamReader(OFD.FileName))
{
fastColoredTextBox1.Text = await SR.ReadToEndAsync();
}
}
}
private async void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog SFD = new SaveFileDialog();
SFD.Filter = "6502 Assembly | *.asm";
SFD.ShowDialog();
using (StreamWriter SW = new StreamWriter(SFD.FileName))
{
SW.WriteLineAsync(SFD.FileName);
MessageBox.Show($"Successfully saved {SFD.FileName}!");
}
}
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void configureToolStripMenuItem_Click(object sender, EventArgs e)
{
Config cfg = new Config();
cfg.Show();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private async void runToolStripMenuItem_Click(object sender, EventArgs e)
{
ProcessStartInfo PSI = new ProcessStartInfo();
PSI.UseShellExecute = false;
PSI.CreateNoWindow = false;
PSI.FileName = Config.Assmblr;
PSI.WindowStyle = ProcessWindowStyle.Normal;
PSI.Arguments = Hiddentxt.Text;
ProcessStartInfo PSI2 = new ProcessStartInfo();
PSI2.UseShellExecute = false;
PSI2.CreateNoWindow = false;
PSI2.FileName = Config.Emulatr;
PSI2.WindowStyle = ProcessWindowStyle.Normal;
PSI2.Arguments = $"{Path.GetFileNameWithoutExtension(Hiddentxt.Text)}.nes";
Process.Start(PSI);
await Task.Delay(3000);
Process.Start(PSI2);
}
private void languageToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void englishEnglishToolStripMenuItem_Click(object sender, EventArgs e)
{
fileToolStripMenuItem.Text = "File";
openToolStripMenuItem.Text = "Open";
saveToolStripMenuItem.Text = "Save";
closeToolStripMenuItem.Text = "Close";
runToolStripMenuItem.Text = "Run";
configureToolStripMenuItem.Text = "Configure";
englishEnglishToolStripMenuItem.Text = "English (English)";
frenchToolStripMenuItem.Text = "French (Français)";
spanishToolStripMenuItem.Text = "Spanish (Español)";
arabicToolStripMenuItem.Text = "Arabic (العربية)";
languageToolStripMenuItem.Text = "Language";
}
private void frenchToolStripMenuItem_Click(object sender, EventArgs e)
{
fileToolStripMenuItem.Text = "Fichier";
openToolStripMenuItem.Text = "Ouvrir";
saveToolStripMenuItem.Text = "Sauvegarde";
closeToolStripMenuItem.Text = "Fermer";
runToolStripMenuItem.Text = "Courir";
configureToolStripMenuItem.Text = "Configuration";
englishEnglishToolStripMenuItem.Text = "Anglais (English)";
frenchToolStripMenuItem.Text = "Français (Français)";
spanishToolStripMenuItem.Text = "Espagnol (Español)";
arabicToolStripMenuItem.Text = "Arabe (العربية)";
languageToolStripMenuItem.Text = "Langue";
}
private void spanishToolStripMenuItem_Click(object sender, EventArgs e)
{
fileToolStripMenuItem.Text = "Archivo";
openToolStripMenuItem.Text = "Abrir";
saveToolStripMenuItem.Text = "Salvar";
closeToolStripMenuItem.Text = "Cerrar";
runToolStripMenuItem.Text = "correr";
configureToolStripMenuItem.Text = "Config";
englishEnglishToolStripMenuItem.Text = "Inglés (English)";
frenchToolStripMenuItem.Text = "Francés (Français)";
spanishToolStripMenuItem.Text = "Español (Español)";
arabicToolStripMenuItem.Text = "Árabe (العربية)";
languageToolStripMenuItem.Text = "Idioma";
}
private void arabicToolStripMenuItem_Click(object sender, EventArgs e)
{
fileToolStripMenuItem.Text = "ملف";
openToolStripMenuItem.Text = "مفتوح";
saveToolStripMenuItem.Text = "أنقذ";
closeToolStripMenuItem.Text = "غلق";
runToolStripMenuItem.Text = "ركض";
configureToolStripMenuItem.Text = "تكوين";
englishEnglishToolStripMenuItem.Text = "الإنكليزية (English)";
frenchToolStripMenuItem.Text = "الفرنسية (Français)";
spanishToolStripMenuItem.Text = "الإسبانية (Español)";
arabicToolStripMenuItem.Text = "العربية (العربية)";
languageToolStripMenuItem.Text = "اللغة";
}
}
}