Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
Add INFO2 output
Browse files Browse the repository at this point in the history
  • Loading branch information
Raytwo committed Sep 19, 2019
1 parent a7841e9 commit 9c36f7f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
1 change: 1 addition & 0 deletions FETHArchiveManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="INFO0.cs" />
<Compile Include="INFO2.cs" />
<Compile Include="IO\AlignmentHelper.cs" />
<Compile Include="IO\EndianBinaryReader.cs" />
<Compile Include="IO\EndianBinaryWriter.cs" />
Expand Down
Binary file removed INFO0.bin
Binary file not shown.
43 changes: 43 additions & 0 deletions INFO2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using G1Tool.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FETHArchiveManager
{
public class INFO2
{
public long INFO0Count { get; set; }
public long INFO1Count => 4;

public INFO2(long info0_count, long info1_count = 4)
{
INFO0Count = info0_count;
}

public void Write(string filename)
{
Write(new EndianBinaryWriter(filename, Endianness.Little));
}

public void Write(EndianBinaryWriter w)
{
w.Write(INFO0Count);
w.Write(INFO1Count);

w.Close();
}
public void Read(string filename)
{
Read(new EndianBinaryReader(filename, Endianness.Little));
}

public void Read(EndianBinaryReader r)
{
throw new NotImplementedException();
//INFO0Count = r.ReadInt64();
}
}
}
5 changes: 4 additions & 1 deletion MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using System.IO;
using System.Windows;
using Microsoft.Win32;

namespace FETHArchiveManager
Expand Down Expand Up @@ -30,7 +31,9 @@ private void SaveButtonINFO_Click(object sender, RoutedEventArgs e)
"FETH Patch Binary (INFO0.bin)|*.bin";
if(dialog.ShowDialog() == true)
{
INFO2 info2 = new INFO2(info0.Count);
info0.Write(dialog.FileName);
info2.Write(Path.GetDirectoryName(dialog.FileName) + "/INFO2.bin");
}
}

Expand Down

0 comments on commit 9c36f7f

Please sign in to comment.