Home » Archimedes archive » Acorn User » AU 1995-02.adf » !Q_Q » BackBoot

BackBoot

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 » Archimedes archive » Acorn User » AU 1995-02.adf » !Q_Q
Filename: BackBoot
Read OK:
File size: 03A3 bytes
Load address: 0000
Exec address: 0000
File contents
    1REM >Backboot
    2REM perform boot-up tasks in the background
    3:
    4par$=FNgetpars
    5F%=OPENIN par$
    6IF F%=0 THEN ERROR 1,"Script file "+par$+" not found"
    7DIM block% 255
    8SYS"Wimp_Initialise",200,&4B534154,"Background Boot"
    9REPEAT
   10 SYS"OS_ReadMonotonicTime" TO time%
   11 SYS"Wimp_PollIdle",0,block%,time%+30 TO reason%
   12 IF reason%=0 THEN
   13  line$=GET$#F%
   14  SYS"Wimp_StartTask",line$
   15 ENDIF
   16 quit%=EOF#F%
   17UNTIL quit%
   18CLOSE #F%
   19SYS"Wimp_CloseDown"
   20END
   21:
   22REM this function could do this being written better. Particularly the
   23REM part that searches for the parameter since it looks for the
   24REM name of the program. ie it won't work if it's renamed!
   25:
   26DEF FNgetpars
   27SYS"OS_GetEnv" TO A%:B%=A%
   28WHILE ?B%>31
   29IF ?B%>64 AND ?B%<91 ?B%+=32
   30B%+=1
   31ENDWHILE
   32WHILE B%?-1=32 AND B%>A% B%-=1:ENDWHILE
   33?B%=13
   34P%=INSTR($A%,".backboot")
   35IF P%=0 ERROR 1,"Bad environment string: '"+$A%+"'"
   36P%=INSTR($A%," ",P%)
   37IF P%=0 ERROR 1,"No parameter supplied"
   38=MID$($A%,P%)
� >Backboot
-� perform boot-up tasks in the background
:
par$=�getpars

F%=� par$
1� F%=0 � � 1,"Script file "+par$+" not found"
� block% 255
7ș"Wimp_Initialise",200,&4B534154,"Background Boot"
	�

% ș"OS_ReadMonotonicTime" � time%
2 ș"Wimp_PollIdle",0,block%,time%+30 � reason%
 � reason%=0 �

  line$=�#F%
  ș"Wimp_StartTask",line$
 �
 quit%=�#F%
� quit%
	� #F%
ș"Wimp_CloseDown"
�
:
H� this function could do this being written better. Particularly the
A� part that searches for the parameter since it looks for the
<� name of the program. ie it won't work if it's renamed!
:
� �getpars
ș"OS_GetEnv" � A%:B%=A%

ȕ ?B%>31
� ?B%>64 � ?B%<91 ?B%+=32
	B%+=1
�
 ȕ B%?-1=32 � B%>A% B%-=1:�
!
?B%=13
"P%=�$A%,".backboot")
#2� P%=0 � 1,"Bad environment string: '"+$A%+"'"
$P%=�$A%," ",P%)
%&� P%=0 � 1,"No parameter supplied"
&
=�$A%,P%)
�
00000000  0d 00 01 0f f4 20 3e 42  61 63 6b 62 6f 6f 74 0d  |..... >Backboot.|
00000010  00 02 2d f4 20 70 65 72  66 6f 72 6d 20 62 6f 6f  |..-. perform boo|
00000020  74 2d 75 70 20 74 61 73  6b 73 20 69 6e 20 74 68  |t-up tasks in th|
00000030  65 20 62 61 63 6b 67 72  6f 75 6e 64 0d 00 03 05  |e background....|
00000040  3a 0d 00 04 11 70 61 72  24 3d a4 67 65 74 70 61  |:....par$=.getpa|
00000050  72 73 0d 00 05 0d 46 25  3d 8e 20 70 61 72 24 0d  |rs....F%=. par$.|
00000060  00 06 31 e7 20 46 25 3d  30 20 8c 20 85 20 31 2c  |..1. F%=0 . . 1,|
00000070  22 53 63 72 69 70 74 20  66 69 6c 65 20 22 2b 70  |"Script file "+p|
00000080  61 72 24 2b 22 20 6e 6f  74 20 66 6f 75 6e 64 22  |ar$+" not found"|
00000090  0d 00 07 10 de 20 62 6c  6f 63 6b 25 20 32 35 35  |..... block% 255|
000000a0  0d 00 08 37 c8 99 22 57  69 6d 70 5f 49 6e 69 74  |...7.."Wimp_Init|
000000b0  69 61 6c 69 73 65 22 2c  32 30 30 2c 26 34 42 35  |ialise",200,&4B5|
000000c0  33 34 31 35 34 2c 22 42  61 63 6b 67 72 6f 75 6e  |34154,"Backgroun|
000000d0  64 20 42 6f 6f 74 22 0d  00 09 05 f5 0d 00 0a 25  |d Boot"........%|
000000e0  20 c8 99 22 4f 53 5f 52  65 61 64 4d 6f 6e 6f 74  | .."OS_ReadMonot|
000000f0  6f 6e 69 63 54 69 6d 65  22 20 b8 20 74 69 6d 65  |onicTime" . time|
00000100  25 0d 00 0b 32 20 c8 99  22 57 69 6d 70 5f 50 6f  |%...2 .."Wimp_Po|
00000110  6c 6c 49 64 6c 65 22 2c  30 2c 62 6c 6f 63 6b 25  |llIdle",0,block%|
00000120  2c 74 69 6d 65 25 2b 33  30 20 b8 20 72 65 61 73  |,time%+30 . reas|
00000130  6f 6e 25 0d 00 0c 12 20  e7 20 72 65 61 73 6f 6e  |on%.... . reason|
00000140  25 3d 30 20 8c 0d 00 0d  10 20 20 6c 69 6e 65 24  |%=0 .....  line$|
00000150  3d be 23 46 25 0d 00 0e  1e 20 20 c8 99 22 57 69  |=.#F%....  .."Wi|
00000160  6d 70 5f 53 74 61 72 74  54 61 73 6b 22 2c 6c 69  |mp_StartTask",li|
00000170  6e 65 24 0d 00 0f 06 20  cd 0d 00 10 0f 20 71 75  |ne$.... ..... qu|
00000180  69 74 25 3d c5 23 46 25  0d 00 11 0b fd 20 71 75  |it%=.#F%..... qu|
00000190  69 74 25 0d 00 12 09 d9  20 23 46 25 0d 00 13 16  |it%..... #F%....|
000001a0  c8 99 22 57 69 6d 70 5f  43 6c 6f 73 65 44 6f 77  |.."Wimp_CloseDow|
000001b0  6e 22 0d 00 14 05 e0 0d  00 15 05 3a 0d 00 16 48  |n".........:...H|
000001c0  f4 20 74 68 69 73 20 66  75 6e 63 74 69 6f 6e 20  |. this function |
000001d0  63 6f 75 6c 64 20 64 6f  20 74 68 69 73 20 62 65  |could do this be|
000001e0  69 6e 67 20 77 72 69 74  74 65 6e 20 62 65 74 74  |ing written bett|
000001f0  65 72 2e 20 50 61 72 74  69 63 75 6c 61 72 6c 79  |er. Particularly|
00000200  20 74 68 65 0d 00 17 41  f4 20 70 61 72 74 20 74  | the...A. part t|
00000210  68 61 74 20 73 65 61 72  63 68 65 73 20 66 6f 72  |hat searches for|
00000220  20 74 68 65 20 70 61 72  61 6d 65 74 65 72 20 73  | the parameter s|
00000230  69 6e 63 65 20 69 74 20  6c 6f 6f 6b 73 20 66 6f  |ince it looks fo|
00000240  72 20 74 68 65 0d 00 18  3c f4 20 6e 61 6d 65 20  |r the...<. name |
00000250  6f 66 20 74 68 65 20 70  72 6f 67 72 61 6d 2e 20  |of the program. |
00000260  69 65 20 69 74 20 77 6f  6e 27 74 20 77 6f 72 6b  |ie it won't work|
00000270  20 69 66 20 69 74 27 73  20 72 65 6e 61 6d 65 64  | if it's renamed|
00000280  21 0d 00 19 05 3a 0d 00  1a 0e dd 20 a4 67 65 74  |!....:..... .get|
00000290  70 61 72 73 0d 00 1b 1c  c8 99 22 4f 53 5f 47 65  |pars......"OS_Ge|
000002a0  74 45 6e 76 22 20 b8 20  41 25 3a 42 25 3d 41 25  |tEnv" . A%:B%=A%|
000002b0  0d 00 1c 0d c8 95 20 3f  42 25 3e 33 31 0d 00 1d  |...... ?B%>31...|
000002c0  1d e7 20 3f 42 25 3e 36  34 20 80 20 3f 42 25 3c  |.. ?B%>64 . ?B%<|
000002d0  39 31 20 3f 42 25 2b 3d  33 32 0d 00 1e 09 42 25  |91 ?B%+=32....B%|
000002e0  2b 3d 31 0d 00 1f 05 ce  0d 00 20 1f c8 95 20 42  |+=1....... ... B|
000002f0  25 3f 2d 31 3d 33 32 20  80 20 42 25 3e 41 25 20  |%?-1=32 . B%>A% |
00000300  42 25 2d 3d 31 3a ce 0d  00 21 0a 3f 42 25 3d 31  |B%-=1:...!.?B%=1|
00000310  33 0d 00 22 18 50 25 3d  a7 24 41 25 2c 22 2e 62  |3..".P%=.$A%,".b|
00000320  61 63 6b 62 6f 6f 74 22  29 0d 00 23 32 e7 20 50  |ackboot")..#2. P|
00000330  25 3d 30 20 85 20 31 2c  22 42 61 64 20 65 6e 76  |%=0 . 1,"Bad env|
00000340  69 72 6f 6e 6d 65 6e 74  20 73 74 72 69 6e 67 3a  |ironment string:|
00000350  20 27 22 2b 24 41 25 2b  22 27 22 0d 00 24 13 50  | '"+$A%+"'"..$.P|
00000360  25 3d a7 24 41 25 2c 22  20 22 2c 50 25 29 0d 00  |%=.$A%," ",P%)..|
00000370  25 26 e7 20 50 25 3d 30  20 85 20 31 2c 22 4e 6f  |%&. P%=0 . 1,"No|
00000380  20 70 61 72 61 6d 65 74  65 72 20 73 75 70 70 6c  | parameter suppl|
00000390  69 65 64 22 0d 00 26 0d  3d c1 24 41 25 2c 50 25  |ied"..&.=.$A%,P%|
000003a0  29 0d ff                                          |)..|
000003a3