[Oberon] System5 - Optimised CopyBlock()

Jörg joerg.straube at iaeth.ch
Fri Feb 22 16:11:43 CET 2019


Tomas
As hint: My structure looks like this:

...
d := da - sa; n := u1 - v1;
IF d >= 0 THEN sa0 := sa + (h-1)* LINELEN; end := sa - LINELEN;    step := -LINELEN  (* copy up, scan down *)
ELSE           sa0 := sa;                  end := sa + h* LINELEN; step := LINELEN   (* copy down, scan up *)
END;
WHILE sa0 # end DO
   IF n >= 0 THEN                                  (* shift right *)
     IF v1 + w*BPP < 32 THEN (* in same word *)
       ...
     ELSE                    (* general case *)
     ...
     END
   ELSE                                            (* shift left *)
       IF v1 + w*BPP < 32 THEN (* in same word *)
         ...
       ELSE                    (* general case *)
       ...
       END
   END;
   INC(sa0, step)
END

> Am 22.02.2019 um 15:15 schrieb Tomas Kral <thomas.kral at email.cz>:
> 
> Hi,
> 
> I have coded optimised Display.CopyBlock(), now putting it to a real
> test with `DIY Dialogs' I need to revisit my coding, that actually borrows from the original.
> 
> PROCEDURE CopyBlock*(sx, sy, w, h, dx, dy, mode: INTEGER); (*only for mode = replace*)
> d := da - sa; n := u1 - v1; (*displacement in words and bits*)
> (*len := (u2 - u0) * 4;*) len := (v2 - v0) * 4; (*source/target word span in bytes*)
> ...
> IF dx = sx THEN (*scroll up / down*)
>  (*use of SYSTEM.COPY()*)
> ELSIF (dy = sy) & (n <= 0) THEN (*scroll right*)
>  (*use of ASR,LSL*)
> ELSIF (dy = sy) & (n > 0) THEN (*scroll left*)
>  (*use of ASR,LSL*)
> ELSIF n <= 0 THEN (*shift diagonal right*)
>  (*use of ROR*)
> ELSE (*n > 0 shift diagonal left*)
>  (*use of ROR*)
> END
> ...
> 
> I am not happy with my coding for horizontal scroll, has problems in some test cases. As a temporary solution for (dy = sy) case I wish to 
> [1] scroll up /or down by 1 pixel (*optimised*)
> [2] do a diagonal move (*functional*)
> 
> I could possibly introduce CopyBlock0(), and call from CopyBlock(), but I would prefer call CopyBlock() from within itself, but cannot figure out how, so the recursion is properly terminated.
> 
> Many thanks.
> 
> -- 
> Tomas Kral <thomas.kral at email.cz>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20190222/0922e7c8/attachment.html>


More information about the Oberon mailing list