private void LoadFlags(string path = "eflags.arc") { Flags = new Dictionary <string, string>(); StreamReader reader = new StreamReader(path); string line, command; string[] args; while (!reader.EndOfStream) { line = reader.ReadLine(); command = line.Substring(0, line.IndexOf(' ')); args = VMCommands.GetArguments(line); switch (command) { case "bit_depth": Flags[command] = args[0]; break; case "RAM_SIZE": Flags[command] = args[0]; break; } } }
private void LoadRegisterDefs(string path = "eregisterdefs.arc") { RegisterCodes = new Dictionary <string, int>(); RegisterSizes = new Dictionary <int, int>(); StreamReader reader = new StreamReader(path); int maxaddr = 0; int maxsize = 0; while (!reader.EndOfStream) { string command = reader.ReadLine(); string[] args = VMCommands.GetArguments(command); if (Convert.ToInt32(args[0], 16) > maxaddr) { maxaddr = Convert.ToInt32(args[0], 16); maxsize = Convert.ToInt32(args[1], 10); } RegisterCodes.Add(command.Substring(0, command.IndexOf(' ')), Convert.ToInt32(args[0], 16)); RegisterSizes.Add(Convert.ToInt32(args[0], 16), Convert.ToInt32(args[1], 10)); } Registers_.Capacity = maxaddr + maxsize; }