IF vTicks>6
AND vTicks<=512
THEN
TRUSTED {
x, xStop, xMod, xInc: INT;
yStart, yStop, yInc, yCur: LONG CARDINAL;
dr: CD.Rect = CDBasics.Intersection[me.deviceDrawRef.interestClip, paintRef.rect]; -- design coords
vr:
CD.Rect ← CDVScale.DesignToViewerRect[me.scale,
CD.Rect[
-- viewer coords
x1: ModDown[dr.x1, dTicks],
y1: ModDown[dr.y1, dTicks],
x2: ModUp[dr.x2, dTicks],
y2: ModUp[dr.y2, dTicks]
]];
vx1, vy1, vx2, vy2: CARDINAL; -- rect in V-coords; snapped to tick positions
vx1 ← IF vr.x1>=0 THEN vr.x1 ELSE vr.x1 + ModUp[-vr.x1, vTicks];
vy1 ← IF vr.y1>=0 THEN vr.y1 ELSE vr.y1 + ModUp[-vr.y1, vTicks];
vx2 ← IF vr.x2<=me.viewer.cw THEN vr.x2 ELSE vr.x2-ModUp[vr.x2-me.viewer.cw, vTicks];
vy2 ← IF vr.y2<=me.viewer.ch THEN vr.y2 ELSE vr.y2-ModUp[vr.y2-me.viewer.ch, vTicks];
-- Now v.. denotes area for ticks; vTicks denote increment; in viewer coordinates
me.xBBptr.width ← me.bpp;
me.xBBptr.height ← 1;
me.xBBptr.src ← [LOOPHOLE[black],,0];
me.xBBptr.srcDesc ← PrincOps.SrcDesc[gray[PrincOps.GrayParm[
yOffset: 0,
widthMinusOne: 0, --words
heightMinusOne: 0 --lines
]]];
me.xBBptr.flags ← PrincOps.BitBltFlags[
direction: forward,
disjoint: TRUE,
disjointItems: TRUE,
gray: TRUE,
srcFunc: null,
dstFunc: or
];
xInc ← vTicks*me.bpp;
x ← Basics.LongMult[vx1+me.vx, me.bpp]; --x start
xStop ← Basics.LongMult[vx2+me.vx, me.bpp];
yInc ← vTicks*me.scWidthWords;
yStart ← LOOPHOLE[me.screen + Basics.LongMult[(me.vy-vy2), me.scWidthWords] ];
yStop ← LOOPHOLE[me.screen + Basics.LongMult[(me.vy-vy1), me.scWidthWords] + xStop/Basics.bitsPerWord];
BEGIN
DoIt:
PROC [] =
TRUSTED {
WHILE x<=xStop
DO
yCur ← yStart+LOOPHOLE[(x/Basics.bitsPerWord), LONG CARDINAL];
xMod ← x MOD Basics.bitsPerWord;
WHILE yCur<=yStop
DO
me.xBBptr.dst ← [LOOPHOLE[yCur],, xMod];
PrincOpsUtils.BITBLT[me.xBBptr];
yCur ← yCur+yInc
ENDLOOP;
x ← x+xInc;
ENDLOOP;
};
IF me.bpp=1 THEN DoIt[] ELSE Terminal.ModifyColorFrame[virtual, DoIt];
END;
};