From 74c9287e06bdacec5fd282dd066d32e0a6568c6c Mon Sep 17 00:00:00 2001 From: Dave Schmenk Date: Fri, 8 Jul 2016 11:00:18 -0700 Subject: [PATCH] dual buffer plot --- src/libsrc/dgr.pla | 105 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 16 deletions(-) diff --git a/src/libsrc/dgr.pla b/src/libsrc/dgr.pla index d223e06..a2539c4 100755 --- a/src/libsrc/dgr.pla +++ b/src/libsrc/dgr.pla @@ -116,6 +116,90 @@ asm dgrUpdate(buff) RTS end +asm drgPlot(buff, x, y, clr) + ; Get buffer address + STX ESP + LDA ESTKL+3,X + STA SRCL + LDA ESTKH+3,X + STA SRCH + LDA ESTKL+1,X ; Y coord + LSR + LDA (SRC),Y + STA DSTL + INY + LDA (SRC),Y + STA DSTH + PHP + SEI + BCS ++ + LDA ESTKL+2,X + LSR + PHA + BCS + + LDY ESTKL,X +end +asm dgrPlotEvnEvn + LDA $100,Y + AND #$0F + STA TMPL + PLA + TAY + LDA (DST),Y + AND #$F0 + ORA TMPL + STA (DST),Y + BCC ++++ ++ LDY ESTKL,X +end +asm dgrPlotEvnOdd + LDA $1000,Y + AND #$F0 + STA TMPL + PLA + TAY + LDA (DST),Y + AND #$0F + ORA TMPL + STA (DST),Y + BCS ++++ +++ LDA ESTKL+2,X + LSR + PHA + BCS +++ + LDY ESTKL,X +end +asm dgrPlotOddEvn + LDA $1000,Y + AND #$0F + STA TMPL + PLA + TAY + LDA (DST),Y + AND #$F0 + ORA TMPL + STA (DST),Y + BCC ++++ ++++ LDY ESTKL,X +end +asm dgrPlotOddOdd + LDA $1000,Y + AND #$F0 + STA TMPL + PLA + TAY + LDA (DST),Y + AND #$0F + ORA TMPL + STA (DST),Y +++++ PLP + LDX ESP + INX + INX + INX + RTS +end + asm vlbWait DEX - LDA $C019 @@ -145,22 +229,6 @@ def txtMode ^an3on end -def dgrPlot(buff, x, y, clr) - word pixptr - - pixptr = buff + ((y >> 1) << 8) + (x >> 1) - if x & 1 - clr = oddclr[clr & $0F] - else - clr = evnclr[clr & $0F] - fin - if y & 1 - ^pixptr = (^pixptr & $0F) | (clr & $F0) - else - ^pixptr = (^pixptr & $F0) | (clr & $0F) - fin -end - def dgrClr(buff, clr) byte row word fillclr @@ -197,5 +265,10 @@ def dgrTest txtMode end +// Assembly fixups +dgrPlotEvnEvn:1 = @evnclr +dgrPlotEvnOdd:1 = @oddclr +dgrPlotOddEvn:1 = @evnclr +dgrPlotOddOdd:1 = @oddclr dgrTest done