private void processCommand(string command, string[] args) { switch (command) { case "display": loadDisplayMenu(); break; case "input": loadInputMenu(); break; case "network": loadNetworkMenu(); break; case "load": string appDir = Path.GetDirectoryName(Assembly.GetCallingAssembly().Location); loadFileMenu(appDir); break; case "softreset": menuReturn(this, null); C64.SoftReset(); break; case "hardreset": menuReturn(this, null); C64.HardReset(); break; case "return": menuReturn(this, null); break; case "quit": menuQuit(this, null); break; case "main": loadMainMenu(); break; case "fps.left": case "fps.right": renderer.DisplayFPS = !renderer.DisplayFPS; menuList[1].Text = "Display FPS: " + (renderer.DisplayFPS ? "Yes" : "No"); break; case "resolution": renderer.Reset( args[0] == "fullscreen", int.Parse(args[1]), int.Parse(args[2]) ); break; case "starthost": menuReturn(this, null); if (network.IsClient) { network.ClientDisconnect(); } network.HostBegin(Network.NETWORK_PORT); renderer.DisplayStatus("Started hosting"); break; case "stophost": menuReturn(this, null); network.HostEnd(); renderer.DisplayStatus("Stopped hosting"); break; case "connect": menuReturn(this, null); Settings.Default.LastHost = args[0]; if (network.IsHosting) { network.HostEnd(); } network.ClientConnect(args[0], Network.NETWORK_PORT); renderer.DisplayStatus("Trying to connect to host..."); break; case "disconnect": menuReturn(this, null); network.ClientDisconnect(); break; case "directory": loadFileMenu(args[0]); break; case "file": if (args[0] == "prg") { C64.LoadProgram(args[1]); menuReturn(this, null); renderer.DisplayStatus("Program loaded into memory"); } break; case "joy1map.left": int newMap = (int)C64.cia1.Joy1Map - 1; if (newMap == -1) { newMap = 4; } C64.cia1.Joy1Map = (MapType)newMap; menuList[1].Text = "Joystick 1 Map: " + C64.cia1.Joy1Map.ToString(); break; case "joy1map.right": newMap = (int)C64.cia1.Joy1Map + 1; if (newMap == 5) { newMap = 0; } C64.cia1.Joy1Map = (MapType)newMap; menuList[1].Text = "Joystick 1 Map: " + C64.cia1.Joy1Map.ToString(); break; case "joy2map.left": newMap = (int)C64.cia1.Joy2Map - 1; if (newMap == -1) { newMap = 4; } C64.cia1.Joy2Map = (MapType)newMap; menuList[2].Text = "Joystick 2 Map: " + C64.cia1.Joy2Map.ToString(); break; case "joy2map.right": newMap = (int)C64.cia1.Joy2Map + 1; if (newMap == 5) { newMap = 0; } C64.cia1.Joy2Map = (MapType)newMap; menuList[2].Text = "Joystick 2 Map: " + C64.cia1.Joy2Map.ToString(); break; case "editkey1": loadKeySetMenu(1); break; case "editkey2": loadKeySetMenu(2); break; } }
private void network_clientDisconnected(object sender, EventArgs e) { C64.HardReset(); renderer.DisplayStatus("Disconnected"); }