Skip to content

Instantly share code, notes, and snippets.

@chenxuuu
Created April 2, 2019 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chenxuuu/53a207ca864b090f69f4cae77b9d84b8 to your computer and use it in GitHub Desktop.
Save chenxuuu/53a207ca864b090f69f4cae77b9d84b8 to your computer and use it in GitHub Desktop.
把coolwatcher读出来的lod转成能拿来烧录用的lod
using System;
using System.Collections;
using System.IO;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string path = Console.ReadLine();//注意文件第一行必须是实际数据,删掉@08000000的前缀
string[] text = File.ReadAllLines(path);
ArrayList result = new ArrayList();
for (int i=0; i<text.Length;i++)
{
if(i% 16384 == 0)
{
if(i / 16384 >= 16)
result.Add("@08" + Convert.ToString(i / 16384, 16) + "0000");
else
result.Add("@080" + Convert.ToString(i / 16384, 16) + "0000");
}
result.Add(text[i]);
if(i % 1000 == 0)
Console.WriteLine((float)i / text.Length);
}
File.WriteAllLines("output.lod", (string[])result.ToArray(typeof(string)));
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment