mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-05-25 06:49:03 -05:00
ldrh should compile correctly
This commit is contained in:
parent
ab1ace2535
commit
dbe054d090
|
|
@ -505,7 +505,7 @@ namespace HavenSoft.HexManiac.Core.Models.Code {
|
|||
// read a number
|
||||
if (template[0] == '#') {
|
||||
if (line[0] != '#') return false;
|
||||
if (!int.TryParse(line.Substring(1), out numeric)) return false;
|
||||
if (!int.TryParse(line.Split(',', ']')[0].Substring(1), out numeric)) return false;
|
||||
template = template.Substring(1);
|
||||
line = line.Substring(("#" + numeric).Length);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -390,6 +390,7 @@ namespace HavenSoft.HexManiac.Tests {
|
|||
[InlineData(".word <bob>", 0b0000_1000_0000_0000_0000_0000_1000_0000)] // test that we can use anchors to get pointer locations
|
||||
[InlineData("ldr r0, [pc, <bob>]", 0b01001_000_11011111)] // -33*4+4=-128
|
||||
[InlineData("ldrb r1, [r1, r2]", 0b0101110_010_001_001)]
|
||||
[InlineData("ldrh r2, [r1, #0]", 0b10001_00000_001010)]
|
||||
public void ThumbCompilerTests(string input, uint output) {
|
||||
var bytes = new List<byte> { (byte)output, (byte)(output >> 8) };
|
||||
var model = new PokemonModel(new byte[0x200]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user