Commit 69d67881 authored by Ben Avison's avatar Ben Avison
Browse files

Commit of my Wimp changes that have trickled in over the last four months.

Detail:
  * The pointer passed to Wimp_CommandWindow can now be top-bit-set.
  * Bugfix to Wimp_CommandWindow: if the current task was uninitialised,
    or initialised as a non-multitasking task, then although entering the
    CommandWindow would restore escape condition generation to the way it
    was before entering the desktop, exiting the CommandWindow did not
    reset escape condition generation to the default desktop state (which is
    for escape condition generation to be disabled).
  * Escape condition generation is disabled for the duration of SWI
    Wimp_ReportError (instead of setting the default escape key for the
    duration). The previous state is restored on exit.
  * Added a minimal environment for the service call
    Service_ErrorButtonPressed, so that claimants can call OS_Exit without
    leaving the global Wimp error box in an undefined state.
  * In the Wimp_Poll loop, if there are no events to deliver to any tasks
    (not even null events), then rather than sitting in a SVC mode loop,
    the Wimp now triggers transient callbacks. This is particularly
    important in order not to halt all activity in the Internet stack.
    The option LeaveOS can be set to make the Wimp use the as-yet
    unimplemented SWI OS_LeaveOS for this purpose; this is currently unset
    for all builds.
  * By (persistent) request, reinstated the old iconbar popping code,
    though it is currently a build switch that is turned off for all builds.
Admin:
  Tested on a Risc PC.

Version 4.69. Tagged as 'Wimp-4_69'
parent 468babda
......@@ -51,6 +51,7 @@
Option NKmessages2, true ; message queue optimisation
; (remove multiple memory change messages)
Option UseAMBControl, true ; delegate task memory management to OS_AMBControl
Option UseLeaveOS, false ; is SWI OS_LeaveOS available on this kernel?
Option StrongARM, true
Option FPE4, true ; assume FPE 4.00 or later present
Option TrueIcon1, true ; true colour support, phase 1
......@@ -58,6 +59,7 @@
Option TrueIcon3, true :LAND: TrueIcon2 ; true colour support, phase 3 (windows)
; Icon bar pops to front when pointer
Option PoppingIconBar, true:LAND::LNOT:DisableShiftF12 ; at bottom of screen
Option OldStyleIconBar, false ; Shift F12 behaviour like RISC OS <= 3.7
Option IconiseButton, false ; Windows given iconise button
Option ChocolateScreen, false ; Clean cached screen after redraw loops
Option KernelLocksFreePool, false ; use OS_Memory 10 to lock Free Pool for Wimp_ClaimFreeMemory
......
......@@ -11,14 +11,14 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "4.68"
Module_Version SETA 468
Module_MajorVersion SETS "4.69"
Module_Version SETA 469
Module_MinorVersion SETS ""
Module_Date SETS "13 Jul 2001"
Module_ApplicationDate2 SETS "13-Jul-01"
Module_ApplicationDate4 SETS "13-Jul-2001"
Module_Date SETS "14 Sep 2001"
Module_ApplicationDate2 SETS "14-Sep-01"
Module_ApplicationDate4 SETS "14-Sep-2001"
Module_ComponentName SETS "Wimp"
Module_ComponentPath SETS "RiscOS/Sources/Desktop/Wimp"
Module_FullVersion SETS "4.68"
Module_HelpVersion SETS "4.68 (13 Jul 2001)"
Module_FullVersion SETS "4.69"
Module_HelpVersion SETS "4.69 (14 Sep 2001)"
END
/* (4.68)
/* (4.69)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 4.68
#define Module_MajorVersion_CMHG 4.69
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 Jul 2001
#define Module_Date_CMHG 14 Sep 2001
#define Module_MajorVersion "4.68"
#define Module_Version 468
#define Module_MajorVersion "4.69"
#define Module_Version 469
#define Module_MinorVersion ""
#define Module_Date "13 Jul 2001"
#define Module_Date "14 Sep 2001"
#define Module_ApplicationDate2 "13-Jul-01"
#define Module_ApplicationDate4 "13-Jul-2001"
#define Module_ApplicationDate2 "14-Sep-01"
#define Module_ApplicationDate4 "14-Sep-2001"
#define Module_ComponentName "Wimp"
#define Module_ComponentPath "RiscOS/Sources/Desktop/Wimp"
#define Module_FullVersion "4.68"
#define Module_HelpVersion "4.68 (13 Jul 2001)"
#define Module_FullVersion "4.69"
#define Module_HelpVersion "4.69 (14 Sep 2001)"
#define Module_LibraryVersionInfo "4:69"
......@@ -1375,7 +1375,9 @@ pop_Back * 0
pop_Delaying * 1
pop_Front * 2
pop_HeldByMenu * 3
[ :LNOT: OldStyleIconBar
pop_Front2 * 4 ; held by virtue of Shift-F12
]
]
[ ChildWindows
......@@ -1433,6 +1435,9 @@ misc # 1
save_context # 4
fontnamebuffer # 60 ; used to store last ROM font.
[ PoppingIconBar :LAND: OldStyleIconBar
iconbar_pop_previous # 4 ; where to go back to
]
[ DebugMemory
memory_claims # 8 ; build a list of mem claims for debugging
......@@ -1471,6 +1476,10 @@ ptrpreserveflag # 4 ; 0 => position pointer over default err
; 1 => don't move pointer on box start
]
[ ErrorServiceCall
errorbuttonoldhandlers # 3*3*4 ; old environment handlers to restore afterwards
]
maxwork * :INDEX:@
! 0, "Free pool = R12+&" :CC: :STR: :INDEX: freepool
......@@ -5038,8 +5047,10 @@ int_commandwindow
BL checkhandle ; give up now!
Pull "R7,PC",VS
;
CMP R0, #0
CMPNE R0, #-1
BEQ releasewrch ; R0 = 0 or -1 ==> remove window
CMP R0,#1
BLT releasewrch ; R0 <= 0 ==> remove window
BEQ treatasactive ; R0 = 1 ==> treat as open
;
LDR R14,[handle,#w_titleflags]
......@@ -5099,6 +5110,19 @@ restorekeys_withescape
;
Pull "PC"
resetkeys_withescape
Push "LR"
;
LDR R14,singletaskhandle ; FORCE escape to be re-disabled
Push "R14"
MOV R14,#nullptr
STR R14,singletaskhandle
BL resetkeycodes ; also re-disable escape after temporary restoration
Pull "R14"
STR R14,singletaskhandle
;
Pull "PC"
execcom2 DCB "Exec",0
ALIGN
......@@ -5116,7 +5140,7 @@ releasewrch
ADR R0,execcom2 ; cancel exec file (just in case)
SWI XOS_CLI ; cf. Wimp_ReportError
ADRL R3,tempiconblk
BL resetkeycodes ; back to normal
BL resetkeys_withescape ; back to normal
MOV R0,#WrchV ; doesn't matter if released
ADR R1,mywrch ; already!
MOV R2,wsptr
......@@ -5128,9 +5152,9 @@ releasewrch
;
[ :LNOT: NoCommandPrompt ; always do this quietly
;
CMP R0,#0 ; R0 < 0 ==> do this quietly
CMP R0,#-1 ; R0 = -1 ==> do this quietly
;
BLT %FT01
BEQ %FT01
Push "r2,r3"
SWI XOS_NewLine
......@@ -5145,8 +5169,8 @@ releasewrch
SWI XOS_NewLine
Pull "r2,r3"
;
BL waitforkey
01
BLGE waitforkey
;
] ; :LNOT: NoCommandPrompt
;
......
......@@ -5320,7 +5320,7 @@ openfinished
BIC R14,R14,#ws_onscreenonce ; only cancel this on Open_Window
STR R14,[handle,#w_flags] ; (not on Set_Extent)
;
[ PoppingIconBar
[ PoppingIconBar :LAND: :LNOT: OldStyleIconBar
LDR R14, iconbar_pop_state ; don't bother if already at back
TEQ R14, #pop_Front
TEQNE R14, #pop_HeldByMenu
......
......@@ -1177,8 +1177,12 @@ checkiconbarpop
B %F10
B %F20
B %F30
[ OldStyleIconBar
; Icon bar is held by menu
|
NOP ; drops through
; Icon bar is held by menu, or fronted by keyboard
]
Pull "R0,PC"
; Icon bar is at back
......@@ -1256,7 +1260,7 @@ checkiconbarpop
TEQ R0,#0
BNE %FT60
; Going to front. Remember where to go back to.
[ false
[ OldStyleIconBar
TST R14,#wf_backwindow
MOVNE R6,#-2
LDREQ R6,[handle,#w_bhandle]
......@@ -1269,7 +1273,7 @@ checkiconbarpop
B %FT65
60 ; Going back to previous position.
[ false
[ OldStyleIconBar
ADRL R6,iconbar_pop_previous
LDR R6,[R6]
CMP R6,#-2
......@@ -2824,7 +2828,7 @@ check_null
02
SUBS R6,R6,#1
BNE %BT01
B repollwimp ; no 'null return' tasks
B triggercallbacks ; no 'null return' tasks
returnnull
......@@ -2839,10 +2843,27 @@ returnnull
nullexit
LDR R14,flagword ; single-tasking exit
TST R14,#null_bit
BNE repollwimp
BNE triggercallbacks
MOV R0,#No_Reason ; null reason code
B ExitPoll
triggercallbacks
; No null events to deliver, so try triggering callbacks
[ UseLeaveOS
SWI XOS_LeaveOS
|
[ Medusa
MRS r0, CPSR
BIC r0, r0, #&F ; drop to same 32-bitness of USR mode
MSR CPSR_c, r0
|
TEQP pc, #0
NOP
]
SWI XOS_IntOn ; callbacks will be triggered on exit
]
SWI XOS_EnterOS
B repollwimp
;-----------------------------------------------------------
; Remove task from list of tasks with pollwords
......
......@@ -1541,7 +1541,7 @@ defaultkey
BLE %FT01
BL checkhandle ; handle -> window block
[ PoppingIconBar
[ PoppingIconBar :LAND: :LNOT: OldStyleIconBar
LDRVC R14, iconbar_pop_state
TEQ R14, #pop_Back
TEQNE R14, #pop_Delaying
......
......@@ -1647,14 +1647,14 @@ useerrorwindow
Pull "R4-R7" ; R4-R7 = original R0-R3
BLEQ starterrorbox
MOV R0, #220 ; Read current escape key so we can restore it later
MOV R0, #229 ; Read current escape condition enable state so we can restore it later
MOV R1, #0
MOV R2, #255
SWI XOS_Byte
STRB r1, old_escape
MOV R0, #220 ; Set default escape key
MOV R1, #27
MOV R0, #229 ; Disable escape conditions (Wimp hasn't actually checked for them for a long time)
MOV R1, #1
MOV R2, #0
SWI XOS_Byte
;
......@@ -1795,14 +1795,17 @@ finisherror
]
[ ErrorServiceCall
BL InstallErrorButtonPressedHandlers
MOV R2,R1
MOV R0,#0
LDR R1,=Service_ErrorButtonPressed
LDR R3,tempworkspace+errtws_buttonlist
SWI XOS_ServiceCall
BL RemoveErrorButtonPressedHandlers
CMP R0,#0
BEQ servicecallend
; module wants error dialog redisplayed
redisplayerrorbox
LDMIA R2!,{R4-R7}
LDMIA R2,{R1-R2}
ADR R3,tempworkspace+errtws_spritearea ; also updates errtws_buttonlist
......@@ -1859,6 +1862,7 @@ servicecallend
;
; tidy up afterwards
;
tidyupaftererror
BL losewindowrects ; just in case - don't lose memory!
ADR R6,errorstack-14*4 ; this is where we put it previously
......@@ -1924,7 +1928,7 @@ ReportError_restored_font_colours
STR R0, [R14] ; move the pointer the next time the error box is opened
]
MOV R0, #220 ; restore the old escape key
MOV R0, #229 ; restore the old escape condition disable state
LDRB R1, old_escape
MOV R2, #0
SWI XOS_Byte
......@@ -1962,6 +1966,74 @@ notoveryet
NOP
B pollit
[ ErrorServiceCall
InstallErrorButtonPressedHandlers
; Install Exit, Error and UpCall_NewApplication handlers for Service_ErrorButtonPressed client
Entry "R0-R4"
ADRL R4, errorbuttonoldhandlers
MOV R0, #ExitHandler
ADR R1, ErrorButtonExitHandler
MOV R2, R12
SWI XOS_ChangeEnvironment
STMIA R4!, {R1-R3}
MOV R0, #ErrorHandler
ADR R1, ErrorButtonErrorHandler
MOV R2, R12
ADRL R3, watchdogerror ; since errorbox_open is set, this won't be used by "App may have gone wrong"
SWI XOS_ChangeEnvironment
STMIA R4!, {R1-R3}
MOV R0, #UpCallHandler
ADR R1, ErrorButtonUpCallHandler
MOV R2, R12
SWI XOS_ChangeEnvironment
STMIA R4!, {R1-R3}
EXIT
RemoveErrorButtonPressedHandlers
; Remove handlers installed in InstallErrorButtonPressedHandlers
Entry "R0-R4"
ADRL R4, errorbuttonoldhandlers
MOV R0, #ExitHandler
LDMIA R4!, {R1-R3}
SWI XOS_ChangeEnvironment
MOV R0, #ErrorHandler
LDMIA R4!, {R1-R3}
SWI XOS_ChangeEnvironment
MOV R0, #UpCallHandler
LDMIA R4!, {R1-R3}
SWI XOS_ChangeEnvironment
EXIT
ErrorButtonErrorHandler
; This shouldn't ever be called, but if it is, then the SVC stack has been flattened,
; so we can't realistically continue execution afterwards; we also can't use an error
; box to display the message, since one is already open. So just print the message,
; then drop through the exit handler to tidy up the old error box.
MOV R12, R0
ADRL R0, watchdogerror + 8 ; skip the PC word and error number
SWI XOS_Write0
SWI XOS_NewLine
; drop through...
ErrorButtonExitHandler
SWI XOS_EnterOS ; we need a stack
BL RemoveErrorButtonPressedHandlers
LDR R1, =Service_ErrorEnding
MOV R2, #2 ; fake a "Cancel" button for the purposes of this service call
SWI XOS_ServiceCall
; SVC stack has been flattened by OS_Exit, but the rest of the error box code
; assumes it can use the word at sp_svc to hold the R1 value to pass back from
; Wimp_ReportError. Use the top word of the SVC stack for this purpose instead -
; it'll be flattened again when *we* call OS_Exit.
MOV R1, #99 ; re-use magic value that causes OS_Exit to be called
Push "R1"
B tidyupaftererror
ErrorButtonUpCallHandler
TEQ R0, #UpCall_NewApplication
MOVEQ R0, #0 ; deny new application
MOV PC, R14
]
LTORG
MACRO
......
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