Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199604.adf » Features » StarInfo/Fletcher/WinMgr/PatchBas
StarInfo/Fletcher/WinMgr/PatchBas
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_199604.adf » Features |
Filename: | StarInfo/Fletcher/WinMgr/PatchBas |
Read OK: | ✔ |
File size: | 08C1 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM > Patch for Module 20REM Created by JFPatch LEN Justin Fletcher, 25 Feb 1995 30REM Intermediate code file created 01 Jul 1995 40ON ERROR PROCError:END 50PROCpatch_loadfile 60sp=13:link=14:pc=15:P%=&0:O%=MC% 70FOR pass%=4 TO 6 STEP2 80REM **** Start of main code **** 90PROCpatch_setpc(&a854) 100[ OPT pass% 110; this replaces code : 120; LDR r14,[r2],#32 - get data and increment 130; AND r14,r14,#&F000 - leave just button 140; TEQ r14,#&F000 <-- this line 150; BNE &a840 - if not then try again 160 B checkforWI 170: 180] 190PROCpatch_setpc(&ab40) 200[ OPT pass% 210; this replaces code : 220; MOV r0,r3 - set window handle 230; MOV r1,r4 - set icon handle 240; MVN r2,#&f0000000 - set x offset 250; MVN r5,#0 <-- this line 260; BL &a53c - is Wimp_SetCaretPosition 270 BL changesetcaret 280: 290] 300PROCpatch_setpc(endofcode) 310[ OPT pass% 320.checkforWI 330 TEQ r14,#&F000 340 TEQNE r14,#&E000 350 B &a858 360: 370; changes parameters passed to Wimp_SetCaretPosition internally when 380; menu opens 390.changesetcaret 400 MOV r2,#1024*16*16 ; 16k (should be enough) 410 MOV r3,#0 ; no y-offset 420 MVN r4,#0 ; flags (-1) 430 MVN r5,#0 ; no index 440 MOV pc,link 450] 460REM **** End of main code **** 470REM Set final pointer to find the length of the code 480PROCpatch_setpc(0) 490NEXT pass% 500PROCpatch_savefile 540END 550: 560REM **** Filing procedures **** 570: 580DEF PROCpatch_loadfile 590infile$="ADFS::IDEDisc4.$.WMTest.WinMgr.Module" 600SYS "OS_File",5,infile$ TO ex,,,,codelen 610IF ex=0 THENERROR 999,"Input file not found" 620DIM MC% codelen+&8000 630SYS "OS_File",255,infile$,MC% 640endofcode=codelen+&0:max=codelen 650L%=endofcode 750ENDPROC 760: 770DEF PROCpatch_savefile 780outfile$="ADFS::IDEDisc4.$.WMTest.WinMgr.NModule" 790OSCLI("Save "+outfile$+" "+STR$~MC%+" "+STR$~(max+MC%)) 800OSCLI("Settype "+outfile$+" Module") 810patchdir$="ADFS::IDEDisc4.$.WMTest.WinMgr" 850ENDPROC 860: 870REM **** Error Handler **** 880: 890DEFPROCError 970ERROR EXT ERR,REPORT$+" at line "+STR$ERL 980ENDPROC 990: 1000REM **** Utility procedures **** 1010: 1020DEFPROCpatch_setpc(n) 1030IF P%-&0>max THENmax=P%-&0 1040P%=n:O%=MC%+n-&0 1050ENDPROC 1060: 1070DEFFNfindfreereg(a,b,c,d):LOCAL n:n=0 1080WHILE n=a OR n=b OR n=c OR n=d 1090 n+=1 1100ENDWHILE 1110=n 1120: 32639REM JFPatch
� > Patch for Module 7� Created by JFPatch � Justin Fletcher, 25 Feb 1995 0� Intermediate code file created 01 Jul 1995 (� � �Error:� 2�patch_loadfile <$sp=13:link=14:pc=15:P%=&0:O%=MC% F� pass%=4 � 6 �2 P"� **** Start of main code **** Z�patch_setpc(&a854) d[ OPT pass% n; this replaces code : x1; LDR r14,[r2],#32 - get data and increment �*; � r14,r14,#&F000 - leave just button �%; TEQ r14,#&F000 <-- this line �0; BNE &a840 - if not then try again � B checkforWI �: �] ��patch_setpc(&ab40) �[ OPT pass% �; this replaces code : �,; MOV r0,r3 - set window handle �*; MOV r1,r4 - set icon handle �'; MVN r2,#&f0000000 - set x offset �%; MVN r5,#0 <-- this line 3; BL &a53c - is Wimp_SetCaretPosition BL changesetcaret : "] ,�patch_setpc(endofcode) 6[ OPT pass% @.checkforWI J TEQ r14,#&F000 T TEQNE r14,#&E000 ^ B &a858 h: rH; changes parameters passed to Wimp_SetCaretPosition internally when |; menu opens �.changesetcaret �6 MOV r2,#1024*16*16 ; 16k (should be enough) �& MOV r3,#0 ; no y-offset �% MVN r4,#0 ; flags (-1) �# MVN r5,#0 ; no index � MOV pc,link �] � � **** End of main code **** �6� Set final pointer to find the length of the code ��patch_setpc(0) �� pass% ��patch_savefile � &: 0!� **** Filing procedures **** :: D� �patch_loadfile N3infile$="ADFS::IDEDisc4.$.WMTest.WinMgr.Module" X*ș "OS_File",5,infile$ � ex,,,,codelen b(� ex=0 �� 999,"Input file not found" l� MC% codelen+&8000 v ș "OS_File",255,infile$,MC% �$endofcode=codelen+&0:max=codelen �L%=endofcode �� �: � �patch_savefile 5outfile$="ADFS::IDEDisc4.$.WMTest.WinMgr.NModule" 1�("Save "+outfile$+" "+�~MC%+" "+�~(max+MC%)) $�("Settype "+outfile$+" Module") *.patchdir$="ADFS::IDEDisc4.$.WMTest.WinMgr" R� \: f� **** Error Handler **** p: z��Error �� � �,�$+" at line "+Þ �� �: �"� **** Utility procedures **** �: ���patch_setpc(n) � P%-&0>max �max=P%-&0 P%=n:O%=MC%+n-&0 � $: ."ݤfindfreereg(a,b,c,d):� n:n=0 8ȕ n=a � n=b � n=c � n=d B n+=1 L� V=n `: � JFPatch �
00000000 0d 00 0a 18 f4 20 3e 20 50 61 74 63 68 20 66 6f |..... > Patch fo| 00000010 72 20 4d 6f 64 75 6c 65 0d 00 14 37 f4 20 43 72 |r Module...7. Cr| 00000020 65 61 74 65 64 20 62 79 20 4a 46 50 61 74 63 68 |eated by JFPatch| 00000030 20 a9 20 4a 75 73 74 69 6e 20 46 6c 65 74 63 68 | . Justin Fletch| 00000040 65 72 2c 20 32 35 20 46 65 62 20 31 39 39 35 0d |er, 25 Feb 1995.| 00000050 00 1e 30 f4 20 49 6e 74 65 72 6d 65 64 69 61 74 |..0. Intermediat| 00000060 65 20 63 6f 64 65 20 66 69 6c 65 20 63 72 65 61 |e code file crea| 00000070 74 65 64 20 30 31 20 4a 75 6c 20 31 39 39 35 0d |ted 01 Jul 1995.| 00000080 00 28 10 ee 20 85 20 f2 45 72 72 6f 72 3a e0 0d |.(.. . .Error:..| 00000090 00 32 13 f2 70 61 74 63 68 5f 6c 6f 61 64 66 69 |.2..patch_loadfi| 000000a0 6c 65 0d 00 3c 24 73 70 3d 31 33 3a 6c 69 6e 6b |le..<$sp=13:link| 000000b0 3d 31 34 3a 70 63 3d 31 35 3a 50 25 3d 26 30 3a |=14:pc=15:P%=&0:| 000000c0 4f 25 3d 4d 43 25 0d 00 46 14 e3 20 70 61 73 73 |O%=MC%..F.. pass| 000000d0 25 3d 34 20 b8 20 36 20 88 32 0d 00 50 22 f4 20 |%=4 . 6 .2..P". | 000000e0 2a 2a 2a 2a 20 53 74 61 72 74 20 6f 66 20 6d 61 |**** Start of ma| 000000f0 69 6e 20 63 6f 64 65 20 2a 2a 2a 2a 0d 00 5a 17 |in code ****..Z.| 00000100 f2 70 61 74 63 68 5f 73 65 74 70 63 28 26 61 38 |.patch_setpc(&a8| 00000110 35 34 29 0d 00 64 0f 5b 20 4f 50 54 20 70 61 73 |54)..d.[ OPT pas| 00000120 73 25 0d 00 6e 1a 3b 20 74 68 69 73 20 72 65 70 |s%..n.; this rep| 00000130 6c 61 63 65 73 20 63 6f 64 65 20 3a 0d 00 78 31 |laces code :..x1| 00000140 3b 20 4c 44 52 20 72 31 34 2c 5b 72 32 5d 2c 23 |; LDR r14,[r2],#| 00000150 33 32 20 20 20 2d 20 67 65 74 20 64 61 74 61 20 |32 - get data | 00000160 61 6e 64 20 69 6e 63 72 65 6d 65 6e 74 0d 00 82 |and increment...| 00000170 2a 3b 20 80 20 72 31 34 2c 72 31 34 2c 23 26 46 |*; . r14,r14,#&F| 00000180 30 30 30 20 2d 20 6c 65 61 76 65 20 6a 75 73 74 |000 - leave just| 00000190 20 62 75 74 74 6f 6e 0d 00 8c 25 3b 20 54 45 51 | button...%; TEQ| 000001a0 20 72 31 34 2c 23 26 46 30 30 30 20 20 20 20 3c | r14,#&F000 <| 000001b0 2d 2d 20 74 68 69 73 20 6c 69 6e 65 0d 00 96 30 |-- this line...0| 000001c0 3b 20 42 4e 45 20 26 61 38 34 30 20 20 20 20 20 |; BNE &a840 | 000001d0 20 20 20 20 20 2d 20 69 66 20 6e 6f 74 20 74 68 | - if not th| 000001e0 65 6e 20 74 72 79 20 61 67 61 69 6e 0d 00 a0 19 |en try again....| 000001f0 20 20 20 42 20 20 20 20 20 20 20 63 68 65 63 6b | B check| 00000200 66 6f 72 57 49 0d 00 aa 05 3a 0d 00 b4 05 5d 0d |forWI....:....].| 00000210 00 be 17 f2 70 61 74 63 68 5f 73 65 74 70 63 28 |....patch_setpc(| 00000220 26 61 62 34 30 29 0d 00 c8 0f 5b 20 4f 50 54 20 |&ab40)....[ OPT | 00000230 70 61 73 73 25 0d 00 d2 1a 3b 20 74 68 69 73 20 |pass%....; this | 00000240 72 65 70 6c 61 63 65 73 20 63 6f 64 65 20 3a 0d |replaces code :.| 00000250 00 dc 2c 3b 20 4d 4f 56 20 72 30 2c 72 33 20 20 |..,; MOV r0,r3 | 00000260 20 20 20 20 20 20 20 20 2d 20 73 65 74 20 77 69 | - set wi| 00000270 6e 64 6f 77 20 68 61 6e 64 6c 65 0d 00 e6 2a 3b |ndow handle...*;| 00000280 20 4d 4f 56 20 72 31 2c 72 34 20 20 20 20 20 20 | MOV r1,r4 | 00000290 20 20 20 20 2d 20 73 65 74 20 69 63 6f 6e 20 68 | - set icon h| 000002a0 61 6e 64 6c 65 0d 00 f0 27 3b 20 4d 56 4e 20 72 |andle...'; MVN r| 000002b0 32 2c 23 26 66 30 30 30 30 30 30 30 20 20 2d 20 |2,#&f0000000 - | 000002c0 73 65 74 20 78 20 6f 66 66 73 65 74 0d 00 fa 25 |set x offset...%| 000002d0 3b 20 4d 56 4e 20 72 35 2c 23 30 20 20 20 20 20 |; MVN r5,#0 | 000002e0 20 20 20 20 3c 2d 2d 20 74 68 69 73 20 6c 69 6e | <-- this lin| 000002f0 65 0d 01 04 33 3b 20 42 4c 20 20 26 61 35 33 63 |e...3; BL &a53c| 00000300 20 20 20 20 20 20 20 20 20 20 2d 20 69 73 20 57 | - is W| 00000310 69 6d 70 5f 53 65 74 43 61 72 65 74 50 6f 73 69 |imp_SetCaretPosi| 00000320 74 69 6f 6e 0d 01 0e 1d 20 20 20 42 4c 20 20 20 |tion.... BL | 00000330 20 20 20 63 68 61 6e 67 65 73 65 74 63 61 72 65 | changesetcare| 00000340 74 0d 01 18 05 3a 0d 01 22 05 5d 0d 01 2c 1b f2 |t....:..".]..,..| 00000350 70 61 74 63 68 5f 73 65 74 70 63 28 65 6e 64 6f |patch_setpc(endo| 00000360 66 63 6f 64 65 29 0d 01 36 0f 5b 20 4f 50 54 20 |fcode)..6.[ OPT | 00000370 70 61 73 73 25 0d 01 40 0f 2e 63 68 65 63 6b 66 |pass%..@..checkf| 00000380 6f 72 57 49 0d 01 4a 19 20 20 20 54 45 51 20 20 |orWI..J. TEQ | 00000390 20 20 20 72 31 34 2c 23 26 46 30 30 30 0d 01 54 | r14,#&F000..T| 000003a0 19 20 20 20 54 45 51 4e 45 20 20 20 72 31 34 2c |. TEQNE r14,| 000003b0 23 26 45 30 30 30 0d 01 5e 14 20 20 20 42 20 20 |#&E000..^. B | 000003c0 20 20 20 20 20 26 61 38 35 38 0d 01 68 05 3a 0d | &a858..h.:.| 000003d0 01 72 48 3b 20 63 68 61 6e 67 65 73 20 70 61 72 |.rH; changes par| 000003e0 61 6d 65 74 65 72 73 20 70 61 73 73 65 64 20 74 |ameters passed t| 000003f0 6f 20 57 69 6d 70 5f 53 65 74 43 61 72 65 74 50 |o Wimp_SetCaretP| 00000400 6f 73 69 74 69 6f 6e 20 69 6e 74 65 72 6e 61 6c |osition internal| 00000410 6c 79 20 77 68 65 6e 0d 01 7c 10 3b 20 6d 65 6e |ly when..|.; men| 00000420 75 20 6f 70 65 6e 73 0d 01 86 13 2e 63 68 61 6e |u opens.....chan| 00000430 67 65 73 65 74 63 61 72 65 74 0d 01 90 36 20 20 |gesetcaret...6 | 00000440 20 4d 4f 56 20 20 20 20 20 72 32 2c 23 31 30 32 | MOV r2,#102| 00000450 34 2a 31 36 2a 31 36 20 3b 20 31 36 6b 20 28 73 |4*16*16 ; 16k (s| 00000460 68 6f 75 6c 64 20 62 65 20 65 6e 6f 75 67 68 29 |hould be enough)| 00000470 0d 01 9a 26 20 20 20 4d 4f 56 20 20 20 20 20 72 |...& MOV r| 00000480 33 2c 23 30 20 20 20 20 20 3b 20 6e 6f 20 79 2d |3,#0 ; no y-| 00000490 6f 66 66 73 65 74 0d 01 a4 25 20 20 20 4d 56 4e |offset...% MVN| 000004a0 20 20 20 20 20 72 34 2c 23 30 20 20 20 20 20 3b | r4,#0 ;| 000004b0 20 66 6c 61 67 73 20 28 2d 31 29 0d 01 ae 23 20 | flags (-1)...# | 000004c0 20 20 4d 56 4e 20 20 20 20 20 72 35 2c 23 30 20 | MVN r5,#0 | 000004d0 20 20 20 20 3b 20 6e 6f 20 69 6e 64 65 78 0d 01 | ; no index..| 000004e0 b8 16 20 20 20 4d 4f 56 20 20 20 20 20 70 63 2c |.. MOV pc,| 000004f0 6c 69 6e 6b 0d 01 c2 05 5d 0d 01 cc 20 f4 20 2a |link....]... . *| 00000500 2a 2a 2a 20 45 6e 64 20 6f 66 20 6d 61 69 6e 20 |*** End of main | 00000510 63 6f 64 65 20 2a 2a 2a 2a 0d 01 d6 36 f4 20 53 |code ****...6. S| 00000520 65 74 20 66 69 6e 61 6c 20 70 6f 69 6e 74 65 72 |et final pointer| 00000530 20 74 6f 20 66 69 6e 64 20 74 68 65 20 6c 65 6e | to find the len| 00000540 67 74 68 20 6f 66 20 74 68 65 20 63 6f 64 65 0d |gth of the code.| 00000550 01 e0 13 f2 70 61 74 63 68 5f 73 65 74 70 63 28 |....patch_setpc(| 00000560 30 29 0d 01 ea 0b ed 20 70 61 73 73 25 0d 01 f4 |0)..... pass%...| 00000570 13 f2 70 61 74 63 68 5f 73 61 76 65 66 69 6c 65 |..patch_savefile| 00000580 0d 02 1c 05 e0 0d 02 26 05 3a 0d 02 30 21 f4 20 |.......&.:..0!. | 00000590 2a 2a 2a 2a 20 46 69 6c 69 6e 67 20 70 72 6f 63 |**** Filing proc| 000005a0 65 64 75 72 65 73 20 2a 2a 2a 2a 0d 02 3a 05 3a |edures ****..:.:| 000005b0 0d 02 44 15 dd 20 f2 70 61 74 63 68 5f 6c 6f 61 |..D.. .patch_loa| 000005c0 64 66 69 6c 65 0d 02 4e 33 69 6e 66 69 6c 65 24 |dfile..N3infile$| 000005d0 3d 22 41 44 46 53 3a 3a 49 44 45 44 69 73 63 34 |="ADFS::IDEDisc4| 000005e0 2e 24 2e 57 4d 54 65 73 74 2e 57 69 6e 4d 67 72 |.$.WMTest.WinMgr| 000005f0 2e 4d 6f 64 75 6c 65 22 0d 02 58 2a c8 99 20 22 |.Module"..X*.. "| 00000600 4f 53 5f 46 69 6c 65 22 2c 35 2c 69 6e 66 69 6c |OS_File",5,infil| 00000610 65 24 20 b8 20 65 78 2c 2c 2c 2c 63 6f 64 65 6c |e$ . ex,,,,codel| 00000620 65 6e 0d 02 62 28 e7 20 65 78 3d 30 20 8c 85 20 |en..b(. ex=0 .. | 00000630 39 39 39 2c 22 49 6e 70 75 74 20 66 69 6c 65 20 |999,"Input file | 00000640 6e 6f 74 20 66 6f 75 6e 64 22 0d 02 6c 17 de 20 |not found"..l.. | 00000650 4d 43 25 20 63 6f 64 65 6c 65 6e 2b 26 38 30 30 |MC% codelen+&800| 00000660 30 0d 02 76 20 c8 99 20 22 4f 53 5f 46 69 6c 65 |0..v .. "OS_File| 00000670 22 2c 32 35 35 2c 69 6e 66 69 6c 65 24 2c 4d 43 |",255,infile$,MC| 00000680 25 0d 02 80 24 65 6e 64 6f 66 63 6f 64 65 3d 63 |%...$endofcode=c| 00000690 6f 64 65 6c 65 6e 2b 26 30 3a 6d 61 78 3d 63 6f |odelen+&0:max=co| 000006a0 64 65 6c 65 6e 0d 02 8a 10 4c 25 3d 65 6e 64 6f |delen....L%=endo| 000006b0 66 63 6f 64 65 0d 02 ee 05 e1 0d 02 f8 05 3a 0d |fcode.........:.| 000006c0 03 02 15 dd 20 f2 70 61 74 63 68 5f 73 61 76 65 |.... .patch_save| 000006d0 66 69 6c 65 0d 03 0c 35 6f 75 74 66 69 6c 65 24 |file...5outfile$| 000006e0 3d 22 41 44 46 53 3a 3a 49 44 45 44 69 73 63 34 |="ADFS::IDEDisc4| 000006f0 2e 24 2e 57 4d 54 65 73 74 2e 57 69 6e 4d 67 72 |.$.WMTest.WinMgr| 00000700 2e 4e 4d 6f 64 75 6c 65 22 0d 03 16 31 ff 28 22 |.NModule"...1.("| 00000710 53 61 76 65 20 22 2b 6f 75 74 66 69 6c 65 24 2b |Save "+outfile$+| 00000720 22 20 22 2b c3 7e 4d 43 25 2b 22 20 22 2b c3 7e |" "+.~MC%+" "+.~| 00000730 28 6d 61 78 2b 4d 43 25 29 29 0d 03 20 24 ff 28 |(max+MC%)).. $.(| 00000740 22 53 65 74 74 79 70 65 20 22 2b 6f 75 74 66 69 |"Settype "+outfi| 00000750 6c 65 24 2b 22 20 4d 6f 64 75 6c 65 22 29 0d 03 |le$+" Module")..| 00000760 2a 2e 70 61 74 63 68 64 69 72 24 3d 22 41 44 46 |*.patchdir$="ADF| 00000770 53 3a 3a 49 44 45 44 69 73 63 34 2e 24 2e 57 4d |S::IDEDisc4.$.WM| 00000780 54 65 73 74 2e 57 69 6e 4d 67 72 22 0d 03 52 05 |Test.WinMgr"..R.| 00000790 e1 0d 03 5c 05 3a 0d 03 66 1d f4 20 2a 2a 2a 2a |...\.:..f.. ****| 000007a0 20 45 72 72 6f 72 20 48 61 6e 64 6c 65 72 20 2a | Error Handler *| 000007b0 2a 2a 2a 0d 03 70 05 3a 0d 03 7a 0b dd f2 45 72 |***..p.:..z...Er| 000007c0 72 6f 72 0d 03 ca 1b 85 20 a2 20 9f 2c f6 24 2b |ror..... . .,.$+| 000007d0 22 20 61 74 20 6c 69 6e 65 20 22 2b c3 9e 0d 03 |" at line "+....| 000007e0 d4 05 e1 0d 03 de 05 3a 0d 03 e8 22 f4 20 2a 2a |.......:...". **| 000007f0 2a 2a 20 55 74 69 6c 69 74 79 20 70 72 6f 63 65 |** Utility proce| 00000800 64 75 72 65 73 20 2a 2a 2a 2a 0d 03 f2 05 3a 0d |dures ****....:.| 00000810 03 fc 14 dd f2 70 61 74 63 68 5f 73 65 74 70 63 |.....patch_setpc| 00000820 28 6e 29 0d 04 06 1a e7 20 50 25 2d 26 30 3e 6d |(n)..... P%-&0>m| 00000830 61 78 20 8c 6d 61 78 3d 50 25 2d 26 30 0d 04 10 |ax .max=P%-&0...| 00000840 14 50 25 3d 6e 3a 4f 25 3d 4d 43 25 2b 6e 2d 26 |.P%=n:O%=MC%+n-&| 00000850 30 0d 04 1a 05 e1 0d 04 24 05 3a 0d 04 2e 22 dd |0.......$.:...".| 00000860 a4 66 69 6e 64 66 72 65 65 72 65 67 28 61 2c 62 |.findfreereg(a,b| 00000870 2c 63 2c 64 29 3a ea 20 6e 3a 6e 3d 30 0d 04 38 |,c,d):. n:n=0..8| 00000880 1c c8 95 20 6e 3d 61 20 84 20 6e 3d 62 20 84 20 |... n=a . n=b . | 00000890 6e 3d 63 20 84 20 6e 3d 64 0d 04 42 09 20 6e 2b |n=c . n=d..B. n+| 000008a0 3d 31 0d 04 4c 05 ce 0d 04 56 06 3d 6e 0d 04 60 |=1..L....V.=n..`| 000008b0 05 3a 0d 7f 7f 0d f4 20 4a 46 50 61 74 63 68 0d |.:..... JFPatch.| 000008c0 ff |.| 000008c1