Showing changes from revision #1 to #2:
Added | Removed | Changed
Entry | |
---|---|
R0 | 37 (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 | Mode: |
-1 → Read palette size | |
0 → Remove palette | |
Otherwise → Create palette | |
→ If bit 31 set, create full 256 entry palette |
Exit | |
---|---|
If R3 = -1 on entry: | |
R3 | Size of palette (bytes), 0 if none |
R4 | Pointer to palette, or 0 if none |
R5 | Sprite Mode Word |
All other registers preserved |
This call allows a palette to be added or removed from a sprite, or for the size and location of a palette to be read.
For 256 colour sprites, bit 31 of R3 controls whether a 64 or 256 entry palette is created. For other colour depths this bit is ignored.
If an attempt is made to add a palette to a true-colour sprite, an error will be returned.
Because sprite palettes contain 8 bytes per entry, when reading the size/location of a palette using R3=-1 the number of palette entries is actually the returned R3 value divided by eight.