Skip to content

Commit

Permalink
Use of --hex command line arg doesn't require also specifying --autoRun
Browse files Browse the repository at this point in the history
Repro:
1. Run "FoenixIDE.exe"
2. In the UI, disable autoRun.
3. Close emulator (.ini file gets saved).
4. Run "FoenixIDE.exe --hex someKernel.hex"

Expected: Emulator launches without autoRun
Actual: Emulator launches with autoRun

Explanation: if you use any command line switch (e.g., --hex) then the emulator looks for autoRun in the command line too.
If you don't specify autoRun on the command line, it won't fall back to reading it from the .ini file. Instead. autoRun always stays at the default (true).
  • Loading branch information
clandrew authored Apr 30, 2022
1 parent e2a5aff commit 218b57c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Main/UI/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public partial class MainWindow : Form

public MainWindow(Dictionary<string, string> context)
{
bool autoRunCommandLineSpecified = false;
bool boardVersionCommandLineSpecified = false;

if (context != null)
{
if (context.ContainsKey("jumpStartAddress"))
Expand All @@ -71,6 +74,7 @@ public MainWindow(Dictionary<string, string> context)
if (context.ContainsKey("autoRun"))
{
autoRun = "true".Equals(context["autoRun"]);
autoRunCommandLineSpecified = true;
}
if (context.ContainsKey("disabledIRQs"))
{
Expand All @@ -90,12 +94,16 @@ public MainWindow(Dictionary<string, string> context)
{
version = BoardVersion.RevUPlus;
}
boardVersionCommandLineSpecified = true;
}
}
// If the user didn't specify context switches, read the ini setting
if (context == null)
if (!autoRunCommandLineSpecified)
{
autoRun = Simulator.Properties.Settings.Default.Autorun;
}
if (!boardVersionCommandLineSpecified)
{
switch (Simulator.Properties.Settings.Default.BoardRevision)
{
case "B":
Expand Down

0 comments on commit 218b57c

Please sign in to comment.