示例#1
0
        static void megalink(string[] args)
        {
            try
            {
                edio = new Edio();
            }
            catch (Exception)
            {
                System.Threading.Thread.Sleep(500);
                edio = new Edio();
            }

            Console.WriteLine("EverDrive found at " + edio.PortName);
            Console.WriteLine("EDIO status: " + edio.getStatus().ToString("X4"));
            Console.WriteLine("");

            bool force_app_mode = true;

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i].Equals("-appmode"))
                {
                    force_app_mode = false;
                }
                if (args[i].Equals("-sermode"))
                {
                    force_app_mode = false;
                }
            }
            if (force_app_mode)
            {
                edio.exitServiceMode();
            }

            CmdProcessor.start(args, edio);

            //edio.getConfig().print();
        }
示例#2
0
        public static void start(string[] args, Edio io)
        {
            edio = io;
            usb  = new Usbio(edio);


            for (int i = 0; i < args.Length; i++)
            {
                string s = args[i].ToLower().Trim();

                if (s.Equals("-reset"))
                {
                    edio.hostReset(Edio.HOST_RST_SOFT);
                    continue;
                }

                if (s.Equals("-recovery"))
                {
                    cmd_recovery();
                    continue;
                }

                if (s.Equals("-appmode"))
                {
                    cmd_exitServiceMode();
                    continue;
                }

                if (s.Equals("-sermode"))
                {
                    cmd_enterServiceMode();
                    continue;
                }

                if (s.Equals("-flawr"))
                {
                    cmd_flashWrite(args[i + 1], args[i + 2]);
                    i += 2;
                    continue;
                }

                if (s.Equals("-rtcset"))
                {
                    edio.rtcSet(DateTime.Now);
                    continue;
                }

                if (s.EndsWith(".rbf"))
                {
                    cmd_loadFpga(args[i]);
                    continue;
                }

                if (s.StartsWith("-memprint"))
                {
                    cmd_memPrint(args[i + 1], args[i + 2]);
                    i += 2;
                }

                if (s.StartsWith("-memwr"))
                {
                    cmd_memWrite(args[i + 1], args[i + 2]);
                    i += 2;
                }

                if (s.StartsWith("-memrd"))
                {
                    cmd_memRead(args[i + 1], args[i + 2], args[i + 3]);
                    i += 3;
                }


                if (s.Equals("-verify"))
                {
                    cmd_verify(args[i + 1], args[i + 2], args[i + 3]);
                    i += 3;
                    continue;
                }


                if (s.EndsWith(".bin") || s.EndsWith(".gen") || s.EndsWith(".md") || s.EndsWith(".smd") || s.EndsWith(".32x") || s.EndsWith(".sms") || s.EndsWith(".nes"))
                {
                    //cmdMemWrite(args[i], "0");
                    cmd_loadGame(s);
                    continue;
                }

                if (s.Equals("-cp"))
                {
                    usb.copyFile(args[i + 1], args[i + 2]);
                    i += 2;
                    continue;
                }

                if (s.Equals("-mkdir"))
                {
                    usb.makeDir(args[i + 1]);
                    i += 1;
                    continue;
                }
            }

            edio.hostReset(Edio.HOST_RST_OFF);
            Console.WriteLine("");
        }
示例#3
0
 public Usbio(Edio edio)
 {
     this.edio = edio;
 }