Home » Archimedes archive » Acorn User » AU 1997-04 A.adf » Features1 » StarInfo/Fletcher/FreeCell/WRSource

StarInfo/Fletcher/FreeCell/WRSource

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 1997-04 A.adf » Features1
Filename: StarInfo/Fletcher/FreeCell/WRSource
Read OK:
File size: 23ED bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > Patch for memory compilation
   20REM Created by JFPatch v2.26 (28 May 1996) LEN Justin Fletcher
   30REM Intermediate code file created 26 Jun 1996
   40ON ERROR PROCError:END
   50PROCpatch_loadfile
   60REM **** Workspace structures ****
   70:
   80ptr=0:REM Start structure of workspace
   90`win=ptr:ptr+=4
  100`icon=ptr:ptr+=4
  110`x0=ptr:ptr+=4
  120`y0=ptr:ptr+=4
  130`x1=ptr:ptr+=4
  140`y1=ptr:ptr+=4
  150`flags=ptr:ptr+=4
  160temp_1=ptr
  170`text=ptr:ptr+=12
  180ptr=temp_1
  190`indtext=ptr:ptr+=4
  200`indvalid=ptr:ptr+=4
  210`indlen=ptr:ptr+=4
  220`delwin=ptr:ptr+=4
  230`delicon=ptr:ptr+=4
  240`len_workspace=ptr
  250:
  260sp=13:link=14:pc=15
  270vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31
  280P%=&0:O%=MC%
  290FOR pass%=4 TO 6 STEP2
  300REM **** Start of main code ****
  310PROCpatch_setpc(0)
  320[OPT pass%
  330          ; **** Add module header ****
  340   EQUD 0                  ; Start offset
  350   EQUD module_init        ; Initialisation offset
  360   EQUD module_final       ; Finalisation offset
  370   EQUD 0                  ; Service request offset
  380   EQUD module_title       ; Title string offset
  390   EQUD module_help        ; Help string offset
  400   EQUD module_commands    ; Help and command keyword table offset
  410   EQUD &C0480             ; SWI chunk base number
  420   EQUD module_swicode     ; SWI handler code offset
  430   EQUD module_switable    ; SWI decoding table offset
  440   EQUD 0                  ; SWI decoding code offset
  450:
  460.module_title
  470   EQUS "WimpResizeIcon"+CHR$0
  480   ALIGN
  490:
  500.module_help
  510   EQUS "WimpResizeIcon"+CHR$9+"1.00 ("+MID$(TIME$,5,11)+") � Justin Fletcher"+CHR$0
  520   ALIGN
  530:
  540.module_init
  550   STMFD   (sp)!,{r0-r4,link}     ; Stack registers
  560   MOV     r0,#6
  570 FNLMOV("",3,`len_workspace)
  580   SWI     "XOS_Module"           ; Claim private workspace
  590   ADDVS   sp,sp,#4               ; if error return r0
  600   LDMVSFD (sp)!,{r1-r4,pc}       ; return error
  610   STR     r2,[r12]               ; store in private word
  620   MOV     r12,r2                 ; r12=space
  630   LDMFD   (sp)!,{r0-r4,pc}       ; restore registers
  640:
  650.module_final
  660   STMFD   (sp)!,{r0-r4,r12,link} ; Stack registers
  670   LDR     r12,[r12]
  680   MOV     r0,#7
  690   MOV     r2,r12
  700   SWI     "XOS_Module"           ; Release workspace
  710   ADDVS   sp,sp,#4
  720   LDMVSFD (sp)!,{r1-r4,r12,pc}   ; Return if error
  730   LDMFD   (sp)!,{r0-r4,r12,pc}   ; Return
  740:
  750; ***** Module commands table
  760.module_commands
  770   EQUS "WimpResizeIcon"   ; Command name
  780   EQUB 0:ALIGN
  790   EQUD 0                  ; Code to call
  800   EQUD &0                 ; Flags
  810   EQUD 0                  ; Syntax pointer
  820   EQUD help_wimpresizeicon ; Help pointer
  830   EQUB 0
  840   ALIGN
  850:
  860; ***** Help and Syntax messages
  870.help_wimpresizeicon
  880   EQUS "WimpResizeIcon provides the WimpHack_ResizeIcon call which allows "
  890   EQUS "normal people to get around the bug where RO3.5 programmers stick "
  900   EQUS "calls in to RO3.5 only code which would otherwise work perfectly "
  910   EQUS "well on older versions of RO."+CHR$13
  920   EQUS "I shalln't mention the other silly things they do� "
  930   EQUB 0
  940   ALIGN
  950:
  960; ***** SWI table
  970.module_switable
  980   EQUS "WimpHack"         ; SWI prefix
  990   EQUB 0
 1000   EQUS "ResizeIcon"+CHR$0
 1010   EQUB 0
 1020   ALIGN
 1030:
 1040; ***** SWI handler code
 1050.module_swicode
 1060   LDR     r12,[r12]
 1070   CMP     r11,#1
 1080   ADDLT   pc,pc,r11,LSL #2
 1090   B       module_swierror
 1100; ***** SWI jump table
 1110   B      resizeicon
 1120.module_swierror
 1130   ADR     r0,`module_swierror
 1140   ORRS    pc,link,#vbit        ; set V flag and return
 1150.`module_swierror
 1160   EQUD    &1E6
 1170   EQUS    "SWI code out of range for module WimpResizeIcon"+CHR$0
 1180   ALIGN
 1190:
 1200          ; **** End of module header ****
 1210:
 1220.resizeicon
 1230   STMFD   (sp)!,{r0-r7,link}            ; Stack registers
 1240          ; "%c04%c30Starting recreation for window %&0, icon %r1"
 1250           ; first we need to store the details given
 1260   MOV     r6,sp                         ; in case we have to exit
 1270                                         ; prematurely, store stack ptr
 1280   MOV     r7,r1                         ; r7 = icon number to re-create
 1290   STR     r0,[r12,#`delwin]
 1300          ; store win in delete block
 1310           ; read the data about the icon
 1320   STMIA   r12,{r0,r1}                   ; store win and icon in block
 1330          ; "Getting icon data"
 1340   MOV     r1,r12                        ; get the block pointer
 1350   SWI     "XWimp_GetIconState"          ; find out the old blocks data
 1360   LDMFD   (sp),{r0-r5}                  ; now read back the new location
 1370   STMIA   r12,{r0-r5}                   ; and store in the safe block
 1380           ; now to delete the icon
 1390          ; "Deleting icon"
 1400   MOV     r1,r12                        ; get the block pointer
 1410   SWI     "XWimp_DeleteIcon"            ; delete the icon
 1420   BVS     __z0_exit                         ; exit gracefully if error
 1430           ; and then create lots of icons...
 1440          ; "Deleted"
 1450   MVN     r2,#NOT -1                    ; use -1 to mark end of list
 1460   STMFD   (sp)!,{r2}                    ; stack value
 1470   LDR     r0,[r12,#`win]
 1480          ; read window handle
 1490   STR     r0,[r12,#`icon]
 1500          ; store window handle at block start
 1510.__z0_createloop
 1520 FNLADD("  ",1,12,`icon)
 1530          ; get pointer to create block
 1540          ; "Trying to create, block = %&1"
 1550   LDR     r2,[r1]
 1560          ; "Win = %&2"
 1570   SWI     "XWimp_CreateIcon"            ; create the icon
 1580   BVS     __z0_exit                         ; exit gracefully if error
 1590          ; "Created icon = %r0"
 1600   CMP     r0,r7                         ; have we found the icon yet ?
 1610   STMLTFD (sp)!,{r0}                    ; if not, stack the icon number THEN
 1620   BLT     __z0_createloop                   ; THEN and try again
 1630           ; we've found the icon we really wanted, so now we must delete
 1640           ; all the rubbish
 1650:
 1660          ; "Now to delete the rubbish"
 1670 FNLADD("  ",1,12,`delwin)
 1680          ; get pointer to delete block
 1690.__z0_deleteloop
 1700   LDMFD   (sp)!,{r0}                    ; read icon number
 1710          ; "Read number %r0"
 1720   CMN     r0,#1                         ; is it -1 (end marker) ?
 1730   BEQ     __z0_lasticon                     ; if so, we're done !
 1740   STR     r0,[r12,#`delicon]
 1750          ; if not, store in delete block
 1760          ; "Deleting icon %r0"
 1770   SWI     "XWimp_DeleteIcon"            ; and delete the icon
 1780   BVS     __z0_exit                         ; exit gracefully if error
 1790.__z0_lasticon
 1800           ; we're all done - time to go !
 1810          ; "Success - exiting !"
 1820.__z0_exit
 1830   MOV     sp,r6                         ; restore the stack pointer
 1840   STRVS   r0,[sp]
 1850   LDMFD   (sp)!,{r0-r7,pc}              ; Return from call
 1860:
 1870]
 1880REM **** End of main code ****
 1890REM Set final pointer to find the length of the code
 1900PROCpatch_setpc(0)
 1910NEXT pass%
 1920PROCpatch_savefile
 1960ON ERROR ERROR EXT ERR,REPORT$+" at line "+STR$ERL
 1970REM **** Post-assembly user code *****
 1980*Run <FreeCellHack$Dir>.WRIcon
 1990END
 2000:
 2010REM **** Filing procedures ****
 2020:
 2030DEF PROCpatch_loadfile
 2040codelen=0
 2050DIM MC% &1400
 2060endofcode=(codelen+&0+3) AND -4:max=codelen
 2070L%=endofcode:__cap%=FALSE
 2210ENDPROC
 2220:
 2230DEF PROCpatch_savefile
 2240outfile$="<FreeCellHack$Dir>.WRIcon"
 2250OSCLI("Save "+outfile$+" "+STR$~MC%+" "+STR$~(max+MC%))
 2260OSCLI("Settype "+outfile$+" Module")
 2270patchdir$="ADFS::Gerph.$.Games.�.!Freecell.Hack"
 2320ENDPROC
 2330:
 2340REM **** Error Handler ****
 2350:
 2360DEFPROCError
 2370LOCAL ERROR
 2380ON ERROR LOCAL:RESTORE ERROR:ERROR EXT ERR,REPORT$+" whilst in error handler at line "+STR$ERL
 2490ERROR EXT ERR,REPORT$+" at line "+STR$ERL
 2500ENDPROC
 2510:
 2620REM **** Utility procedures ****
 2630:
 2640DEFPROCpatch_setpc(n)
 2650IF P%-&0>max THENmax=P%-&0
 2660P%=n:O%=MC%+n-&0
 2670ENDPROC
 2680:
 2690DEFFNfindfreereg(a,b,c,d):LOCAL n:n=0
 2700WHILE n=a OR n=b OR n=c OR n=d
 2710 n+=1
 2720ENDWHILE
 2730=n
 2740:
 2750REM **** Long MOV macro instruction ****
 2760:
 2770DEFFNLMOV(cond$,reg,value)
 2780IF cond$="" OR cond$="  " THENcond$="AL"
 2790cond=(INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
 2800mov=(&3A<<20)+(reg<<12)+(cond<<28)
 2810add=(&28<<20)+(reg<<12)+(reg<<16)+(cond<<28)
 2820IF value<0 THENneg=TRUE:mov=mov OR (1<<22):add=add EOR (12<<20):value=-value-1 ELSEneg=FALSE
 2830shift=0
 2840REPEAT
 2850 WHILE (value AND 3)=0 AND shift<16
 2860  shift+=1:value=value DIV4
 2870 ENDWHILE
 2880 xshift=16-shift:IF xshift=16 THENxshift=0
 2890 IF mov<>0 THEN
 2900  [OPT pass%:EQUD mov+(xshift<<8)+(value AND 255):]
 2910  mov=0
 2920 ELSE
 2930  [OPT pass%:EQUD add+(xshift<<8)+(value AND 255):]
 2940 ENDIF
 2950 value=value DIV256:shift+=4
 2960UNTILvalue=0
 2970=0
 2980:
 2990REM **** Long ADD macro instruction ****
 3000:
 3010DEFFNLADD(cond$,reg1,reg2,value)
 3020IF cond$="" OR cond$="  " THENcond$="AL"
 3030cond=(INSTR("EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
 3040add1=(&28<<20)+(reg1<<12)+(reg2<<16)+(cond<<28)
 3050add2=(&28<<20)+(reg1<<12)+(reg1<<16)+(cond<<28)
 3060shift=0
 3070REPEAT
 3080 WHILE (value AND 3)=0 AND shift<16
 3090  shift+=1:value=value DIV4
 3100 ENDWHILE
 3110 xshift=16-shift:IF xshift=16 THENxshift=0
 3120 IF add1<>0 THEN
 3130  [OPT pass%:EQUDadd1+(xshift<<8)+(value AND 255):]
 3140  add1=0
 3150 ELSE
 3160  [OPT pass%:EQUDadd2+(xshift<<8)+(value AND 255):]
 3170 ENDIF
 3180 value=value DIV256:shift+=4
 3190UNTILvalue=0
 3200=0
 3210:
32639REM JFPatch

$� > Patch for memory compilation
>� Created by JFPatch v2.26 (28 May 1996) � Justin Fletcher
0� Intermediate code file created 26 Jun 1996
(� � �Error:�
2�patch_loadfile
<$� **** Workspace structures ****
F:
P(ptr=0:� Start structure of workspace
Z`win=ptr:ptr+=4
d`icon=ptr:ptr+=4
n`x0=ptr:ptr+=4
x`y0=ptr:ptr+=4
�`x1=ptr:ptr+=4
�`y1=ptr:ptr+=4
�`flags=ptr:ptr+=4
�temp_1=ptr
�`text=ptr:ptr+=12
�ptr=temp_1
�`indtext=ptr:ptr+=4
�`indvalid=ptr:ptr+=4
�`indlen=ptr:ptr+=4
�`delwin=ptr:ptr+=4
�`delicon=ptr:ptr+=4
�`len_workspace=ptr
�:
sp=13:link=14:pc=15
/vbit=1<<28:cbit=1<<29:zbit=1<<30:nbit=1<<31
P%=&0:O%=MC%
"� pass%=4 � 6 �2
,"� **** Start of main code ****
6�patch_setpc(0)
@[OPT pass%
J+          ; **** Add module header ****
T-   EQUD 0                  ; Start offset
^6   EQUD module_init        ; Initialisation offset
h4   EQUD module_final       ; Finalisation offset
r7   EQUD 0                  ; Service request offset
|4   EQUD module_title       ; Title string offset
�3   EQUD module_help        ; Help string offset
�F   EQUD module_commands    ; Help and command keyword table offset
�6   EQUD &C0480             ; SWI chunk base number
�8   EQUD module_swicode     ; SWI handler code offset
�:   EQUD module_switable    ; SWI decoding table offset
�9   EQUD 0                  ; SWI decoding code offset
�:
�.module_title
�   EQUS "WimpResizeIcon"+�0
�   ALIGN
�:
�.module_help
�K   EQUS "WimpResizeIcon"+�9+"1.00 ("+��$,5,11)+") � Justin Fletcher"+�0
   ALIGN
:
.module_init
&7   STMFD   (sp)!,{r0-r4,link}     ; Stack registers
0   MOV     r0,#6
: �LMOV("",3,`len_workspace)
D?   SWI     "XOS_Module"           ; Claim private workspace
N:   ADDVS   sp,sp,#4               ; if error return r0
X4   LDMVSFD (sp)!,{r1-r4,pc}       ; return error
b=   STR     r2,[r12]               ; store in private word
l1   MOV     r12,r2                 ; r12=space
v9   LDMFD   (sp)!,{r0-r4,pc}       ; restore registers
�:
�.module_final
�7   STMFD   (sp)!,{r0-r4,r12,link} ; Stack registers
�   LDR     r12,[r12]
�   MOV     r0,#7
�   MOV     r2,r12
�9   SWI     "XOS_Module"           ; Release workspace
�   ADDVS   sp,sp,#4
�7   LDMVSFD (sp)!,{r1-r4,r12,pc}   ; Return if error
�.   LDMFD   (sp)!,{r0-r4,r12,pc}   ; Return
�:
�!; ***** Module commands table
�.module_commands
-   EQUS "WimpResizeIcon"   ; Command name
   EQUB 0:ALIGN
-   EQUD 0                  ; Code to call
 &   EQUD &0                 ; Flags
*/   EQUD 0                  ; Syntax pointer
4.   EQUD help_wimpresizeicon ; Help pointer
>
   EQUB 0
H   ALIGN
R:
\$; ***** Help and Syntax messages
f.help_wimpresizeicon
pP   EQUS "WimpResizeIcon provides the WimpHack_ResizeIcon call which allows "
zP   EQUS "normal people to get around the bug where RO3.5 programmers stick "
�O   EQUS "calls in to RO3.5 only code which would otherwise work perfectly "
�/   EQUS "well on older versions of RO."+�13
�A   EQUS "I shalln't mention the other silly things they do� "
�
   EQUB 0
�   ALIGN
�:
�; ***** SWI table
�.module_switable
�+   EQUS "WimpHack"         ; SWI prefix
�
   EQUB 0
�   EQUS "ResizeIcon"+�0
�
   EQUB 0
�   ALIGN
:
; ***** SWI handler code
.module_swicode
$   LDR     r12,[r12]
.   CMP     r11,#1
8   ADDLT   pc,pc,r11,LSL #2
B   B       module_swierror
L; ***** SWI jump table
V   B      resizeicon
`.module_swierror
j"   ADR     r0,`module_swierror
t:   �RS    pc,link,#vbit        ; set V flag and return
~.`module_swierror
�   EQUD    &1E6
�C   EQUS    "SWI code out of range for module WimpResizeIcon"+�0
�   ALIGN
�:
�.          ; **** End of module header ****
�:
�.resizeicon
�>   STMFD   (sp)!,{r0-r7,link}            ; Stack registers
�F          ; "%c04%c30Starting recreation for window %&0, icon %r1"
�9           ; first we need to store the details given
�F   MOV     r6,sp                         ; in case we have to exit
�K                                         ; prematurely, store stack ptr
L   MOV     r7,r1                         ; r7 = icon number to re-create

    STR     r0,[r12,#`delwin]
)          ; store win in delete block
-           ; read the data about the icon
(J   STMIA   r12,{r0,r1}                   ; store win and icon in block
2#          ; "Getting icon data"
<D   MOV     r1,r12                        ; get the block pointer
FK   SWI     "XWimp_GetIconState"          ; find out the old blocks data
PM   LDMFD   (sp),{r0-r5}                  ; now read back the new location
ZJ   STMIA   r12,{r0-r5}                   ; and store in the safe block
d'           ; now to delete the icon
n          ; "Deleting icon"
xD   MOV     r1,r12                        ; get the block pointer
�>   SWI     "XWimp_DeleteIcon"            ; delete the icon
�K   BVS     __z0_exit                         ; exit gracefully if error
�1           ; and then create lots of icons...
�          ; "Deleted"
�G   MVN     r2,#� -1                    ; use -1 to mark end of list
�:   STMFD   (sp)!,{r2}                    ; stack value
�   LDR     r0,[r12,#`win]
�"          ; read window handle
�   STR     r0,[r12,#`icon]
�2          ; store window handle at block start
�.__z0_createloop
� �LADD("  ",1,12,`icon)
�+          ; get pointer to create block
/          ; "Trying to create, block = %&1"
   LDR     r2,[r1]
          ; "Win = %&2"
">   SWI     "XWimp_CreateIcon"            ; create the icon
,K   BVS     __z0_exit                         ; exit gracefully if error
6$          ; "Created icon = %r0"
@K   CMP     r0,r7                         ; have we found the icon yet ?
JN   STMLTFD (sp)!,{r0}                    ; if not, stack the icon number �
TB   BLT     __z0_createloop                   ; � and try again
^M           ; we've found the icon we really wanted, so now we must delete
h            ; all the rubbish
r:
|+          ; "Now to delete the rubbish"
� �LADD("  ",1,12,`delwin)
�+          ; get pointer to delete block
�.__z0_deleteloop
�?   LDMFD   (sp)!,{r0}                    ; read icon number
�!          ; "Read number %r0"
�F   CMN     r0,#1                         ; is it -1 (end marker) ?
�F   BEQ     __z0_lasticon                     ; if so, we're done !
�!   STR     r0,[r12,#`delicon]
�-          ; if not, store in delete block
�#          ; "Deleting icon %r0"
�B   SWI     "XWimp_DeleteIcon"            ; and delete the icon
�K   BVS     __z0_exit                         ; exit gracefully if error
�.__z0_lasticon
.           ; we're all done - time to go !
%          ; "Success - exiting !"
.__z0_exit
&H   MOV     sp,r6                         ; restore the stack pointer
0   STRVS   r0,[sp]
:?   LDMFD   (sp)!,{r0-r7,pc}              ; Return from call
D:
N]
X � **** End of main code ****
b6� Set final pointer to find the length of the code
l�patch_setpc(0)
v� pass%
��patch_savefile
�� � � � �,�$+" at line "+Þ
�(� **** Post-assembly user code *****
�"*Run <FreeCellHack$Dir>.WRIcon
��
�:
�!� **** Filing procedures ****
�:
�� �patch_loadfile
�
codelen=0
� MC% &1400
-endofcode=(codelen+&0+3) � -4:max=codelen
L%=endofcode:__cap%=�
��
�:
�� �patch_savefile
�(outfile$="<FreeCellHack$Dir>.WRIcon"
�1�("Save "+outfile$+" "+�~MC%+" "+�~(max+MC%))
�$�("Settype "+outfile$+" Module")
�4patchdir$="ADFS::Gerph.$.Games.�.!Freecell.Hack"
	�
	:
	$� **** Error Handler ****
	.:
	8��Error
	B� �
	L=� � �:� �:� � �,�$+" whilst in error handler at line "+Þ
	�� � �,�$+" at line "+Þ
	��
	�:
<"� **** Utility procedures ****
F:
P��patch_setpc(n)
Z� P%-&0>max �max=P%-&0
dP%=n:O%=MC%+n-&0
n�
x:
�"ݤfindfreereg(a,b,c,d):� n:n=0
�ȕ n=a � n=b � n=c � n=d
�	 n+=1
��
�=n
�:
�*� **** Long MOV macro instruction ****
�:
�ݤLMOV(cond$,reg,value)
�'� cond$="" � cond$="  " �cond$="AL"
�9cond=(�"EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
�&mov=(&3A<<20)+(reg<<12)+(cond<<28)
�0add=(&28<<20)+(reg<<12)+(reg<<16)+(cond<<28)
O� value<0 �neg=�:mov=mov � (1<<22):add=add � (12<<20):value=-value-1 �neg=�
shift=0
�
"  ȕ (value � 3)=0 � shift<16
,  shift+=1:value=value �4
6 �
@* xshift=16-shift:� xshift=16 �xshift=0
J � mov<>0 �
T5  [OPT pass%:EQUD mov+(xshift<<8)+(value � 255):]
^  mov=0
h �
r5  [OPT pass%:EQUD add+(xshift<<8)+(value � 255):]
| �
� value=value �256:shift+=4
��value=0
�=0
�:
�*� **** Long ADD macro instruction ****
�:
�!ݤLADD(cond$,reg1,reg2,value)
�'� cond$="" � cond$="  " �cond$="AL"
�9cond=(�"EQNECSCCMIPLVSVCHILSGELTGTLEALNV",cond$)-1)/2
�3add1=(&28<<20)+(reg1<<12)+(reg2<<16)+(cond<<28)
�3add2=(&28<<20)+(reg1<<12)+(reg1<<16)+(cond<<28)
�shift=0
��
  ȕ (value � 3)=0 � shift<16
  shift+=1:value=value �4
 �
&* xshift=16-shift:� xshift=16 �xshift=0
0 � add1<>0 �
:5  [OPT pass%:EQUDadd1+(xshift<<8)+(value � 255):]
D  add1=0
N �
X5  [OPT pass%:EQUDadd2+(xshift<<8)+(value � 255):]
b �
l value=value �256:shift+=4
v�value=0
�=0
�:

� JFPatch
�
00000000  0d 00 0a 24 f4 20 3e 20  50 61 74 63 68 20 66 6f  |...$. > Patch fo|
00000010  72 20 6d 65 6d 6f 72 79  20 63 6f 6d 70 69 6c 61  |r memory compila|
00000020  74 69 6f 6e 0d 00 14 3e  f4 20 43 72 65 61 74 65  |tion...>. Create|
00000030  64 20 62 79 20 4a 46 50  61 74 63 68 20 76 32 2e  |d by JFPatch v2.|
00000040  32 36 20 28 32 38 20 4d  61 79 20 31 39 39 36 29  |26 (28 May 1996)|
00000050  20 a9 20 4a 75 73 74 69  6e 20 46 6c 65 74 63 68  | . Justin Fletch|
00000060  65 72 0d 00 1e 30 f4 20  49 6e 74 65 72 6d 65 64  |er...0. Intermed|
00000070  69 61 74 65 20 63 6f 64  65 20 66 69 6c 65 20 63  |iate code file c|
00000080  72 65 61 74 65 64 20 32  36 20 4a 75 6e 20 31 39  |reated 26 Jun 19|
00000090  39 36 0d 00 28 10 ee 20  85 20 f2 45 72 72 6f 72  |96..(.. . .Error|
000000a0  3a e0 0d 00 32 13 f2 70  61 74 63 68 5f 6c 6f 61  |:...2..patch_loa|
000000b0  64 66 69 6c 65 0d 00 3c  24 f4 20 2a 2a 2a 2a 20  |dfile..<$. **** |
000000c0  57 6f 72 6b 73 70 61 63  65 20 73 74 72 75 63 74  |Workspace struct|
000000d0  75 72 65 73 20 2a 2a 2a  2a 0d 00 46 05 3a 0d 00  |ures ****..F.:..|
000000e0  50 28 70 74 72 3d 30 3a  f4 20 53 74 61 72 74 20  |P(ptr=0:. Start |
000000f0  73 74 72 75 63 74 75 72  65 20 6f 66 20 77 6f 72  |structure of wor|
00000100  6b 73 70 61 63 65 0d 00  5a 13 60 77 69 6e 3d 70  |kspace..Z.`win=p|
00000110  74 72 3a 70 74 72 2b 3d  34 0d 00 64 14 60 69 63  |tr:ptr+=4..d.`ic|
00000120  6f 6e 3d 70 74 72 3a 70  74 72 2b 3d 34 0d 00 6e  |on=ptr:ptr+=4..n|
00000130  12 60 78 30 3d 70 74 72  3a 70 74 72 2b 3d 34 0d  |.`x0=ptr:ptr+=4.|
00000140  00 78 12 60 79 30 3d 70  74 72 3a 70 74 72 2b 3d  |.x.`y0=ptr:ptr+=|
00000150  34 0d 00 82 12 60 78 31  3d 70 74 72 3a 70 74 72  |4....`x1=ptr:ptr|
00000160  2b 3d 34 0d 00 8c 12 60  79 31 3d 70 74 72 3a 70  |+=4....`y1=ptr:p|
00000170  74 72 2b 3d 34 0d 00 96  15 60 66 6c 61 67 73 3d  |tr+=4....`flags=|
00000180  70 74 72 3a 70 74 72 2b  3d 34 0d 00 a0 0e 74 65  |ptr:ptr+=4....te|
00000190  6d 70 5f 31 3d 70 74 72  0d 00 aa 15 60 74 65 78  |mp_1=ptr....`tex|
000001a0  74 3d 70 74 72 3a 70 74  72 2b 3d 31 32 0d 00 b4  |t=ptr:ptr+=12...|
000001b0  0e 70 74 72 3d 74 65 6d  70 5f 31 0d 00 be 17 60  |.ptr=temp_1....`|
000001c0  69 6e 64 74 65 78 74 3d  70 74 72 3a 70 74 72 2b  |indtext=ptr:ptr+|
000001d0  3d 34 0d 00 c8 18 60 69  6e 64 76 61 6c 69 64 3d  |=4....`indvalid=|
000001e0  70 74 72 3a 70 74 72 2b  3d 34 0d 00 d2 16 60 69  |ptr:ptr+=4....`i|
000001f0  6e 64 6c 65 6e 3d 70 74  72 3a 70 74 72 2b 3d 34  |ndlen=ptr:ptr+=4|
00000200  0d 00 dc 16 60 64 65 6c  77 69 6e 3d 70 74 72 3a  |....`delwin=ptr:|
00000210  70 74 72 2b 3d 34 0d 00  e6 17 60 64 65 6c 69 63  |ptr+=4....`delic|
00000220  6f 6e 3d 70 74 72 3a 70  74 72 2b 3d 34 0d 00 f0  |on=ptr:ptr+=4...|
00000230  16 60 6c 65 6e 5f 77 6f  72 6b 73 70 61 63 65 3d  |.`len_workspace=|
00000240  70 74 72 0d 00 fa 05 3a  0d 01 04 17 73 70 3d 31  |ptr....:....sp=1|
00000250  33 3a 6c 69 6e 6b 3d 31  34 3a 70 63 3d 31 35 0d  |3:link=14:pc=15.|
00000260  01 0e 2f 76 62 69 74 3d  31 3c 3c 32 38 3a 63 62  |../vbit=1<<28:cb|
00000270  69 74 3d 31 3c 3c 32 39  3a 7a 62 69 74 3d 31 3c  |it=1<<29:zbit=1<|
00000280  3c 33 30 3a 6e 62 69 74  3d 31 3c 3c 33 31 0d 01  |<30:nbit=1<<31..|
00000290  18 10 50 25 3d 26 30 3a  4f 25 3d 4d 43 25 0d 01  |..P%=&0:O%=MC%..|
000002a0  22 14 e3 20 70 61 73 73  25 3d 34 20 b8 20 36 20  |".. pass%=4 . 6 |
000002b0  88 32 0d 01 2c 22 f4 20  2a 2a 2a 2a 20 53 74 61  |.2..,". **** Sta|
000002c0  72 74 20 6f 66 20 6d 61  69 6e 20 63 6f 64 65 20  |rt of main code |
000002d0  2a 2a 2a 2a 0d 01 36 13  f2 70 61 74 63 68 5f 73  |****..6..patch_s|
000002e0  65 74 70 63 28 30 29 0d  01 40 0e 5b 4f 50 54 20  |etpc(0)..@.[OPT |
000002f0  70 61 73 73 25 0d 01 4a  2b 20 20 20 20 20 20 20  |pass%..J+       |
00000300  20 20 20 3b 20 2a 2a 2a  2a 20 41 64 64 20 6d 6f  |   ; **** Add mo|
00000310  64 75 6c 65 20 68 65 61  64 65 72 20 2a 2a 2a 2a  |dule header ****|
00000320  0d 01 54 2d 20 20 20 45  51 55 44 20 30 20 20 20  |..T-   EQUD 0   |
00000330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00000340  20 53 74 61 72 74 20 6f  66 66 73 65 74 0d 01 5e  | Start offset..^|
00000350  36 20 20 20 45 51 55 44  20 6d 6f 64 75 6c 65 5f  |6   EQUD module_|
00000360  69 6e 69 74 20 20 20 20  20 20 20 20 3b 20 49 6e  |init        ; In|
00000370  69 74 69 61 6c 69 73 61  74 69 6f 6e 20 6f 66 66  |itialisation off|
00000380  73 65 74 0d 01 68 34 20  20 20 45 51 55 44 20 6d  |set..h4   EQUD m|
00000390  6f 64 75 6c 65 5f 66 69  6e 61 6c 20 20 20 20 20  |odule_final     |
000003a0  20 20 3b 20 46 69 6e 61  6c 69 73 61 74 69 6f 6e  |  ; Finalisation|
000003b0  20 6f 66 66 73 65 74 0d  01 72 37 20 20 20 45 51  | offset..r7   EQ|
000003c0  55 44 20 30 20 20 20 20  20 20 20 20 20 20 20 20  |UD 0            |
000003d0  20 20 20 20 20 20 3b 20  53 65 72 76 69 63 65 20  |      ; Service |
000003e0  72 65 71 75 65 73 74 20  6f 66 66 73 65 74 0d 01  |request offset..|
000003f0  7c 34 20 20 20 45 51 55  44 20 6d 6f 64 75 6c 65  ||4   EQUD module|
00000400  5f 74 69 74 6c 65 20 20  20 20 20 20 20 3b 20 54  |_title       ; T|
00000410  69 74 6c 65 20 73 74 72  69 6e 67 20 6f 66 66 73  |itle string offs|
00000420  65 74 0d 01 86 33 20 20  20 45 51 55 44 20 6d 6f  |et...3   EQUD mo|
00000430  64 75 6c 65 5f 68 65 6c  70 20 20 20 20 20 20 20  |dule_help       |
00000440  20 3b 20 48 65 6c 70 20  73 74 72 69 6e 67 20 6f  | ; Help string o|
00000450  66 66 73 65 74 0d 01 90  46 20 20 20 45 51 55 44  |ffset...F   EQUD|
00000460  20 6d 6f 64 75 6c 65 5f  63 6f 6d 6d 61 6e 64 73  | module_commands|
00000470  20 20 20 20 3b 20 48 65  6c 70 20 61 6e 64 20 63  |    ; Help and c|
00000480  6f 6d 6d 61 6e 64 20 6b  65 79 77 6f 72 64 20 74  |ommand keyword t|
00000490  61 62 6c 65 20 6f 66 66  73 65 74 0d 01 9a 36 20  |able offset...6 |
000004a0  20 20 45 51 55 44 20 26  43 30 34 38 30 20 20 20  |  EQUD &C0480   |
000004b0  20 20 20 20 20 20 20 20  20 20 3b 20 53 57 49 20  |          ; SWI |
000004c0  63 68 75 6e 6b 20 62 61  73 65 20 6e 75 6d 62 65  |chunk base numbe|
000004d0  72 0d 01 a4 38 20 20 20  45 51 55 44 20 6d 6f 64  |r...8   EQUD mod|
000004e0  75 6c 65 5f 73 77 69 63  6f 64 65 20 20 20 20 20  |ule_swicode     |
000004f0  3b 20 53 57 49 20 68 61  6e 64 6c 65 72 20 63 6f  |; SWI handler co|
00000500  64 65 20 6f 66 66 73 65  74 0d 01 ae 3a 20 20 20  |de offset...:   |
00000510  45 51 55 44 20 6d 6f 64  75 6c 65 5f 73 77 69 74  |EQUD module_swit|
00000520  61 62 6c 65 20 20 20 20  3b 20 53 57 49 20 64 65  |able    ; SWI de|
00000530  63 6f 64 69 6e 67 20 74  61 62 6c 65 20 6f 66 66  |coding table off|
00000540  73 65 74 0d 01 b8 39 20  20 20 45 51 55 44 20 30  |set...9   EQUD 0|
00000550  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000560  20 20 3b 20 53 57 49 20  64 65 63 6f 64 69 6e 67  |  ; SWI decoding|
00000570  20 63 6f 64 65 20 6f 66  66 73 65 74 0d 01 c2 05  | code offset....|
00000580  3a 0d 01 cc 11 2e 6d 6f  64 75 6c 65 5f 74 69 74  |:.....module_tit|
00000590  6c 65 0d 01 d6 1f 20 20  20 45 51 55 53 20 22 57  |le....   EQUS "W|
000005a0  69 6d 70 52 65 73 69 7a  65 49 63 6f 6e 22 2b bd  |impResizeIcon"+.|
000005b0  30 0d 01 e0 0c 20 20 20  41 4c 49 47 4e 0d 01 ea  |0....   ALIGN...|
000005c0  05 3a 0d 01 f4 10 2e 6d  6f 64 75 6c 65 5f 68 65  |.:.....module_he|
000005d0  6c 70 0d 01 fe 4b 20 20  20 45 51 55 53 20 22 57  |lp...K   EQUS "W|
000005e0  69 6d 70 52 65 73 69 7a  65 49 63 6f 6e 22 2b bd  |impResizeIcon"+.|
000005f0  39 2b 22 31 2e 30 30 20  28 22 2b c1 91 24 2c 35  |9+"1.00 ("+..$,5|
00000600  2c 31 31 29 2b 22 29 20  a9 20 4a 75 73 74 69 6e  |,11)+") . Justin|
00000610  20 46 6c 65 74 63 68 65  72 22 2b bd 30 0d 02 08  | Fletcher"+.0...|
00000620  0c 20 20 20 41 4c 49 47  4e 0d 02 12 05 3a 0d 02  |.   ALIGN....:..|
00000630  1c 10 2e 6d 6f 64 75 6c  65 5f 69 6e 69 74 0d 02  |...module_init..|
00000640  26 37 20 20 20 53 54 4d  46 44 20 20 20 28 73 70  |&7   STMFD   (sp|
00000650  29 21 2c 7b 72 30 2d 72  34 2c 6c 69 6e 6b 7d 20  |)!,{r0-r4,link} |
00000660  20 20 20 20 3b 20 53 74  61 63 6b 20 72 65 67 69  |    ; Stack regi|
00000670  73 74 65 72 73 0d 02 30  14 20 20 20 4d 4f 56 20  |sters..0.   MOV |
00000680  20 20 20 20 72 30 2c 23  36 0d 02 3a 1f 20 a4 4c  |    r0,#6..:. .L|
00000690  4d 4f 56 28 22 22 2c 33  2c 60 6c 65 6e 5f 77 6f  |MOV("",3,`len_wo|
000006a0  72 6b 73 70 61 63 65 29  0d 02 44 3f 20 20 20 53  |rkspace)..D?   S|
000006b0  57 49 20 20 20 20 20 22  58 4f 53 5f 4d 6f 64 75  |WI     "XOS_Modu|
000006c0  6c 65 22 20 20 20 20 20  20 20 20 20 20 20 3b 20  |le"           ; |
000006d0  43 6c 61 69 6d 20 70 72  69 76 61 74 65 20 77 6f  |Claim private wo|
000006e0  72 6b 73 70 61 63 65 0d  02 4e 3a 20 20 20 41 44  |rkspace..N:   AD|
000006f0  44 56 53 20 20 20 73 70  2c 73 70 2c 23 34 20 20  |DVS   sp,sp,#4  |
00000700  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |             ; i|
00000710  66 20 65 72 72 6f 72 20  72 65 74 75 72 6e 20 72  |f error return r|
00000720  30 0d 02 58 34 20 20 20  4c 44 4d 56 53 46 44 20  |0..X4   LDMVSFD |
00000730  28 73 70 29 21 2c 7b 72  31 2d 72 34 2c 70 63 7d  |(sp)!,{r1-r4,pc}|
00000740  20 20 20 20 20 20 20 3b  20 72 65 74 75 72 6e 20  |       ; return |
00000750  65 72 72 6f 72 0d 02 62  3d 20 20 20 53 54 52 20  |error..b=   STR |
00000760  20 20 20 20 72 32 2c 5b  72 31 32 5d 20 20 20 20  |    r2,[r12]    |
00000770  20 20 20 20 20 20 20 20  20 20 20 3b 20 73 74 6f  |           ; sto|
00000780  72 65 20 69 6e 20 70 72  69 76 61 74 65 20 77 6f  |re in private wo|
00000790  72 64 0d 02 6c 31 20 20  20 4d 4f 56 20 20 20 20  |rd..l1   MOV    |
000007a0  20 72 31 32 2c 72 32 20  20 20 20 20 20 20 20 20  | r12,r2         |
000007b0  20 20 20 20 20 20 20 20  3b 20 72 31 32 3d 73 70  |        ; r12=sp|
000007c0  61 63 65 0d 02 76 39 20  20 20 4c 44 4d 46 44 20  |ace..v9   LDMFD |
000007d0  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 34 2c 70  |  (sp)!,{r0-r4,p|
000007e0  63 7d 20 20 20 20 20 20  20 3b 20 72 65 73 74 6f  |c}       ; resto|
000007f0  72 65 20 72 65 67 69 73  74 65 72 73 0d 02 80 05  |re registers....|
00000800  3a 0d 02 8a 11 2e 6d 6f  64 75 6c 65 5f 66 69 6e  |:.....module_fin|
00000810  61 6c 0d 02 94 37 20 20  20 53 54 4d 46 44 20 20  |al...7   STMFD  |
00000820  20 28 73 70 29 21 2c 7b  72 30 2d 72 34 2c 72 31  | (sp)!,{r0-r4,r1|
00000830  32 2c 6c 69 6e 6b 7d 20  3b 20 53 74 61 63 6b 20  |2,link} ; Stack |
00000840  72 65 67 69 73 74 65 72  73 0d 02 9e 18 20 20 20  |registers....   |
00000850  4c 44 52 20 20 20 20 20  72 31 32 2c 5b 72 31 32  |LDR     r12,[r12|
00000860  5d 0d 02 a8 14 20 20 20  4d 4f 56 20 20 20 20 20  |]....   MOV     |
00000870  72 30 2c 23 37 0d 02 b2  15 20 20 20 4d 4f 56 20  |r0,#7....   MOV |
00000880  20 20 20 20 72 32 2c 72  31 32 0d 02 bc 39 20 20  |    r2,r12...9  |
00000890  20 53 57 49 20 20 20 20  20 22 58 4f 53 5f 4d 6f  | SWI     "XOS_Mo|
000008a0  64 75 6c 65 22 20 20 20  20 20 20 20 20 20 20 20  |dule"           |
000008b0  3b 20 52 65 6c 65 61 73  65 20 77 6f 72 6b 73 70  |; Release worksp|
000008c0  61 63 65 0d 02 c6 17 20  20 20 41 44 44 56 53 20  |ace....   ADDVS |
000008d0  20 20 73 70 2c 73 70 2c  23 34 0d 02 d0 37 20 20  |  sp,sp,#4...7  |
000008e0  20 4c 44 4d 56 53 46 44  20 28 73 70 29 21 2c 7b  | LDMVSFD (sp)!,{|
000008f0  72 31 2d 72 34 2c 72 31  32 2c 70 63 7d 20 20 20  |r1-r4,r12,pc}   |
00000900  3b 20 52 65 74 75 72 6e  20 69 66 20 65 72 72 6f  |; Return if erro|
00000910  72 0d 02 da 2e 20 20 20  4c 44 4d 46 44 20 20 20  |r....   LDMFD   |
00000920  28 73 70 29 21 2c 7b 72  30 2d 72 34 2c 72 31 32  |(sp)!,{r0-r4,r12|
00000930  2c 70 63 7d 20 20 20 3b  20 52 65 74 75 72 6e 0d  |,pc}   ; Return.|
00000940  02 e4 05 3a 0d 02 ee 21  3b 20 2a 2a 2a 2a 2a 20  |...:...!; ***** |
00000950  4d 6f 64 75 6c 65 20 63  6f 6d 6d 61 6e 64 73 20  |Module commands |
00000960  74 61 62 6c 65 0d 02 f8  14 2e 6d 6f 64 75 6c 65  |table.....module|
00000970  5f 63 6f 6d 6d 61 6e 64  73 0d 03 02 2d 20 20 20  |_commands...-   |
00000980  45 51 55 53 20 22 57 69  6d 70 52 65 73 69 7a 65  |EQUS "WimpResize|
00000990  49 63 6f 6e 22 20 20 20  3b 20 43 6f 6d 6d 61 6e  |Icon"   ; Comman|
000009a0  64 20 6e 61 6d 65 0d 03  0c 13 20 20 20 45 51 55  |d name....   EQU|
000009b0  42 20 30 3a 41 4c 49 47  4e 0d 03 16 2d 20 20 20  |B 0:ALIGN...-   |
000009c0  45 51 55 44 20 30 20 20  20 20 20 20 20 20 20 20  |EQUD 0          |
000009d0  20 20 20 20 20 20 20 20  3b 20 43 6f 64 65 20 74  |        ; Code t|
000009e0  6f 20 63 61 6c 6c 0d 03  20 26 20 20 20 45 51 55  |o call.. &   EQU|
000009f0  44 20 26 30 20 20 20 20  20 20 20 20 20 20 20 20  |D &0            |
00000a00  20 20 20 20 20 3b 20 46  6c 61 67 73 0d 03 2a 2f  |     ; Flags..*/|
00000a10  20 20 20 45 51 55 44 20  30 20 20 20 20 20 20 20  |   EQUD 0       |
00000a20  20 20 20 20 20 20 20 20  20 20 20 3b 20 53 79 6e  |           ; Syn|
00000a30  74 61 78 20 70 6f 69 6e  74 65 72 0d 03 34 2e 20  |tax pointer..4. |
00000a40  20 20 45 51 55 44 20 68  65 6c 70 5f 77 69 6d 70  |  EQUD help_wimp|
00000a50  72 65 73 69 7a 65 69 63  6f 6e 20 3b 20 48 65 6c  |resizeicon ; Hel|
00000a60  70 20 70 6f 69 6e 74 65  72 0d 03 3e 0d 20 20 20  |p pointer..>.   |
00000a70  45 51 55 42 20 30 0d 03  48 0c 20 20 20 41 4c 49  |EQUB 0..H.   ALI|
00000a80  47 4e 0d 03 52 05 3a 0d  03 5c 24 3b 20 2a 2a 2a  |GN..R.:..\$; ***|
00000a90  2a 2a 20 48 65 6c 70 20  61 6e 64 20 53 79 6e 74  |** Help and Synt|
00000aa0  61 78 20 6d 65 73 73 61  67 65 73 0d 03 66 18 2e  |ax messages..f..|
00000ab0  68 65 6c 70 5f 77 69 6d  70 72 65 73 69 7a 65 69  |help_wimpresizei|
00000ac0  63 6f 6e 0d 03 70 50 20  20 20 45 51 55 53 20 22  |con..pP   EQUS "|
00000ad0  57 69 6d 70 52 65 73 69  7a 65 49 63 6f 6e 20 70  |WimpResizeIcon p|
00000ae0  72 6f 76 69 64 65 73 20  74 68 65 20 57 69 6d 70  |rovides the Wimp|
00000af0  48 61 63 6b 5f 52 65 73  69 7a 65 49 63 6f 6e 20  |Hack_ResizeIcon |
00000b00  63 61 6c 6c 20 77 68 69  63 68 20 61 6c 6c 6f 77  |call which allow|
00000b10  73 20 22 0d 03 7a 50 20  20 20 45 51 55 53 20 22  |s "..zP   EQUS "|
00000b20  6e 6f 72 6d 61 6c 20 70  65 6f 70 6c 65 20 74 6f  |normal people to|
00000b30  20 67 65 74 20 61 72 6f  75 6e 64 20 74 68 65 20  | get around the |
00000b40  62 75 67 20 77 68 65 72  65 20 52 4f 33 2e 35 20  |bug where RO3.5 |
00000b50  70 72 6f 67 72 61 6d 6d  65 72 73 20 73 74 69 63  |programmers stic|
00000b60  6b 20 22 0d 03 84 4f 20  20 20 45 51 55 53 20 22  |k "...O   EQUS "|
00000b70  63 61 6c 6c 73 20 69 6e  20 74 6f 20 52 4f 33 2e  |calls in to RO3.|
00000b80  35 20 6f 6e 6c 79 20 63  6f 64 65 20 77 68 69 63  |5 only code whic|
00000b90  68 20 77 6f 75 6c 64 20  6f 74 68 65 72 77 69 73  |h would otherwis|
00000ba0  65 20 77 6f 72 6b 20 70  65 72 66 65 63 74 6c 79  |e work perfectly|
00000bb0  20 22 0d 03 8e 2f 20 20  20 45 51 55 53 20 22 77  | ".../   EQUS "w|
00000bc0  65 6c 6c 20 6f 6e 20 6f  6c 64 65 72 20 76 65 72  |ell on older ver|
00000bd0  73 69 6f 6e 73 20 6f 66  20 52 4f 2e 22 2b bd 31  |sions of RO."+.1|
00000be0  33 0d 03 98 41 20 20 20  45 51 55 53 20 22 49 20  |3...A   EQUS "I |
00000bf0  73 68 61 6c 6c 6e 27 74  20 6d 65 6e 74 69 6f 6e  |shalln't mention|
00000c00  20 74 68 65 20 6f 74 68  65 72 20 73 69 6c 6c 79  | the other silly|
00000c10  20 74 68 69 6e 67 73 20  74 68 65 79 20 64 6f 8c  | things they do.|
00000c20  20 22 0d 03 a2 0d 20 20  20 45 51 55 42 20 30 0d  | "....   EQUB 0.|
00000c30  03 ac 0c 20 20 20 41 4c  49 47 4e 0d 03 b6 05 3a  |...   ALIGN....:|
00000c40  0d 03 c0 15 3b 20 2a 2a  2a 2a 2a 20 53 57 49 20  |....; ***** SWI |
00000c50  74 61 62 6c 65 0d 03 ca  14 2e 6d 6f 64 75 6c 65  |table.....module|
00000c60  5f 73 77 69 74 61 62 6c  65 0d 03 d4 2b 20 20 20  |_switable...+   |
00000c70  45 51 55 53 20 22 57 69  6d 70 48 61 63 6b 22 20  |EQUS "WimpHack" |
00000c80  20 20 20 20 20 20 20 20  3b 20 53 57 49 20 70 72  |        ; SWI pr|
00000c90  65 66 69 78 0d 03 de 0d  20 20 20 45 51 55 42 20  |efix....   EQUB |
00000ca0  30 0d 03 e8 1b 20 20 20  45 51 55 53 20 22 52 65  |0....   EQUS "Re|
00000cb0  73 69 7a 65 49 63 6f 6e  22 2b bd 30 0d 03 f2 0d  |sizeIcon"+.0....|
00000cc0  20 20 20 45 51 55 42 20  30 0d 03 fc 0c 20 20 20  |   EQUB 0....   |
00000cd0  41 4c 49 47 4e 0d 04 06  05 3a 0d 04 10 1c 3b 20  |ALIGN....:....; |
00000ce0  2a 2a 2a 2a 2a 20 53 57  49 20 68 61 6e 64 6c 65  |***** SWI handle|
00000cf0  72 20 63 6f 64 65 0d 04  1a 13 2e 6d 6f 64 75 6c  |r code.....modul|
00000d00  65 5f 73 77 69 63 6f 64  65 0d 04 24 18 20 20 20  |e_swicode..$.   |
00000d10  4c 44 52 20 20 20 20 20  72 31 32 2c 5b 72 31 32  |LDR     r12,[r12|
00000d20  5d 0d 04 2e 15 20 20 20  43 4d 50 20 20 20 20 20  |]....   CMP     |
00000d30  72 31 31 2c 23 31 0d 04  38 1f 20 20 20 41 44 44  |r11,#1..8.   ADD|
00000d40  4c 54 20 20 20 70 63 2c  70 63 2c 72 31 31 2c 4c  |LT   pc,pc,r11,L|
00000d50  53 4c 20 23 32 0d 04 42  1e 20 20 20 42 20 20 20  |SL #2..B.   B   |
00000d60  20 20 20 20 6d 6f 64 75  6c 65 5f 73 77 69 65 72  |    module_swier|
00000d70  72 6f 72 0d 04 4c 1a 3b  20 2a 2a 2a 2a 2a 20 53  |ror..L.; ***** S|
00000d80  57 49 20 6a 75 6d 70 20  74 61 62 6c 65 0d 04 56  |WI jump table..V|
00000d90  18 20 20 20 42 20 20 20  20 20 20 72 65 73 69 7a  |.   B      resiz|
00000da0  65 69 63 6f 6e 0d 04 60  14 2e 6d 6f 64 75 6c 65  |eicon..`..module|
00000db0  5f 73 77 69 65 72 72 6f  72 0d 04 6a 22 20 20 20  |_swierror..j"   |
00000dc0  41 44 52 20 20 20 20 20  72 30 2c 60 6d 6f 64 75  |ADR     r0,`modu|
00000dd0  6c 65 5f 73 77 69 65 72  72 6f 72 0d 04 74 3a 20  |le_swierror..t: |
00000de0  20 20 84 52 53 20 20 20  20 70 63 2c 6c 69 6e 6b  |  .RS    pc,link|
00000df0  2c 23 76 62 69 74 20 20  20 20 20 20 20 20 3b 20  |,#vbit        ; |
00000e00  73 65 74 20 56 20 66 6c  61 67 20 61 6e 64 20 72  |set V flag and r|
00000e10  65 74 75 72 6e 0d 04 7e  15 2e 60 6d 6f 64 75 6c  |eturn..~..`modul|
00000e20  65 5f 73 77 69 65 72 72  6f 72 0d 04 88 13 20 20  |e_swierror....  |
00000e30  20 45 51 55 44 20 20 20  20 26 31 45 36 0d 04 92  | EQUD    &1E6...|
00000e40  43 20 20 20 45 51 55 53  20 20 20 20 22 53 57 49  |C   EQUS    "SWI|
00000e50  20 63 6f 64 65 20 6f 75  74 20 6f 66 20 72 61 6e  | code out of ran|
00000e60  67 65 20 66 6f 72 20 6d  6f 64 75 6c 65 20 57 69  |ge for module Wi|
00000e70  6d 70 52 65 73 69 7a 65  49 63 6f 6e 22 2b bd 30  |mpResizeIcon"+.0|
00000e80  0d 04 9c 0c 20 20 20 41  4c 49 47 4e 0d 04 a6 05  |....   ALIGN....|
00000e90  3a 0d 04 b0 2e 20 20 20  20 20 20 20 20 20 20 3b  |:....          ;|
00000ea0  20 2a 2a 2a 2a 20 45 6e  64 20 6f 66 20 6d 6f 64  | **** End of mod|
00000eb0  75 6c 65 20 68 65 61 64  65 72 20 2a 2a 2a 2a 0d  |ule header ****.|
00000ec0  04 ba 05 3a 0d 04 c4 0f  2e 72 65 73 69 7a 65 69  |...:.....resizei|
00000ed0  63 6f 6e 0d 04 ce 3e 20  20 20 53 54 4d 46 44 20  |con...>   STMFD |
00000ee0  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 37 2c 6c  |  (sp)!,{r0-r7,l|
00000ef0  69 6e 6b 7d 20 20 20 20  20 20 20 20 20 20 20 20  |ink}            |
00000f00  3b 20 53 74 61 63 6b 20  72 65 67 69 73 74 65 72  |; Stack register|
00000f10  73 0d 04 d8 46 20 20 20  20 20 20 20 20 20 20 3b  |s...F          ;|
00000f20  20 22 25 63 30 34 25 63  33 30 53 74 61 72 74 69  | "%c04%c30Starti|
00000f30  6e 67 20 72 65 63 72 65  61 74 69 6f 6e 20 66 6f  |ng recreation fo|
00000f40  72 20 77 69 6e 64 6f 77  20 25 26 30 2c 20 69 63  |r window %&0, ic|
00000f50  6f 6e 20 25 72 31 22 0d  04 e2 39 20 20 20 20 20  |on %r1"...9     |
00000f60  20 20 20 20 20 20 3b 20  66 69 72 73 74 20 77 65  |      ; first we|
00000f70  20 6e 65 65 64 20 74 6f  20 73 74 6f 72 65 20 74  | need to store t|
00000f80  68 65 20 64 65 74 61 69  6c 73 20 67 69 76 65 6e  |he details given|
00000f90  0d 04 ec 46 20 20 20 4d  4f 56 20 20 20 20 20 72  |...F   MOV     r|
00000fa0  36 2c 73 70 20 20 20 20  20 20 20 20 20 20 20 20  |6,sp            |
00000fb0  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 69  |             ; i|
00000fc0  6e 20 63 61 73 65 20 77  65 20 68 61 76 65 20 74  |n case we have t|
00000fd0  6f 20 65 78 69 74 0d 04  f6 4b 20 20 20 20 20 20  |o exit...K      |
00000fe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00001000  20 20 20 3b 20 70 72 65  6d 61 74 75 72 65 6c 79  |   ; prematurely|
00001010  2c 20 73 74 6f 72 65 20  73 74 61 63 6b 20 70 74  |, store stack pt|
00001020  72 0d 05 00 4c 20 20 20  4d 4f 56 20 20 20 20 20  |r...L   MOV     |
00001030  72 37 2c 72 31 20 20 20  20 20 20 20 20 20 20 20  |r7,r1           |
00001040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00001050  72 37 20 3d 20 69 63 6f  6e 20 6e 75 6d 62 65 72  |r7 = icon number|
00001060  20 74 6f 20 72 65 2d 63  72 65 61 74 65 0d 05 0a  | to re-create...|
00001070  20 20 20 20 53 54 52 20  20 20 20 20 72 30 2c 5b  |    STR     r0,[|
00001080  72 31 32 2c 23 60 64 65  6c 77 69 6e 5d 0d 05 14  |r12,#`delwin]...|
00001090  29 20 20 20 20 20 20 20  20 20 20 3b 20 73 74 6f  |)          ; sto|
000010a0  72 65 20 77 69 6e 20 69  6e 20 64 65 6c 65 74 65  |re win in delete|
000010b0  20 62 6c 6f 63 6b 0d 05  1e 2d 20 20 20 20 20 20  | block...-      |
000010c0  20 20 20 20 20 3b 20 72  65 61 64 20 74 68 65 20  |     ; read the |
000010d0  64 61 74 61 20 61 62 6f  75 74 20 74 68 65 20 69  |data about the i|
000010e0  63 6f 6e 0d 05 28 4a 20  20 20 53 54 4d 49 41 20  |con..(J   STMIA |
000010f0  20 20 72 31 32 2c 7b 72  30 2c 72 31 7d 20 20 20  |  r12,{r0,r1}   |
00001100  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001110  3b 20 73 74 6f 72 65 20  77 69 6e 20 61 6e 64 20  |; store win and |
00001120  69 63 6f 6e 20 69 6e 20  62 6c 6f 63 6b 0d 05 32  |icon in block..2|
00001130  23 20 20 20 20 20 20 20  20 20 20 3b 20 22 47 65  |#          ; "Ge|
00001140  74 74 69 6e 67 20 69 63  6f 6e 20 64 61 74 61 22  |tting icon data"|
00001150  0d 05 3c 44 20 20 20 4d  4f 56 20 20 20 20 20 72  |..<D   MOV     r|
00001160  31 2c 72 31 32 20 20 20  20 20 20 20 20 20 20 20  |1,r12           |
00001170  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 67  |             ; g|
00001180  65 74 20 74 68 65 20 62  6c 6f 63 6b 20 70 6f 69  |et the block poi|
00001190  6e 74 65 72 0d 05 46 4b  20 20 20 53 57 49 20 20  |nter..FK   SWI  |
000011a0  20 20 20 22 58 57 69 6d  70 5f 47 65 74 49 63 6f  |   "XWimp_GetIco|
000011b0  6e 53 74 61 74 65 22 20  20 20 20 20 20 20 20 20  |nState"         |
000011c0  20 3b 20 66 69 6e 64 20  6f 75 74 20 74 68 65 20  | ; find out the |
000011d0  6f 6c 64 20 62 6c 6f 63  6b 73 20 64 61 74 61 0d  |old blocks data.|
000011e0  05 50 4d 20 20 20 4c 44  4d 46 44 20 20 20 28 73  |.PM   LDMFD   (s|
000011f0  70 29 2c 7b 72 30 2d 72  35 7d 20 20 20 20 20 20  |p),{r0-r5}      |
00001200  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 6e 6f  |            ; no|
00001210  77 20 72 65 61 64 20 62  61 63 6b 20 74 68 65 20  |w read back the |
00001220  6e 65 77 20 6c 6f 63 61  74 69 6f 6e 0d 05 5a 4a  |new location..ZJ|
00001230  20 20 20 53 54 4d 49 41  20 20 20 72 31 32 2c 7b  |   STMIA   r12,{|
00001240  72 30 2d 72 35 7d 20 20  20 20 20 20 20 20 20 20  |r0-r5}          |
00001250  20 20 20 20 20 20 20 20  20 3b 20 61 6e 64 20 73  |         ; and s|
00001260  74 6f 72 65 20 69 6e 20  74 68 65 20 73 61 66 65  |tore in the safe|
00001270  20 62 6c 6f 63 6b 0d 05  64 27 20 20 20 20 20 20  | block..d'      |
00001280  20 20 20 20 20 3b 20 6e  6f 77 20 74 6f 20 64 65  |     ; now to de|
00001290  6c 65 74 65 20 74 68 65  20 69 63 6f 6e 0d 05 6e  |lete the icon..n|
000012a0  1f 20 20 20 20 20 20 20  20 20 20 3b 20 22 44 65  |.          ; "De|
000012b0  6c 65 74 69 6e 67 20 69  63 6f 6e 22 0d 05 78 44  |leting icon"..xD|
000012c0  20 20 20 4d 4f 56 20 20  20 20 20 72 31 2c 72 31  |   MOV     r1,r1|
000012d0  32 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2               |
000012e0  20 20 20 20 20 20 20 20  20 3b 20 67 65 74 20 74  |         ; get t|
000012f0  68 65 20 62 6c 6f 63 6b  20 70 6f 69 6e 74 65 72  |he block pointer|
00001300  0d 05 82 3e 20 20 20 53  57 49 20 20 20 20 20 22  |...>   SWI     "|
00001310  58 57 69 6d 70 5f 44 65  6c 65 74 65 49 63 6f 6e  |XWimp_DeleteIcon|
00001320  22 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 64  |"            ; d|
00001330  65 6c 65 74 65 20 74 68  65 20 69 63 6f 6e 0d 05  |elete the icon..|
00001340  8c 4b 20 20 20 42 56 53  20 20 20 20 20 5f 5f 7a  |.K   BVS     __z|
00001350  30 5f 65 78 69 74 20 20  20 20 20 20 20 20 20 20  |0_exit          |
00001360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00001370  20 65 78 69 74 20 67 72  61 63 65 66 75 6c 6c 79  | exit gracefully|
00001380  20 69 66 20 65 72 72 6f  72 0d 05 96 31 20 20 20  | if error...1   |
00001390  20 20 20 20 20 20 20 20  3b 20 61 6e 64 20 74 68  |        ; and th|
000013a0  65 6e 20 63 72 65 61 74  65 20 6c 6f 74 73 20 6f  |en create lots o|
000013b0  66 20 69 63 6f 6e 73 2e  2e 2e 0d 05 a0 19 20 20  |f icons.......  |
000013c0  20 20 20 20 20 20 20 20  3b 20 22 44 65 6c 65 74  |        ; "Delet|
000013d0  65 64 22 0d 05 aa 47 20  20 20 4d 56 4e 20 20 20  |ed"...G   MVN   |
000013e0  20 20 72 32 2c 23 ac 20  2d 31 20 20 20 20 20 20  |  r2,#. -1      |
000013f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00001400  75 73 65 20 2d 31 20 74  6f 20 6d 61 72 6b 20 65  |use -1 to mark e|
00001410  6e 64 20 6f 66 20 6c 69  73 74 0d 05 b4 3a 20 20  |nd of list...:  |
00001420  20 53 54 4d 46 44 20 20  20 28 73 70 29 21 2c 7b  | STMFD   (sp)!,{|
00001430  72 32 7d 20 20 20 20 20  20 20 20 20 20 20 20 20  |r2}             |
00001440  20 20 20 20 20 20 20 3b  20 73 74 61 63 6b 20 76  |       ; stack v|
00001450  61 6c 75 65 0d 05 be 1d  20 20 20 4c 44 52 20 20  |alue....   LDR  |
00001460  20 20 20 72 30 2c 5b 72  31 32 2c 23 60 77 69 6e  |   r0,[r12,#`win|
00001470  5d 0d 05 c8 22 20 20 20  20 20 20 20 20 20 20 3b  |]..."          ;|
00001480  20 72 65 61 64 20 77 69  6e 64 6f 77 20 68 61 6e  | read window han|
00001490  64 6c 65 0d 05 d2 1e 20  20 20 53 54 52 20 20 20  |dle....   STR   |
000014a0  20 20 72 30 2c 5b 72 31  32 2c 23 60 69 63 6f 6e  |  r0,[r12,#`icon|
000014b0  5d 0d 05 dc 32 20 20 20  20 20 20 20 20 20 20 3b  |]...2          ;|
000014c0  20 73 74 6f 72 65 20 77  69 6e 64 6f 77 20 68 61  | store window ha|
000014d0  6e 64 6c 65 20 61 74 20  62 6c 6f 63 6b 20 73 74  |ndle at block st|
000014e0  61 72 74 0d 05 e6 14 2e  5f 5f 7a 30 5f 63 72 65  |art.....__z0_cre|
000014f0  61 74 65 6c 6f 6f 70 0d  05 f0 1b 20 a4 4c 41 44  |ateloop.... .LAD|
00001500  44 28 22 20 20 22 2c 31  2c 31 32 2c 60 69 63 6f  |D("  ",1,12,`ico|
00001510  6e 29 0d 05 fa 2b 20 20  20 20 20 20 20 20 20 20  |n)...+          |
00001520  3b 20 67 65 74 20 70 6f  69 6e 74 65 72 20 74 6f  |; get pointer to|
00001530  20 63 72 65 61 74 65 20  62 6c 6f 63 6b 0d 06 04  | create block...|
00001540  2f 20 20 20 20 20 20 20  20 20 20 3b 20 22 54 72  |/          ; "Tr|
00001550  79 69 6e 67 20 74 6f 20  63 72 65 61 74 65 2c 20  |ying to create, |
00001560  62 6c 6f 63 6b 20 3d 20  25 26 31 22 0d 06 0e 16  |block = %&1"....|
00001570  20 20 20 4c 44 52 20 20  20 20 20 72 32 2c 5b 72  |   LDR     r2,[r|
00001580  31 5d 0d 06 18 1b 20 20  20 20 20 20 20 20 20 20  |1]....          |
00001590  3b 20 22 57 69 6e 20 3d  20 25 26 32 22 0d 06 22  |; "Win = %&2".."|
000015a0  3e 20 20 20 53 57 49 20  20 20 20 20 22 58 57 69  |>   SWI     "XWi|
000015b0  6d 70 5f 43 72 65 61 74  65 49 63 6f 6e 22 20 20  |mp_CreateIcon"  |
000015c0  20 20 20 20 20 20 20 20  20 20 3b 20 63 72 65 61  |          ; crea|
000015d0  74 65 20 74 68 65 20 69  63 6f 6e 0d 06 2c 4b 20  |te the icon..,K |
000015e0  20 20 42 56 53 20 20 20  20 20 5f 5f 7a 30 5f 65  |  BVS     __z0_e|
000015f0  78 69 74 20 20 20 20 20  20 20 20 20 20 20 20 20  |xit             |
00001600  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 65 78  |            ; ex|
00001610  69 74 20 67 72 61 63 65  66 75 6c 6c 79 20 69 66  |it gracefully if|
00001620  20 65 72 72 6f 72 0d 06  36 24 20 20 20 20 20 20  | error..6$      |
00001630  20 20 20 20 3b 20 22 43  72 65 61 74 65 64 20 69  |    ; "Created i|
00001640  63 6f 6e 20 3d 20 25 72  30 22 0d 06 40 4b 20 20  |con = %r0"..@K  |
00001650  20 43 4d 50 20 20 20 20  20 72 30 2c 72 37 20 20  | CMP     r0,r7  |
00001660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001670  20 20 20 20 20 20 20 3b  20 68 61 76 65 20 77 65  |       ; have we|
00001680  20 66 6f 75 6e 64 20 74  68 65 20 69 63 6f 6e 20  | found the icon |
00001690  79 65 74 20 3f 0d 06 4a  4e 20 20 20 53 54 4d 4c  |yet ?..JN   STML|
000016a0  54 46 44 20 28 73 70 29  21 2c 7b 72 30 7d 20 20  |TFD (sp)!,{r0}  |
000016b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000016c0  20 20 3b 20 69 66 20 6e  6f 74 2c 20 73 74 61 63  |  ; if not, stac|
000016d0  6b 20 74 68 65 20 69 63  6f 6e 20 6e 75 6d 62 65  |k the icon numbe|
000016e0  72 20 8c 0d 06 54 42 20  20 20 42 4c 54 20 20 20  |r ...TB   BLT   |
000016f0  20 20 5f 5f 7a 30 5f 63  72 65 61 74 65 6c 6f 6f  |  __z0_createloo|
00001700  70 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |p               |
00001710  20 20 20 20 3b 20 8c 20  61 6e 64 20 74 72 79 20  |    ; . and try |
00001720  61 67 61 69 6e 0d 06 5e  4d 20 20 20 20 20 20 20  |again..^M       |
00001730  20 20 20 20 3b 20 77 65  27 76 65 20 66 6f 75 6e  |    ; we've foun|
00001740  64 20 74 68 65 20 69 63  6f 6e 20 77 65 20 72 65  |d the icon we re|
00001750  61 6c 6c 79 20 77 61 6e  74 65 64 2c 20 73 6f 20  |ally wanted, so |
00001760  6e 6f 77 20 77 65 20 6d  75 73 74 20 64 65 6c 65  |now we must dele|
00001770  74 65 0d 06 68 20 20 20  20 20 20 20 20 20 20 20  |te..h           |
00001780  20 3b 20 61 6c 6c 20 74  68 65 20 72 75 62 62 69  | ; all the rubbi|
00001790  73 68 0d 06 72 05 3a 0d  06 7c 2b 20 20 20 20 20  |sh..r.:..|+     |
000017a0  20 20 20 20 20 3b 20 22  4e 6f 77 20 74 6f 20 64  |     ; "Now to d|
000017b0  65 6c 65 74 65 20 74 68  65 20 72 75 62 62 69 73  |elete the rubbis|
000017c0  68 22 0d 06 86 1d 20 a4  4c 41 44 44 28 22 20 20  |h".... .LADD("  |
000017d0  22 2c 31 2c 31 32 2c 60  64 65 6c 77 69 6e 29 0d  |",1,12,`delwin).|
000017e0  06 90 2b 20 20 20 20 20  20 20 20 20 20 3b 20 67  |..+          ; g|
000017f0  65 74 20 70 6f 69 6e 74  65 72 20 74 6f 20 64 65  |et pointer to de|
00001800  6c 65 74 65 20 62 6c 6f  63 6b 0d 06 9a 14 2e 5f  |lete block....._|
00001810  5f 7a 30 5f 64 65 6c 65  74 65 6c 6f 6f 70 0d 06  |_z0_deleteloop..|
00001820  a4 3f 20 20 20 4c 44 4d  46 44 20 20 20 28 73 70  |.?   LDMFD   (sp|
00001830  29 21 2c 7b 72 30 7d 20  20 20 20 20 20 20 20 20  |)!,{r0}         |
00001840  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 65 61  |           ; rea|
00001850  64 20 69 63 6f 6e 20 6e  75 6d 62 65 72 0d 06 ae  |d icon number...|
00001860  21 20 20 20 20 20 20 20  20 20 20 3b 20 22 52 65  |!          ; "Re|
00001870  61 64 20 6e 75 6d 62 65  72 20 25 72 30 22 0d 06  |ad number %r0"..|
00001880  b8 46 20 20 20 43 4d 4e  20 20 20 20 20 72 30 2c  |.F   CMN     r0,|
00001890  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
000018a0  20 20 20 20 20 20 20 20  20 20 20 3b 20 69 73 20  |           ; is |
000018b0  69 74 20 2d 31 20 28 65  6e 64 20 6d 61 72 6b 65  |it -1 (end marke|
000018c0  72 29 20 3f 0d 06 c2 46  20 20 20 42 45 51 20 20  |r) ?...F   BEQ  |
000018d0  20 20 20 5f 5f 7a 30 5f  6c 61 73 74 69 63 6f 6e  |   __z0_lasticon|
000018e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000018f0  20 20 20 20 20 3b 20 69  66 20 73 6f 2c 20 77 65  |     ; if so, we|
00001900  27 72 65 20 64 6f 6e 65  20 21 0d 06 cc 21 20 20  |'re done !...!  |
00001910  20 53 54 52 20 20 20 20  20 72 30 2c 5b 72 31 32  | STR     r0,[r12|
00001920  2c 23 60 64 65 6c 69 63  6f 6e 5d 0d 06 d6 2d 20  |,#`delicon]...- |
00001930  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 6e 6f  |         ; if no|
00001940  74 2c 20 73 74 6f 72 65  20 69 6e 20 64 65 6c 65  |t, store in dele|
00001950  74 65 20 62 6c 6f 63 6b  0d 06 e0 23 20 20 20 20  |te block...#    |
00001960  20 20 20 20 20 20 3b 20  22 44 65 6c 65 74 69 6e  |      ; "Deletin|
00001970  67 20 69 63 6f 6e 20 25  72 30 22 0d 06 ea 42 20  |g icon %r0"...B |
00001980  20 20 53 57 49 20 20 20  20 20 22 58 57 69 6d 70  |  SWI     "XWimp|
00001990  5f 44 65 6c 65 74 65 49  63 6f 6e 22 20 20 20 20  |_DeleteIcon"    |
000019a0  20 20 20 20 20 20 20 20  3b 20 61 6e 64 20 64 65  |        ; and de|
000019b0  6c 65 74 65 20 74 68 65  20 69 63 6f 6e 0d 06 f4  |lete the icon...|
000019c0  4b 20 20 20 42 56 53 20  20 20 20 20 5f 5f 7a 30  |K   BVS     __z0|
000019d0  5f 65 78 69 74 20 20 20  20 20 20 20 20 20 20 20  |_exit           |
000019e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000019f0  65 78 69 74 20 67 72 61  63 65 66 75 6c 6c 79 20  |exit gracefully |
00001a00  69 66 20 65 72 72 6f 72  0d 06 fe 12 2e 5f 5f 7a  |if error.....__z|
00001a10  30 5f 6c 61 73 74 69 63  6f 6e 0d 07 08 2e 20 20  |0_lasticon....  |
00001a20  20 20 20 20 20 20 20 20  20 3b 20 77 65 27 72 65  |         ; we're|
00001a30  20 61 6c 6c 20 64 6f 6e  65 20 2d 20 74 69 6d 65  | all done - time|
00001a40  20 74 6f 20 67 6f 20 21  0d 07 12 25 20 20 20 20  | to go !...%    |
00001a50  20 20 20 20 20 20 3b 20  22 53 75 63 63 65 73 73  |      ; "Success|
00001a60  20 2d 20 65 78 69 74 69  6e 67 20 21 22 0d 07 1c  | - exiting !"...|
00001a70  0e 2e 5f 5f 7a 30 5f 65  78 69 74 0d 07 26 48 20  |..__z0_exit..&H |
00001a80  20 20 4d 4f 56 20 20 20  20 20 73 70 2c 72 36 20  |  MOV     sp,r6 |
00001a90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001aa0  20 20 20 20 20 20 20 20  3b 20 72 65 73 74 6f 72  |        ; restor|
00001ab0  65 20 74 68 65 20 73 74  61 63 6b 20 70 6f 69 6e  |e the stack poin|
00001ac0  74 65 72 0d 07 30 16 20  20 20 53 54 52 56 53 20  |ter..0.   STRVS |
00001ad0  20 20 72 30 2c 5b 73 70  5d 0d 07 3a 3f 20 20 20  |  r0,[sp]..:?   |
00001ae0  4c 44 4d 46 44 20 20 20  28 73 70 29 21 2c 7b 72  |LDMFD   (sp)!,{r|
00001af0  30 2d 72 37 2c 70 63 7d  20 20 20 20 20 20 20 20  |0-r7,pc}        |
00001b00  20 20 20 20 20 20 3b 20  52 65 74 75 72 6e 20 66  |      ; Return f|
00001b10  72 6f 6d 20 63 61 6c 6c  0d 07 44 05 3a 0d 07 4e  |rom call..D.:..N|
00001b20  05 5d 0d 07 58 20 f4 20  2a 2a 2a 2a 20 45 6e 64  |.]..X . **** End|
00001b30  20 6f 66 20 6d 61 69 6e  20 63 6f 64 65 20 2a 2a  | of main code **|
00001b40  2a 2a 0d 07 62 36 f4 20  53 65 74 20 66 69 6e 61  |**..b6. Set fina|
00001b50  6c 20 70 6f 69 6e 74 65  72 20 74 6f 20 66 69 6e  |l pointer to fin|
00001b60  64 20 74 68 65 20 6c 65  6e 67 74 68 20 6f 66 20  |d the length of |
00001b70  74 68 65 20 63 6f 64 65  0d 07 6c 13 f2 70 61 74  |the code..l..pat|
00001b80  63 68 5f 73 65 74 70 63  28 30 29 0d 07 76 0b ed  |ch_setpc(0)..v..|
00001b90  20 70 61 73 73 25 0d 07  80 13 f2 70 61 74 63 68  | pass%.....patch|
00001ba0  5f 73 61 76 65 66 69 6c  65 0d 07 a8 1f ee 20 85  |_savefile..... .|
00001bb0  20 85 20 a2 20 9f 2c f6  24 2b 22 20 61 74 20 6c  | . . .,.$+" at l|
00001bc0  69 6e 65 20 22 2b c3 9e  0d 07 b2 28 f4 20 2a 2a  |ine "+.....(. **|
00001bd0  2a 2a 20 50 6f 73 74 2d  61 73 73 65 6d 62 6c 79  |** Post-assembly|
00001be0  20 75 73 65 72 20 63 6f  64 65 20 2a 2a 2a 2a 2a  | user code *****|
00001bf0  0d 07 bc 22 2a 52 75 6e  20 3c 46 72 65 65 43 65  |..."*Run <FreeCe|
00001c00  6c 6c 48 61 63 6b 24 44  69 72 3e 2e 57 52 49 63  |llHack$Dir>.WRIc|
00001c10  6f 6e 0d 07 c6 05 e0 0d  07 d0 05 3a 0d 07 da 21  |on.........:...!|
00001c20  f4 20 2a 2a 2a 2a 20 46  69 6c 69 6e 67 20 70 72  |. **** Filing pr|
00001c30  6f 63 65 64 75 72 65 73  20 2a 2a 2a 2a 0d 07 e4  |ocedures ****...|
00001c40  05 3a 0d 07 ee 15 dd 20  f2 70 61 74 63 68 5f 6c  |.:..... .patch_l|
00001c50  6f 61 64 66 69 6c 65 0d  07 f8 0d 63 6f 64 65 6c  |oadfile....codel|
00001c60  65 6e 3d 30 0d 08 02 0f  de 20 4d 43 25 20 26 31  |en=0..... MC% &1|
00001c70  34 30 30 0d 08 0c 2d 65  6e 64 6f 66 63 6f 64 65  |400...-endofcode|
00001c80  3d 28 63 6f 64 65 6c 65  6e 2b 26 30 2b 33 29 20  |=(codelen+&0+3) |
00001c90  80 20 2d 34 3a 6d 61 78  3d 63 6f 64 65 6c 65 6e  |. -4:max=codelen|
00001ca0  0d 08 16 19 4c 25 3d 65  6e 64 6f 66 63 6f 64 65  |....L%=endofcode|
00001cb0  3a 5f 5f 63 61 70 25 3d  a3 0d 08 a2 05 e1 0d 08  |:__cap%=........|
00001cc0  ac 05 3a 0d 08 b6 15 dd  20 f2 70 61 74 63 68 5f  |..:..... .patch_|
00001cd0  73 61 76 65 66 69 6c 65  0d 08 c0 28 6f 75 74 66  |savefile...(outf|
00001ce0  69 6c 65 24 3d 22 3c 46  72 65 65 43 65 6c 6c 48  |ile$="<FreeCellH|
00001cf0  61 63 6b 24 44 69 72 3e  2e 57 52 49 63 6f 6e 22  |ack$Dir>.WRIcon"|
00001d00  0d 08 ca 31 ff 28 22 53  61 76 65 20 22 2b 6f 75  |...1.("Save "+ou|
00001d10  74 66 69 6c 65 24 2b 22  20 22 2b c3 7e 4d 43 25  |tfile$+" "+.~MC%|
00001d20  2b 22 20 22 2b c3 7e 28  6d 61 78 2b 4d 43 25 29  |+" "+.~(max+MC%)|
00001d30  29 0d 08 d4 24 ff 28 22  53 65 74 74 79 70 65 20  |)...$.("Settype |
00001d40  22 2b 6f 75 74 66 69 6c  65 24 2b 22 20 4d 6f 64  |"+outfile$+" Mod|
00001d50  75 6c 65 22 29 0d 08 de  34 70 61 74 63 68 64 69  |ule")...4patchdi|
00001d60  72 24 3d 22 41 44 46 53  3a 3a 47 65 72 70 68 2e  |r$="ADFS::Gerph.|
00001d70  24 2e 47 61 6d 65 73 2e  a3 2e 21 46 72 65 65 63  |$.Games...!Freec|
00001d80  65 6c 6c 2e 48 61 63 6b  22 0d 09 10 05 e1 0d 09  |ell.Hack".......|
00001d90  1a 05 3a 0d 09 24 1d f4  20 2a 2a 2a 2a 20 45 72  |..:..$.. **** Er|
00001da0  72 6f 72 20 48 61 6e 64  6c 65 72 20 2a 2a 2a 2a  |ror Handler ****|
00001db0  0d 09 2e 05 3a 0d 09 38  0b dd f2 45 72 72 6f 72  |....:..8...Error|
00001dc0  0d 09 42 07 ea 20 85 0d  09 4c 3d ee 20 85 20 ea  |..B.. ...L=. . .|
00001dd0  3a f7 20 85 3a 85 20 a2  20 9f 2c f6 24 2b 22 20  |:. .:. . .,.$+" |
00001de0  77 68 69 6c 73 74 20 69  6e 20 65 72 72 6f 72 20  |whilst in error |
00001df0  68 61 6e 64 6c 65 72 20  61 74 20 6c 69 6e 65 20  |handler at line |
00001e00  22 2b c3 9e 0d 09 ba 1b  85 20 a2 20 9f 2c f6 24  |"+....... . .,.$|
00001e10  2b 22 20 61 74 20 6c 69  6e 65 20 22 2b c3 9e 0d  |+" at line "+...|
00001e20  09 c4 05 e1 0d 09 ce 05  3a 0d 0a 3c 22 f4 20 2a  |........:..<". *|
00001e30  2a 2a 2a 20 55 74 69 6c  69 74 79 20 70 72 6f 63  |*** Utility proc|
00001e40  65 64 75 72 65 73 20 2a  2a 2a 2a 0d 0a 46 05 3a  |edures ****..F.:|
00001e50  0d 0a 50 14 dd f2 70 61  74 63 68 5f 73 65 74 70  |..P...patch_setp|
00001e60  63 28 6e 29 0d 0a 5a 1a  e7 20 50 25 2d 26 30 3e  |c(n)..Z.. P%-&0>|
00001e70  6d 61 78 20 8c 6d 61 78  3d 50 25 2d 26 30 0d 0a  |max .max=P%-&0..|
00001e80  64 14 50 25 3d 6e 3a 4f  25 3d 4d 43 25 2b 6e 2d  |d.P%=n:O%=MC%+n-|
00001e90  26 30 0d 0a 6e 05 e1 0d  0a 78 05 3a 0d 0a 82 22  |&0..n....x.:..."|
00001ea0  dd a4 66 69 6e 64 66 72  65 65 72 65 67 28 61 2c  |..findfreereg(a,|
00001eb0  62 2c 63 2c 64 29 3a ea  20 6e 3a 6e 3d 30 0d 0a  |b,c,d):. n:n=0..|
00001ec0  8c 1c c8 95 20 6e 3d 61  20 84 20 6e 3d 62 20 84  |.... n=a . n=b .|
00001ed0  20 6e 3d 63 20 84 20 6e  3d 64 0d 0a 96 09 20 6e  | n=c . n=d.... n|
00001ee0  2b 3d 31 0d 0a a0 05 ce  0d 0a aa 06 3d 6e 0d 0a  |+=1.........=n..|
00001ef0  b4 05 3a 0d 0a be 2a f4  20 2a 2a 2a 2a 20 4c 6f  |..:...*. **** Lo|
00001f00  6e 67 20 4d 4f 56 20 6d  61 63 72 6f 20 69 6e 73  |ng MOV macro ins|
00001f10  74 72 75 63 74 69 6f 6e  20 2a 2a 2a 2a 0d 0a c8  |truction ****...|
00001f20  05 3a 0d 0a d2 1b dd a4  4c 4d 4f 56 28 63 6f 6e  |.:......LMOV(con|
00001f30  64 24 2c 72 65 67 2c 76  61 6c 75 65 29 0d 0a dc  |d$,reg,value)...|
00001f40  27 e7 20 63 6f 6e 64 24  3d 22 22 20 84 20 63 6f  |'. cond$="" . co|
00001f50  6e 64 24 3d 22 20 20 22  20 8c 63 6f 6e 64 24 3d  |nd$="  " .cond$=|
00001f60  22 41 4c 22 0d 0a e6 39  63 6f 6e 64 3d 28 a7 22  |"AL"...9cond=(."|
00001f70  45 51 4e 45 43 53 43 43  4d 49 50 4c 56 53 56 43  |EQNECSCCMIPLVSVC|
00001f80  48 49 4c 53 47 45 4c 54  47 54 4c 45 41 4c 4e 56  |HILSGELTGTLEALNV|
00001f90  22 2c 63 6f 6e 64 24 29  2d 31 29 2f 32 0d 0a f0  |",cond$)-1)/2...|
00001fa0  26 6d 6f 76 3d 28 26 33  41 3c 3c 32 30 29 2b 28  |&mov=(&3A<<20)+(|
00001fb0  72 65 67 3c 3c 31 32 29  2b 28 63 6f 6e 64 3c 3c  |reg<<12)+(cond<<|
00001fc0  32 38 29 0d 0a fa 30 61  64 64 3d 28 26 32 38 3c  |28)...0add=(&28<|
00001fd0  3c 32 30 29 2b 28 72 65  67 3c 3c 31 32 29 2b 28  |<20)+(reg<<12)+(|
00001fe0  72 65 67 3c 3c 31 36 29  2b 28 63 6f 6e 64 3c 3c  |reg<<16)+(cond<<|
00001ff0  32 38 29 0d 0b 04 4f e7  20 76 61 6c 75 65 3c 30  |28)...O. value<0|
00002000  20 8c 6e 65 67 3d b9 3a  6d 6f 76 3d 6d 6f 76 20  | .neg=.:mov=mov |
00002010  84 20 28 31 3c 3c 32 32  29 3a 61 64 64 3d 61 64  |. (1<<22):add=ad|
00002020  64 20 82 20 28 31 32 3c  3c 32 30 29 3a 76 61 6c  |d . (12<<20):val|
00002030  75 65 3d 2d 76 61 6c 75  65 2d 31 20 8b 6e 65 67  |ue=-value-1 .neg|
00002040  3d a3 0d 0b 0e 0b 73 68  69 66 74 3d 30 0d 0b 18  |=.....shift=0...|
00002050  05 f5 0d 0b 22 20 20 c8  95 20 28 76 61 6c 75 65  |...."  .. (value|
00002060  20 80 20 33 29 3d 30 20  80 20 73 68 69 66 74 3c  | . 3)=0 . shift<|
00002070  31 36 0d 0b 2c 1d 20 20  73 68 69 66 74 2b 3d 31  |16..,.  shift+=1|
00002080  3a 76 61 6c 75 65 3d 76  61 6c 75 65 20 81 34 0d  |:value=value .4.|
00002090  0b 36 06 20 ce 0d 0b 40  2a 20 78 73 68 69 66 74  |.6. ...@* xshift|
000020a0  3d 31 36 2d 73 68 69 66  74 3a e7 20 78 73 68 69  |=16-shift:. xshi|
000020b0  66 74 3d 31 36 20 8c 78  73 68 69 66 74 3d 30 0d  |ft=16 .xshift=0.|
000020c0  0b 4a 0f 20 e7 20 6d 6f  76 3c 3e 30 20 8c 0d 0b  |.J. . mov<>0 ...|
000020d0  54 35 20 20 5b 4f 50 54  20 70 61 73 73 25 3a 45  |T5  [OPT pass%:E|
000020e0  51 55 44 20 6d 6f 76 2b  28 78 73 68 69 66 74 3c  |QUD mov+(xshift<|
000020f0  3c 38 29 2b 28 76 61 6c  75 65 20 80 20 32 35 35  |<8)+(value . 255|
00002100  29 3a 5d 0d 0b 5e 0b 20  20 6d 6f 76 3d 30 0d 0b  |):]..^.  mov=0..|
00002110  68 06 20 cc 0d 0b 72 35  20 20 5b 4f 50 54 20 70  |h. ...r5  [OPT p|
00002120  61 73 73 25 3a 45 51 55  44 20 61 64 64 2b 28 78  |ass%:EQUD add+(x|
00002130  73 68 69 66 74 3c 3c 38  29 2b 28 76 61 6c 75 65  |shift<<8)+(value|
00002140  20 80 20 32 35 35 29 3a  5d 0d 0b 7c 06 20 cd 0d  | . 255):]..|. ..|
00002150  0b 86 1e 20 76 61 6c 75  65 3d 76 61 6c 75 65 20  |... value=value |
00002160  81 32 35 36 3a 73 68 69  66 74 2b 3d 34 0d 0b 90  |.256:shift+=4...|
00002170  0c fd 76 61 6c 75 65 3d  30 0d 0b 9a 06 3d 30 0d  |..value=0....=0.|
00002180  0b a4 05 3a 0d 0b ae 2a  f4 20 2a 2a 2a 2a 20 4c  |...:...*. **** L|
00002190  6f 6e 67 20 41 44 44 20  6d 61 63 72 6f 20 69 6e  |ong ADD macro in|
000021a0  73 74 72 75 63 74 69 6f  6e 20 2a 2a 2a 2a 0d 0b  |struction ****..|
000021b0  b8 05 3a 0d 0b c2 21 dd  a4 4c 41 44 44 28 63 6f  |..:...!..LADD(co|
000021c0  6e 64 24 2c 72 65 67 31  2c 72 65 67 32 2c 76 61  |nd$,reg1,reg2,va|
000021d0  6c 75 65 29 0d 0b cc 27  e7 20 63 6f 6e 64 24 3d  |lue)...'. cond$=|
000021e0  22 22 20 84 20 63 6f 6e  64 24 3d 22 20 20 22 20  |"" . cond$="  " |
000021f0  8c 63 6f 6e 64 24 3d 22  41 4c 22 0d 0b d6 39 63  |.cond$="AL"...9c|
00002200  6f 6e 64 3d 28 a7 22 45  51 4e 45 43 53 43 43 4d  |ond=(."EQNECSCCM|
00002210  49 50 4c 56 53 56 43 48  49 4c 53 47 45 4c 54 47  |IPLVSVCHILSGELTG|
00002220  54 4c 45 41 4c 4e 56 22  2c 63 6f 6e 64 24 29 2d  |TLEALNV",cond$)-|
00002230  31 29 2f 32 0d 0b e0 33  61 64 64 31 3d 28 26 32  |1)/2...3add1=(&2|
00002240  38 3c 3c 32 30 29 2b 28  72 65 67 31 3c 3c 31 32  |8<<20)+(reg1<<12|
00002250  29 2b 28 72 65 67 32 3c  3c 31 36 29 2b 28 63 6f  |)+(reg2<<16)+(co|
00002260  6e 64 3c 3c 32 38 29 0d  0b ea 33 61 64 64 32 3d  |nd<<28)...3add2=|
00002270  28 26 32 38 3c 3c 32 30  29 2b 28 72 65 67 31 3c  |(&28<<20)+(reg1<|
00002280  3c 31 32 29 2b 28 72 65  67 31 3c 3c 31 36 29 2b  |<12)+(reg1<<16)+|
00002290  28 63 6f 6e 64 3c 3c 32  38 29 0d 0b f4 0b 73 68  |(cond<<28)....sh|
000022a0  69 66 74 3d 30 0d 0b fe  05 f5 0d 0c 08 20 20 c8  |ift=0........  .|
000022b0  95 20 28 76 61 6c 75 65  20 80 20 33 29 3d 30 20  |. (value . 3)=0 |
000022c0  80 20 73 68 69 66 74 3c  31 36 0d 0c 12 1d 20 20  |. shift<16....  |
000022d0  73 68 69 66 74 2b 3d 31  3a 76 61 6c 75 65 3d 76  |shift+=1:value=v|
000022e0  61 6c 75 65 20 81 34 0d  0c 1c 06 20 ce 0d 0c 26  |alue .4.... ...&|
000022f0  2a 20 78 73 68 69 66 74  3d 31 36 2d 73 68 69 66  |* xshift=16-shif|
00002300  74 3a e7 20 78 73 68 69  66 74 3d 31 36 20 8c 78  |t:. xshift=16 .x|
00002310  73 68 69 66 74 3d 30 0d  0c 30 10 20 e7 20 61 64  |shift=0..0. . ad|
00002320  64 31 3c 3e 30 20 8c 0d  0c 3a 35 20 20 5b 4f 50  |d1<>0 ...:5  [OP|
00002330  54 20 70 61 73 73 25 3a  45 51 55 44 61 64 64 31  |T pass%:EQUDadd1|
00002340  2b 28 78 73 68 69 66 74  3c 3c 38 29 2b 28 76 61  |+(xshift<<8)+(va|
00002350  6c 75 65 20 80 20 32 35  35 29 3a 5d 0d 0c 44 0c  |lue . 255):]..D.|
00002360  20 20 61 64 64 31 3d 30  0d 0c 4e 06 20 cc 0d 0c  |  add1=0..N. ...|
00002370  58 35 20 20 5b 4f 50 54  20 70 61 73 73 25 3a 45  |X5  [OPT pass%:E|
00002380  51 55 44 61 64 64 32 2b  28 78 73 68 69 66 74 3c  |QUDadd2+(xshift<|
00002390  3c 38 29 2b 28 76 61 6c  75 65 20 80 20 32 35 35  |<8)+(value . 255|
000023a0  29 3a 5d 0d 0c 62 06 20  cd 0d 0c 6c 1e 20 76 61  |):]..b. ...l. va|
000023b0  6c 75 65 3d 76 61 6c 75  65 20 81 32 35 36 3a 73  |lue=value .256:s|
000023c0  68 69 66 74 2b 3d 34 0d  0c 76 0c fd 76 61 6c 75  |hift+=4..v..valu|
000023d0  65 3d 30 0d 0c 80 06 3d  30 0d 0c 8a 05 3a 0d 7f  |e=0....=0....:..|
000023e0  7f 0d f4 20 4a 46 50 61  74 63 68 0d ff           |... JFPatch..|
000023ed