Assembler question, if i may:
Source code line 283 has this instruction:
bit #$80
In the .prg file this is translated as opcode $89, which is illegal opcode NOP imm.
How is that working?
Especially since XA says: "undocumented opcodes are intentionally not supported."
And when i compile your source code, the generated code is partly at different locations. Weird.