UnsafeTile.mesa
Copyright Ó 1988, 1991 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) October 9, 1988 12:12:31 pm PDT
Michael Plass, October 14, 1988 11:40:21 am PDT
DIRECTORY RasterBasics;
UnsafeTile: DEFINITIONS = BEGIN
Arg: TYPE = LONG POINTER TO ArgRecord;
ArgRecord: TYPE = RECORD [
dstWord: WordPtr ¬ NIL, -- pointer to first word of dst to change
dstBit: BitOffset ¬ 0, -- bit offset for first dst bit
dstBpl: NAT ¬ 0, -- destination bits per line
fSize: NAT ¬ 0, -- destination dots per line
sSize: NAT ¬ 0, -- destination number of lines
srcWord: WordPtr ¬ NIL, -- pointer to first word of src brick
srcBit: BitOffset ¬ 0, -- bit offset for first src bit
srcBpl: NAT ¬ 0, -- source bits per line
fSizeTile: NAT ¬ 0, -- dots per line of src
sSizeTile: NAT ¬ 0, -- number of lines of src
firstBit: NAT ¬ 0, -- first bit in first line of src tile; assert: firstBit < fSizeTile
firstLine: NAT ¬ 0, -- first line of src tile to get moved; assert: firstLine < sSizeTile
phase: NAT ¬ 0, -- phase shift for subsequent lines; assert: phase < fSizeTile
srcInvert: WORD ¬ 0, -- XOR'd with every source word fetched
dstFunc: DstFunc ¬ null -- dst function to perform
];
DstFunc: TYPE = RasterBasics.DstFunc;
BitOffset: TYPE = CARDINAL[0..BITS[WORD]);
WordPtr: TYPE = LONG POINTER TO WORD;
Op: UNSAFE PROC [arg: Arg];
Performs the tiling operation specified by the argument. Some modest argument block checking is performed (checks for arg.firstBit < arg.fSizeTile AND arg.phase < arg.fSizeTile AND arg.firstLine < arg.sSizeTile). This procedure then determines which of the following fast cases to invoke.
Fast1: UNSAFE PROC [arg: Arg];
Performs Op for the case when arg.fSizeTile = 2**N and arg.fSizeTile <= BITS[WORD]. No argument block checking is performed.
Fast2: UNSAFE PROC [arg: Arg];
Performs Op for the case when arg.fSizeTile <= BITS[WORD]. No argument block checking is performed.
Fast3: UNSAFE PROC [arg: Arg];
Performs Op for the case when arg.fSizeTile > BITS[WORD]. No argument block checking is performed.
DumbOp: UNSAFE PROC [arg: Arg];
Performs the tiling operation specified by the argument a bit at a time. Included for reference purposes. Probably excruciatingly slow.
END.