[Oberon] System-V - Frame Clipping

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Mon Mar 4 17:00:36 CET 2019


  > Hi Andreas,
   >
   > mask := SYSTEM.VAL(SET, ASR(7FFFFFFFH, 31-x));
   >
   > Thank you, will toy with your line code.
   >
   > The mask above is interesting, not sure I get the idea yet,
   > as I still use older version of D.CopyPattern();
   >

Hi Tomas,

The mask named “mask” in CopyPattern wasn’t the one I was referring too
(it was introduced in a recent change to the official Display.CopyPattern).

I was referring to the masks called “ml” and “ml” in the (modified) CopyPattern
below, which accepts margins “left”, “right”, “top” and “bot” as parameters:

  PROCEDURE CopyPattern*(col, patadr, x, y, left, right, top, bot, mode: INTEGER);     (* <--- margins added*)
    VAR … ml, mr: SET;
  BEGIN
    ...
    INC(patadr, 2 + bot*((w + 7) DIV 8)); h := h - top - bot;      (* <--- this clips the pattern from the bottom and the top*)
    
    FOR a0 := a TO a + (h-1)*128 BY 128 DO
      ...
      IF left + right > 0 THEN                                     (* <--- and this clips the pattern from the left and from the right*)
        ml := {0 .. w-right-1}; mr := {left .. w-1};
        pwd := SYSTEM.VAL(INTEGER, SYSTEM.VAL(SET, pwd) * ml * mr)
      END ;
      ...
    END
  END CopyPattern;

HTH, 
-ap


More information about the Oberon mailing list