<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Tomas<div class="">As hint: My structure looks like this:<div class=""><br class=""><div class=""><font face="Courier" size="1" class="">...<br class=""></font><div class=""><font face="Courier" size="1" class="">d := da - sa; n := u1 - v1;</font></div><div class=""><font face="Courier" size="1" class="">IF d >= 0 THEN sa0 := sa + (h-1)* LINELEN; end := sa - LINELEN; step := -LINELEN (* copy up, scan down *)</font></div><div class=""><font face="Courier" size="1" class="">ELSE sa0 := sa; end := sa + h* LINELEN; step := LINELEN (* copy down, scan up *)</font></div><div class=""><font face="Courier" size="1" class="">END;</font></div><div class=""><font face="Courier" size="1" class="">WHILE sa0 # end DO</font></div><div class=""><font face="Courier" size="1" class=""> IF n >= 0 THEN (* shift right *)</font></div><div class=""><font face="Courier" size="1" class=""> IF v1 + w*BPP < 32 THEN (* in same word *)</font></div><div class=""><font face="Courier" size="1" class=""> ...</font></div><div class=""><font face="Courier" size="1" class=""> ELSE (* general case *)</font></div><div class=""><font face="Courier" size="1" class=""> ...</font></div><div class=""><font face="Courier" size="1" class=""> END</font></div><div class=""><font face="Courier" size="1" class=""> ELSE (* shift left *)</font></div><div class=""><font face="Courier" size="1" class=""> IF v1 + w*BPP < 32 THEN (* in same word *)</font></div><div class=""><font face="Courier" size="1" class=""> ...</font></div><div class=""><font face="Courier" size="1" class=""> ELSE (* general case *)</font></div><div class=""><font face="Courier" size="1" class=""> ...</font></div><div class=""><font face="Courier" size="1" class=""> END</font></div><div class=""><font face="Courier" size="1" class=""> END;</font></div><div class=""><font face="Courier" size="1" class=""> INC(sa0, step)</font></div><div class=""><font face="Courier" size="1" class="">END</font><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 22.02.2019 um 15:15 schrieb Tomas Kral <<a href="mailto:thomas.kral@email.cz" class="">thomas.kral@email.cz</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">I have coded optimised Display.CopyBlock(), now putting it to a real<br class="">test with `DIY Dialogs' I need to revisit my coding, that actually borrows from the original.<br class=""><br class="">PROCEDURE CopyBlock*(sx, sy, w, h, dx, dy, mode: INTEGER); (*only for mode = replace*)<br class="">d := da - sa; n := u1 - v1; (*displacement in words and bits*)<br class="">(*len := (u2 - u0) * 4;*) len := (v2 - v0) * 4; (*source/target word span in bytes*)<br class="">...<br class="">IF dx = sx THEN (*scroll up / down*)<br class=""> (*use of SYSTEM.COPY()*)<br class="">ELSIF (dy = sy) & (n <= 0) THEN (*scroll right*)<br class=""> (*use of ASR,LSL*)<br class="">ELSIF (dy = sy) & (n > 0) THEN (*scroll left*)<br class=""> (*use of ASR,LSL*)<br class="">ELSIF n <= 0 THEN (*shift diagonal right*)<br class=""> (*use of ROR*)<br class="">ELSE (*n > 0 shift diagonal left*)<br class=""> (*use of ROR*)<br class="">END<br class="">...<br class=""><br class="">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 <br class="">[1] scroll up /or down by 1 pixel (*optimised*)<br class="">[2] do a diagonal move (*functional*)<br class=""><br class="">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.<br class=""><br class="">Many thanks.<br class=""><br class="">-- <br class="">Tomas Kral <<a href="mailto:thomas.kral@email.cz" class="">thomas.kral@email.cz</a>><br class="">--<br class=""><a href="mailto:Oberon@lists.inf.ethz.ch" class="">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br class=""><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" class="">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br class=""></div></div></blockquote></div><br class=""></div></div></div></div></body></html>