aboutsummaryrefslogtreecommitdiff
path: root/dla.s
diff options
context:
space:
mode:
Diffstat (limited to 'dla.s')
-rw-r--r--dla.s24
1 files changed, 19 insertions, 5 deletions
diff --git a/dla.s b/dla.s
index f08084f..627ebe9 100644
--- a/dla.s
+++ b/dla.s
@@ -136,8 +136,15 @@ printbanner:
; use CIO to read input, so user can use backspace/etc.
jsr readline
lda linebuf
+
+ ; check for error (user hit Break or Ctrl-3 for EOF).
+ cpy #1
+ bne printbanner
+
+ ; if user hit Return by itself, use the old value.
cmp #$9b
- beq usedefault ; if user hit Return
+ beq prompt4seed
+
; use floating point ROM to convert input to an integer.
lda #0
sta CIX
@@ -153,8 +160,7 @@ printbanner:
stx maxparticles
sta maxparticles+1
-usedefault:
-
+prompt4seed:
; print seed type prompt
lda #<seedprompt
ldx #>seedprompt
@@ -168,7 +174,10 @@ usedefault:
jsr printmsg
readseed:
- jsr getchrx
+ jsr getchr ; N.B. getchrx won't work here (see io.s)
+ cpy #1
+ bne readseed
+
cmp #$9b
beq dfltseed ; use default if user pressed return
cmp #$31
@@ -285,7 +294,7 @@ main_done:
waitkey:
jsr getchr
- ; see what key was hit
+ ; see what key was hit. don't need extra code for Break or ^3 here.
and #$5f ; ignore case
cmp #'R' ; Redo
bne notredo
@@ -306,9 +315,14 @@ saveimage:
jsr restore_gr0 ; back to GR.0, so we can...
lda #<saveprompt
ldx #>saveprompt
+siprompt:
jsr printmsg ; ...prompt for, and...
jsr readline ; ...let the user type a filename.
+ ; if user hit Break or ^3, prompt again.
+ cpy #1
+ bne siprompt
+
jsr close1 ; make sure the IOCB is closed before we open it!
; prepend D: to the filename, if there's no device given.