2 ; Atari XL startup system check
4 ; This routine gets loaded prior to the main part of the executable
5 ; and checks if the system is compatible to run the program.
6 ; It checks whether the system is an XL type one and that enough
7 ; memory is installed (which isn't the case for a 600XL).
8 ; If the system doesn't qualify, the loading of the main program
9 ; is aborted by jumping to DOSVEC.
11 ; Christian Groessler, chris@groessler.org, 2013
19 .import __SYSCHK_LOAD__
20 .import __STARTADDRESS__ ; needed by xlmemchk.inc
22 .include "zeropage.inc"
26 .macro print_string text
29 start: .byte text, ATEOL
30 cont: ldx #0 ; channel 0
43 .macro print_string2 addr, len
61 ; ------------------------------------------------------------------------
69 ; ------------------------------------------------------------------------
75 no_xl: print_string "This program needs an XL machine."
80 lda $fcd8 ; from ostype.s
84 ; we have an XL machine, now check memory
90 print_string "Not enough memory."
96 .include "xlmemchk.inc" ; calculate lowest address we will use when we move the screen buffer down
105 ; load address was too low
106 print_string2 lmemerr_txt, lmemerr_txt_len
107 jsr delay ; long text takes longer to read, give user additional time
110 ; all is well(tm), launch the application
113 print_string "Stage #1 OK"
120 .byte "Not enough memory to move screen", ATEOL
121 .byte "memory to low memory. Consider using", ATEOL
122 .byte "a higher load address.", ATEOL
123 lmemerr_txt_len = * - lmemerr_txt
148 ; ------------------------------------------------------------------------
149 ; Chunk "trailer" - sets INITAD
157 .endif ; .ifdef __ATARIXL__