From b6da614b95dbb4e02340bb2780005ea8d8dae126 Mon Sep 17 00:00:00 2001 From: Benjamin Popp Date: Sat, 27 Jul 2019 22:15:36 -0500 Subject: [PATCH] lsl should select the correct version --- src/HexManiac.Core/Models/Code/ThumbParser.cs | 3 ++- src/HexManiac.Tests/ToolTests.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/HexManiac.Core/Models/Code/ThumbParser.cs b/src/HexManiac.Core/Models/Code/ThumbParser.cs index c096a08b..bfef190b 100644 --- a/src/HexManiac.Core/Models/Code/ThumbParser.cs +++ b/src/HexManiac.Core/Models/Code/ThumbParser.cs @@ -533,7 +533,8 @@ namespace HavenSoft.HexManiac.Core.Models.Code { return false; } - return true; + // Completed parsing the line. Should've used the entire template. + return template.Length == 0; } private static ushort ParseList(string list) { diff --git a/src/HexManiac.Tests/ToolTests.cs b/src/HexManiac.Tests/ToolTests.cs index 58355bf4..87e21102 100644 --- a/src/HexManiac.Tests/ToolTests.cs +++ b/src/HexManiac.Tests/ToolTests.cs @@ -391,6 +391,7 @@ namespace HavenSoft.HexManiac.Tests { [InlineData("ldr r0, [pc, ]", 0b01001_000_11011111)] // -33*4+4=-128 [InlineData("ldrb r1, [r1, r2]", 0b0101110_010_001_001)] [InlineData("ldrh r2, [r1, #0]", 0b10001_00000_001010)] + [InlineData("lsl r1, r2", 0b0100000010_010_001)] public void ThumbCompilerTests(string input, uint output) { var bytes = new List { (byte)output, (byte)(output >> 8) }; var model = new PokemonModel(new byte[0x200]);