Home » Archimedes archive » Acorn User » AU 1998-13 (Christmas).adf » Regulars » StarInfo/Leonard/Resizes

StarInfo/Leonard/Resizes

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1998-13 (Christmas).adf » Regulars
Filename: StarInfo/Leonard/Resizes
Read OK:
File size: 2BE2 bytes
Load address: 0000
Exec address: 0000
File contents
    1REM vi:set sts=4 sw=4 tw=0 expandtab:
    2
    3REM LEN 1998, Thomas Leonard
    4
    5Prog$       = "Resize"
    6Version$    = "1.00 (10 Aug 1998) � Thomas Leonard"
    7Dest$       = "Boot:Choices.Boot.Tasks.Resize"
    8WimpSlot%   = 1024 * 4
    9Base%       = &0
   10
   11ON ERROR PROCerror
   12
   13DIM code WimpSlot%
   14PROCassemble                                
   15PROCsave(Dest$,code,O%,"Module")
   16
   17OSCLI "/" + Dest$
   18END
   19
   20REM Display the error in a form that QuickFix can read easily
   21DEF PROCerror
   22ON ERROR OFF
   23PRINT STR$(ERL / 10) + " : " + REPORT$
   24*Quit
   25ENDPROC
   26
   27DEF PROCsave(File$,Start%,End%,Type$)
   28LOCAL Type%
   29SYS "OS_FSControl",31,Type$ TO ,,Type%
   30SYS "OS_File",10,File$,Type%,,Start%,End%
   31ENDPROC
   32
   33DEF PROCassemble
   34
   35sp = 13
   36lk = 14
   37
   38FOR I% = 12 TO 14 STEP 2
   39
   40  O% = code
   41  P% = Base%
   42  L% = O% + WimpSlot%
   43
   44  [OPT I%
   45    equd    0           ;start_code
   46    equd    init_code
   47    equd    final_code
   48    equd    0           ;service_code
   49    equd    s_title
   50    equd    s_help
   51    equd    0           ;commands
   52    equd    0           ;SWI chunk base
   53    equd    0           ;swi_handler
   54    equd    0           ;swi_table
   55    equd    0           ;decoding code
   56
   57.init_code
   58    stmfd   (sp)!,{lk}
   59    adr     r0,s_filter
   60    adr     r1,filer_code
   61    mov     r2,r12
   62    mov     r3,#0           ;apply to all tasks
   63    mvn     r4,#1 << 2      ;trap OpenWindow requests
   64    swi     "XFilter_RegisterPostFilter"
   65    ldmfd   (sp)!,{pc}
   66
   67.final_code
   68    stmfd   (sp)!,{lk}
   69    adr     r0,s_filter
   70    adr     r1,filer_code
   71    mov     r2,r12
   72    mov     r3,#0           ;applied to all tasks
   73    mvn     r4,#1 << 2      ;stop trapping OpenWindow requests
   74    swi     "XFilter_DeRegisterPostFilter"
   75    ldmfd   (sp)!,{pc}^
   76
   77.s_filter   ; Same as module title
   78.s_title    :=Prog$:=0
   79.s_help     :=Prog$:=9:=9:=Version$:=0
   80
   81    align
   82
   83.filer_code
   84    teq     r0,#2           ;ignore toolbox events (can't be masked out)
   85    movnes  pc,lk
   86    ldr     r0,[r1,#28]
   87    cmn     r0,#2           ;click on back icon?
   88    mov     r0,#2
   89    movnes  pc,lk           ;no - pass the request on
   90    stmfd   (sp)!,{r0-r9,lk}
   91
   92    ldr     r2,[r1,#0]      ;r2 is the window handle
   93
   94    ; We know the user clicked on the back icon, but did they use Adjust?
   95
   96    sub     sp,sp,#20
   97    mov     r1,sp
   98    swi     "XWimp_GetPointerInfo"
   99    ldr     r0,[r1,#8]
  100    ; r0 = button state
  101    ; r2 = window handle
  102    teq     r0,#1               ;Adjust used to send window to back?
  103    addne   sp,sp,#20
  104    ldmnefd (sp)!,{r0-r9,pc}^   ;no - pass event on
  105
  106    ; Can the window normally be resized?
  107    ; If not, we'd better not resize it!
  108
  109    ; --->8--->8--- Cut this bit out if you don't want the check.
  110
  111    sub     sp,sp,#92 - 20
  112    str     r2,[sp]
  113    orr     r1,sp,#1
  114    swi     "XWimp_GetWindowInfo"
  115    ldr     r0,[sp,#32]         ;r0 = window flags
  116    add     sp,sp,#92 - 20
  117
  118    tst     r0,#&28000000       ;are there adjust-size or toggle-size icons?
  119    addeq   sp,sp,#24
  120    mvneq   r0,#0               ;no - do nothing (but prevent move to back)
  121    ldmeqfd (sp)!,{r1-r9,pc}^
  122    
  123    ; ---8<---8<--- End of cut.
  124    
  125    ; Read the initial size for the draggable outline.
  126
  127    mov     r1,sp
  128    str     r2,[r1]
  129    swi     "XWimp_GetWindowOutline"
  130
  131    ; Clip the bounding box to the screen size, so all
  132    ; sides can be dragged.
  133
  134    ; First - read the current screen size.
  135    
  136    adr     r0,vdu_vars
  137    sub     sp,sp,#4 * 4
  138    mov     r1,sp
  139    swi     "XOS_ReadVduVariables"
  140    ldr     r0,[r1,#0]      ;X eigen factor
  141    ldr     r2,[r1,#8]      ;X pixels on screen
  142    mov     r2,r2,lsl r0
  143    ldr     r0,[r1,#4]      ;Y eigen factor
  144    ldr     r3,[r1,#12]     ;Y pixels on screen
  145    mov     r3,r3,lsl r0
  146
  147    ; (r2,r3) is the top-right OS-coordinate.
  148
  149    add     sp,sp,#4 * 4
  150
  151    ; Now clip the initial box to the screen limits.
  152    ; Note - only the detection box is clipped, not the box
  153    ; plotted on the screen.
  154
  155    add     r1,sp,#4
  156    ldmia   r1,{r4-r7}      ;get bounding box in (r4,r5) ; (r6,r7)
  157    cmp     r6,r2           ;limit max X
  158    movgt   r6,r2
  159    cmp     r7,r3           ;limit max Y
  160    movgt   r7,r3
  161    cmp     r4,#0           ;limit min X
  162    movlt   r4,#0
  163    cmp     r5,#0           ;limit min y
  164    movlt   r5,#0
  165    
  166    mov     r0,#&40         ;select 'invert' plotting mode
  167    swi     "XWimp_SetColour"
  168
  169    ; Show the current window limits so the user can decide
  170    ; which edge(s) to move.
  171
  172    bl      show_outline
  173
  174    ; Wait until the user moves across one of the edges...
  175
  176.l_find_edge
  177    swi     "XOS_Mouse"
  178    teq     r2,#0
  179    beq     abort_resize        ;all mouse buttons released - abort
  180    cmp     r0,r4
  181    cmpgt   r1,r5
  182    ble     hit_side
  183    cmp     r0,r6
  184    cmplt   r1,r7
  185    blt     l_find_edge
  186.hit_side
  187
  188    ; Get mouse coord as offset from bottom-left of window and scale up by 3.
  189    ; Decide which side(s) need moving.
  190
  191    sub     r0,r0,r4
  192    sub     r1,r1,r5
  193    add     r0,r0,r0,lsl#1
  194    add     r1,r1,r1,lsl#1
  195    
  196    sub     r4,r6,r4        ;r4 = width of window
  197    sub     r5,r7,r5        ;r5 = height of window
  198
  199    cmp     r0,r4
  200    movlt   r6,#4           ;make left side moveable if left of middle column
  201    movge   r6,#0
  202    cmp     r0,r4,lsl#1
  203    movgt   r6,#12          ;make right side moveable if right of middle column
  204    ldr     r8,[sp,r6]
  205    subgt   r8,r8,#1        ;right ordinate is exclusive
  206
  207    cmp     r1,r5
  208    movlt   r7,#8           ;make bottom moveable if below middle row
  209    movge   r7,#0
  210    cmp     r1,r5,lsl#1
  211    movgt   r7,#16          ;make top moveable if above middle row
  212    ldr     r9,[sp,r7]
  213    subgt   r9,r9,#1        ;top ordinate is exclusive
  214    
  215    ; (r8,r9) is the initial mouse position (so we can find out how much
  216    ; we moved).
  217    ; Note - we use the point at which the mouse crossed the line, not
  218    ; where it was when we noticed the fact (does make a difference!)
  219    
  220    ; r6,r7 are the offsets from sp to store new_x and new_y at.
  221    ; Zero for static.
  222
  223    mov     r4,r8
  224    mov     r5,r9
  225.l_resize
  226    ; (r4,r5) is the previous mouse position (to stop flickering)
  227    swi     "XOS_Mouse"
  228    cmp     r0,r4
  229    cmpeq   r1,r5
  230    beq     mouse_didnt_move
  231    
  232    bl      show_outline    ;remove old window outline from screen
  233    str     r0,[sp,r6]
  234    str     r1,[sp,r7]
  235    bl      show_outline    ;plot new window outline
  236    mov     r4,r0
  237    mov     r5,r1
  238.mouse_didnt_move
  239    teq     r2,#0           ;keep resizing until all mouse buttons are released
  240    bne     l_resize
  241
  242    ; Finished dragging - update the poll block and continue with OpenWindow.
  243
  244    bl      show_outline
  245    add     sp,sp,#20
  246    sub     r2,r0,r8
  247    sub     r3,r1,r9
  248    
  249    ; r2,r3 are the ammount we moved by.
  250    ; Remember - we have the new outline position, not the new
  251    ; visible area.
  252    ; Get the current window position and update the side(s) we moved.
  253
  254    ldr     r1,[sp,#4]      ;get stacked r1 (application's poll block)
  255    swi     "XWimp_GetWindowState"
  256    cmp     r6,#0
  257    ldrne   r0,[r1,r6]
  258    addne   r0,r0,r2
  259    strne   r0,[r1,r6]
  260    cmp     r7,#0
  261    ldrne   r0,[r1,r7]
  262    addne   r0,r0,r3
  263    strne   r0,[r1,r7]
  264
  265    ; Make sure the coords are the right way around...
  266
  267    ldr     r0,[r1,#4]
  268    ldr     r2,[r1,#12]
  269    cmp     r0,r2
  270    strgt   r0,[r1,#12]
  271    strgt   r2,[r1,#4]
  272
  273    ldr     r0,[r1,#8]
  274    ldr     r2,[r1,#16]
  275    cmp     r0,r2
  276    strgt   r0,[r1,#16]
  277    strgt   r2,[r1,#8]
  278    ldmfd   (sp)!,{r0-r9,pc}^   ;pass on the (modified) OpenWindow request
  279.vdu_vars
  280    equd    4       ; X eigen factor
  281    equd    5       ; Y eigen factor
  282    equd    11      ; X pixels on screen - 1
  283    equd    12      ; Y pixels on screen - 1
  284    equd    -1
  285
  286.abort_resize
  287    bl      show_outline
  288    mvn     r0,#0
  289    add     sp,sp,#24
  290    ldmfd   (sp)!,{r1-r9,pc}^
  291
  292    ;           show_outline
  293    ; => sp -> bounding box structure (as from Wimp_GetWindowOutline)
  294    ; Plots box with grid (select the plotting colour first).
  295.show_outline
  296    stmfd   (sp)!,{r0-r5,lk}
  297    add     r1,sp,#4 * 8
  298    ldmia   r1,{r1-r4}      ;get bounding box of window outline
  299
  300    sub     r3,r3,r1        ;r3 = width of box
  301    sub     r4,r4,r2        ;r4 = height of box
  302    mov     r0,#4
  303    swi     "XOS_Plot"      ;move to bottom left corner
  304    sub     r3,r3,#1
  305    sub     r4,r4,#1
  306    
  307    ; From here on, all coords are relative.
  308
  309    ; Plot the border.
  310
  311    mov     r0,#1 + 8       ;plot bottom edge
  312    mov     r1,r3
  313    mov     r2,#0
  314    swi     "XOS_Plot"
  315    mov     r0,#1 + 8       ;plot right edge
  316    mov     r1,#0
  317    mov     r2,r4
  318    swi     "XOS_Plot"
  319    mov     r0,#1 + 8       ;plot top
  320    rsb     r1,r3,#0
  321    mov     r2,#0
  322    swi     "XOS_Plot"
  323    mov     r0,#1 + 8       ;plot left edge
  324    mov     r1,#0
  325    rsb     r2,r4,#0
  326    swi     "XOS_Plot"
  327
  328    ; Draw the grid.
  329    ; Graphics cursor is back at the bottom-left.
  330    ; Plot excluding both endpoints in all lines now.
  331
  332    ; Do r5 = r3 / 3 to find the horizontal grid spacing.
  333
  334    mov     r0,#43
  335    mul     r1,r3,r0
  336    mov     r5,r1,lsr#7
  337
  338    ; Plot the two vertical bars.
  339
  340    mov     r0,#0 + 40  ; move relative
  341    mov     r1,r5
  342    mov     r2,#0
  343    swi     "XOS_Plot"
  344    mov     r0,#1 + 40  ; plot relative
  345    mov     r1,#0
  346    mov     r2,r4
  347    swi     "XOS_Plot"
  348    mov     r0,#0 + 40  ; move relative
  349    mov     r1,r5
  350    mov     r2,#0
  351    swi     "XOS_Plot"
  352    mov     r0,#1 + 40  ; plot relative
  353    mov     r1,#0
  354    rsb     r2,r4,#0
  355    swi     "XOS_Plot"
  356
  357    ; Plot the two horizontal bars.
  358    ; We are now at the bottom of the right inside bar.
  359
  360    rsb     r1,r5,#0
  361    mov     r1,r1,lsl#1
  362    ; Do r5 = r4 / 3 to find vertical spacing.
  363    mov     r0,#43
  364    mul     r2,r4,r0
  365    mov     r5,r2,lsr#7
  366    mov     r2,r5
  367    mov     r0,#0 + 40  ;move to left end of the lower bar
  368    swi     "XOS_Plot"
  369    mov     r0,#1 + 40  ;plot lower bar
  370    mov     r1,r3
  371    mov     r2,#0
  372    swi     "XOS_Plot"
  373    mov     r0,#0 + 40  ;move to right end of upper bar
  374    mov     r1,#0
  375    mov     r2,r5
  376    swi     "XOS_Plot"
  377    mov     r0,#1 + 40  ;plot upper bar
  378    rsb     r1,r3,#0
  379    mov     r2,#0
  380    swi     "XOS_Plot"
  381    ldmfd   (sp)!,{r0-r5,pc}^
  382  ]
  383NEXT I%
  384ENDPROC
  385
'� vi:set sts=4 sw=4 tw=0 expandtab:

� � 1998, Thomas Leonard

Prog$       = "Resize"
7Version$    = "1.00 (10 Aug 1998) � Thomas Leonard"
2Dest$       = "Boot:Choices.Boot.Tasks.Resize"
WimpSlot%   = 1024 * 4
	Base%       = &0


� � �error


� code WimpSlot%
-�assemble                                
!�save(Dest$,code,O%,"Module")

� "/" + Dest$
�

?� Display the error in a form that QuickFix can read easily
� �error
	� � �
� �(� / 10) + " : " + �$
	*Quit
�

$� �save(File$,Start%,End%,Type$)
� Type%
(ș "OS_FSControl",31,Type$ � ,,Type%
,ș "OS_File",10,File$,Type%,,Start%,End%
�
 
!� �assemble
"
#sp = 13
$lk = 14
%
&� I% = 12 � 14 � 2
'
(  O% = code
)  P% = Base%
*  L% = O% + WimpSlot%
+
,
  [OPT I%
-'    equd    0           ;start_code
.    equd    init_code
/    equd    final_code
0)    equd    0           ;service_code
1    equd    s_title
2    equd    s_help
3%    equd    0           ;commands
4+    equd    0           ;SWI chunk base
5(    equd    0           ;swi_handler
6&    equd    0           ;swi_table
7*    equd    0           ;decoding code
8
9.init_code
:    stmfd   (sp)!,{lk}
;    adr     r0,s_filter
<    adr     r1,filer_code
=    mov     r2,r12
>3    mov     r3,#0           ;apply to all tasks
?9    mvn     r4,#1 << 2      ;trap OpenWindow requests
@,    swi     "XFilter_RegisterPostFilter"
A    ldmfd   (sp)!,{pc}
B
C.final_code
D    stmfd   (sp)!,{lk}
E    adr     r0,s_filter
F    adr     r1,filer_code
G    mov     r2,r12
H5    mov     r3,#0           ;applied to all tasks
IB    mvn     r4,#1 << 2      ;stop trapping OpenWindow requests
J.    swi     "XFilter_DeRegisterPostFilter"
K    ldmfd   (sp)!,{pc}^
L
M&.s_filter   ; Same as module title
N.s_title    :=Prog$:=0
O*.s_help     :=Prog$:=9:=9:=Version$:=0
P
Q
    align
R
S.filer_code
TL    teq     r0,#2           ;ignore toolbox events (can't be masked out)
U    movnes  pc,lk
V    ldr     r0,[r1,#28]
W4    cmn     r0,#2           ;click on back icon?
X    mov     r0,#2
Y9    movnes  pc,lk           ;no - pass the request on
Z     stmfd   (sp)!,{r0-r9,lk}
[
\8    ldr     r2,[r1,#0]      ;r2 is the window handle
]
^M    ; We know the user clicked on the back icon, but did they use Adjust?
_
`    sub     sp,sp,#20
a    mov     r1,sp
b&    swi     "XWimp_GetPointerInfo"
c    ldr     r0,[r1,#8]
d    ; r0 = button state
e    ; r2 = window handle
fH    teq     r0,#1               ;Adjust used to send window to back?
g    addne   sp,sp,#20
h7    ldmnefd (sp)!,{r0-r9,pc}^   ;no - pass event on
i
j-    ; Can the window normally be resized?
k,    ; If not, we'd better not resize it!
l
mE    ; --->8--->8--- Cut this bit out if you don't want the check.
n
o    sub     sp,sp,#92 - 20
p    str     r2,[sp]
q    orr     r1,sp,#1
r%    swi     "XWimp_GetWindowInfo"
s6    ldr     r0,[sp,#32]         ;r0 = window flags
t    add     sp,sp,#92 - 20
u
vP    tst     r0,#&28000000       ;are there adjust-size or toggle-size icons?
w    addeq   sp,sp,#24
xO    mvneq   r0,#0               ;no - do nothing (but prevent move to back)
y!    ldmeqfd (sp)!,{r1-r9,pc}^
z    
{#    ; ---8<---8<--- End of cut.
|    
}:    ; Read the initial size for the draggable outline.
~
    mov     r1,sp
�    str     r2,[r1]
�(    swi     "XWimp_GetWindowOutline"
�
�:    ; Clip the bounding box to the screen size, so all
�    ; sides can be dragged.
�
�/    ; First - read the current screen size.
�    
�    adr     r0,vdu_vars
�    sub     sp,sp,#4 * 4
�    mov     r1,sp
�&    swi     "XOS_ReadVduVariables"
�/    ldr     r0,[r1,#0]      ;X eigen factor
�3    ldr     r2,[r1,#8]      ;X pixels on screen
�    mov     r2,r2,lsl r0
�/    ldr     r0,[r1,#4]      ;Y eigen factor
�3    ldr     r3,[r1,#12]     ;Y pixels on screen
�    mov     r3,r3,lsl r0
�
�1    ; (r2,r3) is the top-right OS-coordinate.
�
�    add     sp,sp,#4 * 4
�
�8    ; Now clip the initial box to the screen limits.
�?    ; Note - only the detection box is clipped, not the box
�     ; plotted on the screen.
�
�    add     r1,sp,#4
�F    ldmia   r1,{r4-r7}      ;get bounding box in (r4,r5) ; (r6,r7)
�,    cmp     r6,r2           ;limit max X
�    movgt   r6,r2
�,    cmp     r7,r3           ;limit max Y
�    movgt   r7,r3
�,    cmp     r4,#0           ;limit min X
�    movlt   r4,#0
�,    cmp     r5,#0           ;limit min y
�    movlt   r5,#0
�    
�>    mov     r0,#&40         ;select 'invert' plotting mode
�!    swi     "XWimp_SetColour"
�
�?    ; Show the current window limits so the user can decide
�     ; which edge(s) to move.
�
�    bl      show_outline
�
�>    ; Wait until the user moves across one of the edges...
�
�.l_find_edge
�    swi     "XOS_Mouse"
�    teq     r2,#0
�G    beq     abort_resize        ;all mouse buttons released - abort
�    cmp     r0,r4
�    cmpgt   r1,r5
�    ble     hit_side
�    cmp     r0,r6
�    cmplt   r1,r7
�    blt     l_find_edge
�
.hit_side
�
�Q    ; Get mouse coord as offset from bottom-left of window and scale up by 3.
�+    ; Decide which side(s) need moving.
�
�    sub     r0,r0,r4
�    sub     r1,r1,r5
�    add     r0,r0,r0,lsl#1
�    add     r1,r1,r1,lsl#1
�    
�5    sub     r4,r6,r4        ;r4 = width of window
�6    sub     r5,r7,r5        ;r5 = height of window
�
�    cmp     r0,r4
�Q    movlt   r6,#4           ;make left side moveable if left of middle column
�    movge   r6,#0
�    cmp     r0,r4,lsl#1
�S    movgt   r6,#12          ;make right side moveable if right of middle column
�    ldr     r8,[sp,r6]
�<    subgt   r8,r8,#1        ;right ordinate is exclusive
�
�    cmp     r1,r5
�I    movlt   r7,#8           ;make bottom moveable if below middle row
�    movge   r7,#0
�    cmp     r1,r5,lsl#1
�F    movgt   r7,#16          ;make top moveable if above middle row
�    ldr     r9,[sp,r7]
�:    subgt   r9,r9,#1        ;top ordinate is exclusive
�    
�L    ; (r8,r9) is the initial mouse position (so we can find out how much
�    ; we moved).
�J    ; Note - we use the point at which the mouse crossed the line, not
�I    ; where it was when we noticed the fact (does make a difference!)
�    
�D    ; r6,r7 are the offsets from sp to store new_x and new_y at.
�    ; Zero for static.
�
�    mov     r4,r8
�    mov     r5,r9
�
.l_resize
�E    ; (r4,r5) is the previous mouse position (to stop flickering)
�    swi     "XOS_Mouse"
�    cmp     r0,r4
�    cmpeq   r1,r5
�     beq     mouse_didnt_move
�    
�F    bl      show_outline    ;remove old window outline from screen
�    str     r0,[sp,r6]
�    str     r1,[sp,r7]
�8    bl      show_outline    ;plot new window outline
�    mov     r4,r0
�    mov     r5,r1
�.mouse_didnt_move
�S    teq     r2,#0           ;keep resizing until all mouse buttons are released
�    bne     l_resize
�
�Q    ; Finished dragging - update the poll block and continue with OpenWindow.
�
�    bl      show_outline
�    add     sp,sp,#20
�    sub     r2,r0,r8
�    sub     r3,r1,r9
�    
�,    ; r2,r3 are the ammount we moved by.
�B    ; Remember - we have the new outline position, not the new
�    ; visible area.
�J    ; Get the current window position and update the side(s) we moved.
�
�J    ldr     r1,[sp,#4]      ;get stacked r1 (application's poll block)
�&    swi     "XWimp_GetWindowState"
    cmp     r6,#0
    ldrne   r0,[r1,r6]
    addne   r0,r0,r2
    strne   r0,[r1,r6]
    cmp     r7,#0
    ldrne   r0,[r1,r7]
    addne   r0,r0,r3
    strne   r0,[r1,r7]

	:    ; Make sure the coords are the right way around...


    ldr     r0,[r1,#4]
    ldr     r2,[r1,#12]

    cmp     r0,r2
    strgt   r0,[r1,#12]
    strgt   r2,[r1,#4]

    ldr     r0,[r1,#8]
    ldr     r2,[r1,#16]
    cmp     r0,r2
    strgt   r0,[r1,#16]
    strgt   r2,[r1,#8]
N    ldmfd   (sp)!,{r0-r9,pc}^   ;pass on the (modified) OpenWindow request

.vdu_vars
(    equd    4       ; X eigen factor
(    equd    5       ; Y eigen factor
0    equd    11      ; X pixels on screen - 1
0    equd    12      ; Y pixels on screen - 1
    equd    -1

.abort_resize
    bl      show_outline
     mvn     r0,#0
!    add     sp,sp,#24
"!    ldmfd   (sp)!,{r1-r9,pc}^
#
$     ;           show_outline
%I    ; => sp -> bounding box structure (as from Wimp_GetWindowOutline)
&A    ; Plots box with grid (select the plotting colour first).
'.show_outline
(     stmfd   (sp)!,{r0-r5,lk}
)    add     r1,sp,#4 * 8
*C    ldmia   r1,{r1-r4}      ;get bounding box of window outline
+
,2    sub     r3,r3,r1        ;r3 = width of box
-3    sub     r4,r4,r2        ;r4 = height of box
.    mov     r0,#4
/;    swi     "XOS_Plot"      ;move to bottom left corner
0    sub     r3,r3,#1
1    sub     r4,r4,#1
2    
30    ; From here on, all coords are relative.
4
5    ; Plot the border.
6
71    mov     r0,#1 + 8       ;plot bottom edge
8    mov     r1,r3
9    mov     r2,#0
:    swi     "XOS_Plot"
;0    mov     r0,#1 + 8       ;plot right edge
<    mov     r1,#0
=    mov     r2,r4
>    swi     "XOS_Plot"
?)    mov     r0,#1 + 8       ;plot top
@    rsb     r1,r3,#0
A    mov     r2,#0
B    swi     "XOS_Plot"
C/    mov     r0,#1 + 8       ;plot left edge
D    mov     r1,#0
E    rsb     r2,r4,#0
F    swi     "XOS_Plot"
G
H    ; Draw the grid.
I5    ; Graphics cursor is back at the bottom-left.
J9    ; Plot excluding both endpoints in all lines now.
K
L=    ; Do r5 = r3 / 3 to find the horizontal grid spacing.
M
N    mov     r0,#43
O    mul     r1,r3,r0
P    mov     r5,r1,lsr#7
Q
R%    ; Plot the two vertical bars.
S
T+    mov     r0,#0 + 40  ; move relative
U    mov     r1,r5
V    mov     r2,#0
W    swi     "XOS_Plot"
X+    mov     r0,#1 + 40  ; plot relative
Y    mov     r1,#0
Z    mov     r2,r4
[    swi     "XOS_Plot"
\+    mov     r0,#0 + 40  ; move relative
]    mov     r1,r5
^    mov     r2,#0
_    swi     "XOS_Plot"
`+    mov     r0,#1 + 40  ; plot relative
a    mov     r1,#0
b    rsb     r2,r4,#0
c    swi     "XOS_Plot"
d
e'    ; Plot the two horizontal bars.
f;    ; We are now at the bottom of the right inside bar.
g
h    rsb     r1,r5,#0
i    mov     r1,r1,lsl#1
j2    ; Do r5 = r4 / 3 to find vertical spacing.
k    mov     r0,#43
l    mul     r2,r4,r0
m    mov     r5,r2,lsr#7
n    mov     r2,r5
o>    mov     r0,#0 + 40  ;move to left end of the lower bar
p    swi     "XOS_Plot"
q+    mov     r0,#1 + 40  ;plot lower bar
r    mov     r1,r3
s    mov     r2,#0
t    swi     "XOS_Plot"
u;    mov     r0,#0 + 40  ;move to right end of upper bar
v    mov     r1,#0
w    mov     r2,r5
x    swi     "XOS_Plot"
y+    mov     r0,#1 + 40  ;plot upper bar
z    rsb     r1,r3,#0
{    mov     r2,#0
|    swi     "XOS_Plot"
}!    ldmfd   (sp)!,{r0-r5,pc}^
~  ]
� I%
��
�
�
00000000  0d 00 01 27 f4 20 76 69  3a 73 65 74 20 73 74 73  |...'. vi:set sts|
00000010  3d 34 20 73 77 3d 34 20  74 77 3d 30 20 65 78 70  |=4 sw=4 tw=0 exp|
00000020  61 6e 64 74 61 62 3a 0d  00 02 04 0d 00 03 1c f4  |andtab:.........|
00000030  20 a9 20 31 39 39 38 2c  20 54 68 6f 6d 61 73 20  | . 1998, Thomas |
00000040  4c 65 6f 6e 61 72 64 0d  00 04 04 0d 00 05 1a 50  |Leonard........P|
00000050  72 6f 67 24 20 20 20 20  20 20 20 3d 20 22 52 65  |rog$       = "Re|
00000060  73 69 7a 65 22 0d 00 06  37 56 65 72 73 69 6f 6e  |size"...7Version|
00000070  24 20 20 20 20 3d 20 22  31 2e 30 30 20 28 31 30  |$    = "1.00 (10|
00000080  20 41 75 67 20 31 39 39  38 29 20 a9 20 54 68 6f  | Aug 1998) . Tho|
00000090  6d 61 73 20 4c 65 6f 6e  61 72 64 22 0d 00 07 32  |mas Leonard"...2|
000000a0  44 65 73 74 24 20 20 20  20 20 20 20 3d 20 22 42  |Dest$       = "B|
000000b0  6f 6f 74 3a 43 68 6f 69  63 65 73 2e 42 6f 6f 74  |oot:Choices.Boot|
000000c0  2e 54 61 73 6b 73 2e 52  65 73 69 7a 65 22 0d 00  |.Tasks.Resize"..|
000000d0  08 1a 57 69 6d 70 53 6c  6f 74 25 20 20 20 3d 20  |..WimpSlot%   = |
000000e0  31 30 32 34 20 2a 20 34  0d 00 09 14 42 61 73 65  |1024 * 4....Base|
000000f0  25 20 20 20 20 20 20 20  3d 20 26 30 0d 00 0a 04  |%       = &0....|
00000100  0d 00 0b 0e ee 20 85 20  f2 65 72 72 6f 72 0d 00  |..... . .error..|
00000110  0c 04 0d 00 0d 14 de 20  63 6f 64 65 20 57 69 6d  |....... code Wim|
00000120  70 53 6c 6f 74 25 0d 00  0e 2d f2 61 73 73 65 6d  |pSlot%...-.assem|
00000130  62 6c 65 20 20 20 20 20  20 20 20 20 20 20 20 20  |ble             |
00000140  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000150  20 20 20 0d 00 0f 21 f2  73 61 76 65 28 44 65 73  |   ...!.save(Des|
00000160  74 24 2c 63 6f 64 65 2c  4f 25 2c 22 4d 6f 64 75  |t$,code,O%,"Modu|
00000170  6c 65 22 29 0d 00 10 04  0d 00 11 11 ff 20 22 2f  |le")......... "/|
00000180  22 20 2b 20 44 65 73 74  24 0d 00 12 05 e0 0d 00  |" + Dest$.......|
00000190  13 04 0d 00 14 3f f4 20  44 69 73 70 6c 61 79 20  |.....?. Display |
000001a0  74 68 65 20 65 72 72 6f  72 20 69 6e 20 61 20 66  |the error in a f|
000001b0  6f 72 6d 20 74 68 61 74  20 51 75 69 63 6b 46 69  |orm that QuickFi|
000001c0  78 20 63 61 6e 20 72 65  61 64 20 65 61 73 69 6c  |x can read easil|
000001d0  79 0d 00 15 0c dd 20 f2  65 72 72 6f 72 0d 00 16  |y..... .error...|
000001e0  09 ee 20 85 20 87 0d 00  17 1c f1 20 c3 28 9e 20  |.. . ...... .(. |
000001f0  2f 20 31 30 29 20 2b 20  22 20 3a 20 22 20 2b 20  |/ 10) + " : " + |
00000200  f6 24 0d 00 18 09 2a 51  75 69 74 0d 00 19 05 e1  |.$....*Quit.....|
00000210  0d 00 1a 04 0d 00 1b 24  dd 20 f2 73 61 76 65 28  |.......$. .save(|
00000220  46 69 6c 65 24 2c 53 74  61 72 74 25 2c 45 6e 64  |File$,Start%,End|
00000230  25 2c 54 79 70 65 24 29  0d 00 1c 0b ea 20 54 79  |%,Type$)..... Ty|
00000240  70 65 25 0d 00 1d 28 c8  99 20 22 4f 53 5f 46 53  |pe%...(.. "OS_FS|
00000250  43 6f 6e 74 72 6f 6c 22  2c 33 31 2c 54 79 70 65  |Control",31,Type|
00000260  24 20 b8 20 2c 2c 54 79  70 65 25 0d 00 1e 2c c8  |$ . ,,Type%...,.|
00000270  99 20 22 4f 53 5f 46 69  6c 65 22 2c 31 30 2c 46  |. "OS_File",10,F|
00000280  69 6c 65 24 2c 54 79 70  65 25 2c 2c 53 74 61 72  |ile$,Type%,,Star|
00000290  74 25 2c 45 6e 64 25 0d  00 1f 05 e1 0d 00 20 04  |t%,End%....... .|
000002a0  0d 00 21 0f dd 20 f2 61  73 73 65 6d 62 6c 65 0d  |..!.. .assemble.|
000002b0  00 22 04 0d 00 23 0b 73  70 20 3d 20 31 33 0d 00  |."...#.sp = 13..|
000002c0  24 0b 6c 6b 20 3d 20 31  34 0d 00 25 04 0d 00 26  |$.lk = 14..%...&|
000002d0  16 e3 20 49 25 20 3d 20  31 32 20 b8 20 31 34 20  |.. I% = 12 . 14 |
000002e0  88 20 32 0d 00 27 04 0d  00 28 0f 20 20 4f 25 20  |. 2..'...(.  O% |
000002f0  3d 20 63 6f 64 65 0d 00  29 10 20 20 50 25 20 3d  |= code..).  P% =|
00000300  20 42 61 73 65 25 0d 00  2a 19 20 20 4c 25 20 3d  | Base%..*.  L% =|
00000310  20 4f 25 20 2b 20 57 69  6d 70 53 6c 6f 74 25 0d  | O% + WimpSlot%.|
00000320  00 2b 04 0d 00 2c 0d 20  20 5b 4f 50 54 20 49 25  |.+...,.  [OPT I%|
00000330  0d 00 2d 27 20 20 20 20  65 71 75 64 20 20 20 20  |..-'    equd    |
00000340  30 20 20 20 20 20 20 20  20 20 20 20 3b 73 74 61  |0           ;sta|
00000350  72 74 5f 63 6f 64 65 0d  00 2e 19 20 20 20 20 65  |rt_code....    e|
00000360  71 75 64 20 20 20 20 69  6e 69 74 5f 63 6f 64 65  |qud    init_code|
00000370  0d 00 2f 1a 20 20 20 20  65 71 75 64 20 20 20 20  |../.    equd    |
00000380  66 69 6e 61 6c 5f 63 6f  64 65 0d 00 30 29 20 20  |final_code..0)  |
00000390  20 20 65 71 75 64 20 20  20 20 30 20 20 20 20 20  |  equd    0     |
000003a0  20 20 20 20 20 20 3b 73  65 72 76 69 63 65 5f 63  |      ;service_c|
000003b0  6f 64 65 0d 00 31 17 20  20 20 20 65 71 75 64 20  |ode..1.    equd |
000003c0  20 20 20 73 5f 74 69 74  6c 65 0d 00 32 16 20 20  |   s_title..2.  |
000003d0  20 20 65 71 75 64 20 20  20 20 73 5f 68 65 6c 70  |  equd    s_help|
000003e0  0d 00 33 25 20 20 20 20  65 71 75 64 20 20 20 20  |..3%    equd    |
000003f0  30 20 20 20 20 20 20 20  20 20 20 20 3b 63 6f 6d  |0           ;com|
00000400  6d 61 6e 64 73 0d 00 34  2b 20 20 20 20 65 71 75  |mands..4+    equ|
00000410  64 20 20 20 20 30 20 20  20 20 20 20 20 20 20 20  |d    0          |
00000420  20 3b 53 57 49 20 63 68  75 6e 6b 20 62 61 73 65  | ;SWI chunk base|
00000430  0d 00 35 28 20 20 20 20  65 71 75 64 20 20 20 20  |..5(    equd    |
00000440  30 20 20 20 20 20 20 20  20 20 20 20 3b 73 77 69  |0           ;swi|
00000450  5f 68 61 6e 64 6c 65 72  0d 00 36 26 20 20 20 20  |_handler..6&    |
00000460  65 71 75 64 20 20 20 20  30 20 20 20 20 20 20 20  |equd    0       |
00000470  20 20 20 20 3b 73 77 69  5f 74 61 62 6c 65 0d 00  |    ;swi_table..|
00000480  37 2a 20 20 20 20 65 71  75 64 20 20 20 20 30 20  |7*    equd    0 |
00000490  20 20 20 20 20 20 20 20  20 20 3b 64 65 63 6f 64  |          ;decod|
000004a0  69 6e 67 20 63 6f 64 65  0d 00 38 04 0d 00 39 0e  |ing code..8...9.|
000004b0  2e 69 6e 69 74 5f 63 6f  64 65 0d 00 3a 1a 20 20  |.init_code..:.  |
000004c0  20 20 73 74 6d 66 64 20  20 20 28 73 70 29 21 2c  |  stmfd   (sp)!,|
000004d0  7b 6c 6b 7d 0d 00 3b 1b  20 20 20 20 61 64 72 20  |{lk}..;.    adr |
000004e0  20 20 20 20 72 30 2c 73  5f 66 69 6c 74 65 72 0d  |    r0,s_filter.|
000004f0  00 3c 1d 20 20 20 20 61  64 72 20 20 20 20 20 72  |.<.    adr     r|
00000500  31 2c 66 69 6c 65 72 5f  63 6f 64 65 0d 00 3d 16  |1,filer_code..=.|
00000510  20 20 20 20 6d 6f 76 20  20 20 20 20 72 32 2c 72  |    mov     r2,r|
00000520  31 32 0d 00 3e 33 20 20  20 20 6d 6f 76 20 20 20  |12..>3    mov   |
00000530  20 20 72 33 2c 23 30 20  20 20 20 20 20 20 20 20  |  r3,#0         |
00000540  20 20 3b 61 70 70 6c 79  20 74 6f 20 61 6c 6c 20  |  ;apply to all |
00000550  74 61 73 6b 73 0d 00 3f  39 20 20 20 20 6d 76 6e  |tasks..?9    mvn|
00000560  20 20 20 20 20 72 34 2c  23 31 20 3c 3c 20 32 20  |     r4,#1 << 2 |
00000570  20 20 20 20 20 3b 74 72  61 70 20 4f 70 65 6e 57  |     ;trap OpenW|
00000580  69 6e 64 6f 77 20 72 65  71 75 65 73 74 73 0d 00  |indow requests..|
00000590  40 2c 20 20 20 20 73 77  69 20 20 20 20 20 22 58  |@,    swi     "X|
000005a0  46 69 6c 74 65 72 5f 52  65 67 69 73 74 65 72 50  |Filter_RegisterP|
000005b0  6f 73 74 46 69 6c 74 65  72 22 0d 00 41 1a 20 20  |ostFilter"..A.  |
000005c0  20 20 6c 64 6d 66 64 20  20 20 28 73 70 29 21 2c  |  ldmfd   (sp)!,|
000005d0  7b 70 63 7d 0d 00 42 04  0d 00 43 0f 2e 66 69 6e  |{pc}..B...C..fin|
000005e0  61 6c 5f 63 6f 64 65 0d  00 44 1a 20 20 20 20 73  |al_code..D.    s|
000005f0  74 6d 66 64 20 20 20 28  73 70 29 21 2c 7b 6c 6b  |tmfd   (sp)!,{lk|
00000600  7d 0d 00 45 1b 20 20 20  20 61 64 72 20 20 20 20  |}..E.    adr    |
00000610  20 72 30 2c 73 5f 66 69  6c 74 65 72 0d 00 46 1d  | r0,s_filter..F.|
00000620  20 20 20 20 61 64 72 20  20 20 20 20 72 31 2c 66  |    adr     r1,f|
00000630  69 6c 65 72 5f 63 6f 64  65 0d 00 47 16 20 20 20  |iler_code..G.   |
00000640  20 6d 6f 76 20 20 20 20  20 72 32 2c 72 31 32 0d  | mov     r2,r12.|
00000650  00 48 35 20 20 20 20 6d  6f 76 20 20 20 20 20 72  |.H5    mov     r|
00000660  33 2c 23 30 20 20 20 20  20 20 20 20 20 20 20 3b  |3,#0           ;|
00000670  61 70 70 6c 69 65 64 20  74 6f 20 61 6c 6c 20 74  |applied to all t|
00000680  61 73 6b 73 0d 00 49 42  20 20 20 20 6d 76 6e 20  |asks..IB    mvn |
00000690  20 20 20 20 72 34 2c 23  31 20 3c 3c 20 32 20 20  |    r4,#1 << 2  |
000006a0  20 20 20 20 3b 73 74 6f  70 20 74 72 61 70 70 69  |    ;stop trappi|
000006b0  6e 67 20 4f 70 65 6e 57  69 6e 64 6f 77 20 72 65  |ng OpenWindow re|
000006c0  71 75 65 73 74 73 0d 00  4a 2e 20 20 20 20 73 77  |quests..J.    sw|
000006d0  69 20 20 20 20 20 22 58  46 69 6c 74 65 72 5f 44  |i     "XFilter_D|
000006e0  65 52 65 67 69 73 74 65  72 50 6f 73 74 46 69 6c  |eRegisterPostFil|
000006f0  74 65 72 22 0d 00 4b 1b  20 20 20 20 6c 64 6d 66  |ter"..K.    ldmf|
00000700  64 20 20 20 28 73 70 29  21 2c 7b 70 63 7d 5e 0d  |d   (sp)!,{pc}^.|
00000710  00 4c 04 0d 00 4d 26 2e  73 5f 66 69 6c 74 65 72  |.L...M&.s_filter|
00000720  20 20 20 3b 20 53 61 6d  65 20 61 73 20 6d 6f 64  |   ; Same as mod|
00000730  75 6c 65 20 74 69 74 6c  65 0d 00 4e 1a 2e 73 5f  |ule title..N..s_|
00000740  74 69 74 6c 65 20 20 20  20 3a 3d 50 72 6f 67 24  |title    :=Prog$|
00000750  3a 3d 30 0d 00 4f 2a 2e  73 5f 68 65 6c 70 20 20  |:=0..O*.s_help  |
00000760  20 20 20 3a 3d 50 72 6f  67 24 3a 3d 39 3a 3d 39  |   :=Prog$:=9:=9|
00000770  3a 3d 56 65 72 73 69 6f  6e 24 3a 3d 30 0d 00 50  |:=Version$:=0..P|
00000780  04 0d 00 51 0d 20 20 20  20 61 6c 69 67 6e 0d 00  |...Q.    align..|
00000790  52 04 0d 00 53 0f 2e 66  69 6c 65 72 5f 63 6f 64  |R...S..filer_cod|
000007a0  65 0d 00 54 4c 20 20 20  20 74 65 71 20 20 20 20  |e..TL    teq    |
000007b0  20 72 30 2c 23 32 20 20  20 20 20 20 20 20 20 20  | r0,#2          |
000007c0  20 3b 69 67 6e 6f 72 65  20 74 6f 6f 6c 62 6f 78  | ;ignore toolbox|
000007d0  20 65 76 65 6e 74 73 20  28 63 61 6e 27 74 20 62  | events (can't b|
000007e0  65 20 6d 61 73 6b 65 64  20 6f 75 74 29 0d 00 55  |e masked out)..U|
000007f0  15 20 20 20 20 6d 6f 76  6e 65 73 20 20 70 63 2c  |.    movnes  pc,|
00000800  6c 6b 0d 00 56 1b 20 20  20 20 6c 64 72 20 20 20  |lk..V.    ldr   |
00000810  20 20 72 30 2c 5b 72 31  2c 23 32 38 5d 0d 00 57  |  r0,[r1,#28]..W|
00000820  34 20 20 20 20 63 6d 6e  20 20 20 20 20 72 30 2c  |4    cmn     r0,|
00000830  23 32 20 20 20 20 20 20  20 20 20 20 20 3b 63 6c  |#2           ;cl|
00000840  69 63 6b 20 6f 6e 20 62  61 63 6b 20 69 63 6f 6e  |ick on back icon|
00000850  3f 0d 00 58 15 20 20 20  20 6d 6f 76 20 20 20 20  |?..X.    mov    |
00000860  20 72 30 2c 23 32 0d 00  59 39 20 20 20 20 6d 6f  | r0,#2..Y9    mo|
00000870  76 6e 65 73 20 20 70 63  2c 6c 6b 20 20 20 20 20  |vnes  pc,lk     |
00000880  20 20 20 20 20 20 3b 6e  6f 20 2d 20 70 61 73 73  |      ;no - pass|
00000890  20 74 68 65 20 72 65 71  75 65 73 74 20 6f 6e 0d  | the request on.|
000008a0  00 5a 20 20 20 20 20 73  74 6d 66 64 20 20 20 28  |.Z     stmfd   (|
000008b0  73 70 29 21 2c 7b 72 30  2d 72 39 2c 6c 6b 7d 0d  |sp)!,{r0-r9,lk}.|
000008c0  00 5b 04 0d 00 5c 38 20  20 20 20 6c 64 72 20 20  |.[...\8    ldr  |
000008d0  20 20 20 72 32 2c 5b 72  31 2c 23 30 5d 20 20 20  |   r2,[r1,#0]   |
000008e0  20 20 20 3b 72 32 20 69  73 20 74 68 65 20 77 69  |   ;r2 is the wi|
000008f0  6e 64 6f 77 20 68 61 6e  64 6c 65 0d 00 5d 04 0d  |ndow handle..]..|
00000900  00 5e 4d 20 20 20 20 3b  20 57 65 20 6b 6e 6f 77  |.^M    ; We know|
00000910  20 74 68 65 20 75 73 65  72 20 63 6c 69 63 6b 65  | the user clicke|
00000920  64 20 6f 6e 20 74 68 65  20 62 61 63 6b 20 69 63  |d on the back ic|
00000930  6f 6e 2c 20 62 75 74 20  64 69 64 20 74 68 65 79  |on, but did they|
00000940  20 75 73 65 20 41 64 6a  75 73 74 3f 0d 00 5f 04  | use Adjust?.._.|
00000950  0d 00 60 19 20 20 20 20  73 75 62 20 20 20 20 20  |..`.    sub     |
00000960  73 70 2c 73 70 2c 23 32  30 0d 00 61 15 20 20 20  |sp,sp,#20..a.   |
00000970  20 6d 6f 76 20 20 20 20  20 72 31 2c 73 70 0d 00  | mov     r1,sp..|
00000980  62 26 20 20 20 20 73 77  69 20 20 20 20 20 22 58  |b&    swi     "X|
00000990  57 69 6d 70 5f 47 65 74  50 6f 69 6e 74 65 72 49  |Wimp_GetPointerI|
000009a0  6e 66 6f 22 0d 00 63 1a  20 20 20 20 6c 64 72 20  |nfo"..c.    ldr |
000009b0  20 20 20 20 72 30 2c 5b  72 31 2c 23 38 5d 0d 00  |    r0,[r1,#8]..|
000009c0  64 1b 20 20 20 20 3b 20  72 30 20 3d 20 62 75 74  |d.    ; r0 = but|
000009d0  74 6f 6e 20 73 74 61 74  65 0d 00 65 1c 20 20 20  |ton state..e.   |
000009e0  20 3b 20 72 32 20 3d 20  77 69 6e 64 6f 77 20 68  | ; r2 = window h|
000009f0  61 6e 64 6c 65 0d 00 66  48 20 20 20 20 74 65 71  |andle..fH    teq|
00000a00  20 20 20 20 20 72 30 2c  23 31 20 20 20 20 20 20  |     r0,#1      |
00000a10  20 20 20 20 20 20 20 20  20 3b 41 64 6a 75 73 74  |         ;Adjust|
00000a20  20 75 73 65 64 20 74 6f  20 73 65 6e 64 20 77 69  | used to send wi|
00000a30  6e 64 6f 77 20 74 6f 20  62 61 63 6b 3f 0d 00 67  |ndow to back?..g|
00000a40  19 20 20 20 20 61 64 64  6e 65 20 20 20 73 70 2c  |.    addne   sp,|
00000a50  73 70 2c 23 32 30 0d 00  68 37 20 20 20 20 6c 64  |sp,#20..h7    ld|
00000a60  6d 6e 65 66 64 20 28 73  70 29 21 2c 7b 72 30 2d  |mnefd (sp)!,{r0-|
00000a70  72 39 2c 70 63 7d 5e 20  20 20 3b 6e 6f 20 2d 20  |r9,pc}^   ;no - |
00000a80  70 61 73 73 20 65 76 65  6e 74 20 6f 6e 0d 00 69  |pass event on..i|
00000a90  04 0d 00 6a 2d 20 20 20  20 3b 20 43 61 6e 20 74  |...j-    ; Can t|
00000aa0  68 65 20 77 69 6e 64 6f  77 20 6e 6f 72 6d 61 6c  |he window normal|
00000ab0  6c 79 20 62 65 20 72 65  73 69 7a 65 64 3f 0d 00  |ly be resized?..|
00000ac0  6b 2c 20 20 20 20 3b 20  49 66 20 6e 6f 74 2c 20  |k,    ; If not, |
00000ad0  77 65 27 64 20 62 65 74  74 65 72 20 6e 6f 74 20  |we'd better not |
00000ae0  72 65 73 69 7a 65 20 69  74 21 0d 00 6c 04 0d 00  |resize it!..l...|
00000af0  6d 45 20 20 20 20 3b 20  2d 2d 2d 3e 38 2d 2d 2d  |mE    ; --->8---|
00000b00  3e 38 2d 2d 2d 20 43 75  74 20 74 68 69 73 20 62  |>8--- Cut this b|
00000b10  69 74 20 6f 75 74 20 69  66 20 79 6f 75 20 64 6f  |it out if you do|
00000b20  6e 27 74 20 77 61 6e 74  20 74 68 65 20 63 68 65  |n't want the che|
00000b30  63 6b 2e 0d 00 6e 04 0d  00 6f 1e 20 20 20 20 73  |ck...n...o.    s|
00000b40  75 62 20 20 20 20 20 73  70 2c 73 70 2c 23 39 32  |ub     sp,sp,#92|
00000b50  20 2d 20 32 30 0d 00 70  17 20 20 20 20 73 74 72  | - 20..p.    str|
00000b60  20 20 20 20 20 72 32 2c  5b 73 70 5d 0d 00 71 18  |     r2,[sp]..q.|
00000b70  20 20 20 20 6f 72 72 20  20 20 20 20 72 31 2c 73  |    orr     r1,s|
00000b80  70 2c 23 31 0d 00 72 25  20 20 20 20 73 77 69 20  |p,#1..r%    swi |
00000b90  20 20 20 20 22 58 57 69  6d 70 5f 47 65 74 57 69  |    "XWimp_GetWi|
00000ba0  6e 64 6f 77 49 6e 66 6f  22 0d 00 73 36 20 20 20  |ndowInfo"..s6   |
00000bb0  20 6c 64 72 20 20 20 20  20 72 30 2c 5b 73 70 2c  | ldr     r0,[sp,|
00000bc0  23 33 32 5d 20 20 20 20  20 20 20 20 20 3b 72 30  |#32]         ;r0|
00000bd0  20 3d 20 77 69 6e 64 6f  77 20 66 6c 61 67 73 0d  | = window flags.|
00000be0  00 74 1e 20 20 20 20 61  64 64 20 20 20 20 20 73  |.t.    add     s|
00000bf0  70 2c 73 70 2c 23 39 32  20 2d 20 32 30 0d 00 75  |p,sp,#92 - 20..u|
00000c00  04 0d 00 76 50 20 20 20  20 74 73 74 20 20 20 20  |...vP    tst    |
00000c10  20 72 30 2c 23 26 32 38  30 30 30 30 30 30 20 20  | r0,#&28000000  |
00000c20  20 20 20 20 20 3b 61 72  65 20 74 68 65 72 65 20  |     ;are there |
00000c30  61 64 6a 75 73 74 2d 73  69 7a 65 20 6f 72 20 74  |adjust-size or t|
00000c40  6f 67 67 6c 65 2d 73 69  7a 65 20 69 63 6f 6e 73  |oggle-size icons|
00000c50  3f 0d 00 77 19 20 20 20  20 61 64 64 65 71 20 20  |?..w.    addeq  |
00000c60  20 73 70 2c 73 70 2c 23  32 34 0d 00 78 4f 20 20  | sp,sp,#24..xO  |
00000c70  20 20 6d 76 6e 65 71 20  20 20 72 30 2c 23 30 20  |  mvneq   r0,#0 |
00000c80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 6e  |              ;n|
00000c90  6f 20 2d 20 64 6f 20 6e  6f 74 68 69 6e 67 20 28  |o - do nothing (|
00000ca0  62 75 74 20 70 72 65 76  65 6e 74 20 6d 6f 76 65  |but prevent move|
00000cb0  20 74 6f 20 62 61 63 6b  29 0d 00 79 21 20 20 20  | to back)..y!   |
00000cc0  20 6c 64 6d 65 71 66 64  20 28 73 70 29 21 2c 7b  | ldmeqfd (sp)!,{|
00000cd0  72 31 2d 72 39 2c 70 63  7d 5e 0d 00 7a 08 20 20  |r1-r9,pc}^..z.  |
00000ce0  20 20 0d 00 7b 23 20 20  20 20 3b 20 2d 2d 2d 38  |  ..{#    ; ---8|
00000cf0  3c 2d 2d 2d 38 3c 2d 2d  2d 20 45 6e 64 20 6f 66  |<---8<--- End of|
00000d00  20 63 75 74 2e 0d 00 7c  08 20 20 20 20 0d 00 7d  | cut...|.    ..}|
00000d10  3a 20 20 20 20 3b 20 52  65 61 64 20 74 68 65 20  |:    ; Read the |
00000d20  69 6e 69 74 69 61 6c 20  73 69 7a 65 20 66 6f 72  |initial size for|
00000d30  20 74 68 65 20 64 72 61  67 67 61 62 6c 65 20 6f  | the draggable o|
00000d40  75 74 6c 69 6e 65 2e 0d  00 7e 04 0d 00 7f 15 20  |utline...~..... |
00000d50  20 20 20 6d 6f 76 20 20  20 20 20 72 31 2c 73 70  |   mov     r1,sp|
00000d60  0d 00 80 17 20 20 20 20  73 74 72 20 20 20 20 20  |....    str     |
00000d70  72 32 2c 5b 72 31 5d 0d  00 81 28 20 20 20 20 73  |r2,[r1]...(    s|
00000d80  77 69 20 20 20 20 20 22  58 57 69 6d 70 5f 47 65  |wi     "XWimp_Ge|
00000d90  74 57 69 6e 64 6f 77 4f  75 74 6c 69 6e 65 22 0d  |tWindowOutline".|
00000da0  00 82 04 0d 00 83 3a 20  20 20 20 3b 20 43 6c 69  |......:    ; Cli|
00000db0  70 20 74 68 65 20 62 6f  75 6e 64 69 6e 67 20 62  |p the bounding b|
00000dc0  6f 78 20 74 6f 20 74 68  65 20 73 63 72 65 65 6e  |ox to the screen|
00000dd0  20 73 69 7a 65 2c 20 73  6f 20 61 6c 6c 0d 00 84  | size, so all...|
00000de0  1f 20 20 20 20 3b 20 73  69 64 65 73 20 63 61 6e  |.    ; sides can|
00000df0  20 62 65 20 64 72 61 67  67 65 64 2e 0d 00 85 04  | be dragged.....|
00000e00  0d 00 86 2f 20 20 20 20  3b 20 46 69 72 73 74 20  |.../    ; First |
00000e10  2d 20 72 65 61 64 20 74  68 65 20 63 75 72 72 65  |- read the curre|
00000e20  6e 74 20 73 63 72 65 65  6e 20 73 69 7a 65 2e 0d  |nt screen size..|
00000e30  00 87 08 20 20 20 20 0d  00 88 1b 20 20 20 20 61  |...    ....    a|
00000e40  64 72 20 20 20 20 20 72  30 2c 76 64 75 5f 76 61  |dr     r0,vdu_va|
00000e50  72 73 0d 00 89 1c 20 20  20 20 73 75 62 20 20 20  |rs....    sub   |
00000e60  20 20 73 70 2c 73 70 2c  23 34 20 2a 20 34 0d 00  |  sp,sp,#4 * 4..|
00000e70  8a 15 20 20 20 20 6d 6f  76 20 20 20 20 20 72 31  |..    mov     r1|
00000e80  2c 73 70 0d 00 8b 26 20  20 20 20 73 77 69 20 20  |,sp...&    swi  |
00000e90  20 20 20 22 58 4f 53 5f  52 65 61 64 56 64 75 56  |   "XOS_ReadVduV|
00000ea0  61 72 69 61 62 6c 65 73  22 0d 00 8c 2f 20 20 20  |ariables".../   |
00000eb0  20 6c 64 72 20 20 20 20  20 72 30 2c 5b 72 31 2c  | ldr     r0,[r1,|
00000ec0  23 30 5d 20 20 20 20 20  20 3b 58 20 65 69 67 65  |#0]      ;X eige|
00000ed0  6e 20 66 61 63 74 6f 72  0d 00 8d 33 20 20 20 20  |n factor...3    |
00000ee0  6c 64 72 20 20 20 20 20  72 32 2c 5b 72 31 2c 23  |ldr     r2,[r1,#|
00000ef0  38 5d 20 20 20 20 20 20  3b 58 20 70 69 78 65 6c  |8]      ;X pixel|
00000f00  73 20 6f 6e 20 73 63 72  65 65 6e 0d 00 8e 1c 20  |s on screen.... |
00000f10  20 20 20 6d 6f 76 20 20  20 20 20 72 32 2c 72 32  |   mov     r2,r2|
00000f20  2c 6c 73 6c 20 72 30 0d  00 8f 2f 20 20 20 20 6c  |,lsl r0.../    l|
00000f30  64 72 20 20 20 20 20 72  30 2c 5b 72 31 2c 23 34  |dr     r0,[r1,#4|
00000f40  5d 20 20 20 20 20 20 3b  59 20 65 69 67 65 6e 20  |]      ;Y eigen |
00000f50  66 61 63 74 6f 72 0d 00  90 33 20 20 20 20 6c 64  |factor...3    ld|
00000f60  72 20 20 20 20 20 72 33  2c 5b 72 31 2c 23 31 32  |r     r3,[r1,#12|
00000f70  5d 20 20 20 20 20 3b 59  20 70 69 78 65 6c 73 20  |]     ;Y pixels |
00000f80  6f 6e 20 73 63 72 65 65  6e 0d 00 91 1c 20 20 20  |on screen....   |
00000f90  20 6d 6f 76 20 20 20 20  20 72 33 2c 72 33 2c 6c  | mov     r3,r3,l|
00000fa0  73 6c 20 72 30 0d 00 92  04 0d 00 93 31 20 20 20  |sl r0.......1   |
00000fb0  20 3b 20 28 72 32 2c 72  33 29 20 69 73 20 74 68  | ; (r2,r3) is th|
00000fc0  65 20 74 6f 70 2d 72 69  67 68 74 20 4f 53 2d 63  |e top-right OS-c|
00000fd0  6f 6f 72 64 69 6e 61 74  65 2e 0d 00 94 04 0d 00  |oordinate.......|
00000fe0  95 1c 20 20 20 20 61 64  64 20 20 20 20 20 73 70  |..    add     sp|
00000ff0  2c 73 70 2c 23 34 20 2a  20 34 0d 00 96 04 0d 00  |,sp,#4 * 4......|
00001000  97 38 20 20 20 20 3b 20  4e 6f 77 20 63 6c 69 70  |.8    ; Now clip|
00001010  20 74 68 65 20 69 6e 69  74 69 61 6c 20 62 6f 78  | the initial box|
00001020  20 74 6f 20 74 68 65 20  73 63 72 65 65 6e 20 6c  | to the screen l|
00001030  69 6d 69 74 73 2e 0d 00  98 3f 20 20 20 20 3b 20  |imits....?    ; |
00001040  4e 6f 74 65 20 2d 20 6f  6e 6c 79 20 74 68 65 20  |Note - only the |
00001050  64 65 74 65 63 74 69 6f  6e 20 62 6f 78 20 69 73  |detection box is|
00001060  20 63 6c 69 70 70 65 64  2c 20 6e 6f 74 20 74 68  | clipped, not th|
00001070  65 20 62 6f 78 0d 00 99  20 20 20 20 20 3b 20 70  |e box...     ; p|
00001080  6c 6f 74 74 65 64 20 6f  6e 20 74 68 65 20 73 63  |lotted on the sc|
00001090  72 65 65 6e 2e 0d 00 9a  04 0d 00 9b 18 20 20 20  |reen.........   |
000010a0  20 61 64 64 20 20 20 20  20 72 31 2c 73 70 2c 23  | add     r1,sp,#|
000010b0  34 0d 00 9c 46 20 20 20  20 6c 64 6d 69 61 20 20  |4...F    ldmia  |
000010c0  20 72 31 2c 7b 72 34 2d  72 37 7d 20 20 20 20 20  | r1,{r4-r7}     |
000010d0  20 3b 67 65 74 20 62 6f  75 6e 64 69 6e 67 20 62  | ;get bounding b|
000010e0  6f 78 20 69 6e 20 28 72  34 2c 72 35 29 20 3b 20  |ox in (r4,r5) ; |
000010f0  28 72 36 2c 72 37 29 0d  00 9d 2c 20 20 20 20 63  |(r6,r7)...,    c|
00001100  6d 70 20 20 20 20 20 72  36 2c 72 32 20 20 20 20  |mp     r6,r2    |
00001110  20 20 20 20 20 20 20 3b  6c 69 6d 69 74 20 6d 61  |       ;limit ma|
00001120  78 20 58 0d 00 9e 15 20  20 20 20 6d 6f 76 67 74  |x X....    movgt|
00001130  20 20 20 72 36 2c 72 32  0d 00 9f 2c 20 20 20 20  |   r6,r2...,    |
00001140  63 6d 70 20 20 20 20 20  72 37 2c 72 33 20 20 20  |cmp     r7,r3   |
00001150  20 20 20 20 20 20 20 20  3b 6c 69 6d 69 74 20 6d  |        ;limit m|
00001160  61 78 20 59 0d 00 a0 15  20 20 20 20 6d 6f 76 67  |ax Y....    movg|
00001170  74 20 20 20 72 37 2c 72  33 0d 00 a1 2c 20 20 20  |t   r7,r3...,   |
00001180  20 63 6d 70 20 20 20 20  20 72 34 2c 23 30 20 20  | cmp     r4,#0  |
00001190  20 20 20 20 20 20 20 20  20 3b 6c 69 6d 69 74 20  |         ;limit |
000011a0  6d 69 6e 20 58 0d 00 a2  15 20 20 20 20 6d 6f 76  |min X....    mov|
000011b0  6c 74 20 20 20 72 34 2c  23 30 0d 00 a3 2c 20 20  |lt   r4,#0...,  |
000011c0  20 20 63 6d 70 20 20 20  20 20 72 35 2c 23 30 20  |  cmp     r5,#0 |
000011d0  20 20 20 20 20 20 20 20  20 20 3b 6c 69 6d 69 74  |          ;limit|
000011e0  20 6d 69 6e 20 79 0d 00  a4 15 20 20 20 20 6d 6f  | min y....    mo|
000011f0  76 6c 74 20 20 20 72 35  2c 23 30 0d 00 a5 08 20  |vlt   r5,#0.... |
00001200  20 20 20 0d 00 a6 3e 20  20 20 20 6d 6f 76 20 20  |   ...>    mov  |
00001210  20 20 20 72 30 2c 23 26  34 30 20 20 20 20 20 20  |   r0,#&40      |
00001220  20 20 20 3b 73 65 6c 65  63 74 20 27 69 6e 76 65  |   ;select 'inve|
00001230  72 74 27 20 70 6c 6f 74  74 69 6e 67 20 6d 6f 64  |rt' plotting mod|
00001240  65 0d 00 a7 21 20 20 20  20 73 77 69 20 20 20 20  |e...!    swi    |
00001250  20 22 58 57 69 6d 70 5f  53 65 74 43 6f 6c 6f 75  | "XWimp_SetColou|
00001260  72 22 0d 00 a8 04 0d 00  a9 3f 20 20 20 20 3b 20  |r".......?    ; |
00001270  53 68 6f 77 20 74 68 65  20 63 75 72 72 65 6e 74  |Show the current|
00001280  20 77 69 6e 64 6f 77 20  6c 69 6d 69 74 73 20 73  | window limits s|
00001290  6f 20 74 68 65 20 75 73  65 72 20 63 61 6e 20 64  |o the user can d|
000012a0  65 63 69 64 65 0d 00 aa  20 20 20 20 20 3b 20 77  |ecide...     ; w|
000012b0  68 69 63 68 20 65 64 67  65 28 73 29 20 74 6f 20  |hich edge(s) to |
000012c0  6d 6f 76 65 2e 0d 00 ab  04 0d 00 ac 1c 20 20 20  |move.........   |
000012d0  20 62 6c 20 20 20 20 20  20 73 68 6f 77 5f 6f 75  | bl      show_ou|
000012e0  74 6c 69 6e 65 0d 00 ad  04 0d 00 ae 3e 20 20 20  |tline.......>   |
000012f0  20 3b 20 57 61 69 74 20  75 6e 74 69 6c 20 74 68  | ; Wait until th|
00001300  65 20 75 73 65 72 20 6d  6f 76 65 73 20 61 63 72  |e user moves acr|
00001310  6f 73 73 20 6f 6e 65 20  6f 66 20 74 68 65 20 65  |oss one of the e|
00001320  64 67 65 73 2e 2e 2e 0d  00 af 04 0d 00 b0 10 2e  |dges............|
00001330  6c 5f 66 69 6e 64 5f 65  64 67 65 0d 00 b1 1b 20  |l_find_edge.... |
00001340  20 20 20 73 77 69 20 20  20 20 20 22 58 4f 53 5f  |   swi     "XOS_|
00001350  4d 6f 75 73 65 22 0d 00  b2 15 20 20 20 20 74 65  |Mouse"....    te|
00001360  71 20 20 20 20 20 72 32  2c 23 30 0d 00 b3 47 20  |q     r2,#0...G |
00001370  20 20 20 62 65 71 20 20  20 20 20 61 62 6f 72 74  |   beq     abort|
00001380  5f 72 65 73 69 7a 65 20  20 20 20 20 20 20 20 3b  |_resize        ;|
00001390  61 6c 6c 20 6d 6f 75 73  65 20 62 75 74 74 6f 6e  |all mouse button|
000013a0  73 20 72 65 6c 65 61 73  65 64 20 2d 20 61 62 6f  |s released - abo|
000013b0  72 74 0d 00 b4 15 20 20  20 20 63 6d 70 20 20 20  |rt....    cmp   |
000013c0  20 20 72 30 2c 72 34 0d  00 b5 15 20 20 20 20 63  |  r0,r4....    c|
000013d0  6d 70 67 74 20 20 20 72  31 2c 72 35 0d 00 b6 18  |mpgt   r1,r5....|
000013e0  20 20 20 20 62 6c 65 20  20 20 20 20 68 69 74 5f  |    ble     hit_|
000013f0  73 69 64 65 0d 00 b7 15  20 20 20 20 63 6d 70 20  |side....    cmp |
00001400  20 20 20 20 72 30 2c 72  36 0d 00 b8 15 20 20 20  |    r0,r6....   |
00001410  20 63 6d 70 6c 74 20 20  20 72 31 2c 72 37 0d 00  | cmplt   r1,r7..|
00001420  b9 1b 20 20 20 20 62 6c  74 20 20 20 20 20 6c 5f  |..    blt     l_|
00001430  66 69 6e 64 5f 65 64 67  65 0d 00 ba 0d 2e 68 69  |find_edge.....hi|
00001440  74 5f 73 69 64 65 0d 00  bb 04 0d 00 bc 51 20 20  |t_side.......Q  |
00001450  20 20 3b 20 47 65 74 20  6d 6f 75 73 65 20 63 6f  |  ; Get mouse co|
00001460  6f 72 64 20 61 73 20 6f  66 66 73 65 74 20 66 72  |ord as offset fr|
00001470  6f 6d 20 62 6f 74 74 6f  6d 2d 6c 65 66 74 20 6f  |om bottom-left o|
00001480  66 20 77 69 6e 64 6f 77  20 61 6e 64 20 73 63 61  |f window and sca|
00001490  6c 65 20 75 70 20 62 79  20 33 2e 0d 00 bd 2b 20  |le up by 3....+ |
000014a0  20 20 20 3b 20 44 65 63  69 64 65 20 77 68 69 63  |   ; Decide whic|
000014b0  68 20 73 69 64 65 28 73  29 20 6e 65 65 64 20 6d  |h side(s) need m|
000014c0  6f 76 69 6e 67 2e 0d 00  be 04 0d 00 bf 18 20 20  |oving.........  |
000014d0  20 20 73 75 62 20 20 20  20 20 72 30 2c 72 30 2c  |  sub     r0,r0,|
000014e0  72 34 0d 00 c0 18 20 20  20 20 73 75 62 20 20 20  |r4....    sub   |
000014f0  20 20 72 31 2c 72 31 2c  72 35 0d 00 c1 1e 20 20  |  r1,r1,r5....  |
00001500  20 20 61 64 64 20 20 20  20 20 72 30 2c 72 30 2c  |  add     r0,r0,|
00001510  72 30 2c 6c 73 6c 23 31  0d 00 c2 1e 20 20 20 20  |r0,lsl#1....    |
00001520  61 64 64 20 20 20 20 20  72 31 2c 72 31 2c 72 31  |add     r1,r1,r1|
00001530  2c 6c 73 6c 23 31 0d 00  c3 08 20 20 20 20 0d 00  |,lsl#1....    ..|
00001540  c4 35 20 20 20 20 73 75  62 20 20 20 20 20 72 34  |.5    sub     r4|
00001550  2c 72 36 2c 72 34 20 20  20 20 20 20 20 20 3b 72  |,r6,r4        ;r|
00001560  34 20 3d 20 77 69 64 74  68 20 6f 66 20 77 69 6e  |4 = width of win|
00001570  64 6f 77 0d 00 c5 36 20  20 20 20 73 75 62 20 20  |dow...6    sub  |
00001580  20 20 20 72 35 2c 72 37  2c 72 35 20 20 20 20 20  |   r5,r7,r5     |
00001590  20 20 20 3b 72 35 20 3d  20 68 65 69 67 68 74 20  |   ;r5 = height |
000015a0  6f 66 20 77 69 6e 64 6f  77 0d 00 c6 04 0d 00 c7  |of window.......|
000015b0  15 20 20 20 20 63 6d 70  20 20 20 20 20 72 30 2c  |.    cmp     r0,|
000015c0  72 34 0d 00 c8 51 20 20  20 20 6d 6f 76 6c 74 20  |r4...Q    movlt |
000015d0  20 20 72 36 2c 23 34 20  20 20 20 20 20 20 20 20  |  r6,#4         |
000015e0  20 20 3b 6d 61 6b 65 20  6c 65 66 74 20 73 69 64  |  ;make left sid|
000015f0  65 20 6d 6f 76 65 61 62  6c 65 20 69 66 20 6c 65  |e moveable if le|
00001600  66 74 20 6f 66 20 6d 69  64 64 6c 65 20 63 6f 6c  |ft of middle col|
00001610  75 6d 6e 0d 00 c9 15 20  20 20 20 6d 6f 76 67 65  |umn....    movge|
00001620  20 20 20 72 36 2c 23 30  0d 00 ca 1b 20 20 20 20  |   r6,#0....    |
00001630  63 6d 70 20 20 20 20 20  72 30 2c 72 34 2c 6c 73  |cmp     r0,r4,ls|
00001640  6c 23 31 0d 00 cb 53 20  20 20 20 6d 6f 76 67 74  |l#1...S    movgt|
00001650  20 20 20 72 36 2c 23 31  32 20 20 20 20 20 20 20  |   r6,#12       |
00001660  20 20 20 3b 6d 61 6b 65  20 72 69 67 68 74 20 73  |   ;make right s|
00001670  69 64 65 20 6d 6f 76 65  61 62 6c 65 20 69 66 20  |ide moveable if |
00001680  72 69 67 68 74 20 6f 66  20 6d 69 64 64 6c 65 20  |right of middle |
00001690  63 6f 6c 75 6d 6e 0d 00  cc 1a 20 20 20 20 6c 64  |column....    ld|
000016a0  72 20 20 20 20 20 72 38  2c 5b 73 70 2c 72 36 5d  |r     r8,[sp,r6]|
000016b0  0d 00 cd 3c 20 20 20 20  73 75 62 67 74 20 20 20  |...<    subgt   |
000016c0  72 38 2c 72 38 2c 23 31  20 20 20 20 20 20 20 20  |r8,r8,#1        |
000016d0  3b 72 69 67 68 74 20 6f  72 64 69 6e 61 74 65 20  |;right ordinate |
000016e0  69 73 20 65 78 63 6c 75  73 69 76 65 0d 00 ce 04  |is exclusive....|
000016f0  0d 00 cf 15 20 20 20 20  63 6d 70 20 20 20 20 20  |....    cmp     |
00001700  72 31 2c 72 35 0d 00 d0  49 20 20 20 20 6d 6f 76  |r1,r5...I    mov|
00001710  6c 74 20 20 20 72 37 2c  23 38 20 20 20 20 20 20  |lt   r7,#8      |
00001720  20 20 20 20 20 3b 6d 61  6b 65 20 62 6f 74 74 6f  |     ;make botto|
00001730  6d 20 6d 6f 76 65 61 62  6c 65 20 69 66 20 62 65  |m moveable if be|
00001740  6c 6f 77 20 6d 69 64 64  6c 65 20 72 6f 77 0d 00  |low middle row..|
00001750  d1 15 20 20 20 20 6d 6f  76 67 65 20 20 20 72 37  |..    movge   r7|
00001760  2c 23 30 0d 00 d2 1b 20  20 20 20 63 6d 70 20 20  |,#0....    cmp  |
00001770  20 20 20 72 31 2c 72 35  2c 6c 73 6c 23 31 0d 00  |   r1,r5,lsl#1..|
00001780  d3 46 20 20 20 20 6d 6f  76 67 74 20 20 20 72 37  |.F    movgt   r7|
00001790  2c 23 31 36 20 20 20 20  20 20 20 20 20 20 3b 6d  |,#16          ;m|
000017a0  61 6b 65 20 74 6f 70 20  6d 6f 76 65 61 62 6c 65  |ake top moveable|
000017b0  20 69 66 20 61 62 6f 76  65 20 6d 69 64 64 6c 65  | if above middle|
000017c0  20 72 6f 77 0d 00 d4 1a  20 20 20 20 6c 64 72 20  | row....    ldr |
000017d0  20 20 20 20 72 39 2c 5b  73 70 2c 72 37 5d 0d 00  |    r9,[sp,r7]..|
000017e0  d5 3a 20 20 20 20 73 75  62 67 74 20 20 20 72 39  |.:    subgt   r9|
000017f0  2c 72 39 2c 23 31 20 20  20 20 20 20 20 20 3b 74  |,r9,#1        ;t|
00001800  6f 70 20 6f 72 64 69 6e  61 74 65 20 69 73 20 65  |op ordinate is e|
00001810  78 63 6c 75 73 69 76 65  0d 00 d6 08 20 20 20 20  |xclusive....    |
00001820  0d 00 d7 4c 20 20 20 20  3b 20 28 72 38 2c 72 39  |...L    ; (r8,r9|
00001830  29 20 69 73 20 74 68 65  20 69 6e 69 74 69 61 6c  |) is the initial|
00001840  20 6d 6f 75 73 65 20 70  6f 73 69 74 69 6f 6e 20  | mouse position |
00001850  28 73 6f 20 77 65 20 63  61 6e 20 66 69 6e 64 20  |(so we can find |
00001860  6f 75 74 20 68 6f 77 20  6d 75 63 68 0d 00 d8 14  |out how much....|
00001870  20 20 20 20 3b 20 77 65  20 6d 6f 76 65 64 29 2e  |    ; we moved).|
00001880  0d 00 d9 4a 20 20 20 20  3b 20 4e 6f 74 65 20 2d  |...J    ; Note -|
00001890  20 77 65 20 75 73 65 20  74 68 65 20 70 6f 69 6e  | we use the poin|
000018a0  74 20 61 74 20 77 68 69  63 68 20 74 68 65 20 6d  |t at which the m|
000018b0  6f 75 73 65 20 63 72 6f  73 73 65 64 20 74 68 65  |ouse crossed the|
000018c0  20 6c 69 6e 65 2c 20 6e  6f 74 0d 00 da 49 20 20  | line, not...I  |
000018d0  20 20 3b 20 77 68 65 72  65 20 69 74 20 77 61 73  |  ; where it was|
000018e0  20 77 68 65 6e 20 77 65  20 6e 6f 74 69 63 65 64  | when we noticed|
000018f0  20 74 68 65 20 66 61 63  74 20 28 64 6f 65 73 20  | the fact (does |
00001900  6d 61 6b 65 20 61 20 64  69 66 66 65 72 65 6e 63  |make a differenc|
00001910  65 21 29 0d 00 db 08 20  20 20 20 0d 00 dc 44 20  |e!)....    ...D |
00001920  20 20 20 3b 20 72 36 2c  72 37 20 61 72 65 20 74  |   ; r6,r7 are t|
00001930  68 65 20 6f 66 66 73 65  74 73 20 66 72 6f 6d 20  |he offsets from |
00001940  73 70 20 74 6f 20 73 74  6f 72 65 20 6e 65 77 5f  |sp to store new_|
00001950  78 20 61 6e 64 20 6e 65  77 5f 79 20 61 74 2e 0d  |x and new_y at..|
00001960  00 dd 1a 20 20 20 20 3b  20 5a 65 72 6f 20 66 6f  |...    ; Zero fo|
00001970  72 20 73 74 61 74 69 63  2e 0d 00 de 04 0d 00 df  |r static........|
00001980  15 20 20 20 20 6d 6f 76  20 20 20 20 20 72 34 2c  |.    mov     r4,|
00001990  72 38 0d 00 e0 15 20 20  20 20 6d 6f 76 20 20 20  |r8....    mov   |
000019a0  20 20 72 35 2c 72 39 0d  00 e1 0d 2e 6c 5f 72 65  |  r5,r9.....l_re|
000019b0  73 69 7a 65 0d 00 e2 45  20 20 20 20 3b 20 28 72  |size...E    ; (r|
000019c0  34 2c 72 35 29 20 69 73  20 74 68 65 20 70 72 65  |4,r5) is the pre|
000019d0  76 69 6f 75 73 20 6d 6f  75 73 65 20 70 6f 73 69  |vious mouse posi|
000019e0  74 69 6f 6e 20 28 74 6f  20 73 74 6f 70 20 66 6c  |tion (to stop fl|
000019f0  69 63 6b 65 72 69 6e 67  29 0d 00 e3 1b 20 20 20  |ickering)....   |
00001a00  20 73 77 69 20 20 20 20  20 22 58 4f 53 5f 4d 6f  | swi     "XOS_Mo|
00001a10  75 73 65 22 0d 00 e4 15  20 20 20 20 63 6d 70 20  |use"....    cmp |
00001a20  20 20 20 20 72 30 2c 72  34 0d 00 e5 15 20 20 20  |    r0,r4....   |
00001a30  20 63 6d 70 65 71 20 20  20 72 31 2c 72 35 0d 00  | cmpeq   r1,r5..|
00001a40  e6 20 20 20 20 20 62 65  71 20 20 20 20 20 6d 6f  |.     beq     mo|
00001a50  75 73 65 5f 64 69 64 6e  74 5f 6d 6f 76 65 0d 00  |use_didnt_move..|
00001a60  e7 08 20 20 20 20 0d 00  e8 46 20 20 20 20 62 6c  |..    ...F    bl|
00001a70  20 20 20 20 20 20 73 68  6f 77 5f 6f 75 74 6c 69  |      show_outli|
00001a80  6e 65 20 20 20 20 3b 72  65 6d 6f 76 65 20 6f 6c  |ne    ;remove ol|
00001a90  64 20 77 69 6e 64 6f 77  20 6f 75 74 6c 69 6e 65  |d window outline|
00001aa0  20 66 72 6f 6d 20 73 63  72 65 65 6e 0d 00 e9 1a  | from screen....|
00001ab0  20 20 20 20 73 74 72 20  20 20 20 20 72 30 2c 5b  |    str     r0,[|
00001ac0  73 70 2c 72 36 5d 0d 00  ea 1a 20 20 20 20 73 74  |sp,r6]....    st|
00001ad0  72 20 20 20 20 20 72 31  2c 5b 73 70 2c 72 37 5d  |r     r1,[sp,r7]|
00001ae0  0d 00 eb 38 20 20 20 20  62 6c 20 20 20 20 20 20  |...8    bl      |
00001af0  73 68 6f 77 5f 6f 75 74  6c 69 6e 65 20 20 20 20  |show_outline    |
00001b00  3b 70 6c 6f 74 20 6e 65  77 20 77 69 6e 64 6f 77  |;plot new window|
00001b10  20 6f 75 74 6c 69 6e 65  0d 00 ec 15 20 20 20 20  | outline....    |
00001b20  6d 6f 76 20 20 20 20 20  72 34 2c 72 30 0d 00 ed  |mov     r4,r0...|
00001b30  15 20 20 20 20 6d 6f 76  20 20 20 20 20 72 35 2c  |.    mov     r5,|
00001b40  72 31 0d 00 ee 15 2e 6d  6f 75 73 65 5f 64 69 64  |r1.....mouse_did|
00001b50  6e 74 5f 6d 6f 76 65 0d  00 ef 53 20 20 20 20 74  |nt_move...S    t|
00001b60  65 71 20 20 20 20 20 72  32 2c 23 30 20 20 20 20  |eq     r2,#0    |
00001b70  20 20 20 20 20 20 20 3b  6b 65 65 70 20 72 65 73  |       ;keep res|
00001b80  69 7a 69 6e 67 20 75 6e  74 69 6c 20 61 6c 6c 20  |izing until all |
00001b90  6d 6f 75 73 65 20 62 75  74 74 6f 6e 73 20 61 72  |mouse buttons ar|
00001ba0  65 20 72 65 6c 65 61 73  65 64 0d 00 f0 18 20 20  |e released....  |
00001bb0  20 20 62 6e 65 20 20 20  20 20 6c 5f 72 65 73 69  |  bne     l_resi|
00001bc0  7a 65 0d 00 f1 04 0d 00  f2 51 20 20 20 20 3b 20  |ze.......Q    ; |
00001bd0  46 69 6e 69 73 68 65 64  20 64 72 61 67 67 69 6e  |Finished draggin|
00001be0  67 20 2d 20 75 70 64 61  74 65 20 74 68 65 20 70  |g - update the p|
00001bf0  6f 6c 6c 20 62 6c 6f 63  6b 20 61 6e 64 20 63 6f  |oll block and co|
00001c00  6e 74 69 6e 75 65 20 77  69 74 68 20 4f 70 65 6e  |ntinue with Open|
00001c10  57 69 6e 64 6f 77 2e 0d  00 f3 04 0d 00 f4 1c 20  |Window......... |
00001c20  20 20 20 62 6c 20 20 20  20 20 20 73 68 6f 77 5f  |   bl      show_|
00001c30  6f 75 74 6c 69 6e 65 0d  00 f5 19 20 20 20 20 61  |outline....    a|
00001c40  64 64 20 20 20 20 20 73  70 2c 73 70 2c 23 32 30  |dd     sp,sp,#20|
00001c50  0d 00 f6 18 20 20 20 20  73 75 62 20 20 20 20 20  |....    sub     |
00001c60  72 32 2c 72 30 2c 72 38  0d 00 f7 18 20 20 20 20  |r2,r0,r8....    |
00001c70  73 75 62 20 20 20 20 20  72 33 2c 72 31 2c 72 39  |sub     r3,r1,r9|
00001c80  0d 00 f8 08 20 20 20 20  0d 00 f9 2c 20 20 20 20  |....    ...,    |
00001c90  3b 20 72 32 2c 72 33 20  61 72 65 20 74 68 65 20  |; r2,r3 are the |
00001ca0  61 6d 6d 6f 75 6e 74 20  77 65 20 6d 6f 76 65 64  |ammount we moved|
00001cb0  20 62 79 2e 0d 00 fa 42  20 20 20 20 3b 20 52 65  | by....B    ; Re|
00001cc0  6d 65 6d 62 65 72 20 2d  20 77 65 20 68 61 76 65  |member - we have|
00001cd0  20 74 68 65 20 6e 65 77  20 6f 75 74 6c 69 6e 65  | the new outline|
00001ce0  20 70 6f 73 69 74 69 6f  6e 2c 20 6e 6f 74 20 74  | position, not t|
00001cf0  68 65 20 6e 65 77 0d 00  fb 17 20 20 20 20 3b 20  |he new....    ; |
00001d00  76 69 73 69 62 6c 65 20  61 72 65 61 2e 0d 00 fc  |visible area....|
00001d10  4a 20 20 20 20 3b 20 47  65 74 20 74 68 65 20 63  |J    ; Get the c|
00001d20  75 72 72 65 6e 74 20 77  69 6e 64 6f 77 20 70 6f  |urrent window po|
00001d30  73 69 74 69 6f 6e 20 61  6e 64 20 75 70 64 61 74  |sition and updat|
00001d40  65 20 74 68 65 20 73 69  64 65 28 73 29 20 77 65  |e the side(s) we|
00001d50  20 6d 6f 76 65 64 2e 0d  00 fd 04 0d 00 fe 4a 20  | moved........J |
00001d60  20 20 20 6c 64 72 20 20  20 20 20 72 31 2c 5b 73  |   ldr     r1,[s|
00001d70  70 2c 23 34 5d 20 20 20  20 20 20 3b 67 65 74 20  |p,#4]      ;get |
00001d80  73 74 61 63 6b 65 64 20  72 31 20 28 61 70 70 6c  |stacked r1 (appl|
00001d90  69 63 61 74 69 6f 6e 27  73 20 70 6f 6c 6c 20 62  |ication's poll b|
00001da0  6c 6f 63 6b 29 0d 00 ff  26 20 20 20 20 73 77 69  |lock)...&    swi|
00001db0  20 20 20 20 20 22 58 57  69 6d 70 5f 47 65 74 57  |     "XWimp_GetW|
00001dc0  69 6e 64 6f 77 53 74 61  74 65 22 0d 01 00 15 20  |indowState".... |
00001dd0  20 20 20 63 6d 70 20 20  20 20 20 72 36 2c 23 30  |   cmp     r6,#0|
00001de0  0d 01 01 1a 20 20 20 20  6c 64 72 6e 65 20 20 20  |....    ldrne   |
00001df0  72 30 2c 5b 72 31 2c 72  36 5d 0d 01 02 18 20 20  |r0,[r1,r6]....  |
00001e00  20 20 61 64 64 6e 65 20  20 20 72 30 2c 72 30 2c  |  addne   r0,r0,|
00001e10  72 32 0d 01 03 1a 20 20  20 20 73 74 72 6e 65 20  |r2....    strne |
00001e20  20 20 72 30 2c 5b 72 31  2c 72 36 5d 0d 01 04 15  |  r0,[r1,r6]....|
00001e30  20 20 20 20 63 6d 70 20  20 20 20 20 72 37 2c 23  |    cmp     r7,#|
00001e40  30 0d 01 05 1a 20 20 20  20 6c 64 72 6e 65 20 20  |0....    ldrne  |
00001e50  20 72 30 2c 5b 72 31 2c  72 37 5d 0d 01 06 18 20  | r0,[r1,r7].... |
00001e60  20 20 20 61 64 64 6e 65  20 20 20 72 30 2c 72 30  |   addne   r0,r0|
00001e70  2c 72 33 0d 01 07 1a 20  20 20 20 73 74 72 6e 65  |,r3....    strne|
00001e80  20 20 20 72 30 2c 5b 72  31 2c 72 37 5d 0d 01 08  |   r0,[r1,r7]...|
00001e90  04 0d 01 09 3a 20 20 20  20 3b 20 4d 61 6b 65 20  |....:    ; Make |
00001ea0  73 75 72 65 20 74 68 65  20 63 6f 6f 72 64 73 20  |sure the coords |
00001eb0  61 72 65 20 74 68 65 20  72 69 67 68 74 20 77 61  |are the right wa|
00001ec0  79 20 61 72 6f 75 6e 64  2e 2e 2e 0d 01 0a 04 0d  |y around........|
00001ed0  01 0b 1a 20 20 20 20 6c  64 72 20 20 20 20 20 72  |...    ldr     r|
00001ee0  30 2c 5b 72 31 2c 23 34  5d 0d 01 0c 1b 20 20 20  |0,[r1,#4]....   |
00001ef0  20 6c 64 72 20 20 20 20  20 72 32 2c 5b 72 31 2c  | ldr     r2,[r1,|
00001f00  23 31 32 5d 0d 01 0d 15  20 20 20 20 63 6d 70 20  |#12]....    cmp |
00001f10  20 20 20 20 72 30 2c 72  32 0d 01 0e 1b 20 20 20  |    r0,r2....   |
00001f20  20 73 74 72 67 74 20 20  20 72 30 2c 5b 72 31 2c  | strgt   r0,[r1,|
00001f30  23 31 32 5d 0d 01 0f 1a  20 20 20 20 73 74 72 67  |#12]....    strg|
00001f40  74 20 20 20 72 32 2c 5b  72 31 2c 23 34 5d 0d 01  |t   r2,[r1,#4]..|
00001f50  10 04 0d 01 11 1a 20 20  20 20 6c 64 72 20 20 20  |......    ldr   |
00001f60  20 20 72 30 2c 5b 72 31  2c 23 38 5d 0d 01 12 1b  |  r0,[r1,#8]....|
00001f70  20 20 20 20 6c 64 72 20  20 20 20 20 72 32 2c 5b  |    ldr     r2,[|
00001f80  72 31 2c 23 31 36 5d 0d  01 13 15 20 20 20 20 63  |r1,#16]....    c|
00001f90  6d 70 20 20 20 20 20 72  30 2c 72 32 0d 01 14 1b  |mp     r0,r2....|
00001fa0  20 20 20 20 73 74 72 67  74 20 20 20 72 30 2c 5b  |    strgt   r0,[|
00001fb0  72 31 2c 23 31 36 5d 0d  01 15 1a 20 20 20 20 73  |r1,#16]....    s|
00001fc0  74 72 67 74 20 20 20 72  32 2c 5b 72 31 2c 23 38  |trgt   r2,[r1,#8|
00001fd0  5d 0d 01 16 4e 20 20 20  20 6c 64 6d 66 64 20 20  |]...N    ldmfd  |
00001fe0  20 28 73 70 29 21 2c 7b  72 30 2d 72 39 2c 70 63  | (sp)!,{r0-r9,pc|
00001ff0  7d 5e 20 20 20 3b 70 61  73 73 20 6f 6e 20 74 68  |}^   ;pass on th|
00002000  65 20 28 6d 6f 64 69 66  69 65 64 29 20 4f 70 65  |e (modified) Ope|
00002010  6e 57 69 6e 64 6f 77 20  72 65 71 75 65 73 74 0d  |nWindow request.|
00002020  01 17 0d 2e 76 64 75 5f  76 61 72 73 0d 01 18 28  |....vdu_vars...(|
00002030  20 20 20 20 65 71 75 64  20 20 20 20 34 20 20 20  |    equd    4   |
00002040  20 20 20 20 3b 20 58 20  65 69 67 65 6e 20 66 61  |    ; X eigen fa|
00002050  63 74 6f 72 0d 01 19 28  20 20 20 20 65 71 75 64  |ctor...(    equd|
00002060  20 20 20 20 35 20 20 20  20 20 20 20 3b 20 59 20  |    5       ; Y |
00002070  65 69 67 65 6e 20 66 61  63 74 6f 72 0d 01 1a 30  |eigen factor...0|
00002080  20 20 20 20 65 71 75 64  20 20 20 20 31 31 20 20  |    equd    11  |
00002090  20 20 20 20 3b 20 58 20  70 69 78 65 6c 73 20 6f  |    ; X pixels o|
000020a0  6e 20 73 63 72 65 65 6e  20 2d 20 31 0d 01 1b 30  |n screen - 1...0|
000020b0  20 20 20 20 65 71 75 64  20 20 20 20 31 32 20 20  |    equd    12  |
000020c0  20 20 20 20 3b 20 59 20  70 69 78 65 6c 73 20 6f  |    ; Y pixels o|
000020d0  6e 20 73 63 72 65 65 6e  20 2d 20 31 0d 01 1c 12  |n screen - 1....|
000020e0  20 20 20 20 65 71 75 64  20 20 20 20 2d 31 0d 01  |    equd    -1..|
000020f0  1d 04 0d 01 1e 11 2e 61  62 6f 72 74 5f 72 65 73  |.......abort_res|
00002100  69 7a 65 0d 01 1f 1c 20  20 20 20 62 6c 20 20 20  |ize....    bl   |
00002110  20 20 20 73 68 6f 77 5f  6f 75 74 6c 69 6e 65 0d  |   show_outline.|
00002120  01 20 15 20 20 20 20 6d  76 6e 20 20 20 20 20 72  |. .    mvn     r|
00002130  30 2c 23 30 0d 01 21 19  20 20 20 20 61 64 64 20  |0,#0..!.    add |
00002140  20 20 20 20 73 70 2c 73  70 2c 23 32 34 0d 01 22  |    sp,sp,#24.."|
00002150  21 20 20 20 20 6c 64 6d  66 64 20 20 20 28 73 70  |!    ldmfd   (sp|
00002160  29 21 2c 7b 72 31 2d 72  39 2c 70 63 7d 5e 0d 01  |)!,{r1-r9,pc}^..|
00002170  23 04 0d 01 24 20 20 20  20 20 3b 20 20 20 20 20  |#...$     ;     |
00002180  20 20 20 20 20 20 73 68  6f 77 5f 6f 75 74 6c 69  |      show_outli|
00002190  6e 65 0d 01 25 49 20 20  20 20 3b 20 3d 3e 20 73  |ne..%I    ; => s|
000021a0  70 20 2d 3e 20 62 6f 75  6e 64 69 6e 67 20 62 6f  |p -> bounding bo|
000021b0  78 20 73 74 72 75 63 74  75 72 65 20 28 61 73 20  |x structure (as |
000021c0  66 72 6f 6d 20 57 69 6d  70 5f 47 65 74 57 69 6e  |from Wimp_GetWin|
000021d0  64 6f 77 4f 75 74 6c 69  6e 65 29 0d 01 26 41 20  |dowOutline)..&A |
000021e0  20 20 20 3b 20 50 6c 6f  74 73 20 62 6f 78 20 77  |   ; Plots box w|
000021f0  69 74 68 20 67 72 69 64  20 28 73 65 6c 65 63 74  |ith grid (select|
00002200  20 74 68 65 20 70 6c 6f  74 74 69 6e 67 20 63 6f  | the plotting co|
00002210  6c 6f 75 72 20 66 69 72  73 74 29 2e 0d 01 27 11  |lour first)...'.|
00002220  2e 73 68 6f 77 5f 6f 75  74 6c 69 6e 65 0d 01 28  |.show_outline..(|
00002230  20 20 20 20 20 73 74 6d  66 64 20 20 20 28 73 70  |     stmfd   (sp|
00002240  29 21 2c 7b 72 30 2d 72  35 2c 6c 6b 7d 0d 01 29  |)!,{r0-r5,lk}..)|
00002250  1c 20 20 20 20 61 64 64  20 20 20 20 20 72 31 2c  |.    add     r1,|
00002260  73 70 2c 23 34 20 2a 20  38 0d 01 2a 43 20 20 20  |sp,#4 * 8..*C   |
00002270  20 6c 64 6d 69 61 20 20  20 72 31 2c 7b 72 31 2d  | ldmia   r1,{r1-|
00002280  72 34 7d 20 20 20 20 20  20 3b 67 65 74 20 62 6f  |r4}      ;get bo|
00002290  75 6e 64 69 6e 67 20 62  6f 78 20 6f 66 20 77 69  |unding box of wi|
000022a0  6e 64 6f 77 20 6f 75 74  6c 69 6e 65 0d 01 2b 04  |ndow outline..+.|
000022b0  0d 01 2c 32 20 20 20 20  73 75 62 20 20 20 20 20  |..,2    sub     |
000022c0  72 33 2c 72 33 2c 72 31  20 20 20 20 20 20 20 20  |r3,r3,r1        |
000022d0  3b 72 33 20 3d 20 77 69  64 74 68 20 6f 66 20 62  |;r3 = width of b|
000022e0  6f 78 0d 01 2d 33 20 20  20 20 73 75 62 20 20 20  |ox..-3    sub   |
000022f0  20 20 72 34 2c 72 34 2c  72 32 20 20 20 20 20 20  |  r4,r4,r2      |
00002300  20 20 3b 72 34 20 3d 20  68 65 69 67 68 74 20 6f  |  ;r4 = height o|
00002310  66 20 62 6f 78 0d 01 2e  15 20 20 20 20 6d 6f 76  |f box....    mov|
00002320  20 20 20 20 20 72 30 2c  23 34 0d 01 2f 3b 20 20  |     r0,#4../;  |
00002330  20 20 73 77 69 20 20 20  20 20 22 58 4f 53 5f 50  |  swi     "XOS_P|
00002340  6c 6f 74 22 20 20 20 20  20 20 3b 6d 6f 76 65 20  |lot"      ;move |
00002350  74 6f 20 62 6f 74 74 6f  6d 20 6c 65 66 74 20 63  |to bottom left c|
00002360  6f 72 6e 65 72 0d 01 30  18 20 20 20 20 73 75 62  |orner..0.    sub|
00002370  20 20 20 20 20 72 33 2c  72 33 2c 23 31 0d 01 31  |     r3,r3,#1..1|
00002380  18 20 20 20 20 73 75 62  20 20 20 20 20 72 34 2c  |.    sub     r4,|
00002390  72 34 2c 23 31 0d 01 32  08 20 20 20 20 0d 01 33  |r4,#1..2.    ..3|
000023a0  30 20 20 20 20 3b 20 46  72 6f 6d 20 68 65 72 65  |0    ; From here|
000023b0  20 6f 6e 2c 20 61 6c 6c  20 63 6f 6f 72 64 73 20  | on, all coords |
000023c0  61 72 65 20 72 65 6c 61  74 69 76 65 2e 0d 01 34  |are relative...4|
000023d0  04 0d 01 35 1a 20 20 20  20 3b 20 50 6c 6f 74 20  |...5.    ; Plot |
000023e0  74 68 65 20 62 6f 72 64  65 72 2e 0d 01 36 04 0d  |the border...6..|
000023f0  01 37 31 20 20 20 20 6d  6f 76 20 20 20 20 20 72  |.71    mov     r|
00002400  30 2c 23 31 20 2b 20 38  20 20 20 20 20 20 20 3b  |0,#1 + 8       ;|
00002410  70 6c 6f 74 20 62 6f 74  74 6f 6d 20 65 64 67 65  |plot bottom edge|
00002420  0d 01 38 15 20 20 20 20  6d 6f 76 20 20 20 20 20  |..8.    mov     |
00002430  72 31 2c 72 33 0d 01 39  15 20 20 20 20 6d 6f 76  |r1,r3..9.    mov|
00002440  20 20 20 20 20 72 32 2c  23 30 0d 01 3a 1a 20 20  |     r2,#0..:.  |
00002450  20 20 73 77 69 20 20 20  20 20 22 58 4f 53 5f 50  |  swi     "XOS_P|
00002460  6c 6f 74 22 0d 01 3b 30  20 20 20 20 6d 6f 76 20  |lot"..;0    mov |
00002470  20 20 20 20 72 30 2c 23  31 20 2b 20 38 20 20 20  |    r0,#1 + 8   |
00002480  20 20 20 20 3b 70 6c 6f  74 20 72 69 67 68 74 20  |    ;plot right |
00002490  65 64 67 65 0d 01 3c 15  20 20 20 20 6d 6f 76 20  |edge..<.    mov |
000024a0  20 20 20 20 72 31 2c 23  30 0d 01 3d 15 20 20 20  |    r1,#0..=.   |
000024b0  20 6d 6f 76 20 20 20 20  20 72 32 2c 72 34 0d 01  | mov     r2,r4..|
000024c0  3e 1a 20 20 20 20 73 77  69 20 20 20 20 20 22 58  |>.    swi     "X|
000024d0  4f 53 5f 50 6c 6f 74 22  0d 01 3f 29 20 20 20 20  |OS_Plot"..?)    |
000024e0  6d 6f 76 20 20 20 20 20  72 30 2c 23 31 20 2b 20  |mov     r0,#1 + |
000024f0  38 20 20 20 20 20 20 20  3b 70 6c 6f 74 20 74 6f  |8       ;plot to|
00002500  70 0d 01 40 18 20 20 20  20 72 73 62 20 20 20 20  |p..@.    rsb    |
00002510  20 72 31 2c 72 33 2c 23  30 0d 01 41 15 20 20 20  | r1,r3,#0..A.   |
00002520  20 6d 6f 76 20 20 20 20  20 72 32 2c 23 30 0d 01  | mov     r2,#0..|
00002530  42 1a 20 20 20 20 73 77  69 20 20 20 20 20 22 58  |B.    swi     "X|
00002540  4f 53 5f 50 6c 6f 74 22  0d 01 43 2f 20 20 20 20  |OS_Plot"..C/    |
00002550  6d 6f 76 20 20 20 20 20  72 30 2c 23 31 20 2b 20  |mov     r0,#1 + |
00002560  38 20 20 20 20 20 20 20  3b 70 6c 6f 74 20 6c 65  |8       ;plot le|
00002570  66 74 20 65 64 67 65 0d  01 44 15 20 20 20 20 6d  |ft edge..D.    m|
00002580  6f 76 20 20 20 20 20 72  31 2c 23 30 0d 01 45 18  |ov     r1,#0..E.|
00002590  20 20 20 20 72 73 62 20  20 20 20 20 72 32 2c 72  |    rsb     r2,r|
000025a0  34 2c 23 30 0d 01 46 1a  20 20 20 20 73 77 69 20  |4,#0..F.    swi |
000025b0  20 20 20 20 22 58 4f 53  5f 50 6c 6f 74 22 0d 01  |    "XOS_Plot"..|
000025c0  47 04 0d 01 48 18 20 20  20 20 3b 20 44 72 61 77  |G...H.    ; Draw|
000025d0  20 74 68 65 20 67 72 69  64 2e 0d 01 49 35 20 20  | the grid...I5  |
000025e0  20 20 3b 20 47 72 61 70  68 69 63 73 20 63 75 72  |  ; Graphics cur|
000025f0  73 6f 72 20 69 73 20 62  61 63 6b 20 61 74 20 74  |sor is back at t|
00002600  68 65 20 62 6f 74 74 6f  6d 2d 6c 65 66 74 2e 0d  |he bottom-left..|
00002610  01 4a 39 20 20 20 20 3b  20 50 6c 6f 74 20 65 78  |.J9    ; Plot ex|
00002620  63 6c 75 64 69 6e 67 20  62 6f 74 68 20 65 6e 64  |cluding both end|
00002630  70 6f 69 6e 74 73 20 69  6e 20 61 6c 6c 20 6c 69  |points in all li|
00002640  6e 65 73 20 6e 6f 77 2e  0d 01 4b 04 0d 01 4c 3d  |nes now...K...L=|
00002650  20 20 20 20 3b 20 44 6f  20 72 35 20 3d 20 72 33  |    ; Do r5 = r3|
00002660  20 2f 20 33 20 74 6f 20  66 69 6e 64 20 74 68 65  | / 3 to find the|
00002670  20 68 6f 72 69 7a 6f 6e  74 61 6c 20 67 72 69 64  | horizontal grid|
00002680  20 73 70 61 63 69 6e 67  2e 0d 01 4d 04 0d 01 4e  | spacing...M...N|
00002690  16 20 20 20 20 6d 6f 76  20 20 20 20 20 72 30 2c  |.    mov     r0,|
000026a0  23 34 33 0d 01 4f 18 20  20 20 20 6d 75 6c 20 20  |#43..O.    mul  |
000026b0  20 20 20 72 31 2c 72 33  2c 72 30 0d 01 50 1b 20  |   r1,r3,r0..P. |
000026c0  20 20 20 6d 6f 76 20 20  20 20 20 72 35 2c 72 31  |   mov     r5,r1|
000026d0  2c 6c 73 72 23 37 0d 01  51 04 0d 01 52 25 20 20  |,lsr#7..Q...R%  |
000026e0  20 20 3b 20 50 6c 6f 74  20 74 68 65 20 74 77 6f  |  ; Plot the two|
000026f0  20 76 65 72 74 69 63 61  6c 20 62 61 72 73 2e 0d  | vertical bars..|
00002700  01 53 04 0d 01 54 2b 20  20 20 20 6d 6f 76 20 20  |.S...T+    mov  |
00002710  20 20 20 72 30 2c 23 30  20 2b 20 34 30 20 20 3b  |   r0,#0 + 40  ;|
00002720  20 6d 6f 76 65 20 72 65  6c 61 74 69 76 65 0d 01  | move relative..|
00002730  55 15 20 20 20 20 6d 6f  76 20 20 20 20 20 72 31  |U.    mov     r1|
00002740  2c 72 35 0d 01 56 15 20  20 20 20 6d 6f 76 20 20  |,r5..V.    mov  |
00002750  20 20 20 72 32 2c 23 30  0d 01 57 1a 20 20 20 20  |   r2,#0..W.    |
00002760  73 77 69 20 20 20 20 20  22 58 4f 53 5f 50 6c 6f  |swi     "XOS_Plo|
00002770  74 22 0d 01 58 2b 20 20  20 20 6d 6f 76 20 20 20  |t"..X+    mov   |
00002780  20 20 72 30 2c 23 31 20  2b 20 34 30 20 20 3b 20  |  r0,#1 + 40  ; |
00002790  70 6c 6f 74 20 72 65 6c  61 74 69 76 65 0d 01 59  |plot relative..Y|
000027a0  15 20 20 20 20 6d 6f 76  20 20 20 20 20 72 31 2c  |.    mov     r1,|
000027b0  23 30 0d 01 5a 15 20 20  20 20 6d 6f 76 20 20 20  |#0..Z.    mov   |
000027c0  20 20 72 32 2c 72 34 0d  01 5b 1a 20 20 20 20 73  |  r2,r4..[.    s|
000027d0  77 69 20 20 20 20 20 22  58 4f 53 5f 50 6c 6f 74  |wi     "XOS_Plot|
000027e0  22 0d 01 5c 2b 20 20 20  20 6d 6f 76 20 20 20 20  |"..\+    mov    |
000027f0  20 72 30 2c 23 30 20 2b  20 34 30 20 20 3b 20 6d  | r0,#0 + 40  ; m|
00002800  6f 76 65 20 72 65 6c 61  74 69 76 65 0d 01 5d 15  |ove relative..].|
00002810  20 20 20 20 6d 6f 76 20  20 20 20 20 72 31 2c 72  |    mov     r1,r|
00002820  35 0d 01 5e 15 20 20 20  20 6d 6f 76 20 20 20 20  |5..^.    mov    |
00002830  20 72 32 2c 23 30 0d 01  5f 1a 20 20 20 20 73 77  | r2,#0.._.    sw|
00002840  69 20 20 20 20 20 22 58  4f 53 5f 50 6c 6f 74 22  |i     "XOS_Plot"|
00002850  0d 01 60 2b 20 20 20 20  6d 6f 76 20 20 20 20 20  |..`+    mov     |
00002860  72 30 2c 23 31 20 2b 20  34 30 20 20 3b 20 70 6c  |r0,#1 + 40  ; pl|
00002870  6f 74 20 72 65 6c 61 74  69 76 65 0d 01 61 15 20  |ot relative..a. |
00002880  20 20 20 6d 6f 76 20 20  20 20 20 72 31 2c 23 30  |   mov     r1,#0|
00002890  0d 01 62 18 20 20 20 20  72 73 62 20 20 20 20 20  |..b.    rsb     |
000028a0  72 32 2c 72 34 2c 23 30  0d 01 63 1a 20 20 20 20  |r2,r4,#0..c.    |
000028b0  73 77 69 20 20 20 20 20  22 58 4f 53 5f 50 6c 6f  |swi     "XOS_Plo|
000028c0  74 22 0d 01 64 04 0d 01  65 27 20 20 20 20 3b 20  |t"..d...e'    ; |
000028d0  50 6c 6f 74 20 74 68 65  20 74 77 6f 20 68 6f 72  |Plot the two hor|
000028e0  69 7a 6f 6e 74 61 6c 20  62 61 72 73 2e 0d 01 66  |izontal bars...f|
000028f0  3b 20 20 20 20 3b 20 57  65 20 61 72 65 20 6e 6f  |;    ; We are no|
00002900  77 20 61 74 20 74 68 65  20 62 6f 74 74 6f 6d 20  |w at the bottom |
00002910  6f 66 20 74 68 65 20 72  69 67 68 74 20 69 6e 73  |of the right ins|
00002920  69 64 65 20 62 61 72 2e  0d 01 67 04 0d 01 68 18  |ide bar...g...h.|
00002930  20 20 20 20 72 73 62 20  20 20 20 20 72 31 2c 72  |    rsb     r1,r|
00002940  35 2c 23 30 0d 01 69 1b  20 20 20 20 6d 6f 76 20  |5,#0..i.    mov |
00002950  20 20 20 20 72 31 2c 72  31 2c 6c 73 6c 23 31 0d  |    r1,r1,lsl#1.|
00002960  01 6a 32 20 20 20 20 3b  20 44 6f 20 72 35 20 3d  |.j2    ; Do r5 =|
00002970  20 72 34 20 2f 20 33 20  74 6f 20 66 69 6e 64 20  | r4 / 3 to find |
00002980  76 65 72 74 69 63 61 6c  20 73 70 61 63 69 6e 67  |vertical spacing|
00002990  2e 0d 01 6b 16 20 20 20  20 6d 6f 76 20 20 20 20  |...k.    mov    |
000029a0  20 72 30 2c 23 34 33 0d  01 6c 18 20 20 20 20 6d  | r0,#43..l.    m|
000029b0  75 6c 20 20 20 20 20 72  32 2c 72 34 2c 72 30 0d  |ul     r2,r4,r0.|
000029c0  01 6d 1b 20 20 20 20 6d  6f 76 20 20 20 20 20 72  |.m.    mov     r|
000029d0  35 2c 72 32 2c 6c 73 72  23 37 0d 01 6e 15 20 20  |5,r2,lsr#7..n.  |
000029e0  20 20 6d 6f 76 20 20 20  20 20 72 32 2c 72 35 0d  |  mov     r2,r5.|
000029f0  01 6f 3e 20 20 20 20 6d  6f 76 20 20 20 20 20 72  |.o>    mov     r|
00002a00  30 2c 23 30 20 2b 20 34  30 20 20 3b 6d 6f 76 65  |0,#0 + 40  ;move|
00002a10  20 74 6f 20 6c 65 66 74  20 65 6e 64 20 6f 66 20  | to left end of |
00002a20  74 68 65 20 6c 6f 77 65  72 20 62 61 72 0d 01 70  |the lower bar..p|
00002a30  1a 20 20 20 20 73 77 69  20 20 20 20 20 22 58 4f  |.    swi     "XO|
00002a40  53 5f 50 6c 6f 74 22 0d  01 71 2b 20 20 20 20 6d  |S_Plot"..q+    m|
00002a50  6f 76 20 20 20 20 20 72  30 2c 23 31 20 2b 20 34  |ov     r0,#1 + 4|
00002a60  30 20 20 3b 70 6c 6f 74  20 6c 6f 77 65 72 20 62  |0  ;plot lower b|
00002a70  61 72 0d 01 72 15 20 20  20 20 6d 6f 76 20 20 20  |ar..r.    mov   |
00002a80  20 20 72 31 2c 72 33 0d  01 73 15 20 20 20 20 6d  |  r1,r3..s.    m|
00002a90  6f 76 20 20 20 20 20 72  32 2c 23 30 0d 01 74 1a  |ov     r2,#0..t.|
00002aa0  20 20 20 20 73 77 69 20  20 20 20 20 22 58 4f 53  |    swi     "XOS|
00002ab0  5f 50 6c 6f 74 22 0d 01  75 3b 20 20 20 20 6d 6f  |_Plot"..u;    mo|
00002ac0  76 20 20 20 20 20 72 30  2c 23 30 20 2b 20 34 30  |v     r0,#0 + 40|
00002ad0  20 20 3b 6d 6f 76 65 20  74 6f 20 72 69 67 68 74  |  ;move to right|
00002ae0  20 65 6e 64 20 6f 66 20  75 70 70 65 72 20 62 61  | end of upper ba|
00002af0  72 0d 01 76 15 20 20 20  20 6d 6f 76 20 20 20 20  |r..v.    mov    |
00002b00  20 72 31 2c 23 30 0d 01  77 15 20 20 20 20 6d 6f  | r1,#0..w.    mo|
00002b10  76 20 20 20 20 20 72 32  2c 72 35 0d 01 78 1a 20  |v     r2,r5..x. |
00002b20  20 20 20 73 77 69 20 20  20 20 20 22 58 4f 53 5f  |   swi     "XOS_|
00002b30  50 6c 6f 74 22 0d 01 79  2b 20 20 20 20 6d 6f 76  |Plot"..y+    mov|
00002b40  20 20 20 20 20 72 30 2c  23 31 20 2b 20 34 30 20  |     r0,#1 + 40 |
00002b50  20 3b 70 6c 6f 74 20 75  70 70 65 72 20 62 61 72  | ;plot upper bar|
00002b60  0d 01 7a 18 20 20 20 20  72 73 62 20 20 20 20 20  |..z.    rsb     |
00002b70  72 31 2c 72 33 2c 23 30  0d 01 7b 15 20 20 20 20  |r1,r3,#0..{.    |
00002b80  6d 6f 76 20 20 20 20 20  72 32 2c 23 30 0d 01 7c  |mov     r2,#0..||
00002b90  1a 20 20 20 20 73 77 69  20 20 20 20 20 22 58 4f  |.    swi     "XO|
00002ba0  53 5f 50 6c 6f 74 22 0d  01 7d 21 20 20 20 20 6c  |S_Plot"..}!    l|
00002bb0  64 6d 66 64 20 20 20 28  73 70 29 21 2c 7b 72 30  |dmfd   (sp)!,{r0|
00002bc0  2d 72 35 2c 70 63 7d 5e  0d 01 7e 07 20 20 5d 0d  |-r5,pc}^..~.  ].|
00002bd0  01 7f 08 ed 20 49 25 0d  01 80 05 e1 0d 01 81 04  |.... I%.........|
00002be0  0d ff                                             |..|
00002be2