Created
April 2, 2019 10:52
-
-
Save chenxuuu/53a207ca864b090f69f4cae77b9d84b8 to your computer and use it in GitHub Desktop.
把coolwatcher读出来的lod转成能拿来烧录用的lod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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