mirror of
https://github.com/fadden/6502bench.git
synced 2025-04-05 01:30:10 +00:00
Don't do nearby SYM-1 for zero-page values
It's pretty common for code to access BUFFER-1,X, but it's rare for the buffer to live on zero page memory. More often than not we're auto-formatting zero-page operands with a nearby symbol when they're just simple variables. It's more confusing than useful, so we don't do that anymore.
This commit is contained in:
parent
ac30512ed3
commit
bef664ae7e
@ -1343,7 +1343,12 @@ namespace SourceGen {
|
||||
// when addr is the very start of a segment, which means we're actually
|
||||
// finding a label reference rather than project/platform symbol; only
|
||||
// works if the location already has a label.
|
||||
if (sym == null && (address & 0xffff) < 0xffff && checkNearby) {
|
||||
//
|
||||
// Don't do this for zero-page locations, because those are usually
|
||||
// individual variables that aren't accessed via addr-1. There are
|
||||
// exceptions, but more often than not it's just distracting.
|
||||
if (sym == null && checkNearby && (address & 0xffff) < 0xffff &&
|
||||
address > 0x0000ff) {
|
||||
sym = SymbolTable.FindNonVariableByAddress(address + 1, accType);
|
||||
if (sym != null && sym.SymbolSource != Symbol.Source.Project &&
|
||||
sym.SymbolSource != Symbol.Source.Platform) {
|
||||
|
@ -102,7 +102,7 @@ L1000 lda CodeWrap+255
|
||||
nop
|
||||
LocalVar .var $41
|
||||
ldx $3e
|
||||
ldx OverVar-1
|
||||
ldx $3f
|
||||
ldx OverVar
|
||||
ldx LocalVar
|
||||
ldx LocalVar+1
|
||||
|
@ -101,7 +101,7 @@ L1000 lda CodeWrap+255
|
||||
nop
|
||||
]LocalVar equ $41
|
||||
ldx $3e
|
||||
ldx OverVar-1
|
||||
ldx $3f
|
||||
ldx OverVar
|
||||
ldx ]LocalVar
|
||||
ldx ]LocalVar+1
|
||||
|
@ -103,7 +103,7 @@ L1000 lda CodeWrap+255
|
||||
!zone Z0000c0
|
||||
.LocalVar = $41
|
||||
ldx $3e
|
||||
ldx OverVar-1
|
||||
ldx $3f
|
||||
ldx OverVar
|
||||
ldx .LocalVar
|
||||
ldx .LocalVar+1
|
||||
|
@ -103,7 +103,7 @@ L1000: lda CodeWrap+255
|
||||
nop
|
||||
LocalVar .set $41
|
||||
ldx $3e
|
||||
ldx OverVar-1
|
||||
ldx $3f
|
||||
ldx OverVar
|
||||
ldx LocalVar
|
||||
ldx LocalVar+1
|
||||
|
Loading…
x
Reference in New Issue
Block a user