Пример #1
0
        private static void SwapRom(string[] args)
        {
            if (args.Length != 3)
            {
                return;
            }

            string inRom  = args[0];
            string outRom = args[1];
            string swap   = args[2];

            if (!FileExists(inRom))
            {
                return;
            }

            FileEncoding fileEncoding;

            switch (swap.ToLower())
            {
            case "little16": fileEncoding = FileEncoding.LittleEndian16; break;

            case "little32": fileEncoding = FileEncoding.LittleEndian32; break;

            default: return;
            }
            using (FileStream fs = File.OpenRead(inRom))
            {
                using (FileStream fw = File.Create(outRom))
                {
                    FileOrder.ToBigEndian32(fs, fw, fileEncoding);
                }
            }
        }
Пример #2
0
        private static void SwapRom(string[] args)
        {
            string       inRom;
            string       outRom;
            string       swap;
            FileEncoding fileEncoding = FileEncoding.Error;

            if (args.Length != 3)
            {
                return;
            }

            inRom  = args[0];
            outRom = args[1];
            swap   = args[2];

            if (!FileExists(inRom))
            {
                return;
            }

            switch (swap.ToLower())
            {
            case "little16": fileEncoding = FileEncoding.LittleEndian16; break;

            case "little32": fileEncoding = FileEncoding.LittleEndian32; break;

            //case "":
            default: return;
            }
            using (FileStream fs = new FileStream(inRom, FileMode.Open, FileAccess.Read))
            {
                using (FileStream fw = new FileStream(outRom, FileMode.Create))
                {
                    FileOrder.ToBigEndian32(fs, fw, fileEncoding);
                }
            }
        }