Home » Personal collection » Acorn hard disk » apps » !Fireworkz » Resource/Loader

Resource/Loader

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 » Personal collection » Acorn hard disk » apps » !Fireworkz
Filename: Resource/Loader
Read OK:
File size: 06D7 bytes
Load address: 0000
Exec address: 0000
File contents
   10PROCmain(FNreadargs)
   20END
   30:
   40DEF PROCmain(args$)
   50LOCAL ptr%, buflen%
   60:
   70buflen% = 255
   80DIM buffer% buflen%
   90SYS "OS_ReadArgs","BASIC,quit/K,load/K,image/A/G",args$,buffer%,buflen%
  100:
  110ptr% = buffer%
  120:
  130REM Skip BASIC, optional -quit, -load filename
  140ptr% += 4
  150ptr% += 4
  160ptr% += 4
  170:
  180f$ = FNstringizeGS(!ptr%)
  190ptr% += 4
  200:
  210SYS8,17,f$TOR%,,,,Z%:IFR%<>1THENENDPROC
  220:
  230DIM v%36
  240v%!0=11:v%!4=12:v%!8=4:v%!12=5:v%!16=-1
  250SYS&31,v%,v%+20
  260px%=1<<v%!28
  270py%=1<<v%!32
  280sw%=(1+v%!20)<<v%!28
  290sh%=(1+v%!24)<<v%!32
  300:
  310SYS&400C0,200,&4b534154
  320:
  330SYS&42701,8 TO sqws%
  340sqwa%=FNe
  350spr%=(sqwa%+sqws%+3)AND-4
  360PROCs(spr%+Z%)
  370SYS8,16,f$,spr%
  380IF !spr%=&48535153 THEN
  390  xpb%=(spr%+Z%+3)AND-4
  400  PROCs(xpb%+spr%!4)
  410  SYS&42701,0,sqwa%,spr%+20,Z%-20,xpb%,spr%!4
  420  spr%=xpb%
  430ENDIF
  440spr%+=12
  450SYS&2E,&228,&100,spr%TO,,,w%,h%,,m%
  460SYS&35,m%,4TO,,spx%
  470SYS&35,m%,5TO,,spy%
  480w%=w%<<spx%
  490h%=h%<<spy%
  500xp%=((sw%-w%)/2)AND-px%
  510yp%=((sh%-h%)/2)AND-py%
  520w%+=(px%*2)
  530h%+=(py%*2)
  540:
  550SYS&40743
  560PLOT4,xp%-(px%*2),yp%-(py%*2)
  570PLOT97,w%+px%,h%+py%
  580:
  590SYS&40743,&FFFFFF00
  600PLOT4,xp%-px%,yp%-py%
  610PLOT97,0,h%-py%
  620PLOT97,w%-px%,0
  630:
  640SYS&40743,&99999900
  650PLOT97,0,-(h%-py%)
  660PLOT97,-(w%-px%),0
  670:
  680DIM tr%64
  690FORa%=0TO60STEP4
  700  a%!tr%=!(spr%+44+(a%*2))
  710NEXTa%
  720SYS&40740,m%,tr%,-1,-1,tr%
  730SYS&2E,&234,&100,spr%,xp%,yp%,,,tr%
  740:
  750SYS&400D1,-1,xp%-(8*px%),yp%-(8*py%),xp%+w%+(8*px%),yp%+h%+(8*py%)
  760SYS&400DD
  770ENDPROC
  780:
  790DEF FNreadargs
  800LOCAL A$
  810SYS "OS_GetEnv" TO A$
  820= A$
  830:
  840DEF FNstringizeGS(ptr%)
  850LOCAL A%, L%
  860L% = ?ptr%
  870A% = 0
  880WHILE A% < L%
  890  ptr%?(A%) = ptr%?(A%+2)
  900  A% += 1
  910ENDWHILE
  920ptr%?A% = 13
  930= $ptr%
  940:
  950DEFPROCs(a%)
  960SYS&400EC,a%-&8000,-1
  970ENDPROC
  980:
  990DEFFNe
 1000SYS&400EC,-1,-1 TO a%
 1010=a%+&8000

�main(�readargs)
�
:
(� �main(args$)
2� ptr%, buflen%
<:
Fbuflen% = 255
P� buffer% buflen%
ZJș "OS_ReadArgs","BASIC,quit/K,load/K,image/A/G",args$,buffer%,buflen%
d:
nptr% = buffer%
x:
�0� Skip BASIC, optional -quit, -load filename
�
ptr% += 4
�
ptr% += 4
�
ptr% += 4
�:
�f$ = �stringizeGS(!ptr%)
�
ptr% += 4
�:
�ș8,17,f$�R%,,,,Z%:�R%<>1��
�:
�
� v%36
�+v%!0=11:v%!4=12:v%!8=4:v%!12=5:v%!16=-1
�ș&31,v%,v%+20
px%=1<<v%!28
py%=1<<v%!32
sw%=(1+v%!20)<<v%!28
"sh%=(1+v%!24)<<v%!32
,:
6ș&400C0,200,&4b534154
@:
Jș&42701,8 � sqws%
Tsqwa%=�e
^spr%=(sqwa%+sqws%+3)�-4
h�s(spr%+Z%)
rș8,16,f$,spr%
|� !spr%=&48535153 �
�  xpb%=(spr%+Z%+3)�-4
�  �s(xpb%+spr%!4)
�0  ș&42701,0,sqwa%,spr%+20,Z%-20,xpb%,spr%!4
�  spr%=xpb%
��
�spr%+=12
�%ș&2E,&228,&100,spr%�,,,w%,h%,,m%
�ș&35,m%,4�,,spx%
�ș&35,m%,5�,,spy%
�w%=w%<<spx%
�h%=h%<<spy%
�xp%=((sw%-w%)/2)�-px%
�yp%=((sh%-h%)/2)�-py%
w%+=(px%*2)
h%+=(py%*2)
:
&ș&40743
0�4,xp%-(px%*2),yp%-(py%*2)
:�97,w%+px%,h%+py%
D:
Nș&40743,&FFFFFF00
X�4,xp%-px%,yp%-py%
b�97,0,h%-py%
l�97,w%-px%,0
v:
�ș&40743,&99999900
��97,0,-(h%-py%)
��97,-(w%-px%),0
�:
�� tr%64
��a%=0�60�4
�  a%!tr%=!(spr%+44+(a%*2))
��a%
�ș&40740,m%,tr%,-1,-1,tr%
�&ș&2E,&234,&100,spr%,xp%,yp%,,,tr%
�:
�Eș&400D1,-1,xp%-(8*px%),yp%-(8*py%),xp%+w%+(8*px%),yp%+h%+(8*py%)
�ș&400DD
�
:
� �readargs
 � A$
*ș "OS_GetEnv" � A$
4= A$
>:
H� �stringizeGS(ptr%)
R� A%, L%
\L% = ?ptr%
f
A% = 0
pȕ A% < L%
z  ptr%?(A%) = ptr%?(A%+2)
�
  A% += 1
��
�ptr%?A% = 13
�= $ptr%
�:
���s(a%)
�ș&400EC,a%-&8000,-1
��
�:
�ݤe
�ș&400EC,-1,-1 � a%
�
=a%+&8000
�
00000000  0d 00 0a 14 f2 6d 61 69  6e 28 a4 72 65 61 64 61  |.....main(.reada|
00000010  72 67 73 29 0d 00 14 05  e0 0d 00 1e 05 3a 0d 00  |rgs).........:..|
00000020  28 12 dd 20 f2 6d 61 69  6e 28 61 72 67 73 24 29  |(.. .main(args$)|
00000030  0d 00 32 13 ea 20 70 74  72 25 2c 20 62 75 66 6c  |..2.. ptr%, bufl|
00000040  65 6e 25 0d 00 3c 05 3a  0d 00 46 11 62 75 66 6c  |en%..<.:..F.bufl|
00000050  65 6e 25 20 3d 20 32 35  35 0d 00 50 15 de 20 62  |en% = 255..P.. b|
00000060  75 66 66 65 72 25 20 62  75 66 6c 65 6e 25 0d 00  |uffer% buflen%..|
00000070  5a 4a c8 99 20 22 4f 53  5f 52 65 61 64 41 72 67  |ZJ.. "OS_ReadArg|
00000080  73 22 2c 22 42 41 53 49  43 2c 71 75 69 74 2f 4b  |s","BASIC,quit/K|
00000090  2c 6c 6f 61 64 2f 4b 2c  69 6d 61 67 65 2f 41 2f  |,load/K,image/A/|
000000a0  47 22 2c 61 72 67 73 24  2c 62 75 66 66 65 72 25  |G",args$,buffer%|
000000b0  2c 62 75 66 6c 65 6e 25  0d 00 64 05 3a 0d 00 6e  |,buflen%..d.:..n|
000000c0  12 70 74 72 25 20 3d 20  62 75 66 66 65 72 25 0d  |.ptr% = buffer%.|
000000d0  00 78 05 3a 0d 00 82 30  f4 20 53 6b 69 70 20 42  |.x.:...0. Skip B|
000000e0  41 53 49 43 2c 20 6f 70  74 69 6f 6e 61 6c 20 2d  |ASIC, optional -|
000000f0  71 75 69 74 2c 20 2d 6c  6f 61 64 20 66 69 6c 65  |quit, -load file|
00000100  6e 61 6d 65 0d 00 8c 0d  70 74 72 25 20 2b 3d 20  |name....ptr% += |
00000110  34 0d 00 96 0d 70 74 72  25 20 2b 3d 20 34 0d 00  |4....ptr% += 4..|
00000120  a0 0d 70 74 72 25 20 2b  3d 20 34 0d 00 aa 05 3a  |..ptr% += 4....:|
00000130  0d 00 b4 1c 66 24 20 3d  20 a4 73 74 72 69 6e 67  |....f$ = .string|
00000140  69 7a 65 47 53 28 21 70  74 72 25 29 0d 00 be 0d  |izeGS(!ptr%)....|
00000150  70 74 72 25 20 2b 3d 20  34 0d 00 c8 05 3a 0d 00  |ptr% += 4....:..|
00000160  d2 1f c8 99 38 2c 31 37  2c 66 24 b8 52 25 2c 2c  |....8,17,f$.R%,,|
00000170  2c 2c 5a 25 3a e7 52 25  3c 3e 31 8c e1 0d 00 dc  |,,Z%:.R%<>1.....|
00000180  05 3a 0d 00 e6 0a de 20  76 25 33 36 0d 00 f0 2b  |.:..... v%36...+|
00000190  76 25 21 30 3d 31 31 3a  76 25 21 34 3d 31 32 3a  |v%!0=11:v%!4=12:|
000001a0  76 25 21 38 3d 34 3a 76  25 21 31 32 3d 35 3a 76  |v%!8=4:v%!12=5:v|
000001b0  25 21 31 36 3d 2d 31 0d  00 fa 12 c8 99 26 33 31  |%!16=-1......&31|
000001c0  2c 76 25 2c 76 25 2b 32  30 0d 01 04 10 70 78 25  |,v%,v%+20....px%|
000001d0  3d 31 3c 3c 76 25 21 32  38 0d 01 0e 10 70 79 25  |=1<<v%!28....py%|
000001e0  3d 31 3c 3c 76 25 21 33  32 0d 01 18 18 73 77 25  |=1<<v%!32....sw%|
000001f0  3d 28 31 2b 76 25 21 32  30 29 3c 3c 76 25 21 32  |=(1+v%!20)<<v%!2|
00000200  38 0d 01 22 18 73 68 25  3d 28 31 2b 76 25 21 32  |8..".sh%=(1+v%!2|
00000210  34 29 3c 3c 76 25 21 33  32 0d 01 2c 05 3a 0d 01  |4)<<v%!32..,.:..|
00000220  36 1a c8 99 26 34 30 30  43 30 2c 32 30 30 2c 26  |6...&400C0,200,&|
00000230  34 62 35 33 34 31 35 34  0d 01 40 05 3a 0d 01 4a  |4b534154..@.:..J|
00000240  16 c8 99 26 34 32 37 30  31 2c 38 20 b8 20 73 71  |...&42701,8 . sq|
00000250  77 73 25 0d 01 54 0c 73  71 77 61 25 3d a4 65 0d  |ws%..T.sqwa%=.e.|
00000260  01 5e 1b 73 70 72 25 3d  28 73 71 77 61 25 2b 73  |.^.spr%=(sqwa%+s|
00000270  71 77 73 25 2b 33 29 80  2d 34 0d 01 68 0f f2 73  |qws%+3).-4..h..s|
00000280  28 73 70 72 25 2b 5a 25  29 0d 01 72 12 c8 99 38  |(spr%+Z%)..r...8|
00000290  2c 31 36 2c 66 24 2c 73  70 72 25 0d 01 7c 17 e7  |,16,f$,spr%..|..|
000002a0  20 21 73 70 72 25 3d 26  34 38 35 33 35 31 35 33  | !spr%=&48535153|
000002b0  20 8c 0d 01 86 19 20 20  78 70 62 25 3d 28 73 70  | .....  xpb%=(sp|
000002c0  72 25 2b 5a 25 2b 33 29  80 2d 34 0d 01 90 15 20  |r%+Z%+3).-4.... |
000002d0  20 f2 73 28 78 70 62 25  2b 73 70 72 25 21 34 29  | .s(xpb%+spr%!4)|
000002e0  0d 01 9a 30 20 20 c8 99  26 34 32 37 30 31 2c 30  |...0  ..&42701,0|
000002f0  2c 73 71 77 61 25 2c 73  70 72 25 2b 32 30 2c 5a  |,sqwa%,spr%+20,Z|
00000300  25 2d 32 30 2c 78 70 62  25 2c 73 70 72 25 21 34  |%-20,xpb%,spr%!4|
00000310  0d 01 a4 0f 20 20 73 70  72 25 3d 78 70 62 25 0d  |....  spr%=xpb%.|
00000320  01 ae 05 cd 0d 01 b8 0c  73 70 72 25 2b 3d 31 32  |........spr%+=12|
00000330  0d 01 c2 25 c8 99 26 32  45 2c 26 32 32 38 2c 26  |...%..&2E,&228,&|
00000340  31 30 30 2c 73 70 72 25  b8 2c 2c 2c 77 25 2c 68  |100,spr%.,,,w%,h|
00000350  25 2c 2c 6d 25 0d 01 cc  15 c8 99 26 33 35 2c 6d  |%,,m%......&35,m|
00000360  25 2c 34 b8 2c 2c 73 70  78 25 0d 01 d6 15 c8 99  |%,4.,,spx%......|
00000370  26 33 35 2c 6d 25 2c 35  b8 2c 2c 73 70 79 25 0d  |&35,m%,5.,,spy%.|
00000380  01 e0 0f 77 25 3d 77 25  3c 3c 73 70 78 25 0d 01  |...w%=w%<<spx%..|
00000390  ea 0f 68 25 3d 68 25 3c  3c 73 70 79 25 0d 01 f4  |..h%=h%<<spy%...|
000003a0  19 78 70 25 3d 28 28 73  77 25 2d 77 25 29 2f 32  |.xp%=((sw%-w%)/2|
000003b0  29 80 2d 70 78 25 0d 01  fe 19 79 70 25 3d 28 28  |).-px%....yp%=((|
000003c0  73 68 25 2d 68 25 29 2f  32 29 80 2d 70 79 25 0d  |sh%-h%)/2).-py%.|
000003d0  02 08 0f 77 25 2b 3d 28  70 78 25 2a 32 29 0d 02  |...w%+=(px%*2)..|
000003e0  12 0f 68 25 2b 3d 28 70  79 25 2a 32 29 0d 02 1c  |..h%+=(py%*2)...|
000003f0  05 3a 0d 02 26 0c c8 99  26 34 30 37 34 33 0d 02  |.:..&...&40743..|
00000400  30 1e f0 34 2c 78 70 25  2d 28 70 78 25 2a 32 29  |0..4,xp%-(px%*2)|
00000410  2c 79 70 25 2d 28 70 79  25 2a 32 29 0d 02 3a 15  |,yp%-(py%*2)..:.|
00000420  f0 39 37 2c 77 25 2b 70  78 25 2c 68 25 2b 70 79  |.97,w%+px%,h%+py|
00000430  25 0d 02 44 05 3a 0d 02  4e 16 c8 99 26 34 30 37  |%..D.:..N...&407|
00000440  34 33 2c 26 46 46 46 46  46 46 30 30 0d 02 58 16  |43,&FFFFFF00..X.|
00000450  f0 34 2c 78 70 25 2d 70  78 25 2c 79 70 25 2d 70  |.4,xp%-px%,yp%-p|
00000460  79 25 0d 02 62 10 f0 39  37 2c 30 2c 68 25 2d 70  |y%..b..97,0,h%-p|
00000470  79 25 0d 02 6c 10 f0 39  37 2c 77 25 2d 70 78 25  |y%..l..97,w%-px%|
00000480  2c 30 0d 02 76 05 3a 0d  02 80 16 c8 99 26 34 30  |,0..v.:......&40|
00000490  37 34 33 2c 26 39 39 39  39 39 39 30 30 0d 02 8a  |743,&99999900...|
000004a0  13 f0 39 37 2c 30 2c 2d  28 68 25 2d 70 79 25 29  |..97,0,-(h%-py%)|
000004b0  0d 02 94 13 f0 39 37 2c  2d 28 77 25 2d 70 78 25  |.....97,-(w%-px%|
000004c0  29 2c 30 0d 02 9e 05 3a  0d 02 a8 0b de 20 74 72  |),0....:..... tr|
000004d0  25 36 34 0d 02 b2 0e e3  61 25 3d 30 b8 36 30 88  |%64.....a%=0.60.|
000004e0  34 0d 02 bc 1e 20 20 61  25 21 74 72 25 3d 21 28  |4....  a%!tr%=!(|
000004f0  73 70 72 25 2b 34 34 2b  28 61 25 2a 32 29 29 0d  |spr%+44+(a%*2)).|
00000500  02 c6 07 ed 61 25 0d 02  d0 1d c8 99 26 34 30 37  |....a%......&407|
00000510  34 30 2c 6d 25 2c 74 72  25 2c 2d 31 2c 2d 31 2c  |40,m%,tr%,-1,-1,|
00000520  74 72 25 0d 02 da 26 c8  99 26 32 45 2c 26 32 33  |tr%...&..&2E,&23|
00000530  34 2c 26 31 30 30 2c 73  70 72 25 2c 78 70 25 2c  |4,&100,spr%,xp%,|
00000540  79 70 25 2c 2c 2c 74 72  25 0d 02 e4 05 3a 0d 02  |yp%,,,tr%....:..|
00000550  ee 45 c8 99 26 34 30 30  44 31 2c 2d 31 2c 78 70  |.E..&400D1,-1,xp|
00000560  25 2d 28 38 2a 70 78 25  29 2c 79 70 25 2d 28 38  |%-(8*px%),yp%-(8|
00000570  2a 70 79 25 29 2c 78 70  25 2b 77 25 2b 28 38 2a  |*py%),xp%+w%+(8*|
00000580  70 78 25 29 2c 79 70 25  2b 68 25 2b 28 38 2a 70  |px%),yp%+h%+(8*p|
00000590  79 25 29 0d 02 f8 0c c8  99 26 34 30 30 44 44 0d  |y%)......&400DD.|
000005a0  03 02 05 e1 0d 03 0c 05  3a 0d 03 16 0f dd 20 a4  |........:..... .|
000005b0  72 65 61 64 61 72 67 73  0d 03 20 08 ea 20 41 24  |readargs.. .. A$|
000005c0  0d 03 2a 17 c8 99 20 22  4f 53 5f 47 65 74 45 6e  |..*... "OS_GetEn|
000005d0  76 22 20 b8 20 41 24 0d  03 34 08 3d 20 41 24 0d  |v" . A$..4.= A$.|
000005e0  03 3e 05 3a 0d 03 48 18  dd 20 a4 73 74 72 69 6e  |.>.:..H.. .strin|
000005f0  67 69 7a 65 47 53 28 70  74 72 25 29 0d 03 52 0c  |gizeGS(ptr%)..R.|
00000600  ea 20 41 25 2c 20 4c 25  0d 03 5c 0e 4c 25 20 3d  |. A%, L%..\.L% =|
00000610  20 3f 70 74 72 25 0d 03  66 0a 41 25 20 3d 20 30  | ?ptr%..f.A% = 0|
00000620  0d 03 70 0e c8 95 20 41  25 20 3c 20 4c 25 0d 03  |..p... A% < L%..|
00000630  7a 1d 20 20 70 74 72 25  3f 28 41 25 29 20 3d 20  |z.  ptr%?(A%) = |
00000640  70 74 72 25 3f 28 41 25  2b 32 29 0d 03 84 0d 20  |ptr%?(A%+2).... |
00000650  20 41 25 20 2b 3d 20 31  0d 03 8e 05 ce 0d 03 98  | A% += 1........|
00000660  10 70 74 72 25 3f 41 25  20 3d 20 31 33 0d 03 a2  |.ptr%?A% = 13...|
00000670  0b 3d 20 24 70 74 72 25  0d 03 ac 05 3a 0d 03 b6  |.= $ptr%....:...|
00000680  0b dd f2 73 28 61 25 29  0d 03 c0 18 c8 99 26 34  |...s(a%)......&4|
00000690  30 30 45 43 2c 61 25 2d  26 38 30 30 30 2c 2d 31  |00EC,a%-&8000,-1|
000006a0  0d 03 ca 05 e1 0d 03 d4  05 3a 0d 03 de 07 dd a4  |.........:......|
000006b0  65 0d 03 e8 17 c8 99 26  34 30 30 45 43 2c 2d 31  |e......&400EC,-1|
000006c0  2c 2d 31 20 b8 20 61 25  0d 03 f2 0d 3d 61 25 2b  |,-1 . a%....=a%+|
000006d0  26 38 30 30 30 0d ff                              |&8000..|
000006d7