From: Christian Groessler Date: Thu, 30 May 2013 00:30:19 +0000 (+0200) Subject: Some small first changes for the 'atarixl' target. X-Git-Tag: V2.15~223^2~121 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=06f441e90ffb96afea13d4b92e2ff371c6e3ece8;p=cc65 Some small first changes for the 'atarixl' target. --- diff --git a/libsrc/atari/crt0.s b/libsrc/atari/crt0.s index f007e64ad..dfaa626fa 100644 --- a/libsrc/atari/crt0.s +++ b/libsrc/atari/crt0.s @@ -18,6 +18,7 @@ .include "zeropage.inc" .include "atari.inc" + .include "save_area.inc" ; ------------------------------------------------------------------------ ; EXE header @@ -25,6 +26,11 @@ .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 diff --git a/libsrc/atari/ostype.s b/libsrc/atari/ostype.s index d93b3ab88..dc17018fa 100644 --- a/libsrc/atari/ostype.s +++ b/libsrc/atari/ostype.s @@ -40,6 +40,10 @@ .export _get_ostype +.if .defined(__ATARIXL__) +.warning "fix me!" +.endif + .proc _get_ostype lda $fcd8