Extended Sprite Info

by Lee Calcraft


The function of XSinfo is to give information about
sprites held in memory, in much the same way as RISC OS'
built in command Sinfo. Unlike the OS command, XSinfo
not only gives information on sprites in the little-used
system sprite area, but also in the Wimp pool (both ROM and
RAM), and perhaps even more usefully in any private user
sprite area.

So if you have a program that loads sprites, or manipulates
them in some way, you can check exactly what is going on by
making use of XSinfo.

XSinfo was first published way back in volume 2 of RISC
User, but has now been updated so that it understands the
new sprite format. If any sprite that it comes across is of
the new type, it will replace data on the sprite's mode
(which is not valid in new sprites) with the word New,
followed by the number of bits per pixel. This will normally
be either 16 or 32 (for 32,000 or 16 million colours,
respectively).

Installation
To install XSinfo, you should run the accompanying
application. This will open a directory viewer containing
two files. Simply copy the one named XSinfo to the Library
directory of your work disc (usually a directory called
Library in the root directory of your hard disc - but if
you do not have one, just create a directory with this name
in your root directory).

The other file is the source code for the utility, which is
supplied for information only. If it is run it will
reassemble the utility, and attempt to save it in the
currently set library.

Using XSinfo
To use XSinfo once it is installed in your library
directory, simply go to the command line (e.g. by pressing
F12 from the Desktop) and type:
	XSinfo
You should see the following:
  XSinfo ver 1.00 (21 Jan 1994)
  XSinfo takes a parameter:
	0 for system sprites
	1 for Wimp sprites (ROM)
	2 for Wimp sprites (RAM)
	A hex address for user sprites

If you type:
	XSinfo 1
You will get a list of the Wimp sprites supplied on ROM. The
first few lines of this will appear as follows:
  Extended Sprite Info
  Wimp Sprites at &03878D90
    Sprite area=34280
    0 byte(s) free
    Sprites present: 110
      directory	34	by	17	mode  12	with mask
      small_dir	18	by	9	mode  12	with mask
      application	34	by	17	mode  12	no mask

Using the call with a parameter of 2 will list Wimp sprites
in RAM.

Finally, XSinfo will list information on the sprites in
any private user area. To do this, just pass the address of
the area in hex as the paraemter. So if you want to check up
on a sprite area in a program you are developing, you can
make the call to XSinfo from within the program itself.
For example, assuming you had set up a sprite area at
my_sprites, the following line would list the contents:
	OSCLI("XSinfo "+STR$~my_sprites)
Of course, if you are in the Desktop, you will need to send
a VDU4 before the call to make sure that you can see the
output, and a VDU5 afterwards.


 Lee Calcraft 1994
