[Oberon] FPGA - Screen.Mod
Tomas Kral
thomas.kral at email.cz
Sun Sep 17 15:58:51 CEST 2017
Hi Paul,
This made the trick in the end, but I fear is not much effective as the
`ReverseByte' is called four times per display word. The masking code
of yours seems four times faster, if could be updated for big endian
somehow?
PROCEDURE ReverseByte(wd: INTEGER): INTEGER;
VAR i: INTEGER; rwd, t: SET;
BEGIN
rwd := {}; FOR i := 0 TO 7 DO
t := SYSTEM.VAL(SET, ASR(wd, i))*{0};
t := SYSTEM.VAL(SET, LSL(SYSTEM.VAL(INTEGER, t), 7-i));
rwd := rwd+t;
END
RETURN SYSTEM.VAL(INTEGER, rwd) END ReverseByte;
...
(*little endian: high, low words*)
hwd := bits MOD 10000H; lwd := bits DIV 10000H;
(*big endian: high, low bytes, bit reversed*)
bits := ReverseByte(lwd DIV 100H)*1000000H +
ReverseByte(lwd MOD 100H)*10000H +
ReverseByte(hwd DIV 100H)*100H +
ReverseByte(hwd MOD 100H);
...
Why do we need bit reversal at all?
Why the bitmap is stored as inverse video?
Many thanks
--
Tomas Kral <thomas.kral at email.cz>
More information about the Oberon
mailing list