[Oberon] System5 - Optimised CopyBlock()

Tomas Kral thomas.kral at email.cz
Fri Feb 22 15:15:13 CET 2019


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>


More information about the Oberon mailing list