Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199611.adf » Regulars » StarInfo/Lindop/!Bio/Library/SpriteIcon/SpriteIcon

StarInfo/Lindop/!Bio/Library/SpriteIcon/SpriteIcon

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199611.adf » Regulars
Filename: StarInfo/Lindop/!Bio/Library/SpriteIcon/SpriteIcon
Read OK:
File size: 0F9B bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >spriteicon
   20REM A J Lindop, 28/12/93
   30REM Change sprite to IBM icon
   40REM
   50END
   60:
   70DEF FNspriteicon_name="Sprites to IBM icons"
   80DEF FNspriteicon_args="-in * -out DOS"
   90:
  100DEF FNspriteicon_init
  110=0
  120:
  130DEF FNspriteicon_key(wh%,ic%,cx%,cy%,ch%,ci%,key%)
  140=0
  150:
  160DEF FNspriteicon_mouse(mx%,my%,mb%,mh%,mi%)
  170=0
  180:
  190DEF FNspriteicon(in$,out$)
  200LOCAL in%,out%,len%,i%,l%,j%,mode%,h%,v%,load%,exec%,length%,attrib%,type%,i$,a%,b%,lb%,hm%,op%,hpi%
  210LOCAL I%,J%,K%,L%,A%,B%,C%,D%
  220DIM screen% &280
  230SYS "OS_File",5,in$ TO type%,, load%, exec%, length%, attrib%
  240IF type% =0 THEN PROCwarn(" Could not find the specified object")
  250IF type% =2 THEN PROCwarn(" Object is a Directory")
  260IF type% =1 THEN
  270  mode%=27
  280  D%=56
  290  length%=16*32
  300  REM ip%=input pixel/byte, op%=output pixel/byte
  310  h%=16:    REM input bytes/input line
  320  ip%=2:op%=2
  330  hpi%=ip%*h%            : REM input horiz. pixels = output horiz. pixels
  340  lb%=h%*8               : REM input bytes to be decoded
  350  v%=length%DIVh%        : REM input vertical lines
  360  h%=h%-1                : REM input horizontal bytes - 1
  370  len%=length%*ip%DIVop% : REM output file length
  380  ho%=hpi%-1             : REM output horizontal pixels - 1
  390  p%=4*op%               : REM output (pixel/byte) * 4
  400  in%=OPENIN(in$)
  410  PTR#in%=0
  420
  430  REM ignore header block of Sprite length=D%
  440  FOR i%=1 TO D%
  450    l%=BGET#in%
  460    screen%?(i%-1)=l%
  470  NEXT
  480  hpi%=(1 + screen%?&1C)*4
  490  ho%=1 + screen%?&20
  500  lb%=screen%?&34
  510  i$=STR$(hpi%)
  520  IF hpi%<>16 THEN
  530    PROCwarn("Sprite Horizontal size Incorrect = "+i$)
  540    CLOSE#in%:=1
  550  ENDIF
  560  i$=STR$(ho%)
  570  IF ho%<>32 THEN
  580    PROCwarn("Sprite Vertical size Incorrect = "+i$)
  590    CLOSE#in%:=1
  600  ENDIF
  610  i$=STR$(lb%)
  620  IF lb%<>27 THEN
  630    PROCwarn("Sprite Mode Incorrect = "+i$)
  640    CLOSE#in%:=1
  650  ENDIF
  660
  670  REM write Icon header block
  680  out%=OPENOUT(out$)
  690  PTR#out%=0
  700  PROCwput(out%,&00010000)
  710  PROCwput(out%,&20200001)
  720  PROCwput(out%,&00000010)
  730  PROCwput(out%,&02E80000)
  740  PROCwput(out%,&00160000)
  750  PROCwput(out%,&00280000)
  760  PROCwput(out%,&00200000)
  770  PROCwput(out%,&00400000)
  780  PROCwput(out%,&00010000)
  790  PROCwput(out%,&00000004)
  800  PROCwput(out%,&02800000)
  810  FOR i%=1 TO 6
  820    PROCwput(out%,&00)
  830  NEXT
  840  PROCwput(out%,&80000080)
  850  PROCwput(out%,&80000000)
  860  PROCwput(out%,&00800080)
  870  PROCwput(out%,&00800000)
  880  PROCwput(out%,&80800080)
  890  PROCwput(out%,&80800000)
  900  PROCwput(out%,&C0C00080)
  910  PROCwput(out%,&000000C0)
  920  PROCwput(out%,&FF0000FF)
  930  PROCwput(out%,&FF000000)
  940  PROCwput(out%,&00FF00FF)
  950  PROCwput(out%,&00FF0000)
  960  PROCwput(out%,&FFFF00FF)
  970  PROCwput(out%,&FFFF0000)
  980  BPUT#out%,&FF
  990  BPUT#out%,&00
 1000  REM end of Icon header block - Icon data follows
 1010
 1020  REM read and process sprite data
 1030  FOR l%=1 TO v%
 1040    FOR i%=0 TO h%
 1050      PROChourglass(PTR#in%,EXT#in%)
 1060      L%=BGET#in%
 1070      A%=L% AND &F0
 1080      B%=L% AND &0F
 1090      C%=A% DIV 16
 1100      CASE B% OF
 1110        WHEN 0: J%=15
 1120        WHEN 1: J%=8
 1130        WHEN 2: J%=8
 1140        WHEN 3: J%=3
 1150        WHEN 4: J%=5
 1160        WHEN 5: J%=4
 1170        WHEN 6: J%=0
 1180        WHEN 7: J%=0
 1190        WHEN 8: J%=12
 1200        WHEN 9: J%=11
 1210        WHEN 10: J%=10
 1220        WHEN 11: J%=1
 1230        WHEN 12: J%=11
 1240        WHEN 13: J%=10
 1250        WHEN 14: J%=13
 1260        WHEN 15: J%=14
 1270      ENDCASE
 1280      B%=J%
 1290      CASE C% OF
 1300        WHEN 0: J%=15
 1310        WHEN 1: J%=8
 1320        WHEN 2: J%=8
 1330        WHEN 3: J%=3
 1340        WHEN 4: J%=5
 1350        WHEN 5: J%=4
 1360        WHEN 6: J%=0
 1370        WHEN 7: J%=0
 1380        WHEN 8: J%=12
 1390        WHEN 9: J%=11
 1400        WHEN 10: J%=10
 1410        WHEN 11: J%=1
 1420        WHEN 12: J%=11
 1430        WHEN 13: J%=10
 1440        WHEN 14: J%=13
 1450        WHEN 15: J%=14
 1460      ENDCASE
 1470      C%=J%
 1480      D%=B% * 16
 1490      L%=(D%+C%)
 1500      j%=i%+(l%-1)*(h%+1)
 1510      screen%?j%=L%
 1520    NEXT
 1530  NEXT
 1540  FOR l%=1 TO v%
 1550    FOR i%=0 TO h%
 1560      j%=i%+(v%-l%)*(h%+1)
 1570      L%=screen%?j%
 1580      BPUT#out%,L%
 1590    NEXT
 1600  NEXT
 1610
 1620  REM write icon tail block
 1630  FOR i%=1 TO &80
 1640    BPUT#out%,&00
 1650  NEXT
 1660  CLOSE#in%
 1670  CLOSE#out%
 1680ENDIF
 1690=0
 1700
 1710
 1720

� >spriteicon
� A J Lindop, 28/12/93
� Change sprite to IBM icon
(�
2�
<:
F-� �spriteicon_name="Sprites to IBM icons"
P'� �spriteicon_args="-in * -out DOS"
Z:
d� �spriteicon_init
n=0
x:
�3� �spriteicon_key(wh%,ic%,cx%,cy%,ch%,ci%,key%)
�=0
�:
�,� �spriteicon_mouse(mx%,my%,mb%,mh%,mi%)
�=0
�:
�� �spriteicon(in$,out$)
�d� in%,out%,len%,i%,l%,j%,mode%,h%,v%,load%,exec%,length%,attrib%,type%,i$,a%,b%,lb%,hm%,op%,hpi%
�� I%,J%,K%,L%,A%,B%,C%,D%
�� screen% &280
�?ș "OS_File",5,in$ � type%,, load%, exec%, length%, attrib%
�>� type% =0 � �warn(" Could not find the specified object")
�0� type% =2 � �warn(" Object is a Directory")
� type% =1 �
  mode%=27
  D%=56
"  length%=16*32
,3  � ip%=input pixel/byte, op%=output pixel/byte
6(  h%=16:    � input bytes/input line
@  ip%=2:op%=2
JK  hpi%=ip%*h%            : � input horiz. pixels = output horiz. pixels
T:  lb%=h%*8               : � input bytes to be decoded
^3  v%=length%�h%        : � input vertical lines
h;  h%=h%-1                : � input horizontal bytes - 1
r1  len%=length%*ip%�op% : � output file length
|=  ho%=hpi%-1             : � output horizontal pixels - 1
�8  p%=4*op%               : � output (pixel/byte) * 4
�  in%=�(in$)
�
  �#in%=0
�
�/  � ignore header block of Sprite length=D%
�  � i%=1 � D%
�    l%=�#in%
�    screen%?(i%-1)=l%
�  �
�  hpi%=(1 + screen%?&1C)*4
�  ho%=1 + screen%?&20
�  lb%=screen%?&34
�  i$=�(hpi%)
  � hpi%<>16 �
7    �warn("Sprite Horizontal size Incorrect = "+i$)
    �#in%:=1
&  �
0  i$=�(ho%)
:  � ho%<>32 �
D5    �warn("Sprite Vertical size Incorrect = "+i$)
N    �#in%:=1
X  �
b  i$=�(lb%)
l  � lb%<>27 �
v,    �warn("Sprite Mode Incorrect = "+i$)
�    �#in%:=1
�  �
�
�  � write Icon header block
�  out%=�(out$)
�  �#out%=0
�  �wput(out%,&00010000)
�  �wput(out%,&20200001)
�  �wput(out%,&00000010)
�  �wput(out%,&02E80000)
�  �wput(out%,&00160000)
�  �wput(out%,&00280000)
�  �wput(out%,&00200000)
  �wput(out%,&00400000)
  �wput(out%,&00010000)
  �wput(out%,&00000004)
   �wput(out%,&02800000)
*  � i%=1 � 6
4    �wput(out%,&00)
>  �
H  �wput(out%,&80000080)
R  �wput(out%,&80000000)
\  �wput(out%,&00800080)
f  �wput(out%,&00800000)
p  �wput(out%,&80800080)
z  �wput(out%,&80800000)
�  �wput(out%,&C0C00080)
�  �wput(out%,&000000C0)
�  �wput(out%,&FF0000FF)
�  �wput(out%,&FF000000)
�  �wput(out%,&00FF00FF)
�  �wput(out%,&00FF0000)
�  �wput(out%,&FFFF00FF)
�  �wput(out%,&FFFF0000)
�  �#out%,&FF
�  �#out%,&00
�4  � end of Icon header block - Icon data follows
�
�$  � read and process sprite data
  � l%=1 � v%
    � i%=0 � h%
!      �hourglass(�#in%,�#in%)
$      L%=�#in%
.      A%=L% � &F0
8      B%=L% � &0F
B      C%=A% � 16
L      Ȏ B% �
V        � 0: J%=15
`        � 1: J%=8
j        � 2: J%=8
t        � 3: J%=3
~        � 4: J%=5
�        � 5: J%=4
�        � 6: J%=0
�        � 7: J%=0
�        � 8: J%=12
�        � 9: J%=11
�        � 10: J%=10
�        � 11: J%=1
�        � 12: J%=11
�        � 13: J%=10
�        � 14: J%=13
�        � 15: J%=14
�      �
      B%=J%

      Ȏ C% �
        � 0: J%=15
        � 1: J%=8
(        � 2: J%=8
2        � 3: J%=3
<        � 4: J%=5
F        � 5: J%=4
P        � 6: J%=0
Z        � 7: J%=0
d        � 8: J%=12
n        � 9: J%=11
x        � 10: J%=10
�        � 11: J%=1
�        � 12: J%=11
�        � 13: J%=10
�        � 14: J%=13
�        � 15: J%=14
�      �
�      C%=J%
�      D%=B% * 16
�      L%=(D%+C%)
�      j%=i%+(l%-1)*(h%+1)
�      screen%?j%=L%
�	    �
�  �
  � l%=1 � v%
    � i%=0 � h%
      j%=i%+(v%-l%)*(h%+1)
"      L%=screen%?j%
,      �#out%,L%
6	    �
@  �
J
T  � write icon tail block
^  � i%=1 � &80
h    �#out%,&00
r  �
|  �#in%
�  �#out%
��
�=0
�
�
�
�
00000000  0d 00 0a 11 f4 20 3e 73  70 72 69 74 65 69 63 6f  |..... >spriteico|
00000010  6e 0d 00 14 1a f4 20 41  20 4a 20 4c 69 6e 64 6f  |n..... A J Lindo|
00000020  70 2c 20 32 38 2f 31 32  2f 39 33 0d 00 1e 1f f4  |p, 28/12/93.....|
00000030  20 43 68 61 6e 67 65 20  73 70 72 69 74 65 20 74  | Change sprite t|
00000040  6f 20 49 42 4d 20 69 63  6f 6e 0d 00 28 05 f4 0d  |o IBM icon..(...|
00000050  00 32 05 e0 0d 00 3c 05  3a 0d 00 46 2d dd 20 a4  |.2....<.:..F-. .|
00000060  73 70 72 69 74 65 69 63  6f 6e 5f 6e 61 6d 65 3d  |spriteicon_name=|
00000070  22 53 70 72 69 74 65 73  20 74 6f 20 49 42 4d 20  |"Sprites to IBM |
00000080  69 63 6f 6e 73 22 0d 00  50 27 dd 20 a4 73 70 72  |icons"..P'. .spr|
00000090  69 74 65 69 63 6f 6e 5f  61 72 67 73 3d 22 2d 69  |iteicon_args="-i|
000000a0  6e 20 2a 20 2d 6f 75 74  20 44 4f 53 22 0d 00 5a  |n * -out DOS"..Z|
000000b0  05 3a 0d 00 64 16 dd 20  a4 73 70 72 69 74 65 69  |.:..d.. .spritei|
000000c0  63 6f 6e 5f 69 6e 69 74  0d 00 6e 06 3d 30 0d 00  |con_init..n.=0..|
000000d0  78 05 3a 0d 00 82 33 dd  20 a4 73 70 72 69 74 65  |x.:...3. .sprite|
000000e0  69 63 6f 6e 5f 6b 65 79  28 77 68 25 2c 69 63 25  |icon_key(wh%,ic%|
000000f0  2c 63 78 25 2c 63 79 25  2c 63 68 25 2c 63 69 25  |,cx%,cy%,ch%,ci%|
00000100  2c 6b 65 79 25 29 0d 00  8c 06 3d 30 0d 00 96 05  |,key%)....=0....|
00000110  3a 0d 00 a0 2c dd 20 a4  73 70 72 69 74 65 69 63  |:...,. .spriteic|
00000120  6f 6e 5f 6d 6f 75 73 65  28 6d 78 25 2c 6d 79 25  |on_mouse(mx%,my%|
00000130  2c 6d 62 25 2c 6d 68 25  2c 6d 69 25 29 0d 00 aa  |,mb%,mh%,mi%)...|
00000140  06 3d 30 0d 00 b4 05 3a  0d 00 be 1b dd 20 a4 73  |.=0....:..... .s|
00000150  70 72 69 74 65 69 63 6f  6e 28 69 6e 24 2c 6f 75  |priteicon(in$,ou|
00000160  74 24 29 0d 00 c8 64 ea  20 69 6e 25 2c 6f 75 74  |t$)...d. in%,out|
00000170  25 2c 6c 65 6e 25 2c 69  25 2c 6c 25 2c 6a 25 2c  |%,len%,i%,l%,j%,|
00000180  6d 6f 64 65 25 2c 68 25  2c 76 25 2c 6c 6f 61 64  |mode%,h%,v%,load|
00000190  25 2c 65 78 65 63 25 2c  6c 65 6e 67 74 68 25 2c  |%,exec%,length%,|
000001a0  61 74 74 72 69 62 25 2c  74 79 70 65 25 2c 69 24  |attrib%,type%,i$|
000001b0  2c 61 25 2c 62 25 2c 6c  62 25 2c 68 6d 25 2c 6f  |,a%,b%,lb%,hm%,o|
000001c0  70 25 2c 68 70 69 25 0d  00 d2 1d ea 20 49 25 2c  |p%,hpi%..... I%,|
000001d0  4a 25 2c 4b 25 2c 4c 25  2c 41 25 2c 42 25 2c 43  |J%,K%,L%,A%,B%,C|
000001e0  25 2c 44 25 0d 00 dc 12  de 20 73 63 72 65 65 6e  |%,D%..... screen|
000001f0  25 20 26 32 38 30 0d 00  e6 3f c8 99 20 22 4f 53  |% &280...?.. "OS|
00000200  5f 46 69 6c 65 22 2c 35  2c 69 6e 24 20 b8 20 74  |_File",5,in$ . t|
00000210  79 70 65 25 2c 2c 20 6c  6f 61 64 25 2c 20 65 78  |ype%,, load%, ex|
00000220  65 63 25 2c 20 6c 65 6e  67 74 68 25 2c 20 61 74  |ec%, length%, at|
00000230  74 72 69 62 25 0d 00 f0  3e e7 20 74 79 70 65 25  |trib%...>. type%|
00000240  20 3d 30 20 8c 20 f2 77  61 72 6e 28 22 20 43 6f  | =0 . .warn(" Co|
00000250  75 6c 64 20 6e 6f 74 20  66 69 6e 64 20 74 68 65  |uld not find the|
00000260  20 73 70 65 63 69 66 69  65 64 20 6f 62 6a 65 63  | specified objec|
00000270  74 22 29 0d 00 fa 30 e7  20 74 79 70 65 25 20 3d  |t")...0. type% =|
00000280  32 20 8c 20 f2 77 61 72  6e 28 22 20 4f 62 6a 65  |2 . .warn(" Obje|
00000290  63 74 20 69 73 20 61 20  44 69 72 65 63 74 6f 72  |ct is a Director|
000002a0  79 22 29 0d 01 04 10 e7  20 74 79 70 65 25 20 3d  |y")..... type% =|
000002b0  31 20 8c 0d 01 0e 0e 20  20 6d 6f 64 65 25 3d 32  |1 .....  mode%=2|
000002c0  37 0d 01 18 0b 20 20 44  25 3d 35 36 0d 01 22 13  |7....  D%=56..".|
000002d0  20 20 6c 65 6e 67 74 68  25 3d 31 36 2a 33 32 0d  |  length%=16*32.|
000002e0  01 2c 33 20 20 f4 20 69  70 25 3d 69 6e 70 75 74  |.,3  . ip%=input|
000002f0  20 70 69 78 65 6c 2f 62  79 74 65 2c 20 6f 70 25  | pixel/byte, op%|
00000300  3d 6f 75 74 70 75 74 20  70 69 78 65 6c 2f 62 79  |=output pixel/by|
00000310  74 65 0d 01 36 28 20 20  68 25 3d 31 36 3a 20 20  |te..6(  h%=16:  |
00000320  20 20 f4 20 69 6e 70 75  74 20 62 79 74 65 73 2f  |  . input bytes/|
00000330  69 6e 70 75 74 20 6c 69  6e 65 0d 01 40 11 20 20  |input line..@.  |
00000340  69 70 25 3d 32 3a 6f 70  25 3d 32 0d 01 4a 4b 20  |ip%=2:op%=2..JK |
00000350  20 68 70 69 25 3d 69 70  25 2a 68 25 20 20 20 20  | hpi%=ip%*h%    |
00000360  20 20 20 20 20 20 20 20  3a 20 f4 20 69 6e 70 75  |        : . inpu|
00000370  74 20 68 6f 72 69 7a 2e  20 70 69 78 65 6c 73 20  |t horiz. pixels |
00000380  3d 20 6f 75 74 70 75 74  20 68 6f 72 69 7a 2e 20  |= output horiz. |
00000390  70 69 78 65 6c 73 0d 01  54 3a 20 20 6c 62 25 3d  |pixels..T:  lb%=|
000003a0  68 25 2a 38 20 20 20 20  20 20 20 20 20 20 20 20  |h%*8            |
000003b0  20 20 20 3a 20 f4 20 69  6e 70 75 74 20 62 79 74  |   : . input byt|
000003c0  65 73 20 74 6f 20 62 65  20 64 65 63 6f 64 65 64  |es to be decoded|
000003d0  0d 01 5e 33 20 20 76 25  3d 6c 65 6e 67 74 68 25  |..^3  v%=length%|
000003e0  81 68 25 20 20 20 20 20  20 20 20 3a 20 f4 20 69  |.h%        : . i|
000003f0  6e 70 75 74 20 76 65 72  74 69 63 61 6c 20 6c 69  |nput vertical li|
00000400  6e 65 73 0d 01 68 3b 20  20 68 25 3d 68 25 2d 31  |nes..h;  h%=h%-1|
00000410  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000420  3a 20 f4 20 69 6e 70 75  74 20 68 6f 72 69 7a 6f  |: . input horizo|
00000430  6e 74 61 6c 20 62 79 74  65 73 20 2d 20 31 0d 01  |ntal bytes - 1..|
00000440  72 31 20 20 6c 65 6e 25  3d 6c 65 6e 67 74 68 25  |r1  len%=length%|
00000450  2a 69 70 25 81 6f 70 25  20 3a 20 f4 20 6f 75 74  |*ip%.op% : . out|
00000460  70 75 74 20 66 69 6c 65  20 6c 65 6e 67 74 68 0d  |put file length.|
00000470  01 7c 3d 20 20 68 6f 25  3d 68 70 69 25 2d 31 20  |.|=  ho%=hpi%-1 |
00000480  20 20 20 20 20 20 20 20  20 20 20 20 3a 20 f4 20  |            : . |
00000490  6f 75 74 70 75 74 20 68  6f 72 69 7a 6f 6e 74 61  |output horizonta|
000004a0  6c 20 70 69 78 65 6c 73  20 2d 20 31 0d 01 86 38  |l pixels - 1...8|
000004b0  20 20 70 25 3d 34 2a 6f  70 25 20 20 20 20 20 20  |  p%=4*op%      |
000004c0  20 20 20 20 20 20 20 20  20 3a 20 f4 20 6f 75 74  |         : . out|
000004d0  70 75 74 20 28 70 69 78  65 6c 2f 62 79 74 65 29  |put (pixel/byte)|
000004e0  20 2a 20 34 0d 01 90 10  20 20 69 6e 25 3d 8e 28  | * 4....  in%=.(|
000004f0  69 6e 24 29 0d 01 9a 0d  20 20 cf 23 69 6e 25 3d  |in$)....  .#in%=|
00000500  30 0d 01 a4 04 0d 01 ae  2f 20 20 f4 20 69 67 6e  |0......./  . ign|
00000510  6f 72 65 20 68 65 61 64  65 72 20 62 6c 6f 63 6b  |ore header block|
00000520  20 6f 66 20 53 70 72 69  74 65 20 6c 65 6e 67 74  | of Sprite lengt|
00000530  68 3d 44 25 0d 01 b8 11  20 20 e3 20 69 25 3d 31  |h=D%....  . i%=1|
00000540  20 b8 20 44 25 0d 01 c2  10 20 20 20 20 6c 25 3d  | . D%....    l%=|
00000550  9a 23 69 6e 25 0d 01 cc  19 20 20 20 20 73 63 72  |.#in%....    scr|
00000560  65 65 6e 25 3f 28 69 25  2d 31 29 3d 6c 25 0d 01  |een%?(i%-1)=l%..|
00000570  d6 07 20 20 ed 0d 01 e0  1e 20 20 68 70 69 25 3d  |..  .....  hpi%=|
00000580  28 31 20 2b 20 73 63 72  65 65 6e 25 3f 26 31 43  |(1 + screen%?&1C|
00000590  29 2a 34 0d 01 ea 19 20  20 68 6f 25 3d 31 20 2b  |)*4....  ho%=1 +|
000005a0  20 73 63 72 65 65 6e 25  3f 26 32 30 0d 01 f4 15  | screen%?&20....|
000005b0  20 20 6c 62 25 3d 73 63  72 65 65 6e 25 3f 26 33  |  lb%=screen%?&3|
000005c0  34 0d 01 fe 10 20 20 69  24 3d c3 28 68 70 69 25  |4....  i$=.(hpi%|
000005d0  29 0d 02 08 12 20 20 e7  20 68 70 69 25 3c 3e 31  |)....  . hpi%<>1|
000005e0  36 20 8c 0d 02 12 37 20  20 20 20 f2 77 61 72 6e  |6 ....7    .warn|
000005f0  28 22 53 70 72 69 74 65  20 48 6f 72 69 7a 6f 6e  |("Sprite Horizon|
00000600  74 61 6c 20 73 69 7a 65  20 49 6e 63 6f 72 72 65  |tal size Incorre|
00000610  63 74 20 3d 20 22 2b 69  24 29 0d 02 1c 10 20 20  |ct = "+i$)....  |
00000620  20 20 d9 23 69 6e 25 3a  3d 31 0d 02 26 07 20 20  |  .#in%:=1..&.  |
00000630  cd 0d 02 30 0f 20 20 69  24 3d c3 28 68 6f 25 29  |...0.  i$=.(ho%)|
00000640  0d 02 3a 11 20 20 e7 20  68 6f 25 3c 3e 33 32 20  |..:.  . ho%<>32 |
00000650  8c 0d 02 44 35 20 20 20  20 f2 77 61 72 6e 28 22  |...D5    .warn("|
00000660  53 70 72 69 74 65 20 56  65 72 74 69 63 61 6c 20  |Sprite Vertical |
00000670  73 69 7a 65 20 49 6e 63  6f 72 72 65 63 74 20 3d  |size Incorrect =|
00000680  20 22 2b 69 24 29 0d 02  4e 10 20 20 20 20 d9 23  | "+i$)..N.    .#|
00000690  69 6e 25 3a 3d 31 0d 02  58 07 20 20 cd 0d 02 62  |in%:=1..X.  ...b|
000006a0  0f 20 20 69 24 3d c3 28  6c 62 25 29 0d 02 6c 11  |.  i$=.(lb%)..l.|
000006b0  20 20 e7 20 6c 62 25 3c  3e 32 37 20 8c 0d 02 76  |  . lb%<>27 ...v|
000006c0  2c 20 20 20 20 f2 77 61  72 6e 28 22 53 70 72 69  |,    .warn("Spri|
000006d0  74 65 20 4d 6f 64 65 20  49 6e 63 6f 72 72 65 63  |te Mode Incorrec|
000006e0  74 20 3d 20 22 2b 69 24  29 0d 02 80 10 20 20 20  |t = "+i$)....   |
000006f0  20 d9 23 69 6e 25 3a 3d  31 0d 02 8a 07 20 20 cd  | .#in%:=1....  .|
00000700  0d 02 94 04 0d 02 9e 1f  20 20 f4 20 77 72 69 74  |........  . writ|
00000710  65 20 49 63 6f 6e 20 68  65 61 64 65 72 20 62 6c  |e Icon header bl|
00000720  6f 63 6b 0d 02 a8 12 20  20 6f 75 74 25 3d ae 28  |ock....  out%=.(|
00000730  6f 75 74 24 29 0d 02 b2  0e 20 20 cf 23 6f 75 74  |out$)....  .#out|
00000740  25 3d 30 0d 02 bc 1b 20  20 f2 77 70 75 74 28 6f  |%=0....  .wput(o|
00000750  75 74 25 2c 26 30 30 30  31 30 30 30 30 29 0d 02  |ut%,&00010000)..|
00000760  c6 1b 20 20 f2 77 70 75  74 28 6f 75 74 25 2c 26  |..  .wput(out%,&|
00000770  32 30 32 30 30 30 30 31  29 0d 02 d0 1b 20 20 f2  |20200001)....  .|
00000780  77 70 75 74 28 6f 75 74  25 2c 26 30 30 30 30 30  |wput(out%,&00000|
00000790  30 31 30 29 0d 02 da 1b  20 20 f2 77 70 75 74 28  |010)....  .wput(|
000007a0  6f 75 74 25 2c 26 30 32  45 38 30 30 30 30 29 0d  |out%,&02E80000).|
000007b0  02 e4 1b 20 20 f2 77 70  75 74 28 6f 75 74 25 2c  |...  .wput(out%,|
000007c0  26 30 30 31 36 30 30 30  30 29 0d 02 ee 1b 20 20  |&00160000)....  |
000007d0  f2 77 70 75 74 28 6f 75  74 25 2c 26 30 30 32 38  |.wput(out%,&0028|
000007e0  30 30 30 30 29 0d 02 f8  1b 20 20 f2 77 70 75 74  |0000)....  .wput|
000007f0  28 6f 75 74 25 2c 26 30  30 32 30 30 30 30 30 29  |(out%,&00200000)|
00000800  0d 03 02 1b 20 20 f2 77  70 75 74 28 6f 75 74 25  |....  .wput(out%|
00000810  2c 26 30 30 34 30 30 30  30 30 29 0d 03 0c 1b 20  |,&00400000).... |
00000820  20 f2 77 70 75 74 28 6f  75 74 25 2c 26 30 30 30  | .wput(out%,&000|
00000830  31 30 30 30 30 29 0d 03  16 1b 20 20 f2 77 70 75  |10000)....  .wpu|
00000840  74 28 6f 75 74 25 2c 26  30 30 30 30 30 30 30 34  |t(out%,&00000004|
00000850  29 0d 03 20 1b 20 20 f2  77 70 75 74 28 6f 75 74  |).. .  .wput(out|
00000860  25 2c 26 30 32 38 30 30  30 30 30 29 0d 03 2a 10  |%,&02800000)..*.|
00000870  20 20 e3 20 69 25 3d 31  20 b8 20 36 0d 03 34 17  |  . i%=1 . 6..4.|
00000880  20 20 20 20 f2 77 70 75  74 28 6f 75 74 25 2c 26  |    .wput(out%,&|
00000890  30 30 29 0d 03 3e 07 20  20 ed 0d 03 48 1b 20 20  |00)..>.  ...H.  |
000008a0  f2 77 70 75 74 28 6f 75  74 25 2c 26 38 30 30 30  |.wput(out%,&8000|
000008b0  30 30 38 30 29 0d 03 52  1b 20 20 f2 77 70 75 74  |0080)..R.  .wput|
000008c0  28 6f 75 74 25 2c 26 38  30 30 30 30 30 30 30 29  |(out%,&80000000)|
000008d0  0d 03 5c 1b 20 20 f2 77  70 75 74 28 6f 75 74 25  |..\.  .wput(out%|
000008e0  2c 26 30 30 38 30 30 30  38 30 29 0d 03 66 1b 20  |,&00800080)..f. |
000008f0  20 f2 77 70 75 74 28 6f  75 74 25 2c 26 30 30 38  | .wput(out%,&008|
00000900  30 30 30 30 30 29 0d 03  70 1b 20 20 f2 77 70 75  |00000)..p.  .wpu|
00000910  74 28 6f 75 74 25 2c 26  38 30 38 30 30 30 38 30  |t(out%,&80800080|
00000920  29 0d 03 7a 1b 20 20 f2  77 70 75 74 28 6f 75 74  |)..z.  .wput(out|
00000930  25 2c 26 38 30 38 30 30  30 30 30 29 0d 03 84 1b  |%,&80800000)....|
00000940  20 20 f2 77 70 75 74 28  6f 75 74 25 2c 26 43 30  |  .wput(out%,&C0|
00000950  43 30 30 30 38 30 29 0d  03 8e 1b 20 20 f2 77 70  |C00080)....  .wp|
00000960  75 74 28 6f 75 74 25 2c  26 30 30 30 30 30 30 43  |ut(out%,&000000C|
00000970  30 29 0d 03 98 1b 20 20  f2 77 70 75 74 28 6f 75  |0)....  .wput(ou|
00000980  74 25 2c 26 46 46 30 30  30 30 46 46 29 0d 03 a2  |t%,&FF0000FF)...|
00000990  1b 20 20 f2 77 70 75 74  28 6f 75 74 25 2c 26 46  |.  .wput(out%,&F|
000009a0  46 30 30 30 30 30 30 29  0d 03 ac 1b 20 20 f2 77  |F000000)....  .w|
000009b0  70 75 74 28 6f 75 74 25  2c 26 30 30 46 46 30 30  |put(out%,&00FF00|
000009c0  46 46 29 0d 03 b6 1b 20  20 f2 77 70 75 74 28 6f  |FF)....  .wput(o|
000009d0  75 74 25 2c 26 30 30 46  46 30 30 30 30 29 0d 03  |ut%,&00FF0000)..|
000009e0  c0 1b 20 20 f2 77 70 75  74 28 6f 75 74 25 2c 26  |..  .wput(out%,&|
000009f0  46 46 46 46 30 30 46 46  29 0d 03 ca 1b 20 20 f2  |FFFF00FF)....  .|
00000a00  77 70 75 74 28 6f 75 74  25 2c 26 46 46 46 46 30  |wput(out%,&FFFF0|
00000a10  30 30 30 29 0d 03 d4 10  20 20 d5 23 6f 75 74 25  |000)....  .#out%|
00000a20  2c 26 46 46 0d 03 de 10  20 20 d5 23 6f 75 74 25  |,&FF....  .#out%|
00000a30  2c 26 30 30 0d 03 e8 34  20 20 f4 20 65 6e 64 20  |,&00...4  . end |
00000a40  6f 66 20 49 63 6f 6e 20  68 65 61 64 65 72 20 62  |of Icon header b|
00000a50  6c 6f 63 6b 20 2d 20 49  63 6f 6e 20 64 61 74 61  |lock - Icon data|
00000a60  20 66 6f 6c 6c 6f 77 73  0d 03 f2 04 0d 03 fc 24  | follows.......$|
00000a70  20 20 f4 20 72 65 61 64  20 61 6e 64 20 70 72 6f  |  . read and pro|
00000a80  63 65 73 73 20 73 70 72  69 74 65 20 64 61 74 61  |cess sprite data|
00000a90  0d 04 06 11 20 20 e3 20  6c 25 3d 31 20 b8 20 76  |....  . l%=1 . v|
00000aa0  25 0d 04 10 13 20 20 20  20 e3 20 69 25 3d 30 20  |%....    . i%=0 |
00000ab0  b8 20 68 25 0d 04 1a 21  20 20 20 20 20 20 f2 68  |. h%...!      .h|
00000ac0  6f 75 72 67 6c 61 73 73  28 8f 23 69 6e 25 2c a2  |ourglass(.#in%,.|
00000ad0  23 69 6e 25 29 0d 04 24  12 20 20 20 20 20 20 4c  |#in%)..$.      L|
00000ae0  25 3d 9a 23 69 6e 25 0d  04 2e 15 20 20 20 20 20  |%=.#in%....     |
00000af0  20 41 25 3d 4c 25 20 80  20 26 46 30 0d 04 38 15  | A%=L% . &F0..8.|
00000b00  20 20 20 20 20 20 42 25  3d 4c 25 20 80 20 26 30  |      B%=L% . &0|
00000b10  46 0d 04 42 14 20 20 20  20 20 20 43 25 3d 41 25  |F..B.      C%=A%|
00000b20  20 81 20 31 36 0d 04 4c  11 20 20 20 20 20 20 c8  | . 16..L.      .|
00000b30  8e 20 42 25 20 ca 0d 04  56 16 20 20 20 20 20 20  |. B% ...V.      |
00000b40  20 20 c9 20 30 3a 20 4a  25 3d 31 35 0d 04 60 15  |  . 0: J%=15..`.|
00000b50  20 20 20 20 20 20 20 20  c9 20 31 3a 20 4a 25 3d  |        . 1: J%=|
00000b60  38 0d 04 6a 15 20 20 20  20 20 20 20 20 c9 20 32  |8..j.        . 2|
00000b70  3a 20 4a 25 3d 38 0d 04  74 15 20 20 20 20 20 20  |: J%=8..t.      |
00000b80  20 20 c9 20 33 3a 20 4a  25 3d 33 0d 04 7e 15 20  |  . 3: J%=3..~. |
00000b90  20 20 20 20 20 20 20 c9  20 34 3a 20 4a 25 3d 35  |       . 4: J%=5|
00000ba0  0d 04 88 15 20 20 20 20  20 20 20 20 c9 20 35 3a  |....        . 5:|
00000bb0  20 4a 25 3d 34 0d 04 92  15 20 20 20 20 20 20 20  | J%=4....       |
00000bc0  20 c9 20 36 3a 20 4a 25  3d 30 0d 04 9c 15 20 20  | . 6: J%=0....  |
00000bd0  20 20 20 20 20 20 c9 20  37 3a 20 4a 25 3d 30 0d  |      . 7: J%=0.|
00000be0  04 a6 16 20 20 20 20 20  20 20 20 c9 20 38 3a 20  |...        . 8: |
00000bf0  4a 25 3d 31 32 0d 04 b0  16 20 20 20 20 20 20 20  |J%=12....       |
00000c00  20 c9 20 39 3a 20 4a 25  3d 31 31 0d 04 ba 17 20  | . 9: J%=11.... |
00000c10  20 20 20 20 20 20 20 c9  20 31 30 3a 20 4a 25 3d  |       . 10: J%=|
00000c20  31 30 0d 04 c4 16 20 20  20 20 20 20 20 20 c9 20  |10....        . |
00000c30  31 31 3a 20 4a 25 3d 31  0d 04 ce 17 20 20 20 20  |11: J%=1....    |
00000c40  20 20 20 20 c9 20 31 32  3a 20 4a 25 3d 31 31 0d  |    . 12: J%=11.|
00000c50  04 d8 17 20 20 20 20 20  20 20 20 c9 20 31 33 3a  |...        . 13:|
00000c60  20 4a 25 3d 31 30 0d 04  e2 17 20 20 20 20 20 20  | J%=10....      |
00000c70  20 20 c9 20 31 34 3a 20  4a 25 3d 31 33 0d 04 ec  |  . 14: J%=13...|
00000c80  17 20 20 20 20 20 20 20  20 c9 20 31 35 3a 20 4a  |.        . 15: J|
00000c90  25 3d 31 34 0d 04 f6 0b  20 20 20 20 20 20 cb 0d  |%=14....      ..|
00000ca0  05 00 0f 20 20 20 20 20  20 42 25 3d 4a 25 0d 05  |...      B%=J%..|
00000cb0  0a 11 20 20 20 20 20 20  c8 8e 20 43 25 20 ca 0d  |..      .. C% ..|
00000cc0  05 14 16 20 20 20 20 20  20 20 20 c9 20 30 3a 20  |...        . 0: |
00000cd0  4a 25 3d 31 35 0d 05 1e  15 20 20 20 20 20 20 20  |J%=15....       |
00000ce0  20 c9 20 31 3a 20 4a 25  3d 38 0d 05 28 15 20 20  | . 1: J%=8..(.  |
00000cf0  20 20 20 20 20 20 c9 20  32 3a 20 4a 25 3d 38 0d  |      . 2: J%=8.|
00000d00  05 32 15 20 20 20 20 20  20 20 20 c9 20 33 3a 20  |.2.        . 3: |
00000d10  4a 25 3d 33 0d 05 3c 15  20 20 20 20 20 20 20 20  |J%=3..<.        |
00000d20  c9 20 34 3a 20 4a 25 3d  35 0d 05 46 15 20 20 20  |. 4: J%=5..F.   |
00000d30  20 20 20 20 20 c9 20 35  3a 20 4a 25 3d 34 0d 05  |     . 5: J%=4..|
00000d40  50 15 20 20 20 20 20 20  20 20 c9 20 36 3a 20 4a  |P.        . 6: J|
00000d50  25 3d 30 0d 05 5a 15 20  20 20 20 20 20 20 20 c9  |%=0..Z.        .|
00000d60  20 37 3a 20 4a 25 3d 30  0d 05 64 16 20 20 20 20  | 7: J%=0..d.    |
00000d70  20 20 20 20 c9 20 38 3a  20 4a 25 3d 31 32 0d 05  |    . 8: J%=12..|
00000d80  6e 16 20 20 20 20 20 20  20 20 c9 20 39 3a 20 4a  |n.        . 9: J|
00000d90  25 3d 31 31 0d 05 78 17  20 20 20 20 20 20 20 20  |%=11..x.        |
00000da0  c9 20 31 30 3a 20 4a 25  3d 31 30 0d 05 82 16 20  |. 10: J%=10.... |
00000db0  20 20 20 20 20 20 20 c9  20 31 31 3a 20 4a 25 3d  |       . 11: J%=|
00000dc0  31 0d 05 8c 17 20 20 20  20 20 20 20 20 c9 20 31  |1....        . 1|
00000dd0  32 3a 20 4a 25 3d 31 31  0d 05 96 17 20 20 20 20  |2: J%=11....    |
00000de0  20 20 20 20 c9 20 31 33  3a 20 4a 25 3d 31 30 0d  |    . 13: J%=10.|
00000df0  05 a0 17 20 20 20 20 20  20 20 20 c9 20 31 34 3a  |...        . 14:|
00000e00  20 4a 25 3d 31 33 0d 05  aa 17 20 20 20 20 20 20  | J%=13....      |
00000e10  20 20 c9 20 31 35 3a 20  4a 25 3d 31 34 0d 05 b4  |  . 15: J%=14...|
00000e20  0b 20 20 20 20 20 20 cb  0d 05 be 0f 20 20 20 20  |.      .....    |
00000e30  20 20 43 25 3d 4a 25 0d  05 c8 14 20 20 20 20 20  |  C%=J%....     |
00000e40  20 44 25 3d 42 25 20 2a  20 31 36 0d 05 d2 14 20  | D%=B% * 16.... |
00000e50  20 20 20 20 20 4c 25 3d  28 44 25 2b 43 25 29 0d  |     L%=(D%+C%).|
00000e60  05 dc 1d 20 20 20 20 20  20 6a 25 3d 69 25 2b 28  |...      j%=i%+(|
00000e70  6c 25 2d 31 29 2a 28 68  25 2b 31 29 0d 05 e6 17  |l%-1)*(h%+1)....|
00000e80  20 20 20 20 20 20 73 63  72 65 65 6e 25 3f 6a 25  |      screen%?j%|
00000e90  3d 4c 25 0d 05 f0 09 20  20 20 20 ed 0d 05 fa 07  |=L%....    .....|
00000ea0  20 20 ed 0d 06 04 11 20  20 e3 20 6c 25 3d 31 20  |  .....  . l%=1 |
00000eb0  b8 20 76 25 0d 06 0e 13  20 20 20 20 e3 20 69 25  |. v%....    . i%|
00000ec0  3d 30 20 b8 20 68 25 0d  06 18 1e 20 20 20 20 20  |=0 . h%....     |
00000ed0  20 6a 25 3d 69 25 2b 28  76 25 2d 6c 25 29 2a 28  | j%=i%+(v%-l%)*(|
00000ee0  68 25 2b 31 29 0d 06 22  17 20 20 20 20 20 20 4c  |h%+1)..".      L|
00000ef0  25 3d 73 63 72 65 65 6e  25 3f 6a 25 0d 06 2c 13  |%=screen%?j%..,.|
00000f00  20 20 20 20 20 20 d5 23  6f 75 74 25 2c 4c 25 0d  |      .#out%,L%.|
00000f10  06 36 09 20 20 20 20 ed  0d 06 40 07 20 20 ed 0d  |.6.    ...@.  ..|
00000f20  06 4a 04 0d 06 54 1d 20  20 f4 20 77 72 69 74 65  |.J...T.  . write|
00000f30  20 69 63 6f 6e 20 74 61  69 6c 20 62 6c 6f 63 6b  | icon tail block|
00000f40  0d 06 5e 12 20 20 e3 20  69 25 3d 31 20 b8 20 26  |..^.  . i%=1 . &|
00000f50  38 30 0d 06 68 12 20 20  20 20 d5 23 6f 75 74 25  |80..h.    .#out%|
00000f60  2c 26 30 30 0d 06 72 07  20 20 ed 0d 06 7c 0b 20  |,&00..r.  ...|. |
00000f70  20 d9 23 69 6e 25 0d 06  86 0c 20 20 d9 23 6f 75  | .#in%....  .#ou|
00000f80  74 25 0d 06 90 05 cd 0d  06 9a 06 3d 30 0d 06 a4  |t%.........=0...|
00000f90  04 0d 06 ae 04 0d 06 b8  04 0d ff                 |...........|
00000f9b