This commit is contained in:
Christian Groessler
2013-09-27 22:01:54 +02:00
parent c88e0818b4
commit 39a98f250b
10 changed files with 809 additions and 809 deletions

View File

@@ -11,11 +11,11 @@
; Christian Groessler, chris@groessler.org, 2013
;
DEBUG = 1
DEBUG = 1
.ifdef __ATARIXL__
.export syschk
.export syschk
.import __SYSCHK_LOAD__
.import __STARTADDRESS__ ; needed by xlmemchk.inc
@@ -24,36 +24,36 @@ DEBUG = 1
.macro print_string text
.local start, cont
jmp cont
start: .byte text, ATEOL
cont: ldx #0 ; channel 0
lda #<start
sta ICBAL,x ; address
lda #>start
sta ICBAH,x
lda #<(cont - start)
sta ICBLL,x ; length
lda #>(cont - start)
sta ICBLH,x
lda #PUTCHR
sta ICCOM,x
jsr CIOV_org
.local start, cont
jmp cont
start: .byte text, ATEOL
cont: ldx #0 ; channel 0
lda #<start
sta ICBAL,x ; address
lda #>start
sta ICBAH,x
lda #<(cont - start)
sta ICBLL,x ; length
lda #>(cont - start)
sta ICBLH,x
lda #PUTCHR
sta ICCOM,x
jsr CIOV_org
.endmacro
.macro print_string2 addr, len
ldx #0 ; channel 0
lda #<addr
sta ICBAL,x ; address
lda #>addr
sta ICBAH,x
lda #<len
sta ICBLL,x ; length
lda #>len
sta ICBLH,x
lda #PUTCHR
sta ICCOM,x
jsr CIOV_org
ldx #0 ; channel 0
lda #<addr
sta ICBAL,x ; address
lda #>addr
sta ICBAH,x
lda #<len
sta ICBLL,x ; length
lda #>len
sta ICBLH,x
lda #PUTCHR
sta ICCOM,x
jsr CIOV_org
.endmacro
@@ -72,74 +72,74 @@ cont: ldx #0 ; channel 0
.segment "SYSCHK"
; no XL machine
no_xl: print_string "This program needs an XL machine."
jmp fail
no_xl: print_string "This program needs an XL machine."
jmp fail
; entry point
syschk:
lda $fcd8 ; from ostype.s
lda $fcd8 ; from ostype.s
cmp #$a2
beq no_xl
; we have an XL machine, now check memory
lda RAMSIZ
cmp #$80
bcs sys_ok
lda RAMSIZ
cmp #$80
bcs sys_ok
; not enough memory
print_string "Not enough memory."
fail: jsr delay
jmp (DOSVEC)
print_string "Not enough memory."
fail: jsr delay
jmp (DOSVEC)
sys_ok:
.include "xlmemchk.inc" ; calculate lowest address we will use when we move the screen buffer down
.include "xlmemchk.inc" ; calculate lowest address we will use when we move the screen buffer down
sec
lda MEMLO
sbc lowadr
lda MEMLO+1
sbc lowadr+1
bcc memlo_ok
sec
lda MEMLO
sbc lowadr
lda MEMLO+1
sbc lowadr+1
bcc memlo_ok
; load address was too low
print_string2 lmemerr_txt, lmemerr_txt_len
jsr delay ; long text takes longer to read, give user additional time
jmp fail
print_string2 lmemerr_txt, lmemerr_txt_len
jsr delay ; long text takes longer to read, give user additional time
jmp fail
; all is well(tm), launch the application
memlo_ok:
.ifdef DEBUG
print_string "Stage #1 OK"
jsr delay
print_string "Stage #1 OK"
jsr delay
.endif
rts
rts
lmemerr_txt:
.byte "Not enough memory to move screen", ATEOL
.byte "memory to low memory. Consider using", ATEOL
.byte "a higher load address.", ATEOL
lmemerr_txt_len = * - lmemerr_txt
.byte "Not enough memory to move screen", ATEOL
.byte "memory to low memory. Consider using", ATEOL
.byte "a higher load address.", ATEOL
lmemerr_txt_len = * - lmemerr_txt
; short delay
.proc delay
.proc delay
lda #10
l: jsr delay1
clc
sbc #0
bne l
rts
lda #10
l: jsr delay1
clc
sbc #0
bne l
rts
delay1: ldx #0
ldy #0
loop: dey
bne loop
dex
bne loop
rts
delay1: ldx #0
ldy #0
loop: dey
bne loop
dex
bne loop
rts
.endproc
@@ -154,4 +154,4 @@ end:
.word INITAD+1
.word syschk
.endif ; .ifdef __ATARIXL__
.endif ; .ifdef __ATARIXL__