1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-06 00:28:58 +00:00

Default to source bank in Format Address Table

When formatting a table of 16-bit addresses in 65816 code, the bank
byte was always being set to zero.  However, for "JMP (addr,X)", the
program bank is used.  We now default to that behavior.

The choice can be overridden as before (select 24-bit addresses with a
constant value for the bank byte).
This commit is contained in:
Andy McFadden 2020-07-16 13:26:13 -07:00
parent eecace8988
commit ad02494f0f

View File

@ -419,7 +419,17 @@ namespace SourceGen.WpfGui {
}
} else {
bankOff = -1; // use constant
bankConst = 0; // always bank 0
// Set the constant bank value equal to whichever bank the table lives in.
// This is correct for "JMP (addr,X)". We use the offset of the first item
// in the range set, which is a little awkward to get to.
int offset = 0;
foreach (TypedRangeSet.Tuple tup in mSelection) {
offset = tup.Value;
break;
}
int addr = mProject.AddrMap.OffsetToAddress(offset);
bankConst = (byte)(addr >> 16);
}
if (IsSplitTable) {