[Oberon] PO2013 - CopyBlock
Jörg
joerg.straube at iaeth.ch
Wed Jul 8 21:52:24 CEST 2020
Tomas
I think your horizontal approach is not implemented correctly:
1) I expected something like „IF dy = sy THEN“
2) your code overwrites the horizontal line with length „w“ starting at (dx, dy-1)
3) did you check your horizontal code for sy = dy = 0.
Br Jörg
> Am 08.07.2020 um 15:34 schrieb Tomas Kral <thomas.kral at email.cz>:
>
> Hi,
>
> As I have optimised vertical scroll w/ SYSTEM.COPY,
> I do horizontal scroll recursive.
>
> IF sx = sy THEN (*horizontal scroll*)
> CopyBlock(sx, sy, w, h, dx, dy-1, mode);
> CopyBlock(dx, dy-1, w, h, dx, dy, mode)
> ELSE
> IF dx = sx THEN (*vertical scroll w/ SYSTEM.COPY*)
> ELSIF n <= 0 THEN (*diagonal right*)
> ELSE (*diagonal left*)
> END
> END
>
> I have two versions of diagonal shift,
> [a] using ASR LSL, shorter slower code
> [b] using ROR, faster bigger code
>
> Running a little benchmark on moving an arbitrary block of 400x300 pixels (4bit colour) horizontally and diagonally.
>
> [a]
> diagonal left 59 ms
> diagonal right 58 ms
> horizontal left 50 ms
> horizontal right 50 ms
>
> [b]
> diagonal left 51 ms
> diagonal right 48 ms
> horizontal left 42 ms
> horizontal right 40 ms
>
> The recursion has only 8 ms overhead, some 8 ms is also the delta between faster [b] and [a] variant.
>
> --
> 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
More information about the Oberon
mailing list