As about the "known bugs": the behaviour is also fixed when one starts the program with the following command:

X /C AAC

The /C parameter clears out the memory from MEMLO to MEMTOP. So it seems that the problem is related to the contents of the memory as left after a program is used. Of course, Sparta Commander, when loaded, occupies about 12k over the MEMLO, so it leaves a lot of "random" (from the point of view of the AAC) values in the area the AAC is loaded to. Therefore it is easily visible that the AAC has a problem running after the Sparta Commander was used.

But in fact, this symptom means that there is an uninitialized variable inside the AAC binary, which gets a proper initial value when the program is loaded to an area of zeroed RAM. This may be a bug in the program itself, or in a library, or in the compiler. It certainly can be traced down with a debugger, and the case looks pretty simple: even AAC /H does not work, so the problem is probably related to the command line parser.

I haven't found a garbage in variable situation yet. I did run this through Altirra's debugger though (after loading symbol names).

Here is the 1st run that works:

(1210: 0, 0) C=FF00 X=00 Y=00 S=EF P=B0 (N ) 00:B937: AD FC 02 LDA CH [$00:02FC] = $FF
Altirra> yr aac.sym
118 symbol(s) loaded.
Altirra> bp main
Breakpoint 0 set at $370A.
Altirra> g
Breakpoint 0 hit
(1424:193,109) C=FF00 X=03 Y=00 S=F2 P=B3 (N ZC) 00:370A: 4C 0D 37 main JMP $370D [$00:370D] = $20
(1424:193,110) C=FF00 X=03 Y=00 S=F2 P=B3 (N ZC) 00:370D: 20 63 33 JSR title [$00:3363] = $4C
(1424:193,110) C=FF00 X=03 Y=00 S=F0 P=B3 (N ZC) 00:3363: 4C 66 33 title JMP $3366 [$00:3366] = $20
(1424:193,110) C=FF00 X=03 Y=00 S=F0 P=B3 (N ZC) 00:3366: 20 AF 28 JSR PutE [$00:28AF] = $A9
(1424:203, 22) C=FF9B X=00 Y=01 S=F0 P=31 ( C) 00:3369: 4C 86 33 JMP $3386 [$00:3386] = $A2
(1424:203, 23) C=FF9B X=00 Y=01 S=F0 P=31 ( C) 00:3386: A2 33 LDX #$33
(1424:203, 23) C=FF9B X=33 Y=01 S=F0 P=31 ( C) 00:3388: A9 6C LDA #$6C
(1424:203, 23) C=FF6C X=33 Y=01 S=F0 P=31 ( C) 00:338A: 20 3B 28 JSR PrintE [$00:283B] = $86
(1425: 34, 82) C=FF65 X=00 Y=01 S=F0 P=31 ( C) 00:338D: 60 RTS
(1425: 34, 82) C=FF65 X=00 Y=01 S=F2 P=31 ( C) 00:3710: 20 D8 30 JSR sdxLibIn [$00:30D8] = $4C
(1425: 34, 90) C=FF01 X=00 Y=00 S=F2 P=30 ( ) 00:3713: A5 A0 LDA $A0 [$00:00A0] = $01
(1425: 34, 90) C=FF01 X=00 Y=00 S=F2 P=30 ( ) 00:3715: F0 03 BEQ $371A
(1425: 34, 90) C=FF01 X=00 Y=00 S=F2 P=30 ( ) 00:3717: 4C 52 37 JMP $3752 [$00:3752] = $A9
(1425: 34, 90) C=FF01 X=00 Y=00 S=F2 P=30 ( ) 00:3752: A9 01 LDA #$01
(1425: 34, 90) C=FF01 X=00 Y=00 S=F2 P=30 ( ) 00:3754: 20 48 28 JSR Close [$00:2848] = $20
(1425: 40, 1) C=FF00 X=10 Y=01 S=F2 P=31 ( C) 00:3757: A9 02 LDA #$02
(1425: 40, 1) C=FF02 X=10 Y=01 S=F2 P=31 ( C) 00:3759: 20 48 28 JSR Close [$00:2848] = $20
(1425: 45, 25) C=FF00 X=20 Y=01 S=F2 P=31 ( C) 00:375C: A0 00 LDY #$00
(1425: 45, 25) C=FF00 X=20 Y=00 S=F2 P=33 ( ZC) 00:375E: 8C 09 37 STY $3709 [$00:3709]
(1425: 45, 26) C=FF00 X=20 Y=00 S=F2 P=33 ( ZC) 00:3761: AD 94 26 LDA $2694 [$00:2694] = $26
(1425: 45, 26) C=FF26 X=20 Y=00 S=F2 P=31 ( C) 00:3764: 8D 16 31 STA $3116 [$00:3116]
(1425: 45, 26) C=FF26 X=20 Y=00 S=F2 P=31 ( C) 00:3767: AD 93 26 LDA $2693 [$00:2693] = $95
(1425: 45, 27) C=FF95 X=20 Y=00 S=F2 P=B1 (N C) 00:376A: 8D 15 31 STA tE [$00:3115]
(1425: 45, 27) C=FF95 X=20 Y=00 S=F2 P=B1 (N C) 00:376D: AD 47 36 LDA $3647 [$00:3647] = $36
(1425: 45, 27) C=FF36 X=20 Y=00 S=F2 P=31 ( C) 00:3770: 8D 94 26 STA $2694 [$00:2694]
(1425: 45, 28) C=FF36 X=20 Y=00 S=F2 P=31 ( C) 00:3773: AD 46 36 LDA $3646 [$00:3646] = $48
(1425: 45, 28) C=FF48 X=20 Y=00 S=F2 P=31 ( C) 00:3776: 8D 93 26 STA $2693 [$00:2693]
(1425: 45, 28) C=FF48 X=20 Y=00 S=F2 P=31 ( C) 00:3779: 20 CD 2D JSR nParms [$00:2DCD] = $4C
(1425: 46, 19) C=FF00 X=20 Y=00 S=F2 P=33 ( ZC) 00:377C: A5 A0 LDA $A0 [$00:00A0] = $00
(1425: 46, 20) C=FF00 X=20 Y=00 S=F2 P=33 ( ZC) 00:377E: F0 03 BEQ $3783
(1425: 46, 20) C=FF00 X=20 Y=00 S=F2 P=33 ( ZC) 00:3783: 20 8E 33 L3783 JSR info [$00:338E] = $4C
(1432:105, 94) C=FFFF X=FF Y=01 S=FF P=B1 (N C) 00:A1D9: E8 INX
(1432:105, 96) C=FFFF X=00 Y=01 S=FF P=33 ( ZC) 00:A1DA: 8E 0E D4 STX NMIEN [$00:D40E]
(1432:105,100) C=FFFF X=00 Y=01 S=FF P=33 ( ZC) 00:A1DD: 78 SEI
(1432:105,102) C=FFFF X=00 Y=01 S=FF P=37 ( IZC) 00:A1DE: AD 01 D3 LDA PORTB [$00:D301] = $FF
(1432:105,106) C=FFFF X=00 Y=01 S=FF P=B5 (N I C) 00:A1E1: 48 PHA
(1432:105,108) C=FFFF X=00 Y=01 S=FE P=B5 (N I C) 00:A1E2: 29 FE AND #$FE
(1432:105,111) C=FFFE X=00 Y=01 S=FE P=B5 (N I C) 00:A1E4: 8D 01 D3 STA PORTB [$00:D301]
(1432:106, 1) C=FFFE X=00 Y=01 S=FE P=B5 (N I C) 00:A1E7: A9 DB LDA #$DB
(1432:106, 3) C=FFDB X=00 Y=01 S=FE P=B5 (N I C) 00:A1E9: 8D FA FF STA $FFFA [$00:FFFA]
(1432:106, 6) C=FFDB X=00 Y=01 S=FE P=B5 (N I C) 00:A1EC: A9 09 LDA #$09
(1432:106, 9) C=FF09 X=00 Y=01 S=FE P=35 ( I C) 00:A1EE: 8D FB FF STA $FFFB [$00:FFFB]
(1432:106, 12) C=FF09 X=00 Y=01 S=FE P=35 ( I C) 00:A1F1: A9 DD LDA #$DD
(1432:106, 15) C=FFDD X=00 Y=01 S=FE P=B5 (N I C) 00:A1F3: 8D FE FF STA $FFFE [$00:FFFE]
(1432:106, 18) C=FFDD X=00 Y=01 S=FE P=B5 (N I C) 00:A1F6: A9 09 LDA #$09
(1432:106, 21) C=FF09 X=00 Y=01 S=FE P=35 ( I C) 00:A1F8: 8D FF FF STA $FFFF [$00:FFFF]
(1432:106, 24) C=FF09 X=00 Y=01 S=FE P=35 ( I C) 00:A1FB: 68 PLA
(1432:106, 31) C=FFFF X=00 Y=01 S=FF P=B5 (N I C) 00:A1FC: 8D 01 D3 STA PORTB [$00:D301]
(1432:106, 36) C=FFFF X=00 Y=01 S=FF P=B5 (N I C) 00:A1FF: 58 LA1FF CLI
(1432:106, 39) C=FFFF X=00 Y=01 S=FF P=B1 (N C) 00:A200: A9 40 LDA #$40
(1432:106, 41) C=FF40 X=00 Y=01 S=FF P=31 ( C) 00:A202: 8D 0E D4 STA NMIEN [$00:D40E]
(1432:106, 47) C=FF40 X=00 Y=01 S=FF P=31 ( C) 00:A205: 8E 1D 0D STX $0D1D [$00:0D1D]
(1432:106, 51) C=FF40 X=00 Y=01 S=FF P=31 ( C) 00:A208: 86 0E STX APPMHI [$00:000E]
(1432:106, 55) C=FF40 X=00 Y=01 S=FF P=31 ( C) 00:A20A: 86 0F STX APPMHI+1 [$00:000F]
(1432:106, 59) C=FF40 X=00 Y=01 S=FF P=31 ( C) 00:A20C: E8 INX
(1432:106, 62) C=FF40 X=01 Y=01 S=FF P=31 ( C) 00:A20D: 8E E5 0C STX $0CE5 [$00:0CE5]
(1432:106, 65) C=FF40 X=01 Y=01 S=FF P=31 ( C) 00:A210: 20 C5 A2 JSR $A2C5 [$00:A2C5] = $20
(1432:109, 60) C=FF12 X=12 Y=01 S=FF P=30 ( ) 00:A213: CE E5 0C DEC $0CE5 [$00:0CE5] = $01
(1432:109, 65) C=FF12 X=12 Y=01 S=FF P=32 ( Z ) 00:A216: 20 27 A2 JSR $A227 [$00:A227] = $A2
(1432:110, 29) C=FF01 X=FF Y=01 S=FF P=B0 (N ) 00:A219: 20 BD A1 JSR $A1BD [$00:A1BD] = $A9
(1432:110, 52) C=FF00 X=FF Y=01 S=FF P=32 ( Z ) 00:A21C: 20 AE AD JSR $ADAE [$00:ADAE] = $20
(1432:153, 53) C=FF31 X=00 Y=FF S=FF P=F1 (NV C) 00:A21F: A9 02 LDA #$02
(1432:153, 56) C=FF02 X=00 Y=FF S=FF P=71 ( V C) 00:A221: 20 4F A2 JSR $A24F [$00:A24F] = $8D

And here is a run after using SC that doesn't work. Notice it never makes it back from the *title* routine:

(646: 0, 0) C=FF00 X=00 Y=00 S=EF P=B0 (N ) 00:B935: F0 19 BEQ $B950
Altirra> yr aac.sym
118 symbol(s) loaded.
Altirra> bp main
Breakpoint 0 set at $370A.
Altirra> g
Breakpoint 0 hit
(1231:193,109) C=FF00 X=03 Y=00 S=F2 P=B3 (N ZC) 00:370A: 4C 0D 37 main JMP $370D [$00:370D] = $20
(1231:193,110) C=FF00 X=03 Y=00 S=F2 P=B3 (N ZC) 00:370D: 20 63 33 JSR title [$00:3363] = $4C
(1231:193,110) C=FF00 X=03 Y=00 S=F0 P=B3 (N ZC) 00:3363: 4C 66 33 title JMP $3366 [$00:3366] = $20
(1231:193,110) C=FF00 X=03 Y=00 S=F0 P=B3 (N ZC) 00:3366: 20 AF 28 JSR PutE [$00:28AF] = $A9
(1231:199, 3) C=FFFF X=FF Y=87 S=FF P=B1 (N C) 00:A1D9: E8 INX
(1231:199, 5) C=FFFF X=00 Y=87 S=FF P=33 ( ZC) 00:A1DA: 8E 0E D4 STX NMIEN [$00:D40E]
(1231:199, 9) C=FFFF X=00 Y=87 S=FF P=33 ( ZC) 00:A1DD: 78 SEI
(1231:199, 11) C=FFFF X=00 Y=87 S=FF P=37 ( IZC) 00:A1DE: AD 01 D3 LDA PORTB [$00:D301] = $FF
(1231:199, 15) C=FFFF X=00 Y=87 S=FF P=B5 (N I C) 00:A1E1: 48 LA1E1 PHA
(1231:199, 17) C=FFFF X=00 Y=87 S=FE P=B5 (N I C) 00:A1E2: 29 FE AND #$FE
(1231:199, 20) C=FFFE X=00 Y=87 S=FE P=B5 (N I C) 00:A1E4: 8D 01 D3 STA PORTB [$00:D301]
(1231:199, 24) C=FFFE X=00 Y=87 S=FE P=B5 (N I C) 00:A1E7: A9 DB LDA #$DB
(1231:199, 27) C=FFDB X=00 Y=87 S=FE P=B5 (N I C) 00:A1E9: 8D FA FF STA $FFFA [$00:FFFA]
(1231:199, 31) C=FFDB X=00 Y=87 S=FE P=B5 (N I C) 00:A1EC: A9 09 LDA #$09
(1231:199, 35) C=FF09 X=00 Y=87 S=FE P=35 ( I C) 00:A1EE: 8D FB FF STA $FFFB [$00:FFFB]
(1231:199, 39) C=FF09 X=00 Y=87 S=FE P=35 ( I C) 00:A1F1: A9 DD LDA #$DD
(1231:199, 43) C=FFDD X=00 Y=87 S=FE P=B5 (N I C) 00:A1F3: 8D FE FF STA $FFFE [$00:FFFE]
(1231:199, 47) C=FFDD X=00 Y=87 S=FE P=B5 (N I C) 00:A1F6: A9 09 LDA #$09
(1231:199, 51) C=FF09 X=00 Y=87 S=FE P=35 ( I C) 00:A1F8: 8D FF FF STA $FFFF [$00:FFFF]
(1231:199, 55) C=FF09 X=00 Y=87 S=FE P=35 ( I C) 00:A1FB: 68 PLA
(1231:199, 60) C=FFFF X=00 Y=87 S=FF P=B5 (N I C) 00:A1FC: 8D 01 D3 STA PORTB [$00:D301]
(1231:199, 64) C=FFFF X=00 Y=87 S=FF P=B5 (N I C) 00:A1FF: 58 LA1FF CLI
(1231:199, 66) C=FFFF X=00 Y=87 S=FF P=B1 (N C) 00:A200: A9 40 LDA #$40
(1231:199, 68) C=FF40 X=00 Y=87 S=FF P=31 ( C) 00:A202: 8D 0E D4 STA NMIEN [$00:D40E]
(1231:199, 72) C=FF40 X=00 Y=87 S=FF P=31 ( C) 00:A205: 8E 1D 0D STX $0D1D [$00:0D1D]
(1231:199, 75) C=FF40 X=00 Y=87 S=FF P=31 ( C) 00:A208: 86 0E STX APPMHI [$00:000E]
(1231:199, 78) C=FF40 X=00 Y=87 S=FF P=31 ( C) 00:A20A: 86 0F STX APPMHI+1 [$00:000F]
(1231:199, 81) C=FF40 X=00 Y=87 S=FF P=31 ( C) 00:A20C: E8 INX
(1231:199, 84) C=FF40 X=01 Y=87 S=FF P=31 ( C) 00:A20D: 8E E5 0C STX $0CE5 [$00:0CE5]
(1231:199, 87) C=FF40 X=01 Y=87 S=FF P=31 ( C) 00:A210: 20 C5 A2 JSR $A2C5 [$00:A2C5] = $20
(1231:202, 88) C=FF12 X=12 Y=01 S=FF P=30 ( ) 00:A213: CE E5 0C DEC $0CE5 [$00:0CE5] = $01
(1231:202, 93) C=FF12 X=12 Y=01 S=FF P=32 ( Z ) 00:A216: 20 27 A2 JSR $A227 [$00:A227] = $A2
(1231:203, 64) C=FF01 X=FF Y=01 S=FF P=B0 (N ) 00:A219: 20 BD A1 JSR $A1BD [$00:A1BD] = $A9
(1231:203, 84) C=FF00 X=FF Y=01 S=FF P=32 ( Z ) 00:A21C: 20 AE AD JSR $ADAE [$00:ADAE] = $20
(1231:246, 67) C=FF31 X=00 Y=FF S=FF P=F1 (NV C) 00:A21F: A9 02 LDA #$02
(1231:246, 69) C=FF02 X=00 Y=FF S=FF P=71 ( V C) 00:A221: 20 4F A2 JSR $A24F [$00:A24F] = $8D