aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dla.s56
1 files changed, 44 insertions, 12 deletions
diff --git a/dla.s b/dla.s
index 04842e3..1d27cfb 100644
--- a/dla.s
+++ b/dla.s
@@ -363,8 +363,6 @@ waitkey:
bne notredo
jmp main
notredo:
- cmp #$2e ; WriteCSV
- beq writecsv
cmp #$3e ; Save
beq saveimage
cmp #$2a ; Exit
@@ -372,12 +370,44 @@ notredo:
;rts ; exit to DOS
jmp COLDSV ; reboot
-writecsv:
saveimage:
-notyet:
- lda #$40
- sta COLOR2
-
+ ldx #$10
+ lda #3 ; OPEN
+ sta ICCOM,x
+ lda #<filename
+ sta ICBAL,x
+ lda #>filename
+ sta ICBAH,x
+ lda #fnlen
+ sta ICBLL,x
+ lda #0
+ sta ICBLH,x
+ sta ICAX2,x
+ lda #8
+ sta ICAX1,x
+ jsr CIOV
+
+ ldx #$10
+ lda #$0b ; write binary record
+ sta ICCOM,x
+ lda #<screen
+ sta ICBAL,x
+ lda #>screen
+ sta ICBAH,x
+ lda #<(maxlines * linelen)
+ sta ICBLL,x
+ lda #>(maxlines * linelen)
+ sta ICBLH,x
+ jsr CIOV
+
+ ldx #$10
+ lda #$0c ; close
+ sta ICCOM,x
+ jsr CIOV
+ jmp keyloop
+
+diskerr:
+ sty textbuf
hang: jmp hang
; TODO: code to save image goes here.
;;; End of main()
@@ -388,19 +418,21 @@ menumsg:
.byte $00 ; 1 decimal point
.byte $00,$00 ; 2 digits fractional minutes
.byte $00 ; 1 the letter "m"
- .byte $00 ; 1 space
+ .byte $00,$00 ; 2 spaces
.byte 'S'-$20+$80 ; 1
scrcode "ave " ; 3
- .byte 'W'-$20+$80 ; 1
- scrcode "rtCSV " ; 6
.byte 'R'-$20+$80 ; 1
scrcode "edo " ; 4
.byte 'E'-$20+$80 ; 1
- scrcode "xit? " ; 5
+ scrcode "xit?" ; 4
.byte $80 ; 1 (cursor)
- .byte $00 ; 1 space (filler) to make 32 bytes
+ .byte $00,$00,$00 ; 3 (filler)
menulen = * - menumsg
+; filename for Save command
+filename: .byte "D:DLA.IMG"
+fnlen = *-filename+1
+
;;; Subroutine: set_limits
;;; Sets the X/Y min/max limits based on circlesize
set_limits: