Align string tables to 4 bytes
This commit is contained in:
parent
90fa5d4748
commit
cb0182f324
|
@ -44,5 +44,11 @@ namespace ScriptTool
|
|||
int value = rom[address] | (rom[address + 1] << 8);
|
||||
return value;
|
||||
}
|
||||
|
||||
public static int AlignTo(this int address, int alignBytes)
|
||||
{
|
||||
int mask = alignBytes - 1;
|
||||
return ((address - 1) & ~mask) + alignBytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -543,6 +543,9 @@ namespace ScriptTool
|
|||
|
||||
static IList<int> CompileM12FixedStringCollection(string name, ref int referenceAddress)
|
||||
{
|
||||
// Align to 4 bytes
|
||||
referenceAddress = referenceAddress.AlignTo(4);
|
||||
|
||||
int baseAddress = referenceAddress;
|
||||
var buffer = new List<byte>();
|
||||
var newPointers = new List<int>();
|
||||
|
|
Loading…
Reference in New Issue