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
16 .if .defined(__ATARIXL__)
19 .import __SYSCHK_LOAD__
20 .import __SAVEAREA_LOAD__
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 lda $fcd8 ; from ostype.s
80 print_string "This program needs an XL machine."
83 ; we have an XL machine, now check memory
89 print_string "Not enough memory."
95 .include "xlmemchk.inc" ; calculate lowest address we will use when we move the screen buffer down
104 ; load address was too low
105 print_string2 lmemerr_txt, lmemerr_txt_len
106 jsr delay ; long text takes longer to read, give user additional time
109 ; all is well(tm), launch the application
112 print_string "Stage #1 OK"
119 .byte "Not enough memory to move screen", ATEOL
120 .byte "memory to low memory. Consider using", ATEOL
121 .byte "a higher load address.", ATEOL
122 lmemerr_txt_len = * - lmemerr_txt
145 ; ------------------------------------------------------------------------
146 ; Chunk "trailer" - sets INITAD
151 .word __SYSCHK_LOAD__
153 .endif ; .if .defined(__ATARIXL__)