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

StarInfo/Fletcher/FreeCell/Source

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/Source
Read OK:
File size: 1006 bytes
Load address: 0000
Exec address: 0000
File contents
In   -
Out  <FreeCellHack$Dir>.WRIcon
Type Module
Ver  1.00t

Define Workspace
  Name     workspace
  Default  r12
   `win       !    window handle
   `icon      !    icon handle
   `x0        !    left
   `y0        !    bottom
   `x1        !    right
   `y1        !    top
   `flags     !    icon flags
  (
   `text      $12  text
  |
   `indtext   !    text pointer
   `indvalid  !    validation pointer
   `indlen    !    text buffer length
  )

   `delwin    !    window to delete icon from
   `delicon   !    window to delete icon from
End Workspace

Define Module
 Name      WimpResizeIcon
 Author    Justin Fletcher
 SWIs
  Base     &C0480
  Prefix   WimpHack
   0       ResizeIcon     resizeicon
 End SWIs
 Commands
  Name     WimpResizeIcon
  Help     ...
           WimpResizeIcon provides the WimpHack_ResizeIcon call which allows
           normal people to get around the bug where RO3.5 programmers stick
           calls in to RO3.5 only code which would otherwise work perfectly
           well on older versions of RO.|M
           I shalln't mention the other silly things they do�
 End Commands
 Workspace `len_workspace
End Module

#REM Off
.resizeicon
   STMFD   (sp)!,{r0-r7,link}            ; Stack registers
   REM     "%c04%c30Starting recreation for window %&0, icon %r1"
           ; first we need to store the details given
   MOV     r6,sp                         ; in case we have to exit
                                         ; prematurely, store stack ptr
   MOV     r7,r1                         ; r7 = icon number to re-create
   STRW    r0,`delwin                    ; store win in delete block
           ; read the data about the icon
   STMIA   r12,{r0,r1}                   ; store win and icon in block
   REM     "Getting icon data"
   MOV     r1,r12                        ; get the block pointer
   SWI     "XWimp_GetIconState"          ; find out the old blocks data
   LDMFD   (sp),{r0-r5}                  ; now read back the new location
   STMIA   r12,{r0-r5}                   ; and store in the safe block
           ; now to delete the icon
   REM     "Deleting icon"
   MOV     r1,r12                        ; get the block pointer
   SWI     "XWimp_DeleteIcon"            ; delete the icon
   BVS     $exit                         ; exit gracefully if error
           ; and then create lots of icons...
   REM     "Deleted"
   MVN     r2,#NOT -1                    ; use -1 to mark end of list
   STMFD   (sp)!,{r2}                    ; stack value
   LDRW    r0,`win                       ; read window handle
   STRW    r0,`icon                      ; store window handle at block start
$createloop
   ADRW    r1,`icon                      ; get pointer to create block
   REM     "Trying to create, block = %&1"
   LDR     r2,[r1]
   REM     "Win = %&2"
   SWI     "XWimp_CreateIcon"            ; create the icon
   BVS     $exit                         ; exit gracefully if error
   REM     "Created icon : %r0"
   CMP     r0,r7                         ; have we found the icon yet ?
   STMLTFD (sp)!,{r0}                    ; if not, stack the icon number �
   BLT     $createloop                   ; � and try again
           ; we've found the icon we really wanted, so now we must delete
           ; all the rubbish

   REM     "Now to delete the rubbish"
   ADRW    r1,`delwin                    ; get pointer to delete block
$deleteloop
   LDMFD   (sp)!,{r0}                    ; read icon number
   REM     "Read number %r0"
   CMN     r0,#1                         ; is it -1 (end marker) ?
   BEQ     $lasticon                     ; if so, we're done !
   STRW    r0,`delicon                   ; if not, store in delete block
   REM     "Deleting icon %r0"
   SWI     "XWimp_DeleteIcon"            ; and delete the icon
   BVS     $exit                         ; exit gracefully if error
$lasticon
           ; we're all done - time to go !
   REM     "Success - exiting !"
$exit
   MOV     sp,r6                         ; restore the stack pointer
   XLDMFD  (sp)!,{r0-r7,pc}              ; Return from call

#Post
#Run <CODE>
00000000  49 6e 20 20 20 2d 0a 4f  75 74 20 20 3c 46 72 65  |In   -.Out  <Fre|
00000010  65 43 65 6c 6c 48 61 63  6b 24 44 69 72 3e 2e 57  |eCellHack$Dir>.W|
00000020  52 49 63 6f 6e 0a 54 79  70 65 20 4d 6f 64 75 6c  |RIcon.Type Modul|
00000030  65 0a 56 65 72 20 20 31  2e 30 30 74 0a 0a 44 65  |e.Ver  1.00t..De|
00000040  66 69 6e 65 20 57 6f 72  6b 73 70 61 63 65 0a 20  |fine Workspace. |
00000050  20 4e 61 6d 65 20 20 20  20 20 77 6f 72 6b 73 70  | Name     worksp|
00000060  61 63 65 0a 20 20 44 65  66 61 75 6c 74 20 20 72  |ace.  Default  r|
00000070  31 32 0a 20 20 20 60 77  69 6e 20 20 20 20 20 20  |12.   `win      |
00000080  20 21 20 20 20 20 77 69  6e 64 6f 77 20 68 61 6e  | !    window han|
00000090  64 6c 65 0a 20 20 20 60  69 63 6f 6e 20 20 20 20  |dle.   `icon    |
000000a0  20 20 21 20 20 20 20 69  63 6f 6e 20 68 61 6e 64  |  !    icon hand|
000000b0  6c 65 0a 20 20 20 60 78  30 20 20 20 20 20 20 20  |le.   `x0       |
000000c0  20 21 20 20 20 20 6c 65  66 74 0a 20 20 20 60 79  | !    left.   `y|
000000d0  30 20 20 20 20 20 20 20  20 21 20 20 20 20 62 6f  |0        !    bo|
000000e0  74 74 6f 6d 0a 20 20 20  60 78 31 20 20 20 20 20  |ttom.   `x1     |
000000f0  20 20 20 21 20 20 20 20  72 69 67 68 74 0a 20 20  |   !    right.  |
00000100  20 60 79 31 20 20 20 20  20 20 20 20 21 20 20 20  | `y1        !   |
00000110  20 74 6f 70 0a 20 20 20  60 66 6c 61 67 73 20 20  | top.   `flags  |
00000120  20 20 20 21 20 20 20 20  69 63 6f 6e 20 66 6c 61  |   !    icon fla|
00000130  67 73 0a 20 20 28 0a 20  20 20 60 74 65 78 74 20  |gs.  (.   `text |
00000140  20 20 20 20 20 24 31 32  20 20 74 65 78 74 0a 20  |     $12  text. |
00000150  20 7c 0a 20 20 20 60 69  6e 64 74 65 78 74 20 20  | |.   `indtext  |
00000160  20 21 20 20 20 20 74 65  78 74 20 70 6f 69 6e 74  | !    text point|
00000170  65 72 0a 20 20 20 60 69  6e 64 76 61 6c 69 64 20  |er.   `indvalid |
00000180  20 21 20 20 20 20 76 61  6c 69 64 61 74 69 6f 6e  | !    validation|
00000190  20 70 6f 69 6e 74 65 72  0a 20 20 20 60 69 6e 64  | pointer.   `ind|
000001a0  6c 65 6e 20 20 20 20 21  20 20 20 20 74 65 78 74  |len    !    text|
000001b0  20 62 75 66 66 65 72 20  6c 65 6e 67 74 68 0a 20  | buffer length. |
000001c0  20 29 0a 0a 20 20 20 60  64 65 6c 77 69 6e 20 20  | )..   `delwin  |
000001d0  20 20 21 20 20 20 20 77  69 6e 64 6f 77 20 74 6f  |  !    window to|
000001e0  20 64 65 6c 65 74 65 20  69 63 6f 6e 20 66 72 6f  | delete icon fro|
000001f0  6d 0a 20 20 20 60 64 65  6c 69 63 6f 6e 20 20 20  |m.   `delicon   |
00000200  21 20 20 20 20 77 69 6e  64 6f 77 20 74 6f 20 64  |!    window to d|
00000210  65 6c 65 74 65 20 69 63  6f 6e 20 66 72 6f 6d 0a  |elete icon from.|
00000220  45 6e 64 20 57 6f 72 6b  73 70 61 63 65 0a 0a 44  |End Workspace..D|
00000230  65 66 69 6e 65 20 4d 6f  64 75 6c 65 0a 20 4e 61  |efine Module. Na|
00000240  6d 65 20 20 20 20 20 20  57 69 6d 70 52 65 73 69  |me      WimpResi|
00000250  7a 65 49 63 6f 6e 0a 20  41 75 74 68 6f 72 20 20  |zeIcon. Author  |
00000260  20 20 4a 75 73 74 69 6e  20 46 6c 65 74 63 68 65  |  Justin Fletche|
00000270  72 0a 20 53 57 49 73 0a  20 20 42 61 73 65 20 20  |r. SWIs.  Base  |
00000280  20 20 20 26 43 30 34 38  30 0a 20 20 50 72 65 66  |   &C0480.  Pref|
00000290  69 78 20 20 20 57 69 6d  70 48 61 63 6b 0a 20 20  |ix   WimpHack.  |
000002a0  20 30 20 20 20 20 20 20  20 52 65 73 69 7a 65 49  | 0       ResizeI|
000002b0  63 6f 6e 20 20 20 20 20  72 65 73 69 7a 65 69 63  |con     resizeic|
000002c0  6f 6e 0a 20 45 6e 64 20  53 57 49 73 0a 20 43 6f  |on. End SWIs. Co|
000002d0  6d 6d 61 6e 64 73 0a 20  20 4e 61 6d 65 20 20 20  |mmands.  Name   |
000002e0  20 20 57 69 6d 70 52 65  73 69 7a 65 49 63 6f 6e  |  WimpResizeIcon|
000002f0  0a 20 20 48 65 6c 70 20  20 20 20 20 2e 2e 2e 0a  |.  Help     ....|
00000300  20 20 20 20 20 20 20 20  20 20 20 57 69 6d 70 52  |           WimpR|
00000310  65 73 69 7a 65 49 63 6f  6e 20 70 72 6f 76 69 64  |esizeIcon provid|
00000320  65 73 20 74 68 65 20 57  69 6d 70 48 61 63 6b 5f  |es the WimpHack_|
00000330  52 65 73 69 7a 65 49 63  6f 6e 20 63 61 6c 6c 20  |ResizeIcon call |
00000340  77 68 69 63 68 20 61 6c  6c 6f 77 73 0a 20 20 20  |which allows.   |
00000350  20 20 20 20 20 20 20 20  6e 6f 72 6d 61 6c 20 70  |        normal p|
00000360  65 6f 70 6c 65 20 74 6f  20 67 65 74 20 61 72 6f  |eople to get aro|
00000370  75 6e 64 20 74 68 65 20  62 75 67 20 77 68 65 72  |und the bug wher|
00000380  65 20 52 4f 33 2e 35 20  70 72 6f 67 72 61 6d 6d  |e RO3.5 programm|
00000390  65 72 73 20 73 74 69 63  6b 0a 20 20 20 20 20 20  |ers stick.      |
000003a0  20 20 20 20 20 63 61 6c  6c 73 20 69 6e 20 74 6f  |     calls in to|
000003b0  20 52 4f 33 2e 35 20 6f  6e 6c 79 20 63 6f 64 65  | RO3.5 only code|
000003c0  20 77 68 69 63 68 20 77  6f 75 6c 64 20 6f 74 68  | which would oth|
000003d0  65 72 77 69 73 65 20 77  6f 72 6b 20 70 65 72 66  |erwise work perf|
000003e0  65 63 74 6c 79 0a 20 20  20 20 20 20 20 20 20 20  |ectly.          |
000003f0  20 77 65 6c 6c 20 6f 6e  20 6f 6c 64 65 72 20 76  | well on older v|
00000400  65 72 73 69 6f 6e 73 20  6f 66 20 52 4f 2e 7c 4d  |ersions of RO.|M|
00000410  0a 20 20 20 20 20 20 20  20 20 20 20 49 20 73 68  |.           I sh|
00000420  61 6c 6c 6e 27 74 20 6d  65 6e 74 69 6f 6e 20 74  |alln't mention t|
00000430  68 65 20 6f 74 68 65 72  20 73 69 6c 6c 79 20 74  |he other silly t|
00000440  68 69 6e 67 73 20 74 68  65 79 20 64 6f 8c 0a 20  |hings they do.. |
00000450  45 6e 64 20 43 6f 6d 6d  61 6e 64 73 0a 20 57 6f  |End Commands. Wo|
00000460  72 6b 73 70 61 63 65 20  60 6c 65 6e 5f 77 6f 72  |rkspace `len_wor|
00000470  6b 73 70 61 63 65 0a 45  6e 64 20 4d 6f 64 75 6c  |kspace.End Modul|
00000480  65 0a 0a 23 52 45 4d 20  4f 66 66 0a 2e 72 65 73  |e..#REM Off..res|
00000490  69 7a 65 69 63 6f 6e 0a  20 20 20 53 54 4d 46 44  |izeicon.   STMFD|
000004a0  20 20 20 28 73 70 29 21  2c 7b 72 30 2d 72 37 2c  |   (sp)!,{r0-r7,|
000004b0  6c 69 6e 6b 7d 20 20 20  20 20 20 20 20 20 20 20  |link}           |
000004c0  20 3b 20 53 74 61 63 6b  20 72 65 67 69 73 74 65  | ; Stack registe|
000004d0  72 73 0a 20 20 20 52 45  4d 20 20 20 20 20 22 25  |rs.   REM     "%|
000004e0  63 30 34 25 63 33 30 53  74 61 72 74 69 6e 67 20  |c04%c30Starting |
000004f0  72 65 63 72 65 61 74 69  6f 6e 20 66 6f 72 20 77  |recreation for w|
00000500  69 6e 64 6f 77 20 25 26  30 2c 20 69 63 6f 6e 20  |indow %&0, icon |
00000510  25 72 31 22 0a 20 20 20  20 20 20 20 20 20 20 20  |%r1".           |
00000520  3b 20 66 69 72 73 74 20  77 65 20 6e 65 65 64 20  |; first we need |
00000530  74 6f 20 73 74 6f 72 65  20 74 68 65 20 64 65 74  |to store the det|
00000540  61 69 6c 73 20 67 69 76  65 6e 0a 20 20 20 4d 4f  |ails given.   MO|
00000550  56 20 20 20 20 20 72 36  2c 73 70 20 20 20 20 20  |V     r6,sp     |
00000560  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000570  20 20 20 20 3b 20 69 6e  20 63 61 73 65 20 77 65  |    ; in case we|
00000580  20 68 61 76 65 20 74 6f  20 65 78 69 74 0a 20 20  | have to exit.  |
00000590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000005b0  20 20 20 20 20 20 20 3b  20 70 72 65 6d 61 74 75  |       ; prematu|
000005c0  72 65 6c 79 2c 20 73 74  6f 72 65 20 73 74 61 63  |rely, store stac|
000005d0  6b 20 70 74 72 0a 20 20  20 4d 4f 56 20 20 20 20  |k ptr.   MOV    |
000005e0  20 72 37 2c 72 31 20 20  20 20 20 20 20 20 20 20  | r7,r1          |
000005f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00000600  20 72 37 20 3d 20 69 63  6f 6e 20 6e 75 6d 62 65  | r7 = icon numbe|
00000610  72 20 74 6f 20 72 65 2d  63 72 65 61 74 65 0a 20  |r to re-create. |
00000620  20 20 53 54 52 57 20 20  20 20 72 30 2c 60 64 65  |  STRW    r0,`de|
00000630  6c 77 69 6e 20 20 20 20  20 20 20 20 20 20 20 20  |lwin            |
00000640  20 20 20 20 20 20 20 20  3b 20 73 74 6f 72 65 20  |        ; store |
00000650  77 69 6e 20 69 6e 20 64  65 6c 65 74 65 20 62 6c  |win in delete bl|
00000660  6f 63 6b 0a 20 20 20 20  20 20 20 20 20 20 20 3b  |ock.           ;|
00000670  20 72 65 61 64 20 74 68  65 20 64 61 74 61 20 61  | read the data a|
00000680  62 6f 75 74 20 74 68 65  20 69 63 6f 6e 0a 20 20  |bout the icon.  |
00000690  20 53 54 4d 49 41 20 20  20 72 31 32 2c 7b 72 30  | STMIA   r12,{r0|
000006a0  2c 72 31 7d 20 20 20 20  20 20 20 20 20 20 20 20  |,r1}            |
000006b0  20 20 20 20 20 20 20 3b  20 73 74 6f 72 65 20 77  |       ; store w|
000006c0  69 6e 20 61 6e 64 20 69  63 6f 6e 20 69 6e 20 62  |in and icon in b|
000006d0  6c 6f 63 6b 0a 20 20 20  52 45 4d 20 20 20 20 20  |lock.   REM     |
000006e0  22 47 65 74 74 69 6e 67  20 69 63 6f 6e 20 64 61  |"Getting icon da|
000006f0  74 61 22 0a 20 20 20 4d  4f 56 20 20 20 20 20 72  |ta".   MOV     r|
00000700  31 2c 72 31 32 20 20 20  20 20 20 20 20 20 20 20  |1,r12           |
00000710  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 67  |             ; g|
00000720  65 74 20 74 68 65 20 62  6c 6f 63 6b 20 70 6f 69  |et the block poi|
00000730  6e 74 65 72 0a 20 20 20  53 57 49 20 20 20 20 20  |nter.   SWI     |
00000740  22 58 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  |"XWimp_GetIconSt|
00000750  61 74 65 22 20 20 20 20  20 20 20 20 20 20 3b 20  |ate"          ; |
00000760  66 69 6e 64 20 6f 75 74  20 74 68 65 20 6f 6c 64  |find out the old|
00000770  20 62 6c 6f 63 6b 73 20  64 61 74 61 0a 20 20 20  | blocks data.   |
00000780  4c 44 4d 46 44 20 20 20  28 73 70 29 2c 7b 72 30  |LDMFD   (sp),{r0|
00000790  2d 72 35 7d 20 20 20 20  20 20 20 20 20 20 20 20  |-r5}            |
000007a0  20 20 20 20 20 20 3b 20  6e 6f 77 20 72 65 61 64  |      ; now read|
000007b0  20 62 61 63 6b 20 74 68  65 20 6e 65 77 20 6c 6f  | back the new lo|
000007c0  63 61 74 69 6f 6e 0a 20  20 20 53 54 4d 49 41 20  |cation.   STMIA |
000007d0  20 20 72 31 32 2c 7b 72  30 2d 72 35 7d 20 20 20  |  r12,{r0-r5}   |
000007e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000007f0  3b 20 61 6e 64 20 73 74  6f 72 65 20 69 6e 20 74  |; and store in t|
00000800  68 65 20 73 61 66 65 20  62 6c 6f 63 6b 0a 20 20  |he safe block.  |
00000810  20 20 20 20 20 20 20 20  20 3b 20 6e 6f 77 20 74  |         ; now t|
00000820  6f 20 64 65 6c 65 74 65  20 74 68 65 20 69 63 6f  |o delete the ico|
00000830  6e 0a 20 20 20 52 45 4d  20 20 20 20 20 22 44 65  |n.   REM     "De|
00000840  6c 65 74 69 6e 67 20 69  63 6f 6e 22 0a 20 20 20  |leting icon".   |
00000850  4d 4f 56 20 20 20 20 20  72 31 2c 72 31 32 20 20  |MOV     r1,r12  |
00000860  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000870  20 20 20 20 20 20 3b 20  67 65 74 20 74 68 65 20  |      ; get the |
00000880  62 6c 6f 63 6b 20 70 6f  69 6e 74 65 72 0a 20 20  |block pointer.  |
00000890  20 53 57 49 20 20 20 20  20 22 58 57 69 6d 70 5f  | SWI     "XWimp_|
000008a0  44 65 6c 65 74 65 49 63  6f 6e 22 20 20 20 20 20  |DeleteIcon"     |
000008b0  20 20 20 20 20 20 20 3b  20 64 65 6c 65 74 65 20  |       ; delete |
000008c0  74 68 65 20 69 63 6f 6e  0a 20 20 20 42 56 53 20  |the icon.   BVS |
000008d0  20 20 20 20 24 65 78 69  74 20 20 20 20 20 20 20  |    $exit       |
000008e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000008f0  20 20 3b 20 65 78 69 74  20 67 72 61 63 65 66 75  |  ; exit gracefu|
00000900  6c 6c 79 20 69 66 20 65  72 72 6f 72 0a 20 20 20  |lly if error.   |
00000910  20 20 20 20 20 20 20 20  3b 20 61 6e 64 20 74 68  |        ; and th|
00000920  65 6e 20 63 72 65 61 74  65 20 6c 6f 74 73 20 6f  |en create lots o|
00000930  66 20 69 63 6f 6e 73 2e  2e 2e 0a 20 20 20 52 45  |f icons....   RE|
00000940  4d 20 20 20 20 20 22 44  65 6c 65 74 65 64 22 0a  |M     "Deleted".|
00000950  20 20 20 4d 56 4e 20 20  20 20 20 72 32 2c 23 4e  |   MVN     r2,#N|
00000960  4f 54 20 2d 31 20 20 20  20 20 20 20 20 20 20 20  |OT -1           |
00000970  20 20 20 20 20 20 20 20  20 3b 20 75 73 65 20 2d  |         ; use -|
00000980  31 20 74 6f 20 6d 61 72  6b 20 65 6e 64 20 6f 66  |1 to mark end of|
00000990  20 6c 69 73 74 0a 20 20  20 53 54 4d 46 44 20 20  | list.   STMFD  |
000009a0  20 28 73 70 29 21 2c 7b  72 32 7d 20 20 20 20 20  | (sp)!,{r2}     |
000009b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000009c0  20 73 74 61 63 6b 20 76  61 6c 75 65 0a 20 20 20  | stack value.   |
000009d0  4c 44 52 57 20 20 20 20  72 30 2c 60 77 69 6e 20  |LDRW    r0,`win |
000009e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000009f0  20 20 20 20 20 20 3b 20  72 65 61 64 20 77 69 6e  |      ; read win|
00000a00  64 6f 77 20 68 61 6e 64  6c 65 0a 20 20 20 53 54  |dow handle.   ST|
00000a10  52 57 20 20 20 20 72 30  2c 60 69 63 6f 6e 20 20  |RW    r0,`icon  |
00000a20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000a30  20 20 20 20 3b 20 73 74  6f 72 65 20 77 69 6e 64  |    ; store wind|
00000a40  6f 77 20 68 61 6e 64 6c  65 20 61 74 20 62 6c 6f  |ow handle at blo|
00000a50  63 6b 20 73 74 61 72 74  0a 24 63 72 65 61 74 65  |ck start.$create|
00000a60  6c 6f 6f 70 0a 20 20 20  41 44 52 57 20 20 20 20  |loop.   ADRW    |
00000a70  72 31 2c 60 69 63 6f 6e  20 20 20 20 20 20 20 20  |r1,`icon        |
00000a80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00000a90  67 65 74 20 70 6f 69 6e  74 65 72 20 74 6f 20 63  |get pointer to c|
00000aa0  72 65 61 74 65 20 62 6c  6f 63 6b 0a 20 20 20 52  |reate block.   R|
00000ab0  45 4d 20 20 20 20 20 22  54 72 79 69 6e 67 20 74  |EM     "Trying t|
00000ac0  6f 20 63 72 65 61 74 65  2c 20 62 6c 6f 63 6b 20  |o create, block |
00000ad0  3d 20 25 26 31 22 0a 20  20 20 4c 44 52 20 20 20  |= %&1".   LDR   |
00000ae0  20 20 72 32 2c 5b 72 31  5d 0a 20 20 20 52 45 4d  |  r2,[r1].   REM|
00000af0  20 20 20 20 20 22 57 69  6e 20 3d 20 25 26 32 22  |     "Win = %&2"|
00000b00  0a 20 20 20 53 57 49 20  20 20 20 20 22 58 57 69  |.   SWI     "XWi|
00000b10  6d 70 5f 43 72 65 61 74  65 49 63 6f 6e 22 20 20  |mp_CreateIcon"  |
00000b20  20 20 20 20 20 20 20 20  20 20 3b 20 63 72 65 61  |          ; crea|
00000b30  74 65 20 74 68 65 20 69  63 6f 6e 0a 20 20 20 42  |te the icon.   B|
00000b40  56 53 20 20 20 20 20 24  65 78 69 74 20 20 20 20  |VS     $exit    |
00000b50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000b60  20 20 20 20 20 3b 20 65  78 69 74 20 67 72 61 63  |     ; exit grac|
00000b70  65 66 75 6c 6c 79 20 69  66 20 65 72 72 6f 72 0a  |efully if error.|
00000b80  20 20 20 52 45 4d 20 20  20 20 20 22 43 72 65 61  |   REM     "Crea|
00000b90  74 65 64 20 69 63 6f 6e  20 3a 20 25 72 30 22 0a  |ted icon : %r0".|
00000ba0  20 20 20 43 4d 50 20 20  20 20 20 72 30 2c 72 37  |   CMP     r0,r7|
00000bb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000bc0  20 20 20 20 20 20 20 20  20 3b 20 68 61 76 65 20  |         ; have |
00000bd0  77 65 20 66 6f 75 6e 64  20 74 68 65 20 69 63 6f  |we found the ico|
00000be0  6e 20 79 65 74 20 3f 0a  20 20 20 53 54 4d 4c 54  |n yet ?.   STMLT|
00000bf0  46 44 20 28 73 70 29 21  2c 7b 72 30 7d 20 20 20  |FD (sp)!,{r0}   |
00000c00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000c10  20 3b 20 69 66 20 6e 6f  74 2c 20 73 74 61 63 6b  | ; if not, stack|
00000c20  20 74 68 65 20 69 63 6f  6e 20 6e 75 6d 62 65 72  | the icon number|
00000c30  20 8c 0a 20 20 20 42 4c  54 20 20 20 20 20 24 63  | ..   BLT     $c|
00000c40  72 65 61 74 65 6c 6f 6f  70 20 20 20 20 20 20 20  |reateloop       |
00000c50  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 8c 20  |            ; . |
00000c60  61 6e 64 20 74 72 79 20  61 67 61 69 6e 0a 20 20  |and try again.  |
00000c70  20 20 20 20 20 20 20 20  20 3b 20 77 65 27 76 65  |         ; we've|
00000c80  20 66 6f 75 6e 64 20 74  68 65 20 69 63 6f 6e 20  | found the icon |
00000c90  77 65 20 72 65 61 6c 6c  79 20 77 61 6e 74 65 64  |we really wanted|
00000ca0  2c 20 73 6f 20 6e 6f 77  20 77 65 20 6d 75 73 74  |, so now we must|
00000cb0  20 64 65 6c 65 74 65 0a  20 20 20 20 20 20 20 20  | delete.        |
00000cc0  20 20 20 3b 20 61 6c 6c  20 74 68 65 20 72 75 62  |   ; all the rub|
00000cd0  62 69 73 68 0a 0a 20 20  20 52 45 4d 20 20 20 20  |bish..   REM    |
00000ce0  20 22 4e 6f 77 20 74 6f  20 64 65 6c 65 74 65 20  | "Now to delete |
00000cf0  74 68 65 20 72 75 62 62  69 73 68 22 0a 20 20 20  |the rubbish".   |
00000d00  41 44 52 57 20 20 20 20  72 31 2c 60 64 65 6c 77  |ADRW    r1,`delw|
00000d10  69 6e 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |in              |
00000d20  20 20 20 20 20 20 3b 20  67 65 74 20 70 6f 69 6e  |      ; get poin|
00000d30  74 65 72 20 74 6f 20 64  65 6c 65 74 65 20 62 6c  |ter to delete bl|
00000d40  6f 63 6b 0a 24 64 65 6c  65 74 65 6c 6f 6f 70 0a  |ock.$deleteloop.|
00000d50  20 20 20 4c 44 4d 46 44  20 20 20 28 73 70 29 21  |   LDMFD   (sp)!|
00000d60  2c 7b 72 30 7d 20 20 20  20 20 20 20 20 20 20 20  |,{r0}           |
00000d70  20 20 20 20 20 20 20 20  20 3b 20 72 65 61 64 20  |         ; read |
00000d80  69 63 6f 6e 20 6e 75 6d  62 65 72 0a 20 20 20 52  |icon number.   R|
00000d90  45 4d 20 20 20 20 20 22  52 65 61 64 20 6e 75 6d  |EM     "Read num|
00000da0  62 65 72 20 25 72 30 22  0a 20 20 20 43 4d 4e 20  |ber %r0".   CMN |
00000db0  20 20 20 20 72 30 2c 23  31 20 20 20 20 20 20 20  |    r0,#1       |
00000dc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000dd0  20 20 3b 20 69 73 20 69  74 20 2d 31 20 28 65 6e  |  ; is it -1 (en|
00000de0  64 20 6d 61 72 6b 65 72  29 20 3f 0a 20 20 20 42  |d marker) ?.   B|
00000df0  45 51 20 20 20 20 20 24  6c 61 73 74 69 63 6f 6e  |EQ     $lasticon|
00000e00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e10  20 20 20 20 20 3b 20 69  66 20 73 6f 2c 20 77 65  |     ; if so, we|
00000e20  27 72 65 20 64 6f 6e 65  20 21 0a 20 20 20 53 54  |'re done !.   ST|
00000e30  52 57 20 20 20 20 72 30  2c 60 64 65 6c 69 63 6f  |RW    r0,`delico|
00000e40  6e 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |n               |
00000e50  20 20 20 20 3b 20 69 66  20 6e 6f 74 2c 20 73 74  |    ; if not, st|
00000e60  6f 72 65 20 69 6e 20 64  65 6c 65 74 65 20 62 6c  |ore in delete bl|
00000e70  6f 63 6b 0a 20 20 20 52  45 4d 20 20 20 20 20 22  |ock.   REM     "|
00000e80  44 65 6c 65 74 69 6e 67  20 69 63 6f 6e 20 25 72  |Deleting icon %r|
00000e90  30 22 0a 20 20 20 53 57  49 20 20 20 20 20 22 58  |0".   SWI     "X|
00000ea0  57 69 6d 70 5f 44 65 6c  65 74 65 49 63 6f 6e 22  |Wimp_DeleteIcon"|
00000eb0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 61 6e  |            ; an|
00000ec0  64 20 64 65 6c 65 74 65  20 74 68 65 20 69 63 6f  |d delete the ico|
00000ed0  6e 0a 20 20 20 42 56 53  20 20 20 20 20 24 65 78  |n.   BVS     $ex|
00000ee0  69 74 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |it              |
00000ef0  20 20 20 20 20 20 20 20  20 20 20 3b 20 65 78 69  |           ; exi|
00000f00  74 20 67 72 61 63 65 66  75 6c 6c 79 20 69 66 20  |t gracefully if |
00000f10  65 72 72 6f 72 0a 24 6c  61 73 74 69 63 6f 6e 0a  |error.$lasticon.|
00000f20  20 20 20 20 20 20 20 20  20 20 20 3b 20 77 65 27  |           ; we'|
00000f30  72 65 20 61 6c 6c 20 64  6f 6e 65 20 2d 20 74 69  |re all done - ti|
00000f40  6d 65 20 74 6f 20 67 6f  20 21 0a 20 20 20 52 45  |me to go !.   RE|
00000f50  4d 20 20 20 20 20 22 53  75 63 63 65 73 73 20 2d  |M     "Success -|
00000f60  20 65 78 69 74 69 6e 67  20 21 22 0a 24 65 78 69  | exiting !".$exi|
00000f70  74 0a 20 20 20 4d 4f 56  20 20 20 20 20 73 70 2c  |t.   MOV     sp,|
00000f80  72 36 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |r6              |
00000f90  20 20 20 20 20 20 20 20  20 20 20 3b 20 72 65 73  |           ; res|
00000fa0  74 6f 72 65 20 74 68 65  20 73 74 61 63 6b 20 70  |tore the stack p|
00000fb0  6f 69 6e 74 65 72 0a 20  20 20 58 4c 44 4d 46 44  |ointer.   XLDMFD|
00000fc0  20 20 28 73 70 29 21 2c  7b 72 30 2d 72 37 2c 70  |  (sp)!,{r0-r7,p|
00000fd0  63 7d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |c}              |
00000fe0  3b 20 52 65 74 75 72 6e  20 66 72 6f 6d 20 63 61  |; Return from ca|
00000ff0  6c 6c 0a 0a 23 50 6f 73  74 0a 23 52 75 6e 20 3c  |ll..#Post.#Run <|
00001000  43 4f 44 45 3e 0a                                 |CODE>.|
00001006