]> git.sur5r.net Git - cc65/commitdiff
Some small first changes for the 'atarixl' target.
authorChristian Groessler <chris@groessler.org>
Thu, 30 May 2013 00:30:19 +0000 (02:30 +0200)
committerChristian Groessler <chris@groessler.org>
Thu, 30 May 2013 00:30:19 +0000 (02:30 +0200)
libsrc/atari/crt0.s
libsrc/atari/ostype.s

index f007e64ad9b3dfdf70f0c28f1fbae1ce24fd7aa4..dfaa626fa80b4ad0636c168a312f4573e6696803 100644 (file)
@@ -18,6 +18,7 @@
 
         .include        "zeropage.inc"
         .include        "atari.inc"
+       .include        "save_area.inc"
 
 ; ------------------------------------------------------------------------
 ; EXE header
 .segment        "EXEHDR"
 
         .word   $FFFF
+
+.if .defined(__ATARIXL__)
+.segment       "MAINHDR"
+.endif
+
         .word   __STARTUP_LOAD__
         .word   __ZPSAVE_LOAD__ - 1
 
@@ -57,6 +63,8 @@ L1:     lda     sp,x
         tsx
         stx     spsave
 
+.if .not .defined(__ATARIXL__)
+
 ; Report memory usage
 
         lda     APPMHI
@@ -74,6 +82,16 @@ L1:     lda     sp,x
         sta     APPMHI+1
         sta     sp+1                    ; setup runtime stack part 2
 
+.else
+
+       ; for now... needs to use value from linker script later
+        lda     MEMTOP
+        sta     sp
+        lda     MEMTOP+1
+        sta     sp+1
+
+.endif
+
 ; Call module constructors
 
         jsr     initlib
@@ -119,6 +137,8 @@ _exit:  jsr     donelib         ; Run module destructors
         lda     old_shflok
         sta     SHFLOK
 
+.if .not .defined(__ATARIXL__)
+
 ; Restore APPMHI
 
         lda     appmsav
@@ -126,6 +146,23 @@ _exit:  jsr     donelib         ; Run module destructors
         lda     appmsav+1
         sta     APPMHI+1
 
+.else
+
+; Atari XL target stuff...
+
+       lda     PORTB_save
+       sta     PORTB
+       lda     MEMTOP_save
+       sta     MEMTOP
+       lda     MEMTOP_save+1
+       sta     MEMTOP+1
+       lda     APPMHI_save
+       sta     APPMHI
+       lda     APPMHI_save+1
+       sta     APPMHI+1
+.endif
+
+
 ; Copy back the zero page stuff
 
         ldx     #zpspace-1
index d93b3ab88b8456e6787056bd77e3941bf85b451d..dc17018fae2ecc06ed8864b015370858987b25fa 100644 (file)
 
         .export         _get_ostype
 
+.if .defined(__ATARIXL__)
+.warning "fix me!"
+.endif
+
 .proc   _get_ostype
 
         lda     $fcd8