From f417950fe61e814ac19212e7e3fbf44f355e37e6 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 5 Feb 2016 18:19:38 -0500 Subject: abort loading if BASIC or a cart is present --- checkmem.s | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 checkmem.s (limited to 'checkmem.s') diff --git a/checkmem.s b/checkmem.s new file mode 100644 index 0000000..b48c12b --- /dev/null +++ b/checkmem.s @@ -0,0 +1,74 @@ + +; initial load segment for taipan. intended to be a tiny (1-sector) +; routine that checks for the presence of BASIC or a cartridge, and +; aborts the load if found. + +; cl65 -o checkmem.xex -t none checkmem.s + + .include "atari.inc" + +start = $0600 ; use page 6 for now + + .word $ffff + .word start + .word end-1 + + .org start + +msg: + .incbin "cartmsg.dat" +msglen = * - msg - 1 + +S: .byte "S:",0 +init: + ldx #6*$10 ; CLOSE #6 + lda #CLOSE + sta ICCOM,x + jsr CIOV + + ; GRAPHICS 0 + ldx #6*$10 ; IOCB #6 + lda #OPEN + sta ICCOM,x + lda #$1c ; $c = read/write + sta ICAX1,x + lda #0 ; aux2 byte zero + sta ICAX2,x + lda #S + sta ICBAH,x + jsr CIOV + + lda RAMTOP + cmp #$c0 + bcs done ; if ramtop is $c000, we're OK + + ; if ramtop is below $c000, we have a cartridge (or XL BASIC) + lda #msg + sta FR0+1 + + ldy #msglen +msgloop: + lda (FR0),y + sta (SAVMSC),y + dey + bpl msgloop + +wait4key: + lda CH + cmp #$ff + beq wait4key + jmp WARMSV + +done: + rts + +end: + .word INITAD + .word INITAD+1 + .word init + + -- cgit v1.2.3