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."
93 lowadr: .res 2 ; lowest address we need in order to move screen memory down, depending on start address of program
96 ; system is basically supported, check if there is enough space btw. MEMLO and our start address
97 ; to move screen memory there
99 CMPVAL = 64+255+992 ; you may ask, why these values... @@@ document
101 sys_ok: lda #<__SAVEAREA_LOAD__
105 lda #>__SAVEAREA_LOAD__
116 ; load address was too low
117 print_string2 lmemerr_txt, lmemerr_txt_len
118 jsr delay ; long text takes longer to read, give user additional time
121 ; all is well(tm), launch the application
124 print_string "Stage #1 OK"
131 .byte "Not enough memory to move screen", ATEOL
132 .byte "memory to low memory. Consider using", ATEOL
133 .byte "a higher load address.", ATEOL
134 lmemerr_txt_len = * - lmemerr_txt
157 ; ------------------------------------------------------------------------
158 ; Chunk "trailer" - sets INITAD
163 .word __SYSCHK_LOAD__
165 .endif ; .if .defined(__ATARIXL__)