-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert.cs
30 lines (27 loc) · 904 Bytes
/
convert.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.IO;
using System.Collections.Generic;
namespace ConvertNES
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the name of the rom to convert (eg 'The Legend of Zelda' = roms/The Legend of Zelda.nes)");
string fileName = Console.ReadLine();
byte[] rom = File.ReadAllBytes("roms/"+fileName+".nes");
//List<int> ints = new List<int>();
string result = "return {";
foreach (byte Byte in rom)
{
//ints.Add(Byte);
result += Byte.ToString()+", ";
}
result += "}";
Console.WriteLine(result);
File.WriteAllLines("NES ROM.lua", new string[] {result});
Console.WriteLine("Completed. Hit ENTER to close.");
Console.ReadLine();
}
}
}