Home » Archimedes archive » Acorn User » AU 1993-04.adf » !StarInfo/Files/RMSave/PatchPin

!StarInfo/Files/RMSave/PatchPin

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 1993-04.adf
Filename: !StarInfo/Files/RMSave/PatchPin
Read OK:
File size: 072D bytes
Load address: FFFFFB44
Exec address: 696E751D
File contents
   10REM     >PatchPin (Info4)
   20REM By  DL & DA
   30REM For 32-bit machines
   40REM (c) BAU April 1993
   50:
   60DIM block 20000
   70SYS "OS_File",&FF,"Pinboard",block TO ,,,,len
   80:
   90valid$=FNzero(block+&9D4)
  100help$=$(block+block!&2AC)
  110syntax$=FNzero(block+block!&2A8)
  120synend$=""
  130WHILE RIGHT$(syntax$,1)<>" "
  140 synend$=RIGHT$(syntax$,1)+synend$
  150 syntax$=LEFT$(syntax$)
  160ENDWHILE
  170:
  180FOR pass=0 TO 2 STEP 2
  190P%=block+len
  200[OPT pass
  210.newbackdrop
  220STMFD   R13!,{R14}
  230MOV     R1,R0
  240ADR     R0,valid
  250ADD     R2,R12,#&450
  260MOV     R3,#&100
  270SWI     "XOS_ReadArgs"
  280LDMVSFD R13!,{PC}
  290LDR     R0,[R2,#20]
  300CMP     R0,#0
  310LDRNEB  R0,[R0,#1]
  320ANDNE   R0,R0,#15
  330ORRNE   R0,R0,#&80
  340STRNEB  R0,bcol
  350LDMFD   R13!,{PC}
  360
  370.bcol
  380EQUD    &84
  390
  400.getcolour
  410LDRB    R0,bcol
  420MOV     PC,R14
  430
  440.valid
  450EQUS    valid$+",B=Background/e"
  460EQUB    0
  470ALIGN
  480
  490.newhelp
  500EQUS    LEFT$(help$)
  510EQUS    " and allows the desktop colour to be changed."
  520EQUB    13
  530.newsyntax
  540EQUS    syntax$+"[-Background <colour>] "
  550EQUS    synend$
  560EQUB    0
  570ALIGN
  580
  590]NEXT
  600end=P%
  610:
  620REM Patch original *Backdrop command
  630REM to point to new decode routine
  640REM that deals with -Background
  650REM
  660P%=block+&8A0
  670[OPT 2
  680 MOV R0,R0
  690 MOV R0,R0
  700 MOV R0,R0
  710 MOV R0,R0
  720 BL  newbackdrop
  730]
  740:
  750REM Patch the two Wimp_SetColour calls
  760REM to use the colour given
  770REM
  780P%=block+&E10
  790[OPT 2
  800 BLNE getcolour
  810]
  820P%=block+&24E8
  830[OPT 2
  840 BL getcolour
  850]
  860:
  870REM Patch *command table to allow up
  880REM to four parameters to *Backdrop
  890REM and point to new help and syntax
  900REM
  910block!&2A4=&040100
  920block!&2A8=newsyntax-block
  930block!&2AC=newhelp-block
  940:
  950SYS "OS_File",10,"NewPin",&FFA,,block,end
  960END
  970:
  980DEF FNzero(z)
  990z$=""
 1000WHILE ?z<>0
 1010 z$+=CHR$?z
 1020 z+=1
 1030ENDWHILE
 1040=z$

�     >PatchPin (Info4)
� By  DL & DA
� For 32-bit machines
(� (c) BAU April 1993
2:
<� block 20000
F/ș "OS_File",&FF,"Pinboard",block � ,,,,len
P:
Zvalid$=�zero(block+&9D4)
dhelp$=$(block+block!&2AC)
n#syntax$=�zero(block+block!&2A8)
xsynend$=""
�ȕ �syntax$,1)<>" "
�  synend$=�syntax$,1)+synend$
� syntax$=�syntax$)
��
�:
�� pass=0 � 2 � 2
�P%=block+len
�
[OPT pass
�.newbackdrop
�STMFD   R13!,{R14}
�MOV     R1,R0
�ADR     R0,valid
�ADD     R2,R12,#&450
MOV     R3,#&100
SWI     "XOS_ReadArgs"
LDMVSFD R13!,{PC}
"LDR     R0,[R2,#20]
,CMP     R0,#0
6LDRNEB  R0,[R0,#1]
@�NE   R0,R0,#15
J�RNE   R0,R0,#&80
TSTRNEB  R0,bcol
^LDMFD   R13!,{PC}
h
r	.bcol
|EQUD    &84
�
�.getcolour
�LDRB    R0,bcol
�MOV     PC,R14
�
�
.valid
�$EQUS    valid$+",B=Background/e"
�
EQUB    0
�	ALIGN
�
�.newhelp
�EQUS    �help$)
�;EQUS    " and allows the desktop colour to be changed."
EQUB    13
.newsyntax
-EQUS    syntax$+"[-Background <colour>] "
&EQUS    synend$
0
EQUB    0
:	ALIGN
D
N]�
X
end=P%
b:
l&� Patch original *Backdrop command
v$� to point to new decode routine
�!� that deals with -Background
��
�P%=block+&8A0
�
[OPT 2
� MOV R0,R0
� MOV R0,R0
� MOV R0,R0
� MOV R0,R0
� BL  newbackdrop
�]
�:
�(� Patch the two Wimp_SetColour calls
�� to use the colour given
�
P%=block+&E10

[OPT 2
  BLNE getcolour
*]
4P%=block+&24E8
>
[OPT 2
H BL getcolour
R]
\:
f&� Patch *command table to allow up
p%� to four parameters to *Backdrop
z&� and point to new help and syntax
��
�block!&2A4=&040100
�block!&2A8=newsyntax-block
�block!&2AC=newhelp-block
�:
�,ș "OS_File",10,"NewPin",&FFA,,block,end
��
�:
�� �zero(z)
�	z$=""
�ȕ ?z<>0
� z$+=�?z
�	 z+=1
�
=z$
�
00000000  0d 00 0a 1b f4 20 20 20  20 20 3e 50 61 74 63 68  |.....     >Patch|
00000010  50 69 6e 20 28 49 6e 66  6f 34 29 0d 00 14 11 f4  |Pin (Info4).....|
00000020  20 42 79 20 20 44 4c 20  26 20 44 41 0d 00 1e 19  | By  DL & DA....|
00000030  f4 20 46 6f 72 20 33 32  2d 62 69 74 20 6d 61 63  |. For 32-bit mac|
00000040  68 69 6e 65 73 0d 00 28  18 f4 20 28 63 29 20 42  |hines..(.. (c) B|
00000050  41 55 20 41 70 72 69 6c  20 31 39 39 33 0d 00 32  |AU April 1993..2|
00000060  05 3a 0d 00 3c 11 de 20  62 6c 6f 63 6b 20 32 30  |.:..<.. block 20|
00000070  30 30 30 0d 00 46 2f c8  99 20 22 4f 53 5f 46 69  |000..F/.. "OS_Fi|
00000080  6c 65 22 2c 26 46 46 2c  22 50 69 6e 62 6f 61 72  |le",&FF,"Pinboar|
00000090  64 22 2c 62 6c 6f 63 6b  20 b8 20 2c 2c 2c 2c 6c  |d",block . ,,,,l|
000000a0  65 6e 0d 00 50 05 3a 0d  00 5a 1c 76 61 6c 69 64  |en..P.:..Z.valid|
000000b0  24 3d a4 7a 65 72 6f 28  62 6c 6f 63 6b 2b 26 39  |$=.zero(block+&9|
000000c0  44 34 29 0d 00 64 1d 68  65 6c 70 24 3d 24 28 62  |D4)..d.help$=$(b|
000000d0  6c 6f 63 6b 2b 62 6c 6f  63 6b 21 26 32 41 43 29  |lock+block!&2AC)|
000000e0  0d 00 6e 23 73 79 6e 74  61 78 24 3d a4 7a 65 72  |..n#syntax$=.zer|
000000f0  6f 28 62 6c 6f 63 6b 2b  62 6c 6f 63 6b 21 26 32  |o(block+block!&2|
00000100  41 38 29 0d 00 78 0e 73  79 6e 65 6e 64 24 3d 22  |A8)..x.synend$="|
00000110  22 0d 00 82 17 c8 95 20  c2 73 79 6e 74 61 78 24  |"...... .syntax$|
00000120  2c 31 29 3c 3e 22 20 22  0d 00 8c 20 20 73 79 6e  |,1)<>" "...  syn|
00000130  65 6e 64 24 3d c2 73 79  6e 74 61 78 24 2c 31 29  |end$=.syntax$,1)|
00000140  2b 73 79 6e 65 6e 64 24  0d 00 96 16 20 73 79 6e  |+synend$.... syn|
00000150  74 61 78 24 3d c0 73 79  6e 74 61 78 24 29 0d 00  |tax$=.syntax$)..|
00000160  a0 05 ce 0d 00 aa 05 3a  0d 00 b4 14 e3 20 70 61  |.......:..... pa|
00000170  73 73 3d 30 20 b8 20 32  20 88 20 32 0d 00 be 10  |ss=0 . 2 . 2....|
00000180  50 25 3d 62 6c 6f 63 6b  2b 6c 65 6e 0d 00 c8 0d  |P%=block+len....|
00000190  5b 4f 50 54 20 70 61 73  73 0d 00 d2 10 2e 6e 65  |[OPT pass.....ne|
000001a0  77 62 61 63 6b 64 72 6f  70 0d 00 dc 16 53 54 4d  |wbackdrop....STM|
000001b0  46 44 20 20 20 52 31 33  21 2c 7b 52 31 34 7d 0d  |FD   R13!,{R14}.|
000001c0  00 e6 11 4d 4f 56 20 20  20 20 20 52 31 2c 52 30  |...MOV     R1,R0|
000001d0  0d 00 f0 14 41 44 52 20  20 20 20 20 52 30 2c 76  |....ADR     R0,v|
000001e0  61 6c 69 64 0d 00 fa 18  41 44 44 20 20 20 20 20  |alid....ADD     |
000001f0  52 32 2c 52 31 32 2c 23  26 34 35 30 0d 01 04 14  |R2,R12,#&450....|
00000200  4d 4f 56 20 20 20 20 20  52 33 2c 23 26 31 30 30  |MOV     R3,#&100|
00000210  0d 01 0e 1a 53 57 49 20  20 20 20 20 22 58 4f 53  |....SWI     "XOS|
00000220  5f 52 65 61 64 41 72 67  73 22 0d 01 18 15 4c 44  |_ReadArgs"....LD|
00000230  4d 56 53 46 44 20 52 31  33 21 2c 7b 50 43 7d 0d  |MVSFD R13!,{PC}.|
00000240  01 22 17 4c 44 52 20 20  20 20 20 52 30 2c 5b 52  |.".LDR     R0,[R|
00000250  32 2c 23 32 30 5d 0d 01  2c 11 43 4d 50 20 20 20  |2,#20]..,.CMP   |
00000260  20 20 52 30 2c 23 30 0d  01 36 16 4c 44 52 4e 45  |  R0,#0..6.LDRNE|
00000270  42 20 20 52 30 2c 5b 52  30 2c 23 31 5d 0d 01 40  |B  R0,[R0,#1]..@|
00000280  13 80 4e 45 20 20 20 52  30 2c 52 30 2c 23 31 35  |..NE   R0,R0,#15|
00000290  0d 01 4a 15 84 52 4e 45  20 20 20 52 30 2c 52 30  |..J..RNE   R0,R0|
000002a0  2c 23 26 38 30 0d 01 54  13 53 54 52 4e 45 42 20  |,#&80..T.STRNEB |
000002b0  20 52 30 2c 62 63 6f 6c  0d 01 5e 15 4c 44 4d 46  | R0,bcol..^.LDMF|
000002c0  44 20 20 20 52 31 33 21  2c 7b 50 43 7d 0d 01 68  |D   R13!,{PC}..h|
000002d0  04 0d 01 72 09 2e 62 63  6f 6c 0d 01 7c 0f 45 51  |...r..bcol..|.EQ|
000002e0  55 44 20 20 20 20 26 38  34 0d 01 86 04 0d 01 90  |UD    &84.......|
000002f0  0e 2e 67 65 74 63 6f 6c  6f 75 72 0d 01 9a 13 4c  |..getcolour....L|
00000300  44 52 42 20 20 20 20 52  30 2c 62 63 6f 6c 0d 01  |DRB    R0,bcol..|
00000310  a4 12 4d 4f 56 20 20 20  20 20 50 43 2c 52 31 34  |..MOV     PC,R14|
00000320  0d 01 ae 04 0d 01 b8 0a  2e 76 61 6c 69 64 0d 01  |.........valid..|
00000330  c2 24 45 51 55 53 20 20  20 20 76 61 6c 69 64 24  |.$EQUS    valid$|
00000340  2b 22 2c 42 3d 42 61 63  6b 67 72 6f 75 6e 64 2f  |+",B=Background/|
00000350  65 22 0d 01 cc 0d 45 51  55 42 20 20 20 20 30 0d  |e"....EQUB    0.|
00000360  01 d6 09 41 4c 49 47 4e  0d 01 e0 04 0d 01 ea 0c  |...ALIGN........|
00000370  2e 6e 65 77 68 65 6c 70  0d 01 f4 13 45 51 55 53  |.newhelp....EQUS|
00000380  20 20 20 20 c0 68 65 6c  70 24 29 0d 01 fe 3b 45  |    .help$)...;E|
00000390  51 55 53 20 20 20 20 22  20 61 6e 64 20 61 6c 6c  |QUS    " and all|
000003a0  6f 77 73 20 74 68 65 20  64 65 73 6b 74 6f 70 20  |ows the desktop |
000003b0  63 6f 6c 6f 75 72 20 74  6f 20 62 65 20 63 68 61  |colour to be cha|
000003c0  6e 67 65 64 2e 22 0d 02  08 0e 45 51 55 42 20 20  |nged."....EQUB  |
000003d0  20 20 31 33 0d 02 12 0e  2e 6e 65 77 73 79 6e 74  |  13.....newsynt|
000003e0  61 78 0d 02 1c 2d 45 51  55 53 20 20 20 20 73 79  |ax...-EQUS    sy|
000003f0  6e 74 61 78 24 2b 22 5b  2d 42 61 63 6b 67 72 6f  |ntax$+"[-Backgro|
00000400  75 6e 64 20 3c 63 6f 6c  6f 75 72 3e 5d 20 22 0d  |und <colour>] ".|
00000410  02 26 13 45 51 55 53 20  20 20 20 73 79 6e 65 6e  |.&.EQUS    synen|
00000420  64 24 0d 02 30 0d 45 51  55 42 20 20 20 20 30 0d  |d$..0.EQUB    0.|
00000430  02 3a 09 41 4c 49 47 4e  0d 02 44 04 0d 02 4e 06  |.:.ALIGN..D...N.|
00000440  5d ed 0d 02 58 0a 65 6e  64 3d 50 25 0d 02 62 05  |]...X.end=P%..b.|
00000450  3a 0d 02 6c 26 f4 20 50  61 74 63 68 20 6f 72 69  |:..l&. Patch ori|
00000460  67 69 6e 61 6c 20 2a 42  61 63 6b 64 72 6f 70 20  |ginal *Backdrop |
00000470  63 6f 6d 6d 61 6e 64 0d  02 76 24 f4 20 74 6f 20  |command..v$. to |
00000480  70 6f 69 6e 74 20 74 6f  20 6e 65 77 20 64 65 63  |point to new dec|
00000490  6f 64 65 20 72 6f 75 74  69 6e 65 0d 02 80 21 f4  |ode routine...!.|
000004a0  20 74 68 61 74 20 64 65  61 6c 73 20 77 69 74 68  | that deals with|
000004b0  20 2d 42 61 63 6b 67 72  6f 75 6e 64 0d 02 8a 05  | -Background....|
000004c0  f4 0d 02 94 11 50 25 3d  62 6c 6f 63 6b 2b 26 38  |.....P%=block+&8|
000004d0  41 30 0d 02 9e 0a 5b 4f  50 54 20 32 0d 02 a8 0e  |A0....[OPT 2....|
000004e0  20 4d 4f 56 20 52 30 2c  52 30 0d 02 b2 0e 20 4d  | MOV R0,R0.... M|
000004f0  4f 56 20 52 30 2c 52 30  0d 02 bc 0e 20 4d 4f 56  |OV R0,R0.... MOV|
00000500  20 52 30 2c 52 30 0d 02  c6 0e 20 4d 4f 56 20 52  | R0,R0.... MOV R|
00000510  30 2c 52 30 0d 02 d0 14  20 42 4c 20 20 6e 65 77  |0,R0.... BL  new|
00000520  62 61 63 6b 64 72 6f 70  0d 02 da 05 5d 0d 02 e4  |backdrop....]...|
00000530  05 3a 0d 02 ee 28 f4 20  50 61 74 63 68 20 74 68  |.:...(. Patch th|
00000540  65 20 74 77 6f 20 57 69  6d 70 5f 53 65 74 43 6f  |e two Wimp_SetCo|
00000550  6c 6f 75 72 20 63 61 6c  6c 73 0d 02 f8 1d f4 20  |lour calls..... |
00000560  74 6f 20 75 73 65 20 74  68 65 20 63 6f 6c 6f 75  |to use the colou|
00000570  72 20 67 69 76 65 6e 0d  03 02 05 f4 0d 03 0c 11  |r given.........|
00000580  50 25 3d 62 6c 6f 63 6b  2b 26 45 31 30 0d 03 16  |P%=block+&E10...|
00000590  0a 5b 4f 50 54 20 32 0d  03 20 13 20 42 4c 4e 45  |.[OPT 2.. . BLNE|
000005a0  20 67 65 74 63 6f 6c 6f  75 72 0d 03 2a 05 5d 0d  | getcolour..*.].|
000005b0  03 34 12 50 25 3d 62 6c  6f 63 6b 2b 26 32 34 45  |.4.P%=block+&24E|
000005c0  38 0d 03 3e 0a 5b 4f 50  54 20 32 0d 03 48 11 20  |8..>.[OPT 2..H. |
000005d0  42 4c 20 67 65 74 63 6f  6c 6f 75 72 0d 03 52 05  |BL getcolour..R.|
000005e0  5d 0d 03 5c 05 3a 0d 03  66 26 f4 20 50 61 74 63  |]..\.:..f&. Patc|
000005f0  68 20 2a 63 6f 6d 6d 61  6e 64 20 74 61 62 6c 65  |h *command table|
00000600  20 74 6f 20 61 6c 6c 6f  77 20 75 70 0d 03 70 25  | to allow up..p%|
00000610  f4 20 74 6f 20 66 6f 75  72 20 70 61 72 61 6d 65  |. to four parame|
00000620  74 65 72 73 20 74 6f 20  2a 42 61 63 6b 64 72 6f  |ters to *Backdro|
00000630  70 0d 03 7a 26 f4 20 61  6e 64 20 70 6f 69 6e 74  |p..z&. and point|
00000640  20 74 6f 20 6e 65 77 20  68 65 6c 70 20 61 6e 64  | to new help and|
00000650  20 73 79 6e 74 61 78 0d  03 84 05 f4 0d 03 8e 16  | syntax.........|
00000660  62 6c 6f 63 6b 21 26 32  41 34 3d 26 30 34 30 31  |block!&2A4=&0401|
00000670  30 30 0d 03 98 1e 62 6c  6f 63 6b 21 26 32 41 38  |00....block!&2A8|
00000680  3d 6e 65 77 73 79 6e 74  61 78 2d 62 6c 6f 63 6b  |=newsyntax-block|
00000690  0d 03 a2 1c 62 6c 6f 63  6b 21 26 32 41 43 3d 6e  |....block!&2AC=n|
000006a0  65 77 68 65 6c 70 2d 62  6c 6f 63 6b 0d 03 ac 05  |ewhelp-block....|
000006b0  3a 0d 03 b6 2c c8 99 20  22 4f 53 5f 46 69 6c 65  |:...,.. "OS_File|
000006c0  22 2c 31 30 2c 22 4e 65  77 50 69 6e 22 2c 26 46  |",10,"NewPin",&F|
000006d0  46 41 2c 2c 62 6c 6f 63  6b 2c 65 6e 64 0d 03 c0  |FA,,block,end...|
000006e0  05 e0 0d 03 ca 05 3a 0d  03 d4 0e dd 20 a4 7a 65  |......:..... .ze|
000006f0  72 6f 28 7a 29 0d 03 de  09 7a 24 3d 22 22 0d 03  |ro(z)....z$=""..|
00000700  e8 0c c8 95 20 3f 7a 3c  3e 30 0d 03 f2 0c 20 7a  |.... ?z<>0.... z|
00000710  24 2b 3d bd 3f 7a 0d 03  fc 09 20 7a 2b 3d 31 0d  |$+=.?z.... z+=1.|
00000720  04 06 05 ce 0d 04 10 07  3d 7a 24 0d ff           |........=z$..|
0000072d