[Oberon] FPGA - Display.CopyBlock()

Tomas Kral thomas.kral at email.cz
Mon Sep 3 09:13:50 CEST 2018


`Display.CopyBlock()' is primarilly used to scroll viewer text up/down.
I learnt the code is more general however, capable of skewing
horizontally, even diagonally.

For diagonal moves, I sometime observe areas left blank, not
copied from the source rectangle. It only happens in the last word
shifted either left or right.

  CONST X = 50; Y = 50; W = 50; H = 50;
    DX = 40; DY = 40; 
  Display.ReplConst(Display.white, X, Y, W, H, Display.replace);
  Display.CopyBlock(X, Y, W, H, DX, DY, Display.invert); (*shift down
  Display.CopyBlock(X, Y, W, H, DX+20, DY+20, Display.invert) (*shift
  up right*)
END Test;

I do not understand code fully yet, by tinkering with it, I
possibly pinned down the lines where some improvement may happen.

PROCEDURE CopyBlock*();
IF n >= 0 THEN (*shift right*)
 FOR ... END;
 SYSTEM.GET(sa0, src); src := ROR(src, n); (*ASR used instead?*)
 SYSTEM.GET(sa0+d, dst);
 SYSTEM.PUT(sa0+d, (src * m0) + (dst - m0))
ELSE (*shift left*)
 FOR ... END;
 SYSTEM.GET(sa0+len, src); src := ROR(src, n); (*ASR used instead?*)
 SYSTEM.GET(sa0+len+d, dst);
 SYSTEM.PUT(sa0+len+d, (src - m2) + (dst * m2))

Tomas Kral <thomas.kral at email.cz>

More information about the Oberon mailing list