[Oberon] FPGA - Bitmaps.Mod

Tomas Kral thomas.kral at email.cz
Wed Apr 19 19:03:23 CEST 2017


Hi,

I am now able to allocate memory for a bitmap with given dimensions
and origin (a bounding rectangle x,y,w,h).

Looking further into ETH code, I wish to continue with DisplayBlock
implementation.

I assume B/W coulours for the depth=1, and I set these as constants for
little understanding of them
...
CONST linelength = 1024 DIV 8; EZoom = 0; bytes = 1;
    Height = 768;
...

PROCEDURE DisplayBlock*(B: Bitmap; sx, sy, w, h, dx, dy, mode: INTEGER);
VAR pw, pd, src, dst, h1 : LONGINT;
...
pd := B.depth; (*0;  SYSTEM.GET(adr+4, SYSTEM.VAL(INTEGER, pd));*)
    IF pd = 1 THEN
      pw := B.width; (*SYSTEM.GET(adr+8, pw);*)
      src := B.base; (*SYSTEM.GET(adr+12, src);*)
      INC(src, (dy+h-1)*pw + dx);  (* top left corner *)
      sy := Height-sy-h;  (* convert to screen coordinate *)
      dst := Display.Base+(LSL(sy*linelength, EZoom) + sx)*bytes;
      IF mode = Display.invert THEN
        REPEAT
          DisplayBlock2(src, dst, w);
          DEC(h);  DEC(src, pw);  INC(dst, LSL(linelength*bytes, EZoom))
        UNTIL h = 0
      ELSE
        REPEAT
          DisplayBlock0(src, dst, w);
          DEC(h);  DEC(src, pw);  INC(dst, LSL(linelength*bytes, EZoom))
        UNTIL h = 0
      END;
      (*PutImage( sx, (Height-sy-h1), w, h1);*)
    ELSE  (* depth not supported *)
      Display.ReplConst(1, sx, sy, w, h, mode)
    END;
...

The code as I believe, copies a bitmap by lines from B.base address to
Display.Base address, masking out bits sticking out the rectangle.
Also OR-XOR inside bits depending on the mode. (I leave out clipping to
a visible area for the time being)

But does not work so far, does not obey x,y, also w,h.

Tomas



More information about the Oberon mailing list