Commit 476aafa4 authored by Steve Revill's avatar Steve Revill
Browse files

Faster TaskWindow from Dan Ellis.

Details:
>
> I was just fiddling with Taskwindow, and realising one of the big things
> slowing it down is that it polls everytime its internal buffer gets filled.
> If it just lets the Wimp do the queueing it goes quite a lot faster!
>
> It only polls the wimp once every 10 buffer fulls of data, so is pretty
> nippy, but doesn't stall when doing a lot of text output in SVC mode.
>
> It also assembles to use TickerV instead of VSync (unless you unset the
> flag).
>
Admin:
  Tested on Ursula RiscPC and STB without any problems.

Version 0.68. Tagged as 'TaskWindow-0_68'
parent 711c6de8
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.62.
;
GBLS Module_MajorVersion
GBLA Module_Version
......@@ -11,14 +12,14 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.67"
Module_Version SETA 67
Module_MajorVersion SETS "0.68"
Module_Version SETA 68
Module_MinorVersion SETS ""
Module_Date SETS "28 Sep 2001"
Module_ApplicationDate2 SETS "28-Sep-01"
Module_ApplicationDate4 SETS "28-Sep-2001"
Module_Date SETS "18 Feb 2002"
Module_ApplicationDate2 SETS "18-Feb-02"
Module_ApplicationDate4 SETS "18-Feb-2002"
Module_ComponentName SETS "TaskWindow"
Module_ComponentPath SETS "RiscOS/Sources/Desktop/TaskWindow"
Module_FullVersion SETS "0.67"
Module_HelpVersion SETS "0.67 (28 Sep 2001)"
Module_FullVersion SETS "0.68"
Module_HelpVersion SETS "0.68 (18 Feb 2002)"
END
/* (0.67)
/* (0.68)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.62.
*
*/
#define Module_MajorVersion_CMHG 0.67
#define Module_MajorVersion_CMHG 0.68
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Sep 2001
#define Module_Date_CMHG 18 Feb 2002
#define Module_MajorVersion "0.67"
#define Module_Version 67
#define Module_MajorVersion "0.68"
#define Module_Version 68
#define Module_MinorVersion ""
#define Module_Date "28 Sep 2001"
#define Module_Date "18 Feb 2002"
#define Module_ApplicationDate2 "28-Sep-01"
#define Module_ApplicationDate4 "28-Sep-2001"
#define Module_ApplicationDate2 "18-Feb-02"
#define Module_ApplicationDate4 "18-Feb-2002"
#define Module_ComponentName "TaskWindow"
#define Module_ComponentPath "RiscOS/Sources/Desktop/TaskWindow"
#define Module_FullVersion "0.67"
#define Module_HelpVersion "0.67 (28 Sep 2001)"
#define Module_LibraryVersionInfo "0:67"
#define Module_FullVersion "0.68"
#define Module_HelpVersion "0.68 (18 Feb 2002)"
#define Module_LibraryVersionInfo "0:68"
......@@ -235,6 +235,9 @@ PollIdleHandling SETL {TRUE}
GBLL NiceNess
NiceNess SETL {TRUE}
GBLL UseTickerV
UseTickerV SETL {TRUE}
GBLA WimpVersion
WimpVersion SETA 300
......@@ -437,7 +440,9 @@ Code_TaskWindowHelp
DCB HSP,HSP,"-ctrl allows control characters through",CR,LF
DCB HSP,HSP,"-display opens the task window immediately, rather than waiting for a character to be printed",CR,LF
DCB HSP,HSP,"-quit makes the task quit after the command even if the task window has been opened",CR,LF
[ NiceNess
DCB HSP,HSP,"-nice alters number of timeslices given to task",CR,LF
]
DCB "Note that fields must be in "" "" if they comprise more than one word"
DCB 0
......@@ -1080,7 +1085,7 @@ Code_WimpStartError ROUT
MOV r1, #6 ; Provide Cancel, not OK, and highlight
SWI XWimp_ReportError ; Say what happened
BL Unlink ; Get rid of memory
SWI Wimp_CloseDown ; No more wimp
SWI XWimp_CloseDown ; No more wimp
SWI OS_Exit ; Dead
taskwindowname
......@@ -1736,7 +1741,11 @@ inittask ROUT
SWI OS_Claim ; Claim ByteV. What about errors?
MOV r0, #1
STR r0, GotByteV
[ UseTickerV
MOV r0, #TickerV
|
MOV r0, #EventV
]
ADRL r1, MyEventV
LDR r2, GlobalWS ; Enter with r12 -> global workspace
......@@ -1753,6 +1762,7 @@ inittask ROUT
60
MOV r0, #0
STR r0, VSyncCount
STR r0, OutputCount
STR r0, PassOnVectors ; Got em
STR r0, Moribund ; Not dying yet
STR r0, Suspended ; Nor are we suspended
......@@ -1780,11 +1790,14 @@ inittask ROUT
STRB r1, TaskEscape ; Remember escape state of caller
CheckPointers
[ Preempt
[ UseTickerV
|
LDR r0, NextBlock
TEQ r0, #0
MOVEQ r0, #EventEnable
MOVEQ r1, #Event_VSync
SWIEQ OS_Byte ; Enable VSync event
]
]
;
; If -display was specified, obtain a parent task before proceeding
......@@ -2435,9 +2448,12 @@ star_prompt
LDR r0, [r0, #:INDEX: NextBlock]
TEQ r0, #0 ; 0 <=> this is the last block
BNE %f40
[ UseTickerV
|
MOV r0, #EventDisable
MOV r1, #Event_VSync
SWI OS_Byte ; Stop VSync
]
LDR r0, GotWrchV
TEQ r0, #0
......@@ -2480,7 +2496,11 @@ star_prompt
MOV r0, #0
STRNE r0, GotEventV
LDRNE r2, GlobalWS
[ UseTickerV
MOVNE r0, #TickerV
|
MOVNE r0, #EventV
]
ADRNE r1, MyEventV
SWINE OS_Release
......@@ -2521,8 +2541,11 @@ MyEventV ROUT
;
; Exit:- All registers preserved
;
[ UseTickerV
|
TEQ r0, #Event_VSync ; Is it the one I want?
MOVNE pc, r14 ; Return if not
]
;
; Now decrement all Inkey counts for all instances
;
......@@ -2561,7 +2584,10 @@ MyEventV ROUT
]
MOVCS r0, #0
STR r0, VSyncCount
[ UseTickerV
|
MOV r0, #Event_VSync
]
MOVCC pc, r14 ; Return if not
;
; Now set up a callback handler ready
......@@ -2654,7 +2680,10 @@ R1R = "R1 in ROM > &3800000", 0
MOV r0, #0
STR r0, PassOnVectors ; Back on vectors again
30
[ UseTickerV
|
MOV r0, #Event_VSync
]
MOV pc, r14 ; And return anyway
......@@ -2810,9 +2839,17 @@ notcontrol
BL SendOutput ; Send buffer if full
BL Insert ; And put the character in
;
; Then poll wimp to allow other coroutines a chance
; Then poll wimp to allow other coroutines a chance if we are ready
;
LDR lr, OutputCount
ADD lr, lr, #1
CMP lr, #10
MOVGE lr, #0
STR lr, OutputCount
BLT %f10 ; Only poll every 10 buffer fulls
MOV r0, #0 ; Allow nulls
STR r0, VSyncCount
[ PollIdleHandling
MOV r2, #0 ; no wait
]
......@@ -3334,7 +3371,10 @@ MyByteV ROUT
AND r2, r2, #&FF
ORR r0, r0, r2, LSL #8; Get count value
ADD r0, r0, #1 ; Ensure count 1 not treated as zero
[ UseTickerV
|
MOV r0, r0, LSR #1 ; Divide by two for use with VSync
]
STR r0, InkeyCount
; See if any input has arrived for us
......@@ -3402,7 +3442,7 @@ MyByteV ROUT
; at this stage we need a text buffer
;
BL GetParentTask
BVS %f25 ; should pass error out
; BVS %f25 ; should pass error out
;
; We're waiting, so empty output buffer
;
......@@ -3414,7 +3454,11 @@ MyByteV ROUT
[ PollIdleHandling
SWI XOS_ReadMonotonicTime
LDR r2, InkeyCount
[ UseTickerV
ADD r2, r0, r2
|
ADD r2, r0, r2, LSL#1
]
]
MOV r0, #0 ; Allow nulls (else we never time out!)
......@@ -4390,6 +4434,7 @@ grotpollwimp
|
SWI XWimp_Poll
]
[ FPErrorHandling
Pull "r12" ; My r12 back
;
......@@ -4397,6 +4442,8 @@ grotpollwimp
;
SavePSR r1
Push "r0, r1" ; Save flags plus wimp result
MOV r0, #ErrorHandler
ADR r1, PreErrorHandler
LDMIA r1, {r1-r3}
......@@ -5403,6 +5450,7 @@ VSyncCount Word
[ NiceNess
Nice Word
]
OutputCount Word
GlobalWS Word ; Address of our global workspace block
MyParameters Word
SoftKeyDollar Word 2 ; Where to put Key$n
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment