Home » Archimedes archive » Acorn User » AU 1998-09.adf » Features » DesktopPD/ExtraBar/!ExtraBar/RMStore/Convertter

DesktopPD/ExtraBar/!ExtraBar/RMStore/Convertter

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 1998-09.adf » Features
Filename: DesktopPD/ExtraBar/!ExtraBar/RMStore/Convertter
Read OK:
File size: 0EC7 bytes
Load address: 0000
Exec address: 0000
File contents
    1ON ERROR REPORT:PRINT ERL:END
    2SYS "XOS_GetEnv" TO env$
    3FOR lp% = 0 TO 2:env$ = MID$(env$,INSTR(env$," ")+1):NEXT
    4
    5old_file$ = LEFT$(env$,INSTR(env$," ")-1)
    6new_file$ = MID$(env$,INSTR(env$," ")+1)
    7
    8DIM blk% 1024
    9
   10a% = OPENUP(old_file$)
   11b% = OPENOUT(new_file$+".Commands")
   12
   13ON ERROR REPORT:PRINT ERL:CLOSE#a%:CLOSE#b%:END
   14
   15SYS "XOS_GBPB",4,a%,blk%,12
   16SYS "XOS_GBPB",4,a%,blk%,(blk%!8 - 12)
   17buttons%   = blk%!12
   18seperator$ = $(blk%+20)
   19load_flags%= blk%!28
   20
   21PROCsetup_file_header_ex100(b%,blk%)
   22
   23IF (load_flags%AND1) THEN blk%!0 = 255:blk%!4 = 0:SYS "OS_GBPB",2,b%,blk%,8
   24
   25WHILE NOT EOF#a%
   26  SYS "XOS_GBPB",4,a%,blk%,8
   27  id% = blk%!0 : size% = blk%!4
   28  CASE id% OF
   29    WHEN 1
   30      SYS "XOS_GBPB",4,a%,blk%,size%
   31      text$     = $(blk%)
   32      button_f% = !(blk%+32)
   33      sprite$   = $(blk%+32+4)
   34      scommand$ = $(blk%+32+4+16)
   35      acommand$ = $(blk%+32+4+16+256)
   36      extra$    = $(blk%+32+4+16+256+256)
   37      dynamic%  = 0
   38      
   39      IF LEFT$(sprite$,1) = "#" THEN
   40        text$ = sprite$+" "+CHR$(34)+extra$+CHR$(34)
   41        sprite$ = "":dynamic% = -1
   42      ENDIF
   43      flags%    = FNconvert_old_flags_to_new(button_f%,dynamic%)
   44      
   45      start% = PTR#b%:SYS "OS_GBPB",2,b%,blk%,8
   46      BPUT#b%,"&"+STR$~(flags%)  : REM Load flags
   47      BPUT#b%,"0"                : REM Minium width
   48      BPUT#b%,text$              : REM Text
   49      BPUT#b%,sprite$            : REM Sprite
   50  
   51      WHILE INSTR(scommand$,seperator$)
   52        a$ = LEFT$(scommand$,INSTR(scommand$,seperator$)-1)
   53        b$ =  MID$(scommand$,INSTR(scommand$,seperator$)+LEN(seperator$))
   54        scommand$ = a$+"|m"+b$
   55      ENDWHILE
   56
   57      WHILE INSTR(acommand$,seperator$)
   58        a$ = LEFT$(acommand$,INSTR(acommand$,seperator$)-1)
   59        b$ =  MID$(acommand$,INSTR(acommand$,seperator$)+LEN(seperator$))
   60        acommand$ = a$+"|m"+b$
   61      ENDWHILE
   62  
   63      BPUT#b%,scommand$          : REM Select command
   64      BPUT#b%,acommand$          : REM Adjust command
   65      BPUT#b%,""                 : REM 
   66    
   67      blk%!0 = 11:blk%!4 = (PTR#b% - start%) - 8
   68      PTR#b% = start%:SYS "OS_GBPB",2,b%,blk%,8:PTR#b% = EXT#b%
   69    WHEN 2:
   70      spr_file$ = "Pipe:$.ExtraBar.Spr"+STR$(TIME) 
   71      read% = 0:sph% = OPENOUT(spr_file$)
   72      WHILE size% > 0
   73        IF size% > 1024 THEN
   74          SYS "XOS_GBPB",4,a%,blk%,1024
   75          SYS "XOS_GBPB",2,sph%,blk%,1024
   76          size%-= 1024
   77        ELSE
   78          SYS "XOS_GBPB",4,a%,blk%,size%
   79          SYS "XOS_GBPB",2,sph%,blk%,size%
   80          size% = 0
   81        ENDIF
   82      ENDWHILE
   83      CLOSE#sph%
   84      SYS"XOS_File",18,spr_file$,&FF9
   85  OTHERWISE
   86    PTR#a% = PTR#a% + size%
   87  ENDCASE
   88ENDWHILE
   89
   90ON ERROR REPORT:PRINT ERL:END
   91
   92CLOSE#a%
   93CLOSE#b%
   94
   95SYS "OS_File",18,new_file$+".Commands",&136
   96END
   97
   98DEF PROCsetup_file_header_ex100(a%,blk%)
   99FOR lp% = 0 TO 40:blk%?lp% = 0:NEXT
  100$(blk%) = "ExBr"
  101blk%!4  = 200
  102blk%!8  = 40
  103blk%!12 = 8
  104blk%!16 = 0
  105blk%!20 = 0
  106blk%!24 = buttons%
  107$(blk%+32) = "{com}"
  108blk%!28 = LEN($(blk%+32))
  109SYS "OS_GBPB",2,a%,blk%,40
  110ENDPROC
  111
  112
  113DEF FNconvert_old_flags_to_new(old_flags%,dynamic%)
  114LOCAL new_flags%
  115new_button_gap_before%   = 0
  116new_button_gap_after%    = 1
  117new_button_break_before% = 2
  118new_button_break_after%  = 3
  119new_button_raised_border%= 4
  120new_button_indent_border%= 5
  121new_button_right_align%  = 6
  122new_button_half_sprite%  = 7
  123
  124new_button_gap_width%    = 20
  125IF dynamic% THEN
  126  new_flags% = (1<<new_button_indent_border%)
  127ELSE
  128  new_flags% = (1<<new_button_raised_border%)
  129ENDIF
  130
  131IF (old_flags%AND(1<<0)) THEN new_flags% = (new_flags% OR (1<<new_button_break_after%))
  132IF (old_flags%AND(1<<1)) THEN new_flags% = (new_flags% OR (1<<new_button_gap_after%))
  133IF (old_flags%AND(1<<3)) THEN new_flags% = (new_flags% OR (1<<new_button_break_before%))
  134IF (old_flags%AND(1<<6)) THEN new_flags% = (new_flags% OR (1<<new_button_right_align%))
  135
  136= new_flags%
� � �:� �:�
ș "XOS_GetEnv" � env$
.� lp% = 0 � 2:env$ = �env$,�env$," ")+1):�

#old_file$ = �env$,�env$," ")-1)
#new_file$ = �env$,�env$," ")+1)

� blk% 1024
	

a% = �(old_file$)
!b% = �(new_file$+".Commands")


� � �:� �:�#a%:�#b%:�

ș "XOS_GBPB",4,a%,blk%,12
)ș "XOS_GBPB",4,a%,blk%,(blk%!8 - 12)
buttons%   = blk%!12
seperator$ = $(blk%+20)
load_flags%= blk%!28

%�setup_file_header_ex100(b%,blk%)

H� (load_flags%�1) � blk%!0 = 255:blk%!4 = 0:ș "OS_GBPB",2,b%,blk%,8


ȕ � �#a%
  ș "XOS_GBPB",4,a%,blk%,8
#  id% = blk%!0 : size% = blk%!4
  Ȏ id% �
    � 1
'      ș "XOS_GBPB",4,a%,blk%,size%
      text$     = $(blk%)
        button_f% = !(blk%+32)
!"      sprite$   = $(blk%+32+4)
"%      scommand$ = $(blk%+32+4+16)
#)      acommand$ = $(blk%+32+4+16+256)
$-      extra$    = $(blk%+32+4+16+256+256)
%      dynamic%  = 0
&
      
'      � �sprite$,1) = "#" �
(2        text$ = sprite$+" "+�(34)+extra$+�(34)
)&        sprite$ = "":dynamic% = -1
*      �
+C      flags%    = �convert_old_flags_to_new(button_f%,dynamic%)
,
      
-0      start% = �#b%:ș "OS_GBPB",2,b%,blk%,8
.-      �#b%,"&"+�~(flags%)  : � Load flags
/2      �#b%,"0"                : � Minium width
0*      �#b%,text$              : � Text
1,      �#b%,sprite$            : � Sprite
2  
3#      ȕ �scommand$,seperator$)
45        a$ = �scommand$,�scommand$,seperator$)-1)
5B        b$ =  �scommand$,�scommand$,seperator$)+�(seperator$))
6"        scommand$ = a$+"|m"+b$
7      �
8
9#      ȕ �acommand$,seperator$)
:5        a$ = �acommand$,�acommand$,seperator$)-1)
;B        b$ =  �acommand$,�acommand$,seperator$)+�(seperator$))
<"        acommand$ = a$+"|m"+b$
=      �
>  
?4      �#b%,scommand$          : � Select command
@4      �#b%,acommand$          : � Adjust command
A&      �#b%,""                 : � 
B    
C2      blk%!0 = 11:blk%!4 = (�#b% - start%) - 8
D<      �#b% = start%:ș "OS_GBPB",2,b%,blk%,8:�#b% = �#b%
E    � 2:
F1      spr_file$ = "Pipe:$.ExtraBar.Spr"+�(�) 
G'      read% = 0:sph% = �(spr_file$)
H      ȕ size% > 0
I        � size% > 1024 �
J*          ș "XOS_GBPB",4,a%,blk%,1024
K,          ș "XOS_GBPB",2,sph%,blk%,1024
L          size%-= 1024
M
        �
N+          ș "XOS_GBPB",4,a%,blk%,size%
O-          ș "XOS_GBPB",2,sph%,blk%,size%
P          size% = 0
Q
        �
R      �
S      �#sph%
T(      ș"XOS_File",18,spr_file$,&FF9
U  
V    �#a% = �#a% + size%
W  �
X�
Y
Z� � �:� �:�
[
\�#a%
]�#b%
^
_.ș "OS_File",18,new_file$+".Commands",&136
`�
a
b'� �setup_file_header_ex100(a%,blk%)
c!� lp% = 0 � 40:blk%?lp% = 0:�
d$(blk%) = "ExBr"
eblk%!4  = 200
fblk%!8  = 40
gblk%!12 = 8
hblk%!16 = 0
iblk%!20 = 0
jblk%!24 = buttons%
k$(blk%+32) = "{com}"
lblk%!28 = �($(blk%+32))
mș "OS_GBPB",2,a%,blk%,40
n�
o
p
q4� �convert_old_flags_to_new(old_flags%,dynamic%)
r� new_flags%
s new_button_gap_before%   = 0
t new_button_gap_after%    = 1
u new_button_break_before% = 2
v new_button_break_after%  = 3
w new_button_raised_border%= 4
x new_button_indent_border%= 5
y new_button_right_align%  = 6
z new_button_half_sprite%  = 7
{
|!new_button_gap_width%    = 20
}� dynamic% �
~1  new_flags% = (1<<new_button_indent_border%)
�
�1  new_flags% = (1<<new_button_raised_border%)
��
�
�T� (old_flags%�(1<<0)) � new_flags% = (new_flags% � (1<<new_button_break_after%))
�R� (old_flags%�(1<<1)) � new_flags% = (new_flags% � (1<<new_button_gap_after%))
�U� (old_flags%�(1<<3)) � new_flags% = (new_flags% � (1<<new_button_break_before%))
�T� (old_flags%�(1<<6)) � new_flags% = (new_flags% � (1<<new_button_right_align%))
�
�= new_flags%
�
00000000  0d 00 01 0f ee 20 85 20  f6 3a f1 20 9e 3a e0 0d  |..... . .:. .:..|
00000010  00 02 1a c8 99 20 22 58  4f 53 5f 47 65 74 45 6e  |..... "XOS_GetEn|
00000020  76 22 20 b8 20 65 6e 76  24 0d 00 03 2e e3 20 6c  |v" . env$..... l|
00000030  70 25 20 3d 20 30 20 b8  20 32 3a 65 6e 76 24 20  |p% = 0 . 2:env$ |
00000040  3d 20 c1 65 6e 76 24 2c  a7 65 6e 76 24 2c 22 20  |= .env$,.env$," |
00000050  22 29 2b 31 29 3a ed 0d  00 04 04 0d 00 05 23 6f  |")+1):........#o|
00000060  6c 64 5f 66 69 6c 65 24  20 3d 20 c0 65 6e 76 24  |ld_file$ = .env$|
00000070  2c a7 65 6e 76 24 2c 22  20 22 29 2d 31 29 0d 00  |,.env$," ")-1)..|
00000080  06 23 6e 65 77 5f 66 69  6c 65 24 20 3d 20 c1 65  |.#new_file$ = .e|
00000090  6e 76 24 2c a7 65 6e 76  24 2c 22 20 22 29 2b 31  |nv$,.env$," ")+1|
000000a0  29 0d 00 07 04 0d 00 08  0f de 20 62 6c 6b 25 20  |)......... blk% |
000000b0  31 30 32 34 0d 00 09 04  0d 00 0a 15 61 25 20 3d  |1024........a% =|
000000c0  20 ad 28 6f 6c 64 5f 66  69 6c 65 24 29 0d 00 0b  | .(old_file$)...|
000000d0  21 62 25 20 3d 20 ae 28  6e 65 77 5f 66 69 6c 65  |!b% = .(new_file|
000000e0  24 2b 22 2e 43 6f 6d 6d  61 6e 64 73 22 29 0d 00  |$+".Commands")..|
000000f0  0c 04 0d 00 0d 19 ee 20  85 20 f6 3a f1 20 9e 3a  |....... . .:. .:|
00000100  d9 23 61 25 3a d9 23 62  25 3a e0 0d 00 0e 04 0d  |.#a%:.#b%:......|
00000110  00 0f 1e c8 99 20 22 58  4f 53 5f 47 42 50 42 22  |..... "XOS_GBPB"|
00000120  2c 34 2c 61 25 2c 62 6c  6b 25 2c 31 32 0d 00 10  |,4,a%,blk%,12...|
00000130  29 c8 99 20 22 58 4f 53  5f 47 42 50 42 22 2c 34  |).. "XOS_GBPB",4|
00000140  2c 61 25 2c 62 6c 6b 25  2c 28 62 6c 6b 25 21 38  |,a%,blk%,(blk%!8|
00000150  20 2d 20 31 32 29 0d 00  11 18 62 75 74 74 6f 6e  | - 12)....button|
00000160  73 25 20 20 20 3d 20 62  6c 6b 25 21 31 32 0d 00  |s%   = blk%!12..|
00000170  12 1b 73 65 70 65 72 61  74 6f 72 24 20 3d 20 24  |..seperator$ = $|
00000180  28 62 6c 6b 25 2b 32 30  29 0d 00 13 18 6c 6f 61  |(blk%+20)....loa|
00000190  64 5f 66 6c 61 67 73 25  3d 20 62 6c 6b 25 21 32  |d_flags%= blk%!2|
000001a0  38 0d 00 14 04 0d 00 15  25 f2 73 65 74 75 70 5f  |8.......%.setup_|
000001b0  66 69 6c 65 5f 68 65 61  64 65 72 5f 65 78 31 30  |file_header_ex10|
000001c0  30 28 62 25 2c 62 6c 6b  25 29 0d 00 16 04 0d 00  |0(b%,blk%)......|
000001d0  17 48 e7 20 28 6c 6f 61  64 5f 66 6c 61 67 73 25  |.H. (load_flags%|
000001e0  80 31 29 20 8c 20 62 6c  6b 25 21 30 20 3d 20 32  |.1) . blk%!0 = 2|
000001f0  35 35 3a 62 6c 6b 25 21  34 20 3d 20 30 3a c8 99  |55:blk%!4 = 0:..|
00000200  20 22 4f 53 5f 47 42 50  42 22 2c 32 2c 62 25 2c  | "OS_GBPB",2,b%,|
00000210  62 6c 6b 25 2c 38 0d 00  18 04 0d 00 19 0d c8 95  |blk%,8..........|
00000220  20 ac 20 c5 23 61 25 0d  00 1a 1f 20 20 c8 99 20  | . .#a%....  .. |
00000230  22 58 4f 53 5f 47 42 50  42 22 2c 34 2c 61 25 2c  |"XOS_GBPB",4,a%,|
00000240  62 6c 6b 25 2c 38 0d 00  1b 23 20 20 69 64 25 20  |blk%,8...#  id% |
00000250  3d 20 62 6c 6b 25 21 30  20 3a 20 73 69 7a 65 25  |= blk%!0 : size%|
00000260  20 3d 20 62 6c 6b 25 21  34 0d 00 1c 0e 20 20 c8  | = blk%!4....  .|
00000270  8e 20 69 64 25 20 ca 0d  00 1d 0b 20 20 20 20 c9  |. id% .....    .|
00000280  20 31 0d 00 1e 27 20 20  20 20 20 20 c8 99 20 22  | 1...'      .. "|
00000290  58 4f 53 5f 47 42 50 42  22 2c 34 2c 61 25 2c 62  |XOS_GBPB",4,a%,b|
000002a0  6c 6b 25 2c 73 69 7a 65  25 0d 00 1f 1d 20 20 20  |lk%,size%....   |
000002b0  20 20 20 74 65 78 74 24  20 20 20 20 20 3d 20 24  |   text$     = $|
000002c0  28 62 6c 6b 25 29 0d 00  20 20 20 20 20 20 20 20  |(blk%)..        |
000002d0  62 75 74 74 6f 6e 5f 66  25 20 3d 20 21 28 62 6c  |button_f% = !(bl|
000002e0  6b 25 2b 33 32 29 0d 00  21 22 20 20 20 20 20 20  |k%+32)..!"      |
000002f0  73 70 72 69 74 65 24 20  20 20 3d 20 24 28 62 6c  |sprite$   = $(bl|
00000300  6b 25 2b 33 32 2b 34 29  0d 00 22 25 20 20 20 20  |k%+32+4).."%    |
00000310  20 20 73 63 6f 6d 6d 61  6e 64 24 20 3d 20 24 28  |  scommand$ = $(|
00000320  62 6c 6b 25 2b 33 32 2b  34 2b 31 36 29 0d 00 23  |blk%+32+4+16)..#|
00000330  29 20 20 20 20 20 20 61  63 6f 6d 6d 61 6e 64 24  |)      acommand$|
00000340  20 3d 20 24 28 62 6c 6b  25 2b 33 32 2b 34 2b 31  | = $(blk%+32+4+1|
00000350  36 2b 32 35 36 29 0d 00  24 2d 20 20 20 20 20 20  |6+256)..$-      |
00000360  65 78 74 72 61 24 20 20  20 20 3d 20 24 28 62 6c  |extra$    = $(bl|
00000370  6b 25 2b 33 32 2b 34 2b  31 36 2b 32 35 36 2b 32  |k%+32+4+16+256+2|
00000380  35 36 29 0d 00 25 17 20  20 20 20 20 20 64 79 6e  |56)..%.      dyn|
00000390  61 6d 69 63 25 20 20 3d  20 30 0d 00 26 0a 20 20  |amic%  = 0..&.  |
000003a0  20 20 20 20 0d 00 27 1f  20 20 20 20 20 20 e7 20  |    ..'.      . |
000003b0  c0 73 70 72 69 74 65 24  2c 31 29 20 3d 20 22 23  |.sprite$,1) = "#|
000003c0  22 20 8c 0d 00 28 32 20  20 20 20 20 20 20 20 74  |" ...(2        t|
000003d0  65 78 74 24 20 3d 20 73  70 72 69 74 65 24 2b 22  |ext$ = sprite$+"|
000003e0  20 22 2b bd 28 33 34 29  2b 65 78 74 72 61 24 2b  | "+.(34)+extra$+|
000003f0  bd 28 33 34 29 0d 00 29  26 20 20 20 20 20 20 20  |.(34)..)&       |
00000400  20 73 70 72 69 74 65 24  20 3d 20 22 22 3a 64 79  | sprite$ = "":dy|
00000410  6e 61 6d 69 63 25 20 3d  20 2d 31 0d 00 2a 0b 20  |namic% = -1..*. |
00000420  20 20 20 20 20 cd 0d 00  2b 43 20 20 20 20 20 20  |     ...+C      |
00000430  66 6c 61 67 73 25 20 20  20 20 3d 20 a4 63 6f 6e  |flags%    = .con|
00000440  76 65 72 74 5f 6f 6c 64  5f 66 6c 61 67 73 5f 74  |vert_old_flags_t|
00000450  6f 5f 6e 65 77 28 62 75  74 74 6f 6e 5f 66 25 2c  |o_new(button_f%,|
00000460  64 79 6e 61 6d 69 63 25  29 0d 00 2c 0a 20 20 20  |dynamic%)..,.   |
00000470  20 20 20 0d 00 2d 30 20  20 20 20 20 20 73 74 61  |   ..-0      sta|
00000480  72 74 25 20 3d 20 8f 23  62 25 3a c8 99 20 22 4f  |rt% = .#b%:.. "O|
00000490  53 5f 47 42 50 42 22 2c  32 2c 62 25 2c 62 6c 6b  |S_GBPB",2,b%,blk|
000004a0  25 2c 38 0d 00 2e 2d 20  20 20 20 20 20 d5 23 62  |%,8...-      .#b|
000004b0  25 2c 22 26 22 2b c3 7e  28 66 6c 61 67 73 25 29  |%,"&"+.~(flags%)|
000004c0  20 20 3a 20 f4 20 4c 6f  61 64 20 66 6c 61 67 73  |  : . Load flags|
000004d0  0d 00 2f 32 20 20 20 20  20 20 d5 23 62 25 2c 22  |../2      .#b%,"|
000004e0  30 22 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0"              |
000004f0  20 20 3a 20 f4 20 4d 69  6e 69 75 6d 20 77 69 64  |  : . Minium wid|
00000500  74 68 0d 00 30 2a 20 20  20 20 20 20 d5 23 62 25  |th..0*      .#b%|
00000510  2c 74 65 78 74 24 20 20  20 20 20 20 20 20 20 20  |,text$          |
00000520  20 20 20 20 3a 20 f4 20  54 65 78 74 0d 00 31 2c  |    : . Text..1,|
00000530  20 20 20 20 20 20 d5 23  62 25 2c 73 70 72 69 74  |      .#b%,sprit|
00000540  65 24 20 20 20 20 20 20  20 20 20 20 20 20 3a 20  |e$            : |
00000550  f4 20 53 70 72 69 74 65  0d 00 32 06 20 20 0d 00  |. Sprite..2.  ..|
00000560  33 23 20 20 20 20 20 20  c8 95 20 a7 73 63 6f 6d  |3#      .. .scom|
00000570  6d 61 6e 64 24 2c 73 65  70 65 72 61 74 6f 72 24  |mand$,seperator$|
00000580  29 0d 00 34 35 20 20 20  20 20 20 20 20 61 24 20  |)..45        a$ |
00000590  3d 20 c0 73 63 6f 6d 6d  61 6e 64 24 2c a7 73 63  |= .scommand$,.sc|
000005a0  6f 6d 6d 61 6e 64 24 2c  73 65 70 65 72 61 74 6f  |ommand$,seperato|
000005b0  72 24 29 2d 31 29 0d 00  35 42 20 20 20 20 20 20  |r$)-1)..5B      |
000005c0  20 20 62 24 20 3d 20 20  c1 73 63 6f 6d 6d 61 6e  |  b$ =  .scomman|
000005d0  64 24 2c a7 73 63 6f 6d  6d 61 6e 64 24 2c 73 65  |d$,.scommand$,se|
000005e0  70 65 72 61 74 6f 72 24  29 2b a9 28 73 65 70 65  |perator$)+.(sepe|
000005f0  72 61 74 6f 72 24 29 29  0d 00 36 22 20 20 20 20  |rator$))..6"    |
00000600  20 20 20 20 73 63 6f 6d  6d 61 6e 64 24 20 3d 20  |    scommand$ = |
00000610  61 24 2b 22 7c 6d 22 2b  62 24 0d 00 37 0b 20 20  |a$+"|m"+b$..7.  |
00000620  20 20 20 20 ce 0d 00 38  04 0d 00 39 23 20 20 20  |    ...8...9#   |
00000630  20 20 20 c8 95 20 a7 61  63 6f 6d 6d 61 6e 64 24  |   .. .acommand$|
00000640  2c 73 65 70 65 72 61 74  6f 72 24 29 0d 00 3a 35  |,seperator$)..:5|
00000650  20 20 20 20 20 20 20 20  61 24 20 3d 20 c0 61 63  |        a$ = .ac|
00000660  6f 6d 6d 61 6e 64 24 2c  a7 61 63 6f 6d 6d 61 6e  |ommand$,.acomman|
00000670  64 24 2c 73 65 70 65 72  61 74 6f 72 24 29 2d 31  |d$,seperator$)-1|
00000680  29 0d 00 3b 42 20 20 20  20 20 20 20 20 62 24 20  |)..;B        b$ |
00000690  3d 20 20 c1 61 63 6f 6d  6d 61 6e 64 24 2c a7 61  |=  .acommand$,.a|
000006a0  63 6f 6d 6d 61 6e 64 24  2c 73 65 70 65 72 61 74  |command$,seperat|
000006b0  6f 72 24 29 2b a9 28 73  65 70 65 72 61 74 6f 72  |or$)+.(seperator|
000006c0  24 29 29 0d 00 3c 22 20  20 20 20 20 20 20 20 61  |$))..<"        a|
000006d0  63 6f 6d 6d 61 6e 64 24  20 3d 20 61 24 2b 22 7c  |command$ = a$+"||
000006e0  6d 22 2b 62 24 0d 00 3d  0b 20 20 20 20 20 20 ce  |m"+b$..=.      .|
000006f0  0d 00 3e 06 20 20 0d 00  3f 34 20 20 20 20 20 20  |..>.  ..?4      |
00000700  d5 23 62 25 2c 73 63 6f  6d 6d 61 6e 64 24 20 20  |.#b%,scommand$  |
00000710  20 20 20 20 20 20 20 20  3a 20 f4 20 53 65 6c 65  |        : . Sele|
00000720  63 74 20 63 6f 6d 6d 61  6e 64 0d 00 40 34 20 20  |ct command..@4  |
00000730  20 20 20 20 d5 23 62 25  2c 61 63 6f 6d 6d 61 6e  |    .#b%,acomman|
00000740  64 24 20 20 20 20 20 20  20 20 20 20 3a 20 f4 20  |d$          : . |
00000750  41 64 6a 75 73 74 20 63  6f 6d 6d 61 6e 64 0d 00  |Adjust command..|
00000760  41 26 20 20 20 20 20 20  d5 23 62 25 2c 22 22 20  |A&      .#b%,"" |
00000770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000780  3a 20 f4 20 0d 00 42 08  20 20 20 20 0d 00 43 32  |: . ..B.    ..C2|
00000790  20 20 20 20 20 20 62 6c  6b 25 21 30 20 3d 20 31  |      blk%!0 = 1|
000007a0  31 3a 62 6c 6b 25 21 34  20 3d 20 28 8f 23 62 25  |1:blk%!4 = (.#b%|
000007b0  20 2d 20 73 74 61 72 74  25 29 20 2d 20 38 0d 00  | - start%) - 8..|
000007c0  44 3c 20 20 20 20 20 20  cf 23 62 25 20 3d 20 73  |D<      .#b% = s|
000007d0  74 61 72 74 25 3a c8 99  20 22 4f 53 5f 47 42 50  |tart%:.. "OS_GBP|
000007e0  42 22 2c 32 2c 62 25 2c  62 6c 6b 25 2c 38 3a cf  |B",2,b%,blk%,8:.|
000007f0  23 62 25 20 3d 20 a2 23  62 25 0d 00 45 0c 20 20  |#b% = .#b%..E.  |
00000800  20 20 c9 20 32 3a 0d 00  46 31 20 20 20 20 20 20  |  . 2:..F1      |
00000810  73 70 72 5f 66 69 6c 65  24 20 3d 20 22 50 69 70  |spr_file$ = "Pip|
00000820  65 3a 24 2e 45 78 74 72  61 42 61 72 2e 53 70 72  |e:$.ExtraBar.Spr|
00000830  22 2b c3 28 91 29 20 0d  00 47 27 20 20 20 20 20  |"+.(.) ..G'     |
00000840  20 72 65 61 64 25 20 3d  20 30 3a 73 70 68 25 20  | read% = 0:sph% |
00000850  3d 20 ae 28 73 70 72 5f  66 69 6c 65 24 29 0d 00  |= .(spr_file$)..|
00000860  48 16 20 20 20 20 20 20  c8 95 20 73 69 7a 65 25  |H.      .. size%|
00000870  20 3e 20 30 0d 00 49 1c  20 20 20 20 20 20 20 20  | > 0..I.        |
00000880  e7 20 73 69 7a 65 25 20  3e 20 31 30 32 34 20 8c  |. size% > 1024 .|
00000890  0d 00 4a 2a 20 20 20 20  20 20 20 20 20 20 c8 99  |..J*          ..|
000008a0  20 22 58 4f 53 5f 47 42  50 42 22 2c 34 2c 61 25  | "XOS_GBPB",4,a%|
000008b0  2c 62 6c 6b 25 2c 31 30  32 34 0d 00 4b 2c 20 20  |,blk%,1024..K,  |
000008c0  20 20 20 20 20 20 20 20  c8 99 20 22 58 4f 53 5f  |        .. "XOS_|
000008d0  47 42 50 42 22 2c 32 2c  73 70 68 25 2c 62 6c 6b  |GBPB",2,sph%,blk|
000008e0  25 2c 31 30 32 34 0d 00  4c 1a 20 20 20 20 20 20  |%,1024..L.      |
000008f0  20 20 20 20 73 69 7a 65  25 2d 3d 20 31 30 32 34  |    size%-= 1024|
00000900  0d 00 4d 0d 20 20 20 20  20 20 20 20 cc 0d 00 4e  |..M.        ...N|
00000910  2b 20 20 20 20 20 20 20  20 20 20 c8 99 20 22 58  |+          .. "X|
00000920  4f 53 5f 47 42 50 42 22  2c 34 2c 61 25 2c 62 6c  |OS_GBPB",4,a%,bl|
00000930  6b 25 2c 73 69 7a 65 25  0d 00 4f 2d 20 20 20 20  |k%,size%..O-    |
00000940  20 20 20 20 20 20 c8 99  20 22 58 4f 53 5f 47 42  |      .. "XOS_GB|
00000950  50 42 22 2c 32 2c 73 70  68 25 2c 62 6c 6b 25 2c  |PB",2,sph%,blk%,|
00000960  73 69 7a 65 25 0d 00 50  17 20 20 20 20 20 20 20  |size%..P.       |
00000970  20 20 20 73 69 7a 65 25  20 3d 20 30 0d 00 51 0d  |   size% = 0..Q.|
00000980  20 20 20 20 20 20 20 20  cd 0d 00 52 0b 20 20 20  |        ...R.   |
00000990  20 20 20 ce 0d 00 53 10  20 20 20 20 20 20 d9 23  |   ...S.      .#|
000009a0  73 70 68 25 0d 00 54 28  20 20 20 20 20 20 c8 99  |sph%..T(      ..|
000009b0  22 58 4f 53 5f 46 69 6c  65 22 2c 31 38 2c 73 70  |"XOS_File",18,sp|
000009c0  72 5f 66 69 6c 65 24 2c  26 46 46 39 0d 00 55 07  |r_file$,&FF9..U.|
000009d0  20 20 7f 0d 00 56 1b 20  20 20 20 cf 23 61 25 20  |  ...V.    .#a% |
000009e0  3d 20 8f 23 61 25 20 2b  20 73 69 7a 65 25 0d 00  |= .#a% + size%..|
000009f0  57 07 20 20 cb 0d 00 58  05 ce 0d 00 59 04 0d 00  |W.  ...X....Y...|
00000a00  5a 0f ee 20 85 20 f6 3a  f1 20 9e 3a e0 0d 00 5b  |Z.. . .:. .:...[|
00000a10  04 0d 00 5c 08 d9 23 61  25 0d 00 5d 08 d9 23 62  |...\..#a%..]..#b|
00000a20  25 0d 00 5e 04 0d 00 5f  2e c8 99 20 22 4f 53 5f  |%..^..._... "OS_|
00000a30  46 69 6c 65 22 2c 31 38  2c 6e 65 77 5f 66 69 6c  |File",18,new_fil|
00000a40  65 24 2b 22 2e 43 6f 6d  6d 61 6e 64 73 22 2c 26  |e$+".Commands",&|
00000a50  31 33 36 0d 00 60 05 e0  0d 00 61 04 0d 00 62 27  |136..`....a...b'|
00000a60  dd 20 f2 73 65 74 75 70  5f 66 69 6c 65 5f 68 65  |. .setup_file_he|
00000a70  61 64 65 72 5f 65 78 31  30 30 28 61 25 2c 62 6c  |ader_ex100(a%,bl|
00000a80  6b 25 29 0d 00 63 21 e3  20 6c 70 25 20 3d 20 30  |k%)..c!. lp% = 0|
00000a90  20 b8 20 34 30 3a 62 6c  6b 25 3f 6c 70 25 20 3d  | . 40:blk%?lp% =|
00000aa0  20 30 3a ed 0d 00 64 14  24 28 62 6c 6b 25 29 20  | 0:...d.$(blk%) |
00000ab0  3d 20 22 45 78 42 72 22  0d 00 65 11 62 6c 6b 25  |= "ExBr"..e.blk%|
00000ac0  21 34 20 20 3d 20 32 30  30 0d 00 66 10 62 6c 6b  |!4  = 200..f.blk|
00000ad0  25 21 38 20 20 3d 20 34  30 0d 00 67 0f 62 6c 6b  |%!8  = 40..g.blk|
00000ae0  25 21 31 32 20 3d 20 38  0d 00 68 0f 62 6c 6b 25  |%!12 = 8..h.blk%|
00000af0  21 31 36 20 3d 20 30 0d  00 69 0f 62 6c 6b 25 21  |!16 = 0..i.blk%!|
00000b00  32 30 20 3d 20 30 0d 00  6a 16 62 6c 6b 25 21 32  |20 = 0..j.blk%!2|
00000b10  34 20 3d 20 62 75 74 74  6f 6e 73 25 0d 00 6b 18  |4 = buttons%..k.|
00000b20  24 28 62 6c 6b 25 2b 33  32 29 20 3d 20 22 7b 63  |$(blk%+32) = "{c|
00000b30  6f 6d 7d 22 0d 00 6c 1b  62 6c 6b 25 21 32 38 20  |om}"..l.blk%!28 |
00000b40  3d 20 a9 28 24 28 62 6c  6b 25 2b 33 32 29 29 0d  |= .($(blk%+32)).|
00000b50  00 6d 1d c8 99 20 22 4f  53 5f 47 42 50 42 22 2c  |.m... "OS_GBPB",|
00000b60  32 2c 61 25 2c 62 6c 6b  25 2c 34 30 0d 00 6e 05  |2,a%,blk%,40..n.|
00000b70  e1 0d 00 6f 04 0d 00 70  04 0d 00 71 34 dd 20 a4  |...o...p...q4. .|
00000b80  63 6f 6e 76 65 72 74 5f  6f 6c 64 5f 66 6c 61 67  |convert_old_flag|
00000b90  73 5f 74 6f 5f 6e 65 77  28 6f 6c 64 5f 66 6c 61  |s_to_new(old_fla|
00000ba0  67 73 25 2c 64 79 6e 61  6d 69 63 25 29 0d 00 72  |gs%,dynamic%)..r|
00000bb0  10 ea 20 6e 65 77 5f 66  6c 61 67 73 25 0d 00 73  |.. new_flags%..s|
00000bc0  20 6e 65 77 5f 62 75 74  74 6f 6e 5f 67 61 70 5f  | new_button_gap_|
00000bd0  62 65 66 6f 72 65 25 20  20 20 3d 20 30 0d 00 74  |before%   = 0..t|
00000be0  20 6e 65 77 5f 62 75 74  74 6f 6e 5f 67 61 70 5f  | new_button_gap_|
00000bf0  61 66 74 65 72 25 20 20  20 20 3d 20 31 0d 00 75  |after%    = 1..u|
00000c00  20 6e 65 77 5f 62 75 74  74 6f 6e 5f 62 72 65 61  | new_button_brea|
00000c10  6b 5f 62 65 66 6f 72 65  25 20 3d 20 32 0d 00 76  |k_before% = 2..v|
00000c20  20 6e 65 77 5f 62 75 74  74 6f 6e 5f 62 72 65 61  | new_button_brea|
00000c30  6b 5f 61 66 74 65 72 25  20 20 3d 20 33 0d 00 77  |k_after%  = 3..w|
00000c40  20 6e 65 77 5f 62 75 74  74 6f 6e 5f 72 61 69 73  | new_button_rais|
00000c50  65 64 5f 62 6f 72 64 65  72 25 3d 20 34 0d 00 78  |ed_border%= 4..x|
00000c60  20 6e 65 77 5f 62 75 74  74 6f 6e 5f 69 6e 64 65  | new_button_inde|
00000c70  6e 74 5f 62 6f 72 64 65  72 25 3d 20 35 0d 00 79  |nt_border%= 5..y|
00000c80  20 6e 65 77 5f 62 75 74  74 6f 6e 5f 72 69 67 68  | new_button_righ|
00000c90  74 5f 61 6c 69 67 6e 25  20 20 3d 20 36 0d 00 7a  |t_align%  = 6..z|
00000ca0  20 6e 65 77 5f 62 75 74  74 6f 6e 5f 68 61 6c 66  | new_button_half|
00000cb0  5f 73 70 72 69 74 65 25  20 20 3d 20 37 0d 00 7b  |_sprite%  = 7..{|
00000cc0  04 0d 00 7c 21 6e 65 77  5f 62 75 74 74 6f 6e 5f  |...|!new_button_|
00000cd0  67 61 70 5f 77 69 64 74  68 25 20 20 20 20 3d 20  |gap_width%    = |
00000ce0  32 30 0d 00 7d 10 e7 20  64 79 6e 61 6d 69 63 25  |20..}.. dynamic%|
00000cf0  20 8c 0d 00 7e 31 20 20  6e 65 77 5f 66 6c 61 67  | ...~1  new_flag|
00000d00  73 25 20 3d 20 28 31 3c  3c 6e 65 77 5f 62 75 74  |s% = (1<<new_but|
00000d10  74 6f 6e 5f 69 6e 64 65  6e 74 5f 62 6f 72 64 65  |ton_indent_borde|
00000d20  72 25 29 0d 00 7f 05 cc  0d 00 80 31 20 20 6e 65  |r%)........1  ne|
00000d30  77 5f 66 6c 61 67 73 25  20 3d 20 28 31 3c 3c 6e  |w_flags% = (1<<n|
00000d40  65 77 5f 62 75 74 74 6f  6e 5f 72 61 69 73 65 64  |ew_button_raised|
00000d50  5f 62 6f 72 64 65 72 25  29 0d 00 81 05 cd 0d 00  |_border%).......|
00000d60  82 04 0d 00 83 54 e7 20  28 6f 6c 64 5f 66 6c 61  |.....T. (old_fla|
00000d70  67 73 25 80 28 31 3c 3c  30 29 29 20 8c 20 6e 65  |gs%.(1<<0)) . ne|
00000d80  77 5f 66 6c 61 67 73 25  20 3d 20 28 6e 65 77 5f  |w_flags% = (new_|
00000d90  66 6c 61 67 73 25 20 84  20 28 31 3c 3c 6e 65 77  |flags% . (1<<new|
00000da0  5f 62 75 74 74 6f 6e 5f  62 72 65 61 6b 5f 61 66  |_button_break_af|
00000db0  74 65 72 25 29 29 0d 00  84 52 e7 20 28 6f 6c 64  |ter%))...R. (old|
00000dc0  5f 66 6c 61 67 73 25 80  28 31 3c 3c 31 29 29 20  |_flags%.(1<<1)) |
00000dd0  8c 20 6e 65 77 5f 66 6c  61 67 73 25 20 3d 20 28  |. new_flags% = (|
00000de0  6e 65 77 5f 66 6c 61 67  73 25 20 84 20 28 31 3c  |new_flags% . (1<|
00000df0  3c 6e 65 77 5f 62 75 74  74 6f 6e 5f 67 61 70 5f  |<new_button_gap_|
00000e00  61 66 74 65 72 25 29 29  0d 00 85 55 e7 20 28 6f  |after%))...U. (o|
00000e10  6c 64 5f 66 6c 61 67 73  25 80 28 31 3c 3c 33 29  |ld_flags%.(1<<3)|
00000e20  29 20 8c 20 6e 65 77 5f  66 6c 61 67 73 25 20 3d  |) . new_flags% =|
00000e30  20 28 6e 65 77 5f 66 6c  61 67 73 25 20 84 20 28  | (new_flags% . (|
00000e40  31 3c 3c 6e 65 77 5f 62  75 74 74 6f 6e 5f 62 72  |1<<new_button_br|
00000e50  65 61 6b 5f 62 65 66 6f  72 65 25 29 29 0d 00 86  |eak_before%))...|
00000e60  54 e7 20 28 6f 6c 64 5f  66 6c 61 67 73 25 80 28  |T. (old_flags%.(|
00000e70  31 3c 3c 36 29 29 20 8c  20 6e 65 77 5f 66 6c 61  |1<<6)) . new_fla|
00000e80  67 73 25 20 3d 20 28 6e  65 77 5f 66 6c 61 67 73  |gs% = (new_flags|
00000e90  25 20 84 20 28 31 3c 3c  6e 65 77 5f 62 75 74 74  |% . (1<<new_butt|
00000ea0  6f 6e 5f 72 69 67 68 74  5f 61 6c 69 67 6e 25 29  |on_right_align%)|
00000eb0  29 0d 00 87 04 0d 00 88  10 3d 20 6e 65 77 5f 66  |)........= new_f|
00000ec0  6c 61 67 73 25 0d ff                              |lags%..|
00000ec7