Showing changes from revision #1 to #2:
Added | Removed | Changed
Entry | |
---|---|
R0 | 36 (Reason code) + Area value |
R1 | Unused/Sprite area (as defined by area value in R0) |
R2 | Sprite name/pointer (as defined by area value in R0) |
R3 | Flags: |
Bits 0-3: Pointer shape (1-4) | |
Bit 4 set: Don’t update pointer image | |
Bit 5 set: Don’t update pointer palette | |
Bit 6 set: Don’t set the active pointer afterwards | |
R4 | X coordinate of active point |
R5 | Y coordinate of active point |
R6 | Pointer to scaling factors, or 0 to use mode-dependent default |
R7 | Pointer to pixel translation table, or 0 for no translation |
Exit | |
---|---|
All registers preserved |
This call is used to configure a pointer shape and the pointer palette based around the contents of an arbitrary sprite. The exact operation of the call can be controlled by bits 4-6 of R3; if these are all set the call is effectively a no-op.
This call is a more flexible and user-friendly alternative to using OS_Word 21,0 to define pointer shapes.
This call does not support the use of true colour sprites; the sprite must be 256 colours or less.
The active point coordinates are in pixels, relative to the top-left corner of the sprite.
If the sprite has a mask and no left-hand wastage, the supplied active point coordinates will be ignored and the active point will instead be selected automatically based around the mask data. Starting from the topmost row and working down, each mask row will be examined in turn and the active point will be set to the first pixel (from the left of the image) which is set.
If bit 5 of R3 is clear then the sprites palette will be used to set the pointer palette. The translation table (if supplied) will be used for a reverse lookup into the sprite palette, in order to determine which colours should be used for pointer colours 1, 2 and 3. In the absence of a translation table, sprite palette entries 1-3 will be used directly.
If no scaling factors are supplied, the DPI and eigen values of the source and destination are used to calculate appropriate scale factors.
As the OS limits the maximum pointer image size to 32×32 pixels, any image larger than this will be cropped, with only the top-left portion visible.
The translation table supplied in R7 should be a standard pixel translation table suitable for converting the image to a 2bpp mode, with the exception that colour 0 should normally be avoided, as the OS always treats pointer colour 0 as transparent. Unless the sprite is 2bpp, a translation table must be supplied.