RectFilter 2.22 KB
Newer Older
Kevin Bracey's avatar
Kevin Bracey committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
; Copyright 1997 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
;     http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; > s.rectFilter

;;----------------------------------------------------------------
;; rect_filter_handler
;;
;; This is called by the Wimp on entry to int_get_rectangle
;;
;; Entry:
;;
;;      R2 - Task handle of calling task.
;;
;; Exit:
;;
;;      All other registers preserved.
;;
;;      All interested filters called.
;;
;;

rect_filter_handler

        Push    "r0-r2,LR"		; If you change this, change the
					; sortout_fakepostrect routine
        MOV     R2,R2,ASL #16
        MOV     R2,R2,LSR #16

Stewart Brodie's avatar
Stewart Brodie committed
41
        [ :LNOT: No26bitCode
Kevin Bracey's avatar
Kevin Bracey committed
42 43 44 45 46
        LDR	LR, fake_postrect	; If we're faking post-rectangle
	TEQ	LR, #0			; filters, and we have any
	LDRNE	LR, post_rect_filters	; claimants, go poke the
	TEQNE	LR, #0			; Window Manager's stack
	BLNE	sortout_fakepostrect
Stewart Brodie's avatar
Stewart Brodie committed
47
        ]
Kevin Bracey's avatar
Kevin Bracey committed
48

49 50 51
        LDR     r0, get_handle_from_r10 ; find the window being redrawn
        TEQ     r0, #0
        LDREQ   r0, [sp,#16+12+0]	; BTW - you didn't see that...
52 53
        Rel     r0,r0,EQ
        Rel     r0,r10,NE               ; turn pointer into window handle
54

Kevin Bracey's avatar
Kevin Bracey committed
55 56 57
        LDR     r1,rect_filters
rect_filter_exit
        CMP     r1,#0
58
      [ No26bitCode
Stewart Brodie's avatar
Stewart Brodie committed
59
        Pull    "r0-r2,PC",EQ            ; End of list.
60 61 62
      |
        Pull    "r0-r2,PC",EQ,^          ; End of list.
      ]
Kevin Bracey's avatar
Kevin Bracey committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
        LDR     r14,[r1,#next_ptr]
        Push    "r14"

        LDR     r14,[r1,#f_task]
        TEQ     r14,R2
        CMPNE   r14,#0
        Pull    "r1",NE
        BNE     rect_filter_exit        ; Filter not interested.

        LDR     r12,[r1,#f_R12]        ; Set R12.

        MOV     LR,PC
        LDR     PC, [r1,#f_address]
        NOP
        Pull    "r1"
        B       rect_filter_exit
Robert Sprowson's avatar
Robert Sprowson committed
79 80

        LNK     PoRtFilter.s
Kevin Bracey's avatar
Kevin Bracey committed
81 82