h6. [[OS SWI Calls]] h6(. » [[OS_SpriteOp]] h6((. » OS_SpriteOp 37 - Create/remove Palette h2. OS_SpriteOp 37 - Create/remove Palette h5. (SWI &2E) |_<^{width:4em}. Entry | | |<^. R0 |<^. 37 (Reason code) + [[OS_SpriteOp|Area value]]| |<^. R1 |<^. Unused/[[Format Of Sprite Area|Sprite area]] (as defined by area value in R0) | |<^. R2 |<^. Sprite name/[[Format Of Sprite|pointer]] (as defined by area value in R0) | |/5<^. R3 |<^. Mode: | |<^. -1 -> Read palette size | |<^. 0 -> Remove palette | |<^. Otherwise -> Create palette | |<^. -> If bit 31 set, create full 256 entry palette | |_<^{width:4em}. Exit | | |\2<^. 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]] | |\2<^. All other registers preserved| h4. Use 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. h4. Notes 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. h4. See also * [[Format Of Sprite]] * [[Format Of Sprite Area]] * [[OS_SpriteOp]]