5.2.4 ** Additional i/o Traps of the Pointer-I.F
There is no procedure at all provided by the extension itself to reliably
and at any time detecting whether the PIF is present. Nevertheless, the
error returns can always provide the necessary information:
ERNUM = 0 would be obvious, but also
ERR.NC -1 can only be returned if the PIF is present,
while
ERR.BP -15 by its own is not
a reliable sign of its absence!
IOP.FLIM |
IOP.FLIM |
3 / 108 |
$6C |
|
Find window sizes limits |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D2 |
0 |
|
|
|
A1 |
addr of data block |
A1 |
addr of data block |
ERR.BP -15, (also if D2 =/= 0)
Returned screen co-ordinates:
0(A1) width
2(A1) height
4(A1) X origin
6(A1) Y
IOP.SVPW |
IOP.SVPW |
3 / 109 |
|
|
save sub-window |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
rel origin |
D1 |
addr of data storage |
|
|
of sub-window area |
|
|
|
D2 |
Null or width | height for data storage |
|
A1 |
addr of data block with screen sizes of window section |
|
A2 |
addr of storage area |
|
|
ERR.OR -4 sub-window out of OL/storage area
ERR.OM -3
A new memory area of the appropriate size will be assigned if D2 =/= 0.
A2 being used as the base address of a supplied memory area only if
D2 = 0.
Several versions of the PIF revealed some sort of "peculiarities":
-
The owner job of the allocated memory area is not pre-determinable.
-
Failure of sub-window storage may lead to unrecoverable memory areae which
were assigned by IOP.SVPW prior to co-ordinates checking and not released,
internally.
IOP.RSPW |
IOP.RSPW |
3 / 110 |
|
|
fetch sub-window contents from memory |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
rel origin |
|
|
|
D2 |
=/= 0 flag to preserve data storage |
|
A1 |
addr of data block with sub-window sizes |
ERR.OR -4 sub- window out of OL/storage area
IOP.SLNK |
IOP.SLNK |
3 / 111 |
|
|
Store data to PIF device definition block |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1.W |
Position in link block |
|
|
|
D2.W |
number of bytes |
|
|
|
A1 |
Pointer to data |
A1 |
addr. of link block |
IOP.PINF |
IOP.PINF |
3 / 112 |
|
|
Pointer Information |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
|
|
D1 |
PTR Version, ASCII coded |
|
|
|
A1 |
Window Manager vector |
ERR.BP -15 Pointer Interface not present
ERR.NC -1 PIF present, but D1/A1 not reliable
IOP.RPTR |
IOP.RPTR |
3 / 113 |
|
|
Read pointer |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
X | Y screen co-ordinates |
D1 |
X | Y pointer co-ordinates |
|
D2.B |
exit table |
|
|
|
D3 |
-1 |
|
|
|
A1 |
Ptr to Pointer Record |
|
|
D1 used to checking whether the pointer was moved.
The bits of the exit table determine, which events will lead to completion:
|
0 |
Key or mouse button in window hit or window changed;
draw Sprite of movement. |
|
1 |
Key or mouse button permanently pressed;
draw Sprite of change of sizes. |
|
2 |
Key or mouse button being released |
|
3 |
Pointer withdrawn from preset co-ordinates |
|
4 |
Pointer out of of window |
|
5 |
within |
|
6 |
-/- |
|
7 |
checking in hit area |
Bit 7 with Bits 0 and 1, only.
Also immediately returning if window being closed if bits 4 and 5 are
set.
Only the window on top of the pile is open for input while this trap
is run.
24 Bytes Pointer Record:
00 ID of windows or -1 if pointer out of window area
04 .w no. of sub-window or -1 if primary window
06 .w X position of Pointers in (sub-)window
08 .w Y
$0A .b 0: no key press, =/= 0: key or mouse button code
$0B .b 0: no key pressed, =/= 0 key/mouse button pressed
$0C event vector, least and most significant
byte set
$10 .w*4 size and origin of (sub-) window
$18 reference address of window
IOP.RPXL |
IOP.RPXL |
3 / 114 |
|
|
read pixel colour |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
X | Y co-ordinates |
D1 |
Position | colour found |
|
D2 |
detection mode and colour |
|
|
D2 detection mode bits:
IOP..GCL 16 colour as set in D2
IOP..SDR 17 scan advancing co-ordinates (down)
IOP..SLR 18 scan horizontally
IOP..SSC 19 colour at start point
IOP..SCN 31 scanning requested
bits 17 & 18:
00 scan upwards
01 scan downwards
10 scan to the left
11 scan to the right
D1 = -1 returned if colour not found.
ERR.OR -4 X,Y not in window area
IOP.WBLB |
IOP.WBLB |
3 / 115 |
|
|
draw Blob |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
X | Y co-ordinates |
|
|
|
A1 |
Ptr to BLOB definition |
|
|
|
A2 |
Ptr to PATTERN definition |
|
|
ERR.OR -4 X,Y not in window
IOP.LBLB |
IOP.LBLB |
3 / 116 |
|
|
Draw line of blobs |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
X | Y start point |
D1 |
end point |
|
D2 |
end point (exclusively) |
|
|
|
A1 |
Ptr to blob definition |
|
|
|
A2 |
Ptr to pattern definition |
A2 |
updated |
ERR.BP -15 Definition not found
IOP.WSPT |
IOP.WSPT |
3 / 117 |
|
|
Draw sprite |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
X | Y co-ordinates |
|
|
|
A1 |
Ptr to sprite definition or number of pre-defined
Sprite |
ERR.OR -4 X,Y not in window
ERR.BP -15 error in of data structure, definition not found
Standard Sprites:
|
0 |
SP.ARROW |
Arrow |
|
1 |
SP.LOCK |
Padlock |
|
2 |
SP.NULL |
Empty window |
|
3 |
SP.MODE |
False MODE (4 or 8) |
|
4 |
SP.KEY |
Keyboard input |
|
5 |
SP.BUSY |
"No entry" |
|
6 |
SP.WMOVE |
Window movement |
|
7 |
SP.WSIZE |
window changes |
IOP.SPRY |
IOP.SPRY |
3 / 118 |
|
|
Draw Blob partially masked off |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
X | Y co-ordinates |
D1 |
X | Y co-ordinates |
|
D2.W |
number of visible pixel |
|
|
|
A1 |
Ptr to Blob |
|
|
|
A2 |
Ptr to mask (pattern) |
|
|
ERR.OR -4 X,Y not in window
IOP.OUTL |
IOP.OUTL |
3 / 122 |
|
|
define window over all area - "outline"! |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
X | Y shadow width |
D1 |
smashed |
|
D2 |
(re below) |
|
|
|
A1 |
Ptr to window sizes |
|
|
ERR.OR -4 window out of of screen
Bits in D2:
IOP..SET 0 just done
IOP..MOV 1 preserve window contents and setup new sizes
A1 points to data block with word entries of width, height, origin.
"outline" built from shadow width added to window sizes.
A thus "outlined" window becomes a PIF "managed" window.
IOP.SPTR |
IOP.SPTR |
3 / 123 |
|
|
Set pointer to pixel position |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
pointer co-ordinates |
D1 |
point in screen co-ordinates |
|
D2.B |
mode of origin |
|
|
ERR.OR -4 X,Y out of of windows
D2 mode of origin:
IOP..REW -1 window co-ordinates
IOP..ABS 0 screen co-ordinates
OP..REH 1 hit area
IOP.PICKK |
IOP.PICK |
3 / 124 |
|
|
Select a (jobs) window |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Job ID |
D1 |
smashed |
|
D2 |
0 |
|
|
ERR.NJ -2
A0 requires being set to some valid window ID or coded as:
Job ID to fetching its primary window to the top of Pile.
-1 the bottom window.
-2 set window of channel ID to un-lockable.
-3 freeze screen and Ptr
IOP.SWDF |
IOP.SWDF |
3 / 125 |
|
|
Set up a list of sub-windows |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
A1 |
Ptr to list of sub-windows or Null |
|
|
List Zero terminated, made up of pointers to (several) sub-window definition(s):
sw_xsize $00 .w sub-window pixel width
sw_ysize $02 .w height
sw_xorg $04 .w X origin within superior window
defn
sw_yorg $06 .w Y
sw_wattr $08 4.w spacing, border, border colour, paper colour
sw_psprt $10 Ptr to Sprite
for the sub-window
IOP.WSAV |
IOP.WSAV |
3 / 126 |
|
|
Store window area to memory |
IOP.WRST |
IOP.WRST |
3 / 127 |
|
|
Restore window area from memory |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
WSAV : Null or size of area |
|
|
|
D2.B |
WRST : =/= 0 preserve memory area |
|
|
|
A1 |
Null or address of memory area |
|
|
ERR.OM -3 out of memory
D1/A1 = 0 to storing the window contents in internally reserved memory
area.