A SIMPLE SPRITE MANAGER

Manage your store of resident system sprites with this short piece of code by Mike Ironmonger.

Keeping track of system sprites, and selectively deleting those no longer required is a tiresome task, since *SDelete requires the exact name of any sprite to be deleted. The utility listed here provides a single star command:
*SWipe
which displays each sprite in turn, and asks whether it should be deleted.

The program is extremely short, and is given the file type &FFC. This means that it is a so-called Transient Utility, and does not need to be specifically loaded before use. All you need to do is issue the command *SWipe, and the code will be loaded from disc into the RMA area (though it is not a Module as such). It will then execute, and will be automatically cleared after use.

To make use of the program, type it in carefully, save away the source code, and run it - making sure that your disc has a directory named $.Library. The Transient Utility will be assembled and saved to $.Library ready for use.

Sprite manager

10 REM >SpriteMan
20 REM Program Sprite Manager
30 REM Version A 1.30
40 REM Author Mike Ironmonger
50 REM RISC User March 1989
60 REM Program Subject to Copyright
70 :
80 MODE0:DIM code% 500
90 FORA%=0TO1:P%=code%
100 :
110 [OPT A%*2
120 MOV R0,#8:SWI "XOS_SpriteOp"
130 MOVVS PC,R14:MOVS R8,R3
140 BNE first_sprite
150 :
160 SWI "XOS_WriteS"
170 EQUS "No Sprites defined"+CHR$13+CHR$10+CHR$0
180 MOV PC,R14
190 :
200 .first_sprite
210 MOV R0,#135:SWI "XOS_Byte"
220 MOV R9,R2:MOV R7,#1
230 :
240 .next_sprite
250 MOV R0,#13:MOV R2,R12
260 MOV R3,#13:MOV R4,R7
270 SWI "XOS_SpriteOp"
280 :
290 MOV R0,#40:SWI "XOS_SpriteOp"
300 TEQ R6,R9:SWIEQ &20100+12
310 SWINE &20100+22:MOVNE R0,R6
320 SWINE "XOS_WriteC"
330 MOVNE R9,R6
340 :
350 SWI "XOS_WriteS"
360 EQUS "Delete '"+CHR$0
370 MOV R0,R12:SWI "XOS_Write0"
380 SWI "XOS_WriteS"
390 EQUS "' (Y/N) ? "+CHR$0
400 :
410 MOV R0,#34:MOV R3,#0
420 MOV R4,R4,LSL #2
430 RSB R4,R4,#992:MOV R5,#8
440 SWI "XOS_SpriteOp"
450 :
460 SWI "XOS_ReadC":BCS end
470 TEQ R0,#ASC"Y":TEQNE R0,#ASC"y"
480 ADDNE R7,R7,#1:MOVEQ R0,#25
490 SWIEQ "XOS_SpriteOp"
500 :
510 SUBS R8,R8,#1:BNE next_sprite
520 .end
530 MOV R0,#126:SWI "XOS_Byte"
540 SWI &20100+12:MOV PC,R14
550 ]:NEXT
560 :
570 SYS "OS_File",10,"$.Library.SWipe",&FFC,,code%,P%
580 PRINT "'*SWipe' command now installed in library"