diff --git a/src/main/java/dk/camelot64/kickc/model/symbols/Scope.java b/src/main/java/dk/camelot64/kickc/model/symbols/Scope.java index a28b0d2a9..6b2e934aa 100644 --- a/src/main/java/dk/camelot64/kickc/model/symbols/Scope.java +++ b/src/main/java/dk/camelot64/kickc/model/symbols/Scope.java @@ -369,11 +369,11 @@ public abstract class Scope implements Symbol { if(symbol instanceof StructDefinition) continue; if(!onlyVars || symbol instanceof Procedure || symbol instanceof BlockScope || symbol instanceof ProgramScope) - res.append(((Scope) symbol).toStringVars(program, onlyVars, false)); + res.append(((Scope) symbol).toStringVars(program, onlyVars, onlyZP)); } else if(symbol instanceof Variable) { Variable symVar = (Variable) symbol; if(!onlyVars || symVar.isVariable()) { - if(!(onlyZP && symVar.getRegister() instanceof Registers.RegisterZpMem && symVar.getRegister().getType() == Registers.RegisterType.ZP_MEM)) continue; // Show only ZP vars + if(onlyZP && !(symVar.getMemoryArea() != null && symVar.getMemoryArea().equals(Variable.MemoryArea.ZEROPAGE_MEMORY) && symVar.getAllocation() != null)) continue; // Show only ZP vars // Output if not instructed to only output variables - or if it is a variable if(symVar.isKindLoadStore()) res.append("__loadstore "); if(symVar.isKindConstant()) res.append("__constant ");