Showing changes from revision #1 to #2:
Added | Removed | Changed
Entry | |
---|---|
R0 | 13 (Reason code) + Area value |
R1 | Unused/Sprite area (as defined by area value in R0) |
R2 | Pointer to buffer to store name |
R3 | Length of buffer |
R4 | Sprite number |
Exit | |
---|---|
R3 | Length of returned string |
All other registers preserved |
This call will return the name of a given sprite.
The first sprite in the area has number 1, therefore valid values of R4 are 1 <= R4 <= number of sprites.
The returned name will always be null terminated. Therefore to be able to read the longest sprite name (12 characters), a buffer length of 13 bytes or more is required.
On entry R3 should be the total length of the buffer, i.e. 13. On exit it will be the number of characters in the name, i.e. 1 to 12.
Once you have the sprite name, you can use OS_SpriteOp 24 to get its address. Using the sprite address to interact with sprites can be significantly faster than using the sprite name, especially with sprite areas which contain lots of sprites.