Repository navigation
Expand file tree
/
Copy pathDim3Base.Mod
More file actions
49 lines (41 loc) · 1.63 KB
/
Copy pathDim3Base.Mod
File metadata and controls
49 lines (41 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(* ETH Oberon, Copyright 2001 ETH Zuerich Institut fuer Computersysteme, ETH Zentrum, CH-8092 Zuerich.
Refer to the "General ETH Oberon System Source License" contract available at: http://www.oberon.ethz.ch/ *)
MODULE Dim3Base; (** portable *) (* David Ulrich Nov 95 - März 96 *)
(* This module contains not portable procedures for the Native version **)
IMPORT S := SYSTEM, Pictures;
CONST Black* = 15; White* = 0; (** black and white of the windows color table **)
VAR
baseAdr, lineW, height: LONGINT;
(** correct color table for Native version **)
PROCEDURE CheckColorTab*(VAR R, G, B: ARRAY OF INTEGER);
BEGIN
(* nothing to do *)
END CheckColorTab;
(** convert color number to Dim3 color palette **)
PROCEDURE GetRealColor*(color: INTEGER):INTEGER;
BEGIN
RETURN color
END GetRealColor;
(** calculate picture addresses **)
PROCEDURE SetPicture*(P: Pictures.Picture);
BEGIN
baseAdr := P.address;
lineW := P.width; height := P.height;
END SetPicture;
(** get address of position X in current scanline Y of actual picture **)
PROCEDURE GetAddress*(X, Y: INTEGER): LONGINT;
BEGIN
RETURN baseAdr + lineW * Y + X;
END GetAddress;
(** ReplConst in previosly set picture with mode replace, H = 1 **)
PROCEDURE ReplConst*(col, X, Y, W: INTEGER);
VAR col4: SET; color: CHAR; pictAdr: LONGINT; color4: ARRAY 4 OF CHAR;
BEGIN
color := CHR(col);
color4[0] := color; color4[1] := color; color4[2] := color; color4[3] := color;
col4 := S.VAL(SET, color4);
pictAdr := baseAdr + lineW * Y + X;
WHILE W > 4 DO S.PUT(pictAdr, col4); DEC(W, 4); INC(pictAdr, 4) END;
WHILE W > 0 DO S.PUT(pictAdr, color); DEC(W); INC(pictAdr) END;
END ReplConst;
END Dim3Base.