-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectFile.cs
More file actions
51 lines (41 loc) · 1.37 KB
/
ProjectFile.cs
File metadata and controls
51 lines (41 loc) · 1.37 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Z80Decompiler
{
public class ProjectFile
{
private byte[] binaryFile;
private List<DecodedLine> decodedLines = new List<DecodedLine>();
//------------------------------------------------------
public ProjectFile()
{
binaryFile = null;
}
//------------------------------------------------------
~ProjectFile()
{
}
//------------------------------------------------------
// Attempt to load and process the binary file
public bool Load(String filename)
{
using (BinaryReader reader = new BinaryReader(File.Open(filename, FileMode.Open)) )
{
// Read the binary file
binaryFile = reader.ReadBytes((int)reader.BaseStream.Length);
// Now we need to process the file into text lines
//Z80Decoder decoder = new Z80Decoder();
// To start with lets assume every byte is a db
for ( int i = 0; i < binaryFile.Length; i++)
{
decodedLines.Add(new DecodedLine(binaryFile, i, 1));
}
}
return true;
}
}
}