Acorn Arcade forums: Programming: IconSprites
|
IconSprites |
|
bmsh (23:21 30/9/2002) Matthew (13:55 1/10/2002)
|
|
Ben H |
Message #20268, posted by bmsh at 23:21, 30/9/2002 |
Member
Posts: 33
|
Hmmm, not many posts to this forum in a while. Anyway...
I'm trying to write a program which will allow the user to configure the sprites used for filetypes and then not allow them to be overwritten. For the 'watching' part of this system I've set an alias to redirect any IconSprites commands to my program thus
Set Alias$IconSprites <Obey$Dir>.NewIS %%*0
where NewIS is a BASIC program which scans the sprite file specified and only allows through sprites which are not on the protected list (or, as currently, just lets everything through) which seems to work okay.
The problem comes when an application is booted which doesn't have a !Boot file but does have a !Sprites file. I'm not sure what happens here as I get a message saying
Not enough application memory to start BASIC.
from the Filer. This is obviously an incorrect error as it happens when I allocate 28,640K to the Next slot. However, if I change the BASIC program for an Obey file just containing "Echo OK" as a test, there is no error but no message either for these situations. Help! What does the OS/Filer do in these situations? Does it issue an IconSprites command or not? Can anyone offer any advice?
I'm now guessing that this method won't work for applications like this and I'll have to try something else. I have a nasty idea that the answer may involve writing a module to watch for IconSprites events (if there is such a thing, I really don't know) and I have no idea where to begin with that but we'll see what people say.
Hmmm, there's probably another program already out there which does exactly what I'm trying to do here. Is there...? |
|
[ Log in to reply ] |
|
Matthew Somerville |
Message #20288, posted by Matthew at 13:55, 1/10/2002, in reply to message #20268 |
Posts: 520
|
Using an alias won't work if the person using the IconSprites command has bypassed any aliases (IIRC (and I probably haven't), you simply put a % before the command).
Re: your memory error, you need to allocate some memory to your NewIS program before running it. Something along the lines of Set Alias$IconSprites Wimpslot -min 32k -max 32k|M<Obey$Dir>.NewIS %%*0
Hmmm, there's probably another program already out there which does exactly what I'm trying to do here. Is there...? For the watching part, yes: AddSprites available from <a href="http://www.doggysoft.co.uk/prog1.html">http://www.doggysoft.co.uk/prog1.html</a>
ATB, Matthew |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: IconSprites |