.import sram_init
.import scrdev
.import findfreeiocb
+ .forceimport sramprep ; force inclusion of the "shadow RAM preparation" load chunk
.include "save_area.inc"
.endif
tsx
stx SP_save
-.ifndef __ATARIXL__
+.ifdef __ATARIXL__
+
+ lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+ sta sp
+ lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
+ sta sp+1
+
+.else
; Report memory usage
sta APPMHI+1
sta sp+1 ; setup runtime stack part 2
-.else
-
- lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
- sta sp
- lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
- sta sp+1
-
.endif
; Call module constructors
; Initialize conio stuff
- dey ; Set X to $FF
- sty CH
+ dey ; Set Y to $FF
+ sty CH ; remove keypress which might be in the input buffer
; Push arguments and call main