Trying to add little endian support
Changed some lines, I expect bugs to happen, if people tested it (w/ SM3DAS files) to report them Commented some code
This commit is contained in:
@@ -245,6 +245,8 @@ namespace BMGEditor
|
|||||||
INF1itemNumber++;
|
INF1itemNumber++;
|
||||||
Entries.Add(newEntry);
|
Entries.Add(newEntry);
|
||||||
|
|
||||||
|
//Code to sort entries by alphabetical order and then reassign an ID
|
||||||
|
//Works perfectly but is unused right now because it breaks flows
|
||||||
/* Entries.Sort((x, y) =>
|
/* Entries.Sort((x, y) =>
|
||||||
{
|
{
|
||||||
string entryNameA = x.entryName, entryNameB = y.entryName;
|
string entryNameA = x.entryName, entryNameB = y.entryName;
|
||||||
@@ -272,8 +274,8 @@ namespace BMGEditor
|
|||||||
m_File.Writer.Write((Int32)m_FileType);
|
m_File.Writer.Write((Int32)m_FileType);
|
||||||
m_File.Writer.Write((UInt32)0x00); //Final fileSize will be written at the end
|
m_File.Writer.Write((UInt32)0x00); //Final fileSize will be written at the end
|
||||||
m_File.Writer.Write((UInt32)0x04); //Number of sections, always 4 in Super Mario Galaxy, this editor isn't meant to be used on anything else anyway.
|
m_File.Writer.Write((UInt32)0x04); //Number of sections, always 4 in Super Mario Galaxy, this editor isn't meant to be used on anything else anyway.
|
||||||
m_File.Writer.Write((Byte)0x02); //Encoding
|
m_File.Writer.Write((Byte)0x02); //Encoding: UTF-16
|
||||||
while (m_File.Stream.Position != 0x20) m_File.Writer.Write((Byte)0x00); // The 15 bytes of nothing
|
while (m_File.Stream.Position != 0x20) m_File.Writer.Write((Byte)0x00); // The 15 bytes of nothing/padding
|
||||||
|
|
||||||
//INF1 section
|
//INF1 section
|
||||||
Int64 INF1start = m_File.Stream.Position;
|
Int64 INF1start = m_File.Stream.Position;
|
||||||
|
|||||||
@@ -29,13 +29,6 @@ namespace BMGEditor
|
|||||||
return (Int32)((val >> 24) | ((val & 0xFF0000) >> 8) | ((val & 0xFF00) << 8) | (val << 24));
|
return (Int32)((val >> 24) | ((val & 0xFF0000) >> 8) | ((val & 0xFF00) << 8) | (val << 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public override long ReadInt64()
|
|
||||||
{
|
|
||||||
UInt64 val = base.ReadUInt64();
|
|
||||||
return (Int64)()
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
public override ushort ReadUInt16()
|
public override ushort ReadUInt16()
|
||||||
{
|
{
|
||||||
UInt16 val = base.ReadUInt16();
|
UInt16 val = base.ReadUInt16();
|
||||||
|
|||||||
@@ -68,8 +68,12 @@ namespace BMGEditor
|
|||||||
|
|
||||||
private void InitRW()
|
private void InitRW()
|
||||||
{
|
{
|
||||||
Reader = m_BigEndian ? new BinaryReaderBE(m_Stream, m_Encoding) : new BinaryReader(m_Stream, m_Encoding);
|
//Original code
|
||||||
Writer = m_BigEndian ? new BinaryWriterBE(m_Stream, m_Encoding) : new BinaryWriter(m_Stream, m_Encoding);
|
//Reader = m_BigEndian ? new BinaryReaderBE(m_Stream, m_Encoding) : new BinaryReader(m_Stream, m_Encoding);
|
||||||
|
//Writer = m_BigEndian ? new BinaryWriterBE(m_Stream, m_Encoding) : new BinaryWriter(m_Stream, m_Encoding);
|
||||||
|
|
||||||
|
Reader = Tests.isBE ? new BinaryReaderBE(m_Stream, m_Encoding) : new BinaryReader(m_Stream, m_Encoding);
|
||||||
|
Writer = Tests.isBE ? new BinaryWriterBE(m_Stream, m_Encoding) : new BinaryWriter(m_Stream, m_Encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,15 @@ namespace BMGEditor
|
|||||||
public static class Variables
|
public static class Variables
|
||||||
{
|
{
|
||||||
public const string softwareName = "Luma";
|
public const string softwareName = "Luma";
|
||||||
public const string softwareVersion = "v1.0";
|
public const string softwareVersion = "v1.1";
|
||||||
public const UInt64 build = 1;
|
public const UInt64 build = 2;
|
||||||
public const bool isBeta = false;
|
public const bool isBeta = true;
|
||||||
public const bool isBE = true;
|
}
|
||||||
|
|
||||||
|
public static class Tests
|
||||||
|
{
|
||||||
|
//Not a good place to put this I know but I'm trying to figure it out
|
||||||
|
public static bool isBE = true;
|
||||||
}
|
}
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
|
|||||||
15
BMGEditor/UI/BMGEditForm.Designer.cs
generated
15
BMGEditor/UI/BMGEditForm.Designer.cs
generated
@@ -43,6 +43,7 @@
|
|||||||
this.deleteEntryBtn = new System.Windows.Forms.ToolStripMenuItem();
|
this.deleteEntryBtn = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.entriesListBox = new System.Windows.Forms.ListBox();
|
this.entriesListBox = new System.Windows.Forms.ListBox();
|
||||||
this.openARCDialog = new System.Windows.Forms.OpenFileDialog();
|
this.openARCDialog = new System.Windows.Forms.OpenFileDialog();
|
||||||
|
this.toggleBEBtn = new System.Windows.Forms.ToolStripButton();
|
||||||
this.toolStrip.SuspendLayout();
|
this.toolStrip.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
@@ -52,7 +53,8 @@
|
|||||||
this.toolStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
this.toolStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||||
this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.fileMenu,
|
this.fileMenu,
|
||||||
this.editBtn});
|
this.editBtn,
|
||||||
|
this.toggleBEBtn});
|
||||||
this.toolStrip.Location = new System.Drawing.Point(0, 0);
|
this.toolStrip.Location = new System.Drawing.Point(0, 0);
|
||||||
this.toolStrip.Name = "toolStrip";
|
this.toolStrip.Name = "toolStrip";
|
||||||
this.toolStrip.Size = new System.Drawing.Size(700, 25);
|
this.toolStrip.Size = new System.Drawing.Size(700, 25);
|
||||||
@@ -177,6 +179,16 @@
|
|||||||
this.openARCDialog.Filter = "Nintendo ARC Files|*.arc";
|
this.openARCDialog.Filter = "Nintendo ARC Files|*.arc";
|
||||||
this.openARCDialog.Title = "Open ARC";
|
this.openARCDialog.Title = "Open ARC";
|
||||||
//
|
//
|
||||||
|
// toggleBEBtn
|
||||||
|
//
|
||||||
|
this.toggleBEBtn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||||
|
this.toggleBEBtn.Image = ((System.Drawing.Image)(resources.GetObject("toggleBEBtn.Image")));
|
||||||
|
this.toggleBEBtn.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||||
|
this.toggleBEBtn.Name = "toggleBEBtn";
|
||||||
|
this.toggleBEBtn.Size = new System.Drawing.Size(158, 22);
|
||||||
|
this.toggleBEBtn.Text = "toggle BE/LE (BE by default)";
|
||||||
|
this.toggleBEBtn.Click += new System.EventHandler(this.toggleBEBtn_Click);
|
||||||
|
//
|
||||||
// BMGEditForm
|
// BMGEditForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
@@ -213,5 +225,6 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem openBCSVBtn;
|
private System.Windows.Forms.ToolStripMenuItem openBCSVBtn;
|
||||||
private System.Windows.Forms.OpenFileDialog openARCDialog;
|
private System.Windows.Forms.OpenFileDialog openARCDialog;
|
||||||
private System.Windows.Forms.ToolStripMenuItem openFlowEditorBtn;
|
private System.Windows.Forms.ToolStripMenuItem openFlowEditorBtn;
|
||||||
|
private System.Windows.Forms.ToolStripButton toggleBEBtn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,5 +133,11 @@ namespace BMGEditor
|
|||||||
Form bcsvEdit = new BcsvEditorForm(m_ARC);
|
Form bcsvEdit = new BcsvEditorForm(m_ARC);
|
||||||
bcsvEdit.Show();
|
bcsvEdit.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void toggleBEBtn_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Tests.isBE = !Tests.isBE;
|
||||||
|
MessageBox.Show("Switched successfully");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,17 @@
|
|||||||
U87f4aUApcXhnrI9Jzg/laQKFntXlHM+lSQK5psL5fvbp/JvJLGCQqmSWM5JkiCT84igXGtSrruKLQ0T
|
U87f4aUApcXhnrI9Jzg/laQKFntXlHM+lSQK5psL5fvbp/JvJLGCQqmSWM5JkiCT84igXGtSrruKLQ0T
|
||||||
luAdmZxHBG37FFuWBC/j5XKOmX8WAH7rcI6ZMffPgjQwN2bXJgDo/COBTpjneQ2dML0PY3cISreGe8HM
|
luAdmZxHBG37FFuWBC/j5XKOmX8WAH7rcI6ZMffPgjQwN2bXJgDo/COBTpjneQ2dML0PY3cISreGe8HM
|
||||||
qgAAAABJRU5ErkJggg==
|
qgAAAABJRU5ErkJggg==
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
<data name="toggleBEBtn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||||
|
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhL3ZErDsJAGIR7DlA47oArV8CDR9RiSDAQPBcA
|
||||||
|
Qx1BgUMQBEk1ooJAKE0I4Wlqf5gmu1n6oqW7hiZfthkx33aqeZ5HKvEFpmmSYRhSQScXINB1XSroDAke
|
||||||
|
96cUpAmupyPZsx7Z8x4drAnPpQmsgU7LdoHDJNIEYjnAlyBXJ3jPhVyaYLca8nLMhX+CPJXAOT+ouTj5
|
||||||
|
p5in4asApdWpS8XRwT+zShIFG/fOyxlZJbGC9f5G5bHzUf6LJFJQqTViyxlxEmRiHhLUW10qDbeRpUGC
|
||||||
|
ErwjE/OQoG9dIsviYGWsXMwxc24BYLcO5pgZc+cWJIG5MbsyAUDnHwlUAkFHJZraR9NeMVq3zi+WF/0A
|
||||||
|
AAAASUVORK5CYII=
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<metadata name="openARCDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="openARCDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
|||||||
Reference in New Issue
Block a user