@@ -73,124 +73,124 @@ public async Task ProcessLine(string line) {
7373 WindowBindings . CurrentInstruction = commandArgs [ 0 ] ;
7474 if ( commandArgs . Length >= 2 ) WindowBindings . CurrentInstructionData = commandArgs [ 1 ] ;
7575 WindowBindings . CurrentInstructionBrush = new SolidColorBrush ( BlueColor ) ;
76- await Task . Delay ( ( int ) DelaySizer . Value ) ;
76+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
7777 WindowBindings . CurrentInstructionBrush = null ;
7878 var args = new string [ ] { } ;
7979 if ( commandArgs . Length >= 2 ) args = commandArgs [ 1 ] . Replace ( " " , "" ) . Split ( ',' ) ;
8080 WindowBindings . DecoderBrush = new SolidColorBrush ( BlueColor ) ;
81- await Task . Delay ( ( int ) DelaySizer . Value ) ;
81+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
8282 WindowBindings . DecoderBrush = null ;
8383 switch ( commandArgs [ 0 ] ) {
8484 case "LOD" :
8585 WindowBindings . AluRegister1 = "" ;
8686 WindowBindings . AluRegister2 = "" ;
8787 WindowBindings . AluRegister1Brush = new SolidColorBrush ( BlueColor ) ;
8888 WindowBindings . AluRegister2Brush = new SolidColorBrush ( BlueColor ) ;
89- await Task . Delay ( ( int ) DelaySizer . Value ) ;
89+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
9090 WindowBindings . AluRegister1Brush = null ;
9191 WindowBindings . AluRegister2Brush = null ;
9292 WindowBindings . AluMethod = "↓" ;
9393 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
94- await Task . Delay ( ( int ) DelaySizer . Value ) ;
94+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
9595 WindowBindings . AluMethodBrush = null ;
9696 WindowBindings . Accumulator = _memoryContainer . GetValue ( args [ 0 ] ) ;
9797 WindowBindings . AccumulatorBrush = new SolidColorBrush ( BlueColor ) ;
98- await Task . Delay ( ( int ) DelaySizer . Value ) ;
98+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
9999 WindowBindings . AccumulatorBrush = null ;
100100 break ;
101101 case "STO" :
102102 WindowBindings . AluRegister1 = "" ;
103103 WindowBindings . AluRegister2 = "" ;
104104 WindowBindings . AluRegister1Brush = new SolidColorBrush ( BlueColor ) ;
105105 WindowBindings . AluRegister2Brush = new SolidColorBrush ( BlueColor ) ;
106- await Task . Delay ( ( int ) DelaySizer . Value ) ;
106+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
107107 WindowBindings . AluRegister1Brush = null ;
108108 WindowBindings . AluRegister2Brush = null ;
109109 WindowBindings . AluMethod = "↑" ;
110110 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
111- await Task . Delay ( ( int ) DelaySizer . Value ) ;
111+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
112112 WindowBindings . AluMethodBrush = null ;
113113 _memoryContainer . SetValue ( args [ 0 ] , WindowBindings . Accumulator ) ;
114114 WindowBindings . AccumulatorBrush = new SolidColorBrush ( BlueColor ) ;
115- await Task . Delay ( ( int ) DelaySizer . Value ) ;
115+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
116116 WindowBindings . AccumulatorBrush = null ;
117117 break ;
118118 case "ADD" :
119119 WindowBindings . AluRegister1 = WindowBindings . Accumulator . ToString ( ) ;
120120 WindowBindings . AluRegister1Brush = new SolidColorBrush ( BlueColor ) ;
121- await Task . Delay ( ( int ) DelaySizer . Value ) ;
121+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
122122 WindowBindings . AluRegister1Brush = null ;
123123 if ( args . Length > 0 && args [ 0 ] [ 0 ] == '#' ) WindowBindings . AluRegister2 = args [ 0 ] . Remove ( 0 , 1 ) ;
124124 else WindowBindings . AluRegister2 = _memoryContainer . GetValue ( args [ 0 ] ) . ToString ( ) ;
125125 WindowBindings . AluRegister2Brush = new SolidColorBrush ( BlueColor ) ;
126- await Task . Delay ( ( int ) DelaySizer . Value ) ;
126+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
127127 WindowBindings . AluRegister2Brush = null ;
128128 WindowBindings . AluMethod = "+" ;
129129 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
130- await Task . Delay ( ( int ) DelaySizer . Value ) ;
130+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
131131 WindowBindings . AluMethodBrush = null ;
132132 if ( args . Length > 0 && args [ 0 ] [ 0 ] == '#' && int . TryParse ( args [ 0 ] . Remove ( 0 , 1 ) , out var result ) )
133133 WindowBindings . Accumulator += result ;
134134 else WindowBindings . Accumulator += _memoryContainer . GetValue ( args [ 0 ] ) ;
135135 WindowBindings . AccumulatorBrush = new SolidColorBrush ( BlueColor ) ;
136- await Task . Delay ( ( int ) DelaySizer . Value ) ;
136+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
137137 WindowBindings . AccumulatorBrush = null ;
138138 break ;
139139 case "SUB" :
140140 WindowBindings . AluRegister1 = WindowBindings . Accumulator . ToString ( ) ;
141141 WindowBindings . AluRegister1Brush = new SolidColorBrush ( BlueColor ) ;
142- await Task . Delay ( ( int ) DelaySizer . Value ) ;
142+ if ( ( int ) DelaySizer . Value > 10 ) if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
143143 WindowBindings . AluRegister1Brush = null ;
144144 if ( args . Length > 0 && args [ 0 ] [ 0 ] == '#' ) WindowBindings . AluRegister2 = args [ 0 ] . Remove ( 0 , 1 ) ;
145145 else WindowBindings . AluRegister2 = _memoryContainer . GetValue ( args [ 0 ] ) . ToString ( ) ;
146146 WindowBindings . AluRegister2Brush = new SolidColorBrush ( BlueColor ) ;
147- await Task . Delay ( ( int ) DelaySizer . Value ) ;
147+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
148148 WindowBindings . AluRegister2Brush = null ;
149149 WindowBindings . AluMethod = "-" ;
150150 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
151- await Task . Delay ( ( int ) DelaySizer . Value ) ;
151+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
152152 WindowBindings . AluMethodBrush = null ;
153153 if ( args . Length > 0 && args [ 0 ] [ 0 ] == '#' && int . TryParse ( args [ 0 ] . Remove ( 0 , 1 ) , out var result2 ) )
154154 WindowBindings . Accumulator -= result2 ;
155155 else WindowBindings . Accumulator -= _memoryContainer . GetValue ( args [ 0 ] ) ;
156156 WindowBindings . AccumulatorBrush = new SolidColorBrush ( BlueColor ) ;
157- await Task . Delay ( ( int ) DelaySizer . Value ) ;
157+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
158158 WindowBindings . AccumulatorBrush = null ;
159159 break ;
160160 case "MUL" :
161161 WindowBindings . AluRegister1 = WindowBindings . Accumulator . ToString ( ) ;
162162 WindowBindings . AluRegister1Brush = new SolidColorBrush ( BlueColor ) ;
163- await Task . Delay ( ( int ) DelaySizer . Value ) ;
163+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
164164 WindowBindings . AluRegister1Brush = null ;
165165 if ( args . Length > 0 && args [ 0 ] [ 0 ] == '#' ) WindowBindings . AluRegister2 = args [ 0 ] . Remove ( 0 , 1 ) ;
166166 else WindowBindings . AluRegister2 = _memoryContainer . GetValue ( args [ 0 ] ) . ToString ( ) ;
167167 WindowBindings . AluRegister2Brush = new SolidColorBrush ( BlueColor ) ;
168- await Task . Delay ( ( int ) DelaySizer . Value ) ;
168+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
169169 WindowBindings . AluRegister2Brush = null ;
170170 WindowBindings . AluMethod = "*" ;
171171 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
172- await Task . Delay ( ( int ) DelaySizer . Value ) ;
172+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
173173 WindowBindings . AluMethodBrush = null ;
174174 if ( args . Length > 0 && args [ 0 ] [ 0 ] == '#' && int . TryParse ( args [ 0 ] . Remove ( 0 , 1 ) , out var result3 ) )
175175 WindowBindings . Accumulator *= result3 ;
176176 else WindowBindings . Accumulator *= _memoryContainer . GetValue ( args [ 0 ] ) ;
177177 WindowBindings . AccumulatorBrush = new SolidColorBrush ( BlueColor ) ;
178- await Task . Delay ( ( int ) DelaySizer . Value ) ;
178+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
179179 WindowBindings . AccumulatorBrush = null ;
180180 break ;
181181 case "DIV" :
182182 WindowBindings . AluRegister1 = WindowBindings . Accumulator . ToString ( ) ;
183183 WindowBindings . AluRegister1Brush = new SolidColorBrush ( BlueColor ) ;
184- await Task . Delay ( ( int ) DelaySizer . Value ) ;
184+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
185185 WindowBindings . AluRegister1Brush = null ;
186186 if ( args . Length > 0 && args [ 0 ] [ 0 ] == '#' ) WindowBindings . AluRegister2 = args [ 0 ] . Remove ( 0 , 1 ) ;
187187 else WindowBindings . AluRegister2 = _memoryContainer . GetValue ( args [ 0 ] ) . ToString ( ) ;
188188 WindowBindings . AluRegister2Brush = new SolidColorBrush ( BlueColor ) ;
189- await Task . Delay ( ( int ) DelaySizer . Value ) ;
189+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
190190 WindowBindings . AluRegister2Brush = null ;
191191 WindowBindings . AluMethod = "/" ;
192192 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
193- await Task . Delay ( ( int ) DelaySizer . Value ) ;
193+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
194194 WindowBindings . AluMethodBrush = null ;
195195 try {
196196 if ( args . Length > 0 && args [ 0 ] [ 0 ] == '#' && int . TryParse ( args [ 0 ] . Remove ( 0 , 1 ) , out var result4 ) )
@@ -204,20 +204,20 @@ public async Task ProcessLine(string line) {
204204 ) ;
205205 }
206206 WindowBindings . AccumulatorBrush = new SolidColorBrush ( BlueColor ) ;
207- await Task . Delay ( ( int ) DelaySizer . Value ) ;
207+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
208208 WindowBindings . AccumulatorBrush = null ;
209209 break ;
210210 case "JMP" :
211211 WindowBindings . AluRegister1 = "" ;
212212 WindowBindings . AluRegister2 = "" ;
213213 WindowBindings . AluRegister1Brush = new SolidColorBrush ( BlueColor ) ;
214214 WindowBindings . AluRegister2Brush = new SolidColorBrush ( BlueColor ) ;
215- await Task . Delay ( ( int ) DelaySizer . Value ) ;
215+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
216216 WindowBindings . AluRegister1Brush = null ;
217217 WindowBindings . AluRegister2Brush = null ;
218218 WindowBindings . AluMethod = "↷" ;
219219 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
220- await Task . Delay ( ( int ) DelaySizer . Value ) ;
220+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
221221 WindowBindings . AluMethodBrush = null ;
222222 WindowBindings . CurrentLine = int . Parse ( args [ 0 ] ) ;
223223 break ;
@@ -226,24 +226,29 @@ public async Task ProcessLine(string line) {
226226 WindowBindings . AluRegister2 = "" ;
227227 WindowBindings . AluRegister1Brush = new SolidColorBrush ( BlueColor ) ;
228228 WindowBindings . AluRegister2Brush = new SolidColorBrush ( BlueColor ) ;
229- await Task . Delay ( ( int ) DelaySizer . Value ) ;
229+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
230230 WindowBindings . AluRegister1Brush = null ;
231231 WindowBindings . AluRegister2Brush = null ;
232232 WindowBindings . AluMethod = "↷" ;
233233 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
234- await Task . Delay ( ( int ) DelaySizer . Value ) ;
234+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
235235 WindowBindings . AluMethodBrush = null ;
236236 if ( WindowBindings . Accumulator == 0 ) WindowBindings . CurrentLine = int . Parse ( args [ 0 ] ) ;
237237 break ;
238238 case "HLT" :
239+ WindowBindings . AluRegister1 = "" ;
240+ WindowBindings . AluRegister2 = "" ;
239241 WindowBindings . AluMethod = "❌" ;
240242 WindowBindings . LinesBrush = new SolidColorBrush ( Colors . Red ) ;
241243 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
242- await Task . Delay ( ( int ) DelaySizer . Value ) ;
244+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
243245 WindowBindings . AluMethodBrush = null ;
244246 WindowBindings . IsRunning = false ;
245247 break ;
246248 case "NOP" :
249+ WindowBindings . AluRegister1 = "" ;
250+ WindowBindings . AluRegister2 = "" ;
251+ WindowBindings . AluMethod = "" ;
247252 break ;
248253 default :
249254 MessageBox . Show (
@@ -253,7 +258,7 @@ public async Task ProcessLine(string line) {
253258 WindowBindings . AluMethod = "❌" ;
254259 WindowBindings . LinesBrush = new SolidColorBrush ( Colors . Red ) ;
255260 WindowBindings . AluMethodBrush = new SolidColorBrush ( BlueColor ) ;
256- await Task . Delay ( ( int ) DelaySizer . Value ) ;
261+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
257262 WindowBindings . AluMethodBrush = null ;
258263 WindowBindings . IsRunning = false ;
259264 break ;
@@ -303,11 +308,11 @@ public async Task NextStep() {
303308
304309 public async Task IncreasePc ( ) {
305310 WindowBindings . IncrementLineBrush = new SolidColorBrush ( BlueColor ) ;
306- await Task . Delay ( ( int ) DelaySizer . Value ) ;
311+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
307312 WindowBindings . IncrementLineBrush = null ;
308313 WindowBindings . CurrentLine ++ ;
309314 WindowBindings . CurrentLineBrush = new SolidColorBrush ( BlueColor ) ;
310- await Task . Delay ( ( int ) DelaySizer . Value ) ;
315+ if ( ( int ) DelaySizer . Value > 10 ) await Task . Delay ( ( int ) DelaySizer . Value ) ;
311316 WindowBindings . CurrentLineBrush = null ;
312317 }
313318
@@ -355,7 +360,6 @@ private void OpenProject_Click(object sender, RoutedEventArgs e) {
355360 //_memoryContainer = objectData.Memory;
356361 }
357362 }
358- MessageBox . Show ( "Project saved successfully." , "Save" , MessageBoxButton . OK , MessageBoxImage . Information ) ;
359363 }
360364 catch ( Exception ex ) {
361365 MessageBox . Show ( $ "Failed to save project!{ Environment . NewLine } { ex . Message } ", "Error" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
@@ -423,8 +427,10 @@ private void AboutVNS_Click(object sender, RoutedEventArgs e) {
423427 "João Pedro Dante" + Environment . NewLine +
424428 Environment . NewLine +
425429 "Github:" + Environment . NewLine +
426- "https://github.com/jpdante/VonNeumannSimulator" ;
427- MessageBox . Show ( about , "About" , MessageBoxButton . OK , MessageBoxImage . Information ) ;
430+ "https://github.com/jpdante/VonNeumannSimulator" + Environment . NewLine +
431+ Environment . NewLine +
432+ "Version: 1.1" ;
433+ MessageBox . Show ( about , "About" , MessageBoxButton . OK , MessageBoxImage . Information ) ;
428434 }
429435 }
430436}
0 commit comments