public void loadOS(NesRom rom, string map_path) { if (map_path == null) { map_path = getTestMapper(255); } byte[] prg = rom.PrgData; byte[] chr = rom.ChrData; MapConfig cfg = new MapConfig(); cfg.map_idx = 0xff; cfg.Ctrl = MapConfig.ctrl_unlock; cmd(cmd_reboot); edio.rx8();//exec edio.memWR(rom.PrgAddr, prg, 0, prg.Length); edio.memWR(rom.ChrAddr, chr, 0, chr.Length); edio.getStatus(); if (map_path == null) { mapLoadSDC(255, cfg); } else { byte[] map = File.ReadAllBytes(map_path); edio.fpgInit(map, cfg); } }
static void edlink(string[] args) { edio = new Edio(); usb = new Usbio(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(); } if (args.Length == 0) { edio.getConfig().printFull(); Console.WriteLine(""); printState(); Console.WriteLine(""); edio.getPort().Close(); Console.WriteLine("Press any key"); Console.ReadKey(); return; } cmdProcessor(args); }