]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/crt0.s
Normalized style.
[cc65] / libsrc / atari / crt0.s
index 464557fa7dda7328af99964c40415fece6a2b3db..f1c7b864e8ffd1d10bd189863eed957650c032dd 100644 (file)
@@ -20,6 +20,7 @@
         .import         sram_init
         .import         scrdev
         .import         findfreeiocb
+        .forceimport    sramprep                        ; force inclusion of the "shadow RAM preparation" load chunk
         .include        "save_area.inc"
 .endif
 
@@ -52,7 +53,14 @@ start:
         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
 
@@ -71,13 +79,6 @@ start:
         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
@@ -99,8 +100,8 @@ start:
 
 ; 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