Showing changes from revision #2 to #3:
Added | Removed | Changed
Bits | Meaning |
---|---|
00 Left | |
01 Centre | |
10 Right | |
11 undefined | |
2-3 | Vertical location of sprite in box |
00 Bottom | |
01 Centre | |
10 Top | |
11 undefined | |
4-5 | Drag bounding box is |
00 Whole screen | |
01 Display area of window that pointer is over | |
10 User specified | |
11 undefined | |
6 | Bounding box applies to |
0 The box | |
1 The pointer | |
7 | Use drop shadow |
8 | Do not dither sprite1 |
9 | Centre sprite around pointer2 |
10 – 15 | Reserved for future use, should be 0 |
16 | Rendering is done by: |
0 = SWI | |
1 = C/assembler function | |
17 | If rendering is a function, it is called in: |
0 = User Mode | |
1 = SVC mode | |
18 | Actually use “user mode” |
19-31 | Reserved, should be zero |
1 Available from RISC OS 3.5 onwards
2 Available from RISC OS 4.00 onwards
When calling DragAnObject with a SWI as the renderer, the block pointed to by R2 should be 10 words long. These words are loaded into R0-R9, and the SWI is called from SVC mode.
When calling DragAnObject with a C/assembler function as the renderer, the function is called in an APCS-conformant manner. The block pointed to by R2 should be 4 words long. These words are loaded into R0-R3 (a1-a4) and passed as parameters to the function. sl, sp and lr are all set correctly.
If the renderer function is in a module, also set bit 17 of the flags word, as this allows access to statics.
Prior to version 0.09 (Castle), DragAnObject would call client functions in SVC mode even when asked to call them in user mode. On 32 bit systems, this leads to an incorrect stack limit which leads to aborts.
Rather than fix the module, which may cause further faults in existing clients, a new bit (b18) indicates that the function should actually be called in user mode. If bit 18 is set, bit 17 should be clear.
The calling environment should be set up sufficiently to allow access to user and C library statics, provided that DragAnObject_Start was called via a veneer that preserves R10 and R11 (sl and fp). OSLib and _kernel_swi veneers are fine, and _swi is fine except on an unpatched RISC OS 3.70/3.71.