From 9a2f5f4c83201c193dd1029aeca04cff44574e60 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 13 Nov 2022 17:18:21 -0500 Subject: v0.3.0: save files are now 176x170. --- dla.s | 53 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 6 deletions(-) (limited to 'dla.s') diff --git a/dla.s b/dla.s index 5126b50..f08084f 100644 --- a/dla.s +++ b/dla.s @@ -16,6 +16,7 @@ lowcode = $0600 ; memcheck and io.s screen = $4000 ; must be on a x000 (4K) boundary screen2 = screen + $1000 ; rest of screen RAM after 4K boundary + savebuf = screen + $6000 ; prepare_output pixarray = screen + $20 linelen = $20 ; aka 32 bytes, antic F (GR.8) in narrow mode. maxlines = $aa ; 170 lines of display @@ -52,6 +53,7 @@ old_savmsc: .res 2 cloksav: .res 3 ; hold RTCLOK here while we convert to MM:SS.CC fptmp: .res 6 ; used in mmss.s +po_line = fptmp ; used by prepare_output .code @@ -312,10 +314,10 @@ saveimage: ; prepend D: to the filename, if there's no device given. lda linebuf+1 cmp #':' - beq open_output + beq prepare_output lda linebuf+2 cmp #':' - beq open_output + beq prepare_output ldy ICBLL dloop: @@ -332,6 +334,45 @@ dloop: inc ICBLL inc ICBLL + ; DLA pixel size is 170x170, screen memory is 256x170. only save + ; the middle 22 bytes (176 pixels) of each line. Really only need + ; 170 pixels, but of course we can't save a partial byte... +prepare_output: + lda #screen + sta screenptr+1 + lda #savebuf + sta pixptr+1 + lda #0 + sta po_line +polineloop: + ldy #5 + ldx #0 +poloop: + lda (screenptr),y + sta (pixptr,x) + inc pixptr + bne ppok + inc pixptr+1 +ppok: + iny + cpy #$1b + bne poloop + lda screenptr + clc + adc #$20 + sta screenptr + lda screenptr+1 + adc #0 + sta screenptr+1 + inc po_line + ldx po_line + cpx #maxlines + bne polineloop + open_output: ; CIO is nice, but it's kind of a PITA to use... ; OPEN #1,8,0, @@ -359,13 +400,13 @@ open_output: ldx #$10 lda #$0b ; write binary record sta ICCOM,x - lda #screen + lda #>savebuf sta ICBAH,x - lda #screenbytes + lda #>(maxlines*22) sta ICBLH,x jsr CIOV cpy #1 -- cgit v1.2.3