aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-10-25 20:23:15 -0400
committerB. Watson <urchlay@slackware.uk>2022-10-25 20:23:15 -0400
commitd4dfa08b3d3b25a3e47362351197fb3ec8052881 (patch)
tree8e309e26f7c313a1df68d3981e07c06f4c738109
parent2ee16d2487a7706952ed97628e5ab23207c149c6 (diff)
downloaddla-asm-d4dfa08b3d3b25a3e47362351197fb3ec8052881.tar.gz
Initial save-image support.
-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: