From 5abdeef09aed56fe386fed778617379d70b5ad18 Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Sat, 7 Sep 2024 20:39:03 -0700 Subject: [PATCH] Ops for MemBl7Mem --- src/libsrc/apple/dcgrlib.pla | 1531 ++++++++++++++++++++++++++++++++++ 1 file changed, 1531 insertions(+) create mode 100644 src/libsrc/apple/dcgrlib.pla diff --git a/src/libsrc/apple/dcgrlib.pla b/src/libsrc/apple/dcgrlib.pla new file mode 100644 index 0000000..5e0142a --- /dev/null +++ b/src/libsrc/apple/dcgrlib.pla @@ -0,0 +1,1531 @@ +include "inc/cmdsys.plh" + +const OP_SRC = 0 +const OP_XOR = 1 +const OP_AND = 2 +const OP_OR = 3 +// +// Apple II graphics soft switches +// +const store80dis = $C000 +const store80ena = $C001 +const show40col = $C00C +const show80col = $C00D +const showgraphics = $C050 +const showtext = $C051 +const showfull = $C052 +const showmix = $C053 +const page1m = $C054 +const page1x = $C055 +const showhires = $C057 +const dhresena = $C05E +const dhresdis = $C05F +const IOUdis = $C07E +const IOUena = $C07F +// +// HiRes scanline addresses +// +byte hgrscanl[]= $00,$00,$00,$00,$00,$00,$00,$00 +byte = $80,$80,$80,$80,$80,$80,$80,$80 +byte = $00,$00,$00,$00,$00,$00,$00,$00 +byte = $80,$80,$80,$80,$80,$80,$80,$80 +byte = $00,$00,$00,$00,$00,$00,$00,$00 +byte = $80,$80,$80,$80,$80,$80,$80,$80 +byte = $00,$00,$00,$00,$00,$00,$00,$00 +byte = $80,$80,$80,$80,$80,$80,$80,$80 +byte = $28,$28,$28,$28,$28,$28,$28,$28 +byte = $A8,$A8,$A8,$A8,$A8,$A8,$A8,$A8 +byte = $28,$28,$28,$28,$28,$28,$28,$28 +byte = $A8,$A8,$A8,$A8,$A8,$A8,$A8,$A8 +byte = $28,$28,$28,$28,$28,$28,$28,$28 +byte = $A8,$A8,$A8,$A8,$A8,$A8,$A8,$A8 +byte = $28,$28,$28,$28,$28,$28,$28,$28 +byte = $A8,$A8,$A8,$A8,$A8,$A8,$A8,$A8 +byte = $50,$50,$50,$50,$50,$50,$50,$50 +byte = $D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0 +byte = $50,$50,$50,$50,$50,$50,$50,$50 +byte = $D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0 +byte = $50,$50,$50,$50,$50,$50,$50,$50 +byte = $D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0 +byte = $50,$50,$50,$50,$50,$50,$50,$50 +byte = $D0,$D0,$D0,$D0,$D0,$D0,$D0,$D0 +byte hgrscanh[]= $20,$24,$28,$2C,$30,$34,$38,$3C +byte = $20,$24,$28,$2C,$30,$34,$38,$3C +byte = $21,$25,$29,$2D,$31,$35,$39,$3D +byte = $21,$25,$29,$2D,$31,$35,$39,$3D +byte = $22,$26,$2A,$2E,$32,$36,$3A,$3E +byte = $22,$26,$2A,$2E,$32,$36,$3A,$3E +byte = $23,$27,$2B,$2F,$33,$37,$3B,$3F +byte = $23,$27,$2B,$2F,$33,$37,$3B,$3F +byte = $20,$24,$28,$2C,$30,$34,$38,$3C +byte = $20,$24,$28,$2C,$30,$34,$38,$3C +byte = $21,$25,$29,$2D,$31,$35,$39,$3D +byte = $21,$25,$29,$2D,$31,$35,$39,$3D +byte = $22,$26,$2A,$2E,$32,$36,$3A,$3E +byte = $22,$26,$2A,$2E,$32,$36,$3A,$3E +byte = $23,$27,$2B,$2F,$33,$37,$3B,$3F +byte = $23,$27,$2B,$2F,$33,$37,$3B,$3F +byte = $20,$24,$28,$2C,$30,$34,$38,$3C +byte = $20,$24,$28,$2C,$30,$34,$38,$3C +byte = $21,$25,$29,$2D,$31,$35,$39,$3D +byte = $21,$25,$29,$2D,$31,$35,$39,$3D +byte = $22,$26,$2A,$2E,$32,$36,$3A,$3E +byte = $22,$26,$2A,$2E,$32,$36,$3A,$3E +byte = $23,$27,$2B,$2F,$33,$37,$3B,$3F +byte = $23,$27,$2B,$2F,$33,$37,$3B,$3F +// +// Pixel masks for 7 contiguous pixels +// +byte auxclrmsk[] = $0F +byte = $70 +byte = $00 +byte = $03|$80 +byte = $3C|$80 +byte = $40|$80 +byte = $00 +byte memclrmsk[] = $00 +byte = $01 +byte = $1E +byte = $60 +byte = $00 +byte = $07|$80 +byte = $78|$80 +// +// Solid colors +// +byte auxclrsl[] = $00 // black +byte = $08 // magenta +byte = $44 // brown +byte = $4C // orange +byte = $22 // dark green +byte = $2A // gray 1 +byte = $66 // green +byte = $6E // yellow +byte = $11 // dark blue +byte = $19 // purple +byte = $55 // gray 2 +byte = $5D // pink +byte = $33 // medium blue +byte = $3B // light blue +byte = $77 // aqua +byte = $7F // white +byte auxclrsh[] = $00 // black +byte = $22 // magenta +byte = $11 // brown +byte = $33 // orange +byte = $08 // dark green +byte = $2A // gray 1 +byte = $19 // green +byte = $3B // yellow +byte = $44 // dark blue +byte = $66 // purple +byte = $55 // gray 2 +byte = $77 // pink +byte = $4C // medium blue +byte = $6E // light blue +byte = $5D // aqua +byte = $7F // white +byte memclrsl[] = $00 // black +byte = $11 // magenta +byte = $08 // brown +byte = $19 // orange +byte = $44 // dark green +byte = $55 // gray 1 +byte = $4C // green +byte = $5D // yellow +byte = $22 // dark blue +byte = $33 // purple +byte = $2A // gray 2 +byte = $3B // pink +byte = $66 // medium blue +byte = $77 // light blue +byte = $6E // aqua +byte = $7F // white +byte memclrsh[] = $00 // black +byte = $44 // magenta +byte = $22 // brown +byte = $66 // orange +byte = $11 // dark green +byte = $55 // gray 1 +byte = $33 // green +byte = $77 // yellow +byte = $08 // dark blue +byte = $4C // purple +byte = $2A // gray 2 +byte = $6E // pink +byte = $19 // medium blue +byte = $5D // light blue +byte = $3B // aqua +byte = $7F // white +byte auxclrl, auxclrh, memclrl, memclrh +// +// Divide 7 combined with Modulo 7 +// +byte divmod7[] = 0+0, 0+1, 0+2, 0+3, 0+4, 0+5, 0+6 +byte = 8+0, 8+1, 8+2, 8+3, 8+4, 8+5, 8+6 +byte = 16+0, 16+1, 16+2, 16+3, 16+4, 16+5, 16+6 +byte = 24+0, 24+1, 24+2, 24+3, 24+4, 24+5, 24+6 +byte = 32+0, 32+1, 32+2, 32+3, 32+4, 32+5, 32+6 +byte = 40+0, 40+1, 40+2, 40+3, 40+4, 40+5, 40+6 +byte = 48+0, 48+1, 48+2, 48+3, 48+4, 48+5, 48+6 +byte = 56+0, 56+1, 56+2, 56+3, 56+4, 56+5, 56+6 +byte = 64+0, 64+1, 64+2, 64+3, 64+4, 64+5, 64+6 +byte = 72+0, 72+1, 72+2, 72+3, 72+4, 72+5, 72+6 +byte = 80+0, 80+1, 80+2, 80+3, 80+4, 80+5, 80+6 +byte = 88+0, 88+1, 88+2, 88+3, 88+4, 88+5, 88+6 +byte = 96+0, 96+1, 96+2, 96+3, 96+4, 96+5, 96+6 +byte = 104+0, 104+1, 104+2, 104+3, 104+4, 104+5, 104+6 +byte = 112+0, 112+1, 112+2, 112+3, 112+4, 112+5, 112+6 +byte = 120+0, 120+1, 120+2, 120+3, 120+4, 120+5, 120+6 +byte = 128+0, 128+1, 128+2, 128+3, 128+4, 128+5, 128+6 +byte = 136+0, 136+1, 136+2, 136+3, 136+4, 136+5, 136+6 +byte = 144+0, 144+1, 144+2, 144+3, 144+4, 144+5, 144+6 +byte = 152+0, 152+1, 152+2, 152+3, 152+4, 152+5, 152+6 +byte = 160+0, 160+1, 160+2, 160+3, 160+4, 160+5, 160+6 +byte = 168+0, 168+1, 168+2, 168+3, 168+4, 168+5, 168+6 +byte = 176+0, 176+1, 176+2, 176+3, 176+4, 176+5, 176+6 +byte = 184+0, 184+1, 184+2, 184+3, 184+4, 184+5, 184+6 +byte = 192+0, 192+1, 192+2, 192+3, 192+4, 192+5, 192+6 +byte = 200+0, 200+1, 200+2, 200+3, 200+4, 200+5, 200+6 +byte = 208+0, 208+1, 208+2, 208+3, 208+4, 208+5, 208+6 +byte = 216+0, 216+1, 216+2, 216+3, 216+4, 216+5, 216+6 +byte = 224+0, 224+1, 224+2, 224+3, 224+4, 224+5, 224+6 +byte = 232+0, 232+1, 232+2, 232+3, 232+4, 232+5, 232+6 +byte = 240+0, 240+1, 240+2, 240+3, 240+4, 240+5, 240+6 +byte = 248+0, 248+1, 248+2, 248+3, 248+4, 248+5, 248+6 +// +// Internal routine to clip x7 and width7 to destination width in A REG +// +asm _clip7#0 +!SOURCE "vmsrc/plvmzp.inc" + STA TMPL ; DSTWIDTH7 + LDA ESTKL-1,X ; X7 COORD + BMI NEGX7 ; IS NEG? + CMP TMPL ; > DSTWIDTH7? + BCS INVIS7 ; YEP, X7 OFF RIGHT EDGE + CLC + ADC ESTKL-3,X ; X7 + WIDTH7 + CMP TMPL ; < DSTWIDTH7? + BCC VIS7 ; YEP, FULLY VISIBLE + LDA TMPL ; CLIP WIDTH7 TO DSTWIDTH + SEC + SBC ESTKL-1,X + STA ESTKL-3,X ; WIDTH7 = DSTWIDTH7 - X7 +VIS7 LDA #$00 ; FULLY VISIBLE + CLC + RTS +; X7 NEGATIVE, CHECK WITH W7 ADDED +NEGX7 CLC + ADC ESTKL-3,X ; X7 + WIDTH7 + BMI INVIS7 ; STILL NEG?, OFF LEFT EDGE + BEQ INVIS7 ; OR ZERO WIDTH7? + CMP TMPL ; > DSTWIDTH7? + BCC + ; YEP, SPANS DSTWIDTH7 + LDA TMPL ; WIDTH7 = DSTWIDTH7 ++ STA ESTKL-3,X ; WIDTH7 = VISIBLE AMOUNT + LDA #$00 + SEC + SBC ESTKL-1,X ; -X7 COORD + PHA ; SAVE FOR SRC/DST CLIP OFFSET + LDA #$00 + STA ESTKL-1,X ; CLIP X7 COORD TO LEFT EDGE + STA ESTKH-1,X + PLA ; VISIBLE WITH X7 CLIP + CLC + RTS +INVIS7 SEC + RTS +end +// +// Exported assembly routines for double color functions +// +export asm dcgrColor(c)#0 + LDA ESTKL,X + INX + AND #$0F + TAY +end +asm _dcgrColorA + LDA $1000,Y ; AUXCLRSL + STA $5000 ; AUXCLRL + LDA $2000,Y ; AUXCLRSH + STA $5001 ; AUXCLRH + LDA $3000,Y ; MEMCLRSL + STA $5002 ; MEMCLRL + LDA $4000,Y ; MEMCLRSH + STA $5003 ; MEMCLRH + RTS +end +// +// Screen destination functions +// +export asm dcgrPlotScr(x, y)#0 + INX + INX + STX ESP + LDY ESTKL-2,X ; Y COORD + CPY #192 + BCS RETPLTS +end +asm _dcgrPlotScrA + LDA $1000,Y ; HGRSCANL + STA DSTL + LDA $2000,Y ; HGRSCANH + STA DSTH + LDY ESTKL-1,X ; X COORD + CPY #140 + BCS RETPLTS +end +asm _dcgrPlotScrB + LDA $3000,Y ; DIVMOD7 + TAX + AND #$F8 + LSR + LSR + TAY ; DIV7 + TXA + AND #$07 + TAX ; PIX7 +end +asm _jmpOpPlotScr + JMP $A000 +end +// +// Plot OP_SRC +// +asm _dcgrPlotScrC + LDA $4000,X ; AUXCLRMSK + BEQ ++ + STA $C055 ; PAGE1X + BMI + +end +asm _dcgrPlotScrD + LDA $5000 ; AUXCLRL + EOR (DST),Y + AND $4000,X ; AUXCLRMSK + EOR (DST),Y + STA (DST),Y + BNE ++ + BEQ ++ ++ INY +end +asm _dcgrPlotScrE + LDA $5001 ; AUXCLRH + EOR (DST),Y + AND $4000,X ; AUXCLRMSK + EOR (DST),Y + STA (DST),Y + DEY +end +asm _dcgrPlotScrF +++ LDA $4001,X ; MEMCLRMSK + BEQ RETPLTS + STA $C054 ; PAGE1M + BMI + +end +asm _dcgrPlotScrG + LDA $5002 ; MEMCLRL + EOR (DST),Y + AND $4000,X ; MEMCLRMSK + EOR (DST),Y + STA (DST),Y + LDX ESP + RTS ++ INY +end +asm _dcgrPlotScrH + LDA $5003 ; MEMCLRH + EOR (DST),Y + AND $4000,X ; MEMCLRMSK + EOR (DST),Y + STA (DST),Y +RETPLTS LDX ESP + RTS +end +// +// Plot OP_XOR,OP_AND,OP_OR +// +asm _dcgrOpPlotScrC + LDA $4000,X ; AUXCLRMSK + BEQ ++ + STA $C055 ; PAGE1X + BMI + +end +asm _dcgrOpPlotScrD + AND $5000 ; AUXCLRL + EOR (DST),Y + STA (DST),Y + BNE ++ + BEQ ++ ++ INY +end +asm _dcgrOpPlotScrE + AND $5001 ; AUXCLRH + EOR (DST),Y + STA (DST),Y + DEY +end +asm _dcgrOpPlotScrF +++ LDA $4001,X ; MEMCLRMSK + BEQ RETPLTS + STA $C054 ; PAGE1M + BMI + +end +asm _dcgrOpPlotScrG + AND $5002 ; MEMCLRL + EOR (DST),Y + STA (DST),Y + LDX ESP + RTS ++ INY +end +asm _dcgrOpPlotScrH + AND $5003 ; MEMCLRH + EOR (DST),Y + STA (DST),Y + LDX ESP + RTS +end +export asm dcgrHLinScr(x1, x2, y)#0 + INX + INX + INX + STX ESP + INC ESTKL-2,X ; ADJUST FOR BCS BELOW + LDY ESTKL-3,X ; Y COORD + CPY #192 + BCS + +end +asm _dcgrHLinScrA + LDA $1000,Y ; HGRSCANL + STA DSTL + LDA $2000,Y ; HGRSCANH + STA DSTH +- LDA ESTKL-1,X ; X1 COORD + CMP ESTKL-2,X ; X2 COORD + BCS + + TAY +end +asm _dcgrHLinScrB + JSR $1000 ; PLOT PIX W/ XCOORD IN Y REG + INC ESTKL-1,X + BNE - ++ RTS +end +export asm dcgrVLinScr(y1, y2, x)#0 + INX + INX + INX + STX ESP + INC ESTKL-2,X ; ADJUST BCS BELOW +- LDA ESTKL-1,X ; Y1 COORD + CMP ESTKL-2,X ; Y2 COORD + BCS + + TAY +end +asm _dcgrVLinScrA + LDA $1000,Y ; HGRSCANL + STA DSTL + LDA $2000,Y ; HGRSCANH + STA DSTH + LDY ESTKL-3,X ; X COORD +end +asm _dcgrVLinScrB + JSR $1000 ; PLOT PIX W/ XCOORD IN Y REG + INC ESTKL-1,X + BNE - ++ RTS +end +export asm dcgrPixScr(x, y, w, h, pixptr)#0 + INX + INX + INX + INX + INX + STX ESP + LDA ESTKL-5,X ; PIXPTR + STA SRCL + LDA ESTKH-5,X + STA SRCH + LDA ESTKL-1,X ; X COORD + CLC + ADC ESTKL-3,X ; WIDTH + STA ESTKL-3,X ; -> RIGHT EDGE + LDA ESTKL-2,X ; Y COORD + CLC + ADC ESTKL-4,X ; HEIGHT + STA ESTKL-4,X ; -> BOTTOM EDGE +YPIXS LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BEQ RETPIXS + INC ESTKL-2,X ; Y COORD++ + CMP #192 ; OFF SCREEN? + BCS - + TAY +end +asm _dcgrPixScrA + LDA $1000,Y ; HGRSCANL + STA DSTL + LDA $2000,Y ; HGRSCANH + STA DSTH + LDA ESTKL-1,X ; X COORD + STA TMPL +PIXSCRL CMP #140 ; OFF SCREEN? + BCS PIXSCRH + LDY #$00 ; LO NIBBLE SRC PIXEL + LDA (SRC),Y + AND #$0F + CMP #$05 ; TRANSPARENT? + BEQ PIXSCRH + TAY +end +asm _dcgrPixScrB + JSR $2000 ; SET COLOR + LDY TMPL +end +asm _dcgrPixScrC + JSR $1000 ; PLOT PIXEL +PIXSCRH INC TMPL + LDA TMPL + CMP ESTKL-3,X ; AT RIGHT EDGE? + BEQ YPIXS ; NEXT ROW + CMP #140 ; OFF SCREEN? + BCS + + LDY #$00 ; HI NIBBLE SRC PIXEL + LDA (SRC),Y + LSR + LSR + LSR + LSR + CMP #$05 ; TRANSPARENT? + BEQ + + TAY +end +asm _dcgrPixScrD + JSR $2000 ; SET COLOR + LDY TMPL +end +asm _dcgrPixScrE + JSR $1000 ; PLOT PIXEL ++ INC SRCL + BNE + + INC SRCH ++ INC TMPL + LDA TMPL + CMP ESTKL-3,X ; AT RIGHT EDGE? + BNE PIXSCRL + BEQ YPIXS ; NEXT ROW +RETPIXS RTS +end +// +// Memory destination functions +// +export asm dcgrPlotMem(x, y, w, h, dstptr, dstspan)#0 + TXA + CLC + ADC #6 + TAX + STX ESP + LDA ESTKL-5,X ; DSTPTR + STA DSTL + LDA ESTKH-5,X + STA DSTH + LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; HEIGHT + BCS RETPLTM + BEQ + + TAY +- CLC ; ADVANCE TO Y SCANLINE + LDA ESTKL-6,X ; SPAN + ADC DSTL + STA DSTL + LDA ESTKH-6,X + ADC DSTH + STA DSTH + DEY + BNE - ++ LDA ESTKL-1,X ; X COORD + CMP ESTKL-3,X ; WIDTH + BCS RETPLTM + TAY +end +asm _dcgrPlotMemB + LDA $3000,Y ; DIVMOD7 + TAX + AND #$F8 + LSR + TAY ; DIV7 + TXA + AND #$07 + TAX ; PIX7 +end +asm _jmpOpPlotMem + JMP $A000 +end +// +// Plot OP_SRC +// +asm _dcgrPlotMemC + LDA $4000,X ; AUXCLRMSK + BEQ ++ + BMI + +end +asm _dcgrPlotMemD + LDA $5000 ; AUXCLRL + EOR (DST),Y + AND $4000,X ; AUXCLRMSK + EOR (DST),Y + STA (DST),Y + BNE ++ + BEQ ++ ++ INY + INY +end +asm _dcgrPlotMemE + LDA $5001 ; AUXCLRH + EOR (DST),Y + AND $4000,X ; AUXCLRMSK + EOR (DST),Y + STA (DST),Y + DEY + DEY +++ INY +end +asm _dcgrPlotMemF + LDA $4001,X ; MEMCLRMSK + BEQ RETPLTM + BMI + +end +asm _dcgrPlotMemG + LDA $5002 ; MEMCLRL + EOR (DST),Y + AND $4000,X ; MEMCLRMSK + EOR (DST),Y + STA (DST),Y + LDX ESP + RTS ++ INY + INY +end +asm _dcgrPlotMemH + LDA $5003 ; MEMCLRH + EOR (DST),Y + AND $4000,X ; MEMCLRMSK + EOR (DST),Y + STA (DST),Y +RETPLTM LDX ESP + RTS +end +// +// Plot OP_XOR,OP_AND,OP_OR +// +asm _dcgrOpPlotMemC + LDA $4000,X ; AUXCLRMSK + BEQ ++ + BMI + +end +asm _dcgrOpPlotMemD + AND $5000 ; AUXCLRL + EOR (DST),Y + STA (DST),Y + BNE ++ + BEQ ++ ++ INY + INY +end +asm _dcgrOpPlotMemE + AND $5001 ; AUXCLRH + EOR (DST),Y + STA (DST),Y + DEY + DEY +++ INY +end +asm _dcgrOpPlotMemF + LDA $4001,X ; MEMCLRMSK + BEQ RETPLTM + BMI + +end +asm _dcgrOpPlotMemG + AND $5002 ; MEMCLRL + EOR (DST),Y + STA (DST),Y + LDX ESP + RTS ++ INY + INY +end +asm _dcgrOpPlotMemH + AND $5003 ; MEMCLRH + EOR (DST),Y + STA (DST),Y + LDX ESP + RTS +end +export asm dcgrHLinMem(x1, x2, y, dstptr, dstspan)#0 + INX + INX + INX + INX + INX + STX ESP + LDA ESTKL-4,X ; DSTPTR + STA DSTL + LDA ESTKH-4,X + STA DSTH + LDA ESTKL-3,X ; Y COORD + BEQ + + TAY +- CLC ; ADVANCE TO Y SCANLINE + LDA ESTKL-5,X ; SPAN + ADC DSTL + STA DSTL + LDA ESTKH-5,X + ADC DSTH + STA DSTH + DEY + BNE - ++ INC ESTKL-2,X ; ADJUST BCS BELOW +XHM LDA ESTKL-1,X ; X1 COORD + CMP ESTKL-2,X ; X2 COORD + BCS + + TAY +end +asm _dcgrHLinMemB + JSR $1000 ; PLOT PIX W/ XCOORD IN Y REG + INC ESTKL-1,X ; X1++ + BNE XHM ; BRA ++ RTS +end +export asm dcgrVLinMem(y1, y2, x, dstptr, dstspan)#0 + INX + INX + INX + INX + INX + STX ESP + LDA ESTKL-4,X ; DSTPTR + STA DSTL + LDA ESTKH-4,X + STA DSTH + LDY ESTKL-1,X + BEQ + +- CLC ; ADVANCE TO Y SCANLINE + LDA ESTKL-5,X ; SPAN + ADC DSTL + STA DSTL + LDA ESTKH-5,X + ADC DSTH + STA DSTH + DEY + BNE - ++ INC ESTKL-2,X ; ADJUST BCS BELOW +YVM LDA ESTKL-1,X ; Y1 COORD + CMP ESTKL-2,X ; Y2 COORD + BCS + + LDY ESTKL-3,X ; X COORD +end +asm _dcgrVLinMemB + JSR $1000 ; PLOT PIX W/ XCOORD IN Y REG + INC ESTKL-1,X ; Y1++ + CLC + LDA ESTKL-5,X ; SPAN + ADC DSTL + STA DSTL + LDA ESTKH-5,X + ADC DSTH + STA DSTH + BNE YVM ; BRA ++ RTS +end +export asm dcgrPixMem(x, y, w, h, pixptr, dstw, dsth, dstptr, dstspan)#0 + TXA + CLC + ADC #9 + TAX + STX ESP + LDA ESTKL-8,X ; DSTPTR + STA DSTL + LDA ESTKH-8,X + STA DSTH + LDY ESTKL-2,X ; Y COORD + BEQ + +- CLC ; ADVANCE TO Y SCANLINE + LDA ESTKL-9,X ; SPAN + ADC DSTL + STA DSTL + LDA ESTKH-9,X + ADC DSTH + STA DSTH + DEY + BNE - ++ LDA ESTKL-5,X ; PIXPTR + STA SRCL + LDA ESTKH-5,X + STA SRCH + LDA ESTKL-1,X ; X COORD + CLC + ADC ESTKL-3,X ; WIDTH + STA ESTKL-3,X ; -> RIGHT EDGE + LDA ESTKL-2,X ; Y COORD + CLC + ADC ESTKL-4,X ; HEIGHT + STA ESTKL-4,X ; -> BOTTOM EDGE +YPIXM LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BEQ RETPIXM + INC ESTKL-2,X ; Y COORD++ + CMP ESTKL-7,X ; OUT OF DST BOUNDS? + BCS NXTPIXM +end +asm _dcgrPixMemA + LDA ESTKL-1,X ; X COORD + STA TMPL +PIXMEML CMP ESTKL-6,X ; OUT OF DST BOUNDS? + BCS PIXMEMH + LDY #$00 ; LO NIBBLE SRC PIXEL + LDA (SRC),Y + AND #$0F + CMP #$05 ; TRANSPARENT? + BEQ PIXMEMH + TAY +end +asm _dcgrPixMemB + JSR $2000 ; SET COLOR + LDY TMPL +end +asm _dcgrPixMemC + JSR $1000 ; PLOT PIXEL +PIXMEMH INC TMPL + LDA TMPL + CMP ESTKL-3,X ; AT RIGHT EDGE? + BEQ NXTPIXM ; NEXT ROW + CMP ESTKL-6,X ; OUT OF DST BOUNDS? + BCS + + LDY #$00 ; HI NIBBLE SRC PIXEL + LDA (SRC),Y + LSR + LSR + LSR + LSR + CMP #$05 ; TRANSPARENT? + BEQ + + TAY +end +asm _dcgrPixMemD + JSR $2000 ; SET COLOR + LDY TMPL +end +asm _dcgrPixMemE + JSR $1000 ; PLOT PIXEL ++ INC SRCL ; PIXPTR + BNE + + INC SRCH ++ INC TMPL + LDA TMPL + CMP ESTKL-3,X ; AT RIGHT EDGE? + BNE PIXMEML +NXTPIXM CLC + LDA ESTKL-9,X ; SPAN + ADC DSTL + STA DSTL + LDA ESTKH-9,X + ADC DSTH + STA DSTH + BNE YPIXM ; NEXT ROW +RETPIXM RTS +end +// +// Mem <-> Screen Block Transfers +// +export asm dcgrScrBl7Mem(x7, y, w7, h, dstptr, dstspan)#0 + TXA + CLC + ADC #6 + TAX + LDA ESTKL-5,X ; DSTPTR + STA DSTL + LDA ESTKH-5,X + STA DSTH + LDA ESTKL-2,X ; Y COORD + CLC + ADC ESTKL-4,X ; HEIGHT + STA ESTKL-4,X ; -> BOTTOM EDGE + ASL ESTKL-1,X ; X7 COORD * 2 +YS7M LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BCS RETS7M + INC ESTKL-2,X ; Y COORD++ + CMP #192 ; OFF SCREEN? + BCS NXTS7M + TAY + LDA ESTKL-3,X ; WIDTH7 + STA TMPL + LDA ESTKL-1,X ; X7 COORD +end +asm _dcgrScrBl7MemA + ADC $2000,Y ; HGRSCANL + STA ESTKH-6,X ; !!! OVERWRITE ADDRESS ON ESTKH !!! + LDA #$00 + ADC $3000,Y ; HGRSCANH + STA ESTKH-5,X + LDY #$00 +XS7M STA $C055 ; PAGE1X + LDA (ESTKH-6,X) + STA (DST),Y + INY + STA $C054 ; PAGE1M + LDA (ESTKH-6,X) + INC ESTKH-6,X + BNE + + INC ESTKH-5,X ++ STA (DST),Y + INY + STA $C055 ; PAGE1X + LDA (ESTKH-6,X) + STA (DST),Y + INY + STA $C054 ; PAGE1M + LDA (ESTKH-6,X) + INC ESTKH-6,X + BNE + + INC ESTKH-5,X ++ STA (DST),Y + INY + DEC TMPL + BNE XS7M +NXTS7M CLC + LDA ESTKL-6,X ; SPAN + ADC DSTL + STA DSTL + LDA #$00 + ADC DSTH + STA DSTH + BNE YS7M ; BRA +RETS7M RTS +end +export asm dcgrMemBl7Scr(x7, y, w7, h, srcptr, srcspan)#0 + TXA + CLC + ADC #6 + TAX + LDA #20 +end +asm _clipMemBl7Src + JSR $F000 + BCS RETM7S + ASL + ASL + ADC ESTKL-5,X ; SRCPTR + STA SRCL + LDA #$00 + ADC ESTKH-5,X + STA SRCH + LDA ESTKL-2,X ; Y COORD + CLC + ADC ESTKL-4,X ; HEIGHT + STA ESTKL-4,X ; -> BOTTOM EDGE + ASL ESTKL-1,X ; X7 COORD * 2 +end +asm _jmpOpMemBl7Scr + JMP $A000 +end +asm _dcgrMemBl7ScrA +YM7S LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BCS RETM7S + INC ESTKL-2,X ; Y COORD++ + CMP #192 ; OFF SCREEN? + BCS NXTM7S + TAY + LDA ESTKL-3,X ; WIDTH7 + STA TMPL + LDA ESTKL-1,X ; X7 COORD + CMP #40 + BCS NXTM7S +end +asm _dcgrMemBl7ScrB + ADC $1000,Y ; HGRSCANL + STA ESTKH-6,X + LDA #$00 + ADC $2000,Y ; HGRSCANH + STA ESTKH-5,X + LDY #$00 +end +asm _dcgrMemBl7ScrC +XM7S STA $C055 ; PAGE1X + LDA (SRC),Y + INY + STA (ESTKH-6,X) + STA $C054 ; PAGE1M + LDA (SRC),Y + INY + STA (ESTKH-6,X) + INC ESTKH-6,X + BNE + + INC ESTKH-5,X ++ STA $C055 ; PAGE1X + LDA (SRC),Y + INY + STA (ESTKH-6,X) + STA $C054 ; PAGE1M + LDA (SRC),Y + INY + STA (ESTKH-6,X) + INC ESTKH-6,X + BNE + + INC ESTKH-5,X ++ DEC TMPL + BNE XM7S +NXTM7S CLC + LDA ESTKL-6,X ; SPAN + ADC SRCL + STA SRCL + LDA #$00 + ADC SRCH + STA SRCH + BNE YM7S ; BRA +RETM7S RTS +end +asm _dcgrOpMemBl7ScrA +YOM7S LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BCS RETM7S + INC ESTKL-2,X ; Y COORD++ + CMP #192 ; OFF SCREEN? + BCS NXTOM7S + TAY + LDA ESTKL-3,X ; WIDTH7 + STA TMPL + LDA ESTKL-1,X ; X7 COORD + CMP #40 + BCS NXTOM7S +end +asm _dcgrOpMemBl7ScrB + ADC $1000,Y ; HGRSCANL + STA ESTKH-6,X + LDA #$00 + ADC $2000,Y ; HGRSCANH + STA ESTKH-5,X + LDY #$00 +XOM7S STA $C055 ; PAGE1X + LDA (SRC),Y + INY +end +asm _dcgrOpMemBl7ScrC + EOR (ESTKH-6,X) + STA (ESTKH-6,X) + STA $C054 ; PAGE1M + LDA (SRC),Y + INY +end +asm _dcgrOpMemBl7ScrD + EOR (ESTKH-6,X) + STA (ESTKH-6,X) + INC ESTKH-6,X + BNE + + INC ESTKH-5,X ++ STA $C055 ; PAGE1X + LDA (SRC),Y + INY +end +asm _dcgrOpMemBl7ScrE + EOR (ESTKH-6,X) + STA (ESTKH-6,X) + STA $C054 ; PAGE1M + LDA (SRC),Y + INY +end +asm _dcgrOpMemBl7ScrF + EOR (ESTKH-6,X) + STA (ESTKH-6,X) + INC ESTKH-6,X + BNE + + INC ESTKH-5,X ++ DEC TMPL + BNE XOM7S +NXTOM7S CLC + LDA ESTKL-6,X ; SPAN + ADC SRCL + STA SRCL + LDA #$00 + ADC SRCH + STA SRCH + BNE YOM7S ; BRA +RETOM7S RTS +end +// +// Memory <-> Memory function +// +export asm dcgrMemBl7Mem(x7, y, w7, h, srcptr, srcspan, dstw7, dsth, dstptr, dstspan)#0 + TXA + CLC + ADC #10 + TAX + LDA ESTKL-7,X +end +asm _clipMemBl7Mem + JSR $F000 ; CLIP7 + BCS RETOM7S ; CLIPPED AWAY + ASL + ASL + PHA + ADC ESTKL-5,X ; SRCPTR + STA SRCL + LDA #$00 + ADC ESTKH-5,X + STA SRCH + PLA + ADC ESTKL-9,X ; DSTPTR + STA DSTL + LDA #$00 + ADC ESTKH-9,X + STA DSTH + LDY ESTKL-2,X ; Y COORD + BEQ + +- CLC ; ADVANCE TO Y SCANLINE + LDA ESTKL-10,X ; DSTSPAN + ADC DSTL + STA DSTL + LDA ESTKH-10,X + ADC DSTH + STA DSTH + DEY + BNE - ++ LDA ESTKL-2,X ; Y COORD + CLC + ADC ESTKL-4,X ; HEIGHT + STA ESTKL-4,X ; -> BOTTOM EDGE + LDA ESTKL-1,X ; X COORD + ASL + ASL + ;CLC + ADC DSTL ; DSTPTR += X7 * 4 + STA DSTL + LDA #$00 + ADC DSTH + STA DSTH + ASL ESTKL-3,X ; WIDTH = WIDTH7 * 4 + ASL ESTKL-3,X +end +asm _jmpOpMemBl7Mem + JMP $F000 +end +asm _dcgrMemBl7MemB + DEC SRCL + BNE YM7M + DEC SRCH +YM7M LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BEQ RETM7M + INC ESTKL-2,X ; Y COORD++ + CMP ESTKL-8,X ; OUT OF BOUNDS? + BCS NXTM7M + LDY ESTKL-3,X ; WIDTH7 +XM7M LDA (SRC),Y + DEY + STA (DST),Y + LDA (SRC),Y + DEY + STA (DST),Y + LDA (SRC),Y + DEY + STA (DST),Y + LDA (SRC),Y + DEY + STA (DST),Y + BNE XM7M +NXTM7M CLC + LDA ESTKL-6,X + ADC SRCL + STA SRCL + LDA ESTKH-6,X + ADC SRCH + STA SRCH + LDA ESTKL-10,X + ADC DSTL + STA DSTL + LDA ESTKH-10,X + ADC DSTH + STA DSTH + BNE YM7M ; BRA +RETM7M RTS +end +asm _dcgrOpMemBl7MemB +YOM7M LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BEQ RETM7M + INC ESTKL-2,X ; Y COORD++ + CMP ESTKL-8,X ; OUT OF BOUNDS? + BCS NXTOM7M + LDY ESTKL-3,X ; WIDTH7 +XOM7M DEY + LDA (SRC),Y +end +asm _dcgrOpMemBl7MemC + EOR (DST),Y + STA (DST),Y + LDA (SRC),Y +end +asm _dcgrOpMemBl7MemD + EOR (DST),Y + STA (DST),Y + DEY + LDA (SRC),Y +end +asm _dcgrOpMemBl7MemE + EOR (DST),Y + STA (DST),Y + DEY + LDA (SRC),Y +end +asm _dcgrOpMemBl7MemF + EOR (DST),Y + STA (DST),Y + CPY #$00 + BNE XOM7M +NXTOM7M CLC + LDA ESTKL-6,X + ADC SRCL + STA SRCL + LDA ESTKH-6,X + ADC SRCH + STA SRCH + LDA ESTKL-10,X + ADC DSTL + STA DSTL + LDA ESTKH-10,X + ADC DSTH + STA DSTH + BNE YOM7M ; BRA +RETOM7M RTS +end +export asm dcgrFillBl7Scr(x7, y, w7, h)#0 + INX + INX + INX + INX + LDA #20 +end +asm _clipFillBl7Scr + JSR $F000 ; CLIP7 + BCS RETFILS + LDA ESTKL-2,X ; Y COORD + ;CLC + ADC ESTKL-4,X ; HEIGHT + STA ESTKL-4,X ; -> BOTTOM EDGE + ASL ESTKL-3,X ; WIDTH7 * 2 + ASL ESTKL-1,X ; X7 COORD * 2 +YFILS LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BEQ RETFILS + INC ESTKL-2,X ; Y COORD++ + CMP #192 ; OFF SCREEN? + BCS YFILS + TAY + LDA ESTKL-1,X ; X7 COORD +end +asm _dcgrFillBl7ScrA + ADC $1000,Y ; HGRSCANL + STA DSTL + LDA #$00 + ADC $2000,Y ; HGRSCANH + STA DSTH + LDY ESTKL-3,X ; WIDTH7 +XFILS STA $C055 ; PAGE1X + DEY +end +asm _dcgrFillBl7ScrB + LDA $3002 ; AUXCLRH + STA (DST),Y + LDA $3000 ; AUXCLRL + DEY + STA (DST),Y + STA $C054 ; PAGE1M + INY +end +asm _dcgrFillBl7ScrC + LDA $3003 ; MEMCLRH + STA (DST),Y + LDA $3001 ; MEMCLRL + DEY + STA (DST),Y + BNE XFILS + BEQ YFILS ; BRA +RETFILS RTS +end +export asm dcgrFillBl7Mem(x7, y, w7, h, dstptr, dstspan)#0 + TXA + CLC + ADC #6 + TAX + LDA ESTKL-6,X ; SPAN + LSR + LSR +end +asm _clipFillBl7Mem + JSR $F000 ; CLIP7 + BCS RETFILM + LDA ESTKL-2,X ; Y COORD + ;CLC + ADC ESTKL-4,X ; HEIGHT + STA ESTKL-4,X ; -> BOTTOM EDGE + LDA ESTKL-1,X ; X7 * 4 + ASL + ASL + ;CLC + ADC ESTKL-5,X ; DSTPTR + STA DSTL + LDA #$00 + ADC ESTKH-5,X + STA DSTH + ASL ESTKL-3,X ; WIDTH7 * 4 + ASL ESTKL-3,X +YFILM LDA ESTKL-2,X ; Y COORD + CMP ESTKL-4,X ; AT BOTTOM? + BEQ RETFILM + INC ESTKL-2,X ; Y COORD++ + CMP #192 ; OFF SCREEN? + BCS NXTFILM + LDY ESTKL-3,X ; WIDTH7 +end +asm _dcgrFillBl7MemA +XFILM LDA $3003 ; MEMCLRH + DEY + STA (DST),Y + LDA $3002 ; AUXCLRH + DEY + STA (DST),Y + LDA $3001 ; MEMCLRL + DEY + STA (DST),Y + LDA $3000 ; AUXCLRL + DEY + STA (DST),Y + BNE XFILM +NXTFILM CLC + LDA ESTKL-6,X + ADC DSTL + STA DSTL + LDA ESTKH-6,X + ADC DSTH + STA DSTH + BNE YFILM ; BRA +RETFILM RTS +end +// +// Wait for VLB +// +export asm dcgrVLB#0 + PHP + SEI + STA $C079 ; Enable IOU access and reset VBL int on //c + STA $C05B ; Enable VBL int +- LDA $C019 + STA $C079 ; Reset VBL int on //c + BMI - +- LDA $C019 + BPL - + STA $C05A ; Disable VBL int on //c + STA $C078 ; Disable IOU access on //c + PLP + RTS +end +export def dcgrOpScr(op)#0 + byte opcode + + // + // Self modifying code! + // + opcode = $11 // ORA (ZP),Y + when op + is OP_XOR + opcode = opcode + $20 // $51 = EOR (ZP),Y + is OP_AND + opcode = opcode + $20 // $31 = AND (ZP),Y + is OP_OR + _jmpOpPlotScr:1 = @_dcgrOpPlotScrC + _dcgrOpPlotScrD.3 = opcode + _dcgrOpPlotScrE.3 = opcode + _dcgrOpPlotScrG.3 = opcode + _dcgrOpPlotScrH.3 = opcode + opcode = opcode - $10 // ORA (ZP,X) + _jmpOpMemBl7Scr:1 = @_dcgrOpMemBl7ScrA + _dcgrOpMemBl7ScrC.0 = opcode + _dcgrOpMemBl7ScrD.0 = opcode + _dcgrOpMemBl7ScrE.0 = opcode + _dcgrOpMemBl7ScrF.0 = opcode + break + otherwise // OP_SRC + _jmpOpPlotScr:1 = @_dcgrPlotScrC + _jmpOpMemBl7Scr:1 = @_dcgrMemBl7ScrA + wend +end +export def dcgrOpMem(op)#0 + byte opcode + + // + // Self modifying code! + // + opcode = $11 // ORA (ZP),Y + when op + is OP_XOR + opcode = opcode + $20 // $51 = EOR (ZP),Y + is OP_AND + opcode = opcode + $20 // $31 = AND (ZP),Y + is OP_OR + _jmpOpPlotMem:1 = @_dcgrOpPlotMemC + _dcgrOpPlotMemD.3 = opcode + _dcgrOpPlotMemE.3 = opcode + _dcgrOpPlotMemG.3 = opcode + _dcgrOpPlotMemH.3 = opcode + _jmpOpMemBl7Mem:1 = @_dcgrOpMemBl7MemB + _dcgrOpMemBl7MemC.0 = opcode + _dcgrOpMemBl7MemD.0 = opcode + _dcgrOpMemBl7MemE.0 = opcode + _dcgrOpMemBl7MemF.0 = opcode + break + otherwise // OP_SRC + _jmpOpPlotMem:1 = @_dcgrPlotMemC + _jmpOpMemBl7Mem:1 = @_dcgrMemBl7MemB + wend +end +export def dcgrAllocBl7Mem(w, h)#3 + word memblk, w7, span + + w7 = (w+14)/7 + span = w7 * 4 + memblk = heapalloc(span * h) + return memblk, span, w7 +end +export def dcgrMode(mode) + if mode >= 0 + ^page1m + ^showfull + ^showhires + ^showgraphics + ^IOUdis = 0 + ^show80col = 0 + ^dhresena + ^store80ena = 0 + dcgrOpScr(OP_SRC) + dcgrOpMem(OP_SRC) + dcgrColor(0) + dcgrFillBl7Scr(0, 0, 20, 192) + else + ^store80dis = 0 + ^dhresdis + ^show40col = 0 + ^showtext + ^page1m + fin + return mode +end +// +// Make sure we are a 128K //e or //c +// +if MACHID & $F0 <> $B0 + puts("\n128K required for double color graphics.\n") + ^$C010 + while ^$C000 < 128; loop + return -1 +fin +// +// Assembly symbol fixups +// +_dcgrColorA:1 = @auxclrsl +_dcgrColorA:4 = @auxclrl +_dcgrColorA:7 = @auxclrsh +_dcgrColorA:10 = @auxclrh +_dcgrColorA:13 = @memclrsl +_dcgrColorA:16 = @memclrl +_dcgrColorA:19 = @memclrsh +_dcgrColorA:22 = @memclrh +// +// Screen function fixups +// +_dcgrPlotScrA:1 = @hgrscanl +_dcgrPlotScrA:6 = @hgrscanh +_dcgrPlotScrB:1 = @divmod7 +_dcgrPlotScrC:1 = @auxclrmsk +_dcgrPlotScrD:1 = @auxclrl +_dcgrPlotScrD:6 = @auxclrmsk +_dcgrPlotScrE:1 = @auxclrh +_dcgrPlotScrE:6 = @auxclrmsk +_dcgrPlotScrF:1 = @memclrmsk +_dcgrPlotScrG:1 = @memclrl +_dcgrPlotScrG:6 = @memclrmsk +_dcgrPlotScrH:1 = @memclrh +_dcgrPlotScrH:6 = @memclrmsk +_dcgrOpPlotScrC:1 = @auxclrmsk +_dcgrOpPlotScrD:1 = @auxclrl +_dcgrOpPlotScrE:1 = @auxclrh +_dcgrOpPlotScrF:1 = @memclrmsk +_dcgrOpPlotScrG:1 = @memclrl +_dcgrOpPlotScrH:1 = @memclrh +_dcgrHLinScrA:1 = @hgrscanl +_dcgrHLinScrA:6 = @hgrscanh +_dcgrHLinScrB:1 = @_dcgrPlotScrB +_dcgrVLinScrA:1 = @hgrscanl +_dcgrVLinScrA:6 = @hgrscanh +_dcgrVLinScrB:1 = @_dcgrPlotScrB +_dcgrPixScrA:1 = @hgrscanl +_dcgrPixScrA:6 = @hgrscanh +_dcgrPixScrB:1 = @_dcgrColorA +_dcgrPixScrC:1 = @_dcgrPlotScrB +_dcgrPixScrD:1 = @_dcgrColorA +_dcgrPixScrE:1 = @_dcgrPlotScrB +_clipFillBl7Scr:1 = @_clip7 +_dcgrFillBl7ScrA:1 = @hgrscanl +_dcgrFillBl7ScrA:8 = @hgrscanh +_dcgrFillBl7ScrB:1 = @auxclrh +_dcgrFillBl7ScrB:6 = @auxclrl +_dcgrFillBl7ScrC:1 = @memclrh +_dcgrFillBl7ScrC:6 = @memclrl +// +// Memory function fixups +// +_dcgrPlotMemB:1 = @divmod7 +_dcgrPlotMemC:1 = @auxclrmsk +_dcgrPlotMemD:1 = @auxclrl +_dcgrPlotMemD:6 = @auxclrmsk +_dcgrPlotMemE:1 = @auxclrh +_dcgrPlotMemE:6 = @auxclrmsk +_dcgrPlotMemF:1 = @memclrmsk +_dcgrPlotMemG:1 = @memclrl +_dcgrPlotMemG:6 = @memclrmsk +_dcgrPlotMemH:1 = @memclrh +_dcgrPlotMemH:6 = @memclrmsk +_dcgrOpPlotMemC:1 = @auxclrmsk +_dcgrOpPlotMemD:1 = @auxclrl +_dcgrOpPlotMemE:1 = @auxclrh +_dcgrOpPlotMemF:1 = @memclrmsk +_dcgrOpPlotMemG:1 = @memclrl +_dcgrOpPlotMemH:1 = @memclrh +_dcgrHLinMemB:1 = @_dcgrPlotMemB +_dcgrVLinMemB:1 = @_dcgrPlotMemB +_dcgrPixMemB:1 = @_dcgrColorA +_dcgrPixMemC:1 = @_dcgrPlotMemB +_dcgrPixMemD:1 = @_dcgrColorA +_dcgrPixMemE:1 = @_dcgrPlotMemB +_clipFillBl7Mem:1 = @_clip7 +_dcgrFillBl7MemA:1 = @memclrh +_dcgrFillBl7MemA:7 = @auxclrh +_dcgrFillBl7MemA:13 = @memclrl +_dcgrFillBl7MemA:19 = @auxclrl +// +// Memory <-> Screen Block Transfer fixups +// +_dcgrScrBl7MemA:1 = @hgrscanl +_dcgrScrBl7MemA:8 = @hgrscanh +_clipMemBl7Src:1 = @_clip7 +_dcgrMemBl7ScrB:1 = @hgrscanl +_dcgrMemBl7ScrB:8 = @hgrscanh +_dcgrOpMemBl7ScrB:1 = @hgrscanl +_dcgrOpMemBl7ScrB:8 = @hgrscanh +// +// Memory <-> Memory Block Transfer fixups +// +_clipMemBl7Mem:1 = @_clip7 + +done