From 363af89fb7b2016a138bd0a8175d7cd349cdf819 Mon Sep 17 00:00:00 2001 From: Denis <93516910+Bussun@users.noreply.github.com> Date: Sat, 29 Jan 2022 00:05:53 +0100 Subject: [PATCH] Changed default endianness for faster tests It also is really weird since there are only a few bytes at the beginning of the file that are inverted --- BMGEditor/FS/Yaz0Stream.cs | 5 +++-- BMGEditor/Program.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BMGEditor/FS/Yaz0Stream.cs b/BMGEditor/FS/Yaz0Stream.cs index c62ad52..c70da17 100644 --- a/BMGEditor/FS/Yaz0Stream.cs +++ b/BMGEditor/FS/Yaz0Stream.cs @@ -108,7 +108,8 @@ namespace BMGEditor byte Byte2 = data[Read_Position + 1]; Read_Position += 2; - uint Dist = (uint)(((Byte1 & 0xF) << 8) | Byte2); + //uint Dist = (uint)(((Byte1 & 0xF) << 8) | Byte2); + uint Dist = (uint)(Byte2 | ((Byte1 & 0xF) << 8)); uint CopySource = (uint)(Write_Position - Dist - 1); uint Byte_Count = (uint)(Byte1 >> 4); @@ -119,7 +120,7 @@ namespace BMGEditor } else { - Byte_Count += 1; + Byte_Count += 2; } for (int i = 0; i < Byte_Count; ++i) diff --git a/BMGEditor/Program.cs b/BMGEditor/Program.cs index 79a131e..928f497 100644 --- a/BMGEditor/Program.cs +++ b/BMGEditor/Program.cs @@ -16,7 +16,7 @@ namespace BMGEditor 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; + public static bool isBE = false; } internal static class Program {