aboutsummaryrefslogtreecommitdiff
path: root/checkmem.s
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-07 01:35:10 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-07 01:35:10 -0500
commite5b222e120b3abab5fb27e86ac0257d24770ba03 (patch)
treedb609a693e61d30248f3b80cc4810b9556a33823 /checkmem.s
parenta57be4c9966f5824bc2ba440684496af663077de (diff)
downloadtaipan-e5b222e120b3abab5fb27e86ac0257d24770ba03.tar.gz
tweaking checkmem stuff
Diffstat (limited to 'checkmem.s')
-rw-r--r--checkmem.s21
1 files changed, 14 insertions, 7 deletions
diff --git a/checkmem.s b/checkmem.s
index 90d21db..a87bbd2 100644
--- a/checkmem.s
+++ b/checkmem.s
@@ -1,7 +1,10 @@
; 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.
+; routine that checks for the presence of BASIC or a cartridge, and aborts
+; the load if found. Also, it resets RAMTOP to RAMSIZ and does a GRAPHICS
+; 0, to avoid problems with funky loaders leaving the graphics screen
+; in the wrong place (Atarimax flash cart leaves it at $9cxx) or in the
+; wrong graphics mode (Fenders 3-sector loader doesn't set up GR.0).
; cl65 -o checkmem.xex -t none checkmem.s
@@ -15,8 +18,12 @@ start = $0600 ; use page 6 for now
.org start
+; message is "Need 48K, remove cartridge" in screen codes.
msg:
- .incbin "cartmsg.dat"
+ .byte $2e, $65, $65, $64, $00, $14, $18, $2b
+ .byte $0c, $00, $72, $65, $6d, $6f, $76, $65
+ .byte $00, $63, $61, $72, $74, $72, $69, $64
+ .byte $67, $65
msglen = * - msg - 1
S: .byte "S:",0
@@ -48,11 +55,11 @@ init:
plp
bcc have_cart
- ; if ramtop is $c000 or higher, we're OK, just exit.
+ ; if RAM size is $c000 or higher, we're OK, just exit.
rts
have_cart:
- ; if ramtop is below $c000, we have a cartridge (or XL BASIC).
+ ; if RAM size is below $c000, we have a cartridge (or XL BASIC).
; print the "remove cart" message...
lda #<msg
sta FR0
@@ -66,10 +73,10 @@ msgloop:
dey
bpl msgloop
+ sty CH ; y == $ff at this point, clear keyboard
; ...wait for a keystroke...
wait4key:
- lda CH
- cmp #$ff
+ cpy CH
beq wait4key
; ...and do a warmstart.