home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / acorn / tech / 12 < prev    next >
Encoding:
Internet Message Format  |  1992-07-31  |  4.0 KB

  1. Path: sparky!uunet!comp.vuw.ac.nz!newshost.wcc.govt.nz!sideways!tornado!khantazi!banksie
  2. From: banksie@khantazi.welly.gen.nz (Philip R. Banks)
  3. Newsgroups: comp.sys.acorn.tech
  4. Subject: I got the EventV Blues.
  5. Keywords: EventV Problem HELP!
  6. Message-ID: <24A9nhj017n@khantazi.welly.gen.nz>
  7. Date: Sat, 1 Aug 1992 00:05:27 +1200
  8. Reply-To: banks_p@kosmos.wcc.govt.nz
  9. Organization: My Arc.
  10. Lines: 78
  11.  
  12.    I have an interesting problem with some event code I am working on. The
  13. problem is not so much that the code doesn't work at all but that it works
  14. under certain circumstances. You see I have some code designed to catch key
  15. and mouse events and do some processing of them. As the processing is a
  16. little complex I have to use a CallBack to do it.
  17.  
  18.    Now the code works when the machine is not *loaded* heavily. By this I
  19. mean I am not running a FS intensive/TaskWindow task. When the machine is
  20. heavily loaded (behavior exhibted on an A3000 and an A5000) mouse clicks get
  21. sluggish and sometimes are lost. The general effect is as if the mouse
  22. interupt code has been slowen down to about three quarters normal speed.
  23. Mouse double clicks are, when done at normal speed, quite often interpreted
  24. as single clicks. Drags persist for longer than they should and generally
  25. recognition of mouse events is slow.
  26.  
  27.    The code attaches itself to the EventV vector and is part of a module. As
  28. far as I can see all registers are safely preserved and I have minimised the
  29. work needed outside the callback, in the interupt code itself. The really
  30. strange thing about it is that keypress activity is completely unaffected.
  31. Can anyone see what I am doing that could be causing this problem? Or have I
  32. hit a hardware/software limitation? (Seems strange given that the code
  33. itself is fairly trivial.)
  34.  
  35. NB When run under RO2 IRQUtils 0.12 is loaded so CallBacks are functioning
  36. fine.
  37.  
  38. ---Code fragment begins---
  39. .EventV
  40.         STMFD   R13!,{R0-R5,R14}
  41.         MOV     R5,PC           ; Store current settings/processor mode
  42.         ORR     R4,R5,#3
  43.         TEQP    R4,#0           ; Enter SVC mode
  44.         MOV     R0,R0           ; NOP for contention purposes
  45.         STMFD   R13!,{R14}      ; Stack SVC mode link register
  46. .Event_mouse
  47.         TEQ     R0,#10           ; Is it a mouse event?
  48.         BNE     Event_key
  49.         TST     R3,#%111
  50.         BEQ     EventV_exit     ; Check for invalid mouse codes.
  51.         FNmvi(0,mouse_bl%,"")
  52.         TST     R3,#4            ; Select?
  53.         MOVNE   R1,R0
  54.         TST     R3,#2            ; Menu?
  55.         ADDNE   R1,R0,#blocksize%
  56.         TST     R3,#1            ; Adjust?
  57.         ADDNE   R1,R0,#blocksize%*2
  58.         ADR     R0,Event_callback
  59.         SWI     "XOS_AddCallBack"; Set up a callback to process event.
  60.         B       EventV_exit      ; Exit if no button was pressed
  61. .Event_key
  62.         TEQ     R0,#11           ; Is it a key event?
  63.         BNE     EventV_exit      ; So is it a mouse event?
  64.         TEQ     R1,#1            ; Is it a key DOWN event?
  65.         BNE     EventV_exit      ; Exit if no key was pressed
  66.         CMP     R2,#&67
  67.         BHI     EventV_exit      ; Exit if an invalid key code is given
  68.         FNmvi(0,key_bl%,"")
  69.         MOV     R3,#blocksize%
  70.         MUL     R1,R2,R3
  71.         ADD     R1,R0,R1
  72.         ADR     R0,Event_callback
  73.         SWI     "XOS_AddCallBack"; Set up a callback to process event.
  74. .EventV_exit
  75.         LDMFD   R13!,{R14}      ; Restore SVC mode link register
  76.         TEQP    R5,#0           ; Return to original mode
  77.         MOV     R0,R0           ; NOP for contention
  78.         LDMFD   R13!,{R0-R5,R14}; Restore Registers
  79.         MOVS    PC,R14          ; Pass on the call.
  80. ---Code fragment ends---
  81.  
  82.     Philip
  83.  
  84. --
  85. Philip R. Banks  Syntax: mail < banks_p@kosmos.wcc.govt.nz >            @@@@@/|
  86.                                                                         @@@@/#|
  87.                                                                         @@@/##|
  88. I breathe the air, While they're running in a rat race,                 @@/---|
  89. Way above it all, Standing on higher ground. ---A.P.P.                  @/    |
  90.