replace*=0; (* The new graphical object completely replaces whatever was before in the destination area. *)
paint*=1; (* The new graphical object is added to whatever was before in the dertination area. *)
invert*=2; (* The new graphical object inverts whatever was before in the dertination area. The color specifies, which planes are affected (inverted) and which aren't *)
PictFileId*= - 4093;
BitMapPtr=POINTER TO G.BitMap;
LayerPtr=POINTER TO G.Layer;
RastPortPtr=POINTER TO G.RastPort;
WindowPtr=POINTER TO I.Window;
ScreenPtr=POINTER TO I.Screen;
ColMem=ARRAY 256 OF RECORD r, g, b: CHAR END;
Pattern*=LONGINT;
Picture*=POINTER TO PictureDesc;
Notifier*=PROCEDURE (P: Picture; X, Y, W, H : INTEGER);
PictureDesc*=RECORD
width*,height*,depth*:INTEGER;
XOff, YOff: INTEGER;
notify*:Notifier;
bitMap:G.BitMap; (* Used only in CreateLayer, FreeLayer; V<39*)
bitMapPtr:G.BitMapPtr; (* Used only in CreateLayer, FreeLayer; V>=39*)
layer:G.LayerPtr;
layerInfo: G.LayerInfoPtr; (* Used only in CreateLayer, FreeLayer *)
rp*: G.RastPortPtr;
pal: ColMem;
oldCol:INTEGER;
oldMode:INTEGER
END ;
Frame*=POINTER TO FrameDesc;
FrameMsg*=RECORD END;
Handler*=PROCEDURE (f: Frame; VAR msg: FrameMsg);
FrameDesc*=RECORD
dsc*, next*: Frame;
X*, Y*, W*, H*: INTEGER;
handle*: Handler
END;
PatternNode=POINTER TO RECORD
p: Amiga.PatternInfoPtr;
next: PatternNode
END;
dots*: Pattern;
ToPrint*: Picture;
rev: ARRAY 16 OF INTEGER;
defaultPicture:Picture;
nofCols:INTEGER;
patternRoot:PatternNode;
gfxBase:LONGINT;
swap: ARRAY 256 OF SYSTEM.BYTE;
DispColBuffer: ColMem;
PROCEDURE SetDisplayColor*(col, red, green, blue: INTEGER); (*col < 0: overlay color not supported on the Amiga*)
Set the RGB values for a screen color.
scr:ScreenPtr;
win: WindowPtr;
BEGIN
IF Amiga.ModifyColors & (col<nofCols) & (col>=0) THEN
win := SYSTEM.VAL(WindowPtr, Amiga.window);
scr := SYSTEM.VAL(ScreenPtr, win.wScreen);
IF G.gfxVersion<39 THEN
G.SetRGB4(
SYSTEM.VAL(G.ViewPortPtr,SYSTEM.ADR(scr.viewPort)),(col MOD nofCols)+Amiga.ColorOffset,
red DIV 16, green DIV 16,blue DIV 16)
ELSE
G.SetRGB32(
SYSTEM.VAL(G.ViewPortPtr,SYSTEM.ADR(scr.viewPort)),(col MOD nofCols)+Amiga.ColorOffset,
As CopyBlock, but the destination area is clipped against the Frame boundary.
VAR dx, dy: INTEGER;
BEGIN
IF (W <= 0) OR (H <= 0) THEN RETURN END;
dx := f.X-DX;
IF dx > 0 THEN INC(SX, dx); DX := f.X; DEC(W, dx) END;
dx := DX+W-(f.X+f.W);
IF dx > 0 THEN DEC(W, dx) END;
dy := f.Y-DY;
IF dy > 0 THEN INC(SY, dy); DY := f.Y; DEC(H, dy) END;
dy := DY+H-(f.Y+f.H);
IF dy > 0 THEN DEC(H, dy) END;
IF (W > 0) & (H > 0) THEN CopyBlock(sP, dP, SX, SY, W, H, DX, DY, mode) END
END CopyBlockC;
PROCEDURE AdjustPointer(wordIn,bitIn:LONGINT; VAR wordStart:LONGINT; VAR bitOffset:INTEGER);
Given a base address and a bit offset from this address, a new start and offset are computed such, that the new start is word aligned, and the offset is in the range 0..15.