1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-07-28 17:24:32 +00:00

Add offset to PlSymbol

It's useful for extension scripts to be able to get the file offset
of symbols in non-addressable regions.  One example of this is CHR
ROM data for an NES cartridge.  However, we were getting the offset
by doing an address-to-offset mapping on the plugin side, which by
definition doesn't work for non-addressable memory.

So we now add the offset to PlSymbol objects for user labels and
address region pre-labels.  The NES visualizer has been updated to
use the new field.

Also, fixed a bogus complaint about bank overruns for non-addressable
regions.
This commit is contained in:
Andy McFadden
2021-10-23 21:26:25 -07:00
parent 1258dd89cb
commit 6e9ff395d2
6 changed files with 103 additions and 47 deletions

View File

@@ -3177,7 +3177,7 @@ namespace SourceGen {
public void GoToLabel(Symbol sym) {
int offset = mProject.FindLabelOffsetByName(sym.Label);
if (offset >= 0) {
// TODO(someday): jump to correct line for address region pre-labels
// TODO(someday): jump to symbol line, not arstart, for address region pre-labels
GoToLocation(new NavStack.Location(offset, 0, NavStack.GoToMode.JumpToCodeData),
true);
} else {